Revision: 201001
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 18 Jan 2010 20:18:27 +0200
changeset 0 5f000ab63145
child 1 838b0a10d15b
child 2 aa12ff35878a
Revision: 201001 Kit: 201003
group/bld.inf
layers.sysdef.xml
package_definition.xml
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_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_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_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/phoneui/aif/phoneuiaif.rss
phoneapp/phoneui/group/bld.inf
phoneapp/phoneui/group/commonphoneapp_icons_aif_bitmaps.mk
phoneapp/phoneui/group/commonphoneapp_icons_aif_scalable.mk
phoneapp/phoneui/group/commonphoneapp_icons_scalable.mk
phoneapp/phoneui/group/iconlist.txt
phoneapp/phoneui/group/phoneui.mmp
phoneapp/phoneui/group/phoneui_stub.pkg
phoneapp/phoneui/group/phoneui_stub.sis
phoneapp/phoneui/help/data/xhtml.zip
phoneapp/phoneui/help/group/bld.inf
phoneapp/phoneui/help/inc/incl.hlp.hrh
phoneapp/phoneui/help/rom/phoneuihelps_variant.iby
phoneapp/phoneui/inc/cphoneapplication.h
phoneapp/phoneui/inc/cphoneappui.h
phoneapp/phoneui/inc/cphonedocument.h
phoneapp/phoneui/loc/basiccallhandling.loc
phoneapp/phoneui/loc/callheadertexts.loc
phoneapp/phoneui/loc/callterminationnote.loc
phoneapp/phoneui/loc/dialer.loc
phoneapp/phoneui/loc/dtmfsignalling.loc
phoneapp/phoneui/loc/incallmenuandsoftkeys.loc
phoneapp/phoneui/loc/incalloperations.loc
phoneapp/phoneui/loc/mobileoriginatedcalls.loc
phoneapp/phoneui/loc/multicallhandling.loc
phoneapp/phoneui/loc/numberentry.loc
phoneapp/phoneui/loc/phone.loc
phoneapp/phoneui/loc/voip.loc
phoneapp/phoneui/rom/phoneui.iby
phoneapp/phoneui/rom/phoneuiresources.iby
phoneapp/phoneui/rom/phoneuiresourcesvoip.iby
phoneapp/phoneui/src/cphoneapplication.cpp
phoneapp/phoneui/src/cphoneappui.cpp
phoneapp/phoneui/src/cphonedocument.cpp
phoneapp/phoneui/srcdata/callhandlingui.rss
phoneapp/phoneui/srcdata/phoneui.hrh
phoneapp/phoneui/srcdata/phoneui.pan
phoneapp/phoneui/srcdata/phoneui.rh
phoneapp/phoneui/srcdata/phoneui.rss
phoneapp/phoneui/srcdata/phoneui_reg.rss
phoneapp/phoneui/srcdata/phoneuitouch.rss
phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/Bmarm/3dringingtoneinterface_testsU.DEF
phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/Bwins/3dringingtoneinterface_testsU.DEF
phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/EABI/3dringingtoneinterface_testsU.def
phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/group/3dringingtoneinterface_tests.mmp
phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/group/3dringingtoneinterface_tests.pkg
phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/group/3dringingtoneinterface_tests.sis
phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/group/bld.inf
phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/inc/3dringingtoneinterface_tests.h
phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/init/3dringingtoneinterface_tests.ini
phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/src/3dringingtoneinterface_tests.cpp
phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/src/3dringingtoneinterface_testsCases.cpp
phoneapp/phoneui/tsrc/public/basic/group/bld.inf
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/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/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/phoneuiview/bwins/phoneuiviewu.def
phoneapp/phoneuiview/eabi/phoneuiviewu.def
phoneapp/phoneuiview/group/bld.inf
phoneapp/phoneuiview/group/phoneuiview.mmp
phoneapp/phoneuiview/group/phoneuiview_stub.pkg
phoneapp/phoneuiview/group/phoneuiview_stub.sis
phoneapp/phoneuiview/inc/c3dringingtoneinterface.h
phoneapp/phoneuiview/inc/c3dringingtoneinterface.inl
phoneapp/phoneuiview/inc/cphoneapplicationexit.h
phoneapp/phoneuiview/inc/cphoneaudiocontroller.h
phoneapp/phoneuiview/inc/cphoneaudioplayer.h
phoneapp/phoneuiview/inc/cphonebubblemapping.h
phoneapp/phoneuiview/inc/cphonebubblewrapper.h
phoneapp/phoneuiview/inc/cphonebuttonscontroller.h
phoneapp/phoneuiview/inc/cphonecallheadertextanimation.h
phoneapp/phoneuiview/inc/cphonecontactcontroller.h
phoneapp/phoneuiview/inc/cphonedialercontroller.h
phoneapp/phoneuiview/inc/cphonedialercontroller.inl
phoneapp/phoneuiview/inc/cphonedialerview.h
phoneapp/phoneuiview/inc/cphonedtmfnumberlistquery.h
phoneapp/phoneuiview/inc/cphonedtmfsendingnote.h
phoneapp/phoneuiview/inc/cphoneincallindicator.h
phoneapp/phoneuiview/inc/cphonekeycapturecontroller.h
phoneapp/phoneuiview/inc/cphonelistquerydialog.h
phoneapp/phoneuiview/inc/cphonemenucontroller.h
phoneapp/phoneuiview/inc/cphonenote.h
phoneapp/phoneuiview/inc/cphonenotecontroller.h
phoneapp/phoneuiview/inc/cphonenumberentry.h
phoneapp/phoneuiview/inc/cphoneprogressnote.h
phoneapp/phoneuiview/inc/cphonequerycontroller.h
phoneapp/phoneuiview/inc/cphonequerydialog.h
phoneapp/phoneuiview/inc/cphoneringingtone.h
phoneapp/phoneuiview/inc/cphoneringingtoneplayerao.h
phoneapp/phoneuiview/inc/cphonesingleitemfetch.h
phoneapp/phoneuiview/inc/cphonestatuspane.h
phoneapp/phoneuiview/inc/cphonetextquery.h
phoneapp/phoneuiview/inc/cphonetoolbarcontroller.h
phoneapp/phoneuiview/inc/cphoneuidisablednote.h
phoneapp/phoneuiview/inc/cphonevideoplayer.h
phoneapp/phoneuiview/inc/cphoneview.h
phoneapp/phoneuiview/inc/cphoneviewcontroller.h
phoneapp/phoneuiview/inc/cphonevmbxhandler.h
phoneapp/phoneuiview/inc/mphoneaudioplayerobserver.h
phoneapp/phoneuiview/inc/mphonebuttoncustomization.h
phoneapp/phoneuiview/inc/mphonecoveruiobserver.h
phoneapp/phoneuiview/inc/mphonedialercontroller.h
phoneapp/phoneuiview/inc/mphonedisplayprovider.h
phoneapp/phoneuiview/inc/mphonenumberentry.h
phoneapp/phoneuiview/inc/mphonenumberentrychangedhandler.h
phoneapp/phoneuiview/inc/mphonequeryobserver.h
phoneapp/phoneuiview/inc/mphoneringingtoneobserver.h
phoneapp/phoneuiview/inc/mphonestatuspane.h
phoneapp/phoneuiview/inc/mphonestatuspaneobserver.h
phoneapp/phoneuiview/inc/mphonevideoplayer.h
phoneapp/phoneuiview/inc/mphonevideoplayerobserver.h
phoneapp/phoneuiview/inc/mphoneviewblockingdialogobserver.h
phoneapp/phoneuiview/inc/mphoneviewcommandhandle.h
phoneapp/phoneuiview/inc/mphoneviewcustomization.h
phoneapp/phoneuiview/inc/mphoneviewobserver.h
phoneapp/phoneuiview/inc/phonebubbleextension.h
phoneapp/phoneuiview/inc/phonebubbleextensiondata.h
phoneapp/phoneuiview/inc/phonebubbleextensionmanager.h
phoneapp/phoneuiview/inc/phoneviewcommanddefinitions.h
phoneapp/phoneuiview/src/cphoneapplicationexit.cpp
phoneapp/phoneuiview/src/cphoneaudiocontroller.cpp
phoneapp/phoneuiview/src/cphoneaudioplayer.cpp
phoneapp/phoneuiview/src/cphonebubblemapping.cpp
phoneapp/phoneuiview/src/cphonebubblewrapper.cpp
phoneapp/phoneuiview/src/cphonebuttonscontroller.cpp
phoneapp/phoneuiview/src/cphonecallheadertextanimation.cpp
phoneapp/phoneuiview/src/cphonecontactcontroller.cpp
phoneapp/phoneuiview/src/cphonedialercontroller.cpp
phoneapp/phoneuiview/src/cphonedialerview.cpp
phoneapp/phoneuiview/src/cphonedtmfnumberlistquery.cpp
phoneapp/phoneuiview/src/cphonedtmfsendingnote.cpp
phoneapp/phoneuiview/src/cphoneincallindicator.cpp
phoneapp/phoneuiview/src/cphonekeycapturecontroller.cpp
phoneapp/phoneuiview/src/cphonelistquerydialog.cpp
phoneapp/phoneuiview/src/cphonemenucontroller.cpp
phoneapp/phoneuiview/src/cphonenote.cpp
phoneapp/phoneuiview/src/cphonenotecontroller.cpp
phoneapp/phoneuiview/src/cphonenumberentry.cpp
phoneapp/phoneuiview/src/cphoneprogressnote.cpp
phoneapp/phoneuiview/src/cphonequerycontroller.cpp
phoneapp/phoneuiview/src/cphonequerydialog.cpp
phoneapp/phoneuiview/src/cphoneringingtone.cpp
phoneapp/phoneuiview/src/cphoneringingtoneplayerao.cpp
phoneapp/phoneuiview/src/cphonesingleitemfetch.cpp
phoneapp/phoneuiview/src/cphonestatuspane.cpp
phoneapp/phoneuiview/src/cphonetextquery.cpp
phoneapp/phoneuiview/src/cphonetoolbarcontroller.cpp
phoneapp/phoneuiview/src/cphoneuidisablednote.cpp
phoneapp/phoneuiview/src/cphonevideoplayer.cpp
phoneapp/phoneuiview/src/cphoneview.cpp
phoneapp/phoneuiview/src/cphoneviewcontroller.cpp
phoneapp/phoneuiview/src/cphonevmbxhandler.cpp
phoneapp/phoneuiview/src/phonebubbleextension.cpp
phoneapp/phoneuiview/src/phonebubbleextensiondata.cpp
phoneapp/phoneuiview/src/phonebubbleextensionmanager.cpp
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/PhoneCntFinder/BWINS/PHONECNTFINDERU.DEF
phoneengine/PhoneCntFinder/ContactService/inc/CPhCntAIWService.h
phoneengine/PhoneCntFinder/ContactService/inc/CPhCntContact.h
phoneengine/PhoneCntFinder/ContactService/inc/CPhCntContactManager.h
phoneengine/PhoneCntFinder/ContactService/inc/CPhCntContactStores.h
phoneengine/PhoneCntFinder/ContactService/inc/CPhCntMatcherImpl.h
phoneengine/PhoneCntFinder/ContactService/inc/CPhCntService.h
phoneengine/PhoneCntFinder/ContactService/inc/CPhCntSingleItemFetchService.h
phoneengine/PhoneCntFinder/ContactService/inc/MPhCntContactFetchObserver.h
phoneengine/PhoneCntFinder/ContactService/inc/MPhCntContactFetcherObserver.h
phoneengine/PhoneCntFinder/ContactService/inc/MPhCntContactManager.h
phoneengine/PhoneCntFinder/ContactService/inc/MPhCntContactStores.h
phoneengine/PhoneCntFinder/ContactService/inc/MPhCntPhonebookServices.h
phoneengine/PhoneCntFinder/ContactService/inc/MPhCntService.h
phoneengine/PhoneCntFinder/ContactService/inc/cphcntasynctosync.h
phoneengine/PhoneCntFinder/ContactService/inc/cphcntcontactdataselection.h
phoneengine/PhoneCntFinder/ContactService/inc/cphcntcontactdataselectionimpl.h
phoneengine/PhoneCntFinder/ContactService/inc/cphcntcontactfieldsresolver.h
phoneengine/PhoneCntFinder/ContactService/inc/cphcntcontactlinkarrayfetch.h
phoneengine/PhoneCntFinder/ContactService/inc/cphcntcontactmatchstrategy.h
phoneengine/PhoneCntFinder/ContactService/inc/cphcntcontactstoreuris.h
phoneengine/PhoneCntFinder/ContactService/inc/cphcntfetchcontact.h
phoneengine/PhoneCntFinder/ContactService/inc/cphcntfoundcontacts.h
phoneengine/PhoneCntFinder/ContactService/inc/cphcntmatchcontact.h
phoneengine/PhoneCntFinder/ContactService/inc/cphcntmatchervoipimpl.h
phoneengine/PhoneCntFinder/ContactService/inc/cphcntphonebookservices.h
phoneengine/PhoneCntFinder/ContactService/inc/cphcntspeeddialcontactlinkfetch.h
phoneengine/PhoneCntFinder/ContactService/inc/cphcntspeeddialimpl.h
phoneengine/PhoneCntFinder/ContactService/inc/cphcntstoreloaderimpl.h
phoneengine/PhoneCntFinder/ContactService/inc/cphcntvoipcontactmatchstrategy.h
phoneengine/PhoneCntFinder/ContactService/inc/cphcntvpbkcontactid.h
phoneengine/PhoneCntFinder/ContactService/inc/cphcntvpbkthumbnailloader.h
phoneengine/PhoneCntFinder/ContactService/inc/mphcntaiwservice.h
phoneengine/PhoneCntFinder/ContactService/inc/mphcntcontactfields.h
phoneengine/PhoneCntFinder/ContactService/inc/mphcntcontactmatchstrategy.h
phoneengine/PhoneCntFinder/ContactService/inc/mphcntcontactstoreeventobserver.h
phoneengine/PhoneCntFinder/ContactService/inc/mphcntservicerequestparam.h
phoneengine/PhoneCntFinder/ContactService/inc/mphcntservicerequestparamfactory.h
phoneengine/PhoneCntFinder/ContactService/inc/mphcntserviceresult.h
phoneengine/PhoneCntFinder/ContactService/inc/mphcntstoreloader.h
phoneengine/PhoneCntFinder/ContactService/inc/mphcntstoreloaderobserver.h
phoneengine/PhoneCntFinder/ContactService/inc/mphcntvoipcontactfinder.h
phoneengine/PhoneCntFinder/ContactService/inc/tphcntaiwserviceobserver.h
phoneengine/PhoneCntFinder/ContactService/inc/tphcntcontactfield.h
phoneengine/PhoneCntFinder/ContactService/inc/tphcntcontactlinkresult.h
phoneengine/PhoneCntFinder/ContactService/inc/tphcntcontactstorestate.h
phoneengine/PhoneCntFinder/ContactService/inc/tphcntcontactutil.h
phoneengine/PhoneCntFinder/ContactService/inc/tphcntnullserviceresult.h
phoneengine/PhoneCntFinder/ContactService/inc/tphcntnumber.h
phoneengine/PhoneCntFinder/ContactService/inc/tphcntservicerequestparamfactory.h
phoneengine/PhoneCntFinder/ContactService/inc/tphcntservicerequestparams.h
phoneengine/PhoneCntFinder/ContactService/inc/tphcntsipuri.h
phoneengine/PhoneCntFinder/ContactService/inc/tphcnttxttospeech.h
phoneengine/PhoneCntFinder/ContactService/inc/tphcntvoipmatchArray.h
phoneengine/PhoneCntFinder/ContactService/src/CPhCntAIWService.cpp
phoneengine/PhoneCntFinder/ContactService/src/CPhCntContact.cpp
phoneengine/PhoneCntFinder/ContactService/src/CPhCntContactManager.cpp
phoneengine/PhoneCntFinder/ContactService/src/CPhCntContactStores.cpp
phoneengine/PhoneCntFinder/ContactService/src/CPhCntMatcherImpl.cpp
phoneengine/PhoneCntFinder/ContactService/src/CPhCntService.cpp
phoneengine/PhoneCntFinder/ContactService/src/CPhCntSingleItemFetchService.cpp
phoneengine/PhoneCntFinder/ContactService/src/cphcntasynctosync.cpp
phoneengine/PhoneCntFinder/ContactService/src/cphcntcontactdataselectionimpl.cpp
phoneengine/PhoneCntFinder/ContactService/src/cphcntcontactfieldsresolver.cpp
phoneengine/PhoneCntFinder/ContactService/src/cphcntcontactlinkarrayfetch.cpp
phoneengine/PhoneCntFinder/ContactService/src/cphcntcontactmatchstrategy.cpp
phoneengine/PhoneCntFinder/ContactService/src/cphcntcontactstoreuris.cpp
phoneengine/PhoneCntFinder/ContactService/src/cphcntfetchcontact.cpp
phoneengine/PhoneCntFinder/ContactService/src/cphcntfoundcontacts.cpp
phoneengine/PhoneCntFinder/ContactService/src/cphcntmatchcontact.cpp
phoneengine/PhoneCntFinder/ContactService/src/cphcntmatchervoipimpl.cpp
phoneengine/PhoneCntFinder/ContactService/src/cphcntphonebookservices.cpp
phoneengine/PhoneCntFinder/ContactService/src/cphcntspeeddialcontactlinkfetch.cpp
phoneengine/PhoneCntFinder/ContactService/src/cphcntspeeddialimpl.cpp
phoneengine/PhoneCntFinder/ContactService/src/cphcntstoreloaderimpl.cpp
phoneengine/PhoneCntFinder/ContactService/src/cphcntvoipcontactmatchstrategy.cpp
phoneengine/PhoneCntFinder/ContactService/src/cphcntvpbkcontactid.cpp
phoneengine/PhoneCntFinder/ContactService/src/cphcntvpbkthumbnailloader.cpp
phoneengine/PhoneCntFinder/ContactService/src/tphcntaiwserviceobserver.cpp
phoneengine/PhoneCntFinder/ContactService/src/tphcntcontactfield.cpp
phoneengine/PhoneCntFinder/ContactService/src/tphcntcontactlinkresult.cpp
phoneengine/PhoneCntFinder/ContactService/src/tphcntcontactstorestate.cpp
phoneengine/PhoneCntFinder/ContactService/src/tphcntcontactutil.cpp
phoneengine/PhoneCntFinder/ContactService/src/tphcntnullserviceresult.cpp
phoneengine/PhoneCntFinder/ContactService/src/tphcntnumber.cpp
phoneengine/PhoneCntFinder/ContactService/src/tphcntservicerequestfactory.cpp
phoneengine/PhoneCntFinder/ContactService/src/tphcntservicerequestparamfactory.cpp
phoneengine/PhoneCntFinder/ContactService/src/tphcntservicerequestparams.cpp
phoneengine/PhoneCntFinder/ContactService/src/tphcntsipuri.cpp
phoneengine/PhoneCntFinder/ContactService/src/tphcnttxttospeech.cpp
phoneengine/PhoneCntFinder/ContactService/src/tphcntvoipmatchArray.cpp
phoneengine/PhoneCntFinder/Group/bld.inf
phoneengine/PhoneCntFinder/Group/phonecntfinder.mmp
phoneengine/PhoneCntFinder/Group/phonecntfinder.pkg
phoneengine/PhoneCntFinder/Group/phonecntfinder_stub.SIS
phoneengine/PhoneCntFinder/Group/phonecntfinder_stub.pkg
phoneengine/PhoneCntFinder/eabi/phonecntfinderu.def
phoneengine/PhoneCntFinder/inc/CPhCntMatch.h
phoneengine/PhoneCntFinder/inc/CPhCntMatchItem.h
phoneengine/PhoneCntFinder/inc/CPhCntMatchItem.inl
phoneengine/PhoneCntFinder/inc/CPhCntMatcher.h
phoneengine/PhoneCntFinder/inc/CPhoneCntFactory.h
phoneengine/PhoneCntFinder/inc/CPhoneCntFactoryImpl.h
phoneengine/PhoneCntFinder/inc/CPhoneCntNumberParser.h
phoneengine/PhoneCntFinder/inc/CPhoneCntPbkOwner.h
phoneengine/PhoneCntFinder/inc/CPhoneCntSaveAddToName.h
phoneengine/PhoneCntFinder/inc/CPhoneRawMatchNumberExtractor.h
phoneengine/PhoneCntFinder/inc/MPhCntMatch.h
phoneengine/PhoneCntFinder/inc/MPhoneCntPbkOwner.h
phoneengine/PhoneCntFinder/inc/Misc/CPhCntMmiSecurity.h
phoneengine/PhoneCntFinder/inc/Misc/CPhCntMmiSecurityImpl.h
phoneengine/PhoneCntFinder/inc/Misc/CPhCntProfileEngine.h
phoneengine/PhoneCntFinder/inc/Misc/CPhCntProfileEngineImpl.h
phoneengine/PhoneCntFinder/inc/Misc/CPhCntRfsHandler.h
phoneengine/PhoneCntFinder/inc/Misc/CPhCntRfsHandlerImpl.h
phoneengine/PhoneCntFinder/inc/Misc/CPhCntSingleItemFetch.h
phoneengine/PhoneCntFinder/inc/Misc/CPhCntSingleItemFetchImpl.h
phoneengine/PhoneCntFinder/inc/Misc/CPhCntSpeedDialMonitor.h
phoneengine/PhoneCntFinder/inc/Misc/CPhCntThumbnailLoader.h
phoneengine/PhoneCntFinder/inc/Misc/CPhCntThumbnailLoaderImpl.h
phoneengine/PhoneCntFinder/inc/Misc/MPhCntThumbnailLoaderObserver.h
phoneengine/PhoneCntFinder/inc/PhCntPanic.h
phoneengine/PhoneCntFinder/inc/PhCntTrace.h
phoneengine/PhoneCntFinder/inc/cphcntcontactid.h
phoneengine/PhoneCntFinder/inc/cphcntpbkcontactid.h
phoneengine/PhoneCntFinder/inc/cphcntpbksaveaddtoname.h
phoneengine/PhoneCntFinder/inc/cphcntpbkthumbnailloader.h
phoneengine/PhoneCntFinder/inc/cphcntthumbnailloaderbase.h
phoneengine/PhoneCntFinder/inc/mphcntthumbnailloader.h
phoneengine/PhoneCntFinder/rom/PhoneCntFinder.iby
phoneengine/PhoneCntFinder/src/CPhoneCntFactoryImpl.cpp
phoneengine/PhoneCntFinder/src/CPhoneCntNumberParser.cpp
phoneengine/PhoneCntFinder/src/CPhoneCntPbkOwner.cpp
phoneengine/PhoneCntFinder/src/CPhoneCntSaveAddToName.cpp
phoneengine/PhoneCntFinder/src/CPhoneRawMatchNumberExtractor.cpp
phoneengine/PhoneCntFinder/src/Misc/CPhCntMmiSecurityImpl.cpp
phoneengine/PhoneCntFinder/src/Misc/CPhCntProfileEngineImpl.cpp
phoneengine/PhoneCntFinder/src/Misc/CPhCntRfsHandlerImpl.cpp
phoneengine/PhoneCntFinder/src/Misc/CPhCntThumbnailLoaderImpl.cpp
phoneengine/PhoneCntFinder/src/PhCntPanic.cpp
phoneengine/PhoneCntFinder/src/cphcntthumbnailloaderbase.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/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/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/contacthandling/bwins/contacthandlingu.def
phoneengine/contacthandling/data/contacthandling_stub.pkg
phoneengine/contacthandling/data/contacthandling_stub.sis
phoneengine/contacthandling/eabi/contacthandlingu.def
phoneengine/contacthandling/group/bld.inf
phoneengine/contacthandling/group/contacthandling.mmp
phoneengine/contacthandling/inc/cpecontactextensionwrapper.h
phoneengine/contacthandling/inc/cpecontacthandling.h
phoneengine/contacthandling/inc/cpecontacthandlingdummy.h
phoneengine/contacthandling/inc/cpecontacthandlingproxy.h
phoneengine/contacthandling/inc/cpecontactmatch.h
phoneengine/contacthandling/inc/mpecontacthandling.h
phoneengine/contacthandling/src/cpecontactextensionwrapper.cpp
phoneengine/contacthandling/src/cpecontacthandling.cpp
phoneengine/contacthandling/src/cpecontacthandlingdummy.cpp
phoneengine/contacthandling/src/cpecontacthandlingproxy.cpp
phoneengine/contacthandling/src/cpecontactmatch.cpp
phoneengine/contacthandling/src/pecontacthandlingpanic.cpp
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/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/group/backup_registration.xml
phoneengine/phonemodel/group/bld.inf
phoneengine/phonemodel/group/phonemodel.mmp
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/cpeincallearvolumesettingmonitor.h
phoneengine/phonemodel/inc/cpeincallloudspeakervolumesettingmonitor.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/mpeclientcallrequestmonitor.h
phoneengine/phonemodel/inc/mpeexternaldatahandler.h
phoneengine/phonemodel/inc/mpemediator.h
phoneengine/phonemodel/inc/mpephonemodelinternal.h
phoneengine/phonemodel/inc/mphonedevicemodeobserver.h
phoneengine/phonemodel/inc/pepanic.pan
phoneengine/phonemodel/inc/pevirtualengine.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/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/cpeincallearvolumesettingmonitor.cpp
phoneengine/phonemodel/src/cpeincallloudspeakervolumesettingmonitor.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/pepanic.cpp
phoneengine/phonemodel/src/phoneengineproxy.cpp
phoneengine/phonemodel/src/tperemotepartyinfomediatorupdater.cpp
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/group/bld.inf
phoneplugins/telbranding/data/102078FA.rss
phoneplugins/telbranding/group/bld.inf
phoneplugins/telbranding/group/telbranding.mmp
phoneplugins/telbranding/group/telbrandingconstants.hrh
phoneplugins/telbranding/inc/telbranding.h
phoneplugins/telbranding/inc/telbrandingbubble.h
phoneplugins/telbranding/inc/telbrandingcallindicator.h
phoneplugins/telbranding/inc/telbrandingimage.h
phoneplugins/telbranding/inc/telbrandingserverhandler.h
phoneplugins/telbranding/inc/telbrandingsettingshandler.h
phoneplugins/telbranding/rom/telbranding.iby
phoneplugins/telbranding/sis/telbranding.pkg
phoneplugins/telbranding/src/telbranding.cpp
phoneplugins/telbranding/src/telbrandingbubble.cpp
phoneplugins/telbranding/src/telbrandingcallindicator.cpp
phoneplugins/telbranding/src/telbrandingimage.cpp
phoneplugins/telbranding/src/telbrandingproxy.cpp
phoneplugins/telbranding/src/telbrandingserverhandler.cpp
phoneplugins/telbranding/src/telbrandingsettingshandler.cpp
phonesettings/aiwcallimageplugin/data/102823d0.rss
phonesettings/aiwcallimageplugin/data/aiwcallimageplugin.pkg
phonesettings/aiwcallimageplugin/data/aiwcallimageplugin.rss
phonesettings/aiwcallimageplugin/data/aiwcallimageplugin_stub.SIS
phonesettings/aiwcallimageplugin/data/aiwcallimageplugin_stub.pkg
phonesettings/aiwcallimageplugin/group/aiwcallimageplugin.mmp
phonesettings/aiwcallimageplugin/group/bld.inf
phonesettings/aiwcallimageplugin/inc/aiwcallimageplugin.h
phonesettings/aiwcallimageplugin/inc/aiwcallimageplugin.hrh
phonesettings/aiwcallimageplugin/loc/aiwcallimageplugin.loc
phonesettings/aiwcallimageplugin/rom/aiwcallimageplugin.iby
phonesettings/aiwcallimageplugin/rom/aiwcallimagepluginresources.iby
phonesettings/aiwcallimageplugin/src/aiwcallimageplugin.cpp
phonesettings/aiwcallimageplugin/src/aiwcallimagepluginmain.cpp
phonesettings/group/bld.inf
phonesettings/pslncallimageplugin/Data/102818EE.rss
phonesettings/pslncallimageplugin/Data/PslnCallImagePluginRsc.rss
phonesettings/pslncallimageplugin/Data/pslncallimageplugin.pkg
phonesettings/pslncallimageplugin/Data/pslncallimageplugin_stub.SIS
phonesettings/pslncallimageplugin/Data/pslncallimageplugin_stub.pkg
phonesettings/pslncallimageplugin/Group/PslnCallImagePlugin.mmp
phonesettings/pslncallimageplugin/Group/PslnCallImagePluginIcons.mk
phonesettings/pslncallimageplugin/Group/bld.inf
phonesettings/pslncallimageplugin/Logger/PslnCallImagePluginLogger.h
phonesettings/pslncallimageplugin/Logger/PslnCallImagePluginLoggingConf.h
phonesettings/pslncallimageplugin/inc/PslnCallImagePlugin.h
phonesettings/pslncallimageplugin/inc/PslnCallImagePluginContainer.h
phonesettings/pslncallimageplugin/inc/PslnCallImagePluginDRM.h
phonesettings/pslncallimageplugin/loc/pslncallimageplugin.loc
phonesettings/pslncallimageplugin/rom/PslnCallImagePlugin.iby
phonesettings/pslncallimageplugin/rom/PslnCallImagePluginResources.iby
phonesettings/pslncallimageplugin/src/PslnCallImagePlugin.cpp
phonesettings/pslncallimageplugin/src/PslnCallImagePluginContainer.cpp
phonesettings/pslncallimageplugin/src/PslnCallImagePluginDRM.cpp
phonesettings/pslncallimageplugin/src/PslnCallImagePluginImplementationTable.cpp
phoneuis/BubbleManager/BMARM/BUBBLEMANAGERU.DEF
phoneuis/BubbleManager/BWINS/BUBBLEMANAGERU.DEF
phoneuis/BubbleManager/Data/BubbleManager.rss
phoneuis/BubbleManager/Data/bubblemanager_stub.SIS
phoneuis/BubbleManager/Group/Bubblemanager.mmp
phoneuis/BubbleManager/Group/bld.inf
phoneuis/BubbleManager/Group/iconlist.txt
phoneuis/BubbleManager/Inc/BMBubbleDebug.h
phoneuis/BubbleManager/Inc/BMBubbleHeader.h
phoneuis/BubbleManager/Inc/BMBubbleIconIndex.h
phoneuis/BubbleManager/Inc/BMBubbleImage.h
phoneuis/BubbleManager/Inc/BMBubbleImageManager.h
phoneuis/BubbleManager/Inc/BMBubbleManager.h
phoneuis/BubbleManager/Inc/BMBubbleOutlook.h
phoneuis/BubbleManager/Inc/BMBubbleOutlookBottom.h
phoneuis/BubbleManager/Inc/BMBubbleOutlookBottomCnap.h
phoneuis/BubbleManager/Inc/BMBubbleOutlookBottomImCnap.h
phoneuis/BubbleManager/Inc/BMBubbleOutlookBottomImage.h
phoneuis/BubbleManager/Inc/BMBubbleOutlookBottomRiCnap.h
phoneuis/BubbleManager/Inc/BMBubbleOutlookBottomRight.h
phoneuis/BubbleManager/Inc/BMBubbleOutlookBottomText.h
phoneuis/BubbleManager/Inc/BMBubbleOutlookConference.h
phoneuis/BubbleManager/Inc/BMBubbleOutlookFiveLined.h
phoneuis/BubbleManager/Inc/BMBubbleOutlookHide.h
phoneuis/BubbleManager/Inc/BMBubbleOutlookMiddle.h
phoneuis/BubbleManager/Inc/BMBubbleOutlookMiddleCnap.h
phoneuis/BubbleManager/Inc/BMBubbleOutlookNE.h
phoneuis/BubbleManager/Inc/BMBubbleOutlookOneLined.h
phoneuis/BubbleManager/Inc/BMBubbleOutlookThreeLined.h
phoneuis/BubbleManager/Inc/BMBubbleOutlookTopLeft.h
phoneuis/BubbleManager/Inc/BMBubbleOutlookTopRight.h
phoneuis/BubbleManager/Inc/BMBubbleOutlookTwoLined.h
phoneuis/BubbleManager/Inc/BMBubbleOutlookVideo.h
phoneuis/BubbleManager/Inc/BMBubbleOutlookVideoCnap.h
phoneuis/BubbleManager/Inc/BMBubblePlace.h
phoneuis/BubbleManager/Inc/BMBubbleSkinBitmap.h
phoneuis/BubbleManager/Inc/BMBubbleVideoContainer.h
phoneuis/BubbleManager/Inc/BMCallHeader.h
phoneuis/BubbleManager/Inc/BMCallObjectManager.h
phoneuis/BubbleManager/Inc/BMCallObjectUtils.h
phoneuis/BubbleManager/Inc/BMCallStatusAnim.h
phoneuis/BubbleManager/Inc/BMCallStatusAnimBig.h
phoneuis/BubbleManager/Inc/BMCallStatusAnimSmall.h
phoneuis/BubbleManager/Inc/BMCallStatusIndi.h
phoneuis/BubbleManager/Inc/BMCallStatusIndiBig.h
phoneuis/BubbleManager/Inc/BMCallStatusIndiSmall.h
phoneuis/BubbleManager/Inc/BMConfHeader.h
phoneuis/BubbleManager/Inc/BMConfPane.h
phoneuis/BubbleManager/Inc/BMCustomManager.h
phoneuis/BubbleManager/Inc/BMDefaultManager.h
phoneuis/BubbleManager/Inc/BMImageReader.h
phoneuis/BubbleManager/Inc/BMImageReaderObserver.h
phoneuis/BubbleManager/Inc/BMMainPaneControl.h
phoneuis/BubbleManager/Inc/BMMediaReader.h
phoneuis/BubbleManager/Inc/BMMediaReaderFactory.h
phoneuis/BubbleManager/Inc/BMMediaReaderInterface.h
phoneuis/BubbleManager/Inc/BMMediaReaderObserver.h
phoneuis/BubbleManager/Inc/BMNumberTypeIcon.h
phoneuis/BubbleManager/Inc/BMPanic.h
phoneuis/BubbleManager/Inc/BMResourceManager.h
phoneuis/BubbleManager/Inc/BMTouchPane.h
phoneuis/BubbleManager/Inc/BMTouchPane.rh
phoneuis/BubbleManager/Inc/BMTouchPaneButton.h
phoneuis/BubbleManager/Inc/BMTouchPaneInterface.h
phoneuis/BubbleManager/Inc/BMTrace.h
phoneuis/BubbleManager/Inc/BMUtils.h
phoneuis/BubbleManager/Inc/BMVideoController.h
phoneuis/BubbleManager/Inc/BMVideoPlaybackObserver.h
phoneuis/BubbleManager/Inc/BMVideoPlayer.h
phoneuis/BubbleManager/Inc/BMVideoPlayerObserver.h
phoneuis/BubbleManager/Inc/BubbleManagerPaths.h
phoneuis/BubbleManager/Src/BMBubbleHeader.cpp
phoneuis/BubbleManager/Src/BMBubbleImage.cpp
phoneuis/BubbleManager/Src/BMBubbleImageManager.cpp
phoneuis/BubbleManager/Src/BMBubbleManager.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlook.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlookBottom.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlookBottomCnap.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlookBottomImCnap.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlookBottomImage.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlookBottomRiCnap.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlookBottomRight.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlookBottomText.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlookConference.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlookFiveLined.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlookHide.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlookMiddle.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlookMiddleCnap.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlookNE.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlookOneLined.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlookThreeLined.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlookTopLeft.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlookTopRight.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlookTwoLined.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlookVideo.cpp
phoneuis/BubbleManager/Src/BMBubbleOutlookVideoCnap.cpp
phoneuis/BubbleManager/Src/BMBubblePlace.cpp
phoneuis/BubbleManager/Src/BMBubbleSkinBitmap.cpp
phoneuis/BubbleManager/Src/BMBubbleVideoContainer.cpp
phoneuis/BubbleManager/Src/BMCallHeader.cpp
phoneuis/BubbleManager/Src/BMCallObjectManager.cpp
phoneuis/BubbleManager/Src/BMCallObjectUtils.cpp
phoneuis/BubbleManager/Src/BMCallStatusAnim.cpp
phoneuis/BubbleManager/Src/BMCallStatusAnimBig.cpp
phoneuis/BubbleManager/Src/BMCallStatusAnimSmall.cpp
phoneuis/BubbleManager/Src/BMCallStatusIndi.cpp
phoneuis/BubbleManager/Src/BMCallStatusIndiBig.cpp
phoneuis/BubbleManager/Src/BMCallStatusIndiSmall.cpp
phoneuis/BubbleManager/Src/BMConfHeader.cpp
phoneuis/BubbleManager/Src/BMConfPane.cpp
phoneuis/BubbleManager/Src/BMCustomManager.cpp
phoneuis/BubbleManager/Src/BMDefaultManager.cpp
phoneuis/BubbleManager/Src/BMImageReader.cpp
phoneuis/BubbleManager/Src/BMMainPaneControl.cpp
phoneuis/BubbleManager/Src/BMMediaReader.cpp
phoneuis/BubbleManager/Src/BMMediaReaderFactory.cpp
phoneuis/BubbleManager/Src/BMNumberTypeIcon.cpp
phoneuis/BubbleManager/Src/BMPanic.cpp
phoneuis/BubbleManager/Src/BMResourceManager.cpp
phoneuis/BubbleManager/Src/BMTouchPane.cpp
phoneuis/BubbleManager/Src/BMTouchPaneButton.cpp
phoneuis/BubbleManager/Src/BMUtils.cpp
phoneuis/BubbleManager/Src/BMVideoController.cpp
phoneuis/BubbleManager/Src/BMVideoPlayer.cpp
phoneuis/BubbleManager/bmcustomization/bwins/bmcustomizationu.def
phoneuis/BubbleManager/bmcustomization/eabi/bmcustomizationu.def
phoneuis/BubbleManager/bmcustomization/group/bld.inf
phoneuis/BubbleManager/bmcustomization/group/bmcustomization.mmp
phoneuis/BubbleManager/bmcustomization/rom/bmcustomization.iby
phoneuis/BubbleManager/bmcustomization/src/telbubbleanim.cpp
phoneuis/BubbleManager/bmcustomization/src/telbubblecallimage.cpp
phoneuis/BubbleManager/bmcustomization/src/telbubblecustomelement.cpp
phoneuis/BubbleManager/bmcustomization/src/telbubbleimage.cpp
phoneuis/BubbleManager/bmcustomization/src/telbubblelabel.cpp
phoneuis/BubbleManager/eabi/bubblemanageru.def
phoneuis/BubbleManager/laf/BMLayout.cpp
phoneuis/BubbleManager/laf/BMLayout.h
phoneuis/BubbleManager/laf/BMLayout2.cpp
phoneuis/BubbleManager/laf/BMLayout2.h
phoneuis/BubbleManager/laf/BMLayout3.cpp
phoneuis/BubbleManager/laf/BMLayout3.h
phoneuis/BubbleManager/laf/BMLayout4.cpp
phoneuis/BubbleManager/laf/BMLayout4.h
phoneuis/BubbleManager/laf/BMLayout6.cpp
phoneuis/BubbleManager/laf/BMLayout6.h
phoneuis/BubbleManager/rom/Bubblemanager.iby
phoneuis/ConnectUtil/data/101F8625.rss
phoneuis/ConnectUtil/data/connectutil.rss
phoneuis/ConnectUtil/data/connectutil_stub.SIS
phoneuis/ConnectUtil/data/connectutil_stub.pkg
phoneuis/ConnectUtil/group/ConnectUtil.mmp
phoneuis/ConnectUtil/group/bld.inf
phoneuis/ConnectUtil/inc/CCoUtlActive.h
phoneuis/ConnectUtil/inc/CCoUtlImplementation.h
phoneuis/ConnectUtil/inc/CCoUtlInterface.h
phoneuis/ConnectUtil/inc/CCoUtlInterface.inl
phoneuis/ConnectUtil/inc/CoUtlInterface.hrh
phoneuis/ConnectUtil/loc/connectutil.loc
phoneuis/ConnectUtil/rom/connectutil.iby
phoneuis/ConnectUtil/rom/connectutilResources.iby
phoneuis/ConnectUtil/src/CCoUtlActive.cpp
phoneuis/ConnectUtil/src/CCoUtlImplementation.cpp
phoneuis/ConnectUtil/src/CoUtlMain.cpp
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/Ussd/aif/UssdAif.rss
phoneuis/Ussd/data/Ussd.pkg
phoneuis/Ussd/data/Ussd_caption.rss
phoneuis/Ussd/data/Ussd_reg.rss
phoneuis/Ussd/data/Ussd_stub.pkg
phoneuis/Ussd/data/ussd.rss
phoneuis/Ussd/data/ussd_stub.SIS
phoneuis/Ussd/group/bld.inf
phoneuis/Ussd/group/ussd.mmp
phoneuis/Ussd/group/ussd_icons_aif_bitmaps.mk
phoneuis/Ussd/group/ussd_icons_aif_bitmaps_dc.mk
phoneuis/Ussd/group/ussd_icons_aif_scalable.mk
phoneuis/Ussd/group/ussd_icons_aif_scalable_dc.mk
phoneuis/Ussd/help/data/xhtml.zip
phoneuis/Ussd/help/group/bld.inf
phoneuis/Ussd/help/inc/ussd.hlp.hrh
phoneuis/Ussd/help/rom/ussdhelps_variant.iby
phoneuis/Ussd/inc/UssdApp.h
phoneuis/Ussd/inc/UssdAppUi.h
phoneuis/Ussd/inc/UssdComms.h
phoneuis/Ussd/inc/UssdContainer.h
phoneuis/Ussd/inc/UssdDocument.h
phoneuis/Ussd/inc/UssdEditorLines.h
phoneuis/Ussd/inc/UssdLayout.h
phoneuis/Ussd/inc/UssdNaviPane.h
phoneuis/Ussd/inc/UssdVariant.hrh
phoneuis/Ussd/inc/ussd.hlp.hrh
phoneuis/Ussd/inc/ussd.hrh
phoneuis/Ussd/loc/ussd.loc
phoneuis/Ussd/rom/Ussd.iby
phoneuis/Ussd/rom/UssdResources.iby
phoneuis/Ussd/src/UssdApp.cpp
phoneuis/Ussd/src/UssdAppUi.cpp
phoneuis/Ussd/src/UssdComms.cpp
phoneuis/Ussd/src/UssdContainer.cpp
phoneuis/Ussd/src/UssdDocument.cpp
phoneuis/Ussd/src/UssdEditorLines.cpp
phoneuis/Ussd/src/UssdLayout.cpp
phoneuis/Ussd/src/UssdNaviPane.cpp
phoneuis/dialer/bwins/dialeru.def
phoneuis/dialer/data/dialer.pkg
phoneuis/dialer/data/dialer.rss
phoneuis/dialer/data/dialer_stub.pkg
phoneuis/dialer/data/dialer_stub.sis
phoneuis/dialer/eabi/dialeru.def
phoneuis/dialer/group/bld.inf
phoneuis/dialer/group/dialer.mmp
phoneuis/dialer/group/dialer_icons.mk
phoneuis/dialer/group/dialerstub.mmp
phoneuis/dialer/group/iconlist.txt
phoneuis/dialer/inc/cdialer.h
phoneuis/dialer/inc/cdialercontainerbase.h
phoneuis/dialer/inc/cdialerkeypadbutton.h
phoneuis/dialer/inc/cdialerkeypadcontainer.h
phoneuis/dialer/inc/cdialernumberentry.h
phoneuis/dialer/inc/cdialertoolbar.h
phoneuis/dialer/inc/cdialervideocontainer.h
phoneuis/dialer/inc/dialer.hrh
phoneuis/dialer/inc/dialercommon.h
phoneuis/dialer/inc/dialertrace.h
phoneuis/dialer/inc/mnumberentry.h
phoneuis/dialer/rom/dialer.iby
phoneuis/dialer/src/cdialer.cpp
phoneuis/dialer/src/cdialercontainerbase.cpp
phoneuis/dialer/src/cdialerkeypadcontainer.cpp
phoneuis/dialer/src/cdialernumberentry.cpp
phoneuis/dialer/src/cdialerstub.cpp
phoneuis/dialer/src/cdialervideocontainer.cpp
phoneuis/dialer/src/cvideodtmfdialer.cpp
phoneuis/dialer/src/cvideodtmfdialerstub.cpp
phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/Bwins/T_VideoDtmfDialeru.def
phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/EABI/T_VideoDtmfDialeru.def
phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/conf/ui_T_VideoDtmfDialer.cfg
phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/group/T_VideoDtmfDialer.mmp
phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/group/T_VideoDtmfDialer.pkg
phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/group/T_VideoDtmfDialer.sis
phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/group/bld.inf
phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/inc/T_VideoDtmfDialer.h
phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/inc/T_VideoDtmfDialer.pan
phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/inc/T_VideoDtmfDialerAppView.h
phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/init/T_VideoDtmfDialer.ini
phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/src/T_VideoDtmfDialer.cpp
phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/src/T_VideoDtmfDialerAppView.cpp
phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/src/T_VideoDtmfDialerBlocks.cpp
phoneuis/dialer/tsrc/public/basic/group/bld.inf
phoneuis/group/bld.inf
phoneuis/vmbx/aif/vmaif.rss
phoneuis/vmbx/group/bld.inf
phoneuis/vmbx/group/icons.mk
phoneuis/vmbx/group/icons_aif_bitmaps.mk
phoneuis/vmbx/group/icons_aif_bitmaps_dc.mk
phoneuis/vmbx/group/icons_aif_scalable.mk
phoneuis/vmbx/group/icons_aif_scalable_dc.mk
phoneuis/vmbx/group/icons_dc.mk
phoneuis/vmbx/group/vm.SIS
phoneuis/vmbx/group/vm.mmp
phoneuis/vmbx/group/vm.pkg
phoneuis/vmbx/group/vm_stub.SIS
phoneuis/vmbx/group/vm_stub.pkg
phoneuis/vmbx/gsvmbxplugin/data/2000B4D6.rss
phoneuis/vmbx/gsvmbxplugin/data/gsvmbxpluginrsc.rss
phoneuis/vmbx/gsvmbxplugin/group/bld.inf
phoneuis/vmbx/gsvmbxplugin/group/gsvmbxplugin.mmp
phoneuis/vmbx/gsvmbxplugin/group/gsvmbxpluginicons.mk
phoneuis/vmbx/gsvmbxplugin/inc/gsvmbxplugin.h
phoneuis/vmbx/gsvmbxplugin/loc/gsvmbxplugin.loc
phoneuis/vmbx/gsvmbxplugin/src/gsvmbxplugin.cpp
phoneuis/vmbx/gsvmbxplugin/src/gsvmbxpluginimplementationtable.cpp
phoneuis/vmbx/help/data/xhtml.zip
phoneuis/vmbx/help/group/bld.inf
phoneuis/vmbx/help/inc/smsvo.hlp.hrh
phoneuis/vmbx/help/rom/vmbxhelps_variant.iby
phoneuis/vmbx/inc/VMBLogger.h
phoneuis/vmbx/inc/VmApp.h
phoneuis/vmbx/inc/VmAppUi.h
phoneuis/vmbx/inc/VmContainer.h
phoneuis/vmbx/inc/VmDetDlgPropertyObserver.h
phoneuis/vmbx/inc/VmDetailsDialog.h
phoneuis/vmbx/inc/VmDetailsDlgDummy.h
phoneuis/vmbx/inc/VmDocument.h
phoneuis/vmbx/inc/VmQueryLauncher.h
phoneuis/vmbx/inc/VoiceMailboxAppPrivateCRKeys.h
phoneuis/vmbx/inc/smsvo.hlp.hrh
phoneuis/vmbx/inc/vm.hrh
phoneuis/vmbx/inc/vm_variant.hrh
phoneuis/vmbx/loc/vm.loc
phoneuis/vmbx/rom/Vmbx.iby
phoneuis/vmbx/rom/VmbxResources.iby
phoneuis/vmbx/rom/gsvmbxplugin.iby
phoneuis/vmbx/rom/gsvmbxpluginresources.iby
phoneuis/vmbx/src/VmApp.cpp
phoneuis/vmbx/src/VmAppUi.cpp
phoneuis/vmbx/src/VmContainer.cpp
phoneuis/vmbx/src/VmDetDlgPropertyObserver.cpp
phoneuis/vmbx/src/VmDetailsDialog.cpp
phoneuis/vmbx/src/VmDetailsDlgDummy.cpp
phoneuis/vmbx/src/VmDocument.cpp
phoneuis/vmbx/src/VmQueryLauncher.cpp
phoneuis/vmbx/src/vm.rss
phoneuis/vmbx/src/vm_caption.rss
phoneuis/vmbx/src/vm_reg.rss
sysdef_1_4_0.dtd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Telephony ADO bld file
+*
+*/
+
+
+#include "../phoneapp/group/bld.inf"
+#include "../phoneengine/group/bld.inf"
+#include "../phonesettings/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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [
+  <!ENTITY layer_real_source_path "sf/app/phone" >
+]>
+
+<SystemDefinition name="phone" schema="1.4.0">
+  <systemModel>
+    <layer name="app_layer">
+      <module name="phone">
+        <unit name="phone" unitID="tedo.phone" bldFile="&layer_real_source_path;/group" mrp="" />
+      </module>
+    </layer>
+
+    <layer name="api_test_layer">
+      <module name="tedo_api_tests">
+        <unit unitID="tedo.dialer.test" name="dialer.test" bldFile="&layer_real_source_path;/phoneuis/dialer/tsrc/public/basic/group" mrp="" />
+        <unit unitID="tedo.phoneui.test" name="phoneui.test" bldFile="&layer_real_source_path;/phoneapp/phoneui/tsrc/public/basic/group" mrp="" />
+       </module>
+    </layer>
+
+  </systemModel>
+</SystemDefinition>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/package_definition.xml	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<SystemDefinition schema="3.0.0">
+  <package id="phone" name="Phone Apps" levels="engine plugin ui app">
+    <collection id="phoneapp" name="Phone Application" level="app">
+      <component id="blacklist" filter="s60" name="Phone Blacklist Clearing" class="plugin">
+        <unit bldFile="phoneapp/blacklist/group"/>
+      </component>
+      <component id="phoneui" filter="s60" name="Phone UI">
+        <unit bldFile="phoneapp/phoneui/group"/>
+        	<!-- should these be separate components? #included? -->
+        <!-- <unit bldFile="phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/group"/> -->
+        <!-- <unit bldFile="phoneapp/phoneui/tsrc/public/basic/group"/> -->
+      </component>
+      <component id="phoneuicontrol" filter="s60" name="Phone UI Control">
+        <unit bldFile="phoneapp/phoneuicontrol/group"/>
+      </component>
+      <component id="phoneuistates" filter="s60" name="Phone UI States">
+        <unit bldFile="phoneapp/phoneuistates/group"/>
+      </component>
+      <component id="phoneuiutils" filter="s60" name="Phone UI Utils">
+        <unit bldFile="phoneapp/phoneuiutils/group"/>
+      </component>
+      <component id="phoneuiview" filter="s60" name="Phone UI View">
+        <unit bldFile="phoneapp/phoneuiview/group"/>
+      </component>
+      <component id="phoneuivoipextension" filter="s60" name="Phone UI VOIP Extension">
+        <unit bldFile="phoneapp/phoneuivoipextension/group"/>
+      </component>
+      <component id="silenceactionplugin" filter="s60" name="Silence Action Plugin" class="plugin">
+        <unit bldFile="phoneapp/silenceactionplugin/group"/>
+      </component>
+      <component id="phonemediatorcenter" filter="s60" name="Phone Mediator Center">
+        <unit bldFile="phoneapp/phonemediatorcenter/group"/>
+      </component>
+    </collection>
+    <collection id="phoneengine" name="Phone Engine" level="engine">
+      <component id="phonecntfinder" filter="s60" name="Phone Contact Finder">
+        <unit bldFile="phoneengine/phonecntfinder/group"/>
+      </component>
+      <component id="audiohandling" filter="s60" name="Phone Audio Handling">
+        <unit bldFile="phoneengine/audiohandling/group"/>
+      </component>
+      <component id="callhandling" filter="s60" name="Call Handling">
+        <unit bldFile="phoneengine/callhandling/group"/>
+      </component>
+      <component id="contacthandling" filter="s60" name="Phone Contact Handling">
+        <unit bldFile="phoneengine/contacthandling/group"/>
+      </component>
+      <component id="loghandling" filter="s60" name="Phone Log Handling">
+        <unit bldFile="phoneengine/loghandling/group"/>
+      </component>
+      <component id="engineinfo" filter="s60" name="Phone Engine Info">
+        <unit bldFile="phoneengine/engineinfo/group"/>
+      </component>
+      <component id="phonemodel" filter="s60" name="Phone Model">
+        <unit bldFile="phoneengine/phonemodel/group"/>
+      </component>
+      <component id="servicehandling" filter="s60" name="Phone Service Handling">
+        <unit bldFile="phoneengine/servicehandling/group"/>
+      </component>
+    </collection>
+    <collection id="phonesettings" name="Phone Settings" level="plugin">
+      <component id="aiwcallimageplugin" filter="s60" name="Call Image AIW Plugin" class="plugin">
+        <unit bldFile="phonesettings/aiwcallimageplugin/group"/>
+      </component>
+      <component id="pslncallimageplugin" filter="s60" name="Call Image Personalization Plugin"  class="plugin">
+        <unit bldFile="phonesettings/pslncallimageplugin/group"/>
+      </component>
+    </collection>
+    <collection id="phoneuis" name="Phone UIs" level="ui">
+      <component id="dialer" filter="s60" name="Dialer">
+        <unit bldFile="phoneuis/dialer/group"/>
+        	<!-- what to do about this test unit? -->
+        <!-- <unit bldFile="phoneuis/dialer/tsrc/public/basic/group"/> -->
+      </component>
+      <component id="bubblemanager" filter="s60" name="Phone Bubble Manager">
+        <unit bldFile="phoneuis/bubblemanager/group"/>
+      </component>
+      <component id="connectutil" filter="s60" name="Connection Utility" class="plugin">
+        <unit bldFile="phoneuis/connectutil/group"/>
+      </component>
+      <component id="sfiutils" filter="s60" name="Send File In Call Utilities" class="plugin">
+        <unit bldFile="phoneuis/sfiutils/group"/>
+        	<!-- what to do about this test unit? -->
+        <!-- <unit bldFile="phoneuis/sfiutils/tsrc/public/basic/group"/> -->
+      </component>
+      <component id="ussd" filter="s60" name="Unstructured Supplementary Services Data">
+        <unit bldFile="phoneuis/ussd/group"/>
+      </component>
+      <component id="vmbx" filter="s60" name="Voice Mailbox">
+        <unit bldFile="phoneuis/vmbx/group"/>
+      </component>
+      <component id="telephonydevicemode" filter="s60" name="Telephony Device Mode">
+        <unit bldFile="phoneuis/telephonydevicemode/group"/>
+      </component>
+    </collection>
+    <collection id="phone_info" name="Phone Apps Info" level="app">
+      <component id="phone_plat" filter="s60" name="Phone Apps Platform Interfaces" class="api">
+        <unit bldFile="phone_plat/group"/>
+      </component>
+    </collection>
+    <collection id="phoneplugins" name="Phone Plugins" level="plugin">
+      <component id="telbranding" filter="s60" name="Tel Branding" class="plugin" introduced="^2">
+        <unit bldFile="phoneplugins/telbranding/group"/>
+      </component>
+    </collection>
+  </package>
+</SystemDefinition>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/3d_ringing_tone_enabler_api/3d_ringing_tone_enabler_api.metaxml	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  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 "../telephony_microphone_mute_status_api/group/bld.inf"
+#include "../dialer_keypad_api/group/bld.inf"
+#include "../telephony_logging_extension_api/group/bld.inf"
+#include "../telephony_matching_extension_api/group/bld.inf"
+#include "../telephony_bubble_extension_api/group/bld.inf"
+#include "../telephony_menu_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"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/phone_application_commands_api/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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)
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/phone_application_commands_api/inc/phoneappcommands.hrh	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,240 @@
+/*
+* 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,
+
+    // 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,
+   
+    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_voip_commands_api/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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; 
+
+#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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_menu_extension_api/inc/telmenuextension.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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_microphone_mute_status_api/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,25 @@
+/*
+* 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
+#include "../../../phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/group/bld.inf"
+#include "../../../phoneuis/dialer/tsrc/public/basic/group/bld.inf"
+#include "../../../phoneuis/sfiutils/tsrc/public/basic/group/bld.inf"
+
+
+ // End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/video_telephony_mediator_api/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Telephony / phoneapp
+*
+*/
+
+
+
+#include "../Blacklist/group/bld.inf"
+#include "../phoneui/group/bld.inf"
+#include "../phoneuicontrol/group/bld.inf"
+#include "../phoneuistates/group/bld.inf"
+#include "../phoneuiutils/group/bld.inf"
+#include "../phoneuiview/group/bld.inf"
+#include "../phoneuivoipextension/group/bld.inf"
+#include "../silenceactionplugin/group/bld.inf"
+#include "../phonemediatorcenter/group/bld.inf"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/bwins/phonemediatorcenteru.def	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  
+*   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.
+CAPABILITY CAP_APPLICATION NetworkControl PowerMgmt MultimediaDD DRM DiskAdmin
+
+// 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
+USERINCLUDE     ../../phoneuiview/inc
+USERINCLUDE     ../../phoneuiutils/inc
+USERINCLUDE     ../../phoneui/srcdata // phoneui.pan
+
+
+APP_LAYER_SYSTEMINCLUDE         // Application layer domain APIs
+SYSTEMINCLUDE   ../../../inc    // Telephony internal headers
+
+
+LIBRARY         euser.lib
+LIBRARY         phoneuicontrol.lib
+LIBRARY         phoneuiutils.lib
+LIBRARY         phoneuiview.lib
+
+// 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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 "mphonecoveruiobserver.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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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/phoneui/aif/phoneuiaif.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,42 @@
+/*
+* 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 aif resource for PhoneUI application.
+*
+*/
+
+
+//  INCLUDES
+#include    <aiftool.rh>
+#include    "Phone.loc"
+
+//  RESOURCE DEFINITIONS 
+
+// ---------------------------------------------------------
+//   
+//    It contains aif data for phone app.
+//
+// ---------------------------------------------------------
+//
+RESOURCE AIF_DATA
+    {
+    app_uid = 0x100058B3;
+    num_icons = 1;
+    embeddability = KAppNotEmbeddable;
+    newfile = KAppDoesNotSupportNewFile;
+    hidden = KAppIsHidden;
+    }
+          
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  PhoneApp / PhoneUI 
+*     		
+*
+*/
+
+#ifdef RD_PHONE_NG
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+
+DEFAULT
+
+//  Help exports
+#include "../help/group/bld.inf"
+
+PRJ_EXPORTS
+// Stub SIS files:
+../group/phoneui_stub.sis                       /epoc32/data/z/system/install/phoneui_stub.sis
+
+
+// IBY files:
+../rom/phoneui.iby                              CORE_APP_LAYER_IBY_EXPORT_PATH(phoneui.iby)
+../rom/phoneuiresources.iby                     LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(phoneuiresources.iby)
+../rom/phoneuiresourcesvoip.iby                 LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(phoneuiresourcesvoip.iby)
+
+// LOC files:
+../loc/basiccallhandling.loc                    APP_LAYER_LOC_EXPORT_PATH(basiccallhandling.loc)
+../loc/callheadertexts.loc                      APP_LAYER_LOC_EXPORT_PATH(callheadertexts.loc)
+../loc/callterminationnote.loc                  APP_LAYER_LOC_EXPORT_PATH(callterminationnote.loc)
+../loc/dtmfsignalling.loc                       APP_LAYER_LOC_EXPORT_PATH(dtmfsignalling.loc)
+../loc/incallmenuandsoftkeys.loc                APP_LAYER_LOC_EXPORT_PATH(incallmenuandsoftkeys.loc)
+../loc/incalloperations.loc                     APP_LAYER_LOC_EXPORT_PATH(incalloperations.loc)
+../loc/mobileoriginatedcalls.loc                APP_LAYER_LOC_EXPORT_PATH(mobileoriginatedcalls.loc)
+../loc/multicallhandling.loc                    APP_LAYER_LOC_EXPORT_PATH(multicallhandling.loc)
+../loc/numberentry.loc                          APP_LAYER_LOC_EXPORT_PATH(numberentry.loc)
+../loc/phone.loc                                APP_LAYER_LOC_EXPORT_PATH(phone.loc)
+../loc/voip.loc                                 APP_LAYER_LOC_EXPORT_PATH(voip.loc)
+../loc/dialer.loc    				APP_LAYER_LOC_EXPORT_PATH(dialer.loc)
+
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+	OPTION TARGETFILE phoneui.mif
+	OPTION HEADERFILE phoneui.mbg
+	OPTION SOURCEFILE iconlist.txt
+END
+
+START EXTENSION s60/mifconv
+	OPTION TARGETFILE phoneui_aif.mif
+	OPTION SOURCES -c8,8 qgn_menu_idle
+END
+
+PRJ_MMPFILES
+phoneui.mmp
+
+
+#endif // RD_PHONE_NG
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/group/commonphoneapp_icons_aif_bitmaps.mk	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,67 @@
+#
+# 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: Make file for phoneui.
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps\
+ICONTARGETFILENAME=$(TARGETDIR)\phoneui_aif.mif
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_idle_lst.bmp
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/group/commonphoneapp_icons_aif_scalable.mk	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,68 @@
+#
+# 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: Make file for phoneui.
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+HEADERDIR=\epoc32\include
+ICONTARGETFILENAME=$(TARGETDIR)\phoneui_aif.mif
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_idle.svg
+		
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/group/commonphoneapp_icons_scalable.mk	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,95 @@
+#
+# 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: Make file for phoneui.
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+HEADERDIR=\epoc32\include
+ICONTARGETFILENAME=$(TARGETDIR)\phoneui.mif
+HEADERFILENAME=$(HEADERDIR)\phoneui.mbg
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+		/c8,8 qgn_indi_button_bluetooth.svg \
+		/c8,8 qgn_indi_button_conference.svg \
+		/c8,8 qgn_indi_button_drop.svg \
+		/c8,8 qgn_indi_button_end_active_call.svg \
+		/c8,8 qgn_indi_button_end_all_calls.svg \
+		/c8,8 qgn_indi_button_go_idle.svg \
+		/c8,8 qgn_indi_button_handset.svg \
+		/c8,8 qgn_indi_button_hold.svg \
+		/c8,8 qgn_indi_button_join.svg \
+		/c8,8 qgn_indi_button_loudspeaker.svg \
+		/c8,8 qgn_indi_button_mute_mic.svg \
+		/c8,8 qgn_indi_button_participants.svg \
+		/c8,8 qgn_indi_button_private.svg \
+		/c8,8 qgn_indi_button_swap.svg \
+		/c8,8 qgn_indi_button_unhold.svg \
+		/c8,8 qgn_indi_button_unmute_mic.svg \
+		/c8,8 qgn_indi_button_video_to_voice.svg \
+		/c8,8 qgn_indi_button_voice_to_video.svg \
+		/c8,8 qgn_indi_button_answer.svg \
+		/c8,8 qgn_indi_button_reject.svg \
+		/c8,8 qgn_indi_tb_call.svg \
+		/c8,8 qgn_indi_dialer_clear.svg \
+		/c8,8 qgn_indi_tb_pb.svg \
+		/c8,8 qgn_indi_dialer_add_contacts.svg \
+		/c8,8 qgn_indi_dialer_logs.svg \
+		/c8,8 qgn_indi_button_send_dtmf.svg \
+		/c8,8 qgn_indi_button_silence.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/group/iconlist.txt	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,32 @@
+-c8,8 qgn_indi_button_bluetooth
+-c8,8 qgn_indi_button_conference
+-c8,8 qgn_indi_button_drop
+-c8,8 qgn_indi_button_end_active_call
+-c8,8 qgn_indi_button_end_all_calls
+-c8,8 qgn_indi_button_go_idle
+-c8,8 qgn_indi_button_handset
+-c8,8 qgn_indi_button_hold
+-c8,8 qgn_indi_button_join
+-c8,8 qgn_indi_button_loudspeaker
+-c8,8 qgn_indi_button_mute_mic
+-c8,8 qgn_indi_button_participants
+-c8,8 qgn_indi_button_private
+-c8,8 qgn_indi_button_swap
+-c8,8 qgn_indi_button_unhold
+-c8,8 qgn_indi_button_unmute_mic
+-c8,8 qgn_indi_button_video_to_voice
+-c8,8 qgn_indi_button_voice_to_video
+-c8,8 qgn_indi_button_answer
+-c8,8 qgn_indi_button_reject
+-c8,8 qgn_indi_dialer_call_send
+-c8,8 qgn_indi_dialer_clear
+-c8,8 qgn_indi_dialer_contacts
+-c8,8 qgn_indi_dialer_add_contacts
+-c8,8 qgn_indi_dialer_logs
+-c8,8 qgn_indi_button_send_dtmf
+-c8,8 qgn_indi_button_silence
+-c8,8 qgn_indi_tb_microphone_mute 
+-c8,8 qgn_indi_tb_microphone_unmute
+-c8,8 qgn_indi_tb_ihf_on 
+-c8,8 qgn_indi_tb_handset
+-c8,8 qgn_indi_tb_bthf
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/group/phoneui.mmp	Mon Jan 18 20:18:27 2010 +0200
@@ -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: 
+*     This is project specification file for the PhoneUI app.
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+// Capability assignment.
+CAPABILITY CAP_APPLICATION MultiMediaDD PowerMgmt NetworkControl DRM DiskAdmin
+
+// Assign Vendor ID.
+VENDORID VID_DEFAULT
+
+EPOCSTACKSIZE   0x5000
+EPOCHEAPSIZE    0x1000 0x500000 // Min 4KB, Max 5MB 
+TARGET          phoneui.exe
+TARGETTYPE      exe
+
+UID	        	0x100039ce 0x100058B3
+
+SOURCEPATH      ../src
+
+SOURCE          cphoneapplication.cpp
+SOURCE          cphonedocument.cpp
+SOURCE          cphoneappui.cpp
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../phoneuiview/inc
+USERINCLUDE     ../../phoneuiutils/inc
+USERINCLUDE     ../../phoneuicontrol/inc
+USERINCLUDE     ../srcdata
+
+APP_LAYER_SYSTEMINCLUDE         // Application layer domain APIs
+SYSTEMINCLUDE   ../../../inc    // Telephony internal headers
+
+#ifndef __SECURE_DATA__ 
+/* Languages */
+LANG SC
+SOURCEPATH      ../srcdata
+
+// load protocol specific resources
+RESOURCE        phoneui.rss
+#else
+// Resources
+SOURCEPATH      ../srcdata
+START RESOURCE  phoneui.rss
+TARGETPATH APP_RESOURCE_DIR
+HEADER
+LANGUAGE_IDS
+END  // RESOURCE
+
+
+// Resources
+SOURCEPATH      ../srcdata
+START RESOURCE  callhandlingui.rss
+TARGETPATH APP_RESOURCE_DIR
+HEADER
+LANGUAGE_IDS
+END  // RESOURCE
+
+SOURCEPATH      ../srcdata
+START RESOURCE  phoneuitouch.rss
+TARGETPATH APP_RESOURCE_DIR
+HEADER
+LANGUAGE_IDS
+END  // RESOURCE
+
+START RESOURCE ../srcdata/phoneui_reg.rss
+DEPENDS phoneui.rsg
+HEADER
+TARGETPATH /private/10003a3f/apps
+END  // RESOURCE
+
+#endif // __SECURE_DATA__
+
+LIBRARY         euser.lib
+LIBRARY         cone.lib
+LIBRARY         apparc.lib
+LIBRARY         eikcore.lib
+LIBRARY         avkon.lib
+LIBRARY         bafl.lib
+LIBRARY         eikcoctl.lib // menu bar
+
+#ifndef __WINS__
+LIBRARY         efsrv.lib
+#endif
+
+LIBRARY         ws32.lib
+LIBRARY         apgrfx.lib  // Apa server
+
+LIBRARY         phoneuiview.lib
+LIBRARY         phoneuicontrol.lib
+LIBRARY         phoneuiutils.lib
+LIBRARY         featmgr.lib // FeatureManager
+
+LIBRARY         cdlengine.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/group/phoneui_stub.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,36 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing phoneui stub.
+;
+; Languages
+&EN
+
+; Header
+#{"phoneui"}, (0x100058B3), 1, 0, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files
+
+;
+;  phoneui
+;
+"" - "z:\sys\bin\phoneui.exe"
+"" - "z:\resource\apps\phoneui_aif.mif"
+"" - "z:\resource\apps\phoneui.rsc"
+"" - "z:\private\10003a3f\apps\phoneui_reg.rsc"
Binary file phoneapp/phoneui/group/phoneui_stub.sis has changed
Binary file phoneapp/phoneui/help/data/xhtml.zip has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/help/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - Initial contribution
+* 
+* Contributors:
+* 
+* 
+* Description:
+* Export help related files.
+*
+*/
+
+#include <platform_paths.hrh>				
+PRJ_EXPORTS
+:zip ../data/xhtml.zip   /epoc32/data/z/resource/ overwrite
+:zip ../data/xhtml.zip   /epoc32/winscw/c/resource/ overwrite
+
+../inc/incl.hlp.hrh	MW_LAYER_PLATFORM_EXPORT_PATH(csxhelp/incl.hlp.hrh)
+../rom/phoneuihelps_variant.iby		CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(phoneuihelps_variant.iby)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/help/inc/incl.hlp.hrh	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description:
+*
+*/
+	
+//
+// incl.hlp.hrh generated by CSXHelp Utilities.
+//           
+
+#ifndef __INCL_HLP_HRH__
+#define __INCL_HLP_HRH__
+
+_LIT(KDIALER_HLP_MAIN, "DIALER_HLP_MAIN"); // 
+_LIT(KINCAL_HLP_CALL_HANDLING, "INCAL_HLP_CALL_HANDLING"); // 
+_LIT(KDIALER_HLP_SEND_DTMF, "DIALER_HLP_SEND_DTMF"); // 
+_LIT(KINCAL_HLP_VIDEO_CALL, "INCAL_HLP_VIDEO_CALL"); // 
+
+#endif 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/help/rom/phoneuihelps_variant.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef __PHONEUIHELPS_VARIANT_IBY__
+#define __PHONEUIHELPS_VARIANT_IBY__
+
+#if defined(FF_S60_HELPS_IN_USE)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x100058B3\contents.zip, RESOURCE_FILES_DIR\xhtml\%02d\0x100058B3\contents.zip)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x100058B3\index.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x100058B3\index.xml)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x100058B3\keywords.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x100058B3\keywords.xml)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x100058B3\meta.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x100058B3\meta.xml)
+#endif
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/inc/cphoneapplication.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Provide a basis for applications working 
+                 within the framework provided by Avkon.
+*
+*/
+
+
+#ifndef CPHONEAPPLICATION_H
+#define CPHONEAPPLICATION_H
+
+//  INCLUDES
+#include <eikenv.h>
+#include <eikapp.h>
+#include <eikappui.h>
+#include <aknapp.h>
+#include <eikdoc.h>
+
+#include "phoneconstants.h"
+
+// CONSTANTS
+
+// CLASS DECLARATION
+class CPhoneLibraryContainer;
+
+/**
+*  Application class for the PhoneUI.
+*
+*  @since 4.0
+*/
+class CPhoneApplication : public CAknApplication
+    {
+    public:
+ 
+        /**
+        * From CEikApplication, creates an instance of the document for 
+        * application.
+        *
+        * @return Returns the created instance.
+        */
+        CApaDocument* CreateDocumentL();
+
+        /**
+        * From CEikApplication, returns the uid of the application.
+        *
+        * @return Returns the uid.
+        */
+        TUid AppDllUid() const;
+
+        /**
+        * destructor
+        */
+        ~CPhoneApplication();
+
+    protected:
+
+        /**
+        * From CAknApplication, called before document construction.
+        * Creates factories.
+        */
+        void PreDocConstructL();
+
+    private:
+        /**
+        * From CAknApplication Returns the application resource file name.
+        */
+        TFileName ResourceFileName() const;
+
+        // Library handle container
+        CPhoneLibraryContainer*      iLibraryContainer;
+    };
+
+#endif      // CPHONEAPPLICATION_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/inc/cphoneappui.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,295 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  AppUI for PhoneUI
+*
+*/
+
+
+#ifndef CPHONEAPPUI_H
+#define CPHONEAPPUI_H
+
+//  INCLUDES
+#include <aknappui.h>
+#include <eikbtgpc.h>
+#include <eikmenub.h> 
+#include "mphonepubsubobserver.h"
+#include "cphonerecoverysystem.h"
+
+// FORWARD DECLARATIONS
+class CPhoneViewController;
+class CPhoneUIController;
+class CPhoneQwertyHandler;
+class CEnvironmentChangeNotifier;
+
+// CLASS DECLARATION
+
+/**
+*  AppUI for the PhoneUI.
+*
+*  @since 4.0
+*
+*/
+class CPhoneAppUI :
+    public CAknAppUi,
+    public MCoeViewActivationObserver,
+    public MAknAliasKeyCodeResolver,
+    private MPhonePubSubObserver 
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CPhoneAppUI();
+
+        /**
+        * Destructor.
+        */
+        ~CPhoneAppUI();
+
+        /**
+        * Symbian OS constructor.
+        */
+        void ConstructL();
+
+    public: // Functions from base classes
+
+        /**
+        * From CAknAppUi, handles window server events.
+        * @param aEvent event.
+        * @param aDestination destination control.
+        */
+        virtual void HandleWsEventL( 
+            const TWsEvent& aEvent,
+            CCoeControl* aDestination );
+
+        /**
+        * From CAknAppUi, handle key events.
+        * @param aKeyEvent a key event
+        * @param aType a key event type
+        */
+        TKeyResponse HandleKeyEventL( 
+            const TKeyEvent& aKeyEvent, 
+            TEventCode aType );
+
+        /**
+        * From CAknAppUi, handles command.
+        *
+        * This method is called first when command is to be performed. Then
+        * control flow goes to HandleCommandL.
+        *
+        * @param aCommand command to be handled.
+        */
+        void ProcessCommandL( TInt aCommand );
+
+        /**
+        * From CAknAppUi, handles commands.
+        *
+        * @param aCommand It is the code of the command to be handled.
+        */
+        void HandleCommandL( TInt aCommand );
+
+        /**
+        * 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.
+        */
+        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.
+        */
+        void DynInitMenuBarL( TInt aResourceId, CEikMenuBar* aMenuBar );
+
+        /**
+        * From CAknAppUi, indicates when app ui is on the foreground.
+        * @param aForeground It is true if app is on the foreground.
+        */
+        void HandleForegroundEventL( TBool aForeground );
+
+        /**
+        * From CAknAppUi, handles status pane size change.
+        */
+        void HandleStatusPaneSizeChange();
+
+        /**
+        * From CAknAppUi. For idle state monitor
+        */
+        void HandleApplicationSpecificEventL( 
+            TInt aType,
+            const TWsEvent& aEvent );
+
+        /**
+        * From CAknAppUi, handles resouce changes.
+        */
+        void HandleResourceChangeL( TInt aType );
+
+        /**
+        * From MCoeViewActivationObserver
+        */
+        void HandleViewActivation(
+            const TVwsViewId& aNewlyActivatedViewId,
+            const TVwsViewId& aViewIdToBeDeactivated );
+
+        /**
+        * From CAknAppUi
+        * Handles view deactivation.
+        * @param aViewIdToBeDeactivated:Id of view to be deactivated.
+        * @param aNewlyActivatedViewId: Id of view to be activated.        
+        */
+        void HandleViewDeactivation(
+            const TVwsViewId& aViewIdToBeDeactivated,
+            const TVwsViewId& aNewlyActivatedViewId );
+
+        /** 
+        * From CCoeAppUi
+        * Returns help context
+        */
+        virtual CArrayFix<TCoeHelpContext>* HelpContextL() const; 
+
+        // STARTUP SIGNALLING
+
+        /**
+        * Performs startup signalling. 
+        *
+        * Calls either idle or security signalling.
+        */
+        static TInt DoStartupSignalL( TAny* aAny );
+
+        /**
+        * Idle signalling.
+        */
+        TInt DoStartupSignalIdleL();
+
+        /**
+        * Security signalling. 
+        */
+        TInt DoStartupSignalSecurityL();
+
+    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
+        */
+        IMPORT_C virtual void HandlePropertyChangedL( 
+            const TUid& aCategory,
+            const TUint aKey,
+            const TInt aValue );
+
+	public: // From MAknAliasKeyCodeResolver
+	
+		/**
+		* @see MAknAliasKeyCodeResolver
+		*/        
+		TInt GetAliasKeyCode( TUint& aCode, 
+							  const TKeyEvent& aKeyEvent,
+							  TEventCode aType);  
+		
+	private:
+
+        /**
+        * Handle enviroment changes
+        */
+        void HandleEnvironmentChangeL( const TInt aChanges ); 
+        
+        /**
+        * Process Window server events.
+        */
+        void ProcessWsEventL( 
+            const TWsEvent& aEvent, 
+            CCoeControl* aDestination );
+            
+        void LayoutMainView();
+        
+        /**
+        * Called in callback
+        */
+        static TInt HandleCallBackL( TAny* aAny );
+
+        /**
+        * Callback pointed to specific instance
+        */
+        void DoHandleCallBackL();
+        
+        /**
+        * NoKey specil handling
+        */
+        void NoKeySpecialHandlingL( 
+                    const TKeyEvent& aKeyEvent,
+					TEventCode aType);  
+
+    private: // Data types
+
+        // Startup states.
+        // EPhoneStartupInitial - Initial state.
+        // EPhoneStartedUp - Phone application is ready.
+        // EPhoneIdleStartedUp - Idle application is ready.
+        enum
+            {
+            EPhoneStartupInitial = 0x00000001,
+            EPhoneStartedUp = 0x00000002,
+            EPhoneIdleStartedUp = 0x00000004
+            };
+
+    private: // Data
+
+        CPhoneViewController *iPhoneViewController;
+        
+        // Phone UI controller
+        CPhoneUIController* iPhoneUIController;    
+
+        //      Owned: Eikon server window group.
+        TInt iEikonServerWgId;
+
+        // STARTUP SIGNALLING
+
+        // 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;
+
+        // Id of system event client - Idle started up.
+        TInt iIdleReadyEventId;
+        
+        // Id of system event client - topmost application.
+        TInt iTopmostAppId;
+
+        // Id of system events from Starter states.
+        TInt iStarterEventId;
+        
+        CPhoneQwertyHandler* iQwertyHandler;
+        
+        // System evenviroment notifier
+        CEnvironmentChangeNotifier* iEnvChangeNotifier;
+        
+        //Indicates whether onscreen dialer is defined
+        TBool iOnScreenDialer;
+        
+
+    };
+
+#endif      // CPHONEAPPUI_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/inc/cphonedocument.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Application document class.
+*
+*/
+
+
+#ifndef CPHONEDOCUMENT_H
+#define CPHONEDOCUMENT_H
+
+//  INCLUDES
+#include <AknDoc.h>
+
+// FORWARD DECLARATION
+class CApaWindowGroupName;
+
+// CLASS DECLARATION
+
+/**
+*  Application document class for the PhoneUI.
+*
+*  @since 4.0
+*
+*/
+class CPhoneDocument : public CAknDocument
+    {
+      public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CPhoneDocument( CEikApplication& aApp );
+
+        /**
+        * Two-phased constructor.
+        */
+        static CPhoneDocument* NewL( CEikApplication& aApp );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneDocument();
+
+        /**
+        * @see CEikDocument::UpdateTaskNameL
+        * @since 2.8
+        */
+        void UpdateTaskNameL( CApaWindowGroupName* aWgName );
+
+    private:
+
+        /**
+        * From CAknDocument: Creates an instance of application UI
+        */
+        CEikAppUi* CreateAppUiL();
+ 
+    };
+
+#endif      // CPHONEDOCUMENT_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/loc/basiccallhandling.loc	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*     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/phoneui/loc/callheadertexts.loc	Mon Jan 18 20:18:27 2010 +0200
@@ -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/phoneui/loc/callterminationnote.loc	Mon Jan 18 20:18:27 2010 +0200
@@ -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/phoneui/loc/dialer.loc	Mon Jan 18 20:18:27 2010 +0200
@@ -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/phoneui/loc/dtmfsignalling.loc	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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/phoneui/loc/incallmenuandsoftkeys.loc	Mon Jan 18 20:18:27 2010 +0200
@@ -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/phoneui/loc/incalloperations.loc	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,566 @@
+/*
+* 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"
+
+
+// d: Tooltip text for callhandling toolbar 'loudspeaker' button.
+// l: popup_preview_text_window_t1  
+// w:
+// r: 9.2
+//
+#define qtn_incal_tooltip_loudspeaker "Activate loudspeaker"
+
+// d: Tooltip text for callhandling toolbar 'handset' button.
+// l: popup_preview_text_window_t1  
+// w:
+// r: 9.2
+//
+#define qtn_incal_tooltip_handset "Activate handset"
+
+// d: Tooltip text for callhandling toolbar 'Mute' button.
+// l: popup_preview_text_window_t1  
+// w:
+// r: 9.2
+//
+#define qtn_incal_tooltip_mute "Mute microphone"
+
+// d: Tooltip text for callhandling toolbar 'UnMute' button.
+// l: popup_preview_text_window_t1  
+// w:
+// r: 9.2
+//
+#define qtn_incal_tooltip_unmute "Unmute microphone"
+
+// d: Tooltip text for callhandling toolbar 'Contacts' button.
+// l: popup_preview_text_window_t1  
+// w:
+// r: 9.2
+//
+#define qtn_incal_tooltip_contacts "Open Contacts"
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/loc/mobileoriginatedcalls.loc	Mon Jan 18 20:18:27 2010 +0200
@@ -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/phoneui/loc/multicallhandling.loc	Mon Jan 18 20:18:27 2010 +0200
@@ -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/phoneui/loc/numberentry.loc	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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/phoneui/loc/phone.loc	Mon Jan 18 20:18:27 2010 +0200
@@ -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/phoneui/loc/voip.loc	Mon Jan 18 20:18:27 2010 +0200
@@ -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/phoneui/rom/phoneui.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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__
+
+#ifdef RD_PHONE_NG
+
+#include <data_caging_paths_for_iby.hrh>
+
+REM PhoneUI
+S60_APP_EXE(phoneui)
+//S60_APP_BITMAP(phoneui)
+S60_APP_AIF_ICONS(phoneui)
+S60_APP_AIF_RSC(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\phoneuiview.dll       	SHARED_LIB_DIR\phoneuiview.dll
+file=ABI_DIR\BUILD_DIR\phoneuistates.dll        SHARED_LIB_DIR\phoneuistates.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\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\phoneuiview_stub.sis           System\Install\phoneuiview_stub.sis
+data=ZSYSTEM\install\phonemediatorcenter_stub.sis   System\Install\phonemediatorcenter_stub.sis
+data=ZSYSTEM\install\phoneuivoipextension_stub.sis  System\Install\phoneuivoipextension_stub.sis
+
+#endif // RD_PHONE_NG
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/rom/phoneuiresources.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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__
+
+#ifdef RD_PHONE_NG
+
+#include <data_caging_paths_for_iby.hrh>
+
+//Resource file(s) for PhoneUI
+data=DATAZ_\APP_RESOURCE_DIR\phoneui.rsc APP_RESOURCE_DIR\phoneui.rsc
+
+data=DATAZ_\RESOURCE_FILES_DIR\PhoneClient.rsc RESOURCE_FILES_DIR\PhoneClient.rsc
+data=DATAZ_\RESOURCE_FILES_DIR\PhoneServer.rsc RESOURCE_FILES_DIR\PhoneServer.rsc
+
+#ifdef FF_TOUCH_CALL_HANDLING
+data=DATAZ_\APP_RESOURCE_DIR\callhandlingui.rsc APP_RESOURCE_DIR\callhandlingui.rsc
+data=DATAZ_\APP_RESOURCE_DIR\phoneuitouch.rsc APP_RESOURCE_DIR\phoneuitouch.rsc
+#endif // FF_TOUCH_CALL_HANDLING
+
+
+#endif // RD_PHONE_NG
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/rom/phoneuiresourcesvoip.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  PhoneUI Resources iby file
+*
+*/
+
+
+#ifndef __PHONEUI_RESOURCES_VOIP_IBY__
+#define __PHONEUI_RESOURCES_VOIP_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+// VoIP specific resource file for PhoneUI
+
+data=DATAZ_\APP_RESOURCE_DIR\phoneuivoip.rsc APP_RESOURCE_DIR\phoneuivoip.rsc
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/src/cphoneapplication.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,141 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Application class.
+*
+*/
+
+
+// INCLUDE FILES
+#include    <bautils.h>
+#include    <data_caging_path_literals.hrh>
+#include    <eikstart.h>
+#include    "phoneconstants.h"
+#include    "cphoneapplication.h"
+#include    "cphonedocument.h"
+#include    "cphonelibrarycontainer.h"
+#include    "cphonemainresourceresolver.h"
+#include    "phoneconstants.h"
+#include    "phonelogger.h"
+#include    "cphonecenrepproxy.h"
+#include    "cphonepubsubproxy.h"
+
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneApplication::CreateDocumentL
+// Creates the document
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+CApaDocument* CPhoneApplication::CreateDocumentL()
+    {   
+    return CPhoneDocument::NewL( *this ); 
+    }
+
+// ---------------------------------------------------------
+// CPhoneApplication::AppDllUid
+// Returns the application dll uid
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TUid CPhoneApplication::AppDllUid() const
+    {
+    return KUidPhoneApplication;
+    }
+
+// ---------------------------------------------------------
+// CPhoneApplication::~CPhoneApplication()
+// ---------------------------------------------------------
+//
+CPhoneApplication::~CPhoneApplication()
+    {
+    // Delete library handle container ( it unloads all factory DLLs )
+    delete iLibraryContainer;
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+//
+// ---------------------------------------------------------
+// NewApplication implements
+// 
+// Creates an instance of application.
+//
+// Returns: an instance of CPAApplication
+// ---------------------------------------------------------
+//
+EXPORT_C CApaApplication* NewApplication()
+    {
+    return new CPhoneApplication;
+    }
+
+// ---------------------------------------------------------
+// CPhoneApplication::ResourceFileName()
+// Called by framework before creating a document. 
+// ---------------------------------------------------------
+//
+TFileName CPhoneApplication::ResourceFileName() const
+    {
+    // Create path to default resource file name
+    TFileName path( KDriveZ );
+    path.Append( KDC_APP_RESOURCE_DIR );
+    path.Append( KPhoneResourceFile );
+
+    // Get correct resourse file among current language
+    RFs &fsSession=iCoeEnv->FsSession();
+    BaflUtils::NearestLanguageFile( fsSession, path ); 
+    
+    return path;
+    }
+// ---------------------------------------------------------
+// CPhoneApplication::PreDocConstructL()
+// Called by framework before creating a document. 
+// ---------------------------------------------------------
+//
+void CPhoneApplication::PreDocConstructL()
+    {   
+    // Create container for factory DLLs. It is deleted as last thing when
+    // application exists, in CPhoneApplication destructor. This ensures that DLLs,
+    // which contain the implementation for the objects that are created in factory,
+    // are usable as long as needed.
+    iLibraryContainer = CPhoneLibraryContainer::NewL();
+
+    // Create logger singleton instance.
+    // We do not need pointer to it in here and class is deleted 
+    // somewhere in coeenv.
+    new (ELeave) CPhoneLogger(KUidPhoneUILoggerSingleton);
+
+    // Create Central Repository Proxy
+    CPhoneCenRepProxy::Instance();
+
+    // Create Publish & Subscribe Proxy
+    CPhonePubSubProxy::Instance();
+
+    // Create main resource resolver
+    CPhoneMainResourceResolver::Instance();
+
+    CAknApplication::PreDocConstructL();
+    }
+
+// -----------------------------------------------------------------------------
+// E32Main
+// -----------------------------------------------------------------------------
+//
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication( NewApplication );
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/src/cphoneappui.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,941 @@
+/*
+* 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:  Application UI class implementation. 
+*
+*/
+
+
+// INCLUDE FILES
+#include <eikenv.h>
+#include <coemain.h>
+#include <coehelp.h>
+#include <bacntf.h>
+#include <starterclient.h>
+#include <telinternalpskeys.h>
+#include <activeidle2domainpskeys.h>
+#include <telremotepartyinformationpskeys.h>
+#include <telinformationpskeys.h>
+#include <UikonInternalPSKeys.h>
+#include <startupdomainpskeys.h>
+#include <apgtask.h>
+#include <apgwgnam.h>
+#include <barsread.h>
+#include <coemain.h>
+#include <AknsConstants.h>   // KAknsMessageSkinChange
+#include <bautils.h>
+#include <StringLoader.h>
+#include <aknsoundsystem.h>
+#include <aknnotewrappers.h> // for Notification for startup...
+#include <eikbtgpc.h>
+#include <eiksoftkeyimage.h> // EikSoftkeyImage
+#include <featmgr.h>         // Feature Manager
+#include <bldvariant.hrh>    // System variant definition
+#include <phoneui.rsg>
+#include "phoneui.pan"
+#include "cphoneappui.h"
+#include "cphoneapplication.h"
+#include "cphonedocument.h"
+#include "cphonekeys.h"
+#include "cphoneview.h" // from PhoneUIView
+#include "cphoneviewcontroller.h"
+#include "cphoneuicontroller.h"
+#include "cphonepubsubproxy.h"
+#include "phonelogger.h"
+#include "phoneconstants.h"
+#include "cphoneclearblacklist.h"
+#include "cphonestatuspane.h"
+#include "cphoneqwertyhandler.h"
+#include "tphonecmdparaminteger.h"
+#ifndef __WINS__
+#include <f32file.h>
+#endif
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneAppUI::CPhoneAppUI()
+// Default constructor
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+CPhoneAppUI::CPhoneAppUI() : 
+    iAppsReady( EPhoneStartupInitial )
+    {            
+    }
+
+// ---------------------------------------------------------
+// CPhoneAppUI::~CPhoneAppUI()
+// Destructor
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+CPhoneAppUI::~CPhoneAppUI()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneAppUI::~CPhoneAppUI() ");
+    if ( iPhoneViewController )
+        {
+        RemoveFromStack( iPhoneViewController->PhoneView() );
+        delete iPhoneViewController;
+        }
+    delete iPhoneUIController;
+    delete iQwertyHandler;
+    
+    CPhoneRecoverySystem::Remove( iStartupSignalRecoveryId );
+
+    delete iEnvChangeNotifier;
+    iEnvChangeNotifier = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAppUI::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CPhoneAppUI::ConstructL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneAppUI::ConstructL() ");
+    // Requires the availability of CBA and Menubar resources
+    BaseConstructL( EAknEnableSkin | EAknEnableMSK | EAknSingleClickCompatible );
+    SetKeyEventFlags( CAknAppUiBase::EDisableSendKeyShort | CAknAppUiBase::EDisableSendKeyLong );
+    
+    SetAliasKeyCodeResolverL( this );
+    
+    // Set phone application to be system application so it can't be closed
+    iEikonEnv->SetSystem( ETrue );
+
+    // Disable priority changes of window server and set
+    // process priority (phone app might be on the background
+    // and so it's priority might be low).
+    iEikonEnv->WsSession().ComputeMode( 
+        RWsSession::EPriorityControlDisabled ); 
+    RThread().SetProcessPriority( EPriorityHigh  );
+
+    // System enviroment change notifier.
+    iEnvChangeNotifier = CEnvironmentChangeNotifier::NewL( 
+        CActive::EPriorityStandard, TCallBack( HandleCallBackL, this ) );
+        
+    iEnvChangeNotifier->Start();
+
+    // Push key sounds to sound system.
+    CAknKeySoundSystem* keySounds = KeySounds();
+    keySounds->PushContextL( R_PHONEUI_DEFAULT_SKEY_LIST );
+   
+    iPhoneViewController = CPhoneViewController::NewL( ClientRect() );
+    iPhoneUIController = CPhoneUIController::NewL( iPhoneViewController );
+    iQwertyHandler = CPhoneQwertyHandler::NewL();        
+
+    // Blacklist singleton is initialized here
+    // return value is ignored since we do not require its services in this class
+    CPhoneClearBlacklist::CreateL( 
+        iEikonEnv->WsSession(), 
+        *iPhoneViewController->PhoneView()->DrawableWindow() );
+
+    RegisterViewL( *iPhoneViewController->PhoneView() );
+    AddToStackL( iPhoneViewController->PhoneView(), ECoeStackPriorityDefault );
+
+    const_cast<CEikAppUi*>( 
+        iEikonEnv->EikAppUi() )->AddViewActivationObserverL( this );
+
+    // Eikon server window group
+    iEikonServerWgId = 
+        iEikonEnv->WsSession().FindWindowGroupIdentifier( 0, KPhoneEikonServer );
+    __ASSERT_ALWAYS( iEikonServerWgId != KErrNotFound, Panic( EPhoneUiNoWindowGroup ) );
+    iEikonEnv->RootWin().EnableFocusChangeEvents(); 
+    iEikonEnv->RootWin().EnableGroupChangeEvents();
+
+    // CLI Name.
+    TInt err = RProperty::Define( 
+        KPSUidTelRemotePartyInformation,
+        KTelCLIName,
+        RProperty::EText,
+        KPhoneReadPolicy,
+        KPhoneWritePolicy );
+
+    __PHONELOG1( 
+        EBasic, 
+        EPhonePhoneapp, 
+        "CPhoneAppUI::ConstructL() - Define CLIName property (status=%d)", 
+        err );
+      
+    // CLI Number.
+    err = RProperty::Define( 
+        KPSUidTelRemotePartyInformation,
+        KTelCLINumber,
+        RProperty::EText,
+        KPhoneReadPolicy,
+        KPhoneWritePolicy );
+
+    __PHONELOG1( 
+        EBasic, 
+        EPhonePhoneapp, 
+        "CPhoneAppUI::ConstructL() - Define CLINumber property (status=%d)", 
+        err );
+
+    // Define the top application system property
+    err = RProperty::Define( 
+        KPSUidUikon,
+        KUikVideoCallTopApp,
+        RProperty::EInt,
+        KPhoneReadPolicy,
+        KPhoneWritePolicy );
+
+    __PHONELOG1( 
+        EBasic, 
+        EPhonePhoneapp, 
+        "CPhoneAppUI::ConstructL() Define top application property (status=%d)", 
+        err );
+
+    // 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 );
+
+    __PHONELOG1( 
+        EBasic, 
+        EPhonePhoneapp, 
+        "CPhoneAppUI::ConstructL() Define phone property (status=%d)", 
+        err );
+           
+    // 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 );
+
+    __PHONELOG1( 
+        EBasic, 
+        EPhonePhoneapp, 
+        "CPhoneAppUI::ConstructL() StartupState value", 
+        startupState );
+        
+    if ( startupState == ESwStateCriticalPhaseOK ||
+        startupState == ESwStateEmergencyCallsOnly ||
+        startupState == ESwStateNormalRfOn ||
+        startupState == ESwStateNormalRfOff ||
+        startupState == ESwStateNormalBTSap )
+        {
+        __PHONELOG( 
+            EBasic, 
+            EPhonePhoneapp, 
+            "CPhoneAppUI::ConstructL() Notify Starter that phone is ready..." );
+            
+        CPhoneRecoverySystem::Instance()->RecoverNow(
+            iStartupSignalRecoveryId, 
+            CTeleRecoverySystem::EPhonePriorityHigh );
+        }
+    else
+        {        
+        __PHONELOG( 
+            EBasic, 
+            EPhonePhoneapp, 
+            "CPhoneAppUI::ConstructL() Startup not ready yet. Start listening..." );            
+        CPhonePubSubProxy::Instance()->NotifyChangeL(
+            KPSUidStartup,
+            KPSGlobalSystemState,
+            this );
+        }
+
+
+    // THE VERY LAST STEP: DROP PRIORITY.
+    RThread().SetPriority( EPriorityNormal );
+
+    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;   
+        }
+    __PHONELOG( EBasic, EPhonePhoneapp, "CPhoneAppUI::ConstructL() Phone started..." );
+    __PHONELOG( EBasic, EPhonePhoneapp, "CPhoneAppUI::ConstructL() done..." );
+    }
+   
+// -----------------------------------------------------------------------------
+// CPhoneAppUI::DoStartupSignalL
+//
+// Callback function.
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneAppUI::DoStartupSignalL( TAny* aAny )
+    {
+    CPhoneAppUI* appUi =
+        static_cast< CPhoneAppUI* >( aAny );
+    
+    return
+        !appUi->iLightIdleReached ?
+            appUi->DoStartupSignalIdleL() :
+            appUi->DoStartupSignalSecurityL();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAppUI::DoStartupSignalIdleL
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneAppUI::DoStartupSignalIdleL()
+    {
+    TBool idleReached = EFalse;
+    
+    // Check if Idle application has been started.
+    const TInt idleUid = CPhonePubSubProxy::Instance()->Value(
+            KPSUidAiInformation,
+            KActiveIdleUid );
+
+    if ( idleUid != 0 && idleUid != KErrNotFound )
+        {
+        // Idle application has already started
+        if ( !( iAppsReady & EPhoneIdleStartedUp ) )
+            {
+            __PHONELOG1( EBasic, EPhonePhoneapp, "CPhoneAppUI::ConstructL() Idle App started (uid=%d)!", idleUid );
+            iAppsReady += EPhoneIdleStartedUp;
+            
+            // Remove Phone application from Fast Swap Window.
+            iPhoneViewController->SetHiddenL( ETrue );
+            
+            // Set Idle's UID to PubSub.
+            CPhonePubSubProxy::Instance()->ChangePropertyValue(
+                KPSUidUikon,
+                KUikVideoCallTopApp,
+                idleUid );
+            }
+        }
+    else
+        {
+        CPhonePubSubProxy::Instance()->NotifyChangeL(
+            KPSUidAiInformation,
+            KActiveIdleUid,
+            this );   
+        }
+
+    const TInt current = CPhonePubSubProxy::Instance()->Value(
+        KPSUidStartup,
+        KPSGlobalSystemState );
+
+    __PHONELOG1( EBasic, EPhonePhoneapp, "CPhoneAppUI::DoStartupSignalIdleL() System state=%d", current );
+    if ( current == ESwStateSelfTestOK ||
+        current == ESwStateCriticalPhaseOK )
+        {                       
+        // Check that both the Phone and Idle applications are ready
+        idleReached = ( iAppsReady & EPhoneStartedUp ) &&
+             ( iAppsReady & EPhoneIdleStartedUp );
+
+        if ( idleReached )
+            {
+            __PHONELOG( EBasic, EPhonePhoneapp, "CPhoneAppUI::DoStartupSignalIdleL() Phone and Idle apps have both been started" );
+
+            CPhonePubSubProxy::Instance()->ChangePropertyValue(
+                KPSUidStartup,
+                KPSPhonePhase1Ok,
+                EPhonePhase1Ok );
+            }
+        }
+    else 
+        {
+        idleReached = ( iAppsReady & EPhoneIdleStartedUp ) && 
+            ( current == ESwStateEmergencyCallsOnly ||
+            current == ESwStateNormalRfOn ||
+            current == ESwStateNormalRfOff ||
+            current == ESwStateNormalBTSap );
+
+        __PHONELOG1( EBasic, EPhonePhoneapp, "CPhoneAppUI::DoStartupSignalIdleL() System state is not at SelfTestOk. Idle reached anyway?=%d", idleReached );
+        }
+
+    if ( idleReached )
+        {
+        __PHONELOG( EBasic, EPhonePhoneapp, "CPhoneAppUI::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 
+        {
+        __PHONELOG( EBasic, EPhonePhoneapp, "CPhoneAppUI::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;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAppUI::DoStartupSignalSecurityL
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneAppUI::DoStartupSignalSecurityL()
+    {
+    TInt err = KErrNone;    
+    return err;
+    }
+
+// -----------------------------------------------------------
+// CPhoneAppUI::HandlePropertyChangedL
+// -----------------------------------------------------------
+//
+void CPhoneAppUI::HandlePropertyChangedL( 
+    const TUid& aCategory,
+    const TUint aKey,
+    const TInt aValue )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneAppUI::HandlePropertyChangedL( ) ");
+
+    if ( aCategory == KPSUidAiInformation )
+        {
+        // Call state event
+        if ( aKey == KActiveIdleUid )
+            {
+            __PHONELOG( EBasic, EPhonePhoneapp, "CPhoneAppUi::HandleChangeL() Idle event" );
+            TInt idleUid = aValue;
+            
+            // If idle startup is ok.
+            if ( idleUid != 0 )
+                {
+                // If idle startup is ok for the first time, then recover
+                // the Start signal processing
+                if ( !( iAppsReady & EPhoneIdleStartedUp ) )
+                    {            
+                    __PHONELOG( EBasic, EPhonePhoneapp, 
+                        "CPhoneAppUI::HandlePropertyChangedL() Idle App started!" );
+                    iAppsReady += EPhoneIdleStartedUp;
+                    // Try to update the startup signal again
+                    CPhoneRecoverySystem::Instance()->RecoverNow(
+                        iStartupSignalRecoveryId, 
+                        CTeleRecoverySystem::EPhonePriorityHigh );    
+                    // Remove Phone application from Fast Swap Window.
+                    iPhoneViewController->SetHiddenL( ETrue );
+                    // Set Idle's UID to PubSub.
+                    CPhonePubSubProxy::Instance()->ChangePropertyValue(
+                        KPSUidUikon,
+                        KUikVideoCallTopApp,
+                        idleUid );
+                    }
+                }
+            }
+        }
+
+    if ( aCategory == KPSUidStartup )
+        {
+        __PHONELOG( EBasic, EPhonePhoneapp, "CPhoneAppUi::HandleChangeL() Starter event" );
+        const TInt startupState = CPhonePubSubProxy::Instance()->Value(
+            KPSUidStartup,
+            KPSGlobalSystemState );
+
+        __PHONELOG1( EBasic, EPhonePhoneapp, "CPhoneAppUI::HandleChangeL() StartupState value", startupState );
+        if ( startupState == ESwStateCriticalPhaseOK ||
+            startupState == ESwStateEmergencyCallsOnly ||
+            startupState == ESwStateNormalRfOn ||
+            startupState == ESwStateNormalRfOff ||
+            startupState == ESwStateNormalBTSap )
+            {
+            // Try to update the startup signal again
+            CPhoneRecoverySystem::Instance()->RecoverNow(
+                iStartupSignalRecoveryId, 
+                CTeleRecoverySystem::EPhonePriorityHigh );    
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneAppUI::HandleEnvironmentChangeL
+// -----------------------------------------------------------------------------
+//
+void CPhoneAppUI::HandleEnvironmentChangeL( const TInt aChanges )
+    {
+    // Pass environment changes to the UI controller
+    iPhoneUIController->HandleEnvironmentChangeL( aChanges );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAppUI::HandleWsEventL
+// -----------------------------------------------------------------------------
+//
+void CPhoneAppUI::HandleWsEventL( 
+    const TWsEvent& aEvent,
+    CCoeControl* aDestination )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAppUI::HandleWsEventL" );
+    
+    // Only handle window server events if startup is finished
+    if ( iLightIdleReached )
+        {
+        __PHONELOG3( EBasic, EPhonePhoneapp, "CPhoneAppUI::HandleWsEvent( key(%d), iCode(%d), type(%d) )",
+            aEvent.Key()->iScanCode, aEvent.Key()->iCode, aEvent.Type() );
+
+        CEikonEnv& eikEnv = *iEikonEnv;
+        CCoeEnv& coeEnv = eikEnv; 
+
+        const TInt type = aEvent.Type();
+        switch ( type )
+            {
+            case EEventFocusGained:
+                {
+                const TInt foregroundApp = 
+                    iPhoneViewController->ForegroundApplicationWindowGroupId();
+                const TInt thisApplicationWgId = 
+                    iPhoneViewController->ApplicationWindowGroupId();
+                
+                if ( thisApplicationWgId != foregroundApp )
+                    {
+                    // Focus gained but phone is not in fore then phone need
+                    // to bring idle to fore if needed.
+                    iPhoneUIController->HandleIdleForegroundEventL();
+                    }
+                else
+                    {
+                    iPhoneUIController->HandlePhoneForegroundEventL();
+                    }
+                }
+                break;
+            
+            case EEventFocusLost:
+                {
+                const TInt windowGroupId = 
+                    coeEnv.WsSession().GetFocusWindowGroup();
+                const TInt foregroundAppWgId = 
+                    iPhoneViewController->ForegroundApplicationWindowGroupId();
+                const TInt phoneApplicationWgId = 
+                    iPhoneViewController->ApplicationWindowGroupId();
+                // If phone app is not in fore and we receive focuslost then we
+                // need to send focus lost event to state which then updates
+                // FSW to correct state. 
+                if ( ( foregroundAppWgId != phoneApplicationWgId ) && 
+                        ( windowGroupId != phoneApplicationWgId ) && 
+                        ( windowGroupId != iEikonServerWgId ) )
+                    {
+                    iPhoneUIController->HandlePhoneFocusLostEventL();
+                    }
+                }
+                break;
+
+            case EEventKey:
+                {
+                TKeyEvent* keyEvent = aEvent.Key();
+                
+                if ( keyEvent->iScanCode == EStdKeyNo )
+                    {
+                    NoKeySpecialHandlingL( *keyEvent, EEventKey );    
+                    }
+                    
+                 //will be called if exit number is typed (*#1234#)
+                if ( keyEvent->iCode == EEikCmdExit )
+                    {
+                    Exit();
+                    return;     
+                    }
+                           
+                if ( iQwertyHandler->IsQwertyInput() )
+                    {
+                    TInt code = iQwertyHandler->NumericKeyCode( *keyEvent );
+                    TBool fepSimulated = keyEvent->iModifiers & EModifierSpecial; 
+                    if ( !fepSimulated && 
+                         ( ( code != EKeyNull && code != keyEvent->iCode ) ||
+                         ( code == EKeyNull && CPhoneKeys::IsNumericKey( 
+                                                             *keyEvent, 
+                                                             ( TEventCode ) aEvent.Type() ) ) )
+                         ) 
+                        {
+                        // Modify event according to keyboard layout
+                        TWsEvent newWsEvent = aEvent;    
+                        TKeyEvent* newKeyEvent = newWsEvent.Key();
+                        newKeyEvent->iCode = code;
+                        TInt shiftMask = EModifierLeftShift  | 
+                                         EModifierRightShift | 
+                                         EModifierShift;
+                        shiftMask = ~shiftMask;
+                        newKeyEvent->iModifiers = newKeyEvent->iModifiers & shiftMask;
+                        return CAknAppUi::HandleWsEventL( newWsEvent, aDestination );
+                        }
+                    }
+                }
+                break;
+                
+            case EEventKeyUp:
+                {
+                TKeyEvent* keyEvent = aEvent.Key();
+                
+                if ( keyEvent->iScanCode == EStdKeyNo )
+                    {
+                    NoKeySpecialHandlingL( *keyEvent, EEventKeyUp );    
+                    }    
+                }
+                break;
+                
+            case EEventKeyDown:
+                {
+                TKeyEvent* keyEvent = aEvent.Key();
+                
+                if ( keyEvent->iScanCode == EStdKeyNo )
+                    {
+                    NoKeySpecialHandlingL( *keyEvent, EEventKeyDown );    
+                    }    
+                }
+                break;
+
+
+            default:
+                break;
+            }            
+        }
+    // All events are sent to base class.
+    CAknAppUi::HandleWsEventL( aEvent, aDestination );
+    }
+
+
+// ---------------------------------------------------------
+// CPhoneAppUI::NoKeySpecialHandlingL
+// Handle no key specific cases.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CPhoneAppUI::NoKeySpecialHandlingL( const TKeyEvent& aEvent,
+                                         TEventCode aType  )
+    {
+    CEikonEnv& eikEnv = *iEikonEnv;
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAppUI::NoKeySpecialHandling" );
+    
+    // Handle case where menu bar is opened or a blocking dialog is 
+    // displayed and the end key is pressed. HandleKeyEventL will not be 
+    // called in this case so it has to be handled here.
+    if ( eikEnv.AppUiFactory()->MenuBar()->IsDisplayed() ||
+        iPhoneViewController->BlockingDialogIsDisplayed() )
+        {
+        // Send key event to the UI controller
+        iPhoneUIController->HandleKeyEventL( aEvent,  aType );
+        }    
+    }
+
+// ---------------------------------------------------------
+// CPhoneAppUI::HandleKeyEventL
+// Handle key events.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TKeyResponse CPhoneAppUI::HandleKeyEventL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode aType )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAppUI::HandleKeyEventL" );
+    // Let key event handler handle event. 
+    return iPhoneUIController->HandleKeyEventL( aKeyEvent, aType );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAppUI::ProcessCommandL
+// -----------------------------------------------------------------------------
+//
+void CPhoneAppUI::ProcessCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAppUI::ProcessCommandL()" );
+
+    if( !iPhoneUIController->ProcessCommandL( aCommand ) )
+        {
+		// State didn't handle the command so pass it up
+        CAknAppUi::ProcessCommandL( aCommand );
+        }
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAppUI::HandleCommandL
+// 
+// Forwards the request to the main view.
+// -----------------------------------------------------------------------------
+//
+void CPhoneAppUI::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAppUI::HandleCommandL()" );
+ 
+    switch (aCommand)
+        {
+        case EEikCmdExit:
+            {
+            __PHONELOG( EBasic, EPhonePhoneapp, "CPhoneAppUI::HandleCommandL -- EEikCmdExit" );
+            Exit();
+            }
+            break;
+        default:
+            {
+            if( !iPhoneUIController->HandleCommandL( aCommand ) )
+                {
+                // State didn't handle the command so pass it up
+                CAknAppUi::HandleCommandL( aCommand );
+                }
+            }
+            break;
+       }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAppUI::DynInitMenuPaneL
+// 
+// Forwards the request to the main view.
+// -----------------------------------------------------------------------------
+//
+void CPhoneAppUI::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
+    {
+    iPhoneUIController->DynInitMenuPaneL( aResourceId, aMenuPane );
+    }
+
+// ---------------------------------------------------------
+// CPAAppUIS60Base::DynInitMenuBarL
+// ---------------------------------------------------------
+//
+void CPhoneAppUI::DynInitMenuBarL(
+    TInt aResourceId, CEikMenuBar* aMenuBar)
+    {
+    iPhoneUIController->DynInitMenuBarL( aResourceId, aMenuBar );
+    }   
+
+// -----------------------------------------------------------------------------
+// CPhoneAppUI::HandleForegroundEventL
+// -----------------------------------------------------------------------------
+//
+void CPhoneAppUI::HandleForegroundEventL( TBool aForeground )
+    {
+    __PHONELOG1(
+        EBasic,
+        EPhonePhoneapp,
+        "CPhoneAppUI::HandleForegroundEventL( InForeground=%d )",
+        aForeground );
+        
+    iPhoneUIController->HandleForegroundEventL( aForeground );
+
+    CAknAppUi::HandleForegroundEventL( aForeground );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAppUI::HandleStatusPaneSizeChange
+// -----------------------------------------------------------------------------
+//
+void CPhoneAppUI::HandleStatusPaneSizeChange()
+    {
+    __PHONELOG( EBasic, EPhonePhoneapp, "CPhoneAppUI::HandleStatusPaneSizeChange" );
+    CAknAppUi::HandleStatusPaneSizeChange();
+
+    LayoutMainView();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAppUI::HandleViewDeactivation
+// -----------------------------------------------------------------------------
+//
+void CPhoneAppUI::HandleViewDeactivation(
+    const TVwsViewId& aViewIdToBeDeactivated, 
+    const TVwsViewId& aNewlyActivatedViewId )
+    {
+    __PHONELOG2(
+        EBasic,
+        EPhonePhoneapp,
+        "CPhoneAppUI::HandleViewDeactivation( aViewIdToBeDeactivated(%d), aNewlyActivatedViewId(%d) )",
+        aViewIdToBeDeactivated.iViewUid, 
+        aNewlyActivatedViewId.iViewUid );
+        
+    CAknAppUi::HandleViewDeactivation( 
+        aViewIdToBeDeactivated, 
+        aNewlyActivatedViewId );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAppUI::HandleApplicationSpecificEventL
+// -----------------------------------------------------------------------------
+//
+void CPhoneAppUI::HandleApplicationSpecificEventL(
+    TInt aType,
+    const TWsEvent& aEvent )
+    {
+    __LOGMETHODSTARTEND( EPhonePhoneapp, "CPhoneAppUI::HandleApplicationSpecificEventL" );
+    
+    if( aType == EEikKeyLockEnabled )
+        {
+        iPhoneUIController->HandleKeyLockEnabled( ETrue );
+        }
+    else if( aType == EEikKeyLockDisabled )
+        {
+        iPhoneUIController->HandleKeyLockEnabled( EFalse );
+        }
+    
+    CAknAppUi::HandleApplicationSpecificEventL( aType, aEvent );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAppUI::HandleResourceChangeL
+// -----------------------------------------------------------------------------
+//
+void CPhoneAppUI::HandleResourceChangeL( TInt aType )
+    {
+    __LOGMETHODSTARTEND( EPhonePhoneapp, "CPhoneAppUI::HandleResourceChangeL" );
+    
+    CAknAppUi::HandleResourceChangeL( aType );
+            
+    if ( aType == KAknsMessageSkinChange || 
+         aType == KEikDynamicLayoutVariantSwitch )
+        {
+        LayoutMainView();
+        iPhoneViewController->HandleResourceChangeL( aType );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneAppUI::HandleViewActivation
+//  Handles the activation of the view aNewlyActivatedViewId 
+//  before the old view 
+//  aViewIdToBeDeactivated is to be deactivated.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CPhoneAppUI::HandleViewActivation( 
+    const TVwsViewId& /*aNewlyActivatedViewId*/, 
+    const TVwsViewId& /*aViewIdToBeDeactivated*/ )
+    {
+     __PHONELOG( EBasic, EPhonePhoneapp, "CPhoneAppUI::HandleViewActivation" );        
+    }
+
+// ---------------------------------------------------------
+// CPhoneAppUI::HelpContextL
+// This routine will be called for returning help context
+// when AppHelpContextL() is called in 
+// CPhoneViewController::LaunchHelpApplicationL()
+// ---------------------------------------------------------
+//
+CArrayFix<TCoeHelpContext>* CPhoneAppUI::HelpContextL() const
+    {
+    CArrayFix<TCoeHelpContext>* result = 
+        new(ELeave) CArrayFixFlat<TCoeHelpContext>( 1 );
+    
+    CleanupStack::PushL( result );
+    // Get the help context name from the View controller
+    TCoeHelpContext helpContext( KUidPhoneApplication, 
+        iPhoneViewController->HelpContext() ); 
+    result->AppendL( helpContext );
+    CleanupStack::Pop( result );
+
+    return result; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAppUi::LayoutMainView
+// -----------------------------------------------------------------------------
+//
+void CPhoneAppUI::LayoutMainView()
+    {
+    __LOGMETHODSTARTEND( EPhonePhoneapp, "CPhoneAppUI::LayoutMainView" );
+    iPhoneViewController->HandleLayoutChange( ClientRect() );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAppUi::GetAliasKeyCode
+// -----------------------------------------------------------------------------
+//        
+TInt CPhoneAppUI::GetAliasKeyCode( TUint& aCode, 
+                                   const TKeyEvent& aKeyEvent,
+                                   TEventCode /*aType*/)
+    {    
+    aCode = aKeyEvent.iCode;    
+    return KErrNone;
+    } 
+
+
+// -----------------------------------------------------------------------------
+// CPhoneAppUI::HandleCallBackL
+// Called when the observed value changes
+//
+// Callback function.
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneAppUI::HandleCallBackL( TAny* aAny )
+    {
+    __PHONELOG( EBasic, EPhonePhoneapp, "CPhoneAppUI::HandleCallBackL" );
+    CPhoneAppUI* appUi =
+        static_cast< CPhoneAppUI* >( aAny );
+    appUi->DoHandleCallBackL();
+    return KErrNone;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneAppUI::DoHandleCallBackL
+// Call back to a specific instance.
+// -----------------------------------------------------------------------------
+//
+void CPhoneAppUI::DoHandleCallBackL()
+    {
+    __PHONELOG( EBasic, EPhonePhoneapp, "CPhoneAppUI::DoHandleCallBackL" );
+    const TInt change = iEnvChangeNotifier->Change();
+    HandleEnvironmentChangeL( change );
+    }
+        
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/src/cphonedocument.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Document class implementation.
+*
+*/
+
+
+// INCLUDE FILES
+#include <apgwgnam.h>
+#include "cphonedocument.h"
+#include "cphoneappui.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneDocument::CPhoneDocument( CEikApplication& aApp ) :
+    CAknDocument( aApp )
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneDocument::NewL
+// ---------------------------------------------------------
+//
+CPhoneDocument* CPhoneDocument::NewL( CEikApplication& aApp )
+    {
+    CPhoneDocument* self = new (ELeave) CPhoneDocument( aApp );
+    
+    return self;
+    }
+
+// Destructor
+CPhoneDocument::~CPhoneDocument()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneDocument::CreateAppUiL
+//
+// Creates an instance of CPhoneAppUi and returns it.
+// ---------------------------------------------------------
+//
+CEikAppUi* CPhoneDocument::CreateAppUiL()
+    {
+    return new (ELeave) CPhoneAppUI;
+    }
+
+// ---------------------------------------------------------
+// CPhoneDocument::UpdateTaskNameL
+// ---------------------------------------------------------
+//
+void CPhoneDocument::UpdateTaskNameL( CApaWindowGroupName* aWgName )
+    {
+    CAknDocument::UpdateTaskNameL( aWgName );
+    aWgName->SetHidden( ETrue );
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/srcdata/callhandlingui.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,859 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     This file contains all the resources for call handling the module.
+*
+*/
+
+
+NAME    CLGI
+
+#include    <bldvariant.hrh>
+#include    <data_caging_paths_strings.hrh>
+#include    <eikon.rh>
+#include    <avkon.hrh>
+#include    <avkon.rh>
+#include    <avkon.loc>
+#include    <uikon.hrh>
+#include    <bmtouchpane.rh>
+#include    <appinfo.rh>
+
+#include    "phoneui.rh"
+#include    "phoneui.hrh"
+#include    <phone.loc>
+#include    <phoneappcommands.hrh>
+#include    <incallmenuandsoftkeys.loc>
+#include    <incalloperations.loc>
+
+//  RESOURCE DEFINITIONS 
+
+RESOURCE RSS_SIGNATURE 
+    {
+    } 
+
+RESOURCE TBUF 
+    { 
+    buf = "CLGI";
+    }
+    
+// -----------------------------------------------------------------------------
+//   
+//    r_phoneui_mute_toggle_button
+//    Mute / Unmute toggle button.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE BUBBLE_TOUCH_PANE_BUTTON r_phoneui_mute_toggle_button
+    {
+    commands = 
+        {
+        EPhoneInCallCmdMute,
+        EPhoneInCallCmdUnmute    
+        };
+    button = AVKON_BUTTON
+        {
+        states =
+            {
+            AVKON_BUTTON_STATE  // mute
+                {
+                txt = qtn_incal_button_mute_mic\
+                      <0x0001>\
+                      qtn_incal_button_mute_mic_landscape;
+                },
+            AVKON_BUTTON_STATE  // unmute
+                {
+                txt = qtn_incal_button_unmute_mic\
+                      <0x0001>\
+                      qtn_incal_button_unmute_mic_landscape;
+                }
+            };                
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_phoneui_end_active_call_button
+//    End call active button.
+//
+// -----------------------------------------------------------------------------
+//          
+RESOURCE BUBBLE_TOUCH_PANE_BUTTON r_phoneui_end_active_call_button
+    {
+    commands = 
+        {
+        EPhoneCmdEnd
+        };
+    button = AVKON_BUTTON
+        {
+        states =
+            {
+            AVKON_BUTTON_STATE
+                {
+                txt = qtn_incal_button_end_active_call\
+                      <0x0001>\
+                      qtn_incal_button_end_active_call_landscape;
+                }
+            };                
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_phoneui_end_call_button
+//    End call button.
+//
+// -----------------------------------------------------------------------------
+//          
+RESOURCE BUBBLE_TOUCH_PANE_BUTTON r_phoneui_end_call_button
+    {
+    commands = 
+        {
+        EPhoneCmdEnd
+        };
+    button = AVKON_BUTTON
+        {
+        states =
+            {
+            AVKON_BUTTON_STATE
+                {
+                txt = qtn_incal_button_end_call\
+                      <0x0001>\
+                      qtn_incal_button_end_call_landscape;
+                }
+            };                
+        };
+    }
+    
+// -----------------------------------------------------------------------------
+//   
+//    r_phoneui_end_all_calls_button
+//    End all calls toggle button.
+//
+// -----------------------------------------------------------------------------
+//          
+RESOURCE BUBBLE_TOUCH_PANE_BUTTON r_phoneui_end_all_calls_button
+    {
+    commands = 
+        {
+        EPhoneInCallCmdEndAllCalls
+        };
+    button = AVKON_BUTTON
+        {
+        states =
+            {
+            AVKON_BUTTON_STATE
+                {
+                txt = qtn_incal_button_end_all_calls\
+                      <0x0001>\
+                      qtn_incal_button_end_all_calls_landscape;
+                }
+            };                
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_phoneui_answer_call_button
+//    Answer call button.
+//
+// -----------------------------------------------------------------------------
+//          
+RESOURCE BUBBLE_TOUCH_PANE_BUTTON r_phoneui_answer_call_button
+    {
+    commands = 
+        {
+        EPhoneCallComingCmdAnswer
+        };
+    button = AVKON_BUTTON
+        {
+        states =
+            {
+            AVKON_BUTTON_STATE
+                {
+                txt = qtn_incal_button_answer\
+                      <0x0001>\
+                      qtn_incal_button_answer_landscape;
+                }
+            };                
+        };
+    }
+    
+// -----------------------------------------------------------------------------
+//   
+//    r_phoneui_reject_call_button
+//    Reject call button.
+//
+// -----------------------------------------------------------------------------
+//          
+RESOURCE BUBBLE_TOUCH_PANE_BUTTON r_phoneui_reject_call_button
+    {
+    commands = 
+        {
+        EPhoneCallComingCmdReject
+        };
+    button = AVKON_BUTTON
+        {
+        states =
+            {
+            AVKON_BUTTON_STATE
+                {
+                txt = qtn_incal_button_reject\
+                <0x0001>\
+                qtn_incal_button_reject_landscape;
+                }
+            };                
+        };
+    }        
+
+// -----------------------------------------------------------------------------
+//   
+//    r_phoneui_end_outgoing_call_button
+//    End ongoing call button.
+//
+// -----------------------------------------------------------------------------
+//          
+RESOURCE BUBBLE_TOUCH_PANE_BUTTON r_phoneui_end_outgoing_call_button
+    {
+    commands = 
+        {
+        EPhoneInCallCmdEndThisOutgoingCall
+        };
+    button = AVKON_BUTTON
+        {
+        states =
+            {
+            AVKON_BUTTON_STATE
+                {
+                txt = qtn_incal_button_end_call\
+                      <0x0001>\
+                      qtn_incal_button_end_call_landscape;
+                }
+            };                
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_phoneui_hold_toggle_button
+//    Hold / Unhold toggle button.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE BUBBLE_TOUCH_PANE_BUTTON r_phoneui_hold_toggle_button
+    {
+    commands = 
+        {
+        EPhoneInCallCmdHold,
+        EPhoneInCallCmdUnhold    
+        };
+    button = AVKON_BUTTON
+        {
+        states =
+            {
+            AVKON_BUTTON_STATE
+                {
+                txt = qtn_incal_button_hold\
+                      <0x0001>\
+                      qtn_incal_button_hold_landscape;
+                },
+            AVKON_BUTTON_STATE
+                {
+                txt = qtn_incal_button_unhold\
+                      <0x0001>\
+                      qtn_incal_button_unhold_landscape;
+                }
+            };                
+        };
+    } 
+
+// -----------------------------------------------------------------------------
+//   
+//    r_phoneui_ihf_toggle_button
+//    Loudspeaker / Handset toggle button
+//
+// -----------------------------------------------------------------------------
+//    
+RESOURCE BUBBLE_TOUCH_PANE_BUTTON r_phoneui_ihf_toggle_button
+    {
+    commands = 
+        {
+        EPhoneInCallCmdActivateIhf,
+        EPhoneInCallCmdDeactivateIhf    
+        };
+    button = AVKON_BUTTON
+        {
+        states =
+            {
+            AVKON_BUTTON_STATE
+                {
+                txt = qtn_incal_button_loudspeaker\
+                      <0x0001>\
+                      qtn_incal_button_loudspeaker_landscape;
+                },
+            AVKON_BUTTON_STATE
+                {
+                txt = qtn_incal_button_handset\
+                      <0x0001>\
+                      qtn_incal_button_handset_landscape;
+                }
+            };                
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_phoneui_bt_toggle_button
+//    BT accessory / Handset toggle button
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE BUBBLE_TOUCH_PANE_BUTTON r_phoneui_bt_toggle_button
+    {
+    commands = 
+        {
+        EPhoneInCallCmdHandset,
+        EPhoneInCallCmdBtHandsfree    
+        };
+    button = AVKON_BUTTON
+        {
+        states =
+            {
+            AVKON_BUTTON_STATE
+                {
+                txt = qtn_incal_button_handset\
+                      <0x0001>\
+                      qtn_incal_button_handset_landscape;
+                },
+            AVKON_BUTTON_STATE
+                {
+                txt = qtn_incal_button_bluetooth\
+                      <0x0001>\
+                      qtn_incal_button_bluetooth_landscape;
+                }
+            };                
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_phoneui_swap_calls_button
+//    Swap calls button
+//
+// -----------------------------------------------------------------------------
+// 
+RESOURCE BUBBLE_TOUCH_PANE_BUTTON r_phoneui_swap_calls_button
+    {
+    commands = 
+        {
+        EPhoneInCallCmdSwap    
+        };
+    button = AVKON_BUTTON
+        {
+        states =
+            {
+            AVKON_BUTTON_STATE
+                {
+                txt = qtn_incal_button_swap\
+                      <0x0001>\
+                      qtn_incal_button_swap_landscape;
+                }
+            };                
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_phoneui_go_to_idle_button
+//    Go to idle button
+//
+// -----------------------------------------------------------------------------
+// 
+RESOURCE BUBBLE_TOUCH_PANE_BUTTON r_phoneui_go_to_idle_button
+    {
+    commands = 
+        {
+        EPhoneInCallCmdGoToIdle    
+        };
+    button = AVKON_BUTTON
+        {
+        states =
+            {
+            AVKON_BUTTON_STATE
+                {
+                txt = qtn_incal_button_go_idle\
+                      <0x0001>\
+                      qtn_incal_button_go_idle_landscape;
+                }
+            };                
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_phoneui_conference_button
+//    Create conference button
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE BUBBLE_TOUCH_PANE_BUTTON r_phoneui_conference_button
+    {
+    commands = 
+        {
+        EPhoneInCallCmdCreateConference    
+        };
+    button = AVKON_BUTTON
+        {
+        states =
+            {
+            AVKON_BUTTON_STATE
+                {
+                txt = qtn_incal_button_conference\
+                      <0x0001>\
+                      qtn_incal_button_conference_landscape;
+                }
+            };                
+        };
+    }    
+
+// -----------------------------------------------------------------------------
+//   
+//    r_phoneui_participants_button
+//    Conference participants
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE BUBBLE_TOUCH_PANE_BUTTON r_phoneui_participants_button
+    {
+    commands = 
+        {
+        EPhoneInCallCmdParticipants    
+        };
+    button = AVKON_BUTTON
+        {
+        states =
+            {
+            AVKON_BUTTON_STATE
+                {
+                txt = qtn_incal_button_participants\
+                      <0x0001>\
+                      qtn_incal_button_participants_landscape;
+                }
+            };                
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_phoneui_drop_participant_button
+//    Conference drop participant button
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE BUBBLE_TOUCH_PANE_BUTTON r_phoneui_drop_participant_button
+    {
+    commands = 
+        {
+        EPhoneInCallCmdDrop    
+        };
+    button = AVKON_BUTTON
+        {
+        states =
+            {
+            AVKON_BUTTON_STATE
+                {
+                txt = qtn_incal_button_drop\
+                      <0x0001>\
+                      qtn_incal_button_drop_landscape;
+                }
+            };                
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_phoneui_go_to_private_button
+//    Conference go to private button
+//
+// -----------------------------------------------------------------------------
+//   
+RESOURCE BUBBLE_TOUCH_PANE_BUTTON r_phoneui_go_to_private_button
+    {
+    commands = 
+        {
+        EPhoneInCallCmdPrivate    
+        };
+    button = AVKON_BUTTON
+        {
+        states =
+            {
+            AVKON_BUTTON_STATE
+                {
+                txt = qtn_incal_button_private\
+                      <0x0001>\
+                      qtn_incal_button_private_landscape;
+                }
+            };                
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_phoneui_join_button
+//    Conference join button
+//
+// -----------------------------------------------------------------------------
+//   
+RESOURCE BUBBLE_TOUCH_PANE_BUTTON r_phoneui_join_button
+    {
+    commands = 
+        {
+        EPhoneInCallCmdJoin    
+        };
+    button = AVKON_BUTTON
+        {
+        states =
+            {
+            AVKON_BUTTON_STATE
+                {
+                txt = qtn_incal_button_join\
+                      <0x0001>\
+                      qtn_incal_button_join_landscape;
+                }
+            };                
+        };
+    }
+    
+// -----------------------------------------------------------------------------
+//   
+//    r_phoneui_voice_to_video_toggle_button
+//    Switch to video button.
+//
+// -----------------------------------------------------------------------------
+//          
+RESOURCE BUBBLE_TOUCH_PANE_BUTTON r_phoneui_voice_to_video_toggle_button
+    {
+    commands = 
+        {
+        EPhoneInCallCmdSwitchToVideo,
+        EPhoneInCallCmdSwitchToVoice
+        };
+    button = AVKON_BUTTON
+        {
+        states =
+            {
+            AVKON_BUTTON_STATE  // voice to video
+                {
+                txt = qtn_incal_button_voice_to_video\
+                      <0x0001>\
+                      qtn_incal_button_voice_to_video_landscape;
+                },
+            AVKON_BUTTON_STATE  // video to voice
+                {
+                txt = qtn_incal_button_video_to_voice\
+                      <0x0001>\
+                      qtn_incal_button_video_to_voice_landscape;
+                }                
+            };                
+        };    
+    }      
+     
+// ----------------------------------------------------------------
+//   
+//    r_phoneui_incall_buttons
+//    Touch buttons shown in incall situation.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE BUBBLE_TOUCH_PANE r_phoneui_incall_buttons
+    {
+    buttons =
+        {
+        r_phoneui_hold_toggle_button,   // Top right
+        r_phoneui_end_call_button       // Botton right
+        
+        // ALTERNATIVE BUTTONS FOR REPLACE, TOTAL MAX.4 BUTTONS                                  
+        // r_phoneui_go_to_idle_button
+        // r_phoneui_voice_to_video_toggle_button
+        };
+    }
+    
+// ----------------------------------------------------------------
+//   
+//    r_phoneui_two_singles_buttons
+//    Touch buttons shown in incall situation.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE BUBBLE_TOUCH_PANE r_phoneui_two_singles_buttons
+    {
+    buttons =
+        {
+        r_phoneui_conference_button,        // Top right
+        r_phoneui_end_active_call_button    // Botton right
+        
+        // ALTERNATIVE BUTTONS FOR REPLACE, TOTAL MAX.4 BUTTONS
+        // r_phoneui_swap_calls_button,
+        // r_phoneui_go_to_idle_button
+        // r_phoneui_end_all_calls_button
+        };
+    }    
+    
+// ----------------------------------------------------------------
+//   
+//    r_phoneui_conference_buttons
+//    Touch buttons shown in incall situation.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE BUBBLE_TOUCH_PANE r_phoneui_conference_buttons
+    {
+    buttons =
+        {
+        r_phoneui_participants_button,      // Top right
+        r_phoneui_end_call_button           // Botton right
+        
+        // ALTERNATIVE BUTTONS FOR REPLACE, TOTAL MAX.4 BUTTONS
+        // r_phoneui_hold_toggle_button,
+        // r_phoneui_go_to_idle_button
+        };
+    }
+    
+// ----------------------------------------------------------------
+//   
+//    r_phoneui_participant_list_buttons
+//    Touch buttons shown in incall situation.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE BUBBLE_TOUCH_PANE r_phoneui_participant_list_buttons
+    {
+    buttons =
+        {
+        r_phoneui_go_to_private_button,
+        r_phoneui_drop_participant_button
+        };
+    }            
+
+// ----------------------------------------------------------------
+//   
+//    r_phoneui_conference_and_single_buttons
+//    Touch buttons shown in incall situation.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE BUBBLE_TOUCH_PANE r_phoneui_conference_and_single_buttons
+    {
+    buttons =
+        {
+        r_phoneui_join_button,              // Top right
+        r_phoneui_end_active_call_button    // Botton right
+        
+        // ALTERNATIVE BUTTONS FOR REPLACE, TOTAL MAX.4 BUTTONS
+        // r_phoneui_swap_calls_button, 
+        // r_phoneui_end_all_calls_button
+        };
+    }
+
+// ----------------------------------------------------------------
+//   
+//    r_phoneui_conference_and_held_single_buttons
+//    Touch buttons shown in incall situation.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE BUBBLE_TOUCH_PANE r_phoneui_conference_and_held_single_buttons
+    {
+    buttons =
+        {
+        r_phoneui_join_button,              // Top right
+        r_phoneui_end_active_call_button    // Botton right
+        
+        // ALTERNATIVE BUTTONS FOR REPLACE, TOTAL MAX.4 BUTTONS
+        // r_phoneui_swap_calls_button,
+        // r_phoneui_end_all_calls_button
+        };
+    }
+    
+// ----------------------------------------------------------------
+//   
+//    r_phoneui_emergency_call_buttons
+//    Touch buttons shown in incall situation.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE BUBBLE_TOUCH_PANE r_phoneui_emergency_call_buttons
+    {
+    buttons =
+        {
+        r_phoneui_ihf_toggle_button,
+        r_phoneui_end_call_button
+        };
+    }
+    
+// ----------------------------------------------------------------
+//   
+//    r_phoneui_incoming_call_buttons
+//    Touch buttons shown in incoming call situation.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE BUBBLE_TOUCH_PANE r_phoneui_incoming_call_buttons
+    {
+    buttons =
+        {
+        r_phoneui_answer_call_button,
+        r_phoneui_reject_call_button
+        };
+    }
+    
+// ----------------------------------------------------------------
+//   
+//    r_phoneui_call_setup_buttons
+//    Touch buttons shown in call setup situation.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE BUBBLE_TOUCH_PANE r_phoneui_call_setup_buttons
+    {
+    buttons =
+        {
+        r_phoneui_ihf_toggle_button,
+        r_phoneui_end_outgoing_call_button
+        };
+    }
+
+// ----------------------------------------------------------------
+//   
+//    r_phoneui_call_setup_and_single_buttons
+//    Touch buttons shown in call setup and single situation.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE BUBBLE_TOUCH_PANE r_phoneui_call_setup_and_single_buttons
+    {
+    buttons =
+        {
+        r_phoneui_ihf_toggle_button,
+        r_phoneui_end_outgoing_call_button
+        };
+    }            
+
+// ----------------------------------------------------------------
+//   
+//    r_phoneui_waiting_call_buttons
+//    Touch buttons shown in call waiting call situation.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE BUBBLE_TOUCH_PANE r_phoneui_waiting_call_buttons
+    {
+    buttons =
+        {
+        r_phoneui_answer_call_button,
+        r_phoneui_end_active_call_button
+        };
+    } 
+    
+// ----------------------------------------------------------------
+//   
+//    r_conference_participant_list_softkeys
+//    Touch buttons shown in incall situation.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE CBA r_conference_participant_list_softkeys
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyCancel;
+            txt = text_softkey_back;
+            }      
+        };
+    }         
+
+// -----------------------------------------------------------------------------
+//   
+//    r_phoneui_silence_call_button
+//    Silent call button.
+//
+// -----------------------------------------------------------------------------
+//          
+RESOURCE BUBBLE_TOUCH_PANE_BUTTON r_phoneui_silence_call_button
+    {
+    commands = 
+        {
+        EPhoneCallComingCmdSilent
+        };
+    button = AVKON_BUTTON
+        {
+        states =
+            {
+            AVKON_BUTTON_STATE
+                {
+                txt = qtn_incal_button_silence\
+                      <0x0001>\
+                      qtn_incal_button_silence_landscape;
+                }
+            };                
+        };
+    }
+
+// ----------------------------------------------------------------
+//   
+//    r_phoneui_incoming_call_silence_buttons
+//    Touch buttons shown in incoming call situation.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE BUBBLE_TOUCH_PANE r_phoneui_incoming_call_silence_buttons
+    {
+    buttons =
+        {
+        r_phoneui_answer_call_button,
+        r_phoneui_silence_call_button
+        };
+    }  
+
+// ----------------------------------------------------------------
+//   
+//    r_phoneui_touch_button_config
+//    Congigurable buttons. Button set is selected via CenRep.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE PHONE_TOUCH_BUTTON_CONFIGURATIONS r_phoneui_touch_button_config
+    {
+    configurations =
+        {
+        PHONE_TOUCH_BUTTON_CONFIGURATION        
+            {
+            button_set_id = EPhoneConfigIncomingCallButtons;
+            button_sets = 
+                {
+                r_phoneui_incoming_call_buttons, 
+                r_phoneui_incoming_call_silence_buttons
+                };
+            }    
+        };
+    } 
+
+//##########################################################
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/srcdata/phoneui.hrh	Mon Jan 18 20:18:27 2010 +0200
@@ -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/phoneui/srcdata/phoneui.pan	Mon Jan 18 20:18:27 2010 +0200
@@ -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/phoneui/srcdata/phoneui.rh	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This file contains declarations for resources of PhoneAppS60.
+*     The file can be included only in resource file.
+*     
+*
+*/
+
+
+#ifndef PHONEAPPS60_RH
+#define PHONEAPPS60_RH
+
+//  STRUCTURE DEFINITIONS
+
+// ---------------------------------------------------------
+//    SMALLEST_POSSIBLE_RESOURCE
+//    
+// ---------------------------------------------------------
+//
+STRUCT SMALLEST_POSSIBLE_RESOURCE
+	{
+	BYTE bytesize = 0;
+	}
+
+// ---------------------------------------------------------
+//    phone_link_apps
+//    It defines structure to contain information about apps 
+//    to be able to activate them.
+// ---------------------------------------------------------
+//
+STRUCT PHONE_LINK_APPS
+    {
+    STRUCT apps[];
+    }
+
+// ---------------------------------------------------------
+//    phone_app
+//    It defines structure that contains information about 
+//    a single app.
+// ---------------------------------------------------------
+//
+STRUCT PHONE_APP
+    {
+    WORD id;          
+    LTEXT txt="";     
+    LONG view = -1;
+    LONG app = -1;
+    }
+
+// ---------------------------------------------------------
+//    phone_string_list
+//    It defines structure that contains array of strings.
+// ---------------------------------------------------------
+//
+STRUCT PHONE_STRING_LIST
+    {
+    STRUCT strings[];
+    }
+
+// ---------------------------------------------------------
+//    phone_string
+//    It is link to the string resource (must be of type LBUF).
+// ---------------------------------------------------------
+//
+STRUCT PHONE_STRING
+    {
+    LLINK id;
+    }
+
+// ---------------------------------------------------------------------------
+// phone_touch_button_configuration
+// ---------------------------------------------------------------------------
+//    
+STRUCT PHONE_TOUCH_BUTTON_CONFIGURATIONS
+    {
+    STRUCT configurations[]; // PHONE_TOUCH_BUTTON_CONFIGURATION
+    }
+    
+// ---------------------------------------------------------------------------
+// phone_touch_button_configuration
+// ---------------------------------------------------------------------------
+//
+STRUCT PHONE_TOUCH_BUTTON_CONFIGURATION
+    {
+    WORD  button_set_id;   // from TPhoneUIConfigurableButtons  
+    LLINK button_sets[];   // button set resources
+    }
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/srcdata/phoneui.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,8154 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*     This file contains all the resources for the module.
+*     All definitions for components used in phone application.
+*     Positions, sizes, texts, etc.
+*
+*/
+
+
+NAME    PHUI
+
+#include    <bldvariant.hrh>
+
+#include    <EIKCORE.rsg>
+#include    <eikon.rh>
+#include    <eikon.rsg>
+#include    <avkon.hrh>
+#include    <avkon.rsg>
+#include    <avkon.rh>
+#include    <avkon.mbg>
+#include    <avkon.loc>
+#include    <e32keys.h>
+#include    <uikon.hrh>
+#include    <AiwCommon.hrh>
+#include    <AiwCommon.rh>
+#include    <aknnotifyplugin.loc>
+
+#include    <phone.loc>
+
+#include    <callheadertexts.loc>
+#include    <basiccallhandling.loc>
+#include    <incallmenuandsoftkeys.loc>
+#include    <callterminationnote.loc>
+#include    <incalloperations.loc>
+#include    <numberentry.loc>
+#include    <multicallhandling.loc>
+#include    <mobileoriginatedcalls.loc>
+#include    <avkon.loc>
+#include    <dialer.loc>
+
+
+#include    <dtmfsignalling.loc>
+
+
+#include    "phoneui.rh"
+#include    "phoneui.hrh"
+
+#include    <appinfo.rh>
+#include    <data_caging_paths_strings.hrh>
+
+//  RESOURCE DEFINITIONS
+
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+RESOURCE TBUF
+    {
+    buf = "";
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    It contains application information.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+    {
+    status_pane = r_phoneui_status_pane;
+    cba = r_phoneui_empty_cba;
+    menubar = r_phoneui_idle_menubar;
+    }
+
+RESOURCE LOCALISABLE_APP_INFO r_phoneui_localisable_app_info
+    {
+    short_caption = qtn_apps_phone_grid;
+    caption_and_icon =
+    CAPTION_AND_ICON_INFO
+        {
+        caption = qtn_apps_phone_list;
+#ifdef __SCALABLE_ICONS
+        number_of_icons = 1;
+        icon_file = PHONEUI_SCALABLE_AIF_ICON_FILE;
+#else
+        number_of_icons = 1;
+        icon_file = PHONEUI_AIF_ICON_FILE;
+#endif // __SCALABLE_ICONS
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_toolbar
+//
+// ---------------------------------------------------------
+//
+RESOURCE AVKON_TOOLBAR r_phoneui_toolbar
+    {
+    flags = KAknToolbarFixed;
+    items =
+        {
+        // Buttons are dynamically added.
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_title_pane
+//    It defines phone's status pane. Title pane is empty.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TITLE_PANE r_phoneui_title_pane
+    {
+    txt = qtn_title_text;
+    }
+
+
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_status_pane
+//    It defines phone's status pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE STATUS_PANE_APP_MODEL r_phoneui_status_pane
+    {
+    layout = R_AVKON_STATUS_PANE_LAYOUT_IDLE;
+    panes =
+        {
+        SPANE_PANE
+            {
+            id = EEikStatusPaneUidTitle;
+            type = EAknCtTitlePane;
+            resource = r_phoneui_title_pane;
+            }
+        };
+    }
+
+
+// ---------------------------------------------------------
+//
+//    r_phone_incall_muted_pane
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phone_incall_muted_pane
+    {
+    buf = qtn_incal_muted_pane;
+    }
+
+
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_idle_menubar
+//    Default menubar shown when idle view is active.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_idle_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_idle_normal_menu;
+            }
+        };
+    }
+
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_numberacq_menubar
+//    Default menubar shown when number acquistion view is active.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_numberacq_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_numberacq_videocall_menubar
+//    Default menubar shown when number acquistion view is active.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_numberacq_videocall_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_videocall_options_menu;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_incall_menubar_with_numberentry
+//    It defines the options menu for in-call state.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phone_incall_menubar_with_numberentry
+    {
+    titles =
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_callhandling_incall_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_menu;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_incall_menubar_with_numberentry_videocall
+//    It defines the options menu for in-call state.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phone_incall_videocall_menubar_with_numberentry
+    {
+    titles =
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_callhandling_incall_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_videocall_options_menu;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_videocall_menubar
+//    It defines the options menu for video call in-call state.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_videocall_menubar
+    {
+    titles =
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_videocallhandling_options_menu;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_videocall_menubar_with_numberentry
+//    It defines the options menu for video call in-call state.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_videocall_menubar_with_numberentry
+    {
+    titles =
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_videocallhandling_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_numberacq_ok_menubar
+//    Default menubar shown when number acquistion view is active.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_numberacq_ok_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_ok_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_numberacq_ok_videocall_menubar
+//    Default menubar shown when number acquistion view is active.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_numberacq_ok_videocall_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_ok_videocall_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_callhandling_menubar
+//    Default menubar shown when call handling view is active.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_callhandling_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_callhandling_incall_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_incomingcall_menubar
+//    Default menubar shown when call handling view is active in
+//    incoming state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_incomingcall_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_incomingcall_options_menu;
+            }
+        };
+    }
+
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_incomingvideocall_menubar
+//    Default menubar shown when call handling view is active in
+//    incoming video call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_incomingvideocall_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_incomingvideocall_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_incomingcall_menubar_with_numberentry
+//    Default menubar shown when call handling view is active in
+//    incoming state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_incomingcall_menubar_with_numberentry
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_incomingcall_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_incomingcall_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_incomingvideocall_menubar_with_numberentry
+//    Default menubar shown when call handling view is active in
+//    incoming state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_incomingvideocall_menubar_with_numberentry
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_incomingvideocall_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_incomingcall_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_callwaiting_menubar
+//    Default menubar shown when call handling view is active in
+//    call waiting state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_callwaiting_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_callwaiting_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_callwaiting_menubar_with_numberentry
+//    Default menubar shown when there is a waiting call and the
+//    number entry is shown.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_callwaiting_menubar_with_numberentry
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_callwaiting_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_confcall_menubar
+//    Default menubar shown when call handling view is active in
+//    conference call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_confcall_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_confcall_options_menu;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_confcall_menubar_with_numberentry
+//    Default menubar shown when call handling view is active in
+//    conference call state and the number entry is displayed.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_confcall_menubar_with_numberentry
+    {
+    titles =
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_confcall_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_confandcallwaiting_menubar
+//    Default menubar shown when call handling view is active in
+//    call waiting state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_confandcallwaiting_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_confandcallwaiting_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_confandcallwaiting_menubar_with_numberentry
+//    Default menubar shown when call handling view is active in
+//    call waiting state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_confandcallwaiting_menubar_with_numberentry
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_confandcallwaiting_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_alertingcall_menubar
+//    Default menubar shown when call handling view is alerting
+//    call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_alertingcall_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_alertingcall_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_alertingcall_menubar_with_numberentry
+//    Default menubar shown when call handling view is alerting
+//    call state and the number entry is displayed.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_alertingcall_menubar_with_numberentry
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_alertingcall_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_activeandheld_menubar
+//    Default menubar shown when call handling view is activeandheld
+//    call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_activeandheld_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_activeandheldcall_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_activeandheld_menubar_with_numberentry
+//    Default menubar shown when call handling view is activeandheld
+//    call state and the number entry is displayed.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_activeandheld_menubar_with_numberentry
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_activeandheldcall_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_activeconfandheld_menubar
+//    Default menubar shown when call handling view is activeandheld
+//    call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_activeconfandheld_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_activeconfandheldcall_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_activeconfandheld_menubar_with_numberentry
+//    Default menubar shown when call handling view is activeandheld
+//    call state and the number entry is displayed.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_activeconfandheld_menubar_with_numberentry
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_activeconfandheldcall_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_activeandheldconf_menubar
+//    Default menubar shown when call handling view is activeandheld
+//    call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_activeandheldconf_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_activeandheldconfcall_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_activeandheldconf_menubar_with_numberentry
+//    Default menubar shown when call handling view is activeandheld
+//    call state and the number entry is displayed.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_activeandheldconf_menubar_with_numberentry
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_activeandheldconfcall_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_callactiveheldandwaiting_menubar
+//    Default menubar shown when call handling view is callactiveheldandwaiting
+//    call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_callactiveheldandwaiting_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_callactiveheldandwaiting_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_callactiveheldandwaiting_menubar_varied
+//    Default menubar shown when call handling view is callactiveheldandwaiting
+//    call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_callactiveheldandwaiting_menubar_varied
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_callactiveheldandwaiting_options_menu_varied;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_callactiveheldandwaiting_menubar_with_numberentry
+//    Default menubar shown when call handling view is callactiveheldandwaiting
+//    call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_callactiveheldandwaiting_menubar_with_numberentry
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_callactiveheldandwaiting_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_confcallactiveheldandwaiting_menubar
+//    Default menubar shown when call handling view is callactiveheldandwaiting
+//    call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_confcallactiveheldandwaiting_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_confcallactiveheldandwaiting_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_confcallactiveheldandwaiting_menubar_with_numberentry
+//    Default menubar shown when call handling view is callactiveheldandwaiting
+//    call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_confcallactiveheldandwaiting_menubar_with_numberentry
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_confcallactiveheldandwaiting_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_callactiveheldconfandwaiting_menubar
+//    Default menubar shown when call handling view is callactiveheldandwaiting
+//    call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_callactiveheldconfandwaiting_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_callactiveheldconfandwaiting_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_callactiveheldconfandwaiting_menubar_with_numberentry
+//    Default menubar shown when call handling view is callactiveheldandwaiting
+//    call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_callactiveheldconfandwaiting_menubar_with_numberentry
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_callactiveheldconfandwaiting_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_alertingandheldcall_menubar
+//    Default menubar shown when call handling view is alertingandheldcall
+//    call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_alertingandheldcall_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_alertingandheldcall_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_alertingandconfcall_menubar
+//    Default menubar shown when call handling view is alertingandconfheldcall
+//    call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_alertingandconfheldcall_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_alertingandconfheldcall_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_alertingandconfheldcall_menubar_with_numberentry
+//    Default menubar shown when call handling view is alertingandconfheldcall
+//    call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_alertingandconfheldcall_menubar_with_numberentry
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_alertingandconfheldcall_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_alertingandheldcall_menubar_with_numberentry
+//    Default menubar shown when call handling view is alertingandheldcall
+//    call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_alertingandheldcall_menubar_with_numberentry
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_alertingandheldcall_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_alertingwaitingandheldconfcall_menubar
+//    Default menubar shown when call handling view is
+//    alertingwaitingandconfheldcall call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_alertingwaitingandheldconfcall_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_alertingwaitingandconfheldcall_options_menu;
+            }
+        };
+    }
+
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_alertingwaitingandheldconfcall_menubar_with_numberentry
+//    Default menubar shown when call handling view is
+//    alertingwaitingandconfheldcall call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_alertingwaitingandheldconfcall_menubar_with_numberentry
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_alertingwaitingandconfheldcall_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_menu;
+            }
+        };
+    }
+
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_alertingheldandwaitingcall_menubar
+//    Default menubar shown when call handling view is alertingheldandwaitingcall
+//    call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_alertingheldandwaitingcall_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_alertingheldandwaitingcall_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_alertingheldandwaitingcall_menubar_with_numberentry
+//    Default menubar shown when call handling view is alertingheldandwaitingcall
+//    call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_alertingheldandwaitingcall_menubar_with_numberentry
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_alertingheldandwaitingcall_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_alertingandwaitingcall_menubar
+//    Default menubar shown when call handling view is alertingandwaitingcall
+//    call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_alertingandwaitingcall_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_alertingandwaitingcall_options_menu;
+            }
+        };
+    }
+
+RESOURCE MENU_BAR r_phoneui_alertingandwaitingcall_menubar_with_numberentry
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_alertingandwaitingcall_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_callhandling_emergency_menubar
+//    Default menubar shown when call handling view is active
+//    in emergency mode.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_callhandling_emergency_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_callhandling_emergency_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_callhandling_emergency_menubar
+//    Default menubar shown when call handling view is active
+//    in emergency mode.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_callhandling_emergency_menubar_with_numberentry
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_callhandling_emergency_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_emergency_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_videocall_2g_menubar_with_numberentry
+//    Default menubar shown when call handling view is active
+//    in emergency mode.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_videocall_2g_menubar_with_numberentry
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_call_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_videocall_waiting_menubar
+//    Default menubar shown when call handling view is active
+//    in emergency mode.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_videocall_waiting_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_videocall_waiting_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_waiting_lock_menubar
+//    Menubar shown when waiting call and phone is locked
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_waiting_lock_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_waiting_lock_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_waiting_lock_menubar
+//    Menubar shown when two singles, waiting call and phone is locked
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_twosingles_waiting_lock_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane =r_phoneui_twosingles_waiting_lock_options_menu;
+            }
+        };
+    }
+// ----------------------------------------------------------------
+//
+//    r_phoneui_videocall_waiting_menubar_with_numberentry
+//    Menubar shown when videocall is waiting
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_videocall_waiting_menubar_with_numberentry
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_videocall_waiting_options_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_call_menu;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_menubar_resource_last
+//    Resource id of last menubar + 1.
+//
+// ---------------------------------------------------------
+//
+RESOURCE SMALLEST_POSSIBLE_RESOURCE r_phoneui_menubar_resource_last {}
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_menupane_resource_offset
+//    Resource id offset - 1 for menupanes.
+//
+// ---------------------------------------------------------
+//
+RESOURCE SMALLEST_POSSIBLE_RESOURCE r_phoneui_menupane_resource_offset {}
+
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_idle_normal_menu
+//    Idle view menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_idle_normal_menu
+    {
+    items=
+        {
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_numberacq_options_menu
+//    Number Acquisition view options menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_numberacq_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdCall;
+            cascade = r_phoneui_numberacq_options_call_menu;
+            txt = text_number_call;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdSendCommand;
+            txt = text_nren_send_com;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdSendMessage;
+            txt = qtn_nren_send_message;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdAddToContacts;
+            cascade = r_phoneui_numberacq_options_add_to_contacts_menu;
+            txt = qtn_phob_opt_save_to_pb;
+            flags = EEikMenuItemSeparatorAfter;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_numberacq_emergency_options_menu
+//    Number Acquisition view options menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_numberacq_emergency_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdSendCommand;
+            txt = text_nren_send_com;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdSendMessage;
+            txt = qtn_nren_send_message;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdAddToContacts;
+            cascade = r_phoneui_numberacq_options_add_to_contacts_menu;
+            txt = qtn_phob_opt_save_to_pb;
+            flags = EEikMenuItemSeparatorAfter;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_numberacq_videocall_options_menu
+//    Number Acquisition view options menu pane when
+//    VideoCall_menu_visible featere ON.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_numberacq_videocall_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdCall;
+            txt =   qtn_call_sub_voice;
+            },
+        MENU_ITEM
+            {
+            command =EPhoneNumberAcqCmdVideoCall;
+            txt =  qtn_call_sub_video;
+            },
+
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdSendCommand;
+            txt = text_nren_send_com;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdSendMessage;
+            txt = qtn_nren_send_message;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdAddToContacts;
+            cascade = r_phoneui_numberacq_options_add_to_contacts_menu;
+            txt = qtn_phob_opt_save_to_pb;
+            flags = EEikMenuItemSeparatorAfter;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_numberacq_incomingcall_options_menu
+//    It defines number entry options for call coming in
+//    with number entry.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_numberacq_incomingcall_options_menu
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdSendCommand;
+            txt = text_nren_send_com;
+            flags = EEikMenuItemSeparatorAfter;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_numberacq_ok_options_menu
+//    Number Acquisition view ok_options menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_numberacq_ok_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdCall;
+            cascade = r_phoneui_numberacq_options_call_menu;
+            txt = text_number_call;
+            },
+
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdSendCommand;
+            txt = text_nren_send_com;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdAddToContacts;
+            cascade = r_phoneui_numberacq_options_add_to_contacts_menu;
+            txt = qtn_phob_opt_save_to_pb;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_numberacq_ok_videocall_options_menu
+//    Number Acquisition view ok_options menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_numberacq_ok_videocall_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdCall;
+            txt =   qtn_call_sub_voice;
+            },
+        MENU_ITEM
+            {
+            command =EPhoneNumberAcqCmdVideoCall;
+            txt =  qtn_call_sub_video;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdSendCommand;
+            txt = text_nren_send_com;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdAddToContacts;
+            cascade = r_phoneui_numberacq_options_add_to_contacts_menu;
+            txt = qtn_phob_opt_save_to_pb;
+            }
+        };
+    }
+
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_numberacq_options_call_menu
+//    Number Acquisition view options call menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_numberacq_options_call_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdCall;
+            txt =   qtn_call_sub_voice;
+            },
+        MENU_ITEM
+            {
+            command =EPhoneNumberAcqCmdVideoCall;
+            txt =  qtn_call_sub_video;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_numberacq_options_add_to_contacts_menu
+//    Number Acquisition view options add to contacts menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_numberacq_options_add_to_contacts_menu
+    {
+    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_callhandling_incall_options_menu
+//    Call Handling view pane
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_callhandling_incall_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute;
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnhold;
+            txt =  qtn_incal_unhold_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer;
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisActiveCall;
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHold;
+            txt =  qtn_incal_hold_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdLockKeypad;
+            txt = qtn_pwrc_lock_keys;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdLockScreen;
+            txt = qtn_pwrc_lock_display;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute;
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdSwitchToVideo;
+            txt =  qtn_incal_voice_to_video;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdNewCall;
+            txt =  qtn_incal_new_call_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneVideoSharing;
+            // Content provided by AIW.
+            txt = "";
+            cascade = AIW_INTELLIGENT_CASCADE_ID;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle;
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery;
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_videocallhandling_options_menu
+//    Video Call Handling menu pane
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_videocallhandling_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute;
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer;
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisActiveCall;
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute;
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdSwitchToVoice;
+            txt =  qtn_incal_video_to_voice;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdNewCall;
+            txt =  qtn_incal_new_call_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle;
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_callhandling_emergency_options_menu
+//    Call Handling view pane
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_callhandling_emergency_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer;
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisActiveCall;
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdLockKeypad;
+            txt = qtn_pwrc_lock_keys;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdLockScreen;
+            txt = qtn_pwrc_lock_display;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle;
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery;
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_incomingcall_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_incomingcall_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneCallComingCmdAnswer;
+            txt =  qtn_call_answer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneCallComingCmdAnswerHandPortable;
+            txt =  qtn_call_answer_hp_vt_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneCallComingCmdSoftReject;
+            txt = qtn_call_soft_reject_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneCallComingCmdReject;
+            txt =  qtn_call_reject_option;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_incomingvideocall_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_incomingvideocall_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneCallComingCmdAnswer;
+            txt =  qtn_call_answer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneCallComingCmdAnswerHandPortableVideo;
+            txt = qtn_call_answer_hp_vt_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneCallComingCmdSoftReject;
+            txt = qtn_call_soft_reject_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneCallComingCmdReject;
+            txt =  qtn_call_reject_option;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_callwaiting_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_callwaiting_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute;
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneCallComingCmdAnswer;
+            txt =  qtn_call_answer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReject;
+            txt =  qtn_call_reject_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnhold;
+            txt =  qtn_incal_unhold_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReplace;
+            txt =  qtn_incal_replace_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer;
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisActiveCall;
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHold;
+            txt =  qtn_incal_hold_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute;
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdNewCall;
+            txt =  qtn_incal_new_call_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle;
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery;
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_videocall_waiting_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_videocall_waiting_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute;
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReject;
+            txt =  qtn_call_reject_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnhold;
+            txt =  qtn_incal_unhold_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer;
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisActiveCall;
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHold;
+            txt =  qtn_incal_hold_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute;
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdNewCall;
+            txt =  qtn_incal_new_call_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle;
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery;
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_waiting_lock_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_waiting_lock_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneCallComingCmdAnswer;
+            txt =  qtn_call_answer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReject;
+            txt =  qtn_call_reject_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReplace;
+            txt =  qtn_incal_replace_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisActiveCall;
+            txt =  qtn_incal_drop_option;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_twosingles_waiting_lock_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_twosingles_waiting_lock_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReject;
+            txt =  qtn_call_reject_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReplace;
+            txt =  qtn_incal_replace_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisActiveCall;
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndAllCalls;
+            txt =  qtn_incal_end_option;
+            }
+        };
+    }
+
+// confcall
+// ---------------------------------------------------------
+//
+//    r_phoneui_confcall_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_confcall_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute;
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnhold;
+            txt =  qtn_incal_unhold_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdCreateConference;
+            cascade = r_phoneui_incall_options_conference_private_drop_menu;
+            txt =  qtn_incal_conference_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer;
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndAllCalls;
+            txt =  qtn_incal_end_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHold;
+            txt =  qtn_incal_hold_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute;
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdLockKeypad;
+            txt = qtn_pwrc_lock_keys;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdLockScreen;
+            txt = qtn_pwrc_lock_display;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdNewCall;
+            txt =  qtn_incal_new_call_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle;
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery;
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// confandcallwaiting
+// ---------------------------------------------------------
+//
+//    r_phoneui_confandcallwaiting_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_confandcallwaiting_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute;
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdAnswer;
+            txt =  qtn_call_answer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReject;
+            txt =  qtn_call_reject_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReplace;
+            txt =  qtn_incal_replace_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdConferenceUnhold;
+            txt =  qtn_incal_unhold_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdCreateConference;
+            cascade = r_phoneui_incall_options_conference_private_drop_menu;
+            txt =  qtn_incal_conference_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer;
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndAllCalls;
+            txt =  qtn_incal_end_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdConferenceHold;
+            txt =  qtn_incal_hold_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute;
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdNewCall;
+            txt =  qtn_incal_new_call_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle;
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery;
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_activeandheldcall_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_activeandheldcall_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute;
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdSwap;
+            txt =  qtn_incal_swap_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdCreateConference;
+            txt =  qtn_incal_conference_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer;
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisActiveCall;
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndAllCalls;
+            txt =  qtn_incal_end_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute;
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdTransfer;
+            txt =  qtn_incal_transfer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle;
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery;
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_activeconfandheldcall_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_activeconfandheldcall_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute;
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdSwap;
+            txt =  qtn_incal_swap_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdCreateConference;
+            cascade = r_phoneui_incall_options_conference_join_drop_menu;
+            txt =  qtn_incal_conference_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer;
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisActiveCall;
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndAllCalls;
+            txt =  qtn_incal_end_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute;
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle;
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery;
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_activeandheldconfcall_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_activeandheldconfcall_options_menu
+
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute;
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdSwap;
+            txt =  qtn_incal_swap_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdCreateConference;
+            cascade = r_phoneui_incall_options_conference_join_menu;
+            txt =  qtn_incal_conference_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer;
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisActiveCall;
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndAllCalls;
+            txt =  qtn_incal_end_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute;
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle;
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery;
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_callactiveheldandwaiting_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_callactiveheldandwaiting_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute;
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReject;
+            txt =  qtn_call_reject_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReplace;
+            txt =  qtn_incal_replace_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdSwap;
+            txt =  qtn_incal_swap_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdCreateConference;
+            txt =  qtn_incal_conference_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer;
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisActiveCall;
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndAllCalls;
+            txt =  qtn_incal_end_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute;
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdTransfer;
+            txt =  qtn_incal_transfer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle;
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery;
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_callactiveheldandwaiting_options_menu_varied
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_callactiveheldandwaiting_options_menu_varied
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute;
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReplace;
+            txt =  qtn_call_answer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReject;
+            txt =  qtn_call_reject_option;
+            },
+
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdSwap;
+            txt =  qtn_incal_swap_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdCreateConference;
+            txt =  qtn_incal_conference_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer;
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisActiveCall;
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndAllCalls;
+            txt =  qtn_incal_end_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute;
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdTransfer;
+            txt =  qtn_incal_transfer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle;
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery;
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_confcallactiveheldandwaiting_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_confcallactiveheldandwaiting_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute;
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReject;
+            txt =  qtn_call_reject_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReplace;
+            txt =  qtn_incal_replace_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdSwap;
+            txt =  qtn_incal_swap_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdCreateConference;
+            cascade = r_phoneui_incall_options_conference_join_drop_menu;
+            txt =  qtn_incal_conference_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer;
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisActiveCall;
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndAllCalls;
+            txt =  qtn_incal_end_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute;
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle;
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery;
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_callactiveheldconfandwaiting_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_callactiveheldconfandwaiting_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute;
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReject;
+            txt =  qtn_call_reject_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReplace;
+            txt =  qtn_incal_replace_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdSwap;
+            txt =  qtn_incal_swap_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdCreateConference;
+            cascade = r_phoneui_incall_options_conference_join_menu;
+            txt =  qtn_incal_conference_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer;
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisActiveCall;
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndAllCalls;
+            txt =  qtn_incal_end_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute;
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle;
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery;
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_alertingcall_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_alertingcall_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer;
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisOutgoingCall;
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle;
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery;
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_alertingandheldcall_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_alertingandheldcall_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute;
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer;
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisOutgoingCall;
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndAllCalls;
+            txt =  qtn_incal_end_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute;
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdTransfer;
+            txt =  qtn_incal_transfer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle;
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery;
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_alertingandconfheldcall_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_alertingandconfheldcall_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute;
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer;
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisOutgoingCall;
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndAllCalls;
+            txt =  qtn_incal_end_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute;
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle;
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery;
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_alertingandconfheldcall_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_alertingwaitingandconfheldcall_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute;
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReject;
+            txt =  qtn_call_reject_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer;
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisOutgoingCall;
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndAllCalls;
+            txt =  qtn_incal_end_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute;
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle;
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery;
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_alertingheldandwaitingcall_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_alertingheldandwaitingcall_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute;
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReject;
+            txt =  qtn_call_reject_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer;
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisActiveCall;
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndAllCalls;
+            txt =  qtn_incal_end_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute;
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdTransfer;
+            txt =  qtn_incal_transfer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle;
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery;
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_alertingandwaitingcall_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_alertingandwaitingcall_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReject;
+            txt =  qtn_call_reject_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer;
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisOutgoingCall;
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle;
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery;
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_incall_options_conference_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_incall_options_conference_private_drop_menu
+{
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdPrivateSelection;
+            txt =  qtn_incal_private_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDropSelection;
+            txt =  qtn_incal_drop_conf_option;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_incall_options_conference_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_incall_options_conference_join_drop_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdJoin;
+            txt =  qtn_incal_join_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDropSelection;
+            txt =  qtn_incal_drop_conf_option;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_incall_options_conference_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_incall_options_conference_join_menu
+{
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdJoin;
+            txt =  qtn_incal_join_option;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+// PLEASE NOTE:  The DTMF CBA's below are used by DTMF dialogs,
+// They are never selected through the PhoneAppS60 ToolBar system!
+// Thus, they are not part of the collection which is registered
+// with PhoneApp.
+// -----------------------------------------------------------------------------
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_dtmfdialer_softkeys_options_cancel
+//    It is softkeys for DTMF dialer
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_dtmfdialer_softkeys_options_cancel
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneDtmfDialerCancel;
+            txt = text_softkey_cancel;
+            }
+        };
+    }
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_dtmf_softkeys_empty_cancel
+//    It is softkeys for sending wait note.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_dtmf_softkeys_empty_cancel
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdDoNothing;
+            txt = text_softkey_empty;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdCancelSendingDtmfString;
+            txt = text_softkey_cancel;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_softkeys_empty_cancel.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_softkeys_empty_back
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdDoNothing;
+            txt = text_softkey_empty;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdBack;
+            txt = text_softkey_back;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_dtmf_softkeys_send_cancel
+//    It is softkeys for wait character confirmation query.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_dtmf_softkeys_send_cancel
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdContinueSendingDtmfString;
+            txt = text_softkey_send;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdCancelSendingDtmfString;
+            txt = text_softkey_cancel;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdContinueSendingDtmfString;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_toolbar_resource_offset
+//    Resource id offset - 1 for toolbars.
+//
+// ---------------------------------------------------------
+//
+RESOURCE SMALLEST_POSSIBLE_RESOURCE r_phoneui_toolbar_resource_offset {}
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_empty_cba
+//    Default Command buttons in view (empty).
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_empty_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneSoftkeyLeft;
+            txt = text_softkey_empty;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneSoftkeyRight;
+            txt = text_softkey_empty;
+            },
+        CBA_BUTTON
+            {
+            id =  EPhoneCmdDoNothing;
+            txt = text_softkey_empty;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_emergency_idle_cba
+//    Command buttons in emergency idle view.
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_emergency_idle_cba
+    {
+    buttons =
+        {
+         CBA_BUTTON
+            {
+            id = EPhoneSoftkeyLeft;
+            txt = text_softkey_empty;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneSoftkeyRight;
+            txt = text_softkey_empty;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_send_dtmf_no_cba
+//    Command buttons in send-dtmf view, when no dialog is available to override them.
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_send_dtmf_no_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdDoNothing;
+            txt = text_softkey_empty;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdDoNothing;
+            txt = text_softkey_empty;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_send_dtmf_empty_edit_box_cba
+//    Command buttons in send-dtmf view, when "Send DTMF..." dialog
+//    is visible, and the user has NOT entered some text into the edit-box.
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_send_dtmf_empty_edit_box_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyCancel;
+            txt = text_softkey_cancel;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_send_dtmf_normal_edit_box_cba
+//    Command buttons in send-dtmf view, when "Send DTMF..." dialog
+//    is visible, and the user has entered some text into the edit-box.
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_send_dtmf_normal_edit_box_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdDtmfOk;
+            txt = text_softkey_ok;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyCancel;
+            txt = text_softkey_cancel;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdDtmfOk;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_dtmf_speed_dial_normal_edit_box_cba
+//    Command buttons in send-dtmf view, when "Speed Dial Number..." dialog
+//    is visible, and the user has entered some text into the edit-box.
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_dtmf_speed_dial_normal_edit_box_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdDtmfSpeedDialOk;
+            txt = text_softkey_ok;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyCancel;
+            txt = text_softkey_cancel;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdDtmfSpeedDialOk;
+            txt = text_softkey_ok;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_numberacq_cba
+//    It contains softkey definitions for number acquisition.
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_numberacq_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdBack;
+            txt = text_softkey_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyContextOptions;
+            txt = text_softkey_options;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//  r_phoneui_conference_keypad_cover
+//  for the device with the keypad cover
+//  that hides the End and Send keys. The latter function is used only if
+//  there is an active unmuted conference call, but no other call.
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_conference_keypad_cover
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdEndAllCalls;
+            txt = qtn_incal_softk_end_all;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyContextOptions;
+            txt = text_softkey_options;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_numberacq_videocall_cba
+//    It contains softkey definitions for number acquisition
+//    if videocall_menu_visibilite feature ON.
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_numberacq_videocall_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneNumberAcqCmdVideoCall;
+            txt = qtn_call_out_going_vt_short;
+            },
+
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyContextOptions;
+            txt = text_softkey_options;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_incall_numberacq_cba
+//    It contains softkey definitions for number acquisition
+//    incall case.
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_incall_numberacq_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+
+        CBA_BUTTON
+            {
+            id = EPhoneCmdBack;
+            txt = text_softkey_back;
+            },
+
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdActivatEPhonebook;
+            txt = qtn_msk_contacts;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_settingsui_cba
+//    Command buttons in SettingsUI view (no softkeys
+//    needed, buttons are controlled by dialogs).
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_settingsui_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdDoNothing;
+            txt = text_softkey_empty;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdDoNothing;
+            txt = text_softkey_empty;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_callhandling_cba
+//    Command buttons in call handling views.
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_callhandling_callsetup_empty_endoutgoing_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdDoNothing;
+            txt = text_softkey_empty;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdEndThisOutgoingCall;
+            txt = text_softkey_drop;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyEmpty;
+            txt = "";
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_callsetup_empty_dtmfdialer_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdDoNothing;
+            txt = text_softkey_empty;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdDtmfManualQuery;
+            txt = qtn_incal_softk_dialer;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyEmpty;
+            txt = "";
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_callsetup_toihf_endoutgoing_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdActivateIhf;
+            txt = qtn_incal_softk_laudspek;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdEndThisOutgoingCall;
+            txt = text_softkey_drop;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyEmpty;
+            txt = "";
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_callsetup_toihf_dtmfdialer_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdActivateIhf;
+            txt = qtn_incal_softk_laudspek;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdDtmfManualQuery;
+            txt = qtn_incal_softk_dialer;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyEmpty;
+            txt = "";
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_callsetup_tohandset_endoutgoing_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdDeactivateIhf;
+            txt = qtn_incal_softk_handset;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdEndThisOutgoingCall;
+            txt = text_softkey_drop;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyEmpty;
+            txt = "";
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_callsetup_tohandset_dtmfdialer_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdDeactivateIhf;
+            txt = qtn_incal_softk_handset;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdDtmfManualQuery;
+            txt = qtn_incal_softk_dialer;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyEmpty;
+            txt = "";
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_incall_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdActivateIhf;
+            txt = qtn_incal_softk_laudspek;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdActivatEPhonebook;
+            txt = qtn_msk_contacts;
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_incall_noihf_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdEndThisActiveCall;
+            txt = text_softkey_drop;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdActivatEPhonebook;
+            txt = qtn_msk_contacts;
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_incall_unmute_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdUnmute;
+            txt = text_softkey_unmute;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdActivatEPhonebook;
+            txt = qtn_msk_contacts;
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_incall_unhold_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdUnhold;
+            txt = text_softkey_unhold;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdActivatEPhonebook;
+            txt = qtn_msk_contacts;
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_incall_handset_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdHandset;
+            txt = qtn_incal_softk_handset;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdActivatEPhonebook;
+            txt = qtn_msk_contacts;
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_incall_btaa_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_softk_bt_handsfree;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdActivatEPhonebook;
+            txt = qtn_msk_contacts;
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_incomingcall_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCallComingCmdSilent;
+            txt = text_softkey_silent;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneLongMSKAnswer;
+            txt = "";
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_incomingcall_reject_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCallComingCmdReject;
+            txt = text_softkey_reject;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneLongMSKAnswer;
+            txt = "";
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_incomingcall_soft_reject_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCallComingCmdSoftReject;
+            txt = qtn_softkey_soft_reject;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneLongMSKAnswer;
+            txt = "";
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_emergency_incall_no_options
+	{
+    buttons = 
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdDoNothing;
+            txt = text_softkey_empty;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdDialer;
+            txt = qtn_incal_softk_dialer;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyEmpty;
+            txt = "";
+            }
+        };
+	}
+
+RESOURCE CBA r_phoneui_callhandling_emergency_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdActivateIhf;
+            txt = qtn_incal_softk_laudspek;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdActivatEPhonebook;
+            txt = qtn_msk_contacts;
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_emergency_noihf_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdEndThisActiveCall;
+            txt = text_softkey_drop;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdActivatEPhonebook;
+            txt = qtn_msk_contacts;
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_emergency_handset_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdHandset;
+            txt = qtn_incal_softk_handset;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdActivatEPhonebook;
+            txt = qtn_msk_contacts;
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_emergency_no_options_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdDoNothing;
+            txt = text_softkey_empty;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdActivateIhf;
+            txt = qtn_incal_softk_laudspek;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyEmpty;
+            txt = "";
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_emergency_no_options_noihf_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdDoNothing;
+            txt = text_softkey_empty;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdEndThisActiveCall;
+            txt = text_softkey_drop;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyEmpty;
+            txt = "";
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_emergency_no_options_handset_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdDoNothing;
+            txt = text_softkey_empty;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdDeactivateIhf;
+            txt = qtn_incal_softk_handset;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyEmpty;
+            txt = "";
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_callwaiting_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdReject;
+            txt = text_softkey_reject;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdActivatEPhonebook;
+            txt = qtn_msk_contacts;
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_new_call_find_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdNewCallFind;
+            txt = text_softkey_find;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdCancel;
+            txt = text_softkey_cancel;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdNewCallFind;
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_new_call_call_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdNewCallCall;
+            txt =  text_softkey_new_call;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdCancel;
+            txt = text_softkey_cancel;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdNewCallCall;
+            }
+        };
+    }
+
+RESOURCE CBA r_phoneui_callhandling_new_call_swap_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdSwap;
+            txt = text_softkey_swap;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdActivatEPhonebook;
+            txt = qtn_msk_contacts;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_callcoming_softkeys_when_slider
+//    It contains softkey definitions for call coming in.
+//    Ringing tone is not muted.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_callcoming_softkeys_when_slider
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCallComingCmdAnswer;
+            txt = text_softkey_answer;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCallComingCmdSilent;
+            txt = text_softkey_silent;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyContextOptions;
+            txt = text_softkey_options;
+            }
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_callcoming_softkeys_when_silent_slider
+//    It contains softkey definitions for call coming in.
+//    Ringing tone is muted.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_callcoming_softkeys_when_silent_slider
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCallComingCmdAnswer;
+            txt = text_softkey_answer;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCallComingCmdReject;
+            txt = text_softkey_reject;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyContextOptions;
+            txt = text_softkey_options;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_softkeys_options_softreject_slider
+//    It is softkeys for soft reject with slider devices.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_softkeys_options_softreject_slider
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCallComingCmdAnswer;
+            txt = text_softkey_answer;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCallComingCmdSoftReject;
+            txt = qtn_softkey_soft_reject;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_new_call_fetch_cba
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_new_call_fetch_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyCall;
+            txt = text_softkey_call;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyCancel;
+            txt = text_softkey_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyCall;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_exit_emergency_mode_cba
+//    Command buttons when phone exits emergency mode
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_exit_emergency_mode_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneEmergencyCmdYes;
+            txt = text_softkey_yes;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneEmergencyCmdNo;
+            txt = text_softkey_no;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_emergency_mode_note_cba
+//    Command buttons when phone is in emergency mode
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_emergency_mode_note_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdDoNothing;
+            txt = text_softkey_empty;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneEmergencyCmdExit;
+            txt = text_softkey_exit;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_wait_note_dlg_cba
+//    Command buttons when wait note is visible
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_wait_note_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdWaitNoteOk;
+            txt = text_softkey_ok;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdDoNothing;
+            txt = text_softkey_empty;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdWaitNoteOk;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_string_list
+//    It is a list of strings for the call headers
+//    that must be preloaded.
+//
+// ---------------------------------------------------------
+//
+RESOURCE PHONE_STRING_LIST r_phoneui_string_list
+    {
+    strings =
+        {
+        PHONE_STRING
+            {
+            id = r_phoneui_mtcal_call;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_mtcal_cli_withheld;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_mtcal_diverted_call;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_mtcal_incoming_call;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_mtcal_incoming_call_short;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_out_going_call;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_out_going_call_short;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_out_going_video_call;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_out_going_video_call_short;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_incall_call_held;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_incall_call_held_short;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_incall_call_held_calln;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_incall_call_held_conference;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_incall_call_disconnected;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_incall_call_disconnected_short;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_incall_call_disconnected_calln;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_incall_call_disconnected_private;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_incall_call_disconnected_diverted;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_incall_call_disconnected_call;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_incall_call_disconnected_conference;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_incall_call_number;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_multc_waiting;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_multc_waiting_short;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_emergency_call;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_conference_call;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_mtcal_incoming_line2;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_mtcal_arriving_number_line2;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_mtcal_waiting_number_line2;
+            },
+        PHONE_STRING
+            {
+            id = R_QTN_TIME_DURAT_LONG_WITH_ZERO;
+            },
+        PHONE_STRING
+            {
+            id = r_phone_mtcal_cli_payphone;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_emergency_call_header;
+            },
+        PHONE_STRING
+            {
+            id = r_phoneui_idle_time_format;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_notetext_use_keyguard_to_unlock
+    {
+    buf = qtn_keyg_info_note_display_lock_switch;
+    }
+
+
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_incal_remote_create_conference_text
+    {
+    buf = qtn_incal_info_conf_active;
+    }
+
+ // ---------------------------------------------------------
+//
+RESOURCE TBUF r_multc_info_conference_text
+    {
+    buf = qtn_multc_conference_note;
+    }
+
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_incal_info_hold_text
+    {
+    buf = qtn_incal_info_hold;
+    }
+
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_incal_remote_active_text
+    {
+    buf = qtn_incal_remote_active_note;
+    }
+
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_incal_info_conf_hold_text
+    {
+    buf = qtn_incal_conf_hold_conf;
+    }
+
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_incal_info_hold_cli_text
+    {
+    buf = qtn_incal_conf_hold_cli;
+    }
+
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_incal_info_hold_nocli_text
+    {
+    buf = qtn_incal_conf_hold_nocli;
+    }
+
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_multc_unhold_done_text
+    {
+    buf = qtn_multc_unhold_done_note;
+    }
+
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_multc_cli_unhold_done_text
+    {
+    buf = qtn_multc_cli_unhold_done_note;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_mtcal_call
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_mtcal_call
+    {
+    buf = qtn_mtcal_call;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_mtcal_cli_withheld
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_mtcal_cli_withheld
+    {
+    buf = qtn_mtcal_cli_withheld;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_mtcal_diverted_call
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_mtcal_diverted_call
+    {
+    buf = qtn_mtcal_diverted_call;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_mtcal_incoming_call
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_mtcal_incoming_call
+    {
+    buf = qtn_mtcal_incoming_call;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_mtcal_incoming_call_short
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_mtcal_incoming_call_short
+    {
+    buf = qtn_mtcal_incoming_call_short;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_mtcal_incoming_call_short
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_multc_info_wait_without
+    {
+    buf = qtn_multc_info_wait_without;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_mtcal_incoming_call_short
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_multc_info_wait_with
+    {
+    buf = qtn_multc_info_wait_with;
+    }
+
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_out_going_call
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_out_going_call
+    {
+    buf = qtn_call_out_going_call;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_out_going_call_short
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_out_going_call_short
+    {
+    buf = qtn_call_out_going_call_short;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_out_going_video_call
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_out_going_video_call
+    {
+    buf = qtn_call_out_going_video_call;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_out_going_video_call_short
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_out_going_video_call_short
+    {
+    buf = qtn_call_out_going_vt_short;
+    }
+// ---------------------------------------------------------
+//
+//    r_phoneui_incall_call_held
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_incall_call_held
+    {
+    buf = qtn_incal_window_held;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_incall_call_held_short
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_incall_call_held_short
+    {
+    buf = qtn_incal_window_held_short;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_incall_call_held_calln
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_incall_call_held_calln
+    {
+    buf = qtn_incal_window_held_call;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_incall_call_held_conference
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_incall_call_held_conference
+    {
+    buf = qtn_incal_window_held_conf;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_incall_call_disconnected
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_incall_call_disconnected
+    {
+    buf = qtn_call_window_discon;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_incall_call_disconnected_short
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_incall_call_disconnected_short
+    {
+    buf = qtn_call_window_discon_short;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_incall_call_disconnected_calln
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_incall_call_disconnected_calln
+    {
+    buf = qtn_call_window_discon_call;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_incall_call_disconnected_private
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_incall_call_disconnected_private
+    {
+    buf = qtn_call_window_discon_privat;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_incall_call_disconnected_diverted
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_incall_call_disconnected_diverted
+    {
+    buf = qtn_call_window_discon_divert;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_incall_call_disconnected_call
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_incall_call_disconnected_call
+    {
+    buf = qtn_call_window_discon_nonum;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_incall_call_disconnected_conference
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_incall_call_disconnected_conference
+    {
+    buf = qtn_call_window_discon_conf;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_incall_call_number
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_incall_call_number
+    {
+    buf = qtn_call_number;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_multc_waiting
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_multc_waiting
+    {
+    buf = qtn_multc_window_waiting;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_multc_waiting_short
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_multc_waiting_short
+    {
+    buf = qtn_multc_window_waiting_short;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_gprs_conn_in_progress
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_gprs_conn_in_progress
+    {
+    buf = qtn_gprs_err_conn_in_progress;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_emergency_call
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_emergency_call
+    {
+    buf = qtn_emerg_call_pop_up;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_conference_call
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_conference_call
+    {
+    buf = qtn_multc_conference_pop_up;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_mtcal_incoming_line2
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_mtcal_incoming_line2
+    {
+    buf = qtn_als_incoming_line2_nonum;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_mtcal_arriving_number_line2
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_mtcal_arriving_number_line2
+    {
+    buf = qtn_als_arriving_line2_number;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_mtcal_waiting_number_line2
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_mtcal_waiting_number_line2
+    {
+    buf = qtn_als_waiting_line2_number;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_mtcal_cli_payphone
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_mtcal_cli_payphone
+    {
+    buf = qtn_mtcal_cli_payphone;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_emergency_call_header
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_emergency_call_header
+    {
+    buf = qtn_emerg_call_pop_up;
+    }
+
+// ---------------------------------------------------------
+//    r_phoneui_idle_time_format
+//    It define the time format shown on navi pane of idle
+//    state.
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_idle_time_format
+    {
+    buf = qtn_idle_time_format;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_phone_life_timer_string
+//    It is template for text in life timer note.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_life_timer_string
+    {
+    buf = qtn_note_life_timer;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_notetext_network_busy
+//    Text for a note.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_notetext_network_busy
+    {
+    buf = text_network_busy;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_notetext_out_of_range
+//    Text for a note.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_notetext_out_of_range
+    {
+    buf = qtn_tel_info_out_of_range;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_notetext_signal_faded
+//    Text for a note.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_notetext_signal_faded
+    {
+    buf = qtn_tel_sig_fade_note;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_notetext_call_failed
+//    Text for a note.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_notetext_call_failed
+    {
+    buf = qtn_tel_info_call_failed;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_notetext_invalid_phonenumber
+//    Text for a note.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_notetext_invalid_phonenumber
+    {
+    buf = text_invalid_number;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_error_empty_sim_location
+//    It is template for text used in error note.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_notetext_empty_sim_location
+    {
+    buf = qtn_simp_note_empty_location;
+    }
+
+
+
+// ----------------------------------------------------------------
+//
+//    r_notetext_error_in_connection
+//    Text for a note.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_notetext_error_in_connection
+    {
+    buf = text_network_failure;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_notetext_number_not_in_use
+//    Text for a note.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_notetext_number_not_in_use
+    {
+    buf = text_unassigned_number;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_notetext_number_barred
+//    Text for a note.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_notetext_number_barred
+    {
+    buf = text_cterm_nbr_barred;
+    }
+
+
+// ----------------------------------------------------------------
+//
+//    r_notetext_no_answer
+//    Text for a note.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_notetext_no_answer
+    {
+    buf = text_no_answer;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_notetext_number_not_in_cug
+//    Text for a note.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_notetext_number_not_in_cug
+    {
+    buf = text_cterm_nbr_not_in_cug;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_notetext_all_incoming_calls_diverted
+//    Text for a note.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_notetext_all_incoming_calls_diverted
+    {
+    buf = qtn_mocal_calls_diverted_note;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_notetext_active_diverts
+//    Text for a note.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_notetext_active_diverts
+    {
+    buf = qtn_mocal_active_diverts_note;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_notetext_diverting
+//    Text for a note.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_notetext_diverting
+    {
+    buf = qtn_mocal_diverting_note;
+    }
+
+// ----------------------------------------------------------------
+
+// ----------------------------------------------------------------
+//
+//    r_notetext_diverting_incoming_call
+//    Text for a note.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_notetext_diverting_incoming_call
+    {
+    buf = qtn_mtcal_diverting_note;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_notetext_call_barrings
+//    Text for a note.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_notetext_call_barrings
+    {
+    buf = qtn_mocal_barred_note;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_error_note_not_allowed
+//    Request to Phone Engine is not confirmed
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_error_note_not_allowed
+    {
+    buf = text_not_allowed;
+    }
+// ----------------------------------------------------------------
+//
+//    r_note_text_conf_audios_handset
+//    Information message text if handset activated.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_note_text_conf_audios_handset
+    {
+    buf = qtn_conf_audios_handset;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_note_text_conf_audios_bt_accessory
+//    Information message text if bluetooth handset activated.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_note_text_conf_audios_bt_accessory
+    {
+    buf = qtn_conf_audios_bt_accessory;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_note_text_cug_in_use
+//    The network might send a notification within the call
+//    creation if the CUG index is used for the current call.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_note_text_cug_in_use
+    {
+    buf = text_cug_in_use;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_note_text_clir_change
+//    If CLIR is subscribed to the permanent option for showing a caller’s
+//    number, and the user has tried to invoke CLIR temporarily,
+//    the operator prevents the calling.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_note_text_clir_change
+    {
+    buf = text_clir_change;
+    }
+
+// ----------------------------------------------------------------
+//
+// r_note_incal_query_vcall_failed
+// Query text for user to inform if video call setup failed
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_note_incal_query_vcall_failed
+    {
+    buf = qtn_incal_query_vcall_failed;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_default_skey_list
+//    It contains overrides for keypad tones.
+//
+// ---------------------------------------------------------
+//
+RESOURCE AVKON_SKEY_LIST r_phoneui_default_skey_list
+    {
+    list =
+        {
+        AVKON_SKEY_INFO {key='0'; sid=EAvkonSIDNoSound;},
+        AVKON_SKEY_INFO {key='0'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;},
+        AVKON_SKEY_INFO {key='0'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;},
+        AVKON_SKEY_INFO {key='1'; sid=EAvkonSIDNoSound;},
+        AVKON_SKEY_INFO {key='1'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;},
+        AVKON_SKEY_INFO {key='1'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;},
+        AVKON_SKEY_INFO {key='2'; sid=EAvkonSIDNoSound;},
+        AVKON_SKEY_INFO {key='2'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;},
+        AVKON_SKEY_INFO {key='2'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;},
+        AVKON_SKEY_INFO {key='3'; sid=EAvkonSIDNoSound;},
+        AVKON_SKEY_INFO {key='3'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;},
+        AVKON_SKEY_INFO {key='3'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;},
+        AVKON_SKEY_INFO {key='4'; sid=EAvkonSIDNoSound;},
+        AVKON_SKEY_INFO {key='4'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;},
+        AVKON_SKEY_INFO {key='4'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;},
+        AVKON_SKEY_INFO {key='5'; sid=EAvkonSIDNoSound;},
+        AVKON_SKEY_INFO {key='5'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;},
+        AVKON_SKEY_INFO {key='5'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;},
+        AVKON_SKEY_INFO {key='6'; sid=EAvkonSIDNoSound;},
+        AVKON_SKEY_INFO {key='6'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;},
+        AVKON_SKEY_INFO {key='6'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;},
+        AVKON_SKEY_INFO {key='7'; sid=EAvkonSIDNoSound;},
+        AVKON_SKEY_INFO {key='7'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;},
+        AVKON_SKEY_INFO {key='7'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;},
+        AVKON_SKEY_INFO {key='8'; sid=EAvkonSIDNoSound;},
+        AVKON_SKEY_INFO {key='8'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;},
+        AVKON_SKEY_INFO {key='8'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;},
+        AVKON_SKEY_INFO {key='9'; sid=EAvkonSIDNoSound;},
+        AVKON_SKEY_INFO {key='9'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;},
+        AVKON_SKEY_INFO {key='9'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;},
+        AVKON_SKEY_INFO {key='*'; sid=EAvkonSIDNoSound;},
+        AVKON_SKEY_INFO {key='*'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;},
+        AVKON_SKEY_INFO {key='*'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;},
+        AVKON_SKEY_INFO {key=EStdKeyHash; sid=EAvkonSIDNoSound;},
+        AVKON_SKEY_INFO {key=EStdKeyHash; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;},
+        AVKON_SKEY_INFO {key=EStdKeyHash; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phone_emergency_network_connect_wait_note
+//
+//    It defines wait note showing when attempting an
+//    emergency call.
+//
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_phone_emergency_network_connect_wait_note
+    {
+    flags = EEikDialogFlagNoDrag |
+            EEikDialogFlagNoTitleBar |
+            EEikDialogFlagCbaButtons;
+
+    buttons = r_phoneui_callhandling_callsetup_empty_endoutgoing_cba;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EPhoneWaitNote;
+            control = AVKON_NOTE
+                {
+                layout = EWaitLayout;
+                singular_label = qtn_emerg_emergency_call_note;
+                imageid=EMbmAvkonQgn_note_progress;
+                imagemask=EMbmAvkonQgn_note_progress_mask;
+                animation = R_QGN_GRAF_WAIT_BAR_ANIM;
+                };
+            }
+        };
+    }
+// ---------------------------------------------------------
+//
+//    r_phone_emergency_network_connect_wait_note_empty_dialer
+//
+//    It defines wait note showing when attempting an
+//    emergency call with onscreen dialer.
+//
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_phone_emergency_network_connect_wait_note_empty_dialer
+    {
+    flags = EEikDialogFlagNoDrag |
+            EEikDialogFlagNoTitleBar |
+            EEikDialogFlagCbaButtons;
+
+    buttons = r_phoneui_callhandling_callsetup_empty_dtmfdialer_cba;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EPhoneWaitNote;
+            control = AVKON_NOTE
+                {
+                layout = EWaitLayout;
+                singular_label = qtn_emerg_emergency_call_note;
+                imageid=EMbmAvkonQgn_note_progress;
+                imagemask=EMbmAvkonQgn_note_progress_mask;
+                animation = R_QGN_GRAF_WAIT_BAR_ANIM;
+                };
+            }
+        };
+    }
+// ---------------------------------------------------------
+//
+//    r_phoneui_emergency_attempting_wait_note
+//
+//    It defines wait note showing when attempting an
+//    emergency call.
+//
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_phone_disconnecting_network_wait_note
+    {
+    flags = EEikDialogFlagNoDrag |
+            EEikDialogFlagNoTitleBar |
+            EEikDialogFlagCbaButtons;
+
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EPhoneWaitNote;
+            control = AVKON_NOTE
+                {
+                layout = EWaitLayout;
+                singular_label = qtn_nam_disconnecting;
+                imageid=EMbmAvkonQgn_note_progress;
+                imagemask=EMbmAvkonQgn_note_progress_mask;
+                animation = R_QGN_GRAF_WAIT_BAR_ANIM;
+                };
+            }
+        };
+    }
+
+
+// ---------------------------------------------------------
+//
+//    r_phone_emergency_mode_information_note
+//    It defines the information note for
+//    Emergency Mode notes
+//
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_phone_emergency_mode_information_note
+    {
+    flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar |
+            EEikDialogFlagCbaButtons;
+
+    buttons = r_phoneui_emergency_mode_note_cba;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EPhoneGeneralNote;
+            control = AVKON_NOTE
+                {
+                layout = EGeneralLayout;
+                singular_label = qtn_emerg_emerg_only_perm;
+                plural_label = "";
+                animation = R_QGN_NOTE_INFO_ANIM;
+                };
+            }
+        };
+    }
+
+RESOURCE AVKON_LAYOUT_RECT r_avkon_exit_emergency_query_heading_pane { l=0; t=3; W=168; H=23; }
+
+// ---------------------------------------------------------
+//
+//    r_phone_exit_emergency_mode_query
+//    It defines the information note for
+//    Emergency Mode notes
+//
+// ---------------------------------------------------------
+
+
+RESOURCE DIALOG r_phone_exit_emergency_mode_query
+    {
+    flags = EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
+
+    buttons = r_phoneui_exit_emergency_mode_cba;
+    items =
+        {
+    DLG_LINE
+        {
+        type = EAknCtPopupHeadingPane;
+        id = EAknMessageQueryHeaderId;
+        control = AVKON_HEADING
+        {
+        label  = qtn_emerg_query_hdr_warn;
+        headinglayout = r_avkon_exit_emergency_query_heading_pane;
+        };
+        },
+        DLG_LINE
+            {
+            type = EAknCtMessageQuery;
+            id = EAknMessageQueryContentId;
+            control = AVKON_MESSAGE_QUERY
+                {
+                message = qtn_emerg_gps_quest_contine;
+                };
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_enter_service_area_information_note
+//    It defines the information note for
+//    Emergency Mode notes
+//
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_phoneui_enter_service_area_information_note
+    {
+    flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar |
+            EEikDialogFlagCbaButtons;
+
+    buttons = R_AVKON_SOFTKEYS_EMPTY;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EPhoneGeneralNote;
+            control = AVKON_NOTE
+                {
+                layout = EGeneralLayout;
+                singular_label = "";
+                plural_label = "";
+                };
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_no_service_information_note
+//    It defines the information note for
+//    Emergency Mode notes
+//
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_phoneui_no_service_information_note
+    {
+    flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar |
+            EEikDialogFlagCbaButtons;
+
+    buttons = R_AVKON_SOFTKEYS_EMPTY;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EPhoneGeneralNote;
+            control = AVKON_NOTE
+                {
+                layout = EGeneralLayout;
+                singular_label = "";
+                plural_label = "";
+                animation = R_QGN_NOTE_INFO_ANIM;
+                };
+            }
+        };
+    }
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_send_dtmf_query
+//    This is a data query used to ask for a DTMF number from the user.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_phoneui_send_dtmf_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_EMPTY;   // NOTE: CBA is overridden by CPADataQuery inherited class
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_DATA_QUERY
+                {
+                layout = EPhoneLayout;
+                label = qtn_dtmf_number_query;
+                control = EDWIN
+                    {
+                    flags = EEikEdwinNoHorizScrolling |
+                            EEikEdwinResizable;
+                    maxlength = 60;
+                    width = 6;
+                    lines = 1;
+                    allowed_input_modes = EAknEditorNumericInputMode;
+                    default_input_mode = EAknEditorNumericInputMode;
+                    };
+                };
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_dtmf_speed_dial_number_query
+//    This is a data query used to ask for a speed dial number from the user.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_phoneui_dtmf_speed_dial_number_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_EMPTY;   // NOTE: CBA is overridden by CPADataQuery inherited class
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_DATA_QUERY
+                {
+                layout = EPhoneLayout;
+                label = qtn_dtmf_spdial_number_query;
+                control = EDWIN
+                    {
+                    flags = EEikEdwinNoHorizScrolling |
+                            EEikEdwinResizable;
+                    maxlength = 60;
+                    width = 6;
+                    lines = 1;
+                    allowed_input_modes = EAknEditorNumericInputMode;
+                    default_input_mode = EAknEditorNumericInputMode;
+                    };
+                };
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_sending_dtmf_wait_note
+//    This is a wait note, shown while the PhoneEngine plays the DTMF String.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_phoneui_sending_dtmf_wait_note
+    {
+    flags = EEikDialogFlagNoDrag |
+            EEikDialogFlagNoTitleBar |
+            EEikDialogFlagCbaButtons;
+
+    buttons = r_phoneui_dtmf_softkeys_empty_cancel;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EPhoneWaitNote;
+            control = AVKON_NOTE
+                {
+                layout = EWaitLayout;
+                singular_label = "";    // generated dynamically...
+                imageid = EMbmAvkonQgn_note_progress;
+                imagemask = EMbmAvkonQgn_note_progress_mask;
+                animation = R_QGN_GRAF_WAIT_BAR_ANIM;
+                };
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_sending_dtmf_wait_note_text
+//    This is a template used to produce the text
+//    for the r_phone_dtmf_sending_wait_note wait note.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_sending_dtmf_wait_note_text
+    {
+    buf = qtn_dtmf_sending_wait_note;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_dtmf_wait_character_confirmation_query
+//    This dialog is used by DTMF Feature, displayed after a Wait Character is
+//    parsed, to ask the user if they wish to continue sending, or cancel.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_phoneui_dtmf_wait_character_confirmation_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = r_phoneui_dtmf_softkeys_send_cancel;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_CONFIRMATION_QUERY
+                {
+                layout = EConfirmationLayout;
+                label = ""; // generated dynamically...
+                };
+            }
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_als_confirmation_query
+//    It defines  the confirmaiton query dialogue when the system
+//    is about to toggle primary phone line and alternative phone
+//    phone line.
+//
+// -----------------------------------------------------------------------------
+//
+
+RESOURCE DIALOG r_phoneui_als_confirmation_query
+    {
+    flags=EGeneralQueryFlags;
+    buttons=r_phoneui_als_query_softkeys_yes_no;
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtQuery;
+            id=EGeneralQuery;
+            control= AVKON_CONFIRMATION_QUERY
+                {
+                layout = EConfirmationLayout;
+                label = text_als_line_change_query;
+                animation = R_QGN_NOTE_QUERY_ANIM;
+                };
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_als_query_softkeys_yes_no
+//    It is softkeys for als line change confirmation query.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_als_query_softkeys_yes_no
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdYesAlsLineChange;
+            txt = text_softkey_yes;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdNoAlsLineChange;
+            txt = text_softkey_no;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdYesAlsLineChange;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_als_line_blocking_error
+//    If user try to change als line while link blocking is on,
+//    this error note will be shown.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_line_blocking_note_text
+    {
+    buf = qtn_als_line_error_no_line_change;
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_new_call_phone_number_editor
+//    The "Phone number Editor" dialog for New call
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_phoneui_new_call_phone_number_editor
+    {
+    flags = EAknDialogGenericQueryFlags | EEikDialogFlagNoShadow;
+    buttons = r_phoneui_callhandling_new_call_find_cba;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_DATA_QUERY
+                {
+                layout = EPhoneLayout;
+                label = text_phone_number;
+                control = EDWIN
+                    {
+                    flags = EEikEdwinNoHorizScrolling |
+                            EEikEdwinResizable;
+                    width=6;
+                    lines=1;
+                    maxlength=80;
+                    allowed_input_modes = EAknEditorNumericInputMode;
+                    default_input_mode = EAknEditorNumericInputMode;
+                    };
+                };
+            }
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_title_in_new_call_fetch
+//    It is title used in new call single item fetch.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_title_in_new_call_fetch
+    {
+    buf = qtn_incal_call_title;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// The following resources exist so that translated strings can be referenced
+// directly in C++ code.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_dtmf_wait_character_confirmation_query_text
+    {
+    buf = qtn_dtmf_send_string_query;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_title_in_dtmf_fetch
+//    It is text shown in title pane during DTMF fetch.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_title_in_dtmf_fetch
+    {
+    buf = qtn_dtmf_phonebook_title;
+    }
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_information_note
+//    It defines note template for information notes. Text
+//    must be replaced to correct in code.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_phone_information_note
+    {
+    flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar |
+            EEikDialogFlagCbaButtons;
+    buttons = R_AVKON_SOFTKEYS_EMPTY;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EPhoneGeneralNote;
+            control = AVKON_NOTE
+                {
+                layout = EGeneralLayout;
+                singular_label = ""; //must be replaced to correct in code
+                plural_label = "";
+                animation = R_QGN_NOTE_INFO_ANIM;
+                };
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_conference_private_softkeys
+//    It contains softkey definitions for private operation.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_conference_private_softkeys
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdPrivate;
+            txt = qtn_softkey_private;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyCancel;
+            txt = text_softkey_cancel;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdPrivate;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_conference_private_dialog
+//    It contains definition for private dialog.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_conference_private_dialog
+    {
+    flags = EEikDialogFlagNoDrag |
+            EEikDialogFlagNoTitleBar |
+            EEikDialogFlagCbaButtons |
+            EEikDialogFlagNoBackgroundFade |
+            EEikDialogFlagNotifyEsc;
+
+    buttons = r_conference_private_softkeys;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_conference_dropparticipant_softkeys
+//    It contains softkey definitions for drop participant
+//    operation.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_conference_dropparticipant_softkeys
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdDrop;
+            txt = qtn_softkey_drop_participant;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyCancel;
+            txt = text_softkey_cancel;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdDrop;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_conference_dropparticipant_dialog
+//    It contains definition for drop participant dialog.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_conference_dropparticipant_dialog
+    {
+    flags = EEikDialogFlagNoDrag |
+            EEikDialogFlagNoTitleBar |
+            EEikDialogFlagCbaButtons |
+            EEikDialogFlagNoBackgroundFade |
+            EEikDialogFlagNotifyEsc;
+    buttons = r_conference_dropparticipant_softkeys;
+    }
+
+
+
+// -----------------------------------------------------------------------------
+//    r_phone_imei_string
+//    It is template for text in IMEI note.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_imei_string
+    {
+    buf = text_imei;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_phone_bt_dev_address
+//    It is template for text in bluetooth device address note.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_bt_dev_address
+    {
+    buf = qtn_bt_dev_address;
+    }
+
+
+// ---------------------------------------------------------
+//
+//    r_phone_information_note_with_wait
+//    It defines note template for information notes. Text
+//    must be replaced to correct in code. Note has wait
+//    flag.
+//
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_phone_information_note_with_wait
+    {
+    flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar |
+            EEikDialogFlagCbaButtons | EEikDialogFlagWait;
+    buttons = r_phoneui_wait_note_cba;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EPhoneGeneralNote;
+            control = AVKON_NOTE
+                {
+                layout = EGeneralLayout;
+                singular_label = ""; //must be replaced to correct in code
+                plural_label = "";
+                animation = R_QGN_NOTE_INFO_ANIM;
+                };
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_confirmation_note
+//    It defines note template for confirmation notes. Text
+//    must be replaced to correct in code.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_phone_confirmation_note
+    {
+    flags = EEikDialogFlagNoDrag |
+            EEikDialogFlagNoTitleBar |
+            EEikDialogFlagCbaButtons;
+    buttons = R_AVKON_SOFTKEYS_EMPTY;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EPhoneGeneralNote;
+            control = AVKON_NOTE
+                {
+                layout = EGeneralLayout;
+                singular_label = ""; //must be replaced to correct in code
+                plural_label = "";
+                animation = R_QGN_NOTE_OK_ANIM;
+                };
+            }
+        };
+    }
+// -----------------------------------------------------------------------------
+//
+//    r_phone_warning_note
+//    It defines note template for warning notes. Text
+//    must be replaced to correct in code.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_phone_warning_note
+    {
+    flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar |
+            EEikDialogFlagCbaButtons;
+    buttons = R_AVKON_SOFTKEYS_EMPTY;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EPhoneGeneralNote;
+            control = AVKON_NOTE
+                {
+                layout = EGeneralLayout;
+                singular_label = ""; //must be replaced to correct in code
+                plural_label = "";
+                animation = R_QGN_NOTE_WARNING_ANIM;
+                };
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_error_note
+//    It defines note template for error notes. Text
+//    must be replaced to correct in code.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_phone_error_note
+    {
+    flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar |
+            EEikDialogFlagCbaButtons;
+    buttons = R_AVKON_SOFTKEYS_EMPTY;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EPhoneGeneralNote;
+            control = AVKON_NOTE
+                {
+                layout = EGeneralLayout;
+                singular_label = ""; //must be replaced to correct in code
+                plural_label = "";
+                animation = R_QGN_NOTE_ERROR_ANIM;
+                };
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_requesting_wait_note
+//    Requesting wait note when USSD is activated
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_requesting_wait_note
+    {
+    flags = EAknWaitNoteFlags;
+    buttons=R_AVKON_SOFTKEYS_EMPTY;
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtNote;
+            id = EPhoneWaitNote;
+            control= AVKON_NOTE
+                {
+                layout = EWaitLayout;
+                singular_label = text_sending;
+                animation = R_QGN_GRAF_WAIT_BAR_ANIM;
+                };
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_security_information_note
+//    It defines note template for information notes for
+//    security notes. Text must be replaced to correct in code.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_phone_security_information_note
+    {
+    flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar |
+            EEikDialogFlagCbaButtons;
+    buttons = R_AVKON_SOFTKEYS_EMPTY;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EPhoneGeneralNote;
+            control = AVKON_NOTE
+                {
+                layout = EGeneralLayout;
+                singular_label = "";
+                plural_label = "";
+                animation = R_QGN_NOTE_INFO_ANIM;
+                };
+            }
+        };
+    }
+
+
+
+RESOURCE TBUF  r_phone_ss_notification_mocal_waiting_text
+    {
+        buf = qtn_mocal_waiting_note;
+    }
+
+RESOURCE TBUF  r_phone_ss_notification_clir_suppr_reject_text
+    {
+        buf = text_clir_suppr_reject;
+    }
+
+
+RESOURCE TBUF  r_phone_ss_notification_incal_info_hold_text
+    {
+        buf = qtn_incal_info_hold;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_ss_notification_incal_wait_transfer_text
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF  r_phone_ss_notification_incal_wait_transfer_text
+    {
+        buf = qtn_incal_wait_transfer;
+    }
+
+RESOURCE TBUF  r_phone_ss_notification_incal_transferred_text
+    {
+        buf = qtn_incal_transferred_note;
+    }
+
+
+RESOURCE TBUF  r_phone_ss_notification_incal_transferred_nro_text
+    {
+        buf = qtn_incal_transferred_nro_note;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_error_request_rejected.
+//    It's used after failure of call concerned ss.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_error_request_rejected
+    {
+    buf = text_request_rejected;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_error_check_network_services
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_error_check_network_services
+    {
+    buf = text_net_info_lost;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_note_text_phone_engine_failed_at_startup.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_note_text_phone_engine_failed_at_startup
+    {
+    buf = qtn_debug_pe_failed_at_startup;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_error_call_not_allowed.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_error_call_not_allowed
+    {
+    buf = text_call_not_allowed;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_error_call_not_allowed_fdn.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_error_call_not_allowed_fdn
+    {
+    buf = qtn_fdn_call_not_allowed;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_error_call_in_progress.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_error_call_in_progress
+    {
+    buf = text_call_in_progress;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_error_emergency_calls_only.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_error_emergency_calls_only
+    {
+    buf = qtn_emerg_emergency_only;
+    }
+
+
+// ---------------------------------------------------------
+//
+//    r_phone_error_number_busy
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_phone_error_number_busy
+    {
+    buf = text_user_busy;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_note_text_post_call_summary
+//    Information text shown in post call screen when call is ended
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_note_text_post_call_summary
+    {
+    buf = text_cterm_note_title;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_note_text_post_call_summary
+//    Information text shown in post call screen when call is ended
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_note_text_post_call_duration
+    {
+    buf = qtn_cterm_time;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_no_video_network
+//
+//    The text shown in information note when there is no
+//    network support for video call.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_no_video_network
+    {
+    buf = qtn_tel_info_video_setup_failed;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_error_note_speed_dial_not_assigned
+//    Information text when speed dial substitution entry is not defined
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_error_note_speed_dial_not_assigned
+    {
+    buf = qtn_dtmf_spdial_empty_err_note;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_error_note_invalid_speed_dial
+//    Information text when speed dial substitution entry is invalid
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_error_note_invalid_speed_dial
+    {
+    buf = qtn_dtmf_invalid_spdial_err_note;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_error_emergency_attempt_failed
+//    It defines text shown in error note if emergency
+//    call fails.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_error_emergency_attempt_failed
+    {
+    buf = qtn_emerg_call_error_note;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_video_call_incoming_short
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_video_call_incoming_short
+    {
+    buf = qtn_mtcal_incoming_vt_short;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_video_call_incoming
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_video_call_incoming
+    {
+    buf = qtn_mtcal_incoming_video_call;
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_video_call_not_possible
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_video_call_not_possible
+    {
+    buf = qtn_video_call_not_possible;
+    }
+
+// -----------------------------------------------------------------------------
+//   Alerting video call softkeys.
+//    r_phoneui_softkeys_options_enablevideo
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_softkeys_options_enablevideo
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdEnableVideo;
+            txt = qtn_incal_softk_enable_video;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_error_call_barred_in_cug
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_error_call_barred_in_cug
+    {
+    buf = text_cterm_d_barred_in_cug;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_error_select_cug
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_error_select_cug
+    {
+    buf = text_cterm_d_no_cug_selected;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_error_cug_unknown
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_error_cug_unknown
+    {
+    buf = text_cterm_d_unknown_cug_index;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_error_not_possible_in_cug
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_error_not_possible_in_cug
+    {
+    buf = text_cterm_d_cug_bs_incompab;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_error_check_cug
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_error_check_cug
+    {
+    buf = text_cterm_d_cug_call_failur;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_error_check_clir
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_error_check_clir
+    {
+    buf = text_cterm_d_clir_not_subscr;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_phone_wlan_mac_string
+//    It is template for text in WLAN MAC note.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_wlan_mac_string
+    {
+    buf = qtn_wlan_info_mac_address;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_text_colp_connected
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_text_colp_connected
+    {
+    buf = text_colp_connected;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_phone_bt_loopback_enabled_string
+//    It is text for bluetooth RF loopback enabled note.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_bt_loopback_enabled_string
+    {
+    buf = qtn_bt_loopback_enabled;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_phone_bt_loopback_disabled_string
+//    It is text for bluetooth RF loopback disabled note.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_bt_loopback_disabled_string
+    {
+    buf = qtn_bt_loopback_disabled;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_phone_incall_info_no_network_support
+//    It is text for no network support for video call note.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_incall_info_no_network_support
+    {
+    buf = qtn_incal_info_no_network_support;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_phone_incall_info_video_call_not_allowed_during_restore
+//    It is text for video call not allowed during MC restore note.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_incall_info_video_call_not_allowed_during_restore
+    {
+    buf = qtn_video_call_not_allowed;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_phone_incall_info_video_call_setup_failed
+//    It is text for video setup failure.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_incall_info_video_call_setup_failed
+    {
+    buf = qtn_tel_info_video_setup_failed;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_error_no_service
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_error_no_service
+    {
+    buf = text_no_service;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_incall_query_switch_to_video
+//    It defines the confirmation query dialogue when the system
+//    is about to switch from voice call to video call
+//    phone line.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_phone_incall_query_switch_to_video
+    {
+    flags=EGeneralQueryFlags;
+    buttons=r_phone_incall_query_switch_to_video_softkeys_yes_no;
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtQuery;
+            id=EGeneralQuery;
+            control= AVKON_CONFIRMATION_QUERY
+                {
+                layout = EConfirmationLayout;
+                label = qtn_query_create_video_call;
+                animation = R_QGN_NOTE_QUERY_ANIM;
+                };
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_incall_query_switch_to_video_softkeys_yes_no
+//    It is softkeys for switch to video query.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phone_incall_query_switch_to_video_softkeys_yes_no
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdYesSwitchToVideo;
+            txt = text_softkey_yes;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdNoSwitchToVideo;
+            txt = text_softkey_no;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdYesSwitchToVideo;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_incall_query_switch_to_voice
+//    It defines the confirmation query dialogue when the system
+//    is about to switch from video call to voice call
+//    phone line.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_phone_incall_query_switch_to_voice
+    {
+    flags=EGeneralQueryFlags;
+    buttons=r_phone_incall_query_switch_to_voice_softkeys_yes_no;
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtQuery;
+            id=EGeneralQuery;
+            control= AVKON_CONFIRMATION_QUERY
+                {
+                layout = EConfirmationLayout;
+                label = qtn_incal_query_create_video_call;
+                animation = R_QGN_NOTE_QUERY_ANIM;
+                };
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_incall_query_switch_to_voice_softkeys_yes_no
+//    It is softkeys for switch to video query.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phone_incall_query_switch_to_voice_softkeys_yes_no
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdYesSwitchToVoice;
+            txt = text_softkey_yes;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdNoSwitchToVoice;
+            txt = text_softkey_no;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdYesSwitchToVoice;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_line_blocking_note
+//    If user try to change als line while link blocking is on,
+//    this error note will be shown.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_line_blocking_note
+    {
+    buf = qtn_als_line_error_no_line_change;
+    }
+
+// SIM RELATED TEXTS
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_sim_removed
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_sim_removed
+    {
+    buf = qtn_su_note_insert_sim;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_reboot_required
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_reboot_required
+    {
+    buf = qtn_memlo_reboot;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_sim_rejected
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_sim_rejected
+    {
+    buf = text_sim_rejected;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_sim_unaccepted
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_sim_unaccepted
+    {
+    buf = text_sim_lock_active;
+    }
+
+
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_continue_in_handset
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_continue_in_handset
+    {
+    buf = qtn_que_continue_in_handset;
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_continue_in_loudspeeker
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_continue_in_loudspeaker
+    {
+    buf = qtn_que_continue_in_louds;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_incomingdataorfaxcall_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_incomingdataorfaxcall_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneCallComingCmdReject;
+            txt =  qtn_incal_reject_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_alertingvideocall_options_menu
+//    Default commands menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_alertingvideocall_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf;
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf;
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisOutgoingCall;
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp;
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_alertingvideocall_menubar
+//    Default menubar shown when video call view is in alerting
+//    call state.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_alertingvideocall_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_alertingvideocall_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_incomingdataorfaxcall_menubar
+//    Default menubar shown when data or fax call is incoming.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_incomingdataorfaxcall_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_incomingdataorfaxcall_options_menu;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_phoneui_aiwshare_interest
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AIW_INTEREST r_phoneui_aiwshare_interest
+    {
+    items =
+        {
+        AIW_CRITERIA_ITEM
+            {
+            id              = EPhoneVideoSharing;
+            serviceCmd      = KAiwCmdShare;
+            serviceClass    = KAiwClassMenu;
+            contentType     = "*";
+            defaultProvider = 0x10282389;
+            maxProviders    = 1;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_call_info_cause_value3
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_call_info_cause_value3
+    {
+    buf = qtn_call_info_cause_value3;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_call_info_cause_value16
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_call_info_cause_value16
+    {
+    buf = qtn_call_info_cause_value16;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_call_info_cause_value18
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_call_info_cause_value18
+    {
+    buf = qtn_call_info_cause_value18;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_call_info_cause_value21
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_call_info_cause_value21
+    {
+    buf = qtn_call_info_cause_value21;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_call_info_cause_value22
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_call_info_cause_value22
+    {
+    buf = qtn_call_info_cause_value22;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_call_info_cause_value31
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_call_info_cause_value31
+    {
+    buf = qtn_call_info_cause_value31;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_call_info_cause_value34
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_call_info_cause_value34
+    {
+    buf = qtn_call_info_cause_value34;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_call_info_cause_value38
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_call_info_cause_value38
+    {
+    buf = qtn_call_info_cause_value38;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_call_info_cause_value50
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_call_info_cause_value50
+    {
+    buf = qtn_call_info_cause_value50;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_call_info_cause_value55
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_call_info_cause_value55
+    {
+    buf = qtn_call_info_cause_value55;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_call_info_cause_value57
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_call_info_cause_value57
+    {
+    buf = qtn_call_info_cause_value57;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_call_info_cause_value58
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_call_info_cause_value58
+    {
+    buf = qtn_call_info_cause_value58;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_call_info_cause_value88
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_call_info_cause_value88
+    {
+    buf = qtn_call_info_cause_value88;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_call_info_cause_value127
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_call_info_cause_value127
+    {
+    buf = qtn_call_info_cause_value127;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_call_info_not_supported
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_call_info_not_supported
+    {
+    buf = qtn_call_info_not_supported;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_call_info_service_not_available
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_call_info_service_not_available
+    {
+    buf = qtn_call_info_service_not_available;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_qtn_enter_manually_query_item
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_qtn_enter_manually_query_item
+    {
+    buf = qtn_enter_manually_query_item;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_qtn_find_query_item
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_qtn_find_query_item
+    {
+    buf = qtn_find_query_item;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_dtmf_list_query
+//    It is list query used to ask predefined dtmf string from user.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_phone_dtmf_list_query
+    {
+    flags   =  EEikDialogFlagNoDrag |
+               EEikDialogFlagNoTitleBar |
+               EEikDialogFlagCbaButtons;
+
+    buttons = R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT;
+    items   =
+        {
+        DLG_LINE
+            {
+            type    = EAknCtListQueryControl;
+            id      = EListQueryControl;
+            control = AVKON_LIST_QUERY_CONTROL
+                {
+                listtype = EAknCtSinglePopupMenuListBox;
+                listbox  = LISTBOX
+                    {
+                    flags    = EAknListBoxMenuList|
+                               EEikEdwinNoWrap;
+                    height   = 3;
+                    width    = 3;
+                    };
+
+                heading  = qtn_send_dtmf_query_prmpt;
+                };
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_tty_info_no_audio_control
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_tty_info_no_audio_control
+    {
+    buf = qtn_tty_info_no_audio_control;
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_participant_list_menu
+//    Menu shown when conference participant view is active.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_participant_list_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdPrivate;
+            txt =  qtn_incal_private_part_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDrop;
+            txt =  qtn_incal_drop_part_option;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_participant_list_menubar
+//    Menubar for conference participant view.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_participant_list_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_participant_list_menu;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_participant_list_drop_menu
+//    Menu shown when conference participant view is active.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_participant_list_drop_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDrop;
+            txt =  qtn_incal_drop_part_option;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_participant_list_drop_menubar
+//    Menubar for conference participant view.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_participant_list_drop_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_participant_list_drop_menu;
+            }
+        };
+    }
+
+
+//dialer specific
+
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_dialer_numberentry_prompt_text
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_dialer_numberentry_prompt_text
+    {
+    buf = qtn_dialer_dtmf_number_input_field_text;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_dialer_tooltip_recent_calls
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_dialer_tooltip_recent_calls
+    {
+    buf = qtn_dialer_tooltip_recent_calls;
+    }
+
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_dialer_tooltip_call
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_dialer_tooltip_call
+    {
+    buf = qtn_dialer_tooltip_call;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_dialer_tooltip_send
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_dialer_tooltip_send
+    {
+    buf = qtn_dialer_tooltip_send;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_dialer_tooltip_contact
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_dialer_tooltip_contacts
+    {
+    buf = qtn_dialer_tooltip_contacts;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_dialer_tooltip_add_to_contacts
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_dialer_tooltip_add_to_contacts
+    {
+    buf = qtn_dialer_tooltip_add_to_contacts;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_dialer_tooltip_clear
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_dialer_tooltip_clear
+    {
+    buf = qtn_dialer_tooltip_clear;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_tooltip_loudspeaker
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_tooltip_loudspeaker
+    {
+    buf = qtn_incal_tooltip_loudspeaker;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_tooltip_handset
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_tooltip_handset
+    {
+    buf = qtn_incal_tooltip_handset;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_tooltip_mute
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_tooltip_mute
+    {
+    buf = qtn_incal_tooltip_mute;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_tooltip_unmute
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_tooltip_unmute
+    {
+    buf = qtn_incal_tooltip_unmute;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_tooltip_contacts
+//
+// ----------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_tooltip_contacts
+    {
+    buf = qtn_incal_tooltip_contacts;
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneuidialer_numberacq_menubar
+//    Default menubar shown when number acquistion view is active.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneuidialer_numberacq_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneuidialer_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneuidialer_numberacq_menubar
+//    Default menubar shown when touch DTMF view is active.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneuidialer_dtmfview_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneuidialer_dtmfview_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneuidialer_numberacq_emergency_menubar
+//    Default menubar shown when number acquistion view is active.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneuidialer_numberacq_emergency_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneuidialer_emergency_options_menu;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//   r_phonedialer_menu
+//   Menu for Dialer
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneuidialer_options_menu
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdSendCommand;
+            txt = text_nren_send_com;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdCall;
+            cascade = r_phoneui_numberacq_options_call_menu;
+            txt = text_number_call;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdSendMessage;
+            txt = qtn_nren_send_message;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneDialerCallHandling;
+            txt = qtn_dialer_call_handling_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneDialerCmdTouchInput;
+            txt = qtn_dialer_touch_input_options;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneDialerCmdLog;
+            txt = qtn_dialer_recent_calls_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneDialerCmdContacts;
+            txt = qtn_dialer_contacts_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneDialerCmdSpeedDial;
+            txt = qtn_dialer_speed_dial_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdAddToContacts;
+            cascade = r_phoneui_numberacq_options_add_to_contacts_menu;
+            txt = qtn_phob_opt_save_to_pb;
+            flags = EEikMenuItemSeparatorAfter;
+            },
+        MENU_ITEM
+            {
+            command = EAknCmdEditItemPlaceHolder;
+            },
+       MENU_ITEM
+            {
+            command = EPhoneDialerCallSettings;
+            txt = qtn_dialer_call_settings_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneDialerCmdHelp;
+            txt = qtn_options_help;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneCmdBack;
+            txt = qtn_options_exit;
+            }
+        };
+    }
+
+
+// ---------------------------------------------------------
+//
+//   r_phoneuidialer_emergency_options_menu
+//   Menu for Dialer in emergencycall state
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneuidialer_emergency_options_menu
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EPhoneDialerCallHandling;
+            txt = qtn_dialer_call_handling_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneDialerCmdTouchInput;
+            txt = qtn_dialer_touch_input_options;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneDialerCmdLog;
+            txt = qtn_dialer_recent_calls_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneDialerCmdContacts;
+            txt = qtn_dialer_contacts_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneDialerCmdSpeedDial;
+            txt = qtn_dialer_speed_dial_option;
+            },
+        MENU_ITEM
+            {
+            command = EAknCmdEditItemPlaceHolder;
+            },
+       MENU_ITEM
+            {
+            command = EPhoneDialerCallSettings;
+            txt = qtn_dialer_call_settings_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneDialerCmdHelp;
+            txt = qtn_options_help;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneCmdBack;
+            txt = qtn_options_exit;
+            }
+        };
+    }
+
+
+// ---------------------------------------------------------
+//
+//   r_phoneuidialer_dtmfview_options_menu
+//   Menu for Dialer dtmf view
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneuidialer_dtmfview_options_menu
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EPhoneCmdDtmfOk;
+            txt = text_nren_send_com;
+            },
+        MENU_ITEM
+            {
+            command = EAknCmdEditItemPlaceHolder;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneDialerCmdHelpDtmf;
+            txt =  qtn_options_help;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneDtmfDialerExit;
+            txt = qtn_options_exit;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_dialer_add_to_contacts_selection_list_query
+//    Resource structure
+//
+// ---------------------------------------------------------
+//
+RESOURCE AVKON_LIST_QUERY r_dialer_add_to_contacts_selection_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_dialer_add_to_contact;
+                listbox = AVKON_LIST_QUERY_LIST
+                    {
+                    array_id = r_phone_contact_add_to_selection_array;
+                    };
+                };
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phone_contact_add_to_selection_array
+//    Array for "add to contact" options.
+//
+// ---------------------------------------------------------
+//
+RESOURCE ARRAY r_phone_contact_add_to_selection_array
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_dialer_create_new;
+            },
+        LBUF
+            {
+            txt = qtn_dialer_update_existing;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_incall_dialer_cba
+//    Softkeys shown in incall situation with onscreen dialer.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_incall_dialer_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdDialer;
+            txt = qtn_incal_softk_dialer;
+            },
+
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdActivatEPhonebook;
+            txt = qtn_msk_contacts;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_incall_dialer_tohandset_cba
+//    Softkeys shown in incall situation with onscreen dialer.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_incall_dialer_tohandset_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdDialer;
+            txt = qtn_incal_softk_dialer;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdEndThisOutgoingCall;
+            txt = text_softkey_drop;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyEmpty;
+            txt = "";
+            }
+        };
+    }
+
+RESOURCE INDICATOR_PANE r_phoneui_empty_indicators
+     {
+     indicators =
+         {
+         };
+     }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_dialer_cba
+//    It contains softkey definitions for dialer.
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_dialer_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdBack;
+            txt = text_softkey_exit;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_callhandling_incall_endactive_cba
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_callhandling_incall_endactive_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdEndThisActiveCall;
+            txt = qtn_incal_softk_end_this;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_callcoming_swivel_closed_cba
+//    It contains softkey definitions for call coming in.
+//    Ringing tone is not muted.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_callcoming_swivel_closed_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCallComingCmdSilent;
+            txt = text_softkey_silent;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCallComingCmdAnswer;
+            txt = qtn_msk_call_answer_loudspeaker;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_callcoming_silent_swivel_closed_cba
+//    It contains softkey definitions for call coming in.
+//    Ringing tone is muted.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_callcoming_silent_swivel_closed_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCallComingCmdReject;
+            txt = text_softkey_reject;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCallComingCmdAnswer;
+            txt = qtn_msk_call_answer_loudspeaker;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_waiting_answer_swivel_closed_cba
+//    It contains softkey definitions for waiting call.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_waiting_answer_swivel_closed_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCallComingCmdReject;
+            txt = text_softkey_reject;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCallComingCmdAnswer;
+            txt = qtn_msk_call_answer_loudspeaker;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phoneui_waiting_replace_swivel_closed_cba
+//    It contains softkey definitions for waiting and held and active calls.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_waiting_replace_swivel_closed_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCallComingCmdReject;
+            txt = text_softkey_reject;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdReplace;
+            txt = qtn_msk_replace;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_note_video_call_only_possible_under_3g_coverage
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_note_video_call_only_possible_under_3g_coverage
+    {
+    buf = qtn_video_call_only_possible_under_3g_coverage;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_note_unable_to_make_video_call_not_supported_by_other_phone
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_note_unable_to_make_video_call_not_supported_by_other_phone
+    {
+    buf = qtn_unable_to_make_video_call_not_supported_by_other_phone;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_note_phone_out_of_3g_coverage
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_note_phone_out_of_3g_coverage
+    {
+    buf = qtn_phone_out_of_3g_coverage;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_note_called_number_has_barred_incoming_calls
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_note_called_number_has_barred_incoming_calls
+    {
+    buf = qtn_called_number_has_barred_incoming_calls;
+    }
+
+//##########################################################
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/srcdata/phoneui_reg.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,35 @@
+/*
+* 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: Resource file for phoneui.
+*
+*/
+
+
+#include <appinfo.rh>
+#include <data_caging_paths_strings.hrh>
+#include "phoneui.hrh"
+#include <phoneui.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x100058B3 
+
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file = "PhoneUi";
+    hidden = KAppIsHidden;
+    localisable_resource_file = LOCALISABLE_RESOURCE_FILE_EXE;
+    localisable_resource_id = R_PHONEUI_LOCALISABLE_APP_INFO;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/srcdata/phoneuitouch.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,736 @@
+/*
+* 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 touch specific menu resources.
+*
+*/
+
+
+NAME    PTCH
+
+#include    <eikon.rh>
+#include    <avkon.loc>
+#include    <incallmenuandsoftkeys.loc>
+#include    <basiccallhandling.loc>
+#include    "phoneui.hrh"
+
+//  RESOURCE DEFINITIONS 
+
+RESOURCE RSS_SIGNATURE 
+    {
+    } 
+
+RESOURCE TBUF 
+    { 
+    buf = "PTCH";
+    }
+
+// Conference call menu
+
+// ----------------------------------------------------------------------------
+//   
+//    r_phoneui_touch_confcall_menubar
+//    Default menubar shown when call handling view is active in
+//    conference call state.
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_touch_confcall_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_touch_confcall_options_menu;
+            }
+        };
+    }
+    
+// ----------------------------------------------------------------------------
+//   
+//    r_phoneui_touch_confcall_options_menu
+//    Default commands menu pane.
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_touch_confcall_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute; 
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnhold; 
+            txt =  qtn_incal_unhold_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdParticipants;
+            txt =  qtn_incal_participants_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer; 
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf; 
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },            
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf; 
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndAllCalls; 
+            txt =  qtn_incal_end_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHold;
+            txt =  qtn_incal_hold_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute; 
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdLockKeypad;
+            txt = qtn_pwrc_lock_keys;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdLockScreen;
+            txt = qtn_pwrc_lock_display;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdNewCall; 
+            txt =  qtn_incal_new_call_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle; 
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery; 
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp; 
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// Conference and waiting call menu
+
+// ----------------------------------------------------------------------------
+//   
+//    r_phoneui_touch_confandcallwaiting_menubar
+//    Default menubar shown when call handling view is active in
+//    call waiting state.
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_touch_confandcallwaiting_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_touch_confandcallwaiting_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------------------
+//   
+//    r_phoneui_touch_confandcallwaiting_options_menu
+//    Default commands menu pane.
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_touch_confandcallwaiting_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute; 
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdAnswer; 
+            txt =  qtn_call_answer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReject; 
+            txt =  qtn_call_reject_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReplace;
+            txt =  qtn_incal_replace_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdConferenceUnhold; 
+            txt =  qtn_incal_unhold_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdParticipants;
+            txt =  qtn_incal_participants_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer; 
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf; 
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf; 
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },            
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndAllCalls; 
+            txt =  qtn_incal_end_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdConferenceHold; 
+            txt =  qtn_incal_hold_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute; 
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdNewCall; 
+            txt =  qtn_incal_new_call_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle; 
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery; 
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp; 
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+
+// Conference and held call menu
+
+// ----------------------------------------------------------------------------
+//   
+//    r_phoneui_touch_activeconfandheld_menubar
+//    Default menubar shown when call handling view is activeandheld
+//    call state.
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_touch_activeconfandheld_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_touch_activeconfandheldcall_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------------------
+//   
+//    r_phoneui_touch_activeconfandheldcall_options_menu
+//    Default commands menu pane.
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_touch_activeconfandheldcall_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute; 
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdSwap; 
+            txt =  qtn_incal_swap_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdParticipants;
+            txt =  qtn_incal_participants_option;
+            },            
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdJoin; 
+            txt =  qtn_incal_add_to_conf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer; 
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf; 
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf; 
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },            
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisActiveCall; 
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndAllCalls; 
+            txt =  qtn_incal_end_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute; 
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle; 
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery; 
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp; 
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// Held conference and active call menu
+
+// ----------------------------------------------------------------------------
+//   
+//    r_phoneui_touch_activeandheldconf_menubar
+//    Default menubar shown when call handling view is activeandheld
+//    call state.
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_touch_activeandheldconf_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_touch_activeandheldconfcall_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------------------
+//   
+//    r_phoneui_touch_activeandheldconfcall_options_menu
+//    Default commands menu pane.
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_touch_activeandheldconfcall_options_menu
+                    
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute; 
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdSwap; 
+            txt =  qtn_incal_swap_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdJoin; 
+            txt =  qtn_incal_join_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer; 
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf; 
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf; 
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },            
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisActiveCall; 
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndAllCalls; 
+            txt =  qtn_incal_end_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute; 
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle; 
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery; 
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp; 
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// Conference, held and waiting call menu
+
+// ----------------------------------------------------------------------------
+//   
+//    r_phoneui_touch_confcallactiveheldandwaiting_menubar
+//    Default menubar shown when call handling view is callactiveheldandwaiting
+//    call state.
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_touch_confcallactiveheldandwaiting_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_touch_confcallactiveheldandwaiting_options_menu;
+            }
+        };
+    }
+    
+// ----------------------------------------------------------------------------
+//   
+//    r_phoneui_touch_confcallactiveheldandwaiting_options_menu
+//    Default commands menu pane.
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_touch_confcallactiveheldandwaiting_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute; 
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReject; 
+            txt =  qtn_call_reject_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReplace;
+            txt =  qtn_incal_replace_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdSwap; 
+            txt =  qtn_incal_swap_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdParticipants;
+            txt =  qtn_incal_participants_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdJoin; 
+            txt =  qtn_incal_add_to_conf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer; 
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf; 
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf; 
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },            
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisActiveCall; 
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndAllCalls; 
+            txt =  qtn_incal_end_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute; 
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle; 
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery; 
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp; 
+            txt =  qtn_options_help;
+            }
+        };
+    }
+
+// Held conference, active call and waiting call menu
+
+// ----------------------------------------------------------------------------
+//   
+//    r_phoneui_touch_callactiveheldconfandwaiting_menubar
+//    Default menubar shown when call handling view is callactiveheldandwaiting
+//    call state.
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_touch_callactiveheldconfandwaiting_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_touch_callactiveheldconfandwaiting_options_menu;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------------------
+//   
+//    r_phoneui_touch_callactiveheldconfandwaiting_options_menu
+//    Default commands menu pane.
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_touch_callactiveheldconfandwaiting_options_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdUnmute; 
+            txt =  qtn_incal_unmute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReject; 
+            txt =  qtn_call_reject_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdReplace;
+            txt =  qtn_incal_replace_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdSwap; 
+            txt =  qtn_incal_swap_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdJoin; 
+            txt =  qtn_incal_join_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDialer; 
+            txt =  qtn_incal_dialer_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdActivateIhf; 
+            txt =  qtn_incal_act_ihf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDeactivateIhf; 
+            txt =  qtn_incal_deact_ihf_option;
+            },
+        MENU_ITEM            // HANDSET
+            {
+            command = EPhoneInCallCmdHandset;
+            txt = qtn_incal_handset_option;
+            },
+        MENU_ITEM            // BT HANDSFREE
+            {
+            command = EPhoneInCallCmdBtHandsfree;
+            txt = qtn_incal_bt_handsfree_option;
+            },            
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndThisActiveCall; 
+            txt =  qtn_incal_drop_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdEndAllCalls; 
+            txt =  qtn_incal_end_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdMute; 
+            txt =  qtn_incal_mute_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdGoToIdle; 
+            txt =  qtn_incal_goto_idle;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdDtmfListQuery; 
+            txt =  qtn_incal_send_dtmf_option;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp; 
+            txt =  qtn_options_help;
+            }
+        };
+    }
+     
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/Bmarm/3dringingtoneinterface_testsU.DEF	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	LibEntryL__Fv @ 1 NONAME R3UNUSED ; LibEntryL(void)
+	SetRequirements__FRP16CTestModuleParamRUl @ 2 NONAME R3UNUSED ; SetRequirements(CTestModuleParam *&, unsigned long &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/Bwins/3dringingtoneinterface_testsU.DEF	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	?LibEntryL@@YAPAVCTestModuleBase@@XZ @ 1 NONAME ; class CTestModuleBase * __cdecl LibEntryL(void)
+	?SetRequirements@@YAHAAPAVCTestModuleParam@@AAK@Z @ 2 NONAME ; int __cdecl SetRequirements(class CTestModuleParam * &,unsigned long &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/EABI/3dringingtoneinterface_testsU.def	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	_Z9LibEntryLv @ 1 NONAME
+	_Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/group/3dringingtoneinterface_tests.mmp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  MMP file for 3dringingtoneinterface_tests.
+*
+*/
+
+
+#if defined(__S60_)
+        // To get the OS_LAYER_SYSTEMINCLUDE-definition
+        #include <platform_paths.hrh>
+#endif
+
+TARGET          3dringingtoneinterface_tests.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E7
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         3dringingtoneinterface_tests.def
+
+SOURCEPATH      ../src
+SOURCE          3dringingtoneinterface_tests.cpp
+SOURCE          3dringingtoneinterface_testsCases.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+USERINCLUDE     ../inc 
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         ecom.lib
+LIBRARY         MediaClientAudio.lib
+
+LANG            SC
+
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/group/3dringingtoneinterface_tests.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,34 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing 3dringingtoneinterface_tests.
+;
+; Languages
+&EN
+
+; Header
+#{"3dringingtoneinterface_tests"}, (0x101FB3E7), 1, 0, 0
+
+; Localised Vendor name
+%{"Nokia Test EN"}
+
+; Unique Vendor name
+:"Vendor"
+
+;Key and certificate
+*"rd-key.pem","rd.cer"
+
+;  3dringingtoneinterface_tests
+"\epoc32\release\armv5\urel\3dringingtoneinterface_tests.dll"-"C:\sys\bin\3dringingtoneinterface_tests.dll"
+"..\init\3dringingtoneinterface_tests.ini"-"C:\TestFramework\3dringingtoneinterface_tests.ini"
+ 
Binary file phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/group/3dringingtoneinterface_tests.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build file for 3dringingtoneinterface_tests.
+*
+*/
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+// Example: 
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+// NOTE: If using ARS requirements .mmp file operation should be done under this.
+// 'abld test build'
+3dringingtoneinterface_tests.mmp
+
+PRJ_MMPFILES
+
+
+//  End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/inc/3dringingtoneinterface_tests.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,327 @@
+/*
+* 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:  3dringingtoneinterface_tests test module.
+*
+*/
+
+
+
+#ifndef _3DRINGINGTONEINTERFACE_TESTS_H
+#define _3DRINGINGTONEINTERFACE_TESTS_H
+
+// INCLUDES
+#include "StifTestModule.h"
+#include <StifLogger.h>
+ 
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// Logging path
+_LIT( K3dringingtoneinterface_testsLogPath, "\\logs\\testframework\\3dringingtoneinterface_tests\\" ); 
+// Log file
+_LIT( K3dringingtoneinterface_testsLogFile, "3dringingtoneinterface_tests.txt" ); 
+
+
+#define GETPTR &
+#define ENTRY(str,func) {_S(str), GETPTR func,0,0,0}
+#define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0}
+#define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c}
+#define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c}
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class C3dringingtoneinterface_tests;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+// A typedef for function that does the actual testing,
+// function is a type 
+// TInt C3dringingtoneinterface_tests::<NameOfFunction> ( TTestResult& aResult )
+typedef TInt (C3dringingtoneinterface_tests::* TestFunction)(TTestResult&);
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfoInternal
+    {
+    public:
+        const TText*    iCaseName;
+        TestFunction    iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    };
+
+// CLASS DECLARATION
+
+/**
+*  A structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfo
+    {
+    public:
+        TPtrC iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+
+    TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
+        {
+        };
+
+    };
+
+
+// CLASS DECLARATION
+
+/**
+*  This a 3dringingtoneinterface_tests class.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(C3dringingtoneinterface_tests) : public CTestModuleBase
+    {
+    public:  // Constructors and destructor
+
+
+        /**
+        * Two-phased constructor.
+        */
+        static C3dringingtoneinterface_tests* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~C3dringingtoneinterface_tests();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CTestModuleBase InitL is used to initialize the 
+        *       3dringingtoneinterface_tests. It is called once for every instance of 
+        *       TestModule3dringingtoneinterface_tests after its creation.
+        * @since ?Series60_version
+        * @param aIniFile Initialization file for the test module (optional)
+        * @param aFirstTime Flag is true when InitL is executed for first 
+        *               created instance of 3dringingtoneinterface_tests.
+        * @return Symbian OS error code
+        */
+        TInt InitL( TFileName& aIniFile, TBool aFirstTime );
+
+        /**
+        * From CTestModuleBase GetTestCasesL is used to inquiry test cases 
+        *   from 3dringingtoneinterface_tests. 
+        * @since ?Series60_version
+        * @param aTestCaseFile Test case file (optional)
+        * @param aTestCases  Array of TestCases returned to test framework
+        * @return Symbian OS error code
+        */
+        TInt GetTestCasesL( const TFileName& aTestCaseFile, 
+                            RPointerArray<TTestCaseInfo>& aTestCases );
+
+        /**
+        * From CTestModuleBase RunTestCaseL is used to run an individual 
+        *   test case. 
+        * @since ?Series60_version
+        * @param aCaseNumber Test case number
+        * @param aTestCaseFile Test case file (optional)
+        * @param aResult Test case result returned to test framework (PASS/FAIL)
+        * @return Symbian OS error code (test case execution error, which is 
+        *           not reported in aResult parameter as test case failure).
+        */   
+        TInt RunTestCaseL( const TInt aCaseNumber, 
+                           const TFileName& aTestCaseFile,
+                           TTestResult& aResult );
+
+        /**
+        * From CTestModuleBase; OOMTestQueryL is used to specify is particular
+        * test case going to be executed using OOM conditions
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailureType OOM failure type (optional)
+        * @param aFirstMemFailure The first heap memory allocation failure value (optional)
+        * @param aLastMemFailure The last heap memory allocation failure value (optional)
+        * @return TBool
+        */
+        virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, 
+                                     const TInt /* aCaseNumber */, 
+                                     TOOMFailureType& aFailureType, 
+                                     TInt& /* aFirstMemFailure */, 
+                                     TInt& /* aLastMemFailure */ );
+
+        /**
+        * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        */
+        virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, 
+                                    const TInt /* aCaseNumber */ ); 
+
+        /**
+        * From CTestModuleBase; OOMHandleWarningL
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailNextValue FailNextValue for OOM test execution (optional)
+        * @return None
+        *
+        * User may add implementation for OOM test warning handling. Usually no
+        * implementation is required.           
+        */
+        virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
+                                        const TInt /* aCaseNumber */, 
+                                        TInt& /* aFailNextValue */); 
+
+        /**
+        * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        *
+        */
+        virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, 
+                                       const TInt /* aCaseNumber */ );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+               
+
+    protected:  // Functions from base classes
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        C3dringingtoneinterface_tests();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Function returning test case name and pointer to test case function.
+        * @since ?Series60_version
+        * @param aCaseNumber test case number
+        * @return TCaseInfo 
+        */
+        const TCaseInfo Case ( const TInt aCaseNumber ) const;
+
+        /**
+        * Actual Hardcoded test case functions are listed below.
+        */
+        //ADD NEW METHOD DEC HERE"
+
+        /**
+        * Printing test case.
+        * @since ?Series60_version
+        * @param aResult Test case result (PASS/FAIL)
+        * @return Symbian OS error code (test case execution error 
+        *   that is not returned as test case result in aResult)
+        */
+        TInt PrintTest( TTestResult& aResult );
+
+        /**
+        * Printing loop test case.
+        * @since ?Series60_version
+        * @param aResult Test case result (PASS/FAIL)
+        * @return Symbian OS error code (test case execution error 
+        *   that is not returned as test case result in aResult)
+        */
+        TInt LoopTest( TTestResult& aResult );
+
+
+        TInt CreateAndDelete( TTestResult& aResult );
+        TInt PlayAndStop( TTestResult& aResult );
+        
+        
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        // Pointer to test (function) to be executed
+        TestFunction iMethod;
+
+        // Pointer to logger
+        CStifLogger * iLog; 
+
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // _3DRINGINGTONEINTERFACE_TESTS_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/init/3dringingtoneinterface_tests.ini	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,167 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= E:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+
+[New_Module]
+ModuleName= 3dringingtoneinterface_tests
+[End_Module]
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+HardwareBasePath= E:\LOGS\TestFramework\
+HardwareFormat= TXT			# Possible values: TXT or HTML
+HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/src/3dringingtoneinterface_tests.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,362 @@
+/*
+* 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:  3dringingtoneinterface_tests class member functions
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include "3dringingtoneinterface_tests.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// C3dringingtoneinterface_tests::C3dringingtoneinterface_tests
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+C3dringingtoneinterface_tests::C3dringingtoneinterface_tests()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// C3dringingtoneinterface_tests::ConstructL
+// Symbian 2nd phase constructor can leave.
+//
+// Note: If OOM test case uses STIF Logger, then STIF Logger must be created
+// with static buffer size parameter (aStaticBufferSize). Otherwise Logger 
+// allocates memory from heap and therefore causes error situations with OOM 
+// testing. For more information about STIF Logger construction, see STIF Users 
+// Guide.
+// -----------------------------------------------------------------------------
+//
+void C3dringingtoneinterface_tests::ConstructL()
+    {
+    iLog = CStifLogger::NewL( K3dringingtoneinterface_testsLogPath, 
+                          K3dringingtoneinterface_testsLogFile);
+
+    // Sample how to use logging
+    _LIT( KLogStart, "3dringingtoneinterface_tests logging starts!" );
+    iLog->Log( KLogStart );
+
+    }
+
+// -----------------------------------------------------------------------------
+// C3dringingtoneinterface_tests::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+C3dringingtoneinterface_tests* C3dringingtoneinterface_tests::NewL()
+    {
+    C3dringingtoneinterface_tests* self = new (ELeave) C3dringingtoneinterface_tests;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+C3dringingtoneinterface_tests::~C3dringingtoneinterface_tests()
+    {
+    delete iLog;
+    }
+
+// -----------------------------------------------------------------------------
+// C3dringingtoneinterface_tests::InitL
+// InitL is used to initialize the Test Module.
+// -----------------------------------------------------------------------------
+//
+TInt C3dringingtoneinterface_tests::InitL( 
+    TFileName& /*aIniFile*/, 
+    TBool /*aFirstTime*/ )
+    {
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// C3dringingtoneinterface_tests::GetTestCasesL
+// GetTestCases is used to inquire test cases from the Test Module. Test
+// cases are stored to array of test cases. The Test Framework will be 
+// the owner of the data in the RPointerArray after GetTestCases return
+// and it does the memory deallocation. 
+// -----------------------------------------------------------------------------
+//
+TInt C3dringingtoneinterface_tests::GetTestCasesL( 
+    const TFileName& /*aConfig*/, 
+    RPointerArray<TTestCaseInfo>& aTestCases )
+    {
+
+    // Loop through all test cases and create new
+    // TTestCaseInfo items and append items to aTestCase array    
+    for( TInt i = 0; Case(i).iMethod != NULL; i++ )
+        {
+
+        // Allocate new TTestCaseInfo from heap for a testcase definition.
+        TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo();
+
+        // PushL TTestCaseInfo to CleanupStack.    
+        CleanupStack::PushL( newCase );
+
+        // Set number for the testcase.
+        // When the testcase is run, this comes as a parameter to RunTestCaseL.
+        newCase->iCaseNumber = i;
+
+        // Set title for the test case. This is shown in UI to user.
+        newCase->iTitle.Copy( Case(i).iCaseName );
+
+        // Append TTestCaseInfo to the testcase array. After appended 
+        // successfully the TTestCaseInfo object is owned (and freed) 
+        // by the TestServer. 
+        User::LeaveIfError(aTestCases.Append ( newCase ) );
+
+        // Pop TTestCaseInfo from the CleanupStack.
+        CleanupStack::Pop( newCase );
+
+        }
+
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// C3dringingtoneinterface_tests::RunTestCaseL
+// RunTestCaseL is used to run an individual test case specified 
+// by aTestCase. Test cases that can be run may be requested from 
+// Test Module by GetTestCases method before calling RunTestCase.
+// -----------------------------------------------------------------------------
+//
+TInt C3dringingtoneinterface_tests::RunTestCaseL( 
+    const TInt aCaseNumber,   
+    const TFileName& /*aConfig*/,
+    TTestResult& aResult )
+    {
+
+    // Return value
+    TInt execStatus = KErrNone;
+
+    // Get the pointer to test case function
+    TCaseInfo tmp = Case ( aCaseNumber );
+
+    _LIT( KLogStartTC, "Starting testcase [%S]" );
+    iLog->Log( KLogStartTC, &tmp.iCaseName);
+
+    // Check that case number was valid
+    if ( tmp.iMethod != NULL )
+        {
+        // Valid case was found, call it via function pointer
+        iMethod = tmp.iMethod;        
+        execStatus  = ( this->*iMethod )( aResult );
+        }
+    else
+        {
+        // Valid case was not found, return error.
+        execStatus = KErrNotFound;
+        }
+
+    // Return case execution status (not the result of the case execution)
+    return execStatus;
+
+    }
+
+// -----------------------------------------------------------------------------
+// C3dringingtoneinterface_tests::OOMTestQueryL
+// Used to check if a particular test case should be run in OOM conditions and 
+// which memory allocations should fail.    
+// -----------------------------------------------------------------------------
+//
+TBool C3dringingtoneinterface_tests::OOMTestQueryL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt aCaseNumber, 
+                                TOOMFailureType& /* aFailureType */, 
+                                TInt& aFirstMemFailure, 
+                                TInt& aLastMemFailure ) 
+    {
+    _LIT( KLogOOMTestQueryL, "C3dringingtoneinterface_tests::OOMTestQueryL" );
+    iLog->Log( KLogOOMTestQueryL );     
+
+    aFirstMemFailure = Case( aCaseNumber ).iFirstMemoryAllocation;
+    aLastMemFailure = Case( aCaseNumber ).iLastMemoryAllocation;
+
+    return Case( aCaseNumber ).iIsOOMTest;
+
+    }
+
+// -----------------------------------------------------------------------------
+// C3dringingtoneinterface_tests::OOMTestInitializeL
+// Used to perform the test environment setup for a particular OOM test case. 
+// Test Modules may use the initialization file to read parameters for Test 
+// Module initialization but they can also have their own configure file or 
+// some other routine to initialize themselves.  
+//
+// NOTE: User may add implementation for OOM test environment initialization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void C3dringingtoneinterface_tests::OOMTestInitializeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// C3dringingtoneinterface_tests::OOMHandleWarningL
+// In some cases the heap memory allocation should be skipped, either due to
+// problems in the OS code or components used by the code being tested, or even 
+// inside the tested components which are implemented this way on purpose (by 
+// design), so it is important to give the tester a way to bypass allocation 
+// failures.
+//
+// NOTE: User may add implementation for OOM test warning handling. Usually no
+// implementation is required.
+// -----------------------------------------------------------------------------
+//
+void C3dringingtoneinterface_tests::OOMHandleWarningL( 
+                                const TFileName& /* aTestCaseFile */,
+                                const TInt /* aCaseNumber */, 
+                                TInt& /* aFailNextValue */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// C3dringingtoneinterface_tests::OOMTestFinalizeL
+// Used to perform the test environment cleanup for a particular OOM test case.
+//
+// NOTE: User may add implementation for OOM test environment finalization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void C3dringingtoneinterface_tests::OOMTestFinalizeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point
+// Returns: CTestModuleBase*: Pointer to Test Module object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CTestModuleBase* LibEntryL()
+    {
+    return C3dringingtoneinterface_tests::NewL();
+
+    }
+
+// -----------------------------------------------------------------------------
+// SetRequirements handles test module parameters(implements evolution
+// version 1 for test module's heap and stack sizes configuring).
+// Returns: TInt: Symbian error code.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, 
+                                TUint32& /*aParameterValid*/ )
+    {
+
+    /* --------------------------------- NOTE ---------------------------------
+    USER PANICS occurs in test thread creation when:
+    1) "The panic occurs when the value of the stack size is negative."
+    2) "The panic occurs if the minimum heap size specified is less
+       than KMinHeapSize".
+       KMinHeapSize: "Functions that require a new heap to be allocated will
+       either panic, or will reset the required heap size to this value if
+       a smaller heap size is specified".
+    3) "The panic occurs if the minimum heap size specified is greater than
+       the maximum size to which the heap can grow".
+    Other:
+    1) Make sure that your hardware or Symbian OS is supporting given sizes.
+       e.g. Hardware might support only sizes that are divisible by four.
+    ------------------------------- NOTE end ------------------------------- */
+
+    // Normally STIF uses default heap and stack sizes for test thread, see:
+    // KTestThreadMinHeap, KTestThreadMinHeap and KStackSize.
+    // If needed heap and stack sizes can be configured here by user. Remove
+    // comments and define sizes.
+
+/*
+    aParameterValid = KStifTestModuleParameterChanged;
+
+    CTestModuleParamVer01* param = CTestModuleParamVer01::NewL();
+    // Stack size
+    param->iTestThreadStackSize= 16384; // 16K stack
+    // Heap sizes
+    param->iTestThreadMinHeap = 4096;   // 4K heap min
+    param->iTestThreadMaxHeap = 1048576;// 1M heap max
+
+    aTestModuleParam = param;
+*/
+    return KErrNone;
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/tsrc/public/basic/3dringingtoneinterface_tests/src/3dringingtoneinterface_testsCases.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,312 @@
+/*
+* 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 C3dringingtoneinterface_tests class.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <e32math.h>
+#include "3dringingtoneinterface_tests.h"
+
+
+#include <c3dringingtoneinterface.h>
+ 
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// C3dringingtoneinterface_tests::Case
+// Returns a test case by number.
+//
+// This function contains an array of all available test cases 
+// i.e pair of case name and test function. If case specified by parameter
+// aCaseNumber is found from array, then that item is returned.
+// 
+// The reason for this rather complicated function is to specify all the
+// test cases only in one place. It is not necessary to understand how
+// function pointers to class member functions works when adding new test
+// cases. See function body for instructions how to add new test case.
+// -----------------------------------------------------------------------------
+//
+const TCaseInfo C3dringingtoneinterface_tests::Case ( 
+    const TInt aCaseNumber ) const 
+     {
+
+    /**
+    * To add new test cases, implement new test case function and add new 
+    * line to KCases array specify the name of the case and the function 
+    * doing the test case
+    * In practice, do following
+    * 1) Make copy of existing test case function and change its name
+    *    and functionality. Note that the function must be added to 
+    *    3dringingtoneinterface_tests.cpp file and to 3dringingtoneinterface_tests.h 
+    *    header file.
+    *
+    * 2) Add entry to following KCases array either by using:
+    *
+    * 2.1: FUNCENTRY or ENTRY macro
+    * ENTRY macro takes two parameters: test case name and test case 
+    * function name.
+    *
+    * FUNCENTRY macro takes only test case function name as a parameter and
+    * uses that as a test case name and test case function name.
+    *
+    * Or
+    *
+    * 2.2: OOM_FUNCENTRY or OOM_ENTRY macro. Note that these macros are used
+    * only with OOM (Out-Of-Memory) testing!
+    *
+    * OOM_ENTRY macro takes five parameters: test case name, test case 
+    * function name, TBool which specifies is method supposed to be run using
+    * OOM conditions, TInt value for first heap memory allocation failure and 
+    * TInt value for last heap memory allocation failure.
+    * 
+    * OOM_FUNCENTRY macro takes test case function name as a parameter and uses
+    * that as a test case name, TBool which specifies is method supposed to be
+    * run using OOM conditions, TInt value for first heap memory allocation 
+    * failure and TInt value for last heap memory allocation failure. 
+    */ 
+
+    static TCaseInfoInternal const KCases[] =
+        {
+        // To add new test cases, add new items to this array
+        
+        // NOTE: When compiled to GCCE, there must be Classname::
+        // declaration in front of the method name, e.g. 
+        // C3dringingtoneinterface_tests::PrintTest. Otherwise the compiler
+        // gives errors.
+        
+        ENTRY( "3DRinging CreateAndDelete", C3dringingtoneinterface_tests::CreateAndDelete ),
+        ENTRY( "3DRinging PlayAndStop", C3dringingtoneinterface_tests::PlayAndStop ),
+        // Example how to use OOM functionality
+        //OOM_ENTRY( "Loop test with OOM", C3dringingtoneinterface_tests::LoopTest, ETrue, 2, 3),
+        //OOM_FUNCENTRY( C3dringingtoneinterface_tests::PrintTest, ETrue, 1, 3 ),
+        };
+
+    // Verify that case number is valid
+    if( (TUint) aCaseNumber >= sizeof( KCases ) / 
+                               sizeof( TCaseInfoInternal ) )
+        {
+        // Invalid case, construct empty object
+        TCaseInfo null( (const TText*) L"" );
+        null.iMethod = NULL;
+        null.iIsOOMTest = EFalse;
+        null.iFirstMemoryAllocation = 0;
+        null.iLastMemoryAllocation = 0;
+        return null;
+        } 
+
+    // Construct TCaseInfo object and return it
+    TCaseInfo tmp ( KCases[ aCaseNumber ].iCaseName );
+    tmp.iMethod = KCases[ aCaseNumber ].iMethod;
+    tmp.iIsOOMTest = KCases[ aCaseNumber ].iIsOOMTest;
+    tmp.iFirstMemoryAllocation = KCases[ aCaseNumber ].iFirstMemoryAllocation;
+    tmp.iLastMemoryAllocation = KCases[ aCaseNumber ].iLastMemoryAllocation;
+    return tmp;
+
+    }
+
+// -----------------------------------------------------------------------------
+// C3dringingtoneinterface_tests::PrintTest
+// Simple printing to UI test.
+// -----------------------------------------------------------------------------
+//
+TInt C3dringingtoneinterface_tests::PrintTest( 
+    TTestResult& aResult )
+    {
+     /* Simple print test */
+    _LIT( KPrintTest, "PrintTest" );
+    _LIT( KEnter, "Enter" );
+    _LIT( KOnGoing, "On-going" );
+    _LIT( KExit, "Exit" );
+
+    TestModuleIf().Printf( 0, KPrintTest, KEnter );
+           
+    TestModuleIf().Printf( 1, KPrintTest, KOnGoing );
+    
+    TestModuleIf().Printf( 0, KPrintTest, KExit );
+
+    // Test case passed
+
+    // Sets test case result and description(Maximum size is KStifMaxResultDes)
+    _LIT( KDescription, "PrintTest passed" );
+    aResult.SetResult( KErrNone, KDescription );
+
+    // Case was executed
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// C3dringingtoneinterface_tests::LoopTest
+// Another printing to UI test.
+// -----------------------------------------------------------------------------
+//
+TInt C3dringingtoneinterface_tests::LoopTest( TTestResult& aResult )
+    {
+
+    /* Simple print and wait loop */
+    _LIT( KState, "State" );
+    _LIT( KLooping, "Looping" );
+
+    TestModuleIf().Printf( 0, KState, KLooping );
+
+    _LIT( KRunning, "Running" );
+    _LIT( KLoop, "%d" );
+    for( TInt i=0; i<10; i++)
+        {
+        TestModuleIf().Printf( 1, KRunning, KLoop, i);
+        User::After( 1000000 );
+        }
+
+    _LIT( KFinished, "Finished" );
+    TestModuleIf().Printf( 0, KState, KFinished );
+
+    // Test case passed
+
+    // Sets test case result and description(Maximum size is KStifMaxResultDes)
+    _LIT( KDescription, "LoopTest passed" );
+    aResult.SetResult( KErrNone, KDescription );
+
+    // Case was executed
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// C3dringingtoneinterface_tests::CreateAndDelete
+// Another printing to UI test.
+// -----------------------------------------------------------------------------
+//
+TInt C3dringingtoneinterface_tests::CreateAndDelete( TTestResult& aResult )
+    {
+    __UHEAP_MARK;
+    
+    CActiveScheduler* scheduler = new( ELeave )CActiveScheduler();
+    CActiveScheduler::Install( scheduler );
+    CleanupStack::PushL( scheduler );
+    
+    C3DRingingToneInterface* plugin=NULL;
+        
+    TRAPD( err,plugin = C3DRingingToneInterface::NewL( KNullUid ) );
+        
+    delete plugin;
+    
+    CleanupStack::PopAndDestroy( scheduler );
+
+ 
+    REComSession::FinalClose();
+    __UHEAP_MARKEND;
+    
+    // Sets test case result and description(Maximum size is KStifMaxResultDes)
+    _LIT( KDescription, "CreateAndDelete passed" );
+    aResult.SetResult( KErrNone, KDescription );
+
+    // Case was executed
+    return KErrNone;
+
+    }
+    
+
+// -----------------------------------------------------------------------------
+// C3dringingtoneinterface_tests::PlayAndStop
+// Another printing to UI test.
+// -----------------------------------------------------------------------------
+//
+TInt C3dringingtoneinterface_tests::PlayAndStop( TTestResult& aResult )
+    {
+    __UHEAP_MARK;
+    
+    CActiveScheduler* scheduler = new( ELeave )CActiveScheduler();
+    CActiveScheduler::Install( scheduler );
+    CleanupStack::PushL( scheduler );
+ 
+    C3DRingingToneInterface* plugin=NULL;
+    
+        
+    TRAPD( err,plugin = C3DRingingToneInterface::NewL( KNullUid ) );
+    
+    if ( !err && plugin )
+        {
+        plugin->PlayL();
+        plugin->Stop();
+        }
+  
+    delete plugin;
+    
+    CleanupStack::PopAndDestroy( scheduler );
+
+    REComSession::FinalClose();
+    __UHEAP_MARKEND;
+    
+    // Sets test case result and description(Maximum size is KStifMaxResultDes)
+    _LIT( KDescription, "PlayAndStop passed" );
+    aResult.SetResult( KErrNone, KDescription );
+
+    // Case was executed
+    return KErrNone;
+
+    }    
+  
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui/tsrc/public/basic/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build file for 3dringingtoneinterface_tests.
+*
+*/
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+// Example: 
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+// NOTE: If using ARS requirements .mmp file operation should be done under this.
+// 'abld test build'
+
+PRJ_MMPFILES
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+../3dringingtoneinterface_tests/group/3dringingtoneinterface_tests.mmp
+
+//  End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/bwins/phoneuicontrolu.def	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,235 @@
+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)
+	?Instance@CPhoneStateHandle@@SAPAV1@XZ @ 22 NONAME ; class CPhoneStateHandle * CPhoneStateHandle::Instance(void)
+	?HandleNumberEntryClearedL@CPhoneStateIdle@@MAEXXZ @ 23 NONAME ; void CPhoneStateIdle::HandleNumberEntryClearedL(void)
+	?DynInitMenuPaneL@CPhoneStateIncoming@@MAEXHPAVCEikMenuPane@@@Z @ 24 NONAME ; void CPhoneStateIncoming::DynInitMenuPaneL(int, class CEikMenuPane *)
+	?HandleCommandL@CPhoneState@@UAEHH@Z @ 25 NONAME ; int CPhoneState::HandleCommandL(int)
+	?StartAlsLineChangeTimerL@CPhoneState@@IAEXXZ @ 26 NONAME ; void CPhoneState::StartAlsLineChangeTimerL(void)
+	?IsNumberEntryVisibleL@CPhoneState@@QAEHXZ @ 27 NONAME ; int CPhoneState::IsNumberEntryVisibleL(void)
+	?RetainPreviousKeylockStateL@CPhoneState@@QAEXXZ @ 28 NONAME ; void CPhoneState::RetainPreviousKeylockStateL(void)
+	?HandlePhoneEngineMessageL@CPhoneStateIdle@@UAEXHH@Z @ 29 NONAME ; void CPhoneStateIdle::HandlePhoneEngineMessageL(int, int)
+	?HandleDialingL@CPhoneStateIdle@@MAEXH@Z @ 30 NONAME ; void CPhoneStateIdle::HandleDialingL(int)
+	?CustomizedDialerCbaResourceIdL@CPhoneState@@IAEHXZ @ 31 NONAME ; int CPhoneState::CustomizedDialerCbaResourceIdL(void)
+	?CaptureKeysDuringCallNotificationL@CPhoneState@@IAEXH@Z @ 32 NONAME ; void CPhoneState::CaptureKeysDuringCallNotificationL(int)
+	?HandleKeyPressDurationL@CPhoneState@@UAEXW4TKeyCode@@VTTimeIntervalMicroSeconds@@@Z @ 33 NONAME ; void CPhoneState::HandleKeyPressDurationL(enum TKeyCode, class TTimeIntervalMicroSeconds)
+	?ChangeState@CPhoneStateMachine@@UAEXH@Z @ 34 NONAME ; void CPhoneStateMachine::ChangeState(int)
+	?IsSimStateNotPresentWithSecurityModeEnabled@CPhoneState@@IAEHXZ @ 35 NONAME ; int CPhoneState::IsSimStateNotPresentWithSecurityModeEnabled(void)
+	?HandlePhoneEngineMessageL@CPhoneState@@UAEXHH@Z @ 36 NONAME ; void CPhoneState::HandlePhoneEngineMessageL(int, int)
+	?HandleNumberEntryClearedL@CPhoneStateIncoming@@UAEXXZ @ 37 NONAME ; void CPhoneStateIncoming::HandleNumberEntryClearedL(void)
+	?HandleKeyEventL@CPhoneUIController@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 38 NONAME ; enum TKeyResponse CPhoneUIController::HandleKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?HandleRemConCommandL@CPhoneStateIdle@@MAEHW4TRemConCoreApiOperationId@@W4TRemConCoreApiButtonAction@@@Z @ 39 NONAME ; int CPhoneStateIdle::HandleRemConCommandL(enum TRemConCoreApiOperationId, enum TRemConCoreApiButtonAction)
+	?HandleAudioPlayStoppedL@CPhoneStateIncoming@@MAEXXZ @ 40 NONAME ; void CPhoneStateIncoming::HandleAudioPlayStoppedL(void)
+	?HandleCenRepChangeL@CPhoneState@@UAEXABVTUid@@I@Z @ 41 NONAME ; void CPhoneState::HandleCenRepChangeL(class TUid const &, unsigned int)
+	?HandleLongHashL@CPhoneState@@UAEXXZ @ 42 NONAME ; void CPhoneState::HandleLongHashL(void)
+	?DialL@CPhoneStateIdle@@MAEXABVTDesC16@@W4TPhoneNumberType@@W4TDialInitiationMethod@1@@Z @ 43 NONAME ; void CPhoneStateIdle::DialL(class TDesC16 const &, enum TPhoneNumberType, enum CPhoneStateIdle::TDialInitiationMethod)
+	?ShowNumberBusyNoteL@CPhoneState@@IAEXXZ @ 44 NONAME ; void CPhoneState::ShowNumberBusyNoteL(void)
+	?DisconnectCallL@CPhoneState@@IAEHXZ @ 45 NONAME ; int CPhoneState::DisconnectCallL(void)
+	?HandleNumberEntryClearedL@CPhoneStateCallSetup@@MAEXXZ @ 46 NONAME ; void CPhoneStateCallSetup::HandleNumberEntryClearedL(void)
+	?HandleIdleForegroundEventL@CPhoneStateIdle@@UAEXXZ @ 47 NONAME ; void CPhoneStateIdle::HandleIdleForegroundEventL(void)
+	?HandleDisconnectingL@CPhoneState@@IAEXH@Z @ 48 NONAME ; void CPhoneState::HandleDisconnectingL(int)
+	?HandleAudioMuteChangedL@CPhoneState@@IAEXXZ @ 49 NONAME ; void CPhoneState::HandleAudioMuteChangedL(void)
+	?HandleKeyLockEnabled@CPhoneState@@UAEXH@Z @ 50 NONAME ; void CPhoneState::HandleKeyLockEnabled(int)
+	?HandleCommandL@CPhoneStateIncoming@@UAEHH@Z @ 51 NONAME ; int CPhoneStateIncoming::HandleCommandL(int)
+	?UpdateSingleActiveCallL@CPhoneState@@IAEXH@Z @ 52 NONAME ; void CPhoneState::UpdateSingleActiveCallL(int)
+	?IsOnScreenDialerSupported@CPhoneState@@IBEHXZ @ 53 NONAME ; int CPhoneState::IsOnScreenDialerSupported(void) const
+	?SimState@CPhoneState@@IBE?AW4TPESimState@@XZ @ 54 NONAME ; enum TPESimState CPhoneState::SimState(void) const
+	?HandleKeyEventL@CPhoneStateCallSetup@@UAEXABUTKeyEvent@@W4TEventCode@@@Z @ 55 NONAME ; void CPhoneStateCallSetup::HandleKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?SetupIdleScreenInBackgroundL@CPhoneState@@IAEXXZ @ 56 NONAME ; void CPhoneState::SetupIdleScreenInBackgroundL(void)
+	?SendGlobalWarningNoteL@CPhoneState@@IAEXH@Z @ 57 NONAME ; void CPhoneState::SendGlobalWarningNoteL(int)
+	?CompleteSatRequestL@CPhoneState@@IAEXH@Z @ 58 NONAME ; void CPhoneState::CompleteSatRequestL(int)
+	?NewL@CPhoneStateStartup@@SAPAV1@PAVMPhoneStateMachine@@PAVMPhoneViewCommandHandle@@PAVMPhoneCustomization@@@Z @ 59 NONAME ; class CPhoneStateStartup * CPhoneStateStartup::NewL(class MPhoneStateMachine *, class MPhoneViewCommandHandle *, class MPhoneCustomization *)
+	?LaunchNewCallQueryL@CPhoneStateInCall@@IAEXXZ @ 60 NONAME ; void CPhoneStateInCall::LaunchNewCallQueryL(void)
+	?NeedToSendToBackgroundL@CPhoneState@@IBEHXZ @ 61 NONAME ; int CPhoneState::NeedToSendToBackgroundL(void) const
+	?SetCallHeaderTextsForCallComingInL@CPhoneState@@IAEXHHPAVTPhoneCmdParamCallHeaderData@@@Z @ 62 NONAME ; void CPhoneState::SetCallHeaderTextsForCallComingInL(int, int, class TPhoneCmdParamCallHeaderData *)
+	?IsSimOk@CPhoneState@@QAEHXZ @ 63 NONAME ; int CPhoneState::IsSimOk(void)
+	?ClearNumberEntryContentCache@CPhoneState@@IAEXXZ @ 64 NONAME ; void CPhoneState::ClearNumberEntryContentCache(void)
+	?HandleCommandL@CPhoneStateIdle@@UAEHH@Z @ 65 NONAME ; int CPhoneStateIdle::HandleCommandL(int)
+	?ViewCommandHandle@CPhoneStateHandle@@QAEPAVMPhoneViewCommandHandle@@XZ @ 66 NONAME ; class MPhoneViewCommandHandle * CPhoneStateHandle::ViewCommandHandle(void)
+	?DialMultimediaCallL@CPhoneStateIdle@@IAEXXZ @ 67 NONAME ; void CPhoneStateIdle::DialMultimediaCallL(void)
+	?DisconnectOutgoingCallL@CPhoneStateInCall@@IAEXXZ @ 68 NONAME ; void CPhoneStateInCall::DisconnectOutgoingCallL(void)
+	?IsKeyLockOn@CPhoneState@@MBEHXZ @ 69 NONAME ; int CPhoneState::IsKeyLockOn(void) const
+	??1CPhoneStateInCall@@UAE@XZ @ 70 NONAME ; CPhoneStateInCall::~CPhoneStateInCall(void)
+	?CustomizedDialerMenuResourceIdL@CPhoneState@@IAEHXZ @ 71 NONAME ; int CPhoneState::CustomizedDialerMenuResourceIdL(void)
+	?ShowReconnectQueryL@CPhoneReconnectQuery@@QAEXH@Z @ 72 NONAME ; void CPhoneReconnectQuery::ShowReconnectQueryL(int)
+	?UpdateSilenceButtonDimming@CPhoneState@@IAEXXZ @ 73 NONAME ; void CPhoneState::UpdateSilenceButtonDimming(void)
+	?SetNumberEntryVisibilityL@CPhoneState@@IAEXH@Z @ 74 NONAME ; void CPhoneState::SetNumberEntryVisibilityL(int)
+	?HandleError@CPhoneUIController@@UAEXABUTPEErrorInfo@@@Z @ 75 NONAME ; void CPhoneUIController::HandleError(struct TPEErrorInfo const &)
+	?ConstructL@CPhoneStateInCall@@MAEXXZ @ 76 NONAME ; void CPhoneStateInCall::ConstructL(void)
+	?OnlyHashInNumberEntryL@CPhoneStateIdle@@MAEXXZ @ 77 NONAME ; void CPhoneStateIdle::OnlyHashInNumberEntryL(void)
+	?IsVideoCallRingingL@CPhoneStateInCall@@MAEHXZ @ 78 NONAME ; int CPhoneStateInCall::IsVideoCallRingingL(void)
+	?HandlePhoneForegroundEventL@CPhoneStateIdle@@UAEXXZ @ 79 NONAME ; void CPhoneStateIdle::HandlePhoneForegroundEventL(void)
+	?HandleHoldSwitchL@CPhoneState@@QAEXXZ @ 80 NONAME ; void CPhoneState::HandleHoldSwitchL(void)
+	?CloseDtmfQueryL@CPhoneStateInCall@@IAEXXZ @ 81 NONAME ; void CPhoneStateInCall::CloseDtmfQueryL(void)
+	?DynInitMenuBarL@CPhoneState@@UAEXHPAVCEikMenuBar@@@Z @ 82 NONAME ; void CPhoneState::DynInitMenuBarL(int, class CEikMenuBar *)
+	?HandleDtmfKeyToneL@CPhoneStateStartup@@EAEXABUTKeyEvent@@W4TEventCode@@@Z @ 83 NONAME ; void CPhoneStateStartup::HandleDtmfKeyToneL(struct TKeyEvent const &, enum TEventCode)
+	?HandleNumberEntryEdited@CPhoneState@@MAEXXZ @ 84 NONAME ; void CPhoneState::HandleNumberEntryEdited(void)
+	?ShowTextQueryL@CPhoneState@@IAEXHHHPAVTDes16@@H@Z @ 85 NONAME ; void CPhoneState::ShowTextQueryL(int, int, int, class TDes16 *, int)
+	?DialMultimediaCallL@CPhoneState@@IAEXXZ @ 86 NONAME ; void CPhoneState::DialMultimediaCallL(void)
+	?NewL@CPhoneUIController@@SAPAV1@PAVMPhoneViewCommandHandle@@@Z @ 87 NONAME ; class CPhoneUIController * CPhoneUIController::NewL(class MPhoneViewCommandHandle *)
+	?HandleCreateNumberEntryL@CPhoneStateStartup@@EAEXABUTKeyEvent@@W4TEventCode@@@Z @ 88 NONAME ; void CPhoneStateStartup::HandleCreateNumberEntryL(struct TKeyEvent const &, enum TEventCode)
+	?CheckDisableHWKeysAndCallUIL@CPhoneState@@QAEXXZ @ 89 NONAME ; void CPhoneState::CheckDisableHWKeysAndCallUIL(void)
+	?IsMenuBarVisibleL@CPhoneState@@UBEHXZ @ 90 NONAME ; int CPhoneState::IsMenuBarVisibleL(void) const
+	?HandleErrorL@CPhoneState@@UAEXABUTPEErrorInfo@@@Z @ 91 NONAME ; void CPhoneState::HandleErrorL(struct TPEErrorInfo const &)
+	?HandleCommandL@CPhoneStateCallSetup@@UAEHH@Z @ 92 NONAME ; int CPhoneStateCallSetup::HandleCommandL(int)
+	?HandleAudioOutputChangedL@CPhoneState@@IAEXXZ @ 93 NONAME ; void CPhoneState::HandleAudioOutputChangedL(void)
+	??1CPhoneUIController@@UAE@XZ @ 94 NONAME ; CPhoneUIController::~CPhoneUIController(void)
+	?HandleKeyEventL@CPhoneState@@UAEXABUTKeyEvent@@W4TEventCode@@@Z @ 95 NONAME ; void CPhoneState::HandleKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?UpdateIncomingContextMenuL@CPhoneState@@MAEXH@Z @ 96 NONAME ; void CPhoneState::UpdateIncomingContextMenuL(int)
+	?OpenMenuBarL@CPhoneStateInCall@@MAEXXZ @ 97 NONAME ; void CPhoneStateInCall::OpenMenuBarL(void)
+	?UpdateIncomingCbaL@CPhoneCbaManager@@QAEXH@Z @ 98 NONAME ; void CPhoneCbaManager::UpdateIncomingCbaL(int)
+	?SetTouchPaneButtonDisabled@CPhoneState@@IAEXH@Z @ 99 NONAME ; void CPhoneState::SetTouchPaneButtonDisabled(int)
+	?ConstructL@CPhoneStateIncoming@@MAEXXZ @ 100 NONAME ; void CPhoneStateIncoming::ConstructL(void)
+	?CreatePhoneEngineL@CPhoneStateMachine@@UAEPAVMPEPhoneModel@@AAVMEngineMonitor@@@Z @ 101 NONAME ; class MPEPhoneModel * CPhoneStateMachine::CreatePhoneEngineL(class MEngineMonitor &)
+	?SetTouchPaneButtons@CPhoneState@@IAEXH@Z @ 102 NONAME ; void CPhoneState::SetTouchPaneButtons(int)
+	?HandleIdleForegroundEventL@CPhoneStateStartup@@UAEXXZ @ 103 NONAME ; void CPhoneStateStartup::HandleIdleForegroundEventL(void)
+	?CallFromNumberEntryL@CPhoneState@@IAEXXZ @ 104 NONAME ; void CPhoneState::CallFromNumberEntryL(void)
+	?UpdateCbaL@CPhoneCbaManager@@QAEXH@Z @ 105 NONAME ; void CPhoneCbaManager::UpdateCbaL(int)
+	?IsVideoCall@CPhoneState@@IAEHH@Z @ 106 NONAME ; int CPhoneState::IsVideoCall(int)
+	?IsSwivelClosed@CPhoneState@@QBEHXZ @ 107 NONAME ; int CPhoneState::IsSwivelClosed(void) const
+	?CloseCustomizedDialerL@CPhoneState@@QAEXXZ @ 108 NONAME ; void CPhoneState::CloseCustomizedDialerL(void)
+	?HandlePhoneForegroundEventL@CPhoneUIController@@UAEXXZ @ 109 NONAME ; void CPhoneUIController::HandlePhoneForegroundEventL(void)
+	?CheckIfRestoreNEContentAfterDtmfDialer@CPhoneState@@IAEXXZ @ 110 NONAME ; void CPhoneState::CheckIfRestoreNEContentAfterDtmfDialer(void)
+	?UpdateInCallContextMenuL@CPhoneState@@UAEXXZ @ 111 NONAME ; void CPhoneState::UpdateInCallContextMenuL(void)
+	?HandleNumericKeyEventL@CPhoneState@@MAEXABUTKeyEvent@@W4TEventCode@@@Z @ 112 NONAME ; void CPhoneState::HandleNumericKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?SendGlobalErrorNoteL@CPhoneState@@QAEXH@Z @ 113 NONAME ; void CPhoneState::SendGlobalErrorNoteL(int)
+	?IsAutoLockOn@CPhoneState@@UBEHXZ @ 114 NONAME ; int CPhoneState::IsAutoLockOn(void) const
+	?UpdateCbaL@CPhoneStateCallSetup@@MAEXH@Z @ 115 NONAME ; void CPhoneStateCallSetup::UpdateCbaL(int)
+	?RestoreNumberEntryContentL@CPhoneState@@IAEXXZ @ 116 NONAME ; void CPhoneState::RestoreNumberEntryContentL(void)
+	?HandleKeyEventL@CPhoneStateIdle@@UAEXABUTKeyEvent@@W4TEventCode@@@Z @ 117 NONAME ; void CPhoneStateIdle::HandleKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?IsNumberEntryContentStored@CPhoneState@@IAEHXZ @ 118 NONAME ; int CPhoneState::IsNumberEntryContentStored(void)
+	?IsVideoCallActiveL@CPhoneStateInCall@@MAEHXZ @ 119 NONAME ; int CPhoneStateInCall::IsVideoCallActiveL(void)
+	?HandlePhoneStartupL@CPhoneStateStartup@@UAEXXZ @ 120 NONAME ; void CPhoneStateStartup::HandlePhoneStartupL(void)
+	?DialVoiceCallL@CPhoneState@@IAEXXZ @ 121 NONAME ; void CPhoneState::DialVoiceCallL(void)
+	?EndUiUpdate@CPhoneState@@IAEXXZ @ 122 NONAME ; void CPhoneState::EndUiUpdate(void)
+	?HandleKeyPressDurationL@CPhoneStateIncoming@@UAEXW4TKeyCode@@VTTimeIntervalMicroSeconds@@@Z @ 123 NONAME ; void CPhoneStateIncoming::HandleKeyPressDurationL(enum TKeyCode, class TTimeIntervalMicroSeconds)
+	?UpdateInCallCbaL@CPhoneStateInCall@@MAEXXZ @ 124 NONAME ; void CPhoneStateInCall::UpdateInCallCbaL(void)
+	?EndTransEffect@CPhoneState@@QAEXXZ @ 125 NONAME ; void CPhoneState::EndTransEffect(void)
+	?HandleEnvironmentChangeL@CPhoneState@@UAEXH@Z @ 126 NONAME ; void CPhoneState::HandleEnvironmentChangeL(int)
+	?HandleKeyMessageL@CPhoneStateInCall@@UAEXW4TPhoneKeyEventMessages@MPhoneKeyEvents@@W4TKeyCode@@@Z @ 127 NONAME ; void CPhoneStateInCall::HandleKeyMessageL(enum MPhoneKeyEvents::TPhoneKeyEventMessages, enum TKeyCode)
+	?SetRingingTonePlaybackL@CPhoneState@@IAEXH@Z @ 128 NONAME ; void CPhoneState::SetRingingTonePlaybackL(int)
+	?ProcessCommandL@CPhoneState@@UAEHH@Z @ 129 NONAME ; int CPhoneState::ProcessCommandL(int)
+	?BeginUiUpdateLC@CPhoneState@@IAEXXZ @ 130 NONAME ; void CPhoneState::BeginUiUpdateLC(void)
+	?DecreaseAudioVolumeL@CPhoneState@@IAEXXZ @ 131 NONAME ; void CPhoneState::DecreaseAudioVolumeL(void)
+	?PhoneEngineInfo@CPhoneStateMachine@@UAEPAVMPEEngineInfo@@XZ @ 132 NONAME ; class MPEEngineInfo * CPhoneStateMachine::PhoneEngineInfo(void)
+	?CreateNumberEntryL@CPhoneStateInCall@@IAEXXZ @ 133 NONAME ; void CPhoneStateInCall::CreateNumberEntryL(void)
+	?HandleSystemEventL@CPhoneUIController@@UAEXABVTWsEvent@@@Z @ 134 NONAME ; void CPhoneUIController::HandleSystemEventL(class TWsEvent const &)
+	?DynInitMenuPaneL@CPhoneUIController@@UAEXHPAVCEikMenuPane@@@Z @ 135 NONAME ; void CPhoneUIController::DynInitMenuPaneL(int, class CEikMenuPane *)
+	??0CPhoneStateStartup@@IAE@PAVMPhoneStateMachine@@PAVMPhoneViewCommandHandle@@PAVMPhoneCustomization@@@Z @ 136 NONAME ; CPhoneStateStartup::CPhoneStateStartup(class MPhoneStateMachine *, class MPhoneViewCommandHandle *, class MPhoneCustomization *)
+	?GetRemoteInfoDataL@CPhoneState@@IAEXHAAVTDes16@@@Z @ 137 NONAME ; void CPhoneState::GetRemoteInfoDataL(int, class TDes16 &)
+	?SetDivertIndication@CPhoneState@@UAEXH@Z @ 138 NONAME ; void CPhoneState::SetDivertIndication(int)
+	?UpdateCbaL@CPhoneStateInCall@@MAEXH@Z @ 139 NONAME ; void CPhoneStateInCall::UpdateCbaL(int)
+	?SetCallId@CPhoneStateMachine@@UAEXH@Z @ 140 NONAME ; void CPhoneStateMachine::SetCallId(int)
+	?ProcessCommandL@CPhoneUIController@@UAEHH@Z @ 141 NONAME ; int CPhoneUIController::ProcessCommandL(int)
+	?DisplayHeaderForCallComingInL@CPhoneState@@IAEXHH@Z @ 142 NONAME ; void CPhoneState::DisplayHeaderForCallComingInL(int, int)
+	??0CPhoneStateIdle@@IAE@PAVMPhoneStateMachine@@PAVMPhoneViewCommandHandle@@PAVMPhoneCustomization@@@Z @ 143 NONAME ; CPhoneStateIdle::CPhoneStateIdle(class MPhoneStateMachine *, class MPhoneViewCommandHandle *, class MPhoneCustomization *)
+	?SendPhoneEngineMessage@CPhoneStateMachine@@UAEXH@Z @ 144 NONAME ; void CPhoneStateMachine::SendPhoneEngineMessage(int)
+	??0CPhoneStateCallSetup@@IAE@PAVMPhoneStateMachine@@PAVMPhoneViewCommandHandle@@PAVMPhoneCustomization@@@Z @ 145 NONAME ; CPhoneStateCallSetup::CPhoneStateCallSetup(class MPhoneStateMachine *, class MPhoneViewCommandHandle *, class MPhoneCustomization *)
+	??0CPhoneState@@QAE@PAVMPhoneStateMachine@@PAVMPhoneViewCommandHandle@@PAVMPhoneCustomization@@@Z @ 146 NONAME ; CPhoneState::CPhoneState(class MPhoneStateMachine *, class MPhoneViewCommandHandle *, class MPhoneCustomization *)
+	?HandleDtmfKeyToneL@CPhoneState@@UAEXABUTKeyEvent@@W4TEventCode@@@Z @ 147 NONAME ; void CPhoneState::HandleDtmfKeyToneL(struct TKeyEvent const &, enum TEventCode)
+	?HandleKeyMessageL@CPhoneStateIdle@@UAEXW4TPhoneKeyEventMessages@MPhoneKeyEvents@@W4TKeyCode@@@Z @ 148 NONAME ; void CPhoneStateIdle::HandleKeyMessageL(enum MPhoneKeyEvents::TPhoneKeyEventMessages, enum TKeyCode)
+	?HandleForegroundEventL@CPhoneUIController@@UAEXH@Z @ 149 NONAME ; void CPhoneUIController::HandleForegroundEventL(int)
+	?HandleSendCommandL@CPhoneStateIdle@@MAEXXZ @ 150 NONAME ; void CPhoneStateIdle::HandleSendCommandL(void)
+	?HandleCommandL@CPhoneUIController@@UAEHH@Z @ 151 NONAME ; int CPhoneUIController::HandleCommandL(int)
+	?HandleCreateNumberEntryL@CPhoneState@@UAEXABUTKeyEvent@@W4TEventCode@@@Z @ 152 NONAME ; void CPhoneState::HandleCreateNumberEntryL(struct TKeyEvent const &, enum TEventCode)
+	?DisableHWKeysL@CPhoneState@@QAEXXZ @ 153 NONAME ; void CPhoneState::DisableHWKeysL(void)
+	?DisplayHeaderForOutgoingCallL@CPhoneState@@IAEXH@Z @ 154 NONAME ; void CPhoneState::DisplayHeaderForOutgoingCallL(int)
+	?GetBlockedKeyList@CPhoneState@@UBEABV?$RArray@H@@XZ @ 155 NONAME ; class RArray<int> const & CPhoneState::GetBlockedKeyList(void) const
+	?HandlePhoneEngineMessageL@CPhoneStateInCall@@UAEXHH@Z @ 156 NONAME ; void CPhoneStateInCall::HandlePhoneEngineMessageL(int, int)
+	?IsSpeedDialNumber@CPhoneStateIdle@@IBEHABVTDesC16@@@Z @ 157 NONAME ; int CPhoneStateIdle::IsSpeedDialNumber(class TDesC16 const &) const
+	?IsNumberEntryUsedL@CPhoneState@@UAEHXZ @ 158 NONAME ; int CPhoneState::IsNumberEntryUsedL(void)
+	?PhoneStorage@CPhoneStateMachine@@UAEPAVMPhoneStorage@@XZ @ 159 NONAME ; class MPhoneStorage * CPhoneStateMachine::PhoneStorage(void)
+	??1CPhoneState@@UAE@XZ @ 160 NONAME ; CPhoneState::~CPhoneState(void)
+	?HandleCreateNumberEntryL@CPhoneStateCallSetup@@MAEXABUTKeyEvent@@W4TEventCode@@@Z @ 161 NONAME ; void CPhoneStateCallSetup::HandleCreateNumberEntryL(struct TKeyEvent const &, enum TEventCode)
+	?HandlePhoneEngineMessageL@CPhoneStateCallSetup@@UAEXHH@Z @ 162 NONAME ; void CPhoneStateCallSetup::HandlePhoneEngineMessageL(int, int)
+	?HandlePhoneFocusLostEventL@CPhoneState@@UAEXXZ @ 163 NONAME ; void CPhoneState::HandlePhoneFocusLostEventL(void)
+	??1CPhoneStateMachine@@UAE@XZ @ 164 NONAME ; CPhoneStateMachine::~CPhoneStateMachine(void)
+	?HandleIdleForegroundEventL@CPhoneState@@UAEXXZ @ 165 NONAME ; void CPhoneState::HandleIdleForegroundEventL(void)
+	?DynInitMenuPaneL@CPhoneState@@UAEXHPAVCEikMenuPane@@@Z @ 166 NONAME ; void CPhoneState::DynInitMenuPaneL(int, class CEikMenuPane *)
+	?IsDTMFEditorVisibleL@CPhoneState@@IBEHXZ @ 167 NONAME ; int CPhoneState::IsDTMFEditorVisibleL(void) const
+	?ConstructL@CPhoneStateCallSetup@@MAEXXZ @ 168 NONAME ; void CPhoneStateCallSetup::ConstructL(void)
+	?BeginTransEffectLC@CPhoneState@@QAEXW4TStateTransEffectType@@@Z @ 169 NONAME ; void CPhoneState::BeginTransEffectLC(enum TStateTransEffectType)
+	?HandleMessage@CPhoneUIController@@UAEXHH@Z @ 170 NONAME ; void CPhoneUIController::HandleMessage(int, int)
+	?HandleSystemEventL@CPhoneState@@UAEXABVTWsEvent@@@Z @ 171 NONAME ; void CPhoneState::HandleSystemEventL(class TWsEvent const &)
+	?DisplayCallSetupL@CPhoneStateIdle@@IAEXH@Z @ 172 NONAME ; void CPhoneStateIdle::DisplayCallSetupL(int)
+	?ConstructL@CPhoneStateStartup@@MAEXXZ @ 173 NONAME ; void CPhoneStateStartup::ConstructL(void)
+	?HandleKeyMessageL@CPhoneStateStartup@@UAEXW4TPhoneKeyEventMessages@MPhoneKeyEvents@@W4TKeyCode@@@Z @ 174 NONAME ; void CPhoneStateStartup::HandleKeyMessageL(enum MPhoneKeyEvents::TPhoneKeyEventMessages, enum TKeyCode)
+	?ShowNoteL@CPhoneState@@IAEXH@Z @ 175 NONAME ; void CPhoneState::ShowNoteL(int)
+	?HandlePropertyChangedL@CPhoneState@@UAEXABVTUid@@IH@Z @ 176 NONAME ; void CPhoneState::HandlePropertyChangedL(class TUid const &, unsigned int, int)
+	?IsAnyQueryActiveL@CPhoneState@@QAEHXZ @ 177 NONAME ; int CPhoneState::IsAnyQueryActiveL(void)
+	?State@CPhoneStateMachine@@UAEPAVMPhoneState@@XZ @ 178 NONAME ; class MPhoneState * CPhoneStateMachine::State(void)
+	?SetHandsfreeModeL@CPhoneState@@IAEXH@Z @ 179 NONAME ; void CPhoneState::SetHandsfreeModeL(int)
+	?IsCustomizedDialerVisibleL@CPhoneState@@QBEHXZ @ 180 NONAME ; int CPhoneState::IsCustomizedDialerVisibleL(void) const
+	?UpdateInCallCbaL@CPhoneStateCallSetup@@MAEXXZ @ 181 NONAME ; void CPhoneStateCallSetup::UpdateInCallCbaL(void)
+	?HandleNumberEntryClearedL@CPhoneStateInCall@@MAEXXZ @ 182 NONAME ; void CPhoneStateInCall::HandleNumberEntryClearedL(void)
+	??0CPhoneStateIncoming@@IAE@PAVMPhoneStateMachine@@PAVMPhoneViewCommandHandle@@PAVMPhoneCustomization@@@Z @ 183 NONAME ; CPhoneStateIncoming::CPhoneStateIncoming(class MPhoneStateMachine *, class MPhoneViewCommandHandle *, class MPhoneCustomization *)
+	??1CPhoneStateIncoming@@UAE@XZ @ 184 NONAME ; CPhoneStateIncoming::~CPhoneStateIncoming(void)
+	?HandleKeyLockEnabled@CPhoneUIController@@UAEXH@Z @ 185 NONAME ; void CPhoneUIController::HandleKeyLockEnabled(int)
+	?DisableCallUIL@CPhoneState@@QAEXXZ @ 186 NONAME ; void CPhoneState::DisableCallUIL(void)
+	?DeleteTouchPaneButtons@CPhoneState@@IAEXXZ @ 187 NONAME ; void CPhoneState::DeleteTouchPaneButtons(void)
+	?ProcessCommandL@CPhoneStateIdle@@UAEHH@Z @ 188 NONAME ; int CPhoneStateIdle::ProcessCommandL(int)
+	?IsNoteVisibleL@CPhoneState@@MAEHXZ @ 189 NONAME ; int CPhoneState::IsNoteVisibleL(void)
+	?DynInitMenuBarL@CPhoneUIController@@UAEXHPAVCEikMenuBar@@@Z @ 190 NONAME ; void CPhoneUIController::DynInitMenuBarL(int, class CEikMenuBar *)
+	?IsAlphanumericSupportedAndCharInput@CPhoneState@@MAEHABUTKeyEvent@@@Z @ 191 NONAME ; int CPhoneState::IsAlphanumericSupportedAndCharInput(struct TKeyEvent const &)
+	?HandlePhoneEngineMessageL@CPhoneStateStartup@@UAEXHH@Z @ 192 NONAME ; void CPhoneStateStartup::HandlePhoneEngineMessageL(int, int)
+	?HandleKeyEventL@CPhoneStateIncoming@@UAEXABUTKeyEvent@@W4TEventCode@@@Z @ 193 NONAME ; void CPhoneStateIncoming::HandleKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?HandleKeyEventL@CPhoneStateStartup@@UAEXABUTKeyEvent@@W4TEventCode@@@Z @ 194 NONAME ; void CPhoneStateStartup::HandleKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?HandleNumberEntryClearedL@CPhoneState@@MAEXXZ @ 195 NONAME ; void CPhoneState::HandleNumberEntryClearedL(void)
+	?OnlyHashInNumberEntryL@CPhoneState@@MAEXXZ @ 196 NONAME ; void CPhoneState::OnlyHashInNumberEntryL(void)
+	?IncreaseAudioVolumeL@CPhoneState@@IAEXXZ @ 197 NONAME ; void CPhoneState::IncreaseAudioVolumeL(void)
+	?ConstructL@CPhoneStateIdle@@MAEXXZ @ 198 NONAME ; void CPhoneStateIdle::ConstructL(void)
+	?CheckIfShowCallTerminationNote@CPhoneState@@MAEHXZ @ 199 NONAME ; int CPhoneState::CheckIfShowCallTerminationNote(void)
+	?SetCallHeaderType@CPhoneState@@IAEXW4TPhoneCallTypeFlags@CBubbleManager@@@Z @ 200 NONAME ; void CPhoneState::SetCallHeaderType(enum CBubbleManager::TPhoneCallTypeFlags)
+	?SendGlobalInfoNoteL@CPhoneState@@QAEXH@Z @ 201 NONAME ; void CPhoneState::SendGlobalInfoNoteL(int)
+	?DisplayIdleScreenL@CPhoneState@@IAEXXZ @ 202 NONAME ; void CPhoneState::DisplayIdleScreenL(void)
+	?StartShowSecurityNoteL@CPhoneState@@IAEXXZ @ 203 NONAME ; void CPhoneState::StartShowSecurityNoteL(void)
+	?StoreNumberEntryContentL@CPhoneState@@IAEXXZ @ 204 NONAME ; void CPhoneState::StoreNumberEntryContentL(void)
+	?SetBTHandsfreeModeL@CPhoneState@@IAEXH@Z @ 205 NONAME ; void CPhoneState::SetBTHandsfreeModeL(int)
+	?HandlePhoneEngineMessageL@CPhoneStateIncoming@@UAEXHH@Z @ 206 NONAME ; void CPhoneStateIncoming::HandlePhoneEngineMessageL(int, int)
+	?SetDefaultFlagsL@CPhoneState@@IAEXXZ @ 207 NONAME ; void CPhoneState::SetDefaultFlagsL(void)
+	?HandleCommandL@CPhoneStateInCall@@UAEHH@Z @ 208 NONAME ; int CPhoneStateInCall::HandleCommandL(int)
+	?DialVoiceCallL@CPhoneStateIdle@@IAEXXZ @ 209 NONAME ; void CPhoneStateIdle::DialVoiceCallL(void)
+	?UpdateRemoteInfoDataL@CPhoneState@@IAEXH@Z @ 210 NONAME ; void CPhoneState::UpdateRemoteInfoDataL(int)
+	?GetRingingCallL@CPhoneStateInCall@@MAEHXZ @ 211 NONAME ; int CPhoneStateInCall::GetRingingCallL(void)
+	?HandleIdleForegroundEventL@CPhoneUIController@@UAEXXZ @ 212 NONAME ; void CPhoneUIController::HandleIdleForegroundEventL(void)
+	?HandlePhoneForegroundEventL@CPhoneState@@UAEXXZ @ 213 NONAME ; void CPhoneState::HandlePhoneForegroundEventL(void)
+	?HandleForegroundEventL@CPhoneState@@UAEXH@Z @ 214 NONAME ; void CPhoneState::HandleForegroundEventL(int)
+	?DisplayIncomingCallL@CPhoneStateIdle@@IAEXH@Z @ 215 NONAME ; void CPhoneStateIdle::DisplayIncomingCallL(int)
+	?HandleRemConCommandL@CPhoneState@@UAEHW4TRemConCoreApiOperationId@@W4TRemConCoreApiButtonAction@@@Z @ 216 NONAME ; int CPhoneState::HandleRemConCommandL(enum TRemConCoreApiOperationId, enum TRemConCoreApiButtonAction)
+	??1CPhoneStateIdle@@UAE@XZ @ 217 NONAME ; CPhoneStateIdle::~CPhoneStateIdle(void)
+	?PhoneNumberFromEntryLC@CPhoneState@@IAEPAVHBufC16@@XZ @ 218 NONAME ; class HBufC16 * CPhoneState::PhoneNumberFromEntryLC(void)
+	?BaseConstructL@CPhoneState@@QAEXXZ @ 219 NONAME ; void CPhoneState::BaseConstructL(void)
+	?HandlePhoneStartupL@CPhoneUIController@@UAEXXZ @ 220 NONAME ; void CPhoneUIController::HandlePhoneStartupL(void)
+	?SpeedDialL@CPhoneStateIdle@@IAEXABIW4TDialInitiationMethod@1@@Z @ 221 NONAME ; void CPhoneStateIdle::SpeedDialL(unsigned int const &, enum CPhoneStateIdle::TDialInitiationMethod)
+	?SetTouchPaneButtonEnabled@CPhoneState@@IAEXH@Z @ 222 NONAME ; void CPhoneState::SetTouchPaneButtonEnabled(int)
+	?SetPhoneEngine@CPhoneStateMachine@@UAEXPAVMPEPhoneModel@@@Z @ 223 NONAME ; void CPhoneStateMachine::SetPhoneEngine(class MPEPhoneModel *)
+	?SpeedDialCanceledL@CPhoneStateIdle@@IAEXABI@Z @ 224 NONAME ; void CPhoneStateIdle::SpeedDialCanceledL(unsigned int const &)
+	?CloseDTMFEditorL@CPhoneState@@IAEXXZ @ 225 NONAME ; void CPhoneState::CloseDTMFEditorL(void)
+	?SetTouchPaneVisible@CPhoneState@@IAEXH@Z @ 226 NONAME ; void CPhoneState::SetTouchPaneVisible(int)
+	?HandlePhoneFocusLostEventL@CPhoneUIController@@UAEXXZ @ 227 NONAME ; void CPhoneUIController::HandlePhoneFocusLostEventL(void)
+	?HandleKeyLockEnabled@CPhoneStateIncoming@@UAEXH@Z @ 228 NONAME ; void CPhoneStateIncoming::HandleKeyLockEnabled(int)
+	??0CPhoneStateMachine@@IAE@PAVMPhoneViewCommandHandle@@@Z @ 229 NONAME ; CPhoneStateMachine::CPhoneStateMachine(class MPhoneViewCommandHandle *)
+	??1CPhoneStateStartup@@UAE@XZ @ 230 NONAME ; CPhoneStateStartup::~CPhoneStateStartup(void)
+	?HandleKeyMessageL@CPhoneState@@UAEXW4TPhoneKeyEventMessages@MPhoneKeyEvents@@W4TKeyCode@@@Z @ 231 NONAME ; void CPhoneState::HandleKeyMessageL(enum MPhoneKeyEvents::TPhoneKeyEventMessages, enum TKeyCode)
+	?SetToolbarButtonLoudspeakerEnabled@CPhoneState@@IAEXXZ @ 232 NONAME ; void CPhoneState::SetToolbarButtonLoudspeakerEnabled(void)
+	?SetToolbarDimming@CPhoneState@@IAEXH@Z @ 233 NONAME ; void CPhoneState::SetToolbarDimming(int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/eabi/phoneuicontrolu.def	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,471 @@
+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
+	_ZN11CPhoneState17SetCallHeaderTypeEN14CBubbleManager19TPhoneCallTypeFlagsE @ 28 NONAME
+	_ZN11CPhoneState17SetHandsfreeModeLEi @ 29 NONAME
+	_ZN11CPhoneState18BeginTransEffectLCE21TStateTransEffectType @ 30 NONAME
+	_ZN11CPhoneState18DisplayIdleScreenLEv @ 31 NONAME
+	_ZN11CPhoneState18GetRemoteInfoDataLEiR6TDes16 @ 32 NONAME
+	_ZN11CPhoneState18HandleDtmfKeyToneLERK9TKeyEvent10TEventCode @ 33 NONAME
+	_ZN11CPhoneState18HandleSystemEventLERK8TWsEvent @ 34 NONAME
+	_ZN11CPhoneState18IsNumberEntryUsedLEv @ 35 NONAME
+	_ZN11CPhoneState19CompleteSatRequestLEi @ 36 NONAME
+	_ZN11CPhoneState19DialMultimediaCallLEv @ 37 NONAME
+	_ZN11CPhoneState19HandleCenRepChangeLERK4TUidj @ 38 NONAME
+	_ZN11CPhoneState19HandlePhoneStartupLEv @ 39 NONAME
+	_ZN11CPhoneState19SendGlobalInfoNoteLEi @ 40 NONAME
+	_ZN11CPhoneState19SetBTHandsfreeModeLEi @ 41 NONAME
+	_ZN11CPhoneState19SetDivertIndicationEi @ 42 NONAME
+	_ZN11CPhoneState19SetTouchPaneButtonsEi @ 43 NONAME
+	_ZN11CPhoneState19SetTouchPaneVisibleEi @ 44 NONAME
+	_ZN11CPhoneState19ShowNumberBusyNoteLEv @ 45 NONAME
+	_ZN11CPhoneState20CallFromNumberEntryLEv @ 46 NONAME
+	_ZN11CPhoneState20DecreaseAudioVolumeLEv @ 47 NONAME
+	_ZN11CPhoneState20HandleDisconnectingLEi @ 48 NONAME
+	_ZN11CPhoneState20HandleKeyLockEnabledEi @ 49 NONAME
+	_ZN11CPhoneState20HandleRemConCommandLE25TRemConCoreApiOperationId26TRemConCoreApiButtonAction @ 50 NONAME
+	_ZN11CPhoneState20IncreaseAudioVolumeLEv @ 51 NONAME
+	_ZN11CPhoneState20SendGlobalErrorNoteLEi @ 52 NONAME
+	_ZN11CPhoneState21IsNumberEntryVisibleLEv @ 53 NONAME
+	_ZN11CPhoneState21UpdateRemoteInfoDataLEi @ 54 NONAME
+	_ZN11CPhoneState22CloseCustomizedDialerLEv @ 55 NONAME
+	_ZN11CPhoneState22DeleteTouchPaneButtonsEv @ 56 NONAME
+	_ZN11CPhoneState22HandleForegroundEventLEi @ 57 NONAME
+	_ZN11CPhoneState22HandleNumericKeyEventLERK9TKeyEvent10TEventCode @ 58 NONAME
+	_ZN11CPhoneState22HandlePropertyChangedLERK4TUidji @ 59 NONAME
+	_ZN11CPhoneState22OnlyHashInNumberEntryLEv @ 60 NONAME
+	_ZN11CPhoneState22PhoneNumberFromEntryLCEv @ 61 NONAME
+	_ZN11CPhoneState22SendGlobalWarningNoteLEi @ 62 NONAME
+	_ZN11CPhoneState22StartShowSecurityNoteLEv @ 63 NONAME
+	_ZN11CPhoneState23HandleAudioMuteChangedLEv @ 64 NONAME
+	_ZN11CPhoneState23HandleKeyPressDurationLE8TKeyCode25TTimeIntervalMicroSeconds @ 65 NONAME
+	_ZN11CPhoneState23HandleNumberEntryEditedEv @ 66 NONAME
+	_ZN11CPhoneState23SetRingingTonePlaybackLEi @ 67 NONAME
+	_ZN11CPhoneState23UpdateSingleActiveCallLEi @ 68 NONAME
+	_ZN11CPhoneState24HandleCreateNumberEntryLERK9TKeyEvent10TEventCode @ 69 NONAME
+	_ZN11CPhoneState24HandleEnvironmentChangeLEi @ 70 NONAME
+	_ZN11CPhoneState24StartAlsLineChangeTimerLEv @ 71 NONAME
+	_ZN11CPhoneState24StoreNumberEntryContentLEv @ 72 NONAME
+	_ZN11CPhoneState24UpdateInCallContextMenuLEv @ 73 NONAME
+	_ZN11CPhoneState25HandleAudioOutputChangedLEv @ 74 NONAME
+	_ZN11CPhoneState25HandleNumberEntryClearedLEv @ 75 NONAME
+	_ZN11CPhoneState25HandlePhoneEngineMessageLEii @ 76 NONAME
+	_ZN11CPhoneState25SetNumberEntryVisibilityLEi @ 77 NONAME
+	_ZN11CPhoneState25SetTouchPaneButtonEnabledEi @ 78 NONAME
+	_ZN11CPhoneState26HandleIdleForegroundEventLEv @ 79 NONAME
+	_ZN11CPhoneState26HandlePhoneFocusLostEventLEv @ 80 NONAME
+	_ZN11CPhoneState26IsNumberEntryContentStoredEv @ 81 NONAME
+	_ZN11CPhoneState26RestoreNumberEntryContentLEv @ 82 NONAME
+	_ZN11CPhoneState26SetTouchPaneButtonDisabledEi @ 83 NONAME
+	_ZN11CPhoneState26UpdateIncomingContextMenuLEi @ 84 NONAME
+	_ZN11CPhoneState26UpdateSilenceButtonDimmingEv @ 85 NONAME
+	_ZN11CPhoneState27DisplayCallTerminationNoteLEv @ 86 NONAME
+	_ZN11CPhoneState27HandlePhoneForegroundEventLEv @ 87 NONAME
+	_ZN11CPhoneState27RetainPreviousKeylockStateLEv @ 88 NONAME
+	_ZN11CPhoneState28CheckDisableHWKeysAndCallUILEv @ 89 NONAME
+	_ZN11CPhoneState28ClearNumberEntryContentCacheEv @ 90 NONAME
+	_ZN11CPhoneState28SetupIdleScreenInBackgroundLEv @ 91 NONAME
+	_ZN11CPhoneState29DisplayHeaderForCallComingInLEii @ 92 NONAME
+	_ZN11CPhoneState29DisplayHeaderForOutgoingCallLEi @ 93 NONAME
+	_ZN11CPhoneState30CheckIfShowCallTerminationNoteEv @ 94 NONAME
+	_ZN11CPhoneState30CustomizedDialerCbaResourceIdLEv @ 95 NONAME
+	_ZN11CPhoneState31CustomizedDialerMenuResourceIdLEv @ 96 NONAME
+	_ZN11CPhoneState34CaptureKeysDuringCallNotificationLEi @ 97 NONAME
+	_ZN11CPhoneState34SetCallHeaderTextsForCallComingInLEiiP28TPhoneCmdParamCallHeaderData @ 98 NONAME
+	_ZN11CPhoneState35IsAlphanumericSupportedAndCharInputERK9TKeyEvent @ 99 NONAME
+	_ZN11CPhoneState38CheckIfRestoreNEContentAfterDtmfDialerEv @ 100 NONAME
+	_ZN11CPhoneState43IsSimStateNotPresentWithSecurityModeEnabledEv @ 101 NONAME
+	_ZN11CPhoneState7IsSimOkEv @ 102 NONAME
+	_ZN11CPhoneState9ShowNoteLEi @ 103 NONAME
+	_ZN11CPhoneStateC1EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 104 NONAME
+	_ZN11CPhoneStateC2EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 105 NONAME
+	_ZN11CPhoneStateD0Ev @ 106 NONAME
+	_ZN11CPhoneStateD1Ev @ 107 NONAME
+	_ZN11CPhoneStateD2Ev @ 108 NONAME
+	_ZN15CPhoneStateIdle10ConstructLEv @ 109 NONAME
+	_ZN15CPhoneStateIdle10SpeedDialLERKjNS_21TDialInitiationMethodE @ 110 NONAME
+	_ZN15CPhoneStateIdle14DialVoiceCallLEv @ 111 NONAME
+	_ZN15CPhoneStateIdle14HandleCommandLEi @ 112 NONAME
+	_ZN15CPhoneStateIdle14HandleDialingLEi @ 113 NONAME
+	_ZN15CPhoneStateIdle15HandleKeyEventLERK9TKeyEvent10TEventCode @ 114 NONAME
+	_ZN15CPhoneStateIdle15ProcessCommandLEi @ 115 NONAME
+	_ZN15CPhoneStateIdle17DisplayCallSetupLEi @ 116 NONAME
+	_ZN15CPhoneStateIdle17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 117 NONAME
+	_ZN15CPhoneStateIdle18HandleSendCommandLEv @ 118 NONAME
+	_ZN15CPhoneStateIdle18SpeedDialCanceledLERKj @ 119 NONAME
+	_ZN15CPhoneStateIdle19DialMultimediaCallLEv @ 120 NONAME
+	_ZN15CPhoneStateIdle20DisplayIncomingCallLEi @ 121 NONAME
+	_ZN15CPhoneStateIdle20HandleRemConCommandLE25TRemConCoreApiOperationId26TRemConCoreApiButtonAction @ 122 NONAME
+	_ZN15CPhoneStateIdle22OnlyHashInNumberEntryLEv @ 123 NONAME
+	_ZN15CPhoneStateIdle25HandleNumberEntryClearedLEv @ 124 NONAME
+	_ZN15CPhoneStateIdle25HandleNumberLongKeyPressLEv @ 125 NONAME
+	_ZN15CPhoneStateIdle25HandlePhoneEngineMessageLEii @ 126 NONAME
+	_ZN15CPhoneStateIdle26HandleIdleForegroundEventLEv @ 127 NONAME
+	_ZN15CPhoneStateIdle26HandlePhoneFocusLostEventLEv @ 128 NONAME
+	_ZN15CPhoneStateIdle27HandlePhoneForegroundEventLEv @ 129 NONAME
+	_ZN15CPhoneStateIdle5DialLERK7TDesC1616TPhoneNumberTypeNS_21TDialInitiationMethodE @ 130 NONAME
+	_ZN15CPhoneStateIdleC1EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 131 NONAME
+	_ZN15CPhoneStateIdleC2EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 132 NONAME
+	_ZN15CPhoneStateIdleD0Ev @ 133 NONAME
+	_ZN15CPhoneStateIdleD1Ev @ 134 NONAME
+	_ZN15CPhoneStateIdleD2Ev @ 135 NONAME
+	_ZN16CPhoneCbaManager10UpdateCbaLEi @ 136 NONAME
+	_ZN16CPhoneCbaManager18UpdateIncomingCbaLEi @ 137 NONAME
+	_ZN16CPhoneCbaManager7SetCbaLEi @ 138 NONAME
+	_ZN17CPhoneStateHandle17ViewCommandHandleEv @ 139 NONAME
+	_ZN17CPhoneStateHandle8InstanceEv @ 140 NONAME
+	_ZN17CPhoneStateInCall10ConstructLEv @ 141 NONAME
+	_ZN17CPhoneStateInCall10UpdateCbaLEi @ 142 NONAME
+	_ZN17CPhoneStateInCall11HandleIdleLEi @ 143 NONAME
+	_ZN17CPhoneStateInCall12OpenMenuBarLEv @ 144 NONAME
+	_ZN17CPhoneStateInCall14HandleCommandLEi @ 145 NONAME
+	_ZN17CPhoneStateInCall15CloseDtmfQueryLEv @ 146 NONAME
+	_ZN17CPhoneStateInCall15GetRingingCallLEv @ 147 NONAME
+	_ZN17CPhoneStateInCall16UpdateInCallCbaLEv @ 148 NONAME
+	_ZN17CPhoneStateInCall17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 149 NONAME
+	_ZN17CPhoneStateInCall18CallFetchedNumberLERK7TDesC16 @ 150 NONAME
+	_ZN17CPhoneStateInCall18CreateNumberEntryLEv @ 151 NONAME
+	_ZN17CPhoneStateInCall18IsVideoCallActiveLEv @ 152 NONAME
+	_ZN17CPhoneStateInCall19IsVideoCallRingingLEv @ 153 NONAME
+	_ZN17CPhoneStateInCall19LaunchNewCallQueryLEv @ 154 NONAME
+	_ZN17CPhoneStateInCall23DisconnectOutgoingCallLEv @ 155 NONAME
+	_ZN17CPhoneStateInCall25HandleNumberEntryClearedLEv @ 156 NONAME
+	_ZN17CPhoneStateInCall25HandlePhoneEngineMessageLEii @ 157 NONAME
+	_ZN17CPhoneStateInCall34PhoneNumberAvailableInPhoneEngineLEi @ 158 NONAME
+	_ZN17CPhoneStateInCallC1EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 159 NONAME
+	_ZN17CPhoneStateInCallC2EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 160 NONAME
+	_ZN17CPhoneStateInCallD0Ev @ 161 NONAME
+	_ZN17CPhoneStateInCallD1Ev @ 162 NONAME
+	_ZN17CPhoneStateInCallD2Ev @ 163 NONAME
+	_ZN18CPhoneStateMachine11ChangeStateEi @ 164 NONAME
+	_ZN18CPhoneStateMachine11PhoneEngineEv @ 165 NONAME
+	_ZN18CPhoneStateMachine12PhoneStorageEv @ 166 NONAME
+	_ZN18CPhoneStateMachine14SetPhoneEngineEP13MPEPhoneModel @ 167 NONAME
+	_ZN18CPhoneStateMachine15PhoneEngineInfoEv @ 168 NONAME
+	_ZN18CPhoneStateMachine18CreatePhoneEngineLER14MEngineMonitor @ 169 NONAME
+	_ZN18CPhoneStateMachine22SendPhoneEngineMessageEi @ 170 NONAME
+	_ZN18CPhoneStateMachine5StateEv @ 171 NONAME
+	_ZN18CPhoneStateMachine9SetCallIdEi @ 172 NONAME
+	_ZN18CPhoneStateMachineC1EP23MPhoneViewCommandHandle @ 173 NONAME
+	_ZN18CPhoneStateMachineC2EP23MPhoneViewCommandHandle @ 174 NONAME
+	_ZN18CPhoneStateMachineD0Ev @ 175 NONAME
+	_ZN18CPhoneStateMachineD1Ev @ 176 NONAME
+	_ZN18CPhoneStateMachineD2Ev @ 177 NONAME
+	_ZN18CPhoneStateStartup10ConstructLEv @ 178 NONAME
+	_ZN18CPhoneStateStartup15HandleKeyEventLERK9TKeyEvent10TEventCode @ 179 NONAME
+	_ZN18CPhoneStateStartup17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 180 NONAME
+	_ZN18CPhoneStateStartup18HandleDtmfKeyToneLERK9TKeyEvent10TEventCode @ 181 NONAME
+	_ZN18CPhoneStateStartup19HandlePhoneStartupLEv @ 182 NONAME
+	_ZN18CPhoneStateStartup24HandleCreateNumberEntryLERK9TKeyEvent10TEventCode @ 183 NONAME
+	_ZN18CPhoneStateStartup25HandlePhoneEngineMessageLEii @ 184 NONAME
+	_ZN18CPhoneStateStartup26HandleIdleForegroundEventLEv @ 185 NONAME
+	_ZN18CPhoneStateStartup4NewLEP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 186 NONAME
+	_ZN18CPhoneStateStartupC1EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 187 NONAME
+	_ZN18CPhoneStateStartupC2EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 188 NONAME
+	_ZN18CPhoneStateStartupD0Ev @ 189 NONAME
+	_ZN18CPhoneStateStartupD1Ev @ 190 NONAME
+	_ZN18CPhoneStateStartupD2Ev @ 191 NONAME
+	_ZN18CPhoneUIController11HandleErrorERK12TPEErrorInfo @ 192 NONAME
+	_ZN18CPhoneUIController13HandleMessageEii @ 193 NONAME
+	_ZN18CPhoneUIController14HandleCommandLEi @ 194 NONAME
+	_ZN18CPhoneUIController15DynInitMenuBarLEiP11CEikMenuBar @ 195 NONAME
+	_ZN18CPhoneUIController15HandleKeyEventLERK9TKeyEvent10TEventCode @ 196 NONAME
+	_ZN18CPhoneUIController15ProcessCommandLEi @ 197 NONAME
+	_ZN18CPhoneUIController16DynInitMenuPaneLEiP12CEikMenuPane @ 198 NONAME
+	_ZN18CPhoneUIController18HandleSystemEventLERK8TWsEvent @ 199 NONAME
+	_ZN18CPhoneUIController19HandlePhoneStartupLEv @ 200 NONAME
+	_ZN18CPhoneUIController20HandleKeyLockEnabledEi @ 201 NONAME
+	_ZN18CPhoneUIController22HandleForegroundEventLEi @ 202 NONAME
+	_ZN18CPhoneUIController24HandleEnvironmentChangeLEi @ 203 NONAME
+	_ZN18CPhoneUIController26HandleIdleForegroundEventLEv @ 204 NONAME
+	_ZN18CPhoneUIController26HandlePhoneFocusLostEventLEv @ 205 NONAME
+	_ZN18CPhoneUIController27HandlePhoneForegroundEventLEv @ 206 NONAME
+	_ZN18CPhoneUIController4NewLEP23MPhoneViewCommandHandle @ 207 NONAME
+	_ZN18CPhoneUIControllerD0Ev @ 208 NONAME
+	_ZN18CPhoneUIControllerD1Ev @ 209 NONAME
+	_ZN18CPhoneUIControllerD2Ev @ 210 NONAME
+	_ZN19CPhoneStateIncoming10ConstructLEv @ 211 NONAME
+	_ZN19CPhoneStateIncoming14HandleCommandLEi @ 212 NONAME
+	_ZN19CPhoneStateIncoming15HandleKeyEventLERK9TKeyEvent10TEventCode @ 213 NONAME
+	_ZN19CPhoneStateIncoming16DynInitMenuPaneLEiP12CEikMenuPane @ 214 NONAME
+	_ZN19CPhoneStateIncoming17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 215 NONAME
+	_ZN19CPhoneStateIncoming20HandleKeyLockEnabledEi @ 216 NONAME
+	_ZN19CPhoneStateIncoming23HandleAudioPlayStoppedLEv @ 217 NONAME
+	_ZN19CPhoneStateIncoming23HandleKeyPressDurationLE8TKeyCode25TTimeIntervalMicroSeconds @ 218 NONAME
+	_ZN19CPhoneStateIncoming25HandleNumberEntryClearedLEv @ 219 NONAME
+	_ZN19CPhoneStateIncoming25HandlePhoneEngineMessageLEii @ 220 NONAME
+	_ZN19CPhoneStateIncomingC1EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 221 NONAME
+	_ZN19CPhoneStateIncomingC2EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 222 NONAME
+	_ZN19CPhoneStateIncomingD0Ev @ 223 NONAME
+	_ZN19CPhoneStateIncomingD1Ev @ 224 NONAME
+	_ZN19CPhoneStateIncomingD2Ev @ 225 NONAME
+	_ZN20CPhoneReconnectQuery19ShowReconnectQueryLEi @ 226 NONAME
+	_ZN20CPhoneReconnectQuery9InstanceLEv @ 227 NONAME
+	_ZN20CPhoneStateCallSetup10ConstructLEv @ 228 NONAME
+	_ZN20CPhoneStateCallSetup10UpdateCbaLEi @ 229 NONAME
+	_ZN20CPhoneStateCallSetup12OpenMenuBarLEv @ 230 NONAME
+	_ZN20CPhoneStateCallSetup14HandleCommandLEi @ 231 NONAME
+	_ZN20CPhoneStateCallSetup15HandleKeyEventLERK9TKeyEvent10TEventCode @ 232 NONAME
+	_ZN20CPhoneStateCallSetup16UpdateInCallCbaLEv @ 233 NONAME
+	_ZN20CPhoneStateCallSetup17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 234 NONAME
+	_ZN20CPhoneStateCallSetup24HandleCreateNumberEntryLERK9TKeyEvent10TEventCode @ 235 NONAME
+	_ZN20CPhoneStateCallSetup25HandleNumberEntryClearedLEv @ 236 NONAME
+	_ZN20CPhoneStateCallSetup25HandlePhoneEngineMessageLEii @ 237 NONAME
+	_ZN20CPhoneStateCallSetupC1EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 238 NONAME
+	_ZN20CPhoneStateCallSetupC2EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 239 NONAME
+	_ZN20CPhoneStateCallSetupD0Ev @ 240 NONAME
+	_ZN20CPhoneStateCallSetupD1Ev @ 241 NONAME
+	_ZN20CPhoneStateCallSetupD2Ev @ 242 NONAME
+	_ZNK11CPhoneState11IsKeyLockOnEv @ 243 NONAME
+	_ZNK11CPhoneState12IsAutoLockOnEv @ 244 NONAME
+	_ZNK11CPhoneState14IsSwivelClosedEv @ 245 NONAME
+	_ZNK11CPhoneState17GetBlockedKeyListEv @ 246 NONAME
+	_ZNK11CPhoneState17IsMenuBarVisibleLEv @ 247 NONAME
+	_ZNK11CPhoneState18TopAppIsDisplayedLEv @ 248 NONAME
+	_ZNK11CPhoneState20IsDTMFEditorVisibleLEv @ 249 NONAME
+	_ZNK11CPhoneState23NeedToSendToBackgroundLEv @ 250 NONAME
+	_ZNK11CPhoneState25IsOnScreenDialerSupportedEv @ 251 NONAME
+	_ZNK11CPhoneState26IsCustomizedDialerVisibleLEv @ 252 NONAME
+	_ZNK11CPhoneState8SimStateEv @ 253 NONAME
+	_ZNK15CPhoneStateIdle17IsSpeedDialNumberERK7TDesC16 @ 254 NONAME
+	_ZTI11CPhoneState @ 255 NONAME
+	_ZTI15CPhoneStateIdle @ 256 NONAME
+	_ZTI17CPhoneStateHandle @ 257 NONAME
+	_ZTI17CPhoneStateInCall @ 258 NONAME
+	_ZTI18CPhoneStateMachine @ 259 NONAME
+	_ZTI18CPhoneStateStartup @ 260 NONAME
+	_ZTI18CPhoneUIController @ 261 NONAME
+	_ZTI19CPhoneStateIncoming @ 262 NONAME
+	_ZTI20CPhoneReconnectQuery @ 263 NONAME
+	_ZTI20CPhoneStateCallSetup @ 264 NONAME
+	_ZTI23CPhoneDtmfWaitCharTimer @ 265 NONAME
+	_ZTI23CPhoneKeyEventForwarder @ 266 NONAME
+	_ZTI24CPhoneSystemEventHandler @ 267 NONAME
+	_ZTI26CPhoneRemoteControlHandler @ 268 NONAME
+	_ZTI27CPhoneBtaaDisconnectHandler @ 269 NONAME
+	_ZTV11CPhoneState @ 270 NONAME
+	_ZTV15CPhoneStateIdle @ 271 NONAME
+	_ZTV17CPhoneStateHandle @ 272 NONAME
+	_ZTV17CPhoneStateInCall @ 273 NONAME
+	_ZTV18CPhoneStateMachine @ 274 NONAME
+	_ZTV18CPhoneStateStartup @ 275 NONAME
+	_ZTV18CPhoneUIController @ 276 NONAME
+	_ZTV19CPhoneStateIncoming @ 277 NONAME
+	_ZTV20CPhoneReconnectQuery @ 278 NONAME
+	_ZTV20CPhoneStateCallSetup @ 279 NONAME
+	_ZTV23CPhoneDtmfWaitCharTimer @ 280 NONAME
+	_ZTV23CPhoneKeyEventForwarder @ 281 NONAME
+	_ZTV24CPhoneSystemEventHandler @ 282 NONAME
+	_ZTV26CPhoneRemoteControlHandler @ 283 NONAME
+	_ZTV27CPhoneBtaaDisconnectHandler @ 284 NONAME
+	_ZThn12_N11CPhoneState15DynInitMenuBarLEiP11CEikMenuBar @ 285 NONAME
+	_ZThn12_N11CPhoneState16DynInitMenuPaneLEiP12CEikMenuPane @ 286 NONAME
+	_ZThn12_N11CPhoneState18HandleSystemEventLERK8TWsEvent @ 287 NONAME
+	_ZThn12_N11CPhoneState19HandleCenRepChangeLERK4TUidj @ 288 NONAME
+	_ZThn12_N11CPhoneState19HandlePhoneStartupLEv @ 289 NONAME
+	_ZThn12_N11CPhoneState20HandleKeyLockEnabledEi @ 290 NONAME
+	_ZThn12_N11CPhoneState22HandleForegroundEventLEi @ 291 NONAME
+	_ZThn12_N11CPhoneState22HandlePropertyChangedLERK4TUidji @ 292 NONAME
+	_ZThn12_N11CPhoneState24HandleEnvironmentChangeLEi @ 293 NONAME
+	_ZThn12_N11CPhoneState26HandleIdleForegroundEventLEv @ 294 NONAME
+	_ZThn12_N11CPhoneState26HandlePhoneFocusLostEventLEv @ 295 NONAME
+	_ZThn12_N11CPhoneState27HandlePhoneForegroundEventLEv @ 296 NONAME
+	_ZThn12_N11CPhoneStateD0Ev @ 297 NONAME
+	_ZThn12_N11CPhoneStateD1Ev @ 298 NONAME
+	_ZThn12_N15CPhoneStateIdle26HandleIdleForegroundEventLEv @ 299 NONAME
+	_ZThn12_N15CPhoneStateIdle26HandlePhoneFocusLostEventLEv @ 300 NONAME
+	_ZThn12_N15CPhoneStateIdle27HandlePhoneForegroundEventLEv @ 301 NONAME
+	_ZThn12_N15CPhoneStateIdleD0Ev @ 302 NONAME
+	_ZThn12_N15CPhoneStateIdleD1Ev @ 303 NONAME
+	_ZThn12_N17CPhoneStateInCallD0Ev @ 304 NONAME
+	_ZThn12_N17CPhoneStateInCallD1Ev @ 305 NONAME
+	_ZThn12_N18CPhoneStateStartup19HandlePhoneStartupLEv @ 306 NONAME
+	_ZThn12_N18CPhoneStateStartup26HandleIdleForegroundEventLEv @ 307 NONAME
+	_ZThn12_N18CPhoneStateStartupD0Ev @ 308 NONAME
+	_ZThn12_N18CPhoneStateStartupD1Ev @ 309 NONAME
+	_ZThn12_N18CPhoneUIController15DynInitMenuBarLEiP11CEikMenuBar @ 310 NONAME
+	_ZThn12_N18CPhoneUIController16DynInitMenuPaneLEiP12CEikMenuPane @ 311 NONAME
+	_ZThn12_N18CPhoneUIController18HandleSystemEventLERK8TWsEvent @ 312 NONAME
+	_ZThn12_N18CPhoneUIController19HandlePhoneStartupLEv @ 313 NONAME
+	_ZThn12_N18CPhoneUIController20HandleKeyLockEnabledEi @ 314 NONAME
+	_ZThn12_N18CPhoneUIController22HandleForegroundEventLEi @ 315 NONAME
+	_ZThn12_N18CPhoneUIController24HandleEnvironmentChangeLEi @ 316 NONAME
+	_ZThn12_N18CPhoneUIController26HandleIdleForegroundEventLEv @ 317 NONAME
+	_ZThn12_N18CPhoneUIController26HandlePhoneFocusLostEventLEv @ 318 NONAME
+	_ZThn12_N18CPhoneUIController27HandlePhoneForegroundEventLEv @ 319 NONAME
+	_ZThn12_N18CPhoneUIControllerD0Ev @ 320 NONAME
+	_ZThn12_N18CPhoneUIControllerD1Ev @ 321 NONAME
+	_ZThn12_N19CPhoneStateIncoming16DynInitMenuPaneLEiP12CEikMenuPane @ 322 NONAME
+	_ZThn12_N19CPhoneStateIncoming20HandleKeyLockEnabledEi @ 323 NONAME
+	_ZThn12_N19CPhoneStateIncomingD0Ev @ 324 NONAME
+	_ZThn12_N19CPhoneStateIncomingD1Ev @ 325 NONAME
+	_ZThn12_N20CPhoneStateCallSetupD0Ev @ 326 NONAME
+	_ZThn12_N20CPhoneStateCallSetupD1Ev @ 327 NONAME
+	_ZThn16_N11CPhoneState14HandleCommandLEi @ 328 NONAME
+	_ZThn16_N11CPhoneState15ProcessCommandLEi @ 329 NONAME
+	_ZThn16_N11CPhoneStateD0Ev @ 330 NONAME
+	_ZThn16_N11CPhoneStateD1Ev @ 331 NONAME
+	_ZThn16_N15CPhoneStateIdle14HandleCommandLEi @ 332 NONAME
+	_ZThn16_N15CPhoneStateIdle15ProcessCommandLEi @ 333 NONAME
+	_ZThn16_N15CPhoneStateIdleD0Ev @ 334 NONAME
+	_ZThn16_N15CPhoneStateIdleD1Ev @ 335 NONAME
+	_ZThn16_N17CPhoneStateInCall14HandleCommandLEi @ 336 NONAME
+	_ZThn16_N17CPhoneStateInCallD0Ev @ 337 NONAME
+	_ZThn16_N17CPhoneStateInCallD1Ev @ 338 NONAME
+	_ZThn16_N18CPhoneStateStartupD0Ev @ 339 NONAME
+	_ZThn16_N18CPhoneStateStartupD1Ev @ 340 NONAME
+	_ZThn16_N18CPhoneUIController14HandleCommandLEi @ 341 NONAME
+	_ZThn16_N18CPhoneUIController15ProcessCommandLEi @ 342 NONAME
+	_ZThn16_N18CPhoneUIControllerD0Ev @ 343 NONAME
+	_ZThn16_N18CPhoneUIControllerD1Ev @ 344 NONAME
+	_ZThn16_N19CPhoneStateIncoming14HandleCommandLEi @ 345 NONAME
+	_ZThn16_N19CPhoneStateIncomingD0Ev @ 346 NONAME
+	_ZThn16_N19CPhoneStateIncomingD1Ev @ 347 NONAME
+	_ZThn16_N20CPhoneStateCallSetup14HandleCommandLEi @ 348 NONAME
+	_ZThn16_N20CPhoneStateCallSetupD0Ev @ 349 NONAME
+	_ZThn16_N20CPhoneStateCallSetupD1Ev @ 350 NONAME
+	_ZThn20_N11CPhoneState20HandleRemConCommandLE25TRemConCoreApiOperationId26TRemConCoreApiButtonAction @ 351 NONAME
+	_ZThn20_N11CPhoneStateD0Ev @ 352 NONAME
+	_ZThn20_N11CPhoneStateD1Ev @ 353 NONAME
+	_ZThn20_N15CPhoneStateIdle20HandleRemConCommandLE25TRemConCoreApiOperationId26TRemConCoreApiButtonAction @ 354 NONAME
+	_ZThn20_N15CPhoneStateIdleD0Ev @ 355 NONAME
+	_ZThn20_N15CPhoneStateIdleD1Ev @ 356 NONAME
+	_ZThn20_N17CPhoneStateInCallD0Ev @ 357 NONAME
+	_ZThn20_N17CPhoneStateInCallD1Ev @ 358 NONAME
+	_ZThn20_N18CPhoneStateStartupD0Ev @ 359 NONAME
+	_ZThn20_N18CPhoneStateStartupD1Ev @ 360 NONAME
+	_ZThn20_N19CPhoneStateIncomingD0Ev @ 361 NONAME
+	_ZThn20_N19CPhoneStateIncomingD1Ev @ 362 NONAME
+	_ZThn20_N20CPhoneStateCallSetupD0Ev @ 363 NONAME
+	_ZThn20_N20CPhoneStateCallSetupD1Ev @ 364 NONAME
+	_ZThn24_N11CPhoneState19SetDivertIndicationEi @ 365 NONAME
+	_ZThn24_N11CPhoneStateD0Ev @ 366 NONAME
+	_ZThn24_N11CPhoneStateD1Ev @ 367 NONAME
+	_ZThn24_N15CPhoneStateIdleD0Ev @ 368 NONAME
+	_ZThn24_N15CPhoneStateIdleD1Ev @ 369 NONAME
+	_ZThn24_N17CPhoneStateInCallD0Ev @ 370 NONAME
+	_ZThn24_N17CPhoneStateInCallD1Ev @ 371 NONAME
+	_ZThn24_N18CPhoneStateStartupD0Ev @ 372 NONAME
+	_ZThn24_N18CPhoneStateStartupD1Ev @ 373 NONAME
+	_ZThn24_N19CPhoneStateIncomingD0Ev @ 374 NONAME
+	_ZThn24_N19CPhoneStateIncomingD1Ev @ 375 NONAME
+	_ZThn24_N20CPhoneStateCallSetupD0Ev @ 376 NONAME
+	_ZThn24_N20CPhoneStateCallSetupD1Ev @ 377 NONAME
+	_ZThn28_NK11CPhoneState17GetBlockedKeyListEv @ 378 NONAME
+	_ZThn32_N11CPhoneState25HandleNumberEntryClearedLEv @ 379 NONAME
+	_ZThn32_N15CPhoneStateIdle25HandleNumberEntryClearedLEv @ 380 NONAME
+	_ZThn32_N17CPhoneStateInCall25HandleNumberEntryClearedLEv @ 381 NONAME
+	_ZThn32_N19CPhoneStateIncoming25HandleNumberEntryClearedLEv @ 382 NONAME
+	_ZThn32_N20CPhoneStateCallSetup25HandleNumberEntryClearedLEv @ 383 NONAME
+	_ZThn36_N11CPhoneState23HandleNumberEntryEditedEv @ 384 NONAME
+	_ZThn36_N11CPhoneStateD0Ev @ 385 NONAME
+	_ZThn36_N11CPhoneStateD1Ev @ 386 NONAME
+	_ZThn36_N15CPhoneStateIdleD0Ev @ 387 NONAME
+	_ZThn36_N15CPhoneStateIdleD1Ev @ 388 NONAME
+	_ZThn36_N17CPhoneStateInCallD0Ev @ 389 NONAME
+	_ZThn36_N17CPhoneStateInCallD1Ev @ 390 NONAME
+	_ZThn36_N18CPhoneStateStartupD0Ev @ 391 NONAME
+	_ZThn36_N18CPhoneStateStartupD1Ev @ 392 NONAME
+	_ZThn36_N19CPhoneStateIncomingD0Ev @ 393 NONAME
+	_ZThn36_N19CPhoneStateIncomingD1Ev @ 394 NONAME
+	_ZThn36_N20CPhoneStateCallSetupD0Ev @ 395 NONAME
+	_ZThn36_N20CPhoneStateCallSetupD1Ev @ 396 NONAME
+	_ZThn40_NK11CPhoneState11IsKeyLockOnEv @ 397 NONAME
+	_ZThn40_NK11CPhoneState12IsAutoLockOnEv @ 398 NONAME
+	_ZThn4_N11CPhoneState12HandleErrorLERK12TPEErrorInfo @ 399 NONAME
+	_ZThn4_N11CPhoneState25HandlePhoneEngineMessageLEii @ 400 NONAME
+	_ZThn4_N11CPhoneStateD0Ev @ 401 NONAME
+	_ZThn4_N11CPhoneStateD1Ev @ 402 NONAME
+	_ZThn4_N15CPhoneStateIdle25HandlePhoneEngineMessageLEii @ 403 NONAME
+	_ZThn4_N15CPhoneStateIdleD0Ev @ 404 NONAME
+	_ZThn4_N15CPhoneStateIdleD1Ev @ 405 NONAME
+	_ZThn4_N17CPhoneStateInCall25HandlePhoneEngineMessageLEii @ 406 NONAME
+	_ZThn4_N17CPhoneStateInCallD0Ev @ 407 NONAME
+	_ZThn4_N17CPhoneStateInCallD1Ev @ 408 NONAME
+	_ZThn4_N18CPhoneStateMachine11ChangeStateEi @ 409 NONAME
+	_ZThn4_N18CPhoneStateMachine11PhoneEngineEv @ 410 NONAME
+	_ZThn4_N18CPhoneStateMachine12PhoneStorageEv @ 411 NONAME
+	_ZThn4_N18CPhoneStateMachine14SetPhoneEngineEP13MPEPhoneModel @ 412 NONAME
+	_ZThn4_N18CPhoneStateMachine15PhoneEngineInfoEv @ 413 NONAME
+	_ZThn4_N18CPhoneStateMachine18CreatePhoneEngineLER14MEngineMonitor @ 414 NONAME
+	_ZThn4_N18CPhoneStateMachine22SendPhoneEngineMessageEi @ 415 NONAME
+	_ZThn4_N18CPhoneStateMachine5StateEv @ 416 NONAME
+	_ZThn4_N18CPhoneStateMachine9SetCallIdEi @ 417 NONAME
+	_ZThn4_N18CPhoneStateMachineD0Ev @ 418 NONAME
+	_ZThn4_N18CPhoneStateMachineD1Ev @ 419 NONAME
+	_ZThn4_N18CPhoneStateStartup25HandlePhoneEngineMessageLEii @ 420 NONAME
+	_ZThn4_N18CPhoneStateStartupD0Ev @ 421 NONAME
+	_ZThn4_N18CPhoneStateStartupD1Ev @ 422 NONAME
+	_ZThn4_N18CPhoneUIController11HandleErrorERK12TPEErrorInfo @ 423 NONAME
+	_ZThn4_N18CPhoneUIController13HandleMessageEii @ 424 NONAME
+	_ZThn4_N19CPhoneStateIncoming25HandlePhoneEngineMessageLEii @ 425 NONAME
+	_ZThn4_N19CPhoneStateIncomingD0Ev @ 426 NONAME
+	_ZThn4_N19CPhoneStateIncomingD1Ev @ 427 NONAME
+	_ZThn4_N20CPhoneStateCallSetup25HandlePhoneEngineMessageLEii @ 428 NONAME
+	_ZThn4_N20CPhoneStateCallSetupD0Ev @ 429 NONAME
+	_ZThn4_N20CPhoneStateCallSetupD1Ev @ 430 NONAME
+	_ZThn8_N11CPhoneState14IsNoteVisibleLEv @ 431 NONAME
+	_ZThn8_N11CPhoneState15HandleKeyEventLERK9TKeyEvent10TEventCode @ 432 NONAME
+	_ZThn8_N11CPhoneState15HandleLongHashLEv @ 433 NONAME
+	_ZThn8_N11CPhoneState17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 434 NONAME
+	_ZThn8_N11CPhoneState18HandleDtmfKeyToneLERK9TKeyEvent10TEventCode @ 435 NONAME
+	_ZThn8_N11CPhoneState23HandleKeyPressDurationLE8TKeyCode25TTimeIntervalMicroSeconds @ 436 NONAME
+	_ZThn8_N11CPhoneState24HandleCreateNumberEntryLERK9TKeyEvent10TEventCode @ 437 NONAME
+	_ZThn8_N11CPhoneState35IsAlphanumericSupportedAndCharInputERK9TKeyEvent @ 438 NONAME
+	_ZThn8_N11CPhoneStateD0Ev @ 439 NONAME
+	_ZThn8_N11CPhoneStateD1Ev @ 440 NONAME
+	_ZThn8_N15CPhoneStateIdle15HandleKeyEventLERK9TKeyEvent10TEventCode @ 441 NONAME
+	_ZThn8_N15CPhoneStateIdle17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 442 NONAME
+	_ZThn8_N15CPhoneStateIdleD0Ev @ 443 NONAME
+	_ZThn8_N15CPhoneStateIdleD1Ev @ 444 NONAME
+	_ZThn8_N17CPhoneStateInCall17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 445 NONAME
+	_ZThn8_N17CPhoneStateInCallD0Ev @ 446 NONAME
+	_ZThn8_N17CPhoneStateInCallD1Ev @ 447 NONAME
+	_ZThn8_N18CPhoneStateStartup15HandleKeyEventLERK9TKeyEvent10TEventCode @ 448 NONAME
+	_ZThn8_N18CPhoneStateStartup17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 449 NONAME
+	_ZThn8_N18CPhoneStateStartup18HandleDtmfKeyToneLERK9TKeyEvent10TEventCode @ 450 NONAME
+	_ZThn8_N18CPhoneStateStartup24HandleCreateNumberEntryLERK9TKeyEvent10TEventCode @ 451 NONAME
+	_ZThn8_N18CPhoneStateStartupD0Ev @ 452 NONAME
+	_ZThn8_N18CPhoneStateStartupD1Ev @ 453 NONAME
+	_ZThn8_N18CPhoneUIController15HandleKeyEventLERK9TKeyEvent10TEventCode @ 454 NONAME
+	_ZThn8_N18CPhoneUIControllerD0Ev @ 455 NONAME
+	_ZThn8_N18CPhoneUIControllerD1Ev @ 456 NONAME
+	_ZThn8_N19CPhoneStateIncoming15HandleKeyEventLERK9TKeyEvent10TEventCode @ 457 NONAME
+	_ZThn8_N19CPhoneStateIncoming17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 458 NONAME
+	_ZThn8_N19CPhoneStateIncoming23HandleKeyPressDurationLE8TKeyCode25TTimeIntervalMicroSeconds @ 459 NONAME
+	_ZThn8_N19CPhoneStateIncomingD0Ev @ 460 NONAME
+	_ZThn8_N19CPhoneStateIncomingD1Ev @ 461 NONAME
+	_ZThn8_N20CPhoneStateCallSetup15HandleKeyEventLERK9TKeyEvent10TEventCode @ 462 NONAME
+	_ZThn8_N20CPhoneStateCallSetup17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 463 NONAME
+	_ZThn8_N20CPhoneStateCallSetup24HandleCreateNumberEntryLERK9TKeyEvent10TEventCode @ 464 NONAME
+	_ZThn8_N20CPhoneStateCallSetupD0Ev @ 465 NONAME
+	_ZThn8_N20CPhoneStateCallSetupD1Ev @ 466 NONAME
+	_ZThn8_NK11CPhoneState17IsMenuBarVisibleLEv @ 467 NONAME
+	_ZN11CPhoneState17SetToolbarDimmingEi @ 468 NONAME
+	_ZN11CPhoneState34SetToolbarButtonLoudspeakerEnabledEv @ 469 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  UIControl subcomponent of PhoneUI
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+// Capability assignment.
+CAPABILITY CAP_APPLICATION MultiMediaDD NetworkControl PowerMgmt DRM DiskAdmin
+
+// 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
+USERINCLUDE     ../../phoneuiview/inc
+USERINCLUDE     ../../phoneuiutils/inc
+USERINCLUDE     ../../phoneui/srcdata
+USERINCLUDE     ../../phoneuistates/inc
+USERINCLUDE     ../../phonemediatorcenter/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
+LIBRARY         commonengine.lib //StringLoader 
+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
+LIBRARY         sendui.lib // CMessageData
+
+// 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,192 @@
+/*
+* 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 <bmbubblemanager.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( 
+                const CBubbleManager::TPhoneCallTypeFlags aCallHeaderType );
+        
+        /**
+        * Returns the set call header type.
+        */
+        CBubbleManager::TPhoneCallTypeFlags 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,1185 @@
+/*
+* 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 <bmbubblemanager.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( const CBubbleManager::TPhoneCallTypeFlags 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();
+
+    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();
+
+    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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,137 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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
+        */
+        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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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 OpenSoftRejectMessageEditorL();
+
+        /**
+        * 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,155 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,143 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,245 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*   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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,259 @@
+/*
+* 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    <bmbubblemanager.h>
+
+#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( 
+                const CBubbleManager::TPhoneCallTypeFlags aCallHeaderType );
+        /**
+        * Returns the set call header type. Used for constructing right type
+        * of call bubble.
+        */
+        CBubbleManager::TPhoneCallTypeFlags 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, 
+               CBubbleManager::TPhoneClippingDirection& 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;
+        CBubbleManager::TPhoneCallTypeFlags iCallHeaderType;
+        TBool iSetDivertIndication;
+            
+    };
+
+#endif // TPHONECALLHEADERPARAM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphoneaccessorybthandler.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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( 
+    const CBubbleManager::TPhoneCallTypeFlags aCallHeaderType )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneCallHeaderManager::SetCallHeaderType() ");
+    iCallHeaderParam->SetCallHeaderType( aCallHeaderType ); 
+    }
+
+// ---------------------------------------------------------------------------
+//  CPhoneCallHeaderManager::~CPhoneCallHeaderManager
+// ---------------------------------------------------------------------------
+//
+CBubbleManager::TPhoneCallTypeFlags 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,491 @@
+/*
+* 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 <callhandlingui.rsg>
+
+#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 = EPhoneCallHandlingIncomingSoftRejectCBA;
+    
+    //Get incoming call touchpane button set
+    TPhoneCmdParamInteger touchpaneButtonsParam;
+    touchpaneButtonsParam.SetInteger( CPhoneMainResourceResolver::Instance()->
+                             ResolveResourceID( EPhoneIncomingCallButtons ) );
+
+    if ( touchpaneButtonsParam.Integer() 
+         == R_PHONEUI_INCOMING_CALL_SILENCE_BUTTONS )
+        {
+        aSoftRejectActivated ? 
+        ret = EPhoneCallHandlingIncomingSoftRejectCBA:
+        ret = EPhoneCallHandlingIncomingRejectCBA;
+        }
+    else
+        {
+        // Check if the ringtone has been silenced. If it is, then show
+        // "Send Message" in RSK, else show "Silence".
+        iRingtoneSilenced ?
+            ret = EPhoneCallHandlingIncomingSoftRejectCBA :
+            ret = EPhoneCallHandlingIncomingCBA;
+        }
+
+    // reset the iRingtoneSilence so it won't cause any problems with
+    // next calls.
+    SetRingtoneSilencedStatus( EFalse );
+
+    return ret;
+    }
+
+// ======== LOCAL FUNCTIONS ========
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphonedtmfwaitchartimer.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,578 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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"
+
+// CONSTANTS
+
+//Avkon P&S keys
+const TUid KCRUidAvkon = { 0x101F876E };
+const TUint32 KAknKeyBoardLayout = 0x0000000B;
+
+// ============================ 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( CPhonePubSubProxy::Instance()->Value(
+          KCRUidAvkon,
+          KAknKeyBoardLayout ) );
+
+    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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,525 @@
+/*
+* 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 <activeidle2domainpskeys.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 = CPhonePubSubProxy::Instance()->Value( KPSUidAiInformation, KActiveIdleState );
+    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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,195 @@
+/*
+* 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 <mcauireconnectqueryobserver.h>
+#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 "tphonecmdparammessageeditor.h"
+#include "tphonecmdparamreconnectquery.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( ) ");
+
+    TPhoneCmdParamReconnectQuery reconQueryParam( *this );
+    // Recipient number to CallUIs reconnect query in case message selected
+    TPtrC phoneNumber( CPhoneStateHandle::Instance()->StateMachine()->
+        PhoneEngineInfo()->PhoneNumber() );
+    reconQueryParam.SetPhoneNumber( phoneNumber );
+    reconQueryParam.SetIncludeVideoOption( iIncludeVideo );
+    // Display reconnect query
+    CPhoneStateHandle::Instance()->ViewCommandHandle()->
+        ExecuteCommandL( EPhoneViewShowQuery, &reconQueryParam );
+    iDisplayingQuery = ETrue;
+    }
+
+// -----------------------------------------------------------
+// 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,194 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,4946 @@
+/*
+* 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 <cphcntprofileengine.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 <activeidle2domainpskeys.h>
+#include <coreapplicationuisdomainpskeys.h>
+#include <mccecall.h>
+#include <ccpdefs.h>
+#include <LogsDomainCRKeys.h>
+#include <spsettings.h>
+#include <ScreensaverInternalPSKeys.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 "tphonecmdparammessageeditor.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 "mphonestorage.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() )
+        {
+        if( IsKeyEventFurtherProcessedL( aKeyEvent ))
+            {
+            // 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 )
+                {                
+                // Complete sat request
+                if ( iStateMachine->PhoneEngineInfo()->CallOrigin( aErrorInfo.iCallId ) == EPECallOriginSAT )
+                    {
+                    CompleteSatRequestL( aErrorInfo.iCallId );
+                    }
+                }
+
+            // 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
+    TTime time( 0 );
+    TTimeIntervalSeconds timeInterval =
+        iStateMachine->PhoneEngineInfo()->CallDuration( aCallId );
+    time += timeInterval;
+
+    // Read format string from AVKON resource
+    TBuf<KPhoneMaxCharsInNote> timeDurationFormatString( KNullDesC );
+    LoadResource( timeDurationFormatString, EPhoneCallDurationFormatString );
+
+    // Format the time
+    TBuf<KPhoneMaxTimeDisplayTextLength> timeString( KNullDesC );
+    time.FormatL( timeString, timeDurationFormatString );
+
+    // Localize time format
+    AknTextUtils::LanguageSpecificNumberConversion( timeString );
+
+    // update the call header call duration
+    iViewCommandHandle->ExecuteCommandL(
+        EPhoneViewUpdateCallHeaderCallDuration,
+        aCallId,
+        timeString );
+    }
+
+// -----------------------------------------------------------------------------
+// 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 );
+        }
+    else
+        {        
+        // Complete sat request
+        if ( iStateMachine->PhoneEngineInfo()->CallOrigin( aCallId ) == EPECallOriginSAT )
+            {
+            CompleteSatRequestL( aCallId );
+            }
+        }
+    }
+
+// -----------------------------------------------------------
+// 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->Des() );
+            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()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandlePhoneForegroundEventL( ) ");
+
+    // Force Idle to the foreground if a foreground event is received,
+    // but Idle is the top application
+
+    const TBool idleIsTopApp = iViewCommandHandle->HandleCommandL(
+        EPhoneViewIsIdleTopApp ) ==
+        EPhoneViewResponseSuccess ;
+
+    if ( !IsOnScreenDialerSupported() && idleIsTopApp )
+        {
+        TBool activatePhone = CPhonePubSubProxy::Instance()->Value(
+            KPSUidAiInformation, KActiveIdleState ) == EPSAiNumberEntry;
+        if ( activatePhone )
+            {
+            // Set Phone as the top application
+            TPhoneCmdParamInteger uidParam;
+            uidParam.SetInteger( KUidPhoneApplication.iUid );
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
+                &uidParam );
+            NumberEntryManagerL()->CreateNumberEntryL();
+            SetNumberEntryVisibilityL(ETrue);
+            }
+
+        else
+            {
+            TPhoneCmdParamBoolean isSecurityMode;
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
+
+            if ( !isSecurityMode.Boolean() )
+                {
+                __PHONELOG( EBasic, EPhoneControl,
+                  "CPhoneState::HandlePhoneForegroundEventL - Force Idle to the foreground" );
+                // Bring Idle app to the foreground
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground );
+                }
+            }
+        }
+
+     }
+
+// -----------------------------------------------------------
+// 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;
+
+        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 );
+        }
+    else
+        {
+        CAknKeySoundSystem* keySounds =
+            static_cast<CAknAppUi*>( iEnv.EikAppUi() )
+                ->KeySounds();
+
+        if ( aLevel < KPhoneVolumeMinValue )
+            {
+            // Set the volume value to volume control
+            valueToControl = KPhoneVolumeMinValue;
+            keySounds->PlaySound( EAvkonSIDVolumeMinTone );
+            }
+        else // aLevel > KPhoneVolumeMaxValue
+            {
+            // Set the volume value to volume control
+            valueToControl = KPhoneVolumeMaxValue;
+            keySounds->PlaySound( EAvkonSIDVolumeMaxTone );
+            }
+        }
+
+    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( ) ");
+    // Fetch active call's id from view
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateConnected );
+    iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+
+    if( callStateData.CallId() == KErrNotFound )
+        {
+        // No connected call, find the hold call
+        callStateData.SetCallState( EPEStateHeld );
+        iViewCommandHandle->HandleCommandL(
+            EPhoneViewGetCallIdByState, &callStateData );
+
+        if( callStateData.CallId() == KErrNotFound )
+            {
+            // No hold call, find the dialing call
+            callStateData.SetCallState( EPEStateDialing );
+            iViewCommandHandle->HandleCommandL(
+                EPhoneViewGetCallIdByState, &callStateData );
+            }
+
+        if( callStateData.CallId() == KErrNotFound )
+            {
+            // No dialing call, find the outgoing call
+            callStateData.SetCallState( EPEStateConnecting );
+            iViewCommandHandle->HandleCommandL(
+                EPhoneViewGetCallIdByState, &callStateData );
+            }
+
+        if( callStateData.CallId() == KErrNotFound )
+            {
+            // No active call, find the disconnectinging call
+            callStateData.SetCallState( EPEStateDisconnecting );
+            iViewCommandHandle->HandleCommandL(
+                EPhoneViewGetCallIdByState, &callStateData );
+            }
+        }
+
+    TBool ret = EFalse;
+    if( callStateData.CallId() > KErrNotFound )
+        {
+        // Release the call
+        iStateMachine->SetCallId( callStateData.CallId() );
+        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,
+                                                                       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
+    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() )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
+        // 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( ) ");
+
+    if ( AknLayoutUtils::PenEnabled() )
+        {
+        //Capture pointer events
+        TPhoneCmdParamBoolean booleanParam;
+        booleanParam.SetBoolean( aCaptured );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetPointerCapture, &booleanParam );
+        }
+
+    // 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(
+    const CBubbleManager::TPhoneCallTypeFlags 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()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateProfileDisplayL( ) ");
+    // Get the profile information
+    const TInt profileId =
+        iStateMachine->PhoneEngineInfo()->ProfileId();
+    TPEProfileName profileName =
+        iStateMachine->PhoneEngineInfo()->ProfileName();
+
+    HBufC* profileString = HBufC::NewLC( profileName.Length() +
+        KPhoneMaxDateDisplayTextLength );
+
+    TPtr profileNameBuf = profileString->Des();
+    profileNameBuf.Zero();
+    profileNameBuf.Append( profileName );
+
+    if ( ( profileId == EProfileGeneralId ) ||
+        ( profileId == EProfileOffLineId ) )
+        {
+        // Show date instead of profile name on navi pane
+        HBufC* buffer = HBufC::NewLC( KPhoneMaxDateDisplayTextLength );
+        TPtr dateString( buffer->Des() );
+
+        TTime time;
+        time.HomeTime();
+
+        // Get date string
+        CCoeEnv* coeEnv = CCoeEnv::Static();
+
+        HBufC* dateFormatString =
+            StringLoader::LoadLC( R_QTN_DATE_USUAL_WITH_ZERO, coeEnv );
+        time.FormatL( dateString, *dateFormatString );
+        CleanupStack::PopAndDestroy( dateFormatString );
+
+        // To arabic
+        AknTextUtils::DisplayTextLanguageSpecificNumberConversion(
+            dateString );
+
+        //Get week day abbreviation
+        TDayNameAbb wkDayAbb = TDayNameAbb();
+        wkDayAbb.Set(time.DayNoInWeek());
+
+        //Get time format string
+        HBufC* timeFormat = StringLoader::LoadLC(
+            CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneIdleTimeFormat ),
+            coeEnv );
+
+        //Set date and weekdays to time format
+        profileNameBuf.Zero();
+
+        StringLoader::Format(
+            profileNameBuf,
+            *timeFormat,
+            1, // date
+            dateString );
+
+        dateString.Copy( profileNameBuf );
+
+        StringLoader::Format(
+            profileNameBuf,
+            dateString,
+            0, // weekday
+            wkDayAbb );
+
+        CleanupStack::PopAndDestroy( timeFormat );
+        CleanupStack::PopAndDestroy( buffer );
+        }
+
+    // Set silence indicator based on the ringing profile
+    const TProfileRingingType ringingType =
+        iStateMachine->PhoneEngineInfo()->RingingType();
+    if ( ringingType == EProfileRingingTypeSilent )
+        {
+        TBuf< 1 > silent;
+        silent.Append( KPuaCodeSilentSymbol );
+        profileNameBuf.Insert( 0, silent );
+        }
+
+    // Update the profile display on the navi pane
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNaviPaneContent, 0,
+        profileNameBuf );
+
+    if ( profileId == EProfileOffLineId )
+        {
+        iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewSetTitlePaneContent,
+            0,
+            profileName );
+        }
+    else
+        {
+        UpdateOperatorDisplayL();
+        }
+
+    CleanupStack::PopAndDestroy( profileString );
+    }
+
+// -----------------------------------------------------------
+// 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( ) ");
+
+    if ( IsOnScreenDialerSupported() )
+        {
+        NumberEntryClearL();
+        }
+    else
+        {
+        // Remove number entry from screen
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        }
+
+    // Fetch IMEI
+    TBuf<RMobilePhone::KPhoneSerialNumberSize> serialNumber;
+    TPEPhoneIdentityParameters phoneIdentityParameters = iStateMachine->
+        PhoneEngineInfo()->PhoneIdentityParameters();
+    serialNumber = phoneIdentityParameters.iSerialNumber;
+
+    // Add it to the resource string
+    HBufC* buf = StringLoader::LoadLC(
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID(
+        EPhonePhoneImeiString ), serialNumber );
+
+    TPhoneCmdParamNote noteParam;
+    noteParam.SetType( EPhoneNoteCustom );
+    noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( EPhoneInformationWaitNote ) );
+    noteParam.SetText( *buf );
+
+    // Display note
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, &noteParam );
+
+    CleanupStack::PopAndDestroy( buf );
+    }
+
+// -----------------------------------------------------------
+// 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( ) ");
+    if ( IsOnScreenDialerSupported() )
+        {
+        NumberEntryClearL();
+        }
+    else
+        {
+        // Remove number entry from screen
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        }
+
+    // Fetch LifeTime
+    TPELifeTimeData lifeTimeData = iStateMachine->
+        PhoneEngineInfo()->LifeTimerData();
+
+    TLocale locale;
+    TBuf<KTimerTextLength> lifetimerText;
+    lifetimerText.NumFixedWidth(
+        lifeTimeData.iHours,
+        EDecimal,
+        KPhoneLifeTimerHoursLength );
+
+    lifetimerText.Append(locale.TimeSeparator( KTimerMinuteSeparator ) );   // minute seperator
+
+    TBuf<KPhoneLifeTimerMinutesLength> mins;
+    mins.NumFixedWidth(
+        lifeTimeData.iMinutes,
+        EDecimal,
+        KPhoneLifeTimerMinutesLength );
+
+    lifetimerText.Append(mins);
+
+    // Add it to the resource string
+    HBufC* buf = StringLoader::LoadLC(
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID(
+        EPhoneLifeTimeFormat ), lifetimerText );
+    TPhoneCmdParamNote noteParam;
+    noteParam.SetType( EPhoneNoteCustom );
+    noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( EPhoneInformationWaitNote ) );
+    noteParam.SetText( *buf );
+
+    // Display note
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, &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 ) )
+        {
+        TPhoneCmdParamInteger integerParam;
+        integerParam.SetInteger( CPhoneMainResourceResolver::Instance()->
+                                 ResolveResourceID( aResourceId ) );
+        TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL(
+                     EPhoneViewSetTouchPaneButtons,
+                     &integerParam ) );
+
+        SetTouchPaneVisible( ETrue );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::DeleteTouchPaneButtons
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::DeleteTouchPaneButtons()
+    {
+    if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        {
+        TPhoneCmdParamInteger integerParam;
+        integerParam.SetInteger( 0 );
+        TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL(
+                        EPhoneViewSetTouchPaneButtons,
+                        &integerParam ) );
+
+        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 );
+        }
+    
+    CPhonePubSubProxy::Instance()->ChangePropertyValue(
+                    KPSUidScreenSaver,
+                    KScreenSaverAllowScreenSaver,
+                    EPhoneScreensaverAllowed );
+
+    // 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 ));
+        }
+    }
+
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphonestatecallsetup.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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 <ScreensaverInternalPSKeys.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();
+     
+    CPhonePubSubProxy::Instance()->ChangePropertyValue(
+                    KPSUidScreenSaver,
+                    KScreenSaverAllowScreenSaver,
+                    EPhoneScreensaverNotAllowed );
+    }
+
+// -----------------------------------------------------------
+// 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 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;
+                                   
+        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 );
+        
+    // Complete sat request
+    if ( iStateMachine->PhoneEngineInfo()->CallOrigin( aCallId ) == EPECallOriginSAT )
+        {
+        CompleteSatRequestL( 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,183 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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
+// ---------------------------------------------------------
+//
+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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,1438 @@
+/*
+* 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 <ScreensaverInternalPSKeys.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 "phoneconstants.h"
+#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 );
+    
+    CPhonePubSubProxy::Instance()->ChangePropertyValue(
+        KPSUidScreenSaver,
+        KScreenSaverAllowScreenSaver,
+        EPhoneScreensaverNotAllowed );
+    
+    BeginTransEffectLC( ENumberEntryClose );
+    BeginUiUpdateLC();
+    
+    // Hide the number entry if it exists
+    if ( IsNumberEntryUsedL() )
+        {
+        SetNumberEntryVisibilityL(EFalse);    
+        }
+     
+    // Close fast swap window if it's displayed
+    CEikonEnv::Static()->DismissTaskList();
+
+    // Show incoming call buttons
+    SetTouchPaneButtons( EPhoneIncomingCallButtons );
+    SetTouchPaneButtonEnabled( EPhoneCallComingCmdSilent );
+    
+    // Display incoming call
+    DisplayIncomingCallL( aCallId );
+
+    // Disable HW keys and Call UI if needed
+    CheckDisableHWKeysAndCallUIL();
+    
+    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);
+
+    // Show call setup buttons
+    SetTouchPaneButtons( EPhoneCallSetupButtons );
+
+    // Display call setup 
+    DisplayCallSetupL( aCallId );            
+    
+    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()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandlePhoneForegroundEventL( ) ");
+    
+    TPhoneCmdParamBoolean isSecurityMode;      
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
+
+    TBool activatePhone = CPhonePubSubProxy::Instance()->Value(
+                    KPSUidAiInformation, KActiveIdleState ) == EPSAiNumberEntry;
+    
+    if ( activatePhone )
+        {
+        // If activatePhone is true then user has pressed some numeric
+        // key and icon must be set to FSW. In this case number entry is not yet open so it
+        // it is not enough to call EPhoneViewUpdateFSW.
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdatePhoneIconToFSW );
+        }
+    // If number entry is used update FSW accordingly.
+    else 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 );
+            }
+        
+        // If dialer is open add icon to FSW list.
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW );
+        }
+    else if ( !IsNumberEntryUsedL() && !isSecurityMode.Boolean() )
+        {
+        // Bring Idle app to the foreground
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground );
+		}
+    }
+
+// -----------------------------------------------------------
+// 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();  
+    }
+
+// -----------------------------------------------------------
+// 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,1593 @@
+/*
+* 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 "tphonecmdparamsingleitemfetch.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:
+            BeginTransEffectLC( ENumberEntryCreate );
+            if ( !IsNumberEntryUsedL() )
+                {
+                CreateNumberEntryL();
+                }
+            SetNumberEntryVisibilityL(ETrue ); 
+            EndTransEffect();
+          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	Mon Jan 18 20:18:27 2010 +0200
@@ -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 <ScreensaverInternalPSKeys.h>
+#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 );
+            
+    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();
+    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
+            OpenSoftRejectMessageEditorL();
+            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::OpenSoftRejectMessageEditorL()
+    {
+    __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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,413 @@
+/*
+* 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 );
+    // Create the key event forwarder
+    iKeyEventForwarder = CPhoneKeyEventForwarder::NewL( 
+        CEikonEnv::Static()->EikAppUi()->ClientRect(), iStateMachine, aViewCommandHandle );
+
+    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; <-- CCoeStatic objects are destroyed outside application
+    }
+
+// ---------------------------------------------------------
+// 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 )
+    {
+    __ASSERT_DEBUG( iKeyEventForwarder, Panic( EPhoneCtrlInvariant ) );
+    return iKeyEventForwarder->OfferKeyEventAfterControlStackL( 
+                aKeyEvent,
+                aEventCode );
+    }
+
+// ---------------------------------------------------------
+// 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,770 @@
+/*
+* 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 ( CBubbleManager::ENormal ),
+          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 ),
+                CBubbleManager::ELeft );
+            
+        // No contact name, use phonenumber when available.
+        aCallHeaderData->SetParticipantListCLI(
+                TPhoneCmdParamCallHeaderData::EPhoneParticipantCNAPText );
+        }
+    else
+        {
+        CBubbleManager::TPhoneClippingDirection cnapClippingDirection = CBubbleManager::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 = CBubbleManager::ELeft;
+            }
+        
+        // Set remote info data as the CLI text for the call header 
+        aCallHeaderData->SetCLIText( remoteInfoText, CBubbleManager::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 ) );
+    aCallHeaderData->SetCallFlag( CallHeaderType() );
+    
+    // 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 );
+    switch ( callType )
+       {
+       case EPECallTypeCSVoice:
+           {
+           if ( iStateMachine.PhoneEngineInfo()->CallALSLine( aCallId ) 
+                == CCCECallParameters::ECCELineTypeAux )
+               {
+               SetCallHeaderType( CBubbleManager::ELine2 );
+               aCallHeaderData->SetLine2( ETrue );
+               }
+           else
+               {
+               SetCallHeaderType( CBubbleManager::ENormal );
+               }
+           }
+           break;
+       case EPECallTypeVideo:
+           SetCallHeaderType( CBubbleManager::EVideo );
+           break;
+       case EPECallTypeVoIP:
+           SetCallHeaderType( CBubbleManager::EVoIPCall );
+           break;
+         default:
+           // None
+           break;     
+       }
+    __PHONELOG1( EBasic, EPhoneControl, 
+                "TPhoneCallHeaderParam::GetCallType() - callType: %d ", 
+                callType )
+    return callType;
+    }
+
+// ---------------------------------------------------------------------------
+//  TPhoneCallHeaderParam::SetCallHeaderType
+// ---------------------------------------------------------------------------
+//
+void TPhoneCallHeaderParam::SetCallHeaderType( 
+    const CBubbleManager::TPhoneCallTypeFlags aCallHeaderType )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetCallHeaderType( ) ");
+    iCallHeaderType = aCallHeaderType;
+    __PHONELOG1( EBasic, EPhoneControl, 
+                    "TPhoneCallHeaderParam::SetCallHeaderType() - iCallHeaderType: %d ", 
+                    iCallHeaderType )
+    }
+
+// ---------------------------------------------------------------------------
+//  TPhoneCallHeaderParam::CallHeaderType
+// ---------------------------------------------------------------------------
+//
+CBubbleManager::TPhoneCallTypeFlags 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 ),
+                CBubbleManager::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 );
+            }
+        
+        // Set remote info data as the CLI text for the call header
+        aCallHeaderData->SetCLIText( remoteInfoText, CBubbleManager::ERight );
+        }
+
+    // Fetch CNAP text and clipping direction
+    CBubbleManager::TPhoneClippingDirection 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 ), 
+                CBubbleManager::ERight );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  TPhoneCallHeaderParam::GetCNAPText
+// ---------------------------------------------------------------------------
+//
+void TPhoneCallHeaderParam::GetCNAPText( 
+       const TInt aCallId,
+       TDes& aData, 
+       CBubbleManager::TPhoneClippingDirection& aDirection ) const
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::GetCNAPText( ) ");
+    
+    // Set clipping direction  
+    aDirection = CBubbleManager::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 = CBubbleManager::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->AddCallFlag( CBubbleManager::EDiverted );
+        }
+    
+    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 );
+    aCallHeaderData->SetCallFlag( CallHeaderType() );
+    
+    // Set CLI text for the call header
+    GetRemoteInfoDataL( aCallId, remoteInfoText );
+    if ( remoteInfoText != KNullDesC )
+        {
+        aCallHeaderData->SetCLIText( remoteInfoText, CBubbleManager::ERight );
+        if ( IsCallPrivateOrPayPhone( aCallId, remoteInfoText ) )
+            {
+            aCallHeaderData->SetCNAPText( remoteInfoText, CBubbleManager::ERight );
+            }
+        else
+            {
+            aCallHeaderData->SetCNAPText( iStateMachine.PhoneEngineInfo()->
+                RemotePhoneNumber( aCallId ), CBubbleManager::ELeft );       
+            }
+        }
+    else
+        {
+        aCallHeaderData->SetCLIText( 
+            iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ),
+            CBubbleManager::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, CBubbleManager::ERight );
+            }
+        else
+            {
+            aCallHeaderData->SetCLIText( remotePartyName, CBubbleManager::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() == CBubbleManager::EVoIPCall ) )
+            {
+            // 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/phoneuistates/bwins/phoneuistatesu.def	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*   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.
+CAPABILITY CAP_APPLICATION MultiMediaDD PowerMgmt NetworkControl DRM DiskAdmin
+
+// 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
+USERINCLUDE     ../../phoneuiview/inc
+USERINCLUDE     ../../phoneui/inc
+USERINCLUDE     ../../phoneuiutils/inc
+USERINCLUDE     ../../phoneui/srcdata
+USERINCLUDE     ../../phonemediatorcenter/inc
+
+APP_LAYER_SYSTEMINCLUDE         // Application layer domain APIs
+SYSTEMINCLUDE   ../../../inc    // Telephony internal headers
+
+LIBRARY         avkon.lib // AknTextUtils
+LIBRARY         bafl.lib
+LIBRARY         commonengine.lib //StringLoader 
+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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,110 @@
+/*
+* 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 );
+        
+    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 );
+      
+     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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphoneidle.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,178 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 );
+        
+    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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*       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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,120 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 ); 
+        
+    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();
+        
+        // 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*   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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,391 @@
+/*
+* 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 <videotelcontrolmediatorapi.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()" );
+    
+    if ( iStateMachine->PhoneEngineInfo()->CallOrigin( aCallId ) == EPECallOriginSAT )
+        {
+        // User has hangup alerting SAT call, complete sat request
+        CompleteSatRequestL( aCallId );
+        }
+    
+    CPhoneGsmInCall::HandleDisconnectingL( aCallId );
+    }
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphonecallsetup.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,190 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <videotelcontrolmediatorapi.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 );
+
+    // 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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 <videotelcontrolmediatorapi.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() );
+        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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,1129 @@
+/*
+* 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()
+    {
+    if ( iViewCommandHandle->HandleCommandL( EPhoneViewIsConferenceInExpandedMode ) 
+        != EPhoneViewResponseSuccess )
+        {
+        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( 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
+    SetHoldFlagL();
+    
+    if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        {
+        SendGlobalInfoNoteL( EPhoneInformationConferenceOnHold );
+        }
+    
+    SetTouchPaneButtonDisabled( EPhoneInCallCmdPrivate );
+    
+    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( EPEStateConnected );
+
+    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 );
+    
+    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();
+    
+    SetTouchPaneButtons( EPhoneWaitingCallButtons );
+    
+    // Display incoming call
+    DisplayIncomingCallL( aCallId, dialerParam );
+
+    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	Mon Jan 18 20:18:27 2010 +0200
@@ -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->ExecuteCommandL( 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,656 @@
+/*
+* 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->ExecuteCommandL( 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( EPEStateConnected );
+
+    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( EPEStateHeld );
+    
+    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 );
+    
+    }
+
+// -----------------------------------------------------------
+// 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 );        
+    }
+
+// -----------------------------------------------------------
+// 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 );
+    
+    // Set touch controls
+    SetTouchPaneButtonDisabled( EPhoneCallComingCmdAnswer );
+
+    // Check if HW Keys or Call UI should be disabled
+    CheckDisableHWKeysAndCallUIL();
+
+    SetTouchPaneButtons( EPhoneWaitingCallButtons );
+        
+    // Display incoming call
+    DisplayIncomingCallL( aCallId, dialerParam  );
+
+    EndUiUpdate();
+
+    TPhoneCmdParamBoolean conferenceAndSingleFlag;
+    conferenceAndSingleFlag.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetConferenceAndSingleFlag, 
+    	&conferenceAndSingleFlag );
+    
+    // Go to Conference And Single And Waiting state
+    UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+    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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,541 @@
+/*
+* 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->ExecuteCommandL( 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 );
+                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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,628 @@
+/*
+* 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;
+
+        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( 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 );
+    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 );
+            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();
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphoneconferenceandwaitingandcallsetup.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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->ExecuteCommandL( 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,1001 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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"
+
+// ================= 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 );
+
+        SetTouchPaneButtons( EPhoneEmergencyCallButtons );
+
+        SetToolbarDimming( ETrue );
+
+        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 );
+
+    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() );
+
+    BeginUiUpdateLC();
+
+    // Notify the view
+    iViewCommandHandle->ExecuteCommandL(
+        EPhoneViewCreateEmergencyCallHeader,
+        aCallId,
+        &emergencyHeaderParam );
+
+    TPhoneCmdParamCallHeaderData headerParam;
+    headerParam.SetCallState( EPEStateConnecting );
+    // Notify the view
+    iViewCommandHandle->ExecuteCommandL(
+        EPhoneViewUpdateBubble,
+        aCallId,
+        &headerParam );
+
+    EndUiUpdate();
+
+    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 );
+
+    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;
+    const TPEAudioOutput audioOutput =
+        iStateMachine->PhoneEngineInfo()->AudioOutput();
+    const TBool btAvailable =
+        iStateMachine->PhoneEngineInfo()->AudioOutputAvailable( EPEBTAudioAccessory );
+
+    __PHONELOG2( EOnlyFatal, EPhoneUIStates,
+            "CPhoneEmergency - AudioOutput: %d, BTAvailable: %d",
+            audioOutput, btAvailable );
+
+    if ( IsNumberEntryVisibleL() )
+        {
+        if ( IsDTMFEditorVisibleL() )
+            {
+            resourceId = EPhoneDtmfDialerCBA;
+            }
+        else
+            {
+            resourceId = EPhoneInCallNumberAcqCBA;
+            }
+        }
+    else if ( iDeviceLockOn || SimState() != EPESimUsable || iStartupInterrupted )
+        {
+        if ( TouchCallHandlingSupported() )
+        	{
+            resourceId = EPhoneCallHandlingEmergencyInCallNoOptions;
+            }
+        else if ( audioOutput == EPEWiredAudioAccessory || IsSwivelClosed())
+            {
+            resourceId = EPhoneCallHandlingEmergencyNoOptionsNoIhfCBA;
+            }
+        else if ( audioOutput == EPELoudspeaker )
+            {
+            resourceId = EPhoneCallHandlingEmergencyNoOptionsHandsetCBA;
+            }
+        else
+            {
+            resourceId = EPhoneCallHandlingEmergencyNoOptionsCBA;
+            }
+        }
+    else
+        {
+        if ( UseEmergencyNoIhfCBA( audioOutput ) )
+            {
+            resourceId = EPhoneCallHandlingEmergencyNoIhfCBA;
+            }
+        else if ( UseHandsetEmergencyCBA( audioOutput ) )
+            {
+            resourceId = EPhoneCallHandlingEmergencyHandsetCBA;
+            }
+        else if ( ( audioOutput == EPEHandset ) 
+        		&& ( btAvailable ) )
+            {
+            resourceId = EPhoneCallHandlingInCallBtaaCBA;
+            }
+        }
+
+    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 = EPhoneCallHandlingCallSetupCBA;
+
+    const TPEAudioOutput audioOutput =
+        iStateMachine->PhoneEngineInfo()->AudioOutput();
+
+    if ( iCallSetup && audioOutput != EPENotActive)
+        {
+        if ( audioOutput == EPELoudspeaker )
+            {
+            resourceId = EPhoneCallHandlingCallSetupToHandsetCBA;
+            }
+        else if ( audioOutput == EPEHandset )
+            {
+            resourceId =  EPhoneCallHandlingCallSetupToIhfCBA;
+            }
+        else
+            {
+            resourceId = EPhoneCallHandlingCallSetupCBA;
+            }
+        TPhoneCmdParamInteger integerParam;
+        integerParam.SetInteger(
+                CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( resourceId ) );
+
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateNoteSoftkeys,
+                &integerParam );
+        }
+    }
+
+// ---------------------------------------------------------
+// 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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.SetCallFlag( CBubbleManager::EDiverted );
+       
+       GetRemoteInfoDataL( ringingCallId, remoteInfoText );
+       divertData.SetCLIText( 
+                  remoteInfoText,
+                  CBubbleManager::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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,365 @@
+/*
+* 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 );
+
+    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, aCommandParam.Boolean() ); //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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,95 @@
+/*
+* 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 <phoneui.rsg>
+
+
+// ============================ 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");
+      
+    BaseConstructL();
+    
+    // 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,405 @@
+/*
+* 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 );
+
+    // 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,842 @@
+/*
+* 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 );
+        TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( 
+                        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;
+
+        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() );
+            }
+        EndUiUpdate();
+        SetToolbarDimming( ETrue );
+
+        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();
+    }
+
+// -----------------------------------------------------------
+// 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
+    UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+    }
+
+// -----------------------------------------------------------
+// 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 );
+
+        // 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 );
+            }
+        }
+
+    // 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() ");
+     UpdateCbaL( 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 );
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphonesinglecall.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,793 @@
+/*
+* 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();
+    }
+    
+// -----------------------------------------------------------
+// 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();  
+    }
+    
+// -----------------------------------------------------------
+// CPhoneSingleCall::ToggleHold
+// -----------------------------------------------------------
+//
+void CPhoneSingleCall::ToggleHoldL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleCall::ToggleHoldL()");
+    TPhoneCmdParamBoolean hold;
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetHoldFlag, &hold );
+   
+    if( hold.Boolean() )
+        {
+        SetCallResumeL();
+        }
+    else
+        {
+        SetCallHoldL();
+        }
+    }
+        
+// -----------------------------------------------------------
+// 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 );    
+
+    // Close fast swap window if it's displayed
+    CEikonEnv::Static()->DismissTaskList();
+
+    // Show incoming call buttons
+    SetTouchPaneButtons( EPhoneWaitingCallButtons );    
+
+    // Display incoming call
+    DisplayIncomingCallL( aCallId, dialerParam );
+
+    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);
+    
+    // Show incoming call buttons
+    SetTouchPaneButtons( EPhoneCallSetupAndSingleButtons );
+
+    // Display call setup 
+    DisplayCallSetupL( aCallId );
+
+    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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,313 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,486 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 );
+    }
+    
+// -----------------------------------------------------------
+// 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 );
+    }
+    
+// -----------------------------------------------------------
+// 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, CBubbleManager::ERight );
+    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
+    UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+    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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,431 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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;
+            
+        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
+    UpdateCbaL( 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, CBubbleManager::ERight );
+    
+    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 ) );
+    
+    // Set touch controls
+    SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer );
+
+    // Check if HW Keys or Call UI should be disabled
+    CheckDisableHWKeysAndCallUIL();
+    
+    SetTouchPaneButtons( EPhoneWaitingCallButtons );
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewCreateConference, aCallId,
+        &callHeaderParam );
+        
+    // Clear the flag
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
+        
+    EndUiUpdate();
+    // Go to Conference And Waiting state
+    // No need for CBA update
+    iStateMachine->ChangeState( EPhoneStateConferenceAndWaiting );                
+    }
+    
+// -----------------------------------------------------------
+// CPhoneTwoSinglesAndWaiting::UpdateInCallCbaL
+// -----------------------------------------------------------
+//
+void CPhoneTwoSinglesAndWaiting::UpdateInCallCbaL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneTwoSinglesAndWaiting::UpdateInCallCbaL()");
+	UpdateCbaL ( EPhoneCallHandlingCallWaitingCBA );   
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL()
+// -----------------------------------------------------------
+//
+void CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL()");
+    UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphoneuistatemachinefactorygsm.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,337 @@
+EXPORTS
+	?DynMenu@TPhoneCmdParamDynMenu@@QAEPAXXZ @ 1 NONAME ; void * TPhoneCmdParamDynMenu::DynMenu(void)
+	?CLITextClippingDirection@TPhoneCmdParamCallHeaderData@@QBE?AW4TPhoneClippingDirection@CBubbleManager@@XZ @ 2 NONAME ; enum CBubbleManager::TPhoneClippingDirection TPhoneCmdParamCallHeaderData::CLITextClippingDirection(void) const
+	?SetParticipantListCLI@TPhoneCmdParamCallHeaderData@@QAEXW4TPhoneParticipantListCLI@1@@Z @ 3 NONAME ; void TPhoneCmdParamCallHeaderData::SetParticipantListCLI(enum TPhoneCmdParamCallHeaderData::TPhoneParticipantListCLI)
+	?ContactLink@TPhoneCmdParamCallHeaderData@@QBEABVTDesC8@@XZ @ 4 NONAME ; class TDesC8 const & TPhoneCmdParamCallHeaderData::ContactLink(void) const
+	?LogIt@CPhoneLogger@@QAAXW4TPhoneUILoggingLevel@@W4TPhoneUILoggingComponent@@V?$TRefByValue@$$CBVTDesC16@@@@ZZ @ 5 NONAME ; void CPhoneLogger::LogIt(enum TPhoneUILoggingLevel, enum TPhoneUILoggingComponent, class TRefByValue<class TDesC16 const >, ...)
+	?IsEscapeKey@CPhoneKeys@@SAHABUTKeyEvent@@W4TEventCode@@@Z @ 6 NONAME ; int CPhoneKeys::IsEscapeKey(struct TKeyEvent const &, enum TEventCode)
+	?Tone@TPhoneCmdParamNote@@QBE?AW4TTone@CAknNoteDialog@@XZ @ 7 NONAME ; enum CAknNoteDialog::TTone TPhoneCmdParamNote::Tone(void) const
+	?LogStateChange@CPhoneLogger@@QAEXHH@Z @ 8 NONAME ; void CPhoneLogger::LogStateChange(int, int)
+	?SetObserver@TPhoneCmdParamNumberEntryObserver@@QAEXVTCallBack@@@Z @ 9 NONAME ; void TPhoneCmdParamNumberEntryObserver::SetObserver(class TCallBack)
+	?QueryType@TPhoneCmdParamQuery@@QBE?AW4TPhoneQueryType@@XZ @ 10 NONAME ; enum TPhoneQueryType TPhoneCmdParamQuery::QueryType(void) const
+	?SetCallType@TPhoneCmdParamCallHeaderData@@QAEXH@Z @ 11 NONAME ; void TPhoneCmdParamCallHeaderData::SetCallType(int)
+	?NumberType@TPhoneCmdParamCallHeaderData@@QBEHXZ @ 12 NONAME ; int TPhoneCmdParamCallHeaderData::NumberType(void) const
+	?CbaCommandMapping@TPhoneCmdParamQuery@@QBEHH@Z @ 13 NONAME ; int TPhoneCmdParamQuery::CbaCommandMapping(int) const
+	?SetTone@TPhoneCmdParamQuery@@QAEXH@Z @ 14 NONAME ; void TPhoneCmdParamQuery::SetTone(int)
+	??0TPhoneCmdParamSingleItemFetch@@QAE@XZ @ 15 NONAME ; TPhoneCmdParamSingleItemFetch::TPhoneCmdParamSingleItemFetch(void)
+	?PhoneNumber@TPhoneCmdParamSpeedDial@@QAEPAVTPtr16@@XZ @ 16 NONAME ; class TPtr16 * TPhoneCmdParamSpeedDial::PhoneNumber(void)
+	?CLIText@TPhoneCmdParamCallHeaderData@@QBEABVTDesC16@@XZ @ 17 NONAME ; class TDesC16 const & TPhoneCmdParamCallHeaderData::CLIText(void) const
+	??0CPhoneLogger@@QAE@VTUid@@@Z @ 18 NONAME ; CPhoneLogger::CPhoneLogger(class TUid)
+	?RingingType@TPhoneCmdParamRingTone@@QBEHXZ @ 19 NONAME ; int TPhoneCmdParamRingTone::RingingType(void) const
+	?Remove@CPhoneRecoverySystem@@SAXH@Z @ 20 NONAME ; void CPhoneRecoverySystem::Remove(int)
+	??0TPhoneCmdParamKeyEvent@@QAE@XZ @ 21 NONAME ; TPhoneCmdParamKeyEvent::TPhoneCmdParamKeyEvent(void)
+	?SetPhoneEngine@CPhoneLogger@@QAEXPAVMPEPhoneModel@@@Z @ 22 NONAME ; void CPhoneLogger::SetPhoneEngine(class MPEPhoneModel *)
+	?SetSendKeyEnabled@TPhoneCmdParamQuery@@QAEXH@Z @ 23 NONAME ; void TPhoneCmdParamQuery::SetSendKeyEnabled(int)
+	?Pointer@TPhoneCmdParamPointer@@QBEPAXXZ @ 24 NONAME ; void * TPhoneCmdParamPointer::Pointer(void) const
+	?SetCallerText@TPhoneCmdParamCallHeaderData@@QAEXABVTDesC16@@@Z @ 25 NONAME ; void TPhoneCmdParamCallHeaderData::SetCallerText(class TDesC16 const &)
+	?PhoneNumber@TPhoneCmdParamReconnectQuery@@QBE?BVTPtrC16@@XZ @ 26 NONAME ; class TPtrC16 const TPhoneCmdParamReconnectQuery::PhoneNumber(void) const
+	?Line2@TPhoneCmdParamIncallIndicatorData@@QBEHXZ @ 27 NONAME ; int TPhoneCmdParamIncallIndicatorData::Line2(void) const
+	?Text@TPhoneCmdParamGlobalNote@@QBEABVTDesC16@@XZ @ 28 NONAME ; class TDesC16 const & TPhoneCmdParamGlobalNote::Text(void) const
+	?RecoverNow@CPhoneRecoverySystem@@QAEHHCH@Z @ 29 NONAME ; int CPhoneRecoverySystem::RecoverNow(int, signed char, int)
+	?LogMsgFromControlToView@CPhoneLogger@@QAEXHH@Z @ 30 NONAME ; void CPhoneLogger::LogMsgFromControlToView(int, int)
+	??0TPhoneCmdParamBitmap@@QAE@XZ @ 31 NONAME ; TPhoneCmdParamBitmap::TPhoneCmdParamBitmap(void)
+	?NumberType@TPhoneCmdParamSpeedDial@@QAE?AW4TPhoneNumberType@@XZ @ 32 NONAME ; enum TPhoneNumberType TPhoneCmdParamSpeedDial::NumberType(void)
+	?SetHasThumbnail@TPhoneCmdParamCallHeaderData@@QAEXH@Z @ 33 NONAME ; void TPhoneCmdParamCallHeaderData::SetHasThumbnail(int)
+	?Text@TPhoneCmdParamNote@@QBEABVTDesC16@@XZ @ 34 NONAME ; class TDesC16 const & TPhoneCmdParamNote::Text(void) const
+	??1CPhoneMethodLogger@@UAE@XZ @ 35 NONAME ; CPhoneMethodLogger::~CPhoneMethodLogger(void)
+	?WaitForReady@TPhoneCmdParamGlobalNote@@QBEHXZ @ 36 NONAME ; int TPhoneCmdParamGlobalNote::WaitForReady(void) const
+	?MaskBitmap@TPhoneCmdParamBitmap@@QBEPAVCFbsBitmap@@XZ @ 37 NONAME ; class CFbsBitmap * TPhoneCmdParamBitmap::MaskBitmap(void) const
+	?IsScreenLocked@CPhoneStorage@@UAEHXZ @ 38 NONAME ; int CPhoneStorage::IsScreenLocked(void)
+	?SetText@TPhoneCmdParamGlobalNote@@QAEXABVTDesC16@@@Z @ 39 NONAME ; void TPhoneCmdParamGlobalNote::SetText(class TDesC16 const &)
+	?AddLibraryL@CPhoneLibraryContainer@@QAEXABVRLibrary@@@Z @ 40 NONAME ; void CPhoneLibraryContainer::AddLibraryL(class RLibrary const &)
+	??1CPhoneResourceResolverBase@@UAE@XZ @ 41 NONAME ; CPhoneResourceResolverBase::~CPhoneResourceResolverBase(void)
+	?ResetBlockedKeysList@CPhoneStorage@@UAEXXZ @ 42 NONAME ; void CPhoneStorage::ResetBlockedKeysList(void)
+	?SetInt@CPhoneCenRepProxy@@QAEHABVTUid@@IH@Z @ 43 NONAME ; int CPhoneCenRepProxy::SetInt(class TUid const &, unsigned int, int)
+	?GetCustomCommandForTimeOut@TPhoneCmdParamQuery@@QBEHAAH@Z @ 44 NONAME ; int TPhoneCmdParamQuery::GetCustomCommandForTimeOut(int &) const
+	?ParamId@TPhoneCommandParam@@QBE?AW4TPhoneParamId@1@XZ @ 45 NONAME ; enum TPhoneCommandParam::TPhoneParamId TPhoneCommandParam::ParamId(void) const
+	?SetString@CPhoneCenRepProxy@@QAEHABVTUid@@IABVTDesC16@@@Z @ 46 NONAME ; int CPhoneCenRepProxy::SetString(class TUid const &, unsigned int, class TDesC16 const &)
+	?Line2@TPhoneCmdParamCallHeaderData@@QBEHXZ @ 47 NONAME ; int TPhoneCmdParamCallHeaderData::Line2(void) const
+	??1CPhoneTimer@@UAE@XZ @ 48 NONAME ; CPhoneTimer::~CPhoneTimer(void)
+	?LogMsgFromPEToPhoneUIEnd@CPhoneLogger@@QAEXH@Z @ 49 NONAME ; void CPhoneLogger::LogMsgFromPEToPhoneUIEnd(int)
+	?DialerController@TPhoneCmdParamCustomDialer@@QAEPAVMPhoneDialerController@@XZ @ 50 NONAME ; class MPhoneDialerController * TPhoneCmdParamCustomDialer::DialerController(void)
+	?Type@TPhoneCmdParamGlobalNote@@QBE?AW4TAknGlobalNoteType@@XZ @ 51 NONAME ; enum TAknGlobalNoteType TPhoneCmdParamGlobalNote::Type(void) const
+	?SetMultipleInstances@TPhoneCmdParamAppInfo@@QAEXH@Z @ 52 NONAME ; void TPhoneCmdParamAppInfo::SetMultipleInstances(int)
+	?Tone@TPhoneCmdParamGlobalNote@@QBEHXZ @ 53 NONAME ; int TPhoneCmdParamGlobalNote::Tone(void) const
+	?ChangePropertyValue@CPhonePubSubProxy@@QAEXABVTUid@@IH@Z @ 54 NONAME ; void CPhonePubSubProxy::ChangePropertyValue(class TUid const &, unsigned int, int)
+	?SetThumbnail@TPhoneCmdParamCallHeaderData@@QAEXPAVCFbsBitmap@@@Z @ 55 NONAME ; void TPhoneCmdParamCallHeaderData::SetThumbnail(class CFbsBitmap *)
+	?SetCbaCommandMapping@TPhoneCmdParamQuery@@QAEXHH@Z @ 56 NONAME ; void TPhoneCmdParamQuery::SetCbaCommandMapping(int, int)
+	?EventCode@TPhoneCmdParamKeyEvent@@QBE?AW4TEventCode@@XZ @ 57 NONAME ; enum TEventCode TPhoneCmdParamKeyEvent::EventCode(void) const
+	?KeyEvent@TPhoneCmdParamKeyEvent@@QBE?BUTKeyEvent@@XZ @ 58 NONAME ; struct TKeyEvent const TPhoneCmdParamKeyEvent::KeyEvent(void) const
+	?SetDataText@TPhoneCmdParamQuery@@QAEXPAVTDes16@@@Z @ 59 NONAME ; void TPhoneCmdParamQuery::SetDataText(class TDes16 *)
+	??0TPhoneCmdParamAppInfo@@QAE@XZ @ 60 NONAME ; TPhoneCmdParamAppInfo::TPhoneCmdParamAppInfo(void)
+	?LittleBubbleVisible@TPhoneCmdParamIncallIndicatorData@@QBEHXZ @ 61 NONAME ; int TPhoneCmdParamIncallIndicatorData::LittleBubbleVisible(void) const
+	?SetCallState@TPhoneCmdParamIncallIndicatorData@@QAEXH@Z @ 62 NONAME ; void TPhoneCmdParamIncallIndicatorData::SetCallState(int)
+	?GetString@CPhoneCenRepProxy@@QBEHABVTUid@@IAAVTDes16@@@Z @ 63 NONAME ; int CPhoneCenRepProxy::GetString(class TUid const &, unsigned int, class TDes16 &) const
+	?ResourceId@TPhoneCmdParamProgressNote@@QBEHXZ @ 64 NONAME ; int TPhoneCmdParamProgressNote::ResourceId(void) const
+	?ReconnectQueryObserver@TPhoneCmdParamReconnectQuery@@QBEAAVMCaUiReconnectQueryObserver@@XZ @ 65 NONAME ; class MCaUiReconnectQueryObserver & TPhoneCmdParamReconnectQuery::ReconnectQueryObserver(void) const
+	?CallId@TPhoneCmdParamCallStateData@@QBEHXZ @ 66 NONAME ; int TPhoneCmdParamCallStateData::CallId(void) const
+	?SetContactMatcher@TPhoneCmdParamReconnectQuery@@QAEXPAVCPhCntMatcher@@@Z @ 67 NONAME ; void TPhoneCmdParamReconnectQuery::SetContactMatcher(class CPhCntMatcher *)
+	?NotifyChangeL@CPhoneCenRepProxy@@QAEXABVTUid@@IPAVMPhoneCenRepObserver@@@Z @ 68 NONAME ; void CPhoneCenRepProxy::NotifyChangeL(class TUid const &, unsigned int, class MPhoneCenRepObserver *)
+	?SetResourceId@TPhoneCmdParamDynMenu@@QAEXH@Z @ 69 NONAME ; void TPhoneCmdParamDynMenu::SetResourceId(int)
+	?Validate@CPhoneKeys@@SAHABVTDesC16@@@Z @ 70 NONAME ; int CPhoneKeys::Validate(class TDesC16 const &)
+	??0TPhoneCmdParamKeyCapture@@QAE@XZ @ 71 NONAME ; TPhoneCmdParamKeyCapture::TPhoneCmdParamKeyCapture(void)
+	?SetResourceId@TPhoneCmdParamNote@@QAEXH@Z @ 72 NONAME ; void TPhoneCmdParamNote::SetResourceId(int)
+	?LogMsgFromPEToPhoneUI@CPhoneLogger@@QAEXHH@Z @ 73 NONAME ; void CPhoneLogger::LogMsgFromPEToPhoneUI(int, int)
+	??0TPhoneCmdParamProgressNote@@QAE@XZ @ 74 NONAME ; TPhoneCmdParamProgressNote::TPhoneCmdParamProgressNote(void)
+	?CallState@TPhoneCmdParamCallStateData@@QBEHXZ @ 75 NONAME ; int TPhoneCmdParamCallStateData::CallState(void) const
+	?SetPointer@TPhoneCmdParamPointer@@QAEXPAX@Z @ 76 NONAME ; void TPhoneCmdParamPointer::SetPointer(void *)
+	??1CPhoneCenRepProxy@@UAE@XZ @ 77 NONAME ; CPhoneCenRepProxy::~CPhoneCenRepProxy(void)
+	?SetEventCode@TPhoneCmdParamKeyEvent@@QAEXW4TEventCode@@@Z @ 78 NONAME ; void TPhoneCmdParamKeyEvent::SetEventCode(enum TEventCode)
+	?WaitTime@TPhoneCmdParamProgressNote@@QBE?AVTTimeIntervalMicroSeconds32@@XZ @ 79 NONAME ; class TTimeIntervalMicroSeconds32 TPhoneCmdParamProgressNote::WaitTime(void) const
+	?SetParam@TPhoneCmdParamAppInfo@@QAEXABVTDesC8@@@Z @ 80 NONAME ; void TPhoneCmdParamAppInfo::SetParam(class TDesC8 const &)
+	?CallType@TPhoneCmdParamCallHeaderData@@QBEHXZ @ 81 NONAME ; int TPhoneCmdParamCallHeaderData::CallType(void) const
+	??0TPhoneCmdParamPointer@@QAE@XZ @ 82 NONAME ; TPhoneCmdParamPointer::TPhoneCmdParamPointer(void)
+	??0TPhoneCmdParamGlobalNote@@QAE@XZ @ 83 NONAME ; TPhoneCmdParamGlobalNote::TPhoneCmdParamGlobalNote(void)
+	?SetCiphering@TPhoneCmdParamEmergencyCallHeaderData@@QAEXH@Z @ 84 NONAME ; void TPhoneCmdParamEmergencyCallHeaderData::SetCiphering(int)
+	?SetTone@TPhoneCmdParamNote@@QAEXW4TTone@CAknNoteDialog@@@Z @ 85 NONAME ; void TPhoneCmdParamNote::SetTone(enum CAknNoteDialog::TTone)
+	?SetCustomCommandForTimeOut@TPhoneCmdParamQuery@@QAEXH@Z @ 86 NONAME ; void TPhoneCmdParamQuery::SetCustomCommandForTimeOut(int)
+	?SetIncludeVideoOption@TPhoneCmdParamReconnectQuery@@QAEXH@Z @ 87 NONAME ; void TPhoneCmdParamReconnectQuery::SetIncludeVideoOption(int)
+	?IsBTAccAvailable@TPhoneCmdParamAudioAvailability@@QBEHXZ @ 88 NONAME ; int TPhoneCmdParamAudioAvailability::IsBTAccAvailable(void) const
+	?NewL@CPhoneStorage@@SAPAV1@XZ @ 89 NONAME ; class CPhoneStorage * CPhoneStorage::NewL(void)
+	?Timeout@TPhoneCmdParamNote@@QBE?AW4TTimeout@CAknNoteDialog@@XZ @ 90 NONAME ; enum CAknNoteDialog::TTimeout TPhoneCmdParamNote::Timeout(void) const
+	?Instance@CPhoneRecoverySystem@@SAPAV1@XZ @ 91 NONAME ; class CPhoneRecoverySystem * CPhoneRecoverySystem::Instance(void)
+	?CancelTimer@CPhoneTimer@@QAEXXZ @ 92 NONAME ; void CPhoneTimer::CancelTimer(void)
+	?NewL@CPhoneTimer@@SAPAV1@H@Z @ 93 NONAME ; class CPhoneTimer * CPhoneTimer::NewL(int)
+	?GetInt@CPhoneCenRepProxy@@QBEHABVTUid@@IAAH@Z @ 94 NONAME ; int CPhoneCenRepProxy::GetInt(class TUid const &, unsigned int, int &) const
+	?SetTextToSay@TPhoneCmdParamRingTone@@QAEXABVTDesC16@@@Z @ 95 NONAME ; void TPhoneCmdParamRingTone::SetTextToSay(class TDesC16 const &)
+	?SetCallState@TPhoneCmdParamCallHeaderData@@QAEXH@Z @ 96 NONAME ; void TPhoneCmdParamCallHeaderData::SetCallState(int)
+	?ContentCba@TPhoneCmdParamQuery@@QBEHXZ @ 97 NONAME ; int TPhoneCmdParamQuery::ContentCba(void) const
+	?SetTextResourceId@TPhoneCmdParamGlobalNote@@QAEXH@Z @ 98 NONAME ; void TPhoneCmdParamGlobalNote::SetTextResourceId(int)
+	??0TPhoneCmdParamDynMenu@@QAE@XZ @ 99 NONAME ; TPhoneCmdParamDynMenu::TPhoneCmdParamDynMenu(void)
+	?CancelAllNotifications@CPhonePubSubProxy@@SAXPAVMPhonePubSubObserver@@@Z @ 100 NONAME ; void CPhonePubSubProxy::CancelAllNotifications(class MPhonePubSubObserver *)
+	??0TPhoneCommandParam@@QAE@XZ @ 101 NONAME ; TPhoneCommandParam::TPhoneCommandParam(void)
+	?SetCNAPText@TPhoneCmdParamCallHeaderData@@QAEXABVTDesC16@@W4TPhoneClippingDirection@CBubbleManager@@@Z @ 102 NONAME ; void TPhoneCmdParamCallHeaderData::SetCNAPText(class TDesC16 const &, enum CBubbleManager::TPhoneClippingDirection)
+	??1CPhoneLogger@@UAE@XZ @ 103 NONAME ; CPhoneLogger::~CPhoneLogger(void)
+	?Softkeys@TPhoneCmdParamGlobalNote@@QBEHXZ @ 104 NONAME ; int TPhoneCmdParamGlobalNote::Softkeys(void) const
+	??0TPhoneCmdParamMessageEditor@@QAE@XZ @ 105 NONAME ; TPhoneCmdParamMessageEditor::TPhoneCmdParamMessageEditor(void)
+	?SetCallState@TPhoneCmdParamCallStateData@@QAEXH@Z @ 106 NONAME ; void TPhoneCmdParamCallStateData::SetCallState(int)
+	?CallerText@TPhoneCmdParamCallHeaderData@@QBEABVTDesC16@@XZ @ 107 NONAME ; class TDesC16 const & TPhoneCmdParamCallHeaderData::CallerText(void) const
+	?String@TPhoneCmdParamString@@QAEPAVTPtr16@@XZ @ 108 NONAME ; class TPtr16 * TPhoneCmdParamString::String(void)
+	?SetKey@TPhoneCmdParamKeyCapture@@QAEXW4TStdScanCode@@@Z @ 109 NONAME ; void TPhoneCmdParamKeyCapture::SetKey(enum TStdScanCode)
+	?IsExtraChar@CPhoneKeys@@SAHH@Z @ 110 NONAME ; int CPhoneKeys::IsExtraChar(int)
+	?SetDynMenu@TPhoneCmdParamDynMenu@@QAEXPAX@Z @ 111 NONAME ; void TPhoneCmdParamDynMenu::SetDynMenu(void *)
+	?IsSecondHashKey@CPhoneKeys@@SAHABVTDes16@@@Z @ 112 NONAME ; int CPhoneKeys::IsSecondHashKey(class TDes16 const &)
+	?SetCallerImageStatus@TPhoneCmdParamRingTone@@QAEXH@Z @ 113 NONAME ; void TPhoneCmdParamRingTone::SetCallerImageStatus(int)
+	?GetReal@CPhoneCenRepProxy@@QBEHABVTUid@@IAAN@Z @ 114 NONAME ; int CPhoneCenRepProxy::GetReal(class TUid const &, unsigned int, double &) const
+	?SetShortLabelText@TPhoneCmdParamCallHeaderData@@QAEXABVTDesC16@@@Z @ 115 NONAME ; void TPhoneCmdParamCallHeaderData::SetShortLabelText(class TDesC16 const &)
+	?SetDialerController@TPhoneCmdParamCustomDialer@@QAEXPAVMPhoneDialerController@@@Z @ 116 NONAME ; void TPhoneCmdParamCustomDialer::SetDialerController(class MPhoneDialerController *)
+	?RingTone@TPhoneCmdParamRingTone@@QBEABVTDesC16@@XZ @ 117 NONAME ; class TDesC16 const & TPhoneCmdParamRingTone::RingTone(void) const
+	?TimeOut@TPhoneCmdParamQuery@@QBEHXZ @ 118 NONAME ; int TPhoneCmdParamQuery::TimeOut(void) const
+	?ShortLabelText@TPhoneCmdParamCallHeaderData@@QBEABVTDesC16@@XZ @ 119 NONAME ; class TDesC16 const & TPhoneCmdParamCallHeaderData::ShortLabelText(void) const
+	?SetInteger@TPhoneCmdParamInteger@@QAEXH@Z @ 120 NONAME ; void TPhoneCmdParamInteger::SetInteger(int)
+	?SetMaskBitmap@TPhoneCmdParamBitmap@@QAEXPAVCFbsBitmap@@@Z @ 121 NONAME ; void TPhoneCmdParamBitmap::SetMaskBitmap(class CFbsBitmap *)
+	?SetTimeout@TPhoneCmdParamNote@@QAEXW4TTimeout@CAknNoteDialog@@@Z @ 122 NONAME ; void TPhoneCmdParamNote::SetTimeout(enum CAknNoteDialog::TTimeout)
+	?IsBlockedKeysListEmpty@CPhoneStorage@@UAEHXZ @ 123 NONAME ; int CPhoneStorage::IsBlockedKeysListEmpty(void)
+	?SetCustomMessage@TPhoneCmdParamAppInfo@@QAEXABVTDesC8@@@Z @ 124 NONAME ; void TPhoneCmdParamAppInfo::SetCustomMessage(class TDesC8 const &)
+	?BaseConstructL@CPhoneResourceResolverBase@@QAEXXZ @ 125 NONAME ; void CPhoneResourceResolverBase::BaseConstructL(void)
+	?SetTextResourceId@TPhoneCmdParamNote@@QAEXH@Z @ 126 NONAME ; void TPhoneCmdParamNote::SetTextResourceId(int)
+	?SetString@TPhoneCmdParamString@@QAEXPAVTPtr16@@@Z @ 127 NONAME ; void TPhoneCmdParamString::SetString(class TPtr16 *)
+	?SetAppUid@TPhoneCmdParamAppInfo@@QAEXABVTUid@@@Z @ 128 NONAME ; void TPhoneCmdParamAppInfo::SetAppUid(class TUid const &)
+	?String@TPhoneCmdParamSingleItemFetch@@QBEPAVTDes16@@XZ @ 129 NONAME ; class TDes16 * TPhoneCmdParamSingleItemFetch::String(void) const
+	?SetBTAccAvailable@TPhoneCmdParamAudioAvailability@@QAEXH@Z @ 130 NONAME ; void TPhoneCmdParamAudioAvailability::SetBTAccAvailable(int)
+	?IsTelephonyFeatureSupported@CPhoneCenRepProxy@@QAEHH@Z @ 131 NONAME ; int CPhoneCenRepProxy::IsTelephonyFeatureSupported(int)
+	?CallImageThemeFilePath@CPhoneCallThemeMonitor@@QBE?AVTPtrC16@@XZ @ 132 NONAME ; class TPtrC16 CPhoneCallThemeMonitor::CallImageThemeFilePath(void) const
+	?HasThumbnail@TPhoneCmdParamCallHeaderData@@QBEHXZ @ 133 NONAME ; int TPhoneCmdParamCallHeaderData::HasThumbnail(void) const
+	?ClearBlackListNow@CPhoneClearBlacklist@@QAEXXZ @ 134 NONAME ; void CPhoneClearBlacklist::ClearBlackListNow(void)
+	?SetCipheringIndicatorAllowed@TPhoneCmdParamEmergencyCallHeaderData@@QAEXH@Z @ 135 NONAME ; void TPhoneCmdParamEmergencyCallHeaderData::SetCipheringIndicatorAllowed(int)
+	?SetCommandParamId@TPhoneCmdParamQuery@@QAEXW4TPhoneParamId@TPhoneCommandParam@@@Z @ 136 NONAME ; void TPhoneCmdParamQuery::SetCommandParamId(enum TPhoneCommandParam::TPhoneParamId)
+	??0TPhoneCmdParamEmergencyCallHeaderData@@QAE@XZ @ 137 NONAME ; TPhoneCmdParamEmergencyCallHeaderData::TPhoneCmdParamEmergencyCallHeaderData(void)
+	?After@CPhoneTimer@@QAEXVTTimeIntervalMicroSeconds32@@PAVMPhoneTimer@@@Z @ 138 NONAME ; void CPhoneTimer::After(class TTimeIntervalMicroSeconds32, class MPhoneTimer *)
+	?NewL@CPhoneLibraryContainer@@SAPAV1@XZ @ 139 NONAME ; class CPhoneLibraryContainer * CPhoneLibraryContainer::NewL(void)
+	?CreateL@CPhoneClearBlacklist@@SAPAV1@AAVRWsSession@@ABVRWindowBase@@@Z @ 140 NONAME ; class CPhoneClearBlacklist * CPhoneClearBlacklist::CreateL(class RWsSession &, class RWindowBase const &)
+	??1CPhoneStorage@@UAE@XZ @ 141 NONAME ; CPhoneStorage::~CPhoneStorage(void)
+	?SetVolume@TPhoneCmdParamRingTone@@QAEXH@Z @ 142 NONAME ; void TPhoneCmdParamRingTone::SetVolume(int)
+	??0TPhoneCmdParamString@@QAE@XZ @ 143 NONAME ; TPhoneCmdParamString::TPhoneCmdParamString(void)
+	?SetContactLink@TPhoneCmdParamCallHeaderData@@QAEXABVTDesC8@@@Z @ 144 NONAME ; void TPhoneCmdParamCallHeaderData::SetContactLink(class TDesC8 const &)
+	??4TPhoneCmdParamQuery@@QAEAAV0@ABV0@@Z @ 145 NONAME ; class TPhoneCmdParamQuery & TPhoneCmdParamQuery::operator=(class TPhoneCmdParamQuery const &)
+	??0TPhoneCmdParamAudioAvailability@@QAE@XZ @ 146 NONAME ; TPhoneCmdParamAudioAvailability::TPhoneCmdParamAudioAvailability(void)
+	?GetBlockedKeyList@CPhoneStorage@@UBEABV?$RArray@H@@XZ @ 147 NONAME ; class RArray<int> const & CPhoneStorage::GetBlockedKeyList(void) const
+	??0TPhoneCmdParamRingTone@@QAE@XZ @ 148 NONAME ; TPhoneCmdParamRingTone::TPhoneCmdParamRingTone(void)
+	?Observer@TPhoneCmdParamNumberEntryObserver@@QAE?AVTCallBack@@XZ @ 149 NONAME ; class TCallBack TPhoneCmdParamNumberEntryObserver::Observer(void)
+	?SetSoftkeys@TPhoneCmdParamGlobalNote@@QAEXH@Z @ 150 NONAME ; void TPhoneCmdParamGlobalNote::SetSoftkeys(int)
+	??0CPhoneResourceResolverBase@@IAE@XZ @ 151 NONAME ; CPhoneResourceResolverBase::CPhoneResourceResolverBase(void)
+	?SetCallId@TPhoneCmdParamCallStateData@@QAEXH@Z @ 152 NONAME ; void TPhoneCmdParamCallStateData::SetCallId(int)
+	?MultipleInstances@TPhoneCmdParamAppInfo@@QBEHXZ @ 153 NONAME ; int TPhoneCmdParamAppInfo::MultipleInstances(void) const
+	?ItemTextArrayForListQuery@TPhoneCmdParamQuery@@QBEPAVMDesC16Array@@XZ @ 154 NONAME ; class MDesC16Array * TPhoneCmdParamQuery::ItemTextArrayForListQuery(void) const
+	?SetHeaderText@TPhoneCmdParamEmergencyCallHeaderData@@QAEXABVTDesC16@@@Z @ 155 NONAME ; void TPhoneCmdParamEmergencyCallHeaderData::SetHeaderText(class TDesC16 const &)
+	?SetContentCba@TPhoneCmdParamQuery@@QAEXH@Z @ 156 NONAME ; void TPhoneCmdParamQuery::SetContentCba(int)
+	?CaptureType@TPhoneCmdParamKeyCapture@@QBE?AW4TPhoneCaptureType@@XZ @ 157 NONAME ; enum TPhoneCaptureType TPhoneCmdParamKeyCapture::CaptureType(void) const
+	?SetQueryResourceId@TPhoneCmdParamQuery@@QAEXH@Z @ 158 NONAME ; void TPhoneCmdParamQuery::SetQueryResourceId(int)
+	?CancelNotify@CPhoneCenRepProxy@@QAEXPAVMPhoneCenRepObserver@@I@Z @ 159 NONAME ; void CPhoneCenRepProxy::CancelNotify(class MPhoneCenRepObserver *, unsigned int)
+	?Param@TPhoneCmdParamAppInfo@@QBEABVTDesC8@@XZ @ 160 NONAME ; class TDesC8 const & TPhoneCmdParamAppInfo::Param(void) const
+	??0CPhoneMethodLogger@@QAE@W4TPhoneUILoggingComponent@@VTPtrC16@@@Z @ 161 NONAME ; CPhoneMethodLogger::CPhoneMethodLogger(enum TPhoneUILoggingComponent, class TPtrC16)
+	?IsDtmfTone@CPhoneKeys@@SAHABUTKeyEvent@@W4TEventCode@@@Z @ 162 NONAME ; int CPhoneKeys::IsDtmfTone(struct TKeyEvent const &, enum TEventCode)
+	?SetMode@TPhoneCmdParamIncallIndicatorData@@QAEXH@Z @ 163 NONAME ; void TPhoneCmdParamIncallIndicatorData::SetMode(int)
+	?NewL@CPhoneCallThemeMonitor@@SAPAV1@XZ @ 164 NONAME ; class CPhoneCallThemeMonitor * CPhoneCallThemeMonitor::NewL(void)
+	?SetCLIText@TPhoneCmdParamCallHeaderData@@QAEXABVTDesC16@@W4TPhoneClippingDirection@CBubbleManager@@@Z @ 165 NONAME ; void TPhoneCmdParamCallHeaderData::SetCLIText(class TDesC16 const &, enum CBubbleManager::TPhoneClippingDirection)
+	?SetPhoneNumber@TPhoneCmdParamSpeedDial@@QAEXPAVTPtr16@@@Z @ 166 NONAME ; void TPhoneCmdParamSpeedDial::SetPhoneNumber(class TPtr16 *)
+	?SendKeyEnabled@TPhoneCmdParamQuery@@QBEHXZ @ 167 NONAME ; int TPhoneCmdParamQuery::SendKeyEnabled(void) const
+	?SetNeedToEnableKeylock@CPhoneStorage@@UAEXH@Z @ 168 NONAME ; void CPhoneStorage::SetNeedToEnableKeylock(int)
+	?SetTitlePaneResourceId@TPhoneCmdParamSingleItemFetch@@QAEXH@Z @ 169 NONAME ; void TPhoneCmdParamSingleItemFetch::SetTitlePaneResourceId(int)
+	?Find@CPhoneCenRepProxy@@QBEHABVTUid@@KKAAV?$RArray@K@@@Z @ 170 NONAME ; int CPhoneCenRepProxy::Find(class TUid const &, unsigned long, unsigned long, class RArray<unsigned long> &) const
+	?SetLabelText@TPhoneCmdParamCallHeaderData@@QAEXABVTDesC16@@@Z @ 171 NONAME ; void TPhoneCmdParamCallHeaderData::SetLabelText(class TDesC16 const &)
+	?CNAPText@TPhoneCmdParamCallHeaderData@@QBEABVTDesC16@@XZ @ 172 NONAME ; class TDesC16 const & TPhoneCmdParamCallHeaderData::CNAPText(void) const
+	?SetOwnPhoneNumberText@TPhoneCmdParamEmergencyCallHeaderData@@QAEXABVTDesC16@@@Z @ 173 NONAME ; void TPhoneCmdParamEmergencyCallHeaderData::SetOwnPhoneNumberText(class TDesC16 const &)
+	?Emergency@TPhoneCmdParamIncallIndicatorData@@QBEHXZ @ 174 NONAME ; int TPhoneCmdParamIncallIndicatorData::Emergency(void) const
+	?SetCbaResourceId@TPhoneCmdParamSingleItemFetch@@QAEXH@Z @ 175 NONAME ; void TPhoneCmdParamSingleItemFetch::SetCbaResourceId(int)
+	?AppUid@TPhoneCmdParamAppInfo@@QBE?AVTUid@@XZ @ 176 NONAME ; class TUid TPhoneCmdParamAppInfo::AppUid(void) const
+	?CustomMessage@TPhoneCmdParamAppInfo@@QBEABVTDesC8@@XZ @ 177 NONAME ; class TDesC8 const & TPhoneCmdParamAppInfo::CustomMessage(void) const
+	?QueryResourceId@TPhoneCmdParamQuery@@QBEHXZ @ 178 NONAME ; int TPhoneCmdParamQuery::QueryResourceId(void) const
+	?SetRingTone@TPhoneCmdParamRingTone@@QAEXABVTDesC16@@@Z @ 179 NONAME ; void TPhoneCmdParamRingTone::SetRingTone(class TDesC16 const &)
+	?NotifyChangeL@CPhonePubSubProxy@@QAEXABVTUid@@IPAVMPhonePubSubObserver@@@Z @ 180 NONAME ; void CPhonePubSubProxy::NotifyChangeL(class TUid const &, unsigned int, class MPhonePubSubObserver *)
+	?AppendBlockedKeysListL@CPhoneStorage@@UAEXW4TStdScanCode@@@Z @ 181 NONAME ; void CPhoneStorage::AppendBlockedKeysListL(enum TStdScanCode)
+	?SetEmergency@TPhoneCmdParamIncallIndicatorData@@QAEXH@Z @ 182 NONAME ; void TPhoneCmdParamIncallIndicatorData::SetEmergency(int)
+	?SetDefaultCba@TPhoneCmdParamQuery@@QAEXH@Z @ 183 NONAME ; void TPhoneCmdParamQuery::SetDefaultCba(int)
+	?Type@TPhoneCmdParamTransEffect@@QBE?AW4TPhoneTransEffectType@@XZ @ 184 NONAME ; enum TPhoneTransEffectType TPhoneCmdParamTransEffect::Type(void) const
+	??0TPhoneCmdParamSfiData@@QAE@XZ @ 185 NONAME ; TPhoneCmdParamSfiData::TPhoneCmdParamSfiData(void)
+	??0TPhoneCmdParamCallHeaderData@@QAE@XZ @ 186 NONAME ; TPhoneCmdParamCallHeaderData::TPhoneCmdParamCallHeaderData(void)
+	??1CPhoneClearBlacklist@@UAE@XZ @ 187 NONAME ; CPhoneClearBlacklist::~CPhoneClearBlacklist(void)
+	?SetMute@TPhoneCmdParamIncallIndicatorData@@QAEXH@Z @ 188 NONAME ; void TPhoneCmdParamIncallIndicatorData::SetMute(int)
+	?KeyCode@TPhoneCmdParamKeyCapture@@QBE?AW4TKeyCode@@XZ @ 189 NONAME ; enum TKeyCode TPhoneCmdParamKeyCapture::KeyCode(void) const
+	?IsNumberKey@CPhoneKeys@@SAHABUTKeyEvent@@W4TEventCode@@@Z @ 190 NONAME ; int CPhoneKeys::IsNumberKey(struct TKeyEvent const &, enum TEventCode)
+	?TextResourceId@TPhoneCmdParamGlobalNote@@QBEHXZ @ 191 NONAME ; int TPhoneCmdParamGlobalNote::TextResourceId(void) const
+	?SetCiphering@TPhoneCmdParamCallHeaderData@@QAEXH@Z @ 192 NONAME ; void TPhoneCmdParamCallHeaderData::SetCiphering(int)
+	?EnablePreconditionL@CPhoneRecoverySystem@@QAEXXZ @ 193 NONAME ; void CPhoneRecoverySystem::EnablePreconditionL(void)
+	?AddL@CPhoneRecoverySystem@@QAEHVTCallBack@@CW4TRecoveryState@CTeleRecoverySystem@@@Z @ 194 NONAME ; int CPhoneRecoverySystem::AddL(class TCallBack, signed char, enum CTeleRecoverySystem::TRecoveryState)
+	?SetLine2@TPhoneCmdParamIncallIndicatorData@@QAEXH@Z @ 195 NONAME ; void TPhoneCmdParamIncallIndicatorData::SetLine2(int)
+	?SetAudioOutput@TPhoneCmdParamAudioOutput@@QAEXW4TPEAudioOutput@@@Z @ 196 NONAME ; void TPhoneCmdParamAudioOutput::SetAudioOutput(enum TPEAudioOutput)
+	?HeaderText@TPhoneCmdParamEmergencyCallHeaderData@@QBEABVTDesC16@@XZ @ 197 NONAME ; class TDesC16 const & TPhoneCmdParamEmergencyCallHeaderData::HeaderText(void) const
+	?CallImageThemeSettings@CPhoneCallThemeMonitor@@QBEHXZ @ 198 NONAME ; int CPhoneCallThemeMonitor::CallImageThemeSettings(void) const
+	?SetLocation@TPhoneCmdParamSpeedDial@@QAEXH@Z @ 199 NONAME ; void TPhoneCmdParamSpeedDial::SetLocation(int)
+	??0TPhoneCmdParamTransEffect@@QAE@XZ @ 200 NONAME ; TPhoneCmdParamTransEffect::TPhoneCmdParamTransEffect(void)
+	?Number@TPhoneCmdParamSfiData@@QBEABVTDesC16@@XZ @ 201 NONAME ; class TDesC16 const & TPhoneCmdParamSfiData::Number(void) const
+	?OwnPhoneNumberText@TPhoneCmdParamEmergencyCallHeaderData@@QBEABVTDesC16@@XZ @ 202 NONAME ; class TDesC16 const & TPhoneCmdParamEmergencyCallHeaderData::OwnPhoneNumberText(void) const
+	?QueryPrompt@TPhoneCmdParamQuery@@QBEABVTDesC16@@XZ @ 203 NONAME ; class TDesC16 const & TPhoneCmdParamQuery::QueryPrompt(void) const
+	?SetQueryPrompt@TPhoneCmdParamQuery@@QAEXABVTDesC16@@@Z @ 204 NONAME ; void TPhoneCmdParamQuery::SetQueryPrompt(class TDesC16 const &)
+	?NewL@CPhoneQwertyHandler@@SAPAV1@XZ @ 205 NONAME ; class CPhoneQwertyHandler * CPhoneQwertyHandler::NewL(void)
+	?IsNumericKey@CPhoneKeys@@SAHABUTKeyEvent@@W4TEventCode@@@Z @ 206 NONAME ; int CPhoneKeys::IsNumericKey(struct TKeyEvent const &, enum TEventCode)
+	?SetCaptureType@TPhoneCmdParamKeyCapture@@QAEXW4TPhoneCaptureType@@@Z @ 207 NONAME ; void TPhoneCmdParamKeyCapture::SetCaptureType(enum TPhoneCaptureType)
+	?ViewUid@TPhoneCmdParamAppInfo@@QBE?AVTUid@@XZ @ 208 NONAME ; class TUid TPhoneCmdParamAppInfo::ViewUid(void) const
+	?CallFlag@TPhoneCmdParamCallHeaderData@@QBEKXZ @ 209 NONAME ; unsigned long TPhoneCmdParamCallHeaderData::CallFlag(void) const
+	?SetLabelText@TPhoneCmdParamEmergencyCallHeaderData@@QAEXABVTDesC16@@@Z @ 210 NONAME ; void TPhoneCmdParamEmergencyCallHeaderData::SetLabelText(class TDesC16 const &)
+	??0TPhoneCmdParamSpeedDial@@QAE@XZ @ 211 NONAME ; TPhoneCmdParamSpeedDial::TPhoneCmdParamSpeedDial(void)
+	?IsCallerText@TPhoneCmdParamRingTone@@QAEHXZ @ 212 NONAME ; int TPhoneCmdParamRingTone::IsCallerText(void)
+	?SetBitmap@TPhoneCmdParamBitmap@@QAEXPAVCFbsBitmap@@@Z @ 213 NONAME ; void TPhoneCmdParamBitmap::SetBitmap(class CFbsBitmap *)
+	?SetNumber@TPhoneCmdParamSfiData@@QAEXABVTDesC16@@@Z @ 214 NONAME ; void TPhoneCmdParamSfiData::SetNumber(class TDesC16 const &)
+	?Location@TPhoneCmdParamSpeedDial@@QAEHXZ @ 215 NONAME ; int TPhoneCmdParamSpeedDial::Location(void)
+	?CipheringIndicatorAllowed@TPhoneCmdParamCallHeaderData@@QBEHXZ @ 216 NONAME ; int TPhoneCmdParamCallHeaderData::CipheringIndicatorAllowed(void) const
+	?Name@TPhoneCmdParamSfiData@@QBEABVTDesC16@@XZ @ 217 NONAME ; class TDesC16 const & TPhoneCmdParamSfiData::Name(void) const
+	??0TPhoneCmdParamQuery@@QAE@ABV0@@Z @ 218 NONAME ; TPhoneCmdParamQuery::TPhoneCmdParamQuery(class TPhoneCmdParamQuery const &)
+	?CallState@TPhoneCmdParamCallHeaderData@@QBEHXZ @ 219 NONAME ; int TPhoneCmdParamCallHeaderData::CallState(void) const
+	??0TPhoneCmdParamIncallIndicatorData@@QAE@XZ @ 220 NONAME ; TPhoneCmdParamIncallIndicatorData::TPhoneCmdParamIncallIndicatorData(void)
+	?Picture@TPhoneCmdParamCallHeaderData@@QBEABVTDesC16@@XZ @ 221 NONAME ; class TDesC16 const & TPhoneCmdParamCallHeaderData::Picture(void) const
+	?SetCallThemeSettingsObserver@CPhoneCallThemeMonitor@@QAEXPAVMPhoneCallThemeSettingsObserver@@@Z @ 222 NONAME ; void CPhoneCallThemeMonitor::SetCallThemeSettingsObserver(class MPhoneCallThemeSettingsObserver *)
+	?ServiceId@TPhoneCmdParamCallHeaderData@@QBEKXZ @ 223 NONAME ; unsigned long TPhoneCmdParamCallHeaderData::ServiceId(void) const
+	?LabelText@TPhoneCmdParamCallHeaderData@@QBEABVTDesC16@@XZ @ 224 NONAME ; class TDesC16 const & TPhoneCmdParamCallHeaderData::LabelText(void) const
+	?Overflow@CPhoneLogger@@EAEXAAVTDes16@@@Z @ 225 NONAME ; void CPhoneLogger::Overflow(class TDes16 &)
+	?SetServiceId@TPhoneCmdParamSpeedDial@@QAEXI@Z @ 226 NONAME ; void TPhoneCmdParamSpeedDial::SetServiceId(unsigned int)
+	?SetKeyEvent@TPhoneCmdParamKeyEvent@@QAEXABUTKeyEvent@@@Z @ 227 NONAME ; void TPhoneCmdParamKeyEvent::SetKeyEvent(struct TKeyEvent const &)
+	?Instance@CPhonePubSubProxy@@SAPAV1@XZ @ 228 NONAME ; class CPhonePubSubProxy * CPhonePubSubProxy::Instance(void)
+	?ResourceId@TPhoneCmdParamNote@@QBEHXZ @ 229 NONAME ; int TPhoneCmdParamNote::ResourceId(void) const
+	?CipheringIndicatorAllowed@TPhoneCmdParamEmergencyCallHeaderData@@QBEHXZ @ 230 NONAME ; int TPhoneCmdParamEmergencyCallHeaderData::CipheringIndicatorAllowed(void) const
+	?CancelAllNotifies@CPhoneCenRepProxy@@SAXPAVMPhoneCenRepObserver@@@Z @ 231 NONAME ; void CPhoneCenRepProxy::CancelAllNotifies(class MPhoneCenRepObserver *)
+	??1CPhoneQwertyHandler@@UAE@XZ @ 232 NONAME ; CPhoneQwertyHandler::~CPhoneQwertyHandler(void)
+	?TextResourceId@TPhoneCmdParamNote@@QBEHXZ @ 233 NONAME ; int TPhoneCmdParamNote::TextResourceId(void) const
+	?SetRemotePhoneNumber@TPhoneCmdParamCallHeaderData@@QAEXABVTDesC16@@@Z @ 234 NONAME ; void TPhoneCmdParamCallHeaderData::SetRemotePhoneNumber(class TDesC16 const &)
+	?CipheringIndicatorAllowed@TPhoneCmdParamIncallIndicatorData@@QBEHXZ @ 235 NONAME ; int TPhoneCmdParamIncallIndicatorData::CipheringIndicatorAllowed(void) const
+	?SetScreenLocked@CPhoneStorage@@UAEXH@Z @ 236 NONAME ; void CPhoneStorage::SetScreenLocked(int)
+	??0TPhoneCmdParamCallStateData@@QAE@XZ @ 237 NONAME ; TPhoneCmdParamCallStateData::TPhoneCmdParamCallStateData(void)
+	?SetKeyCode@TPhoneCmdParamKeyCapture@@QAEXW4TKeyCode@@@Z @ 238 NONAME ; void TPhoneCmdParamKeyCapture::SetKeyCode(enum TKeyCode)
+	?CustomMessageId@TPhoneCmdParamAppInfo@@QBE?AVTUid@@XZ @ 239 NONAME ; class TUid TPhoneCmdParamAppInfo::CustomMessageId(void) const
+	?RemotePhoneNumber@TPhoneCmdParamCallHeaderData@@QBEABVTDesC16@@XZ @ 240 NONAME ; class TDesC16 const & TPhoneCmdParamCallHeaderData::RemotePhoneNumber(void) const
+	?SetType@TPhoneCmdParamNote@@QAEXW4TPhoneNoteType@@@Z @ 241 NONAME ; void TPhoneCmdParamNote::SetType(enum TPhoneNoteType)
+	?Instance@CPhoneClearBlacklist@@SAPAV1@XZ @ 242 NONAME ; class CPhoneClearBlacklist * CPhoneClearBlacklist::Instance(void)
+	?TextToSay@TPhoneCmdParamRingTone@@QBEABVTDesC16@@XZ @ 243 NONAME ; class TDesC16 const & TPhoneCmdParamRingTone::TextToSay(void) const
+	?Type@TPhoneCmdParamNote@@QBE?AW4TPhoneNoteType@@XZ @ 244 NONAME ; enum TPhoneNoteType TPhoneCmdParamNote::Type(void) const
+	??0TPhoneCmdParamReconnectQuery@@QAE@AAVMCaUiReconnectQueryObserver@@@Z @ 245 NONAME ; TPhoneCmdParamReconnectQuery::TPhoneCmdParamReconnectQuery(class MCaUiReconnectQueryObserver &)
+	?SetCallFlag@TPhoneCmdParamCallHeaderData@@QAEXW4TPhoneCallTypeFlags@CBubbleManager@@@Z @ 246 NONAME ; void TPhoneCmdParamCallHeaderData::SetCallFlag(enum CBubbleManager::TPhoneCallTypeFlags)
+	?SetPicture@TPhoneCmdParamCallHeaderData@@QAEXABVTDesC16@@@Z @ 247 NONAME ; void TPhoneCmdParamCallHeaderData::SetPicture(class TDesC16 const &)
+	?Integer@TPhoneCmdParamInteger@@QBEHXZ @ 248 NONAME ; int TPhoneCmdParamInteger::Integer(void) const
+	?Mode@TPhoneCmdParamIncallIndicatorData@@QBEHXZ @ 249 NONAME ; int TPhoneCmdParamIncallIndicatorData::Mode(void) const
+	?SetText@TPhoneCmdParamNote@@QAEXABVTDesC16@@@Z @ 250 NONAME ; void TPhoneCmdParamNote::SetText(class TDesC16 const &)
+	?SetCallerTextStatus@TPhoneCmdParamRingTone@@QAEXH@Z @ 251 NONAME ; void TPhoneCmdParamRingTone::SetCallerTextStatus(int)
+	?IsWiredAccAvailable@TPhoneCmdParamAudioAvailability@@QBEHXZ @ 252 NONAME ; int TPhoneCmdParamAudioAvailability::IsWiredAccAvailable(void) const
+	?SetWaitForReady@TPhoneCmdParamGlobalNote@@QAEXH@Z @ 253 NONAME ; void TPhoneCmdParamGlobalNote::SetWaitForReady(int)
+	??0TPhoneCmdParamBoolean@@QAE@XZ @ 254 NONAME ; TPhoneCmdParamBoolean::TPhoneCmdParamBoolean(void)
+	?QueryCommandObserver@TPhoneCmdParamQuery@@QAEPAVMPhoneQueryCommandObserver@@XZ @ 255 NONAME ; class MPhoneQueryCommandObserver * TPhoneCmdParamQuery::QueryCommandObserver(void)
+	?DataText@TPhoneCmdParamQuery@@QBEPAVTDes16@@XZ @ 256 NONAME ; class TDes16 * TPhoneCmdParamQuery::DataText(void) const
+	?SetType@TPhoneCmdParamSingleItemFetch@@QAEXW4TFetchType@CPhCntSingleItemFetch@@@Z @ 257 NONAME ; void TPhoneCmdParamSingleItemFetch::SetType(enum CPhCntSingleItemFetch::TFetchType)
+	?SetReal@CPhoneCenRepProxy@@QAEHABVTUid@@IN@Z @ 258 NONAME ; int CPhoneCenRepProxy::SetReal(class TUid const &, unsigned int, double)
+	??0TPhoneCmdParamCustomDialer@@QAE@XZ @ 259 NONAME ; TPhoneCmdParamCustomDialer::TPhoneCmdParamCustomDialer(void)
+	??1CPhonePubSubProxy@@UAE@XZ @ 260 NONAME ; CPhonePubSubProxy::~CPhonePubSubProxy(void)
+	?NumericKeyCode@CPhoneQwertyHandler@@QAEHABUTKeyEvent@@@Z @ 261 NONAME ; int CPhoneQwertyHandler::NumericKeyCode(struct TKeyEvent const &)
+	?SetMessageData@TPhoneCmdParamMessageEditor@@QAEXPAVCMessageData@@@Z @ 262 NONAME ; void TPhoneCmdParamMessageEditor::SetMessageData(class CMessageData *)
+	??0TPhoneCmdParamNote@@QAE@XZ @ 263 NONAME ; TPhoneCmdParamNote::TPhoneCmdParamNote(void)
+	?Volume@TPhoneCmdParamRingTone@@QBEHXZ @ 264 NONAME ; int TPhoneCmdParamRingTone::Volume(void) const
+	?SetItemTextArrayForListQuery@TPhoneCmdParamQuery@@QAEXAAVMDesC16Array@@@Z @ 265 NONAME ; void TPhoneCmdParamQuery::SetItemTextArrayForListQuery(class MDesC16Array &)
+	?Type@TPhoneCmdParamRingTone@@QBE?AW4TPhoneRingToneType@@XZ @ 266 NONAME ; enum TPhoneRingToneType TPhoneCmdParamRingTone::Type(void) const
+	?Key@TPhoneCmdParamKeyCapture@@QBE?AW4TStdScanCode@@XZ @ 267 NONAME ; enum TStdScanCode TPhoneCmdParamKeyCapture::Key(void) const
+	?LabelText@TPhoneCmdParamEmergencyCallHeaderData@@QBEABVTDesC16@@XZ @ 268 NONAME ; class TDesC16 const & TPhoneCmdParamEmergencyCallHeaderData::LabelText(void) const
+	?Ciphering@TPhoneCmdParamIncallIndicatorData@@QBEHXZ @ 269 NONAME ; int TPhoneCmdParamIncallIndicatorData::Ciphering(void) const
+	?SetQueryCommandObserver@TPhoneCmdParamQuery@@QAEXAAVMPhoneQueryCommandObserver@@@Z @ 270 NONAME ; void TPhoneCmdParamQuery::SetQueryCommandObserver(class MPhoneQueryCommandObserver &)
+	?IsPhoneUIFeatureSupported@CPhoneCenRepProxy@@QAEHH@Z @ 271 NONAME ; int CPhoneCenRepProxy::IsPhoneUIFeatureSupported(int)
+	?DefaultCba@TPhoneCmdParamQuery@@QBEHXZ @ 272 NONAME ; int TPhoneCmdParamQuery::DefaultCba(void) const
+	?CallState@TPhoneCmdParamIncallIndicatorData@@QBEHXZ @ 273 NONAME ; int TPhoneCmdParamIncallIndicatorData::CallState(void) const
+	??0TPhoneCmdParamNumberEntryObserver@@QAE@XZ @ 274 NONAME ; TPhoneCmdParamNumberEntryObserver::TPhoneCmdParamNumberEntryObserver(void)
+	?MessageData@TPhoneCmdParamMessageEditor@@QBEPAVCMessageData@@XZ @ 275 NONAME ; class CMessageData * TPhoneCmdParamMessageEditor::MessageData(void) const
+	?SetLine2@TPhoneCmdParamCallHeaderData@@QAEXH@Z @ 276 NONAME ; void TPhoneCmdParamCallHeaderData::SetLine2(int)
+	?FetchValuesFromCenRepL@CPhoneCenRepProxy@@QAEXAAVTPhoneCmdParamAppInfo@@W4TKeyCode@@PAVHBufC8@@AAH@Z @ 277 NONAME ; void CPhoneCenRepProxy::FetchValuesFromCenRepL(class TPhoneCmdParamAppInfo &, enum TKeyCode, class HBufC8 *, int &)
+	?CNAPTextClippingDirection@TPhoneCmdParamCallHeaderData@@QBE?AW4TPhoneClippingDirection@CBubbleManager@@XZ @ 278 NONAME ; enum CBubbleManager::TPhoneClippingDirection TPhoneCmdParamCallHeaderData::CNAPTextClippingDirection(void) const
+	?ParticipantCLI@TPhoneCmdParamCallHeaderData@@QBE?AW4TPhoneParticipantListCLI@1@XZ @ 279 NONAME ; enum TPhoneCmdParamCallHeaderData::TPhoneParticipantListCLI TPhoneCmdParamCallHeaderData::ParticipantCLI(void) const
+	?Thumbnail@TPhoneCmdParamCallHeaderData@@QBEPAVCFbsBitmap@@XZ @ 280 NONAME ; class CFbsBitmap * TPhoneCmdParamCallHeaderData::Thumbnail(void) const
+	?SetTimeOut@TPhoneCmdParamQuery@@QAEXH@Z @ 281 NONAME ; void TPhoneCmdParamQuery::SetTimeOut(int)
+	?Boolean@TPhoneCmdParamBoolean@@QBEHXZ @ 282 NONAME ; int TPhoneCmdParamBoolean::Boolean(void) const
+	?LogMsgFromPhoneUIToPE@CPhoneLogger@@QAEXHH@Z @ 283 NONAME ; void CPhoneLogger::LogMsgFromPhoneUIToPE(int, int)
+	?SetCustomMessageId@TPhoneCmdParamAppInfo@@QAEXABVTUid@@@Z @ 284 NONAME ; void TPhoneCmdParamAppInfo::SetCustomMessageId(class TUid const &)
+	?ResolveResourceID@CPhoneResourceResolverBase@@UBEHABH@Z @ 285 NONAME ; int CPhoneResourceResolverBase::ResolveResourceID(int const &) const
+	?SetName@TPhoneCmdParamSfiData@@QAEXABVTDesC16@@@Z @ 286 NONAME ; void TPhoneCmdParamSfiData::SetName(class TDesC16 const &)
+	?TitlePaneResourceId@TPhoneCmdParamSingleItemFetch@@QBEHXZ @ 287 NONAME ; int TPhoneCmdParamSingleItemFetch::TitlePaneResourceId(void) const
+	?SetType@TPhoneCmdParamGlobalNote@@QAEXW4TAknGlobalNoteType@@@Z @ 288 NONAME ; void TPhoneCmdParamGlobalNote::SetType(enum TAknGlobalNoteType)
+	?IncludeVideoCallOption@TPhoneCmdParamReconnectQuery@@QBEHXZ @ 289 NONAME ; int TPhoneCmdParamReconnectQuery::IncludeVideoCallOption(void) const
+	?SetLittleBubbleVisible@TPhoneCmdParamIncallIndicatorData@@QAEXH@Z @ 290 NONAME ; void TPhoneCmdParamIncallIndicatorData::SetLittleBubbleVisible(int)
+	?Ciphering@TPhoneCmdParamCallHeaderData@@QBEHXZ @ 291 NONAME ; int TPhoneCmdParamCallHeaderData::Ciphering(void) const
+	?SetType@TPhoneCmdParamRingTone@@QAEXW4TPhoneRingToneType@@@Z @ 292 NONAME ; void TPhoneCmdParamRingTone::SetType(enum TPhoneRingToneType)
+	?ResourceId@TPhoneCmdParamDynMenu@@QBEHXZ @ 293 NONAME ; int TPhoneCmdParamDynMenu::ResourceId(void) const
+	?SetCipheringIndicatorAllowed@TPhoneCmdParamCallHeaderData@@QAEXH@Z @ 294 NONAME ; void TPhoneCmdParamCallHeaderData::SetCipheringIndicatorAllowed(int)
+	?SetWaitTime@TPhoneCmdParamProgressNote@@QAEXVTTimeIntervalMicroSeconds32@@@Z @ 295 NONAME ; void TPhoneCmdParamProgressNote::SetWaitTime(class TTimeIntervalMicroSeconds32)
+	?Ciphering@TPhoneCmdParamEmergencyCallHeaderData@@QBEHXZ @ 296 NONAME ; int TPhoneCmdParamEmergencyCallHeaderData::Ciphering(void) const
+	??1CPhoneCallThemeMonitor@@UAE@XZ @ 297 NONAME ; CPhoneCallThemeMonitor::~CPhoneCallThemeMonitor(void)
+	?SetNumberType@TPhoneCmdParamCallHeaderData@@QAEXH@Z @ 298 NONAME ; void TPhoneCmdParamCallHeaderData::SetNumberType(int)
+	?Mute@TPhoneCmdParamIncallIndicatorData@@QBEHXZ @ 299 NONAME ; int TPhoneCmdParamIncallIndicatorData::Mute(void) const
+	?IsQwertyInput@CPhoneQwertyHandler@@QBEHXZ @ 300 NONAME ; int CPhoneQwertyHandler::IsQwertyInput(void) const
+	?SetBoolean@TPhoneCmdParamBoolean@@QAEXH@Z @ 301 NONAME ; void TPhoneCmdParamBoolean::SetBoolean(int)
+	?IsTelephonyFeatureSupported@CPhoneResourceResolverBase@@MBEHH@Z @ 302 NONAME ; int CPhoneResourceResolverBase::IsTelephonyFeatureSupported(int) const
+	?Instance@CPhoneMainErrorMessagesHandler@@SAPAV1@XZ @ 303 NONAME ; class CPhoneMainErrorMessagesHandler * CPhoneMainErrorMessagesHandler::Instance(void)
+	?SetViewUid@TPhoneCmdParamAppInfo@@QAEXABVTUid@@@Z @ 304 NONAME ; void TPhoneCmdParamAppInfo::SetViewUid(class TUid const &)
+	?SetServiceId@TPhoneCmdParamCallHeaderData@@QAEXK@Z @ 305 NONAME ; void TPhoneCmdParamCallHeaderData::SetServiceId(unsigned long)
+	?Instance@CPhoneCenRepProxy@@SAPAV1@XZ @ 306 NONAME ; class CPhoneCenRepProxy * CPhoneCenRepProxy::Instance(void)
+	?AddCallFlag@TPhoneCmdParamCallHeaderData@@QAEXW4TPhoneCallTypeFlags@CBubbleManager@@@Z @ 307 NONAME ; void TPhoneCmdParamCallHeaderData::AddCallFlag(enum CBubbleManager::TPhoneCallTypeFlags)
+	?SetQueryType@TPhoneCmdParamQuery@@QAEXW4TPhoneQueryType@@@Z @ 308 NONAME ; void TPhoneCmdParamQuery::SetQueryType(enum TPhoneQueryType)
+	?Value@CPhonePubSubProxy@@QAEHABVTUid@@I@Z @ 309 NONAME ; int CPhonePubSubProxy::Value(class TUid const &, unsigned int)
+	?SetWiredAccAvailable@TPhoneCmdParamAudioAvailability@@QAEXH@Z @ 310 NONAME ; void TPhoneCmdParamAudioAvailability::SetWiredAccAvailable(int)
+	?SetString@TPhoneCmdParamSingleItemFetch@@QAEXPAVTDes16@@@Z @ 311 NONAME ; void TPhoneCmdParamSingleItemFetch::SetString(class TDes16 *)
+	??0TPhoneCmdParamAudioOutput@@QAE@XZ @ 312 NONAME ; TPhoneCmdParamAudioOutput::TPhoneCmdParamAudioOutput(void)
+	?IsCallerImage@TPhoneCmdParamRingTone@@QAEHXZ @ 313 NONAME ; int TPhoneCmdParamRingTone::IsCallerImage(void)
+	??0TPhoneCmdParamQuery@@QAE@XZ @ 314 NONAME ; TPhoneCmdParamQuery::TPhoneCmdParamQuery(void)
+	?SetPhoneNumber@TPhoneCmdParamReconnectQuery@@QAEXVTPtrC16@@@Z @ 315 NONAME ; void TPhoneCmdParamReconnectQuery::SetPhoneNumber(class TPtrC16)
+	?Instance@CPhoneMainResourceResolver@@SAPAV1@XZ @ 316 NONAME ; class CPhoneMainResourceResolver * CPhoneMainResourceResolver::Instance(void)
+	?ServiceId@TPhoneCmdParamSpeedDial@@QBEIXZ @ 317 NONAME ; unsigned int TPhoneCmdParamSpeedDial::ServiceId(void) const
+	??1CPhoneLibraryContainer@@UAE@XZ @ 318 NONAME ; CPhoneLibraryContainer::~CPhoneLibraryContainer(void)
+	?ClearBlackListOnNextKey@CPhoneClearBlacklist@@QAEXXZ @ 319 NONAME ; void CPhoneClearBlacklist::ClearBlackListOnNextKey(void)
+	?Tone@TPhoneCmdParamQuery@@QBEHXZ @ 320 NONAME ; int TPhoneCmdParamQuery::Tone(void) const
+	?SetNumberType@TPhoneCmdParamSpeedDial@@QAEXW4TPhoneNumberType@@@Z @ 321 NONAME ; void TPhoneCmdParamSpeedDial::SetNumberType(enum TPhoneNumberType)
+	?SetRingingType@TPhoneCmdParamRingTone@@QAEXH@Z @ 322 NONAME ; void TPhoneCmdParamRingTone::SetRingingType(int)
+	?CbaResourceId@TPhoneCmdParamSingleItemFetch@@QBEHXZ @ 323 NONAME ; int TPhoneCmdParamSingleItemFetch::CbaResourceId(void) const
+	?SetCiphering@TPhoneCmdParamIncallIndicatorData@@QAEXH@Z @ 324 NONAME ; void TPhoneCmdParamIncallIndicatorData::SetCiphering(int)
+	?SetCipheringIndicatorAllowed@TPhoneCmdParamIncallIndicatorData@@QAEXH@Z @ 325 NONAME ; void TPhoneCmdParamIncallIndicatorData::SetCipheringIndicatorAllowed(int)
+	?NeedToEnableKeylock@CPhoneStorage@@UAEHXZ @ 326 NONAME ; int CPhoneStorage::NeedToEnableKeylock(void)
+	?AudioOutput@TPhoneCmdParamAudioOutput@@QBE?AW4TPEAudioOutput@@XZ @ 327 NONAME ; enum TPEAudioOutput TPhoneCmdParamAudioOutput::AudioOutput(void) const
+	?SetResourceId@TPhoneCmdParamProgressNote@@QAEXH@Z @ 328 NONAME ; void TPhoneCmdParamProgressNote::SetResourceId(int)
+	??0TPhoneCmdParamInteger@@QAE@XZ @ 329 NONAME ; TPhoneCmdParamInteger::TPhoneCmdParamInteger(void)
+	?Type@TPhoneCmdParamSingleItemFetch@@QAE?AW4TFetchType@CPhCntSingleItemFetch@@XZ @ 330 NONAME ; enum CPhCntSingleItemFetch::TFetchType TPhoneCmdParamSingleItemFetch::Type(void)
+	?SetType@TPhoneCmdParamTransEffect@@QAEXW4TPhoneTransEffectType@@@Z @ 331 NONAME ; void TPhoneCmdParamTransEffect::SetType(enum TPhoneTransEffectType)
+	?Bitmap@TPhoneCmdParamBitmap@@QBEPAVCFbsBitmap@@XZ @ 332 NONAME ; class CFbsBitmap * TPhoneCmdParamBitmap::Bitmap(void) const
+	?SetTone@TPhoneCmdParamGlobalNote@@QAEXH@Z @ 333 NONAME ; void TPhoneCmdParamGlobalNote::SetTone(int)
+	?After@CPhoneTimer@@QAEXVTTimeIntervalMicroSeconds32@@VTCallBack@@@Z @ 334 NONAME ; void CPhoneTimer::After(class TTimeIntervalMicroSeconds32, class TCallBack)
+	?ContactMatcher@TPhoneCmdParamReconnectQuery@@QBEPAVCPhCntMatcher@@XZ @ 335 NONAME ; class CPhCntMatcher * TPhoneCmdParamReconnectQuery::ContactMatcher(void) const
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/eabi/phoneuiutilsu.def	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,443 @@
+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
+	_ZN27TPhoneCmdParamMessageEditor14SetMessageDataEP12CMessageData @ 218 NONAME
+	_ZN27TPhoneCmdParamMessageEditorC1Ev @ 219 NONAME
+	_ZN27TPhoneCmdParamMessageEditorC2Ev @ 220 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData10SetCLITextERK7TDesC16N14CBubbleManager23TPhoneClippingDirectionE @ 221 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData10SetPictureERK7TDesC16 @ 222 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData11AddCallFlagEN14CBubbleManager19TPhoneCallTypeFlagsE @ 223 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData11SetCNAPTextERK7TDesC16N14CBubbleManager23TPhoneClippingDirectionE @ 224 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData11SetCallFlagEN14CBubbleManager19TPhoneCallTypeFlagsE @ 225 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData11SetCallTypeEi @ 226 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData12SetCallStateEi @ 227 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData12SetCipheringEi @ 228 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData12SetLabelTextERK7TDesC16 @ 229 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData12SetServiceIdEm @ 230 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData12SetThumbnailEP10CFbsBitmap @ 231 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData13SetCallerTextERK7TDesC16 @ 232 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData13SetNumberTypeEi @ 233 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData14SetContactLinkERK6TDesC8 @ 234 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData15SetHasThumbnailEi @ 235 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData17SetShortLabelTextERK7TDesC16 @ 236 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData20SetRemotePhoneNumberERK7TDesC16 @ 237 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData21SetParticipantListCLIENS_24TPhoneParticipantListCLIE @ 238 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData28SetCipheringIndicatorAllowedEi @ 239 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData8SetLine2Ei @ 240 NONAME
+	_ZN28TPhoneCmdParamCallHeaderDataC1Ev @ 241 NONAME
+	_ZN28TPhoneCmdParamCallHeaderDataC2Ev @ 242 NONAME
+	_ZN28TPhoneCmdParamReconnectQuery14SetPhoneNumberE7TPtrC16 @ 243 NONAME
+	_ZN28TPhoneCmdParamReconnectQuery17SetContactMatcherEP13CPhCntMatcher @ 244 NONAME
+	_ZN28TPhoneCmdParamReconnectQuery21SetIncludeVideoOptionEi @ 245 NONAME
+	_ZN28TPhoneCmdParamReconnectQueryC1ER27MCaUiReconnectQueryObserver @ 246 NONAME
+	_ZN28TPhoneCmdParamReconnectQueryC2ER27MCaUiReconnectQueryObserver @ 247 NONAME
+	_ZN29TPhoneCmdParamSingleItemFetch16SetCbaResourceIdEi @ 248 NONAME
+	_ZN29TPhoneCmdParamSingleItemFetch22SetTitlePaneResourceIdEi @ 249 NONAME
+	_ZN29TPhoneCmdParamSingleItemFetch4TypeEv @ 250 NONAME
+	_ZN29TPhoneCmdParamSingleItemFetch7SetTypeEN21CPhCntSingleItemFetch10TFetchTypeE @ 251 NONAME
+	_ZN29TPhoneCmdParamSingleItemFetch9SetStringEP6TDes16 @ 252 NONAME
+	_ZN29TPhoneCmdParamSingleItemFetchC1Ev @ 253 NONAME
+	_ZN29TPhoneCmdParamSingleItemFetchC2Ev @ 254 NONAME
+	_ZN30CPhoneMainErrorMessagesHandler8InstanceEv @ 255 NONAME
+	_ZN31TPhoneCmdParamAudioAvailability17SetBTAccAvailableEi @ 256 NONAME
+	_ZN31TPhoneCmdParamAudioAvailability20SetWiredAccAvailableEi @ 257 NONAME
+	_ZN31TPhoneCmdParamAudioAvailabilityC1Ev @ 258 NONAME
+	_ZN31TPhoneCmdParamAudioAvailabilityC2Ev @ 259 NONAME
+	_ZN33TPhoneCmdParamIncallIndicatorData12SetCallStateEi @ 260 NONAME
+	_ZN33TPhoneCmdParamIncallIndicatorData12SetCipheringEi @ 261 NONAME
+	_ZN33TPhoneCmdParamIncallIndicatorData12SetEmergencyEi @ 262 NONAME
+	_ZN33TPhoneCmdParamIncallIndicatorData22SetLittleBubbleVisibleEi @ 263 NONAME
+	_ZN33TPhoneCmdParamIncallIndicatorData28SetCipheringIndicatorAllowedEi @ 264 NONAME
+	_ZN33TPhoneCmdParamIncallIndicatorData7SetModeEi @ 265 NONAME
+	_ZN33TPhoneCmdParamIncallIndicatorData7SetMuteEi @ 266 NONAME
+	_ZN33TPhoneCmdParamIncallIndicatorData8SetLine2Ei @ 267 NONAME
+	_ZN33TPhoneCmdParamIncallIndicatorDataC1Ev @ 268 NONAME
+	_ZN33TPhoneCmdParamIncallIndicatorDataC2Ev @ 269 NONAME
+	_ZN33TPhoneCmdParamNumberEntryObserver11SetObserverE9TCallBack @ 270 NONAME
+	_ZN33TPhoneCmdParamNumberEntryObserver8ObserverEv @ 271 NONAME
+	_ZN33TPhoneCmdParamNumberEntryObserverC1Ev @ 272 NONAME
+	_ZN33TPhoneCmdParamNumberEntryObserverC2Ev @ 273 NONAME
+	_ZN37TPhoneCmdParamEmergencyCallHeaderData12SetCipheringEi @ 274 NONAME
+	_ZN37TPhoneCmdParamEmergencyCallHeaderData12SetLabelTextERK7TDesC16 @ 275 NONAME
+	_ZN37TPhoneCmdParamEmergencyCallHeaderData13SetHeaderTextERK7TDesC16 @ 276 NONAME
+	_ZN37TPhoneCmdParamEmergencyCallHeaderData21SetOwnPhoneNumberTextERK7TDesC16 @ 277 NONAME
+	_ZN37TPhoneCmdParamEmergencyCallHeaderData28SetCipheringIndicatorAllowedEi @ 278 NONAME
+	_ZN37TPhoneCmdParamEmergencyCallHeaderDataC1Ev @ 279 NONAME
+	_ZN37TPhoneCmdParamEmergencyCallHeaderDataC2Ev @ 280 NONAME
+	_ZNK13CPhoneStorage17GetBlockedKeyListEv @ 281 NONAME
+	_ZNK17CPhoneCenRepProxy4FindERK4TUidmmR6RArrayImE @ 282 NONAME
+	_ZNK17CPhoneCenRepProxy6GetIntERK4TUidjRi @ 283 NONAME
+	_ZNK17CPhoneCenRepProxy7GetRealERK4TUidjRd @ 284 NONAME
+	_ZNK17CPhoneCenRepProxy9GetStringERK4TUidjR6TDes16 @ 285 NONAME
+	_ZNK18TPhoneCmdParamNote10ResourceIdEv @ 286 NONAME
+	_ZNK18TPhoneCmdParamNote14TextResourceIdEv @ 287 NONAME
+	_ZNK18TPhoneCmdParamNote4TextEv @ 288 NONAME
+	_ZNK18TPhoneCmdParamNote4ToneEv @ 289 NONAME
+	_ZNK18TPhoneCmdParamNote4TypeEv @ 290 NONAME
+	_ZNK18TPhoneCmdParamNote7TimeoutEv @ 291 NONAME
+	_ZNK18TPhoneCommandParam7ParamIdEv @ 292 NONAME
+	_ZNK19CPhoneQwertyHandler13IsQwertyInputEv @ 293 NONAME
+	_ZNK19TPhoneCmdParamQuery10ContentCbaEv @ 294 NONAME
+	_ZNK19TPhoneCmdParamQuery10DefaultCbaEv @ 295 NONAME
+	_ZNK19TPhoneCmdParamQuery11QueryPromptEv @ 296 NONAME
+	_ZNK19TPhoneCmdParamQuery14SendKeyEnabledEv @ 297 NONAME
+	_ZNK19TPhoneCmdParamQuery15QueryResourceIdEv @ 298 NONAME
+	_ZNK19TPhoneCmdParamQuery17CbaCommandMappingEi @ 299 NONAME
+	_ZNK19TPhoneCmdParamQuery25ItemTextArrayForListQueryEv @ 300 NONAME
+	_ZNK19TPhoneCmdParamQuery26GetCustomCommandForTimeOutERi @ 301 NONAME
+	_ZNK19TPhoneCmdParamQuery4ToneEv @ 302 NONAME
+	_ZNK19TPhoneCmdParamQuery7TimeOutEv @ 303 NONAME
+	_ZNK19TPhoneCmdParamQuery8DataTextEv @ 304 NONAME
+	_ZNK19TPhoneCmdParamQuery9QueryTypeEv @ 305 NONAME
+	_ZNK20TPhoneCmdParamBitmap10MaskBitmapEv @ 306 NONAME
+	_ZNK20TPhoneCmdParamBitmap6BitmapEv @ 307 NONAME
+	_ZNK21TPhoneCmdParamAppInfo13CustomMessageEv @ 308 NONAME
+	_ZNK21TPhoneCmdParamAppInfo15CustomMessageIdEv @ 309 NONAME
+	_ZNK21TPhoneCmdParamAppInfo17MultipleInstancesEv @ 310 NONAME
+	_ZNK21TPhoneCmdParamAppInfo5ParamEv @ 311 NONAME
+	_ZNK21TPhoneCmdParamAppInfo6AppUidEv @ 312 NONAME
+	_ZNK21TPhoneCmdParamAppInfo7ViewUidEv @ 313 NONAME
+	_ZNK21TPhoneCmdParamBoolean7BooleanEv @ 314 NONAME
+	_ZNK21TPhoneCmdParamDynMenu10ResourceIdEv @ 315 NONAME
+	_ZNK21TPhoneCmdParamInteger7IntegerEv @ 316 NONAME
+	_ZNK21TPhoneCmdParamPointer7PointerEv @ 317 NONAME
+	_ZNK21TPhoneCmdParamSfiData4NameEv @ 318 NONAME
+	_ZNK21TPhoneCmdParamSfiData6NumberEv @ 319 NONAME
+	_ZNK22CPhoneCallThemeMonitor22CallImageThemeFilePathEv @ 320 NONAME
+	_ZNK22CPhoneCallThemeMonitor22CallImageThemeSettingsEv @ 321 NONAME
+	_ZNK22TPhoneCmdParamKeyEvent8KeyEventEv @ 322 NONAME
+	_ZNK22TPhoneCmdParamKeyEvent9EventCodeEv @ 323 NONAME
+	_ZNK22TPhoneCmdParamRingTone11RingingTypeEv @ 324 NONAME
+	_ZNK22TPhoneCmdParamRingTone4TypeEv @ 325 NONAME
+	_ZNK22TPhoneCmdParamRingTone6VolumeEv @ 326 NONAME
+	_ZNK22TPhoneCmdParamRingTone8RingToneEv @ 327 NONAME
+	_ZNK22TPhoneCmdParamRingTone9TextToSayEv @ 328 NONAME
+	_ZNK23TPhoneCmdParamSpeedDial9ServiceIdEv @ 329 NONAME
+	_ZNK24TPhoneCmdParamGlobalNote12WaitForReadyEv @ 330 NONAME
+	_ZNK24TPhoneCmdParamGlobalNote14TextResourceIdEv @ 331 NONAME
+	_ZNK24TPhoneCmdParamGlobalNote4TextEv @ 332 NONAME
+	_ZNK24TPhoneCmdParamGlobalNote4ToneEv @ 333 NONAME
+	_ZNK24TPhoneCmdParamGlobalNote4TypeEv @ 334 NONAME
+	_ZNK24TPhoneCmdParamGlobalNote8SoftkeysEv @ 335 NONAME
+	_ZNK24TPhoneCmdParamKeyCapture11CaptureTypeEv @ 336 NONAME
+	_ZNK24TPhoneCmdParamKeyCapture3KeyEv @ 337 NONAME
+	_ZNK24TPhoneCmdParamKeyCapture7KeyCodeEv @ 338 NONAME
+	_ZNK25TPhoneCmdParamAudioOutput11AudioOutputEv @ 339 NONAME
+	_ZNK25TPhoneCmdParamTransEffect4TypeEv @ 340 NONAME
+	_ZNK26CPhoneResourceResolverBase17ResolveResourceIDERKi @ 341 NONAME
+	_ZNK26CPhoneResourceResolverBase27IsTelephonyFeatureSupportedEi @ 342 NONAME
+	_ZNK26TPhoneCmdParamProgressNote10ResourceIdEv @ 343 NONAME
+	_ZNK26TPhoneCmdParamProgressNote8WaitTimeEv @ 344 NONAME
+	_ZNK27TPhoneCmdParamCallStateData6CallIdEv @ 345 NONAME
+	_ZNK27TPhoneCmdParamCallStateData9CallStateEv @ 346 NONAME
+	_ZNK27TPhoneCmdParamMessageEditor11MessageDataEv @ 347 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData10CallerTextEv @ 348 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData10NumberTypeEv @ 349 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData11ContactLinkEv @ 350 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData12HasThumbnailEv @ 351 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData14ParticipantCLIEv @ 352 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData14ShortLabelTextEv @ 353 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData17RemotePhoneNumberEv @ 354 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData24CLITextClippingDirectionEv @ 355 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData25CNAPTextClippingDirectionEv @ 356 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData25CipheringIndicatorAllowedEv @ 357 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData5Line2Ev @ 358 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData7CLITextEv @ 359 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData7PictureEv @ 360 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData8CNAPTextEv @ 361 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData8CallFlagEv @ 362 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData8CallTypeEv @ 363 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData9CallStateEv @ 364 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData9CipheringEv @ 365 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData9LabelTextEv @ 366 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData9ServiceIdEv @ 367 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData9ThumbnailEv @ 368 NONAME
+	_ZNK28TPhoneCmdParamReconnectQuery11PhoneNumberEv @ 369 NONAME
+	_ZNK28TPhoneCmdParamReconnectQuery14ContactMatcherEv @ 370 NONAME
+	_ZNK28TPhoneCmdParamReconnectQuery22IncludeVideoCallOptionEv @ 371 NONAME
+	_ZNK28TPhoneCmdParamReconnectQuery22ReconnectQueryObserverEv @ 372 NONAME
+	_ZNK29TPhoneCmdParamSingleItemFetch13CbaResourceIdEv @ 373 NONAME
+	_ZNK29TPhoneCmdParamSingleItemFetch19TitlePaneResourceIdEv @ 374 NONAME
+	_ZNK29TPhoneCmdParamSingleItemFetch6StringEv @ 375 NONAME
+	_ZNK31TPhoneCmdParamAudioAvailability16IsBTAccAvailableEv @ 376 NONAME
+	_ZNK31TPhoneCmdParamAudioAvailability19IsWiredAccAvailableEv @ 377 NONAME
+	_ZNK33TPhoneCmdParamIncallIndicatorData19LittleBubbleVisibleEv @ 378 NONAME
+	_ZNK33TPhoneCmdParamIncallIndicatorData25CipheringIndicatorAllowedEv @ 379 NONAME
+	_ZNK33TPhoneCmdParamIncallIndicatorData4ModeEv @ 380 NONAME
+	_ZNK33TPhoneCmdParamIncallIndicatorData4MuteEv @ 381 NONAME
+	_ZNK33TPhoneCmdParamIncallIndicatorData5Line2Ev @ 382 NONAME
+	_ZNK33TPhoneCmdParamIncallIndicatorData9CallStateEv @ 383 NONAME
+	_ZNK33TPhoneCmdParamIncallIndicatorData9CipheringEv @ 384 NONAME
+	_ZNK33TPhoneCmdParamIncallIndicatorData9EmergencyEv @ 385 NONAME
+	_ZNK37TPhoneCmdParamEmergencyCallHeaderData10HeaderTextEv @ 386 NONAME
+	_ZNK37TPhoneCmdParamEmergencyCallHeaderData18OwnPhoneNumberTextEv @ 387 NONAME
+	_ZNK37TPhoneCmdParamEmergencyCallHeaderData25CipheringIndicatorAllowedEv @ 388 NONAME
+	_ZNK37TPhoneCmdParamEmergencyCallHeaderData9CipheringEv @ 389 NONAME
+	_ZNK37TPhoneCmdParamEmergencyCallHeaderData9LabelTextEv @ 390 NONAME
+	_ZTI11CPhoneTimer @ 391 NONAME
+	_ZTI12CPhoneLogger @ 392 NONAME
+	_ZTI13CPhoneStorage @ 393 NONAME
+	_ZTI17CPhoneCenRepProxy @ 394 NONAME
+	_ZTI17CPhonePubSubProxy @ 395 NONAME
+	_ZTI18CPhoneMethodLogger @ 396 NONAME
+	_ZTI19CPhoneQwertyHandler @ 397 NONAME
+	_ZTI20CPhoneClearBlacklist @ 398 NONAME
+	_ZTI20CPhoneRecoverySystem @ 399 NONAME
+	_ZTI22CPhoneCallThemeMonitor @ 400 NONAME
+	_ZTI22CPhoneLibraryContainer @ 401 NONAME
+	_ZTI23CPhoneQwertyModeMonitor @ 402 NONAME
+	_ZTI24CPhoneCenRepEventHandler @ 403 NONAME
+	_ZTI24CPhoneLangSettingMonitor @ 404 NONAME
+	_ZTI25CPhonePublishSubscriberAO @ 405 NONAME
+	_ZTI26CPhoneMainResourceResolver @ 406 NONAME
+	_ZTI26CPhoneResourceResolverBase @ 407 NONAME
+	_ZTI30CPhoneMainErrorMessagesHandler @ 408 NONAME
+	_ZTV11CPhoneTimer @ 409 NONAME
+	_ZTV12CPhoneLogger @ 410 NONAME
+	_ZTV13CPhoneStorage @ 411 NONAME
+	_ZTV17CPhoneCenRepProxy @ 412 NONAME
+	_ZTV17CPhonePubSubProxy @ 413 NONAME
+	_ZTV18CPhoneMethodLogger @ 414 NONAME
+	_ZTV19CPhoneQwertyHandler @ 415 NONAME
+	_ZTV20CPhoneClearBlacklist @ 416 NONAME
+	_ZTV20CPhoneRecoverySystem @ 417 NONAME
+	_ZTV22CPhoneCallThemeMonitor @ 418 NONAME
+	_ZTV22CPhoneLibraryContainer @ 419 NONAME
+	_ZTV23CPhoneQwertyModeMonitor @ 420 NONAME
+	_ZTV24CPhoneCenRepEventHandler @ 421 NONAME
+	_ZTV24CPhoneLangSettingMonitor @ 422 NONAME
+	_ZTV25CPhonePublishSubscriberAO @ 423 NONAME
+	_ZTV26CPhoneMainResourceResolver @ 424 NONAME
+	_ZTV26CPhoneResourceResolverBase @ 425 NONAME
+	_ZTV30CPhoneMainErrorMessagesHandler @ 426 NONAME
+	_ZThn4_N12CPhoneLoggerD0Ev @ 427 NONAME
+	_ZThn4_N12CPhoneLoggerD1Ev @ 428 NONAME
+	_ZThn4_N13CPhoneStorage14IsScreenLockedEv @ 429 NONAME
+	_ZThn4_N13CPhoneStorage15SetScreenLockedEi @ 430 NONAME
+	_ZThn4_N13CPhoneStorage19NeedToEnableKeylockEv @ 431 NONAME
+	_ZThn4_N13CPhoneStorage20ResetBlockedKeysListEv @ 432 NONAME
+	_ZThn4_N13CPhoneStorage22AppendBlockedKeysListLE12TStdScanCode @ 433 NONAME
+	_ZThn4_N13CPhoneStorage22IsBlockedKeysListEmptyEv @ 434 NONAME
+	_ZThn4_N13CPhoneStorage22SetNeedToEnableKeylockEi @ 435 NONAME
+	_ZThn4_N13CPhoneStorageD0Ev @ 436 NONAME
+	_ZThn4_N13CPhoneStorageD1Ev @ 437 NONAME
+	_ZThn4_N26CPhoneResourceResolverBaseD0Ev @ 438 NONAME
+	_ZThn4_N26CPhoneResourceResolverBaseD1Ev @ 439 NONAME
+	_ZThn4_NK13CPhoneStorage17GetBlockedKeyListEv @ 440 NONAME
+	_ZThn4_NK26CPhoneResourceResolverBase17ResolveResourceIDERKi @ 441 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  
+*     PhoneUIUtils module project specification file.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+// Capability assignment.
+CAPABILITY CAP_APPLICATION MultiMediaDD PowerMgmt NetworkControl DRM DiskAdmin
+
+// 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
+SOURCE          tphonecmdparammessageeditor.cpp
+SOURCE          tphonecmdparamnote.cpp
+SOURCE          tphonecmdparamprogressnote.cpp
+SOURCE          tphonecmdparamquery.cpp
+SOURCE          tphonecmdparamreconnectquery.cpp
+SOURCE          tphonecmdparamringtone.cpp
+SOURCE          tphonecmdparamsfidata.cpp
+SOURCE          tphonecmdparamsingleitemfetch.cpp
+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     ../../phoneui/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
+LIBRARY         cauiengine.lib
+#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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,110 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*    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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/ctelewaitingidle.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*    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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,495 @@
+/*
+* 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;
+
+// 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; 
+
+
+#endif  // PHONECONSTANTS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/phonelogger.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,425 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -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/phonerssbase.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,398 @@
+/*
+* 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
+
+    // Last
+    EPhoneRssBaseLast
+    };
+
+#endif      // PHONERSSBASE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/phonerssgsm.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,420 @@
+/*
+* 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 "tphonecommandparam.h"
+#include "phoneconstants.h"
+#include "bmbubblemanager.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,                
+            };
+           
+    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, 
+                                  CBubbleManager::TPhoneClippingDirection 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,
+                CBubbleManager::TPhoneClippingDirection aDirection );
+
+        /**
+        * Sets the call header picture
+        * @param aPicture is the picture data
+        */
+        IMPORT_C void SetPicture( const TDesC& aPicture );
+        
+        /**
+        * Sets the call flag
+        * @param call flag
+        */
+        IMPORT_C void SetCallFlag( 
+            CBubbleManager::TPhoneCallTypeFlags aCallFlag );
+            
+        /**
+        * Sets the call header line2 status.
+        * @param aLine2 is ETrue if line2 is active.
+        */
+        IMPORT_C void SetLine2( TBool aLine2 );
+            
+        /**
+        * Adds the call flag
+        * @param call flag
+        */
+        IMPORT_C void AddCallFlag( 
+            CBubbleManager::TPhoneCallTypeFlags aCallFlag );
+
+        /**
+        * 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 CBubbleManager::TPhoneClippingDirection CLITextClippingDirection() const;
+
+        /**
+         * Returns the clipping direction of the CNAP text.
+         * @return  Clipping direction of the CNAP text.
+         */
+        IMPORT_C CBubbleManager::TPhoneClippingDirection 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 the call flag
+        * @return Returns the call flag
+        */
+        IMPORT_C TUint32 CallFlag() 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.
+         */
+        CBubbleManager::TPhoneClippingDirection iCLITextClippingDirection;
+        
+        /**
+         * Clipping direction of the CLI text.
+         */
+        CBubbleManager::TPhoneClippingDirection iCNAPTextClippingDirection;
+        
+        /**
+        * Call header CNAP Text
+        */
+        TBuf<KCntMaxTextFieldLength> iCNAPText;
+
+        /**
+        * Call header picture data
+        */
+        TPtrC iPicture;
+        
+        /**
+        * Call flag
+        */
+        TUint32     iCallFlag;
+        
+        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;
+    };
+
+#endif // __TPHONECMDPARAMCALLHEADERDATA_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamcallstatedata.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,140 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,156 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 );
+
+        
+        /**
+        * 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;      
+ 
+    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;
+
+    };
+
+#endif // __TPHONECMDPARAMGLOBALNOTE_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamincallindicatordata.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,320 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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.
+        * 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,197 @@
+/*
+* 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() );
+    
+    // Start listen changes in setting and image path
+    CPhoneCenRepProxy::Instance()->NotifyChangeL(
+        KCRUidThemes, 
+        KThemesCallImagePath,
+        this );
+    
+    CPhoneCenRepProxy::Instance()->NotifyChangeL(
+        KCRUidThemes, 
+        KThemesCallImageSetting,
+        this );
+    }
+
+// -----------------------------------------------------------------------------
+// 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() );
+        
+        // Get image file path
+        CPhoneCenRepProxy::Instance()->GetString(
+            KCRUidThemes,
+            KThemesCallImagePath,
+            imagePtr );
+
+        __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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,132 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,730 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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() );
+
+    iCenRepAccessoryEventHandler = CPhoneCenRepEventHandler::NewL( 
+        KCRUidAccessorySettings );
+    iCenRepNetworkEventHandler = CPhoneCenRepEventHandler::NewL( 
+        KCRUidNetworkSettings );
+    iCenRepThemesEventHandler = CPhoneCenRepEventHandler::NewL( 
+        KCRUidThemes );
+    iCenRepLanguageEventHandler = CPhoneCenRepEventHandler::NewL( 
+        KCRUidAknFep );
+    iCenRepQwertyEventHandler = CPhoneCenRepEventHandler::NewL( 
+        KCRUidAvkon );
+    iCenRepKDRMHelperEventHandler = CPhoneCenRepEventHandler::NewL( 
+        KCRUidDRMHelperServer );
+    }
+
+// ---------------------------------------------------------
+// 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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( CPhoneCenRepProxy::Instance()->GetInt(
+        KCRUidAknFep,
+        KAknFepInputTxtLang,
+        language ));
+    
+    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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,196 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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()
+    {
+    // Current Call state.
+    iQwertyMode = GetQwertyMode();
+
+    CPhonePubSubProxy::Instance()->NotifyChangeL(
+        KCRUidAvkon, 
+        KAknQwertyInputModeActive,
+        this );
+
+     iKeyboard = GetKeyboard();
+    
+#ifdef RD_INTELLIGENT_TEXT_INPUT
+    CPhonePubSubProxy::Instance()->NotifyChangeL(
+        KCRUidAvkon, 
+        KAknKeyBoardLayout,
+        this );
+#endif
+    }
+
+// -----------------------------------------------------------------------------
+// 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 ) );
+    
+    return qwertyMode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneQwertyModeMonitor::GetQwertyMode
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneQwertyModeMonitor::GetKeyboard() const
+    {
+    // Get call state.
+    TInt keyboard( CPhonePubSubProxy::Instance()->Value(
+        KCRUidAvkon,
+        KAknKeyBoardLayout ) );
+    
+    return keyboard;
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/cphonerecoverysystem.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,1531 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <phoneui.rsg>
+#include <callhandlingui.rsg>
+#include <phoneuitouch.rsg>
+#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_INCALL_DIALER_CBA;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CALLHANDLING_INCALL_HANDSET_CBA;
+                }
+            break;
+
+        case EPhoneCallHandlingInCallBtaaCBA:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUI_INCALL_DIALER_CBA;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CALLHANDLING_INCALL_BTAA_CBA;
+                }
+
+            break;
+
+        case EPhoneCallHandlingEmergencyCBA:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUI_INCALL_DIALER_CBA;
+                }
+            else
+                {
+                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_QTN_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;
+
+        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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,25 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,167 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,503 @@
+/*
+* 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 ),
+    iCallFlag( CBubbleManager::ENormal ),
+    iLine2 ( EFalse ),
+    iThumbnail( NULL ),
+    iCallerText( KNullDesC ),
+    iParticipantListCLI( EPhoneParticipantCLIText ),
+    iCipheringIndicatorAllowed( ETrue ),
+    iContactLink( KNullDesC8 ),
+    iRemotePhoneNumber( KNullDesC )
+    {
+    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,
+   CBubbleManager::TPhoneClippingDirection 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,
+   CBubbleManager::TPhoneClippingDirection 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::SetCallFlag(
+    const CBubbleManager::TPhoneCallTypeFlags aCallFlag )
+    {
+    iCallFlag = aCallFlag;        
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::AddCallFlag
+// Adds the call flag
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallHeaderData::AddCallFlag(
+    const CBubbleManager::TPhoneCallTypeFlags aCallFlag )
+    {
+    iCallFlag |= aCallFlag;
+    }
+
+// ---------------------------------------------------------
+// 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 CBubbleManager::TPhoneClippingDirection 
+TPhoneCmdParamCallHeaderData::CLITextClippingDirection() const
+    {
+    return iCLITextClippingDirection;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::CNAPTextClippingDirection
+// Returns the clipping direction of the CNAP text.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C CBubbleManager::TPhoneClippingDirection 
+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 TUint32
+    TPhoneCmdParamCallHeaderData::CallFlag() const
+    {
+    return iCallFlag;        
+    }
+
+// ---------------------------------------------------------
+// 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,180 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 )
+    {
+    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::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;
+   }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamincallindicatordata.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,437 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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
+   	{
+   	__ASSERT_DEBUG( iDataText, Panic( EPhoneUtilsInvariant ) );
+   	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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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: Touch button configuration.
+*
+*/
+
+// INCLUDE FILES
+#include "cphonecenrepproxy.h"
+#include <callhandlingui.rsg>
+#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 )
+    {
+    TResourceReader reader;
+    CCoeEnv::Static()->CreateResourceReaderLC( 
+            reader, 
+            R_PHONEUI_TOUCH_BUTTON_CONFIG );
+
+    TInt configItemCount = reader.ReadInt16();
+    for ( TInt i=0; i < configItemCount; i++ )
+        {
+        TInt buttonSetId = reader.ReadInt16();
+        TInt buttonSetCount = reader.ReadInt16();
+        for ( TInt j=0; j < buttonSetCount ; j++ )
+            {
+            TInt buttonSetResourceId = reader.ReadInt32();
+            if ( j == aKeyValues[ buttonSetId ] )
+                {
+                iConfiguration[ buttonSetId ] = buttonSetResourceId;
+                }
+            }
+        }
+    
+    CleanupStack::PopAndDestroy(); // reader
+    }
+
+// ---------------------------------------------------------------------------
+// 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/phoneuiview/bwins/phoneuiviewu.def	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,27 @@
+EXPORTS
+	?HandleResourceChangeL@CPhoneViewController@@QAEXH@Z @ 1 NONAME ; void CPhoneViewController::HandleResourceChangeL(int)
+	?ExecuteCommand@CPhoneViewController@@UAEXHPAVTPhoneCommandParam@@@Z @ 2 NONAME ; void CPhoneViewController::ExecuteCommand(int, class TPhoneCommandParam *)
+	?DoFetchForegroundApplicationWindowGroupIdL@CPhoneViewController@@SAHAAVCEikonEnv@@@Z @ 3 NONAME ; int CPhoneViewController::DoFetchForegroundApplicationWindowGroupIdL(class CEikonEnv &)
+	?ExecuteCommandL@CPhoneViewController@@UAEXHHPAVTPhoneCommandParam@@@Z @ 4 NONAME ; void CPhoneViewController::ExecuteCommandL(int, int, class TPhoneCommandParam *)
+	?SetBlockingDialogIsDisplayed@CPhoneViewController@@UAEXH@Z @ 5 NONAME ; void CPhoneViewController::SetBlockingDialogIsDisplayed(int)
+	?BlockingDialogIsDisplayed@CPhoneViewController@@QBEHXZ @ 6 NONAME ; int CPhoneViewController::BlockingDialogIsDisplayed(void) const
+	?NewL@CPhoneSingleItemFetch@@SAPAV1@AAVCEikonEnv@@AAVCPhoneViewController@@AAVCPhoneContactController@@AAVCPhoneStatusPane@@@Z @ 7 NONAME ; class CPhoneSingleItemFetch * CPhoneSingleItemFetch::NewL(class CEikonEnv &, class CPhoneViewController &, class CPhoneContactController &, class CPhoneStatusPane &)
+	?HelpContext@CPhoneViewController@@QAEABVTDesC16@@XZ @ 8 NONAME ; class TDesC16 const & CPhoneViewController::HelpContext(void)
+	?ExecuteCommandL@CPhoneViewController@@UAEXHH@Z @ 9 NONAME ; void CPhoneViewController::ExecuteCommandL(int, int)
+	?IdleWindowGroupId@CPhoneViewController@@QAEHXZ @ 10 NONAME ; int CPhoneViewController::IdleWindowGroupId(void)
+	?ExecuteCommandL@CPhoneViewController@@UAEXHHAAVTDesC16@@@Z @ 11 NONAME ; void CPhoneViewController::ExecuteCommandL(int, int, class TDesC16 &)
+	?PhoneView@CPhoneViewController@@QAEPAVCPhoneView@@XZ @ 12 NONAME ; class CPhoneView * CPhoneViewController::PhoneView(void)
+	?SetHiddenL@CPhoneViewController@@QAEXH@Z @ 13 NONAME ; void CPhoneViewController::SetHiddenL(int)
+	?HandleLayoutChange@CPhoneViewController@@QAEXVTRect@@@Z @ 14 NONAME ; void CPhoneViewController::HandleLayoutChange(class TRect)
+	?HandleCommandL@CPhoneViewController@@UAEHHPAVTPhoneCommandParam@@@Z @ 15 NONAME ; int CPhoneViewController::HandleCommandL(int, class TPhoneCommandParam *)
+	?ApplicationWindowGroupId@CPhoneViewController@@QAEHXZ @ 16 NONAME ; int CPhoneViewController::ApplicationWindowGroupId(void)
+	?NewL@CPhoneViewController@@SAPAV1@VTRect@@@Z @ 17 NONAME ; class CPhoneViewController * CPhoneViewController::NewL(class TRect)
+	?ExecuteCommand@CPhoneViewController@@UAEXH@Z @ 18 NONAME ; void CPhoneViewController::ExecuteCommand(int)
+	?ForegroundApplicationWindowGroupId@CPhoneViewController@@QAEHXZ @ 19 NONAME ; int CPhoneViewController::ForegroundApplicationWindowGroupId(void)
+	?StatusPaneDisplayed@CPhoneViewController@@QAEHXZ @ 20 NONAME ; int CPhoneViewController::StatusPaneDisplayed(void)
+	??1CPhoneViewController@@UAE@XZ @ 21 NONAME ; CPhoneViewController::~CPhoneViewController(void)
+	?ExecuteCommandL@CPhoneViewController@@UAEXH@Z @ 22 NONAME ; void CPhoneViewController::ExecuteCommandL(int)
+	?ExecuteCommandL@CPhoneViewController@@UAEXHPAVTPhoneCommandParam@@@Z @ 23 NONAME ; void CPhoneViewController::ExecuteCommandL(int, class TPhoneCommandParam *)
+	?FetchContent@CPhoneViewController@@UAEABVTDesC16@@XZ @ 24 NONAME ; class TDesC16 const & CPhoneViewController::FetchContent(void)
+	?HandleCommandL@CPhoneViewController@@UAEHH@Z @ 25 NONAME ; int CPhoneViewController::HandleCommandL(int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/eabi/phoneuiviewu.def	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,107 @@
+EXPORTS
+	_ZN20CPhoneViewController10SetHiddenLEi @ 1 NONAME
+	_ZN20CPhoneViewController11HelpContextEv @ 2 NONAME
+	_ZN20CPhoneViewController12FetchContentEv @ 3 NONAME
+	_ZN20CPhoneViewController14ExecuteCommandEi @ 4 NONAME
+	_ZN20CPhoneViewController14ExecuteCommandEiP18TPhoneCommandParam @ 5 NONAME
+	_ZN20CPhoneViewController14HandleCommandLEi @ 6 NONAME
+	_ZN20CPhoneViewController14HandleCommandLEiP18TPhoneCommandParam @ 7 NONAME
+	_ZN20CPhoneViewController15ExecuteCommandLEi @ 8 NONAME
+	_ZN20CPhoneViewController15ExecuteCommandLEiP18TPhoneCommandParam @ 9 NONAME
+	_ZN20CPhoneViewController15ExecuteCommandLEii @ 10 NONAME
+	_ZN20CPhoneViewController15ExecuteCommandLEiiP18TPhoneCommandParam @ 11 NONAME
+	_ZN20CPhoneViewController15ExecuteCommandLEiiR7TDesC16 @ 12 NONAME
+	_ZN20CPhoneViewController17IdleWindowGroupIdEv @ 13 NONAME
+	_ZN20CPhoneViewController18HandleLayoutChangeE5TRect @ 14 NONAME
+	_ZN20CPhoneViewController19StatusPaneDisplayedEv @ 15 NONAME
+	_ZN20CPhoneViewController21HandleResourceChangeLEi @ 16 NONAME
+	_ZN20CPhoneViewController24ApplicationWindowGroupIdEv @ 17 NONAME
+	_ZN20CPhoneViewController28SetBlockingDialogIsDisplayedEi @ 18 NONAME
+	_ZN20CPhoneViewController34ForegroundApplicationWindowGroupIdEv @ 19 NONAME
+	_ZN20CPhoneViewController42DoFetchForegroundApplicationWindowGroupIdLER9CEikonEnv @ 20 NONAME
+	_ZN20CPhoneViewController4NewLE5TRect @ 21 NONAME
+	_ZN20CPhoneViewController9PhoneViewEv @ 22 NONAME
+	_ZN21CPhoneSingleItemFetch4NewLER9CEikonEnvR20CPhoneViewControllerR23CPhoneContactControllerR16CPhoneStatusPane @ 23 NONAME
+	_ZNK20CPhoneViewController25BlockingDialogIsDisplayedEv @ 24 NONAME
+	_ZTI10CPhoneNote @ 25 NONAME
+	_ZTI10CPhoneView @ 26 NONAME
+	_ZTI15CPhoneTextQuery @ 27 NONAME
+	_ZTI16CPhoneDialerView @ 28 NONAME
+	_ZTI16CPhoneStatusPane @ 29 NONAME
+	_ZTI17CPhoneAudioPlayer @ 30 NONAME
+	_ZTI17CPhoneQueryDialog @ 31 NONAME
+	_ZTI17CPhoneRingingTone @ 32 NONAME
+	_ZTI17CPhoneVmbxHandler @ 33 NONAME
+	_ZTI18CPhoneProgressNote @ 34 NONAME
+	_ZTI19CPhoneBubbleMapping @ 35 NONAME
+	_ZTI19CPhoneBubbleWrapper @ 36 NONAME
+	_ZTI19CPhoneTextTitlePane @ 37 NONAME
+	_ZTI20CPhoneMenuController @ 38 NONAME
+	_ZTI20CPhoneNoteController @ 39 NONAME
+	_ZTI20CPhoneUIDisabledNote @ 40 NONAME
+	_ZTI20CPhoneViewController @ 41 NONAME
+	_ZTI21CPhoneApplicationExit @ 42 NONAME
+	_ZTI21CPhoneAudioController @ 43 NONAME
+	_ZTI21CPhoneBubbleExtension @ 44 NONAME
+	_ZTI21CPhoneDtmfSendingNote @ 45 NONAME
+	_ZTI21CPhoneIncallIndicator @ 46 NONAME
+	_ZTI21CPhoneListQueryDialog @ 47 NONAME
+	_ZTI21CPhoneQueryController @ 48 NONAME
+	_ZTI21CPhoneSingleItemFetch @ 49 NONAME
+	_ZTI23CPhoneContactController @ 50 NONAME
+	_ZTI25CPhoneBubbleExtensionData @ 51 NONAME
+	_ZTI25CPhoneDtmfNumberListQuery @ 52 NONAME
+	_ZTI25CPhoneRingingTonePlayerAO @ 53 NONAME
+	_ZTI26CPhoneKeyCaptureController @ 54 NONAME
+	_ZTI28CPhoneBubbleExtensionManager @ 55 NONAME
+	_ZTI29CPhoneCallHeaderTextAnimation @ 56 NONAME
+	_ZTIN21CPhoneApplicationExit11CElementUidE @ 57 NONAME
+	_ZTIN21CPhoneApplicationExit13CElementBasicE @ 58 NONAME
+	_ZTIN21CPhoneApplicationExit13CElementDriveE @ 59 NONAME
+	_ZTV10CPhoneNote @ 60 NONAME
+	_ZTV10CPhoneView @ 61 NONAME
+	_ZTV15CPhoneTextQuery @ 62 NONAME
+	_ZTV16CPhoneDialerView @ 63 NONAME
+	_ZTV16CPhoneStatusPane @ 64 NONAME
+	_ZTV17CPhoneAudioPlayer @ 65 NONAME
+	_ZTV17CPhoneQueryDialog @ 66 NONAME
+	_ZTV17CPhoneRingingTone @ 67 NONAME
+	_ZTV17CPhoneVmbxHandler @ 68 NONAME
+	_ZTV18CPhoneProgressNote @ 69 NONAME
+	_ZTV19CPhoneBubbleMapping @ 70 NONAME
+	_ZTV19CPhoneBubbleWrapper @ 71 NONAME
+	_ZTV19CPhoneTextTitlePane @ 72 NONAME
+	_ZTV20CPhoneMenuController @ 73 NONAME
+	_ZTV20CPhoneNoteController @ 74 NONAME
+	_ZTV20CPhoneUIDisabledNote @ 75 NONAME
+	_ZTV20CPhoneViewController @ 76 NONAME
+	_ZTV21CPhoneApplicationExit @ 77 NONAME
+	_ZTV21CPhoneAudioController @ 78 NONAME
+	_ZTV21CPhoneBubbleExtension @ 79 NONAME
+	_ZTV21CPhoneDtmfSendingNote @ 80 NONAME
+	_ZTV21CPhoneIncallIndicator @ 81 NONAME
+	_ZTV21CPhoneListQueryDialog @ 82 NONAME
+	_ZTV21CPhoneQueryController @ 83 NONAME
+	_ZTV21CPhoneSingleItemFetch @ 84 NONAME
+	_ZTV23CPhoneContactController @ 85 NONAME
+	_ZTV25CPhoneBubbleExtensionData @ 86 NONAME
+	_ZTV25CPhoneDtmfNumberListQuery @ 87 NONAME
+	_ZTV25CPhoneRingingTonePlayerAO @ 88 NONAME
+	_ZTV26CPhoneKeyCaptureController @ 89 NONAME
+	_ZTV28CPhoneBubbleExtensionManager @ 90 NONAME
+	_ZTV29CPhoneCallHeaderTextAnimation @ 91 NONAME
+	_ZTVN21CPhoneApplicationExit11CElementUidE @ 92 NONAME
+	_ZTVN21CPhoneApplicationExit13CElementBasicE @ 93 NONAME
+	_ZTVN21CPhoneApplicationExit13CElementDriveE @ 94 NONAME
+	_ZThn12_N20CPhoneViewController28SetBlockingDialogIsDisplayedEi @ 95 NONAME
+	_ZThn4_N20CPhoneViewController12FetchContentEv @ 96 NONAME
+	_ZThn4_N20CPhoneViewController14ExecuteCommandEi @ 97 NONAME
+	_ZThn4_N20CPhoneViewController14ExecuteCommandEiP18TPhoneCommandParam @ 98 NONAME
+	_ZThn4_N20CPhoneViewController14HandleCommandLEi @ 99 NONAME
+	_ZThn4_N20CPhoneViewController14HandleCommandLEiP18TPhoneCommandParam @ 100 NONAME
+	_ZThn4_N20CPhoneViewController15ExecuteCommandLEi @ 101 NONAME
+	_ZThn4_N20CPhoneViewController15ExecuteCommandLEiP18TPhoneCommandParam @ 102 NONAME
+	_ZThn4_N20CPhoneViewController15ExecuteCommandLEii @ 103 NONAME
+	_ZThn4_N20CPhoneViewController15ExecuteCommandLEiiP18TPhoneCommandParam @ 104 NONAME
+	_ZThn4_N20CPhoneViewController15ExecuteCommandLEiiR7TDesC16 @ 105 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  PhoneUiView bld file
+*
+*/
+
+#ifdef RD_PHONE_NG
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+
+DEFAULT
+
+PRJ_EXPORTS
+
+
+// Stub SIS files:
+../group/phoneuiview_stub.sis                   /epoc32/data/z/system/install/phoneuiview_stub.sis
+
+PRJ_MMPFILES
+phoneuiview.mmp
+
+#endif // RD_PHONE_NG
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/group/phoneuiview.mmp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,167 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View subcomponent of PhoneUI
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+// Capability assignment.
+CAPABILITY CAP_APPLICATION MultiMediaDD PowerMgmt NetworkControl DRM DiskAdmin
+
+// Assign Vendor ID.
+VENDORID VID_DEFAULT
+
+TARGET          phoneuiview.dll
+TARGETTYPE      dll
+UID             0x1000008d 0x101F4D18
+
+SOURCEPATH      ../src
+
+SOURCE          cphoneapplicationexit.cpp
+SOURCE          cphoneaudiocontroller.cpp
+SOURCE          cphoneaudioplayer.cpp
+SOURCE          cphonebubblemapping.cpp
+SOURCE          cphonebubblewrapper.cpp
+SOURCE          cphonecallheadertextanimation.cpp
+SOURCE          cphonecontactcontroller.cpp
+SOURCE          cphonedtmfsendingnote.cpp
+SOURCE          cphoneincallindicator.cpp
+SOURCE          cphonekeycapturecontroller.cpp
+SOURCE          cphonemenucontroller.cpp
+SOURCE          cphonenote.cpp
+SOURCE          cphoneuidisablednote.cpp
+SOURCE          cphonenotecontroller.cpp
+SOURCE          cphoneprogressnote.cpp
+SOURCE          cphonequerycontroller.cpp
+SOURCE          cphonequerydialog.cpp
+SOURCE          cphoneringingtone.cpp
+SOURCE          cphoneringingtoneplayerao.cpp
+SOURCE          cphonestatuspane.cpp
+SOURCE          cphonetextquery.cpp
+SOURCE          cphoneview.cpp
+SOURCE          cphonedialerview.cpp
+SOURCE          cphoneviewcontroller.cpp
+SOURCE          cphonevmbxhandler.cpp
+SOURCE          cphonedtmfnumberlistquery.cpp
+SOURCE          cphonebuttonscontroller.cpp
+SOURCE          cphonesingleitemfetch.cpp
+SOURCE          cphonedialercontroller.cpp
+SOURCE          cphonelistquerydialog.cpp
+SOURCE          cphonenumberentry.cpp 
+SOURCE          phonebubbleextensionmanager.cpp 
+SOURCE          phonebubbleextension.cpp 
+SOURCE          phonebubbleextensiondata.cpp
+SOURCE          cphonetoolbarcontroller.cpp
+
+
+/* Languages */
+LANG SC
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../phoneuicontrol/inc
+USERINCLUDE     ../../phoneuiutils/inc
+USERINCLUDE     ../../phonemediatorcenter/inc
+USERINCLUDE     ../../phoneui/srcdata
+
+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         euser.lib
+LIBRARY         cone.lib
+LIBRARY         eikcore.lib
+LIBRARY         ws32.lib
+LIBRARY         bafl.lib
+LIBRARY         efsrv.lib // TParse
+LIBRARY         ecom.lib // for CPhoneBubbleExtensionManager plugin
+
+LIBRARY         eikcoctl.lib // status pane
+LIBRARY         eikdlg.lib   // for CPhoneNote
+LIBRARY         eikctl.lib
+
+//LIBRARY         eikctl.lib
+LIBRARY         aknskins.lib
+LIBRARY         avkon.lib
+LIBRARY         aknnotify.lib // for AknInCallBubble
+LIBRARY         apparc.lib
+
+LIBRARY         apgrfx.lib  // Apa server
+
+LIBRARY         cdlengine.lib
+LIBRARY         aknicon.lib
+LIBRARY         akncapserverclient.lib
+
+// Scalable UI.
+LIBRARY         aknlayout2scalable.lib
+LIBRARY         aknlayout2.lib
+
+
+LIBRARY         bitmaptransforms.lib
+LIBRARY         fbscli.lib
+LIBRARY         bitgdi.lib
+LIBRARY         hlplch.lib // Help launcher
+LIBRARY         sendui.lib // CSendAppUi
+LIBRARY         mediaclient.lib
+LIBRARY         mediaclientaudio.lib
+
+// DRM
+LIBRARY         drmhelper.lib
+LIBRARY         apmime.lib
+LIBRARY         caf.lib
+
+// UTF-8 conversion for the TTS
+LIBRARY         charconv.lib
+
+LIBRARY         featmgr.lib // FeatureManager
+
+LIBRARY         phoneuiutils.lib
+LIBRARY         bubblemanager.lib
+LIBRARY         phoneclient.lib 
+
+// From S60
+LIBRARY         commonengine.lib //StringLoader
+LIBRARY         etext.lib // CRichText
+
+// Phonebook engine
+LIBRARY         pbkeng.lib
+
+// Ringingtone output
+LIBRARY         audiooutputrouting.lib
+
+// AIW
+LIBRARY         servicehandler.lib
+
+
+LIBRARY         dialer.lib
+LIBRARY         egul.lib
+
+
+// Video mailbox
+LIBRARY         vmbx.lib
+
+LIBRARY         cauiengine.lib // For Video call Reconnect query
+LIBRARY         gslauncher.lib // For call settings launch.
+
+// Transition effects
+LIBRARY         gfxtrans.lib
+
+LIBRARY         platformenv.lib // PathInfo
+
+LIBRARY         phonemediatorcenter.lib
+LIBRARY         serviceprovidersettings.lib
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/group/phoneuiview_stub.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -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 phoneuiview component stub.
+;
+; Languages
+&EN
+
+; Header
+#{"PhoneUIView"}, (0x101F4D18), 1, 0, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files
+;
+;  PhoneUIView
+;
+"" - "z:\sys\bin\PhoneUIView.dll"
Binary file phoneapp/phoneuiview/group/phoneuiview_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/c3dringingtoneinterface.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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/phoneapp/phoneuiview/inc/c3dringingtoneinterface.inl	Mon Jan 18 20:18:27 2010 +0200
@@ -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/phoneapp/phoneuiview/inc/cphoneapplicationexit.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,215 @@
+/*
+* 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:  It provides functionality to exit the foreground application.
+*
+*/
+
+
+
+#ifndef CPHONEAPPLICATIONEXIT_H
+#define CPHONEAPPLICATIONEXIT_H
+
+//  INCLUDES
+#include    <e32base.h>
+
+// FORWARD DECLARATIONS
+class CPhoneViewController;
+class RWsSession;
+
+// CLASS DECLARATION
+
+/**
+*  It provides functionality to exit the foreground application.
+*
+*  @since Series 60 2.6
+*/
+class CPhoneApplicationExit 
+    : public CBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aViewController Phone UI View controller
+        * @param aWsSession window server session.
+        * @param aUikonWgId UIKON server window group id.
+        * @return new CPhoneApplicationExit instance.
+        */
+        static CPhoneApplicationExit* NewL(
+            CPhoneViewController* aViewController,
+            RWsSession& aWsSession,
+            const TInt aUikonWgId );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneApplicationExit();
+
+    public: // New functions
+        
+        /**
+        * Exits the active application.
+        * @return error code.
+        */
+        TInt ExitApplication();
+
+    private:
+
+        // Inner class.
+        class CElement;
+
+        // Basic cases.
+        class CElementBasic;
+
+        // UID range element.
+        class CElementUid;
+
+        // Drive element.
+        class CElementDrive;
+
+        /**
+        * C++ constructor.
+        * @param aViewController Phone UI View controller
+        * @param aWsSession window server session.
+        * @param aUikonWgId UIKON server window group id.
+        */
+        CPhoneApplicationExit(
+            CPhoneViewController* aViewController,
+            RWsSession& aWsSession,
+            const TInt aUikonWgId );
+
+        /**
+        * Exits the application.
+        */
+        void ExitApplicationL();
+
+        /**
+        * Checks if application should be closed using product
+        * specific variation variables.
+        * @param aUid application UID.
+        * @return ETrue if application should be closed.
+        */
+        TBool CheckApplicationClosingL( const TUid& aUid );
+
+        /**
+        * Checks if included to "close" list.
+        * @param aUid application UID.
+        * @return ETrue if included.
+        */
+        TBool IsIncludedToCloseListL( const TUid& aUid ) const;
+
+        /**
+        * Checks if included to "don't close" list.
+        * @param aUid application UID.
+        * @return ETrue if included.
+        */
+        TBool IsIncludedToDontCloseListL( const TUid& aUid ) const;
+
+        /**
+        * Checks if application UID is included to the list.
+        * @param aSource list to be checked.
+        * @param aUid application UID.
+        * @return ETrue if application UID is included to the list.
+        */
+        TBool CheckListL( 
+            const RPointerArray< CElement >& aSource, 
+            const TUid& aUid ) const;
+
+        /**
+        * Reads lists from variation variables.
+        */
+        void ReadListsL();
+
+        /**
+        * Builds list from text description.
+        * @param aTarget it will contain list of elements.
+        * @param aSource source description.
+        * @param aOomAllowed ETrue if OOM is allowed in the description.
+        */
+        void BuildListL(
+            RPointerArray< CElement >& aTarget,
+            const TDesC& aSource,
+            TBool aOomAllowed );
+
+        /**
+        * Parses string from lexer.
+        * @param aLexer lexer.
+        * @param aString string to be checked.
+        * @return ETrue if string was next element.
+        */
+        TBool ParseString( 
+            TLex& aLexer,
+            const TDesC& aString );
+
+        /**
+        * Parses UID from lexer.
+        * @param aLexer lexer.
+        * @param aUidStart it will contain UID.
+        * @param aUidEnd it will contain UID. 
+        * @return ETrue if UID or UID range was next element.
+        */
+        TBool ParseUid( 
+            TLex& aLexer, 
+            TUid& aUidStart,
+            TUid& aUidEnd );
+        
+        /**
+        * Parses driver identifier from lexerl.
+        * @param aLexer lexer.
+        * @param aChar it will contain drive character.
+        * @return ETrue if drive identifier was next element.
+        */
+        TBool ParseDrive(
+            TLex& aLexer, 
+            TChar& aChar );
+
+        /**
+        * Checks that the element ends appropriately - 
+        * next character must be space or then input has ended.
+        * @param aLexer lexer.
+        * @return ETrue if element ends appropriately.
+        */
+        inline TBool CheckEnd( TLex& aLexer );
+        
+        /**
+        * Checks if application closing is enabled.
+        * @return ETrue if application closing is enabled.
+        */
+        TBool IsApplicationClosingEnabled() const;
+
+    private:    // Data
+
+        // Reference to Phone UI View Controller.
+        CPhoneViewController* iViewController;
+
+        // Reference to window server session.
+        RWsSession& iWsSession;
+
+        // UIKON server window group id.
+        const TInt iUikonWgId;
+
+        // ETrue if product specific variables have been read.
+        TBool iListsRead;
+
+        // Owned product specific "close" list.
+        RPointerArray<CElement> iCloseList;
+        
+        // Owned product specific "don't close" list.
+        RPointerArray<CElement> iDontCloseList;
+        
+    };
+
+#endif // CPHONEAPPLICATIONEXIT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphoneaudiocontroller.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,227 @@
+/*
+* 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:  It manages incall indicator.
+*
+*/
+
+
+#ifndef CPHONEAUDIOCONTROLLER_H
+#define CPHONEAUDIOCONTROLLER_H
+
+// INCLUDES
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class CPhoneStatusPane;
+class TPhoneCommandParam;
+class CPhoneTimer;
+
+// CLASS DECLARATION
+
+/**
+*  It manages navi pane audio indicators
+*
+*  @since 1.0
+*/
+class CPhoneAudioController : public CBase, public MCoeControlObserver,
+    public MCoeForegroundObserver
+    {
+    public:  // Constructors and destructor      
+        
+        /**
+        * Two-phased constructor.
+        * @return new instance.
+        */
+        static CPhoneAudioController* NewL();
+        
+        /**
+        * Destructor.
+        */
+        ~CPhoneAudioController();
+
+    public: // New functions
+
+        /**
+        * Activates voice volume control.
+        */
+        void ActivateVolumeControlL();
+
+        /**
+        * Deactivate voice volume control.
+        */
+        void DeactivateVolumeControl();
+        
+        /**
+        * Update control using the specified data
+        * @param aCommandParam command parameter
+        */
+        void HandleVolumeChangeL( TPhoneCommandParam* aCommandParam );
+        
+        /**
+        * Update control using the specified data
+        * @param aCommandParam command parameter
+        */
+        void HandleIhfChange( TPhoneCommandParam* aCommandParam );
+        
+        /**
+        * Update control using the specified data
+        * @param aCommandParam command parameter
+        */
+        void HandleMuteChange( TPhoneCommandParam* aCommandParam );
+        
+        /**
+        * Gets volume level from navi pane control.
+        * @return Volume level.
+        */
+        TInt VolumeLevelFromControl();  
+        
+    private: // MCoeControlObserver
+    
+        void HandleControlEventL( CCoeControl* aControl, 
+                                  TCoeEvent aEventType ); 
+        
+    private: // MCoeForegroundObserver
+        
+        /**
+         * Handles the application coming to the foreground.
+         */
+        void HandleGainingForeground();
+        
+        /**
+         * Handles the application going into the background.
+         */
+        void HandleLosingForeground();
+
+    private:
+
+        /**
+        * C++ constructor.
+        */
+        CPhoneAudioController();
+
+        /**
+        * Symbian OS constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Update indicator.
+        */
+        void ActivateL();
+
+        /**
+        * Recovery system callback
+        */
+        static TInt DoRecoverActivateL( TAny* aAny );
+        
+        /**
+        * Pushes new decorator to navi pane replacing the
+        * previous one if needed.
+        * @param aNew new to replace the old one.
+        */
+        void PushL(CAknNavigationDecorator& aNew);
+
+        /**
+        * Callback function. Called when navi pane should be updated 
+        * back to default.
+        * @param aAny pointer to instance of this class.
+        * @return KErrNone always.
+        */
+        static TInt DoUpdateNaviPaneToDefault( TAny* aAny );
+
+        /**
+        * Get current volume decorator (Ihf or Ear) 
+        * @return Current volume decorator
+        */
+        CAknNavigationDecorator& VolumeDecorator();
+        
+        /**
+        * Get current volume control (Ihf or Ear) 
+        * @return Current volume control (Ihf or Ear)         
+        */
+        CAknVolumeControl& VolumeControl();    
+                
+        /**
+        * Get current volume level (Ihf or Ear)  
+        * @return Current Ihf or Ear volume level         
+        */        
+        TInt VolumeLevel(); 
+        
+        /**
+        * Select decorator based on current audio status
+        * @return Selected decorator (Ihf, Ear or Muted).         
+        */
+        CAknNavigationDecorator& SelectDecoratorL();         
+
+        /**
+        * Set volume level for given volume control
+        * @param aVolumeControl Volume control
+        * @param aVolumeLevel New volume level
+        */
+        void SetVolumeLevel(CAknVolumeControl& aVolumeControl, TInt aVolumeLevel);
+    
+    private:    // Data
+
+        // Recovery id for activating volume control
+        TInt iActivateRecoveryId;    
+
+        CPhoneStatusPane* iStatusPane;
+        
+        // Count the volume control activations
+        TInt iVolumeControlCount;
+
+        // Owned IHF volume control
+        CAknNavigationDecorator* iIhfVolumeControl;
+
+        // IHF volume, from 1 to 10
+        TInt iIhfVolume;
+        
+        // ETrue IHF is active
+        TBool iIhfMode;
+
+        // ETrue if transfer to or from IHF pending
+        TBool iIhfTransferPending; 
+        
+        // Owned non-IHF volume control.
+        CAknNavigationDecorator* iEarVolumeControl;
+        
+        // Non-IHF volume, from 1 to 10
+        TInt iEarVolume; 
+
+        // Owned muted indicator
+        CAknNavigationDecorator* iMutedControl;
+        
+        // ETrue phone is muted
+        TBool iMuted;
+
+        // ETrue if timed control transfer to muted is pending
+        TBool iTimedMuteTransferPending; 
+
+        // Pointer the current control that is in navi pane
+        CAknNavigationDecorator* iOldControl;
+        
+        // Owned timer to update navi pane
+        CPhoneTimer* iNaviPaneUpdateTimer;
+        
+        /**
+         * ETrue if Telephony is the foreground application,
+         * otherwise EFalse.
+         */
+        TBool iPhoneInForeground;
+
+    };
+
+#endif      // CPHONEAUDIOCONTROLLER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphoneaudioplayer.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,356 @@
+/*
+* 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:  Audio player for playing audio sample or tone file.
+*
+*/
+
+
+#ifndef CPHONEAUDIOPLAYER_H
+#define CPHONEAUDIOPLAYER_H
+
+// INCLUDES
+#include <e32base.h>
+#include <mdaaudiosampleplayer.h>
+#include <mdaaudiotoneplayer.h>
+
+// CLASS DECLARATION
+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/phoneuiview/inc/cphonebubblemapping.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,294 @@
+/*
+* 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:  Mapping Call To Bubble
+*
+*/
+
+
+#ifndef __CPHONEBUBBLEMAPPING_H
+#define __CPHONEBUBBLEMAPPING_H
+
+// INCLUDES
+#include    <e32base.h>
+#include    <bmbubblemanager.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+* It defines a single item in mapping.
+*/
+class TMappingItem
+    {
+    public:
+        TInt iCallId;
+        CBubbleManager::TBubbleId iBubbleId;
+        CBubbleManager::TPhoneCallState iCallState;
+    
+            // NOT OWNED
+        CFbsBitmap* iThumbnail; // the thumbnail to be displayed in the 
+                                // call bubble 
+    };
+   
+/**
+* It keeps up mapping from call objects to bubble ids.
+*/
+class CPhoneBubbleMapping 
+    : public CBase
+    {
+    public:  // Constructors and destructor      
+        
+        /**
+        * Two-phased constructor.
+        *
+        * @param aMaximumAmount It contains maximum amount of 
+        *        calls at the same time.
+        */
+        static CPhoneBubbleMapping* NewL(
+            TInt aMaximumAmount );
+        
+        /**
+        * Destructor.
+        */
+        ~CPhoneBubbleMapping();
+
+    public: // New functions
+
+        /**
+        * Find a bubble id by call id.
+        *
+        * @param aCallId call Id.
+        * @param aId It will contain bubble id corresponding to the call.
+        * @return ETrue iff succeeded.
+        */
+        TBool FindBubbleByCall( 
+            TInt aCallId,
+            CBubbleManager::TBubbleId& aId ) const;
+        
+        /**
+        * Find call id by bubble id.
+        *
+        * @param aId bubble id.
+        * @param aCallId It will contain call corresponding to the bubble.
+        * @return ETrue iff succeeded.
+        */
+        TBool FindCallByBubble(
+            CBubbleManager::TBubbleId aId,
+            TInt& aCallId ) const;
+
+        /**
+        * Find thumbnail id by call id.
+        *
+        * @param aCallId call Id.
+        * @return the thumbnail iff succeeded.
+        */
+        const CFbsBitmap* FindThumbnailByCall( 
+            TInt aCallId ) const;
+        
+        /**
+        * Add to mapping.
+        *
+        * Note that method panics if there already is an item with
+        * the same call or allocation fails.
+        *
+        * @param aId It is the id of the call bubble.
+        * @param aCallId It is call id corresponding to the bubble.
+        * @param aThumbnail is the thumbnail attached to the bubble
+        */
+        void AddToMappingL( 
+            CBubbleManager::TBubbleId aId, 
+            TInt aCallId,
+            CBubbleManager::TPhoneCallState aCallState,
+            CFbsBitmap* aThumbnail
+            );
+
+        /**
+        * Remove from mapping.
+        *
+        * @param aCallId The call id
+        */
+        void RemoveFromMapping( 
+            TInt aCallId );
+ 
+        /**
+        * Returns total amount of items in mapping.
+        *
+        * @return amount of items in mapping.
+        */
+        TInt ItemCount() const;
+
+        /**
+        * Returns bubble at position.
+        *
+        * @param aIndex position.
+        * @return id of the corresponding bubble.
+        */
+        CBubbleManager::TBubbleId BubbleAt( TInt aIndex ) const;
+        
+        /**
+        * Returns call id at position.
+        *
+        * @param aIndex position.
+        * @return corresponding call id.
+        */
+        TInt CallIdAt( TInt aIndex ) const;
+
+        /**
+        * Returns Thumbnail pointer at position.
+        *
+        * @param aIndex position.
+        * @return corresponding thumbnail
+        */
+        const CFbsBitmap* ThumbnailAt( TInt aIndex ) const;
+
+        /**
+        * update Thumbnail pointer at position.  this function
+        * will release the memory if the current status of the
+        * thumbnail pointer is not NULL
+        *
+        * @param aCallId the call ID
+        * @param corresponding thumbnail
+        * @return none
+        */
+        void SetThumbnailByCall(
+            TInt aCallId,
+            CFbsBitmap* aThumbnail );
+            
+        /**
+        * update CallState at position. 
+        *
+        * @param aCallId the call ID
+        * @param corresponding callState
+        * @return none
+        */
+        void SetCallState(
+            TInt aCallId,
+            CBubbleManager::TPhoneCallState aCallState );
+            
+        /**
+        * Find callState by call id.
+        *
+        * @param aCallId call Id.
+        * @return the callState if succeeded.
+        */
+        CBubbleManager::TPhoneCallState FindCallStateByCall( 
+            TInt aCallId ) const;
+            
+       /**
+        * Returns CallState at position.
+        *
+        * @param aIndex position.
+        * @return callState
+        */
+        CBubbleManager::TPhoneCallState CallStateAt( TInt aIndex ) const;
+
+        /**
+        * update callState at position.
+        *
+        * @param aCallId the call ID
+        * @param aCallState
+        * @return none
+        */
+        void SetCallStateByCall(
+            TInt aCallId,
+            CBubbleManager::TPhoneCallState aCallState );
+        
+        /**
+        * Find callId by callState.
+        *
+        * @param aCallState call state.
+        * @return the callId if succeeded
+        * and -1 if not found.
+        */    
+        TInt FindCallIdByCallState( 
+            CBubbleManager::TPhoneCallState aCallState );
+
+    private:
+        /**
+        * update Thumbnail pointer at position.
+        * If user need to free the thumbnail, this call should
+        * be used instead of user doing "delete thumbnail"
+        * the user can call SetThumbnailAt( index , NULL ) to 
+        * release and reset the pointer
+        *
+        * @param aIndex position.
+        * @param corresponding thumbnail
+        * @return none
+        */
+        void SetThumbnailAt( 
+            TInt aIndex, 
+            CFbsBitmap* aThumbnail);
+            
+        /**
+        * update CallState at position.
+        *
+        * @param aIndex position.
+        * @param callState
+        * @return none
+        */
+        void SetCallStateAt( 
+            TInt aIndex, 
+            CBubbleManager::TPhoneCallState aCallState );
+
+        /**
+        * Find the index of the item by call ID
+        *
+        * @param aCallId call Id.
+        * @param aIndex the index of the call item
+        * @return ETrue iff succeeded.
+        */
+        TBool FindIndexByCall( 
+            TInt aCallId,
+            TInt& aIndex ) const;
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneBubbleMapping();
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL( TInt aMaximumAmount );
+
+        // By default, prohibit copy constructor
+        CPhoneBubbleMapping( const CPhoneBubbleMapping& );
+        // Prohibit assigment operator
+        CPhoneBubbleMapping& operator= ( 
+            const CPhoneBubbleMapping& );
+
+    private:    // Data
+
+        /**
+        * It defines type for array of mapping items.
+        */
+        typedef CArrayFixFlat<TMappingItem> CMappingArray;
+
+        /**
+        * It is the mapping.
+        */
+        CMappingArray* iMapping;
+
+        /**
+        * It is the amount of reserved items in mapping.
+        */
+        TInt iMappingReserve;
+    };
+
+#endif      // __CPHONEBUBBLEMAPPING_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonebubblewrapper.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,663 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 Bubble Wrapper
+*
+*/
+
+#ifndef CPHONEBUBBLEWRAPPER_H
+#define CPHONEBUBBLEWRAPPER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+#include <coecntrl.h>
+#include <eikimage.h>
+#include <pevirtualengine.h>
+#include <bmbubblemanager.h>
+#include "mphonevideoplayer.h"
+#include "bmvideoplaybackobserver.h"
+#include "mphoneviewcommandhandle.h"
+#include "cphonecallthememonitor.h"
+#include "mphonenumberentrychangedhandler.h"
+
+// FORWARD DECLARATIONS
+class CBubbleManager;
+class CPhoneBubbleMapping;
+class CPhoneNumberEntry;
+class TPhoneCommandParam;
+class TPhoneCmdParamCallHeaderData;
+class CPhoneCallHeaderTextAnimation;
+
+class MNumberEntryObserver;
+class MNumberEntry;
+
+class CPhoneBubbleExtensionManager;
+class MPhoneCustomization;
+
+class CPhoneBubbleWrapper :
+    public CBase,
+    public MPhoneVideoPlayer,
+    private MBubbleVideoPlaybackObserver,
+    public MPhoneCallThemeSettingsObserver,
+    public MPhoneNumberEntryChangedHandler,
+    public MCoeControlObserver
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CPhoneBubbleWrapper* NewL(
+            CCoeControl* aControl,
+            const TRect& aRect );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneBubbleWrapper();
+
+    public: // Call Header functions
+
+        void RemoveCallHeaderL( TInt aCallId );
+
+        CBubbleManager::TBubbleId CreateCallHeaderL(
+            TInt aCallId,
+            TPhoneCommandParam* aCommandParam );
+
+        CBubbleManager::TBubbleId CreateEmergencyCallHeaderL(
+            TInt aCallId,
+            TPhoneCommandParam* aCommandParam );
+
+        void UpdateCallHeaderDisplay(
+            TInt aCallId,
+            TPhoneCommandParam* aCommandParam );
+
+        void UpdateCallHeaderAndLabel(
+            TInt aCallId,
+            TPhoneCommandParam* aCommandParam );
+
+    public: // Thumbnail functions
+
+    public: // Number Entry functions
+
+        void CreateNumberEntry();
+
+        void SetNumberEntryObserver( MNumberEntryObserver& aObserver  );
+
+        void SetNumberEntryPromptText( const TDesC& aPromptText );
+
+        void RemoveNumberEntry();
+
+        void SetNumberEntryContent( const TDesC& aContent );
+
+        void GetNumberEntryContent( TPhoneCommandParam* aCommandParam );
+
+        void GetLocalizedNumberEntryContent( TPhoneCommandParam* aCommandParam );
+
+        void SetNumberEntryVisible( TPhoneCommandParam* aCommandParam );
+
+        void GetNumberEntryCount( TPhoneCommandParam* aCommandParam );
+
+        TBool IsNumberEntryUsed();
+
+        TBool IsNumberEntryVisible();
+
+        /**
+        * Count amount of characters in number entry.
+        * @return amount of chracters.
+        */
+        TInt CountNumberEntryCharacters();
+
+        // from base class MPhoneNumberEntryChangedHandler
+        
+        /**
+         * From MPhoneNumberEntryChangedHandler
+         * 
+         * Contains implementation about what is done when Phone Number Entry
+         *  has informed that it's state has changed  
+         *  
+         * @since S60 5.0
+         */
+        void HandleNumberEntryChanged( );
+        
+        /**
+         * From MPhoneNumberEntryChangedHandler
+         * 
+         * Sets callback function to observer that want to know about the 
+         * number entry changes. 
+         *
+         * @since S60 5.0 
+         */
+        void SetNumberEntryChangedCallBack( TPhoneCommandParam* aCommandParam );
+        
+        /**
+         * From MCoeControlObserver
+         * 
+         * Bubble wrapper receives events from bubble number editor
+         */
+        void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType );
+        
+        
+    public: // New functions
+
+        /**
+        * Handles key event.
+        *
+        * @param aCommandParam a command parameter
+        * @return Indicates if event was handled.
+        */
+        TKeyResponse HandleKeyEventL( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Set the phone muted icon.
+        * @param aCommandParam a command parameter
+        */
+        void SetPhoneMuted( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Prepare the call state
+        * @param aCallId call id
+        * @param aState call state
+        * @param aStateLabelText label associated with the call state
+        * @param aStateShortLabelText short label associated with the call state
+        */
+        void PrepareCallStateL(
+            TInt aCallId,
+            TPEState aState,
+            const TDesC& aStateLabelText,
+            const TDesC& aStateShortLabelText );
+
+        /**
+        * Update the call duration
+        * @param aCallId call id
+        */
+        void UpdateCallDuration( TInt aCallId, const TDesC& aDurationText );
+
+        /**
+        * Give selected conf member callId
+        * @param  aCommandParam
+        */
+        TBool SelectedConfMemberCallIdL( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Give selected conf member callId
+        * @param  aCommandParam
+        */
+        void OpenConferenceList( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Move Highlight in conference up/down
+        * @param  aCommandParam
+        */
+        void MoveHighlightInConference( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Give callState by callId
+        * @param  aCommandParam
+        */
+        TInt GetCallState( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Give callId by callState
+        * @param  aCommandParam
+        */
+        TInt GetCallIdByState( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Give number of active calls
+        * @param  aCommandParam
+        */
+        void GetActiveCallsCount( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Give is conference active or not
+        * @param  aCommandParam
+        */
+        void GetIsConference( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Give is this callId member of conference or not
+        * @param    aCallId, callId
+        *           aCommandParam
+        */
+        void CallExistsInConference(
+            TInt aCallId,
+            TPhoneCommandParam* aCommandParam );
+        /**
+        * Removes all callHeaders
+        */
+        void RemoveAllCallHeadersL();
+
+        /**
+        * Updates ciphering indicator in the bubble if necessary.
+        * @param aCallId Call id.
+        * @param aCommandParam Command parameter.
+        */
+        void UpdateCipheringIndicator(
+            TInt aCallId,
+            TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Give is max members in conference
+        */
+        TBool IsMaxMembersInConf() const;
+
+        /**
+        * Toggle number entry mode
+        * @param aCommandparam ETrue if new mode is alpha
+        */
+        void ToggleNumberEntryAlphaNumericMode( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Opens VKB
+        * 
+        */
+        void OpenVkbL();
+        
+        /**
+        * Get number entry cursor position
+        * @param aCommandparam cursor position
+        */
+        void GetNumberEntryCursorPosition( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Set number entry cursor position
+        * @param aCommandparam cursor position
+        */
+        void SetNumberEntryCursorPositionL( TPhoneCommandParam* aCommandParam );
+           
+        /**
+        * Get number entry mode
+        */
+        TBool IsNENumericMode() const;
+
+        /**
+        * Before making any changes to bubble headers, call this function.
+        */
+        void StartChanges();
+
+        /**
+        * After the changes to bubble headers call this function.
+        */
+        void EndChanges();
+
+        /**
+        * Gives access to button pane.
+        */
+        MBubbleTouchPaneInterface& TouchPane() const;
+
+        /**
+        * Sets touchpane visible.
+        * @param aVisible ETrue if touch is to be shown
+        *        otherwise EFalse.
+        */
+        void SetTouchPaneVisible( TBool aVisible );
+
+        /**
+        * Gives access to bubblemanager's interface.
+        */
+        CBubbleManager& BubbleManager();
+
+        /**
+        * Returns BubbleManager's CCoeControl interface.
+        */
+        CCoeControl* Control();
+
+        /**
+        * Checks whether conference is in expanded mode
+        */
+        TBool IsConferenceInExpandedMode() const;
+
+        /**
+         * Loads the extension plugins.
+         */
+        void LoadPlugins();
+
+        /**
+         * Sets phone customization interface
+         */
+        void SetPhoneCustomization( MPhoneCustomization* aCustomization );
+    public: // Dialer specific methods
+
+        /**
+        * Sets number entry
+        */
+        void SetNumberEntry( MNumberEntry* aNumberEntry );
+
+        /**
+        * Forward commands to Dialer
+        * @param aCommand Dialer command
+        */
+        void HandleCommandL( TInt aCommand);
+
+        /**
+        * Keypad audio enabled
+        *
+        */
+        void KeypadAudioEnabled();
+
+        /**
+        * Keypad audio disabled
+        *
+        */
+        void KeypadAudioDisabled();
+
+    public: // DO NOT CALL THE FOLLOWING BEFORE STARTCHANGES HAS BEEN CALLED.
+
+        /**
+        * Creates new bubble for call. If bubble for the
+        * call already exists, then it is returned.
+        *
+        * @param aCallId callId.
+        * @return bubble id.
+        */
+        CBubbleManager::TBubbleId CreateBubbleL(
+            TInt aCallId );
+
+        /**
+        * Changes CLI of the bubble.
+        *
+        * @param aId bubble id.
+        * @param aText text, new CLI.
+        * @param aDirection clipping direction.
+        */
+        void SetCLI(
+            CBubbleManager::TBubbleId aId,
+            const TDesC& aText,
+            CBubbleManager::TPhoneClippingDirection aDirection );
+
+        /**
+        * Changes Cnap of the bubble, clipping done from the beginning
+        * Related to __SERIES60_PHONE_CNAP flag
+        *
+        * @param aId bubble id.
+        * @param aCnapText text, new Cnap
+        * @param aDirection clipping direction.
+        */
+        void SetCNAP( 
+            CBubbleManager::TBubbleId aId,
+            const TDesC& aCnapText,
+            CBubbleManager::TPhoneClippingDirection aDirection );
+
+        /**
+        * Set the icon that represents the call number type in the current
+        * call bubble.
+        * @param aBubbleId bubble id.
+        * @param aNumberType number type.
+        */
+        void SetNumberTypeIndicator(
+            CBubbleManager::TBubbleId aId,
+            TPEPhoneNumberIdType aNumberType  );
+
+        /**
+        * Creates a new conference call.
+        * @param TInt aCallId .
+        */
+        void CreateConferenceL(
+            TInt aCallId,
+            TPhoneCommandParam *aCommandParam );
+
+        /**
+        * Removes conference call
+        */
+        void RemoveConferenceL();
+
+        /**
+        * Removes conference call bubble
+        */
+        void RemoveConferenceBubbleL();
+
+        /**
+        * Removes party from conference call.
+        * @param TInt aCallId .
+        */
+        void RemoveFromConferenceL(TInt aCallId);
+
+        /**
+        * Finds a participant position in conference call participant list.
+        *
+        * @param aCallId call id to search for
+        * @return position in participant list or KErrNotFound
+        */
+        TInt FindParticipantPosition( TInt aCallId );
+
+        /**
+        * Set conference call header expanded
+        */
+        void SetConferenceExpand( TBool aStatus );
+
+        /**
+        * Set conference call header highlighted
+        */
+        void SetConferenceHighlight( TBool aStatus );
+
+        /**
+        * Handles flag changes.
+        */
+        void HandleFlagsUpdated( TInt aNewFlags );
+
+        /**
+        * Drop party from conference call
+        * to private call.
+        * @param TInt aCallId .
+        */
+        void ConferenceMemberToPrivateL( TInt aCalld );
+
+        /**
+        * Adds party to conference call.
+        */
+        void AddToConferenceL();
+
+
+    protected:  // Constructors
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneBubbleWrapper(  );
+
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        void ConstructL( CCoeControl* aControl, const TRect& aRect );
+
+        /**
+        * convert TPEState to TPhoneCallState
+        */
+        CBubbleManager::TPhoneCallState GetBubbleState( TPEState aState );
+
+        /**
+        * convert TPhoneCallState to TPEState
+        */
+        TPEState ConvertCallState(
+            CBubbleManager::TPhoneCallState aBubbleState );
+
+        /**
+        * Count active call bubbles (Active + Hold + Disconnecting )
+        */
+        TInt CountNumberOfActiveCalls() const;
+
+        /**
+        * Adds party to conference call.
+        */
+        void AddToConferenceL( TInt aCallId );
+
+
+    private:
+
+        void StartMOVideoCallAnimationHeaderL(
+            CBubbleManager::TBubbleId aBubbleId,
+            const TDesC& aStateLabelText,
+            const TDesC& aStateShortLabelText );
+
+        /**
+        * From MPhoneVideoPlayer
+        */
+        void PlayVideoRingTone( const TDesC& aFileName,
+                                TPlayMode aPlayType,
+                                TInt aVolumeLevel,
+                                TBool aArbitraryScaling,
+                                MPhoneVideoPlayerObserver* aObserver );
+
+        /**
+        * From MPhoneVideoPlayer
+        */
+        void StopVideoRingTone();
+
+        /**
+        * From MPhoneVideoPlayer
+        */
+        void MuteVideoRingTone();
+
+        /**
+        * From MPhoneVideoPlayer
+        */
+        void CancelVideoRingTone();
+
+        /**
+        * From MBubbleVideoPlaybackObserver
+        */
+        void HandleBubbleVideoPlaybackEvent(
+            TBubbleVideoPlaybackEvent aEvent );
+
+        /**
+        * From MBubbleVideoPlaybackObserver
+        */
+        void HandleBubbleVideoPlaybackError(
+            TBubbleVideoPlaybackError aErrorType, TInt aErrorCode );
+
+        /**
+        * Get number entry mode from bubblemanager
+        */
+        TBool IsNumberEntryNumericMode() const;
+
+        /**
+        * From MPhoneCallThemeSettingsObserver
+        */
+        void CallThemeSettingsChanged();
+
+        /**
+        * Sets call header parameters.
+        */
+        void SetCallHeaderParameters(
+            TInt aBubble,
+            TPhoneCmdParamCallHeaderData* aCallHeaderParam );
+        
+        /**
+         * Returns ETrue if simplified conference call bubble must be used
+         * in a conference created using the given service.
+         * 
+         * @param   aServiceId  Service identifier.
+         * @return  ETrue if simplified conference call bubble setting is 
+         *          enabled, EFalse otherwise.
+         */
+        TBool IsSimplifiedConferenceCallHeaderEnabledL( TUint32 aServiceId ) const;
+        
+        /**
+         * Sets simplified conference call header status flag on/off.
+         * 
+         * @param   aOnOff      ETrue switches setting on, EFalse off.
+         */
+        void SetSimplifiedConferenceCallHeaderStatus( TBool aOnOff );
+        
+    private:
+
+        // Real bubble manager
+        CBubbleManager* iBubbleManager;
+
+        // Bubble mapping of call and bubble
+        CPhoneBubbleMapping* iMapping;
+
+        // is number entry visible
+        TBool iNumberEntryVisible;
+
+        // is conference call on or not
+        TBool iConference;
+
+        // Stores call id's of conference participants.
+        typedef CArrayFixFlat<const TInt> CParticipantArray;
+        CParticipantArray* iParticipants;
+
+
+
+        // ETrue if ciphering indicator is allowed
+        TBool iCipheringIndicatorAllowed;
+
+        enum TFlags
+            {
+            // Conference is expanded.
+            EFlagConferenceExpanded = 1,
+            // Conference is required to expanded, with highlight
+            EFlagConferenceReqExpanded = 2,
+            // Number entry exists
+            EFlagNumberEntryExists = 4,
+            // Number entry visible
+            EFlagNumberEntryVisible = 8,
+            // Overrides EFlagConferenceExpanded setting
+            EFlagSimplifiedConferenceCallHeader = 16
+            };
+        // Sum of subset of TFlags
+        TInt iFlags;
+
+        // Pointer to video call's text animation bubble header
+        CPhoneCallHeaderTextAnimation* iVideoCallAnimationHeader;
+
+        // Is Image/text call feature supported
+        TBool iCallImageTextSupported;
+
+        /** 
+         * Pointer to call theme monitor
+         * Own.
+         */
+        CPhoneCallThemeMonitor* iCallTheme;
+
+        // Observer for video playback events
+        MPhoneVideoPlayerObserver* iVideoPlayerObserver;
+
+        /**
+         * Container for Phone number entry related handling.
+         * Own.
+         */
+        CPhoneNumberEntry* iPhoneNumberEntry;
+
+        /**
+         * Interface to Dialer's number entry functionality
+         * Not own.
+        */
+        MNumberEntry* iDialerNumberEntry;
+
+        // Is dialler supported.
+        TBool iUseDialer;
+
+        // Is number entry mode numeric/alpha
+        TBool iIsNumberEntryModeNumeric;
+
+        /**
+         * Bubble extension plugin manager.
+         * Own.
+         */
+        CPhoneBubbleExtensionManager* iBubbleExtensionManager;
+       
+        /**
+         * Interface to phone customization
+         * Not own.
+         */
+        MPhoneCustomization* iPhoneCustomization;
+    };
+
+#endif // CPHONEBUBBLEWRAPPER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonebuttonscontroller.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,197 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 the updating of touch buttons
+*
+*/
+
+
+#ifndef CPHONEBUTTONSCONTROLLER_H
+#define CPHONEBUTTONSCONTROLLER_H
+
+#include <e32base.h>
+#include <bmtouchpaneinterface.h>
+#include "mphonebuttoncustomization.h"
+
+class TPhoneCommandParam;
+
+/**
+ *  Updates touch buttons
+ *
+ *  @lib PhoneUIView.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CPhoneButtonsController ): 
+    public CBase, MBubbleTouchPaneIconProvider
+    {
+public:
+
+    static CPhoneButtonsController* NewL(
+        MBubbleTouchPaneInterface& aTouchPane );
+
+    virtual ~CPhoneButtonsController();
+    
+    /**
+     * Loads buttons form given resouce.
+     *
+     * @since S60 v5.0
+     * @param aCommandParam Mute information
+     */
+    void SetButtonSet( TPhoneCommandParam* aCommandParam );
+    
+    /**
+     * SetMuteFlag
+     *
+     * @since S60 v5.0
+     * @param aCommandParam 
+     */
+    void SetMuteFlag( TPhoneCommandParam* aCommandParam );
+    
+    /**
+     * SetHoldFlag
+     *
+     * @since S60 v5.0
+     * @param aCommandParam 
+     */
+    void SetHoldFlag( TPhoneCommandParam* aCommandParam );
+   
+    /**
+     * Handles IHF change event.
+     *
+     * @since S60 v5.0
+     * @param aCommandParam IHF information.
+     */
+    void SetIhfFlag( TPhoneCommandParam* aCommandParam );
+
+    /**
+     * Handles BT accessory output change event.
+     *
+     * @since S60 v5.0
+     * @param aCommandParam BTA information.
+     */    
+    void SetBTAccFlag( TPhoneCommandParam* aCommandParam );
+
+    /**
+     * Handles Wired accessory output change event.
+     *
+     * @since S60 v5.0
+     * @param aCommandParam wired information.
+     */    
+    void SetWiredAccFlag( TPhoneCommandParam* aCommandParam );
+    
+    /**
+     * Handles BT accessory availability change event.
+     *
+     * @since S60 v5.0
+     * @param aCommandParam BTA availability 
+     */    
+    void SetBTAccAvailableFlag( TPhoneCommandParam* aCommandParam );
+
+    /**
+     * Handles switch to video change event.
+     *
+     * @since S60 v5.0
+     * @param aCommandParam  
+     */    
+    void SetVideoCallFlag( TPhoneCommandParam* aCommandParam );
+    
+    /**
+     * Handles conference join availability change event.
+     *
+     * @since S60 v5.0
+     * @param aCommandParam Add to conference availability 
+     */    
+    void SetInCallJoinEnabled( TPhoneCommandParam* aCommandParam );
+ 
+    /**
+     * Replace Audio Button
+     *
+     * @since S60 v5.0
+     */
+    void ReplaceAudioButton(); 
+    
+    /**
+     * Sets buttons to correct states.
+     *
+     * @since S60 v5.0
+     */
+     void SetToggleButtons();
+     
+    /**
+     * Set button dimming.
+     *
+     * @since S60 v5.0
+     */
+    void SetButtonDimming();
+    
+    /**
+     * Set button enabled.
+     *
+     * @since S60 v5.0
+     */
+    void SetButtonEnabled( TPhoneCommandParam* aCommandParam );
+    
+    /**
+     * Set button disabled.
+     *
+     * @since S60 v5.0
+     */
+    void SetButtonDisabled( TPhoneCommandParam* aCommandParam );
+
+    /**
+     * Set customization.
+     *
+     * @since S60 v5.0
+     */
+    void SetCustomization( MPhoneButtonCustomization* aCustomization );
+
+private: // From MBubbleTouchPaneIconProvider
+    CGulIcon* GetIconForCommandL( TInt aCommandId );
+    
+    // From MBubbleTouchPaneIconProvider
+    TAknsItemID GetButtonForCommandL( TInt aCommandId );
+    
+
+private:
+
+    CPhoneButtonsController( MBubbleTouchPaneInterface& aTouchPane );
+    
+    void ConstructL();
+    
+private: // data
+    MBubbleTouchPaneInterface& iTouchPane;
+
+    // Tool bar button customization
+    MPhoneButtonCustomization* iCustomization;
+
+    // Flags
+    enum TPhoneButtonsFlags
+        {
+        EButtonsPhoneMuted = 1,
+        EButtonsCallOnHold = 2,
+        EButtonsIhfActive  = 4,
+        EButtonsWiredAcc   = 8,
+        EButtonsBTAcc      = 16,
+        EButtonsBTAccAvail = 32,
+        EButtonsBTAccTmpUn = 64,
+        EButtonsDimAnswer  = 128,
+        EButtonsDimPrivate = 256,
+        EButtonsDimJoin    = 512,
+        EButtonsVideoCallOngoing = 1024,
+        EButtonsDimSilence  = 2048,
+        EButtonsDimCreateConference = 4096  
+        };
+    TInt iFlags;
+    };
+
+#endif // CPHONEBUTTONSCONTROLLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonecallheadertextanimation.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 video call header text animation.
+*
+*/
+
+
+#ifndef CPHONECALLHEADERTEXTANIMATION_H
+#define CPHONECALLHEADERTEXTANIMATION_H
+
+// INCLUDES
+#include <coemain.h>
+#include "mphonetimer.h"
+#include "bmbubblemanager.h"
+
+// CONSTANTS
+const TInt KPhoneCallHeaderAnimationTextLength = 125;
+
+// FORWARD DECLARATIONS
+class CPhoneTimer;
+
+// CLASS DECLARATION
+
+class CPhoneCallHeaderTextAnimation : public CCoeStatic, public MPhoneTimer
+    {
+    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 CPhoneCallHeaderTextAnimation object    
+         */    
+        static CPhoneCallHeaderTextAnimation* InstanceL();   
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneCallHeaderTextAnimation();
+        
+        /**
+        * Stops and destroys video call text animation bubble.
+        */
+        void RemoveAnimatingVideoCallHeader();
+ 
+		/**
+		* Begins animating video call header
+		* @param aBubbleId - bubble which will affect on this
+		* @param aNormalText - normal length text
+		* @param aShortText - short version of the text
+		* @param aBubbleManager - reference to bubble manager for manipulating
+		*						  the bubble
+		*/
+		void StartAnimatingVideoCallHeaderL(
+			const CBubbleManager::TBubbleId aBubbleId,    
+    		const TDesC& aNormalText,
+    		const TDesC& aShortText,
+    		CBubbleManager& aBubbleManager );
+    	
+    	/**
+    	* Sets bubble texts
+    	* @param aNormalText - normal length text
+    	* @param aShortText - short version of the text
+    	*/	
+		void SetBubbleTexts( const TDesC& aNormalText, 
+			const TDesC& aShortText );
+        
+    // From base class MPhoneTimer
+        /**
+        * From MPhoneTimer
+        * This function is called after on timeout.
+        */
+        void HandleTimeOutL();
+        
+
+    private:
+
+        /**    
+         * Default constructor is private because we are using the
+         * singleton design pattern.
+         */    
+        CPhoneCallHeaderTextAnimation();  
+        
+        /**
+        * By default EPOC constructor is private.
+        */
+        void ConstructL();
+                        
+        
+    private:
+    
+        /**
+        * Animation timer
+        */
+        CPhoneTimer* iTimer;
+        
+        /**
+        * Number of dots displayed in the bubble
+        */
+        TInt iDotNum;
+          
+        /*
+        * Pointer to bubble manager
+        */
+        CBubbleManager* iBubbleManager;
+
+        // Bubble Id for the bubble of active call
+        CBubbleManager::TBubbleId iActiveBubble;
+
+        // Normal text for video call header
+        TBuf<KPhoneCallHeaderAnimationTextLength> iNormalText;
+
+        // Short text for video call header
+        TBuf<KPhoneCallHeaderAnimationTextLength> iShortText;
+
+    };
+    
+#endif // CPHONECALLHEADERTEXTANIMATION_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonecontactcontroller.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,166 @@
+/*
+* 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:  Manager for contacts.
+*
+*/
+
+
+
+#ifndef CPHONECONTACTCONTROLLER_H
+#define CPHONECONTACTCONTROLLER_H
+
+// INCLUDES
+#include    <e32base.h>
+
+// FORWARD DECLARATIONS
+class CPhoneCntManagerBase;
+class CPhCntFactory;
+class CPhCntSingleItemFetch;
+class CPhoneCntVoiceKeyImp;
+class CPhoneCntSaveAddToName;
+class CPhCntRfsHandler;
+class CPhCntSpeedDialMonitor; 
+
+// CONSTANTS
+const TInt KConstructAll = -1;
+
+// CLASS DECLARATION
+
+/**
+*  It is manager for contacts.
+*/
+class CPhoneContactController 
+    : public CBase
+    {
+    public:  // Constructors and destructor      
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CPhoneContactController* NewL();
+        
+        /**
+        * Destructor.
+        */
+        ~CPhoneContactController();
+
+    public: // New functions
+
+        /**
+        * Perform steps in construction.
+        *
+        * @param aSteps steps to be performed, one by default
+        * @return steps to be done.
+        */
+        TInt ContinueConstructL( TInt aSteps = 1 );
+
+        /**
+        * Returns amount of steps to be done.
+        *
+        * @return steps to be done, 0 if everything ok.
+        */
+        TInt ConstructionSteps() const;
+
+        /**
+        * Creates single item fetcher.
+        * 
+        * @return single item fetcher, ownership transferred.
+        */
+        CPhCntSingleItemFetch* CreateSingleItemFetchL();
+      
+        /**
+        * Creates object from which pbk operations add
+        * and save are possible
+        *
+        * @return CPhoneCntSaveAddToName, ownership transferred.
+        */
+        CPhoneCntSaveAddToName* CreateSaveAddToNameL();
+        
+        /**
+        * Creates Restore Factory Settings handler.
+        *
+        * @return instance of restore factory settings handler
+        */
+        CPhCntRfsHandler* CreateRfsHandlerL();
+        
+        /**
+        * Creates Speed dial monitor handler.
+        *
+        * @return instance of speed dial monitor handler
+        */
+        CPhCntSpeedDialMonitor* CreateSpeedDialMonitorL();
+        
+        /**
+        * Creates phonebook services, stores etc.
+        */
+        void CreatePhoneBookServiceL();
+
+    private:
+
+        // It defines enumeration for steps in construction.
+        enum TStep
+            {
+            EStepLoadLibrary,
+            EStepCreateFactory,
+            EStepDone
+            };
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneContactController();
+        
+        /**
+        * Perform a step.
+        */
+        void DoStepL();
+
+        /**
+        * Determine next step.
+        *
+        * @param aStep current step.
+        * @return next step.
+        */
+        static TStep NextStep( TStep aStep );
+
+        /**
+        * Load library.
+        */
+        void ConstructLoadLibraryL();
+
+        /**
+        * Create factory.
+        */
+        void ConstructCreateFactoryL();
+
+        // By default, prohibit copy constructor
+        CPhoneContactController( const CPhoneContactController& );
+        // Prohibit assigment operator
+        CPhoneContactController& operator= ( const CPhoneContactController& );
+
+    private:    // Data
+        
+        // Owned: library.
+        RLibrary iLibrary;
+
+        // Owned: contact factory.
+        CPhCntFactory* iFactory;
+
+        // Current situation.
+        TStep iCurrentStep;
+    };
+
+#endif // CPhoneContactController_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonedialercontroller.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,318 @@
+/*
+* 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:  Handles the updating dialer, toolbar buttons.
+*
+*/
+
+
+#ifndef CPHONEDIALERCONTROLLER_H
+#define CPHONEDIALERCONTROLLER_H
+
+#include <e32base.h>
+#include <akntoolbarobserver.h>
+#include <mnumberentry.h>
+#include "mphonenumberentrychangedhandler.h"
+
+class CAknToolbar;
+class CPhoneBubbleWrapper;
+class CCoeEnv;
+class CPhoneMenuController;
+class TPhoneCommandParam;
+class CAknButton;
+class TAknsItemID;
+class MPhoneDialerController;
+class TPhoneCommandParam;
+
+/**
+ *  Dialer controller, updates toolbar buttons
+ *
+ *  @lib PhoneUIView.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CPhoneDialerController ): 
+    public CBase, public MAknToolbarObserver, public MNumberEntryObserver,
+    public MPhoneNumberEntryChangedHandler
+    {
+public:
+    /**
+     * Two-phased constructor.
+     * @param aBubbleWrapper 
+     * @param aCoeEnv 
+     * @param aMenuController 
+     */
+    static CPhoneDialerController* NewL( CPhoneBubbleWrapper& aBubbleWrapper,
+                                         CCoeEnv& aCoeEnv,
+                                         CPhoneMenuController& aMenuController );
+    /**
+     * Destructor.
+     */
+    virtual ~CPhoneDialerController();
+    
+     /**
+     * Updates toolbar buttons according to numberentry state.
+     *
+     * @since S60 v5.0
+     */
+    void UpdateToolbar();
+    
+     /**
+     * Sets state of dtmf dialer visibility.
+     *
+     * @since S60 v5.0
+     * @param aVisible
+     */    
+    void SetDtmfDialerVisibleL( TBool aVisible );  
+    
+     /**
+     * Returns dtmf dialer visibility status.
+     *
+     * @since S60 v5.0
+     * @return ETrue if DTMF Dialer is visible
+     */     
+    TBool IsDTMFDialerVisible() const;
+    
+     /**
+     * Sets state of restricted dialer.
+     *
+     * @since S60 v5.0
+     * @param aRestricted
+     */      
+	void SetRestrictedDialer( TBool aRestricted );    
+	
+     /**
+     * Sets state of service code flag.
+     *
+     * @since S60 v5.0
+     * @param aCommandParam
+     */	
+	void SetServiceCodeFlagL( TPhoneCommandParam* aCommandParam );
+    
+	/**
+    * Enables toolbar
+    *
+    * @since S60 v5.0
+    */ 
+	void ShowToolbar();
+
+    /**
+    * Disables toolbar
+    *
+    * @since S60 v5.0
+    */ 
+    void HideToolbar();	
+
+    /**
+    * Sets custom dialer visible.
+    * @param aCustomController Pointer to dialer extension implementation
+    * @since S60 v5.1
+    */    
+    void ShowCustomizedDialerL( 
+            MPhoneDialerController* aCustomController );
+    
+    /**
+    * Sets custom dialer visible.
+    * @since S60 v5.1
+    */ 
+    void HideCustomizedDialer();
+	
+    /**
+    * Returns flag indicating if customized dialer is visible.
+    * @return ETrue if customized dialer visible, else EFalse
+    * @since S60 v5.1
+    */   
+    TBool IsCustomizedDialerVisible() const;
+	
+    /**
+    * Returns sotkeys resource of the customized dialer
+    * @return Customized dialer softkeys resource id
+    * @since S60 v5.1
+    */ 
+    TInt CustomizedCbaResourceId() const;
+	
+    /**
+    * Returns menu resource of the customized dialer
+    * @return Customized dialer menu resource id
+    * @since S60 v5.1
+    */ 
+    TInt CustomizedMenuResourceId() const;
+
+public:     // from MAknToolbarObserver
+    /**
+     * From base class MAknToolbarObserver
+     * Handles toolbar events for a certain toolbar item.
+     *
+     * @param aCommand The command ID of some toolbar item.
+     */ 
+    void OfferToolbarEventL( TInt aCommand );
+    
+    /**
+     * From base class MAknToolbarObserver
+     * Should be used to set the properties of some toolbar components 
+     * before it is drawn.
+     *   
+     * @param aResourceId The resource ID for particular toolbar
+     * @param aToolbar The toolbar object pointer
+     */
+    void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar );
+    
+public:     // from MNumberEntryObserver
+    /**
+     * From base class MNumberEntryObserver
+     * Indication that numberentry state changed
+     *
+     * @since S60 v5.0
+     */
+    void NumberEntryStateChanged( TBool aHidePromptText );    
+    
+public:    // from base class MPhoneNumberEntryChangedHandler
+        
+    /**
+     * From MPhoneNumberEntryChangedHandler
+     * 
+     * Handles number entry state change. 
+     * Checks has the content of the number entry been modifed.
+     * Informs the via call back functionality the party interested about 
+     * the change. (at the moment phone state machine) 
+     * 
+     * @since S60 5.0
+     */
+     void HandleNumberEntryChanged( );
+        
+     /**
+      * From MPhoneNumberEntryChangedHandler
+      * 
+      * Sets the call back function that is used to get notification when the 
+      * content of the Number Entry has changed. (Used by the the phone 
+      * statemachine.)  
+      * 
+      * @since S60 5.0
+      */
+     void SetNumberEntryChangedCallBack( TPhoneCommandParam* aCommandParam );
+      
+private:
+
+    /**
+     * Creates CAknButton with given parameters and leaves it to 
+     * CleanupStack.
+     * 
+     * @param aNormalIconId
+     * @param aNormalMaskId
+     * @param aTooltipText
+     * @param aSkinIconId
+     * @param aCommand 
+     */  
+    CAknButton* CreateButtonLC( TInt aNormalIconId,
+                                TInt aNormalMaskId,
+                                const TDesC& aTooltipText, 
+                                const TAknsItemID& aSkinIconId,
+                                TInt aCommand );
+    
+    /**
+     * Creates button set for an empty Number Entry.  
+     */
+    void CreateButtonSetNumberEntryEmpty();
+
+    /**
+     * Creates button set for Number Entry when some charaters 
+     * have been entered.
+     */
+    void CreateButtonSetNumberEntryNotEmpty();
+    
+    /**
+     * Constructor.
+     * 
+     * @param aBubbleWrapper 
+     * @param aCoeEnv 
+     * @param aMenuController 
+     */
+    CPhoneDialerController( CPhoneBubbleWrapper& aBubbleWrapper,
+                             CCoeEnv& aCoeEnv,
+                             CPhoneMenuController& aMenuController );    
+    /**
+     * Symbian 2nd phase constructor.
+     * 
+     */
+    void ConstructL();
+    
+    /**
+     * Searches the skin id for the given icon.
+     */
+    inline TAknsItemID SkinId( TInt aIconIndex );
+    
+    /**
+     * Searches the tooltip text for the button using the 
+     * the given command id.
+     * 
+     * @param aCommandId the command id
+     * @param aText     the searched tooltip text
+     */
+    void  GetTooltipTextL( TInt aCommandId, HBufC*& aText ); 
+    
+private: // data
+    /**
+     * AknToolbar. 
+     * Not own.  
+     */
+    CAknToolbar* iToolbar;
+    
+    /**
+     * The reference to the Bubblewrapper
+     */
+    CPhoneBubbleWrapper& iBubbleWrapper;
+    
+    /**
+     * CoeEnv 
+     */
+    CCoeEnv& iCoeEnv;
+    
+    /**
+     * Menucontroller
+     */
+    CPhoneMenuController& iMenuController;    
+    
+    /**
+     * Used to check is the Dialer in DTMF mode
+     */
+    TBool iDtmfDialerVisible;
+
+    /**
+     * Used to check is the Dialer in the restricted mode.
+     * 'Send' and 'Add to Contacts' buttons are dimmed.
+     */
+    TBool iRestrictedDialer; 
+    
+    /**
+     * Used to check is the service code flag set.
+     * Tooltip text is changed between 'Send' or 'Call' 
+     */
+    TBool iServiceCodeFlag;
+    
+    /*
+     * Is used to check has the hide prompt text flag changed.
+     */
+    TBool iPreviousHidePromptTextStatus;
+    
+    // Pointer to dialer extension implementation
+    MPhoneDialerController* iCustomizedDialer;
+    
+    /**
+     * Is used to check should toolbar be updated. 
+     */
+    TBool iUpdateToolbar;
+
+    };
+
+#include    "cphonedialercontroller.inl"
+
+#endif // CPHONEDIALERCONTROLLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonedialercontroller.inl	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,56 @@
+/*
+* 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:  private, CPhoneDialerController
+*
+*/
+
+#ifndef CPHONEDIALERCONTROLLER_INL_
+#define CPHONEDIALERCONTROLLER_INL_
+
+#include <AknsUtils.h>
+#include <phoneui.mbg>
+
+// ---------------------------------------------------------------------------
+// SkinId
+// ---------------------------------------------------------------------------
+//    
+inline TAknsItemID CPhoneDialerController::SkinId( TInt aIconIndex )
+    {
+    TAknsItemID skinId;
+    
+    switch ( aIconIndex )
+        {
+        case EMbmPhoneuiQgn_indi_dialer_call_send:
+            skinId = KAknsIIDQgnIndiDialerCallSend;
+            break;
+        case EMbmPhoneuiQgn_indi_button_send_dtmf:
+            skinId = KAknsIIDQgnIndiButtonSendDtmf;
+            break;
+        case EMbmPhoneuiQgn_indi_dialer_contacts:
+            skinId = KAknsIIDQgnIndiDialerContacts;
+            break;
+        case EMbmPhoneuiQgn_indi_dialer_add_contacts:
+            skinId = KAknsIIDQgnIndiDialerAddContacts;
+            break;
+        case EMbmPhoneuiQgn_indi_dialer_clear:
+            skinId = KAknsIIDQgnIndiDialerClear;
+            break;                        
+        default:
+            skinId = KAknsIIDNone;        
+            break;            
+        }
+    return skinId;   
+    }
+
+#endif /*CPHONEDIALERCONTROLLER_INL_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonedialerview.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,209 @@
+/*
+* 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 UI Dialer View
+*
+*/
+
+#ifndef __CPHONEDIALERVIEW_H
+#define __CPHONEDIALERVIEW_H
+
+//  INCLUDES
+
+#include <coecntrl.h>
+#include <coeview.h>
+
+// FORWARD DECLARATIONS
+class CAknsLayeredBackgroundControlContext;
+class TPhoneCommandParam;
+
+// CLASS DECLARATION
+
+/**
+*   View for dialer control
+*/
+class CPhoneDialerView : public CCoeControl, public MCoeView
+    {
+    public:  // Constructors and destructor        
+
+        static CPhoneDialerView *NewL( TRect aRect );
+
+        virtual ~CPhoneDialerView();
+
+    public: // Functions from base classes
+
+        /**
+        * Returns a TVwsViewId uniquely identifying the view.
+        * @return Represents a view in the server
+        */
+        TVwsViewId ViewId() const;
+
+        void ActivateL();
+
+        /**
+        * From CCoeControl; notifier for resource changes
+        * @param aType : Type of resource change
+        */
+        void HandleResourceChange( TInt aType );
+
+    public: // New functions
+
+        /**
+        * Sets the control as component.
+        * @param aControl It is the new component.
+        */
+        void SetControl( CCoeControl* aControl );
+        
+        /**
+        * Returns the control in the view.
+        * @return aControl The control.
+        */
+        CCoeControl* Control() const;
+       
+        /**
+        * Sets the security mode flag ETrue or EFalse
+        * @param aStatus ETrue for the security mode. EFalse for the 
+        * normal mode.
+        */ 
+        void SetSecurityMode ( TBool aStatus );
+        
+        /**
+        * Get state of the security mode flag
+        * @return aStatus ETrue for the security mode. EFalse for the 
+        * normal mode.
+        */         
+        TBool IsSecurityMode();
+        
+    public:  // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        void SetRect( const TRect &aRect );        
+
+    protected:  // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        void HandlePointerEventL(
+            const TPointerEvent& aPointerEvent );
+
+        /**
+        * From CCoeControl
+        */
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+
+        /**
+        * From CCoeControl
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl
+        */
+        void Draw( const TRect& aRect ) const;
+
+        /**
+        * From CCoeControl, informs that the size is changed to update
+        * the sizes of component controls appropriately.
+        */
+        void SizeChanged();
+
+        /**
+        * From CCoeControl, informs that the position has been changed.
+        */
+        void PositionChanged();
+
+        /**
+        * From CCoeControl, MopSupplyObject
+        */
+        TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
+
+        /**
+        * From CCoeControl
+        */        
+        void FocusChanged( TDrawNow aDrawNow );
+        
+    private: // Functions from base classes
+
+        /**
+        * Takes any action required on activation of the view. 
+        * Reimplemented versions should read the message text
+        * @param aCustomMessage message for any message type 
+        *                       identified by aCustomMessageId
+        * @param aCustomMessageId message ID that the view understands
+        * @param aPrevViewId The id of the previously active view 
+        *                    so that the view may switch back to its caller
+        *                    at some later stage
+        */
+        void ViewActivatedL( 
+            const TVwsViewId& aPrevViewId, 
+            TUid aCustomMessageId, 
+            const TDesC8& aCustomMessage );
+
+        /**
+        * Takes any action required on deactivation of the view e.g. to 
+        * make the controls owned by the view non-visible
+        * (thereby saving the window server uneccessary work).
+        */
+        void ViewDeactivated();
+
+    private:
+
+        CPhoneDialerView();
+
+        void ConstructL( TRect aRect );
+
+    private:
+
+        /**
+        * Updates size of the control.
+        */
+        void UpdateControlRect();
+
+    private:
+
+        // Region type.
+        typedef RRegionBuf< KPhoneRegionAmount > RPhoneRegionBuf;
+
+        // Control rectangle
+        TRect iControlRect;
+        
+        // Owned: region
+        RPhoneRegionBuf iRegion;
+        
+        // Pointer to active control.
+        CCoeControl* iControl;
+
+        // Owned: background context.
+        CAknsLayeredBackgroundControlContext* iBgContext;
+
+        // Top left coordinate.
+        TPoint iTopLeftCoord;
+        
+        // Owned: Status area use status.
+        TBool iStatusAreaUsed;
+        
+        //Id of the fullscreen AI plugin
+        TInt iFsAiId;
+        
+        //MainPane
+        TRect iMainPane;
+        
+        //Is security mode or not
+        TBool iSecurityMode;
+        };
+
+#endif // __CPHONEDIALERVIEW_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonedtmfnumberlistquery.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Definition of CPhoneDtmfNumberListQuery class.
+*
+*/
+
+
+#ifndef CPHONEDTMFNUMBERLISTQUERY_H
+#define CPHONEDTMFNUMBERLISTQUERY_H
+
+#include    <AknQueryDialog.h>
+
+    
+// CLASS DECLARATION
+class MPhoneQueryObserver; 
+    
+/**
+*   DTMF number list query.
+*
+*   Shows DTMF list query. 
+*   By default list is formatted with 'Find' and 'Enter manually' items.
+*   In addition predefined DTMF of the contact can be seen in 
+*   list if available.
+*
+*   Otherwise base class can handle it.
+*
+*   @since 5.0
+*/
+class CPhoneDtmfNumberListQuery : public CAknListQueryDialog
+    {
+    public:  // Constructors and destructor      
+               
+         /**
+        * Creates new instance of CPhoneDtmfNumberListQuery
+        * @param aCommandObserver callback observer
+        * @param aQueryObserver  query observer
+        * @param aSelectedDtmfNumber selected predefined dtmf number 
+        * @return CPhoneDtmfNumberListQuery* object  
+        */
+        static CPhoneDtmfNumberListQuery* 
+            CPhoneDtmfNumberListQuery::NewL( MEikCommandObserver& aCommandObserver,
+                                             MPhoneQueryObserver& aQueryObserver,
+                                             HBufC*& aSelectedDtmfNumber );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneDtmfNumberListQuery();
+    
+    public:
+        
+        /**
+        * Appends given string to DTMF array 
+        * @param aString -string to be added 
+        */    
+        void AppendStringToArrayL( TDesC& aString );
+        
+    protected: // Functions from base classes
+            
+        /**
+        * From base class, 
+        * check if it is ok to exit.
+        */
+        TBool OkToExitL( TInt aButtonId );
+            
+        /**
+        * From CEikDialog, initialization after layout.
+        */
+        void PostLayoutDynInitL();
+        
+
+        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                          TEventCode aType );
+    
+    private:
+    
+        /**
+        * C++ constructor.
+        * @param aCommandObserver callback observer
+        * @param aQueryObserver  query observer
+        * @param aSelectedDtmfNumber selected predefined dtmf number 
+        */
+        CPhoneDtmfNumberListQuery( MEikCommandObserver& aCommandObserver,
+                                   MPhoneQueryObserver& aQueryObserver,
+                                   HBufC*& aSelectedDtmfNumber  );
+        
+        
+        /**
+        * Symbian constructor
+        */
+        void ConstructL();
+
+    private:    // Data
+
+        MEikCommandObserver& iCommandObserver;
+                
+        MPhoneQueryObserver& iQueryObserver;
+        
+        HBufC*& iSelectedDtmfNumber;
+   
+        // Index of selected item.
+        TInt iIndex;
+        
+        // Contains predefined DTMF(s), 'Find' and 'Enter manually' items
+        // Owned.
+        CDesCArrayFlat iArray;
+        
+        
+    };
+
+#endif      // CPHONEDTMFNUMBERLISTQUERY_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonedtmfsendingnote.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  DTMF Sending Note. This note handles keypresses unlike
+*								 CPhoneNote.
+*
+*/
+
+/*
+*/
+
+#ifndef CPHONEDTMFSENDINGNOTE_H
+#define CPHONEDTMFSENDINGNOTE_H
+
+
+//  INCLUDES
+#include "cphonenote.h"
+
+// FORWARD DECLARATIONS
+
+class CPhoneDtmfSendingNote : public CPhoneNote
+    {
+    public:  // Constructors and destructor
+
+        /**
+         * Constructor.
+         * 
+         * @param    aSelfPtr            Pointer to self. 
+         *                               This pointer is set to NULL when the note is destroyed by the framework.
+         * @param    aCommandObserver    Observer to receive command events from the note.
+         */
+        CPhoneDtmfSendingNote( CEikDialog** aSelfPtr, MEikCommandObserver& aCommandObserver );  
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneDtmfSendingNote();  
+        
+        
+    protected:
+
+        TKeyResponse OfferKeyEventL( 
+            const TKeyEvent& aKeyEvent,
+            TEventCode aType );
+
+    };
+
+#endif // CPHONEDTMFSENDINGNOTE_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphoneincallindicator.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,152 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  It manages incall indicator.
+*
+*/
+
+
+#ifndef CPHONEINCALLINDICATOR_H
+#define CPHONEINCALLINDICATOR_H
+
+// INCLUDES
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class CAknIncallBubble;
+class TPhoneCommandParam;
+
+// CLASS DECLARATION
+
+/**
+*  It manages incall indicator (small bubble over the status pane).
+*
+*  @since 1.0
+*/
+class CPhoneIncallIndicator : public CBase
+    {
+    public:  // Constructors and destructor      
+        
+        /**
+        * Two-phased constructor.
+        * @return new instance.
+        */
+        static CPhoneIncallIndicator* NewL();
+        
+        /**
+        * Destructor.
+        */
+        ~CPhoneIncallIndicator();
+
+    public: // New functions
+
+        /**
+        * Update indicator using the specified data
+        * @param aCommandParam command parameter
+        */
+        void Update( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Handle an audio mute change
+        * @param aCommandParam command parameter
+        */
+        void HandleMuteChange( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Handle a ciphering change
+        * @param aCommandParam command parameter
+        */
+        void HandleCipheringChange( TPhoneCommandParam* aCommandParam );
+
+    private:
+
+        /**
+        * C++ constructor.
+        */
+        CPhoneIncallIndicator();
+
+        /**
+        * Symbian OS constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Update indicator.
+        */
+        void Update();
+
+        /**
+        * Sets state.
+        *
+        * @param aState new state.
+        * @param aSync do synchronously.
+        */
+        void SetState( TInt aState, TBool aSync );
+
+        /**
+        * Updates using recovery system.
+        */
+        void UpdateWithRecovery();
+
+        /**
+        * Updates incall indicator.
+        */
+        static TInt DoRecoverUpdateL( TAny* aAny );
+
+        /**
+        * Updates incall indicator.
+        */
+        static TInt DoUpdate( TAny* aAny );
+
+    private:    // Data
+
+        // Recovery id for updating incall indicator.
+        TInt iUpdateRecoveryId;
+
+        // Current call state.
+        TInt iCallState;
+
+        // Incall mode.
+        TInt iMode;
+
+        // Current state.
+        TInt iState;
+
+        // Owned incall bubble instance.
+        CAknIncallBubble* iBubble;
+
+        // Indicates if phone is muted.
+        TBool iMuted;
+
+        // Indicates if ciphering is off.
+        TBool iCipheringOff;
+
+        // Indicates if call is in emergency mode.
+        TBool iEmergency;
+
+        // Owned callback.
+        CIdle* iUpdater;
+        
+        // Indicates if line2 is in use.
+        TBool iLine2;
+        
+        // Indicated if bubble needs to be visible or not
+        TBool iVisible;
+        
+        // Indicates if ciphering indicator is allowed.
+        TBool iCipheringIndicatorAllowed; 
+    };
+
+#endif      // CPHONEINCALLINDICATOR_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonekeycapturecontroller.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  PhoneUI Key Capture Controller
+*
+*/
+
+/*
+*/
+
+#ifndef __CPHONEKEYCAPTURECONTROLLER_H
+#define __CPHONEKEYCAPTURECONTROLLER_H
+
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32keys.h>
+
+// FORWARD DECLARATIONS
+class TPhoneCommandParam;
+
+class CPhoneKeyCaptureController : public CBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CPhoneKeyCaptureController* NewL( CEikonEnv& aEikEnv );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneKeyCaptureController();   
+
+    public: 
+
+        /**
+        * Set key to be captured 
+        * @param aCommandParam a command param
+        */
+        void StartCapturingKey( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Set key not to be captured 
+        * @param aCommandParam a command param
+        */
+        void StopCapturingKey( TPhoneCommandParam* aCommandParam );
+
+    private:  // Constructors
+        
+        /**
+        * C++ default constructor.
+        */
+        CPhoneKeyCaptureController( CEikonEnv& aEikEnv );
+
+    private:    // Data types
+
+        // enumerated type for captured key events
+        enum TPhoneKeyCaptureType
+            {
+            EPhoneKeyCaptureEvent,
+            EPhoneKeyCaptureUpAndDownEvents,
+            EPhoneKeyCaptureAllEvents
+            };
+
+        // key capture data structure
+        class TPhoneKeyCapture
+            {
+            public:
+                TStdScanCode            iKey;
+                TKeyCode                iKeyCode;
+                TPhoneKeyCaptureType    iType;
+                TInt32                  iHandle;
+                TInt32                  iHandleForUpAndDown;
+            };
+
+    private:  // New functions
+
+        /**
+        * May be used to ask whether a key has been set to be captured
+        * using StartCapturingKey()
+        * @param aKey is the iScanCode of the key
+        * @return ETrue if the key is currently captured via this mechanism
+        */
+        TBool IsKeyCaptured( TStdScanCode aKey ) const;
+
+        /**
+        * Set key not to be captured 
+        * @param aKeyCapture is the key not to be captured
+        */
+        void StopKeyCapture( TPhoneKeyCapture aKeyCapture );
+
+    private:  // Data
+
+        /**
+        * Array of keycodes currently captured which includes the window
+        * server handles for the captured keys.
+        */
+        RArray<TPhoneKeyCapture> iCapturedKeys;
+        
+        CEikonEnv& iEikEnv;
+
+    };
+
+#endif      // __CPHONEKEYCAPTURECONTROLLER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonelistquerydialog.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  PhoneUI ListQueryDialog
+*
+*/
+
+
+#ifndef CPHONELISTQUERYDIALOG_H
+#define CPHONELISTQUERYDIALOG_H
+
+//  INCLUDES
+#include <aknlistquerydialog.h>
+
+
+// CLASS DECLARATION
+class MPhoneQueryObserver;
+
+/**
+* This is a dialog, which can be initialized with selected items.
+*/
+class CPhoneListQueryDialog : public CAknListQueryDialog
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ constructor.
+        *
+        * @param aCommandObserver callback observer
+        *                    
+        */
+        CPhoneListQueryDialog( MEikCommandObserver& aCommandObserver,
+                               MPhoneQueryObserver& aQueryObserver,
+                               const RArray<TInt>& aCommands );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneListQueryDialog();
+        
+        
+    private: // From CEikDialog
+        
+        /**
+        * Sets selection indexes to list box.
+        */
+        void PostLayoutDynInitL();
+
+        /**
+        * If the user has pushed Ok, the dialog Stores the selected 
+        * values in to the server.
+        *
+        * @param aKeyCode key code
+        * @return ETrue if dialog is closed
+        */
+        TBool OkToExitL( TInt aKeycode );
+        
+               
+        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                           TEventCode aType );
+
+    private: // Data
+
+        // contains selected index
+        TInt iIndex;
+        
+        MEikCommandObserver& iCommandObserver;
+        
+        MPhoneQueryObserver& iQueryObserver; 
+        
+        RArray<TInt> iCommands;
+
+    };
+
+#endif      // CPHONELISTQUERYDIALOG_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonemenucontroller.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  PhoneUI Menu Controller
+*
+*/
+
+
+#ifndef CPHONEMENUCONTROLLER_H
+#define CPHONEMENUCONTROLLER_H
+
+//  INCLUDES
+
+
+#include <e32base.h>
+#include <e32std.h>
+#include <eikmenub.h> 
+#include <e32property.h>
+#include "mphonepubsubobserver.h"
+
+// FORWARD DECLARATION
+class TPhoneCommandParam;
+class CEikonEnv;
+class MPhonePubSubObserver;
+class CAiwServiceHandler;
+
+class CPhoneMenuController : public CBase, public MPhonePubSubObserver
+    {
+    public:
+
+        /**
+        * Two-phased constructor.
+        */
+        static CPhoneMenuController* NewL( CEikonEnv& aEikEnv );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneMenuController();   
+
+        void OpenMenuBarL();
+
+        void CloseMenuBar();
+        
+        void OpenMenuBarL( TPhoneCommandParam* aCommandParam );
+
+        void DynInitMenuBar( TPhoneCommandParam* aCommandParam );
+
+        void DynInitMenuPaneL( TPhoneCommandParam* aCommandParam );
+       
+        void SetMuteFlag( TPhoneCommandParam* aCommandParam );
+
+        void SetIhfFlag( TPhoneCommandParam* aCommandParam );
+        
+        void SetHoldFlag( TPhoneCommandParam* aCommandParam );
+        
+        void GetHoldFlag( TPhoneCommandParam* aCommandParam );
+        
+        void SetConferenceAndSingleFlag( TPhoneCommandParam* aCommandParam );
+        
+        void GetConferenceAndSingleFlag( TPhoneCommandParam* aCommandParam );
+        
+        void SetSoftRejectFlag( TPhoneCommandParam* aCommandParam );
+        
+        void GetSoftRejectFlag( TPhoneCommandParam* aCommandParam );
+
+        void SetServiceCodeFlag( TPhoneCommandParam* aCommandParam );
+        
+        void SetWiredAccFlag( TPhoneCommandParam* aCommandParam );
+        
+        void SetMaxConfMembersFlag( TBool aIsMaxConfMember );
+        
+        void SetBTAccFlag( TPhoneCommandParam* aCommandParam );
+        
+        void SetBTAccAvailableFlag( TPhoneCommandParam* aCommandParam );
+        
+        void SetPhoneNumberAvailableInPhoneEngine( TPhoneCommandParam* aCommandParam );
+        
+        void SetWiredAccAvailableFlag( TPhoneCommandParam* aCommandParam );
+        
+        void SetNEVisibleFlag( TBool aVisible );
+
+        void SetReplaceFlag( TBool aReplace );
+        
+        void SetRemoveConfrenceOptionsFlag( TBool aRemoveConfrenceOptions );
+        
+        void SetNumberEntryEmptyFlag( TBool aNumberEntryEmpty );
+        
+        void SetCallInProgressFlag( TPhoneCommandParam* aCommandParam );               
+        
+        TBool IsMenuBarVisible();
+        
+        void SetConferenceParticipantsListVisibleFlag( TPhoneCommandParam* aCommandParam );
+        
+        void GetConferenceParticipantsListVisibleFlag(
+            TPhoneCommandParam* aCommandParam );
+
+        void SetAlphaModeFlag( TBool aMode );
+        
+        void SetAllowDtmfOptionsFlag( TBool aAllowDtmfOptions );
+        
+        void SetVoipEnabledFlag( TPhoneCommandParam* aCommandParam );
+        
+        void SetHideVideoCallDTMFVisibilityFlag ( TBool aHideVideoCallDTMFVisibility );
+
+		void SendAiwCommandL( TPhoneCommandParam* aCommandParam );      
+ 
+		void SetContextMenu( TPhoneCommandParam* aCommandParam );
+		
+    public: //from base class 
+        
+         void HandlePropertyChangedL( 
+            const TUid& aCategory,
+            const TUint aKey,
+            const TInt aValue );
+		
+    protected:    // Constructors
+        
+        /**
+        * C++ default constructor.
+        */
+        CPhoneMenuController( CEikonEnv& aEikEnv );
+       
+
+    private:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        void ConstructL();
+
+        void AddMenuPaneL(
+            TInt aPaneResourceId,
+            CEikMenuPane* aMenuPane,
+            TBool aAddSeparator );
+            
+        /**
+        * Checks if task swapper is to be shown in menu.
+        * @param aResourceId It is the context menu resource.
+        */
+        void ShowTaskSwapper( TInt aResourceId ) const;
+        
+        TBool IsSwivelClosed() const;
+    
+    private:
+        CEikMenuBar* iMenu;
+        TInt iGSMMenuResourceOffset;
+
+        TInt iMenuResourceId;
+        TInt iOkMenuResourceId;
+        TBool iIhfFlag;
+        TBool iMuteFlag;
+        TBool iHoldFlag;
+        TBool iConferenceAndSingleFlag;
+        TBool iSoftRejectFlag;
+        TBool iServiceCodeFlag;
+        TBool iWiredAccFlag;
+        TBool iMaxConfMembersFlag;
+        TBool iBTAccFlag;
+        TBool iBTAccTmpUnFlag;
+        TBool iBTAccAvailableFlag;
+        TBool iPhoneNumberAvailableInPhoneEngine;
+        TBool iWiredAccAvailableFlag;
+        TBool iNEVisible;
+        TBool iReplace;
+        TBool iRemoveConfrenceOptionsFlag;
+        TBool iNumberEntryEmpty;
+        TBool iCallInProgress;
+        TBool iConferenceParticipantsListOpenFlag;
+        TBool iAlphaMode;
+        TBool iAllowDtmfOptionsFlag;
+        TBool iVoipEnabledFlag;  
+        TBool iHideVideoCallDTMFVisibility;
+        // Eikon environment delivered from CPhoneViewController
+        CEikonEnv& iEikEnv;       
+        // Pointer to AIW service handler. OWNED.
+        CAiwServiceHandler* iServiceHandler;       
+    };
+
+#endif      // MPAMENUBARCONTROLLER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonenote.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  PhoneUI Note
+*
+*/
+
+/*
+*/
+
+#ifndef CPHONENOTE_H
+#define CPHONENOTE_H
+
+
+//  INCLUDES
+#include "tphonecmdparamnote.h"
+#include <aknnotedialog.h>
+
+// FORWARD DECLARATIONS
+
+class CPhoneNote : public CAknNoteDialog
+    {
+    public:  // Constructors and destructor
+
+        /**
+         * Constructor.
+         * 
+         * @param    aSelfPtr            Pointer to self. 
+         *                               This pointer is set to NULL when the note is destroyed by the framework.
+         * @param    aCommandObserver    Observer to receive command events from the note.
+         */
+        CPhoneNote( CEikDialog** aSelfPtr, MEikCommandObserver& aCommandObserver );  
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneNote();  
+
+        /**
+        * Sets the type of the note.
+        */
+        void SetNoteType( TPhoneNoteType aNoteType );
+
+        /**
+        * Gets the type of the note.
+        */
+        TPhoneNoteType NoteType();
+        
+        /**
+        * Updates softkeys to note
+        * @param    aResourceId     Resource id
+        */
+        void UpdateSoftkeysL( TInt aResourceId );
+        
+    protected:
+
+        TKeyResponse OfferKeyEventL( 
+            const TKeyEvent& aKeyEvent,
+            TEventCode aType );
+
+        TBool OkToExitL( TInt aCommand );
+
+        void HandlePointerEventL( 
+            const TPointerEvent& aPointerEvent );
+        
+    protected:  // Data
+
+        MEikCommandObserver& iCommandObserver;
+        
+        //The type of note. Not necessarily set.
+        //Used in security view
+        TPhoneNoteType iNoteType;
+    };
+
+#endif // CPHONENOTE_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonenotecontroller.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  PhoneUI Note Controller
+*
+*/
+
+/*
+*/
+#ifndef CPHONENOTECONTROLLER_H
+#define CPHONENOTECONTROLLER_H
+
+
+//  INCLUDES
+#include "cphoneprogressnote.h"
+#include "mphonetimer.h"
+
+// FORWARD DECLARATIONS
+class TPhoneCommandParam;
+class CPhoneTimer;
+class CEikonEnv;
+class CPhoneNote;
+class CPhoneUIDisabledNote;
+
+class CPhoneNoteController : public CBase, public MPhoneTimer
+    {
+    public:
+
+        /**
+        * Two-phased constructor.
+        */
+        static CPhoneNoteController* NewL( CEikonEnv& aEikEnv );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneNoteController();   
+
+        void CreateNoteL( TPhoneCommandParam* aCommandParam );
+
+        void DestroyNote();
+        
+        void DestroyDTMFNote();
+        
+        void DestroyGlobalNoteL();
+
+        void CreateGlobalNoteL( TPhoneCommandParam* aCommandParam );
+        
+        void CreateProgressNoteL( TPhoneCommandParam* aCommandParam );
+        
+        void DestroyProgressNote();
+        
+        /**
+        * This function is called after on timeout.
+        */
+        void HandleTimeOutL();
+        
+        /**
+        * Writes information is note visible or not
+        * to the given command parameter.
+        * @param aCommandParam - boolean param
+        */
+        void IsNoteVisible( TPhoneCommandParam* aCommandParam );        
+
+        /**
+        * Writes information is progress note visible or not
+        * to the given command parameter.
+        * @param aCommandParam - boolean param
+        */
+        void IsProgressNoteVisible( TPhoneCommandParam* aCommandParam );   
+        
+        /**
+        * Writes information is note or not
+        * to the given command parameter.
+        * @param aCommandParam - boolean param
+        */
+        void IsNoteActive( TPhoneCommandParam* aCommandParam );  
+        
+        /**
+        * Returns true if active note is dismissable by key event, else false.
+        * @param aCommandParam - boolean param
+        */
+        void IsActiveNoteDissmissableByKeyEvent( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Updates softkeys to note 
+        * @param aCommandParam - integer param for resolved resource id
+        */
+        void UpdateNoteSoftkeysL( TPhoneCommandParam* aCommandParam );
+        
+    private:
+        
+        /**
+        * C++ default constructor.
+        */
+        CPhoneNoteController( CEikonEnv& aEikEnv );
+
+        /**
+        * Updates information text to ongoing note
+        * @param aCommandParam - note param
+        */
+        void UpdateNoteTextL( TPhoneCommandParam* aCommandParam );    
+
+    private:  // Data
+
+        // Actual note
+        CPhoneNote* iNote;
+        
+        CPhoneProgressNote* iProgressNote;
+        
+        // Owned timer instance.
+        CPhoneTimer* iProgressUpdateTimer;
+        
+        // Interval of progress updates.
+        TInt iInterval;
+
+        // Current progress.
+        TInt iProgressBarCount;
+
+        // Time to wait until next attempt.
+        TInt iWaitTime;
+        
+        TTime iStartTime;
+        
+        /**
+        * ID of global note.
+        */
+        TInt iGlobalNoteId;
+        
+        // Eikon environment delivered from CPhoneViewController
+        CEikonEnv& iEikEnv;
+        
+        // Note's text
+        TDesC* iNoteText;
+        
+    };
+
+#endif      // CPHONENOTECONTROLLER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonenumberentry.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,160 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Definition of number entry handler.
+*
+*/
+
+#ifndef CPHONENUMBERENTRY_H
+#define CPHONENUMBERENTRY_H
+
+// Includes
+#include <e32base.h>
+
+#include "mphonenumberentry.h"
+#include "mphonenumberentrychangedhandler.h"
+
+// Forward declarations
+class CBubbleManager;
+class MNumberEntry;
+class CCoeControl;
+class TPhoneCommandParam;
+
+/**
+ *  Access to number entry.
+ *
+ *  @lib PhoneUIView.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CPhoneNumberEntry ): public CBase, public MPhoneNumberEntry,
+    public MPhoneNumberEntryChangedHandler
+    {
+
+public:
+
+
+    static CPhoneNumberEntry* NewL( CBubbleManager& aBubbleManager );
+
+    virtual ~CPhoneNumberEntry();
+    
+    // From MPhoneNumberEntry
+    
+    void EnableTactileFeedback( const TBool aEnable );
+    
+    TBool IsNumberEntryUsed() const;
+    
+    TInt CountNumberEntryCharacters();
+    
+    void SetNumberEntry( MNumberEntry* aNumberEntry );
+    
+    void SetNumberEntryContent( const TDesC& aContent );
+    
+    void SetNumberEntryPromptText( const TDesC& aPromptText ); 
+    
+    // from base class MPhoneNumberEntryChangedHandler
+    
+    /**
+     * From MPhoneNumberEntryChangedHandler
+     * 
+     * Handles number entry state change. 
+     * Checks has the content of the number entry been modifed.
+     * Informs the via call back functionality the party interested about 
+     * the change. (at the moment phone state machine) 
+     * 
+     * @since S60 5.0
+     */
+    void HandleNumberEntryChanged( );
+    
+    /**
+     * From MPhoneNumberEntryChangedHandler
+     * 
+     * Sets the call back function that is used to get notification when the 
+     * content of the Number Entry has changed. (Used by the the phone 
+     * statemachine.)  
+     * 
+     * @since S60 5.0
+     */
+    void SetNumberEntryChangedCallBack( TPhoneCommandParam* aCommandParam );
+   
+private:
+
+    CPhoneNumberEntry( CBubbleManager& aBubbleManager );
+    
+    void ConstructL();
+    
+    /**
+     * Compares previous number entry content to current.
+     * If it is different updates the previous buffer. 
+     * 
+     * @return ETrue if nubmer entry content has changed
+     */
+    TBool CheckNumberEntryContent();
+    
+    /**
+     * Updates the previous number entry buffer. 
+     * 
+     * @return ETrue if nubmer entry content was changed
+     */
+    TBool UpdatePreviousNumberEntryContent( CCoeControl* aEditor );
+    
+    /**
+     * Returns pointer to phonenumbereditor of the Dialer number entry , 
+     * if it in use
+     * 
+     * @return pointer to number entry editor
+     */
+    CCoeControl* DialerNumberEntryEditor() const;
+    
+    /**
+     * Returns pointer to phonenumbereditor of the Bubblemanager number entry , 
+     * if it in use
+     * 
+     * @return pointer to number entry editor
+     */
+    CCoeControl* BubbleNumberEntryEditor() const;
+
+private:
+    
+    CBubbleManager& iBubbleManager;
+    
+    /**
+     * Pointer to MNumberEntry, dialercontroller sets this to 
+     * point to touch dialer.
+     * Not own.
+     */
+    MNumberEntry* iDialerNumberEntry;
+    
+    // Owned contents.
+    HBufC* iNumberEntryContents;
+    
+    /**
+     * Is used to check is touch dialer enabled.
+     */
+    TBool iUseDialer;
+    
+    /*
+    * Call back function to inform that the content of 
+    * Number Entry has changed.
+    */
+    TCallBack iNEChangedCallBack;
+    
+    /**
+     * Keeps track of the content of the number entry
+     * Own.
+     */
+    HBufC* iPreviousNumberEntryContent;     
+    
+    };
+
+
+#endif // CPHONENUMBERENTRY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphoneprogressnote.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Progress note handler
+*
+*/
+
+
+#ifndef CPHONEPROGRESSNOTE_H
+#define CPHONEPROGRESSNOTE_H
+
+//  INCLUDES
+#include    <AknProgressDialog.h>
+
+// FORWARD DECLARATIONS
+
+class CPhoneProgressNote : public CAknProgressDialog
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Constructor.
+        *
+        * @param aFinalValue final value.
+        * @param anIncrement increment.
+        * @param anInterval interval after which note is updated.
+        * @param aSelfPtr pointer to itself.
+        * @param aCommandHandler command handler.
+        */
+        CPhoneProgressNote( 
+                TInt aFinalValue,
+                TInt anIncrement,
+                TInt anInterval,
+                CEikDialog** aSelfPtr,
+                MEikCommandObserver* aCommandObserver ); 
+                
+        /**
+        * Constructor.
+        *
+        * @param aSelfPtr pointer to itself.
+        * @param aCommandHandler command handler.
+        */
+        CPhoneProgressNote(
+            CEikDialog** aSelfPtr,
+            MEikCommandObserver* aCommandObserver  ); 
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneProgressNote();  
+        
+    private:  // From CAknNoteDialog
+
+        TKeyResponse OfferKeyEventL( 
+            const TKeyEvent& aKeyEvent,
+            TEventCode aType );
+
+        TBool OkToExitL( TInt aCommand );
+
+    private:  // Data
+
+        MEikCommandObserver* iCommandObserver;
+    };
+#endif      // CPhoneProgressNote_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonequerycontroller.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,363 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 Query Controller
+*
+*/
+
+
+#ifndef CPHONEQUERYCONTROLLER_H
+#define CPHONEQUERYCONTROLLER_H
+
+
+
+//  INCLUDES
+#include "cphonetextquery.h"
+#include "mphonequeryobserver.h"
+#include "mphonetimer.h"
+#include "tphonecmdparamquery.h"
+
+// DATA TYPES
+enum TPhoneAvkonQueryType
+    {
+    EPhoneAvkonNone,
+    EPhoneAvkonGlobalConfirmation,
+    EPhoneAvkonGlobalList
+    };
+
+// FORWARD DECLARATIONS
+class TPhoneCommandParam;
+class CAknGlobalConfirmationQuery;
+class CPhoneQueryDialog;
+class CPhoneDtmfNumberListQuery;
+class CPhoneListQueryDialog;
+class CCaUiReconnectQuery;
+class CPhoneTimer;
+class CAknGlobalMsgQuery;
+class CAknGlobalNote;
+
+class CPhoneQueryController :
+    public CActive,
+    public MEikCommandObserver,
+    public MPhoneQueryObserver,
+    protected MPhoneTimer
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CPhoneQueryController* NewL( CEikonEnv& aEikEnv );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneQueryController();   
+
+        /**
+        * Creates query dialog from the given command parameter
+        * @param aCommandParam command parameter holding data for
+        * populating the needed query dialog.
+        */
+        void CreateQueryL( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Destructs all existing query dialogs except global.
+        */
+        void DestroyQuery();
+        
+        /**
+        * Destructs global query dialog.
+        */
+        void DestroyGlobalQuery();
+
+        /**
+        * Destroys global wait note
+        */
+        void DestroyGlobalWaitNote();
+
+        /**
+        * Fetches query dialog's content
+        * @param aCommandParam pointer where content will be written
+        */
+        void GetTextQueryContentL( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Set by the query when it is asynchronously deleted.
+        * @param aQueryDeleted ETrue if the query is deleted
+        */
+        void SetQueryDeletedFlag( TBool aQueryDeleted ); 
+        
+        /**
+        * Get active status of queries
+        * @param aCommandParam command parameter
+        */
+        void IsQueryActive( TPhoneCommandParam* aCommandParam );
+        
+        /**
+        * Sets string for List query dialog
+        * @param aCommandParam command parameter
+        */
+        void SetListQueryStringL( TPhoneCommandParam* aCommandParam );
+    
+        /**
+        * Reports query dialog's exit
+        * @param aCommand user selected action.
+        */        
+        void ReportQueryCompleteAsync( TInt aCommand );
+        
+        /**
+        * Check if dtmf test query or dtmf dialog is visible.
+        */        
+        TBool IsDTMFQueryVisible();
+        
+        /**
+        * Sets member variable NoConnectedCalls value.
+        */ 
+        void SetNoConnectedCalls( TPhoneCommandParam* aCommandParam );
+
+    protected: // from CActive
+
+        /**
+        * See CActive documentation.
+        */  
+        void RunL();
+    
+        /**
+        * See CActive documentation.
+        */
+        TInt RunError( TInt aError );
+
+        /**
+        * See CActive documentation.
+        */    
+        void DoCancel();
+        
+        /**
+        * @see CPhoneTimer, handles timeout.
+        */
+        virtual void HandleTimeOutL();        
+ 
+        /**
+        * @see MEikCommandObserver
+        */
+        void ProcessCommandL( TInt aCommandId );
+    private:  // Constructors
+        
+        /**
+        * C++ default constructor.
+        */
+        CPhoneQueryController( CEikonEnv& aEikEnv );
+
+        /**
+        * Creates query dialog
+        * @param aParams a TPhoneCmdParamQuery holding the parameters for the query
+        */
+        void CreateQueryDialogL( 
+            const TPhoneCmdParamQuery& aParams );
+        
+        /**
+        * Creates text query dialog
+        * @param aParams a TPhoneCmdParamQuery holding the parameters for the query
+        */            
+        void CreateTextQueryDialogL( 
+            const TPhoneCmdParamQuery& aParams,
+            TInt aOkButtonCmd = EEikBidOk );              
+        
+        /*
+        * Generates DTMF list query.
+		* @param aDialogResourceId -Id of the list query to be loaded
+        */
+        void CreateDtmfListQueryL( TInt aDialogResourceId );
+        
+        /*
+        * Generates list query.
+		* @param aDialogResourceId -Id of the list query to be loaded
+        */
+        void CreateListQueryL( TInt aDialogResourceId, const RArray<TInt>& aCommands );
+
+        /*
+        * Generates custom list query.
+        * @param aDialogResourceId -Id of the list query to be loaded
+        * @param aItemTextArray Text array for list items.
+        * @param aTone Query tone.
+        */
+        void CreateCustomListQueryL( const TPhoneCmdParamQuery& aParams );
+        
+        /**
+        * Creates the default query.
+        * @param aParams ommand parameter holding data for
+        * populating the needed query dialog.
+        */    
+        void CreateDefaultQueryL( const TPhoneCmdParamQuery& aParams );
+        
+        /**
+        * Creates the reconnect query.
+        * @param aParams ommand parameter holding data for
+        * populating the needed query dialog.
+        */
+        void CreateReconnectQueryL( TPhoneCommandParam* aCommandParam );
+                
+        /**
+        * Creates the global query.
+        * @param aParams a TPhoneCmdParamQuery holding the parameters for the query
+        */        
+        void CreateGlobalQueryDialogL( const TPhoneCmdParamQuery& aParams ); 
+
+        /**
+        * Callback function that CIdle calls when we are using Text Query Dialog.
+        * This method displayes the actual query.
+        * @param aCPhoneQueryController - pointer to itself
+        * @return KErrNone
+        */
+        static TInt DisplayTextQueryCallBack( TAny* aCPhoneQueryController );
+        
+        /**
+        * Clear timer used in global query
+        */
+        void ClearTimer();
+ 
+        /**
+         * Creates global message query dialog.
+         * @param aParams a TPhoneCmdParamQuery holding the parameters for the query
+         */    
+        void CreateGlobalMsgQueryL( const TPhoneCmdParamQuery& aParams );
+        
+        /**
+         * Destroys global message query.
+         */
+        void DestroyGlobalMsgQuery();
+
+        /**
+         * Creates global wait note.
+         * @param aParams a TPhoneCmdParamQuery holding the parameters for the query
+         */     
+        void CreateGlobalWaitNoteL( const TPhoneCmdParamQuery& aParams );
+       
+        /**
+        * Callback function that CIdle calls when we are handling process command.
+        * This method forwards the actual command
+        * @param aCPhoneQueryController - pointer to itself
+        * @return KErrNone
+        */
+        static TInt ProcessCommandCallBack( TAny* aCPhoneQueryController );
+        
+    private:  // Data
+
+        /**
+        * Query dialog
+        */
+        CPhoneQueryDialog* iQuery;
+        
+        /**
+        * Text query dialog
+        */
+        CPhoneTextQuery* iTextQuery;
+        
+        /**
+        * DTMF number list query
+        */
+        CPhoneDtmfNumberListQuery* iDtmfNumberListQuery;
+        
+        CPhoneListQueryDialog* iListQuery;        
+
+        /**
+        * ETrue when the query is asynchronously deleted
+        */
+        TBool iQueryDeleted;
+        
+        /**
+        * Call UI reconnect query.
+        */
+        CCaUiReconnectQuery* iCallUiReconnectQuery;
+        
+        // Eikon environment delivered from CPhoneViewController
+        CEikonEnv& iEikEnv;
+        
+        // Query dialog's text. Stored here for async operations.
+        RBuf iQueryNoteText;
+        // Prompt for queries. Stored here for async operations.
+        RBuf iQueryPrompt;
+        
+        // Query dialog's text. Stored here for async operations.
+        // Needed if query has been deleted before content get 
+        RBuf iQueryPreviousText;
+        
+        // Command for queries. Stored here for async operations.
+        TInt iCommandId;
+        
+        // Waitnote text
+        RBuf iWaitNoteText;
+            
+        // Global confirmation query.
+        CAknGlobalConfirmationQuery* iGlobalConfirmationQuery;
+ 
+ 		// Currently active avkon query type
+ 		TInt iActiveAvkonQuery;
+ 	    
+ 	    /**
+        * Status of VideoCallSetupFailedQuery
+        */
+        TBool iVideoCallSetupFailedQuery;
+        
+        /**
+        * Status of transfer acceptance query.
+        */
+        TBool iTransferAcceptanceQuery;
+        
+        // Displaying a Text Query is a blocking synchronous call and we want to give
+        // run time for other Phone stuff so CIdle object is used to let us do that.
+        // Owned.
+        CIdle *iTextQueryDisplayer;
+                
+        // Asynchronous call for process command
+        CIdle *iCommandAsync;
+        
+        // Contains selected DTMF string from dtmf listquery dialog.
+        HBufC* iResultBuffer;   
+        
+        // Timer.
+        CPhoneTimer* iTimer;
+        
+        /**
+         * Global message query.
+         * Own.
+         */
+        CAknGlobalMsgQuery* iGlobalMsgQuery;
+        
+        /**
+         * Parameter query command object.
+         */
+        TPhoneCmdParamQuery iQueryParam;
+        
+        /**
+        * Global wait note.
+        * Own.
+        */
+        CAknGlobalNote* iGlobalWaitNote;
+
+        /**
+         * Flag for check is command already handled.
+         */
+        TBool iCommandHandled;
+        
+		/**
+         * Flag indicating connected calls.
+         */
+        TBool iNoConnectedCalls;
+        
+     };
+
+#endif      // CPHONEQUERYCONTROLLER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonequerydialog.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,56 @@
+/*
+* 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 Query Dialog
+*
+*/
+
+/*
+*/
+
+#ifndef CPHONEQUERYDIALOG_H
+#define CPHONEQUERYDIALOG_H
+
+
+//  INCLUDES
+#include <AknQueryDialog.h>
+
+// FORWARD DECLARATIONS
+
+class CPhoneQueryDialog : public CAknQueryDialog
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Constructor.
+        */
+        CPhoneQueryDialog( const TTone& aTone );
+        
+        static CPhoneQueryDialog* NewL( const TTone& aTone = ENoTone );  
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneQueryDialog();  
+
+        
+    protected:
+
+        TKeyResponse OfferKeyEventL( 
+            const TKeyEvent& aKeyEvent,
+            TEventCode aType );
+    };
+
+#endif // CPHONEQUERYDIALOG_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphoneringingtone.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,151 @@
+/*
+* 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:  Class representing ringing tone
+*
+*/
+
+
+
+#ifndef CPHONERINGINGTONE_H
+#define CPHONERINGINGTONE_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// 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;
+        
+    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;
+    };
+
+#endif      // CPHONERINGINGTONE_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphoneringingtoneplayerao.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,615 @@
+/*
+* 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:  Active object which implements ringing tone functionality
+*
+*/
+
+
+#ifndef CPHONERINGINGTONEPLAYERAO_H
+#define CPHONERINGINGTONEPLAYERAO_H
+
+// INCLUDES
+#include <e32base.h>
+#include <Profile.hrh>
+#include "mphoneaudioplayerobserver.h"
+#include "mphonevideoplayerobserver.h"
+#include "mphonecenrepobserver.h"
+#include "cphoneaudioplayer.h"
+#include "mphonetimer.h"
+#include "mphonevideoplayer.h"
+
+// FORWARD DECLARATIONS
+//class MPhoneRingingToneObserver;
+class CPhoneAudioPlayer;
+class CPhoneTimer;
+class CMdaServer;
+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
+*/
+class CPhoneRingingTonePlayerAO :
+    public CActive,
+    public MPhoneCenRepObserver,
+    private MPhoneAudioPlayerObserver,
+    private MPhoneTimer,
+    private MPhoneVideoPlayerObserver
+    {
+    public:
+        // States for this active object
+        enum TState
+            {
+            EIdleState,  
+            EDeletingAudioPlayer,
+            EDeletingVideoPlayer,
+            EPlayingDefaultVideo
+            };
+
+    public:
+        
+        /**
+        * Two-phased constructor.
+        * @return new instance.
+        */
+        static CPhoneRingingTonePlayerAO* NewL();
+        
+        /**
+        * Destructor.
+        */
+        ~CPhoneRingingTonePlayerAO();
+
+        /**
+        * Play ring tone
+        * @param aCommandParam a command param
+        */
+        void PlayRingToneL( TPhoneCommandParam *aCommandParam );
+
+        /**
+        * Play audio ring tone 
+        */
+        void PlayAudioRingTone( 
+            TInt aVolume, 
+            TProfileRingingType aRingingType );
+
+        /**
+        * Playing the Beep once.
+        * @param aVolume volume used to play the ringing tone.
+        */
+        void BeepOnce( TInt aVolume );
+
+        /**
+        * Play silent tone. No_sound.wav will be played. If vibration alert
+        * is ON, it will vibrate.
+        */
+        void PlaySilentTone();
+
+        /**
+        * Play unsecure VoIP tone.
+        * Play tone if secure call fails and call is changed to unsecure call
+        * @since    S60 5.0
+        */
+        void PlayUnsecureVoIPTone();
+        
+        /**
+        * Stops playing the ringing tone.
+        * Method does not do anything if ringing tone is not playing.
+        */
+        void StopPlaying();
+
+        /**
+        * Continues video playback ( and ringing tone ) with volume 0
+        * Stream not closed ( If music player was ongoing ) 
+        */
+        void MuteRingingToneOnAnswer();
+          
+        /**
+        * Continues video playback with muted audio.
+        * Ringing tone is stopped.
+        */
+        void MuteRingingTone();
+          
+        /**
+        * Sets video player.
+        * @since Series 60 v3.2
+        * @param aVideoPlayer Video player reference.
+        */
+        void SetVideoPlayer( MPhoneVideoPlayer* aVideoPlayer );
+
+
+        /**
+        * 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
+        * @param aVolume Volume for the TTS-tone, Does not effect the volume 
+        * of the normal tone, that will be played simulteneously with the TTS
+        * @param aRingingType ringing type.
+        */
+        void PlayTtsTone(
+            const TDesC& aTextToSay,
+            TInt aVolume,
+            TProfileRingingType aRingingType );
+
+        /**
+        * 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;
+   
+        /**
+        * 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 );
+		
+    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:
+
+        /**
+        * 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 );
+
+        /**
+        * @see MPhoneTimer
+        */
+        virtual void HandleTimeOutL();
+
+        /**
+        * HandleVideoPlayerError
+        */
+        virtual void HandleVideoPlayerError( 
+            TPhoneVideoPlayerErrorEvent aEvent,
+            TInt aError );
+
+        /**
+        * HandleVideoPlayerInitComplete
+        */
+        virtual void HandleVideoPlayerInitComplete();
+
+        /**
+        * HandleVideoPlayerPlayingComplete
+        */
+        virtual void HandleVideoPlayerPlayingComplete();
+
+        /** 
+        * 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,
+            EPlayerUnsecureVoIP,
+            EPlayerDefault,
+            EPlayerBackup,
+            EPlayerTts, 
+            EPlayerLast = EPlayerTts,
+            EPlayerCount
+            };
+            
+        /**
+        * Enumerates how many times TTs is played
+        * ESaidOnce -once
+        * ESaidTwice twice 
+        */    
+        enum TTtsStatus
+            {
+            ESaidOnce,
+            ESaidTwice
+            };
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneRingingTonePlayerAO();
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * 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 );
+
+        /**
+        * 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 );
+
+        /**
+        * 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 );
+
+        /**
+        * 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 );
+
+        /**
+        * Construct media server and backup tone player.
+        */
+        TInt ConstructPlayers();
+
+        /**
+        * Construct media server and backup tone player.
+        */
+        void ConstructPlayersL();
+
+        /**
+        * 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 );
+
+        /**
+        * Cleanup players.
+        */
+        void CleanupPlayers();
+
+        /**
+        * Deletes player asynchronoysly.
+        * @param aPlayer player to be deleted.
+        */
+        void DeletePlayerAsync(
+            TPlayerId aPlayer );
+       /**
+        * 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();
+
+        /**
+        * @see CActive::RunL.
+        */
+        void RunL();
+
+        /**
+        * @see CActive::DoCancel.
+        */
+        void DoCancel();
+        
+        /**
+        * 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();
+        
+        /**
+        * 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( TProfileRingingType aRingingType );
+             
+        /**
+        * Returns currently active player which is used wit 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();
+        
+         /**
+         * 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( CPhoneRingingTone* aRingingTone );
+
+         /**
+         * 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
+         * @param aSizeLimitKB  the size limit in kB is read to this variable.
+         * @return leaves on error.
+         */
+        void GetMaxToneFileSizeL( TInt& aSizeLimitKB ) const;
+        
+        /**
+        * Returns currently active audio player.
+        * @return Currently active audio player or NULL if none active.
+        */
+        CPhoneAudioPlayer* ActiveAudioPlayer();
+        
+        /**
+        * Mutes the ringing tone.
+        */
+        void DoMuteRingingTone();
+        
+
+    private:    // Data
+        
+        // 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;
+        
+        // Audio player for unsecure VoIP tone.
+        CPhoneAudioPlayer* iUnsecureVoIPTonePlayer;
+        
+        // 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;
+
+        // Indicate which tone is playing or need to be played:
+        // EIdle - idle,
+        // EAudioTonePlaying - audio playing,
+        // EBeepOnce - beep once playing,
+        // ESilentTonePlaying - silent tone playing,
+        // EUnsecureVoIPTonePlaying - unsecure tone playing (VoIP),
+        // 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,
+            EUnsecureVoIPTonePlaying,
+            EDefaultTonePlaying,
+            EBackupTonePlaying,
+            EVideoTonePlaying,
+            ESilentVideoTonePlaying,
+            EPersonalVideoTonePlaying
+            };
+
+        // Current playing status.
+        TTonePlayingStatus iTonePlayingStatus;
+        
+        // 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;
+
+        // Audio/Video tone, not owned
+        CPhoneRingingTone* iAudioVideoRingingTone;
+
+        // Volume for backup tone playing.
+        TInt iVolume;
+        
+        // Volume of the text pronounced by the TTS engine
+        TInt iTtsVolume;
+
+        // Ringing type for backup tone playing.
+        TProfileRingingType iRingingType;
+
+        // Timer.
+        CPhoneTimer* iTimer;
+
+        // 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;
+
+        // Player to be deleted asynchronously.
+        RPointerArray<CPhoneAudioPlayer> iAsyncDeletePlayers;
+
+        // DRM extend security
+        TBool iExtSecNeeded;
+ 
+        // Video ringing tone player
+        MPhoneVideoPlayer* iVideoPlayer;
+    
+        // State of this active object
+        TState iState;
+              
+        // RingingType for TtsPlayer only.
+        TProfileRingingType iTtsRingingType;
+        
+        // Counter for TTs timeouts
+        TInt iTTsTimeOutCounter;
+        
+        // Voice call ringing tone file size max value.
+        TInt iToneFileSizeLimitKB;             
+
+        // Flag. Indicates video scaling capability of the device.
+        TBool iArbitraryVideoScaling;
+
+    };
+
+#endif      // CPHONERINGINGTONEPLAYERAO_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonesingleitemfetch.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,147 @@
+/*
+* 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:  Fetch items from Contact
+*
+*/
+
+
+#ifndef C_CPHONESINGLEITEMFETCH_H
+#define C_CPHONESINGLEITEMFETCH_H
+
+#include <e32base.h>
+#include "mphoneviewobserver.h"
+
+class CPhoneViewController;
+class CPhoneContactController;
+class CPhCntSingleItemFetch;
+class CPhoneStatusPane;
+
+/**
+ *  Items Fetch from Contact
+ *
+ *
+ *  @lib PhoneUIView
+ *  @since S60 5.0
+ */
+class CPhoneSingleItemFetch : public CActive, public MPhoneViewObserver
+    {
+
+public:
+
+   /**
+    * Two-phased constructor.
+    */
+    IMPORT_C static CPhoneSingleItemFetch* NewL( 
+        CEikonEnv& aEikEnv,
+        CPhoneViewController& aViewController,
+        CPhoneContactController& aContactController,
+        CPhoneStatusPane& aStatusPane );
+
+   /**
+    * Destructor.
+    */
+     virtual ~CPhoneSingleItemFetch();
+
+    /**
+     * Open single item fetch dialog
+     * @param aCommandParam command parameter holding data for
+     * populating the needed query dialog.
+     */
+     void OpenSingleItemFetchDialogL( TPhoneCommandParam* aCommandParam ); 
+    
+    /**
+     * Delete SingleItemFetch
+     */
+     void Delete();
+     
+    /**
+     * See MPhoneViewObserver.h
+     */
+     void PhoneViewActivatedL();
+     
+
+protected: // from CActive
+
+    /**
+     * See CActive documentation.
+     */  
+     void RunL();
+
+    /**
+     * See CActive documentation.
+     * @param aError symbian error code
+     */
+     TInt RunError( TInt aError );
+
+    /**
+     * See CActive documentation.
+     */    
+     void DoCancel();
+     
+private:
+
+    /**
+     * C++ default constructor.
+     */
+     CPhoneSingleItemFetch( 
+        CEikonEnv& aEikEnv,
+        CPhoneViewController& aViewController,
+        CPhoneContactController& aContactController,
+        CPhoneStatusPane& aStatusPane );
+
+private: // data
+
+    
+    /**
+    * Eikon environment delivered from CPhoneViewController
+    */
+    CEikonEnv& iEikEnv;
+    
+    /**
+    * Reference to owner
+    */
+    CPhoneViewController& iViewController;
+    
+    /**
+    * Pointer to CPhoneContactController
+    */
+    CPhoneContactController& iContactController;
+    
+    /**
+    * Pointer to CPhoneStatusPane
+    */
+    CPhoneStatusPane& iStatusPane;
+    
+    /**
+    * Single Item Fetch
+    */
+    CPhCntSingleItemFetch* iSingleItemFetch;
+    
+    /**
+    * ResourceId
+    */
+    TInt iResourceId;
+    
+    /**
+    * ButtonId
+    */
+    TInt iButtonId;
+    
+    /**
+     * True when singleitem fetch have been completed.
+     */
+    TBool iFetchPerformed;
+    };
+
+#endif // C_CPHONESINGLEITEMFETCH_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonestatuspane.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,330 @@
+/*
+* 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 for the statuspane, include navi pane and title pane
+*
+*/
+
+
+#ifndef CPHONESTATUSPANE_H
+#define CPHONESTATUSPANE_H
+
+// INCLUDES
+#include <e32base.h>
+#include <coemain.h>
+#include <aknnavi.h>    // for CAknNavigationControlContainer & 
+                        // CAknNavigationDecorator
+
+#include "mphonestatuspane.h"
+#include "phoneconstants.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CAknTitlePane;
+class CEikStatusPane;
+class TPhoneCommandParam;
+class CAknIndicatorContainer;
+
+// CLASS DECLARATION
+
+class THandlerTag
+    {
+    public:
+   		MPhoneStatusPaneObserver* iObserver;
+    	TInt iLayer;
+    };
+/**
+*  Manager for the statuspane, include navi pane and title pane
+*  Usage:
+*  Every client in phone application that will change the title pane should
+*  use status pane manager, to avoid confliction. 
+*  - Always use iStatusPaneManager.TitlePane() to get the reference of status 
+*    pane.
+*  - in ConstructL() insert a new handler to status pane manager by 
+*    AddTitlePaneHandlerL( *this )
+*  - Reserve the title pane before you change the title pane by 
+*    ReserveTitlePane( *this )
+*  - Before changing the status pane, always check if I'm the topmost handler
+*    of the manager, by iStatusPaneManager->IsTitlePaneVisible()
+*  - release the title pane after the change
+*  
+*/
+class CPhoneStatusPane : 
+    public CCoeStatic, 
+    public MPhoneStatusPane
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * First call initializes the singleton object. Subsequent calls return
+        * instance.
+        * @return the created instance.
+        */
+        static CPhoneStatusPane* Instance();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneStatusPane();
+
+    public: // from MPAStatusPane
+
+        /**
+        * Returns ETrue if status pane is visible.
+        */
+        TBool IsVisible() const;
+
+        /**
+        * Get the reference of the title pane
+        * @return the reference of the title pane
+        */
+        CAknTitlePane& TitlePane() const;
+
+        /**
+        * Get the reference of the title pane
+        * @return the reference of the title pane
+        */
+        CEikStatusPane& StatusPane() const;
+
+        /**
+        * Get the reference of the navi pane
+        * @return the reference of the navi pane
+        */
+        CAknNavigationControlContainer& NaviPane() const;
+
+        /**
+        * Get the reference of the navi decorator
+        * @return the reference of the navi decorator
+        */
+        CAknNavigationDecorator& NaviDecorator() const;
+
+        /**
+        * Add title pane handler, returns reserve id
+        * @return reservatoin id
+        */
+        void AddTitlePaneHandlerL( MPhoneStatusPaneObserver& aObserver );
+
+        /**
+        * Reserve the title pane
+        * @param the reserve id for release and get the visibility status
+        */
+        void ReserveTitlePane( MPhoneStatusPaneObserver& aObserver  );
+
+        /**
+        * Release title pane that has been reserved
+        * @param aReserveId the reserve id
+        */
+        void ReleaseTitlePane( MPhoneStatusPaneObserver& aObserver  );
+
+        /**
+        * Remove the handler
+        */
+        void RemoveTitlePaneHandler( MPhoneStatusPaneObserver& aObserver  );
+
+        /**
+        * Check if the title pane is visible
+        * @param aReserveId the reservation id
+        * @return ETrue if the title pane is visible
+        */
+        TBool IsTitlePaneVisible( 
+            MPhoneStatusPaneObserver& aObserver  ) const;
+
+        /**
+        * Gets status pane shape.
+        * @param aRegion shape of the status pane.
+        */
+        void GetShape( TRegion& aRegion );
+
+    public:
+
+        /**
+        * Update the title pane.
+        */
+        void UpdateTitlePane();
+
+
+        void SetTitlePaneContentL( const TDesC& aMessage );
+
+        void SetTitlePanePictureL( TPhoneCommandParam* aCommandParam );
+        
+        /**
+        * Handle update of volume leven in naviPane
+        */    
+        void SetVolumeLevel( 
+            TPhoneCommandParam* aCommandParam );
+            
+        void ActivateVoiceVolumeControl(
+            TPhoneCommandParam* aCommandParam);
+        
+        void DeactivateVoiceVolumeControl();
+        
+        TInt DoSwitchVolumeControlL( 
+            TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Creates title pane containing text.
+        *
+        * When instance is deleted, then text is removed from title pane.
+        *
+        * @param aTextResourceId text resorce.
+        * @return instance, also put to cleanup stack.
+        */
+        CBase* CreateTextTitlePaneLC( TInt aTextResourceId );
+        
+        /**
+        * Creates empty indicator pane.
+        * @return  the pointer of empty indicator pane.
+        */        
+        CAknIndicatorContainer* CreateEmptyIndicatorContainerL();
+
+    private:
+    
+        /**
+        * Update the title pane within recovery system
+        */
+        void DoUpdateTitlePaneL();
+        /**
+        * Callback funciton for recovery system to update title pane.
+        */
+        static TInt UpdateTitlePaneCallBackL( TAny* aAny );
+
+        /**
+        * Pushes new decorator to navi pane replacing the
+        * previous one.
+        * @param aNew new to replace the old one.
+        */
+        void PushL( CAknNavigationDecorator& aNew );
+
+    private:
+
+        /**
+        * Two-phased constructor.
+        * @return new instance.
+        */
+        static CPhoneStatusPane* NewL();
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneStatusPane();
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+    private:
+
+        /**
+        * Get the largest layer in the title pane list
+        */
+        TInt LargestLayerInTitlePaneList() const;
+
+        /**
+        * Get the pointer to the title pane hander by reserve id
+        */
+        THandlerTag* FindTitlePaneHandler( 
+            MPhoneStatusPaneObserver& aObserver ) const;
+
+        /**
+        * Get the current active title pane user
+        */
+        THandlerTag* FindTopmostTitlePaneHandler() const;
+
+        /**
+        * Notify handler on activation event
+        */
+        void NotifyHandlerOnActivation( 
+            THandlerTag& aHandlerTag,
+            TBool aActive );
+
+        /**
+        * Call back function for recovery system to switch the layout to idle
+        */
+        static TInt RecoverySwitchLayoutToIdleL( TAny* aAny );
+
+        // By default, prohibit copy constructor
+        CPhoneStatusPane( const CPhoneStatusPane& );
+
+        // Prohibit assigment operator
+        CPhoneStatusPane& operator= ( const CPhoneStatusPane& );
+        
+        /** 
+         * Function for statuspane if there is a operatorpicture 
+         */ 
+        void RenderBitmapOnTitlePaneL(); 
+      
+    private:    // Data  
+
+        //Recovery id for switch layout to idle state
+        TInt iSwitchLayoutIdleRecoveryId;
+
+        // Recovery id for update title pane
+        TInt iUpdateTitlePaneRecoveryId;
+
+        /**
+         * Array of PhoneStatusPane observers 
+         * Own.
+         */
+        CArrayFixFlat< THandlerTag > *iTitlePaneList;
+
+        /**
+        * Pointer to Eikon status pane.
+        * Not own.
+        */
+        CEikStatusPane* iStatusPane;
+        
+        /**
+         * Pointer the Avkon title pane.
+         * Not own.
+         */
+        CAknTitlePane* iTitlePane;
+        
+        /**
+        * Title pane bitmap.
+        * Own.
+        */
+        CFbsBitmap* iTitlePanePicture;
+        
+        /**
+         *  Title pane bitmap mask
+         *  Own.
+         */
+        CFbsBitmap* iTitlePanePictureMask;
+        
+        /**
+         * ETrue if title pane text is displayed; otherwise, display the bitmap
+         */ 
+        TBool iTitlePaneTextIsDisplayed;
+
+        /* 
+         * The pointer to the navi pane.
+         * Not own.
+         */
+        CAknNavigationControlContainer* iNaviPane;    
+        
+        /**
+         * The pointer to the navi decorator
+         * Own.
+         */
+        CAknNavigationDecorator* iNaviDecorator;
+        
+        // Title Pane Text
+        TBuf< KPhoneTitlePaneTextSize > iTitleText; 
+    };
+
+#endif      // CPhoneStatusPane_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonetextquery.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  PhoneUI Text Query.
+*
+*/
+
+
+#ifndef CPHONETEXTQUERY_H
+#define CPHONETEXTQUERY_H
+
+//  INCLUDES
+#include <AknQueryDialog.h>
+
+// CLASS DECLARATION
+
+class CPhoneTextQuery : public CAknTextQueryDialog
+    {
+    public:
+
+        /**
+        * Constructor.
+        */
+        CPhoneTextQuery( 
+            MEikCommandObserver& aCommandObserver, 
+            TDes& aDataText,
+            TInt aDefaultCbaResourceId,
+            TInt aContentCbaResourceId,
+            TBool aSendKeyEnabled,
+            TInt aEikBidOkCmd = EEikBidOk );  
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneTextQuery();   
+
+        /**
+        * From CAknTextQueryDialog, handles keyevents.
+        */
+        TKeyResponse OfferKeyEventL(
+            const TKeyEvent& aKeyEvent,
+            TEventCode aType );
+
+        /**
+        * From CAknTextQueryDialog, dynamic initialization 
+        * after layout.
+        */
+        void PostLayoutDynInitL();   
+    
+        void GetContent( TDes& aText );
+        
+      
+    private:
+      
+        /**
+        * From CEikdialog   This function is called by the EIKON framework 
+        *                   if the user activates a button in the button panel. 
+        *                   It is not called if the Cancel button is activated, 
+        *                   unless the EEikDialogFlagNotifyEsc flag is set.
+        * @param aButtonId  The ID of the button that was activated
+        * @return           Should return ETrue if the dialog should exit, and EFalse if it should not.
+        */
+        TBool OkToExitL( TInt aButtonId );
+
+        /**
+        * Updates softkeys.
+        */
+        void UpdateSoftkeysL();
+ 
+        /**
+         * Asks the command id from the softkey (CBA)
+         * @return the command id or 0 in case of problems
+         */
+        TInt FetchCommandFromCba();
+     
+    private: // Data
+        
+        MEikCommandObserver& iCommandObserver;
+                
+        TInt iDefaultCbaResourceId;
+        
+        TInt iContentCbaResourceId;
+
+        TBool iSendKeyHandlingEnabled;
+        
+        TInt iEikBidOkCmd;
+    };
+
+#endif      // CPHONETEXTQUERY_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonetoolbarcontroller.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,175 @@
+/*
+* 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:  Handles the updating dialer, toolbar buttons.
+*
+*/
+
+
+#ifndef CPHONETOOLBARCONTROLLER_H
+#define CPHONETOOLBARCONTROLLER_H
+
+#include <e32base.h>
+#include <akntoolbarobserver.h>
+
+class CAknToolbar;
+class CCoeEnv;
+class TPhoneCommandParam;
+class CAknButton;
+class TAknsItemID;
+class TPhoneCommandParam;
+
+
+/**
+ *  Toolbar controller, updates toolbar buttons
+ *
+ *  @lib PhoneUIView.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CPhoneToolbarController ): 
+    public CBase, public MAknToolbarObserver 
+    {
+public:
+    /**
+     * Two-phased constructor.
+     * @param aCoeEnv 
+     * @param aMenuController 
+     */
+    static CPhoneToolbarController* NewL( CCoeEnv& aCoeEnv);
+    /**
+     * Destructor.
+     */
+    virtual ~CPhoneToolbarController();
+    
+     /**
+     * Updates toolbar buttons.
+     */
+    void UpdateToolbar();
+  
+
+    
+	/**
+    * Enables toolbar
+    */ 
+	void ShowToolbar();
+
+    /**
+    * Disables toolbar
+    */ 
+    void HideToolbar();	
+    
+    void SetMuteFlag( TPhoneCommandParam* aCommandParam );
+
+    void SetIhfFlag( TPhoneCommandParam* aCommandParam );
+    
+    /**
+     * Dims (greys out) or undims all toolbar items.
+     *
+     * @param aDimmed Use ETrue to dim this toolbar item or EFalse to
+     *      un-dim this toolbar item.
+     */
+    void DimToolbar( const TBool aDimmed );
+    
+    /**
+     * Dims (greys out) or undims a toolbar item.
+     *
+     * @param aCommandId The command (as defined in an .hrh file)
+     *      associated with this toolbar item. This identifies the toolbar
+     *      item, whose text is to be dimmed or un-dimmed.
+     * @param aDimmed Use ETrue to dim this toolbar item or EFalse to
+     *      un-dim this toolbar item.
+     */
+    void SetToolbarButtonDimmed( const TInt aCommandId,
+                                 const TBool aDimmed );
+
+public:     // from MAknToolbarObserver
+    /**
+     * From base class MAknToolbarObserver
+     * Handles toolbar events for a certain toolbar item.
+     *
+     * @param aCommand The command ID of some toolbar item.
+     */ 
+    void OfferToolbarEventL( TInt aCommand );
+    
+    /**
+     * From base class MAknToolbarObserver
+     * Should be used to set the properties of some toolbar components 
+     * before it is drawn.
+     *   
+     * @param aResourceId The resource ID for particular toolbar
+     * @param aToolbar The toolbar object pointer
+     */
+    void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar );
+      
+private:
+
+    /**
+     * Creates CAknButton with given parameters and leaves it to 
+     * CleanupStack.
+     * 
+     * @param aNormalIconId
+     * @param aNormalMaskId
+     * @param aTooltipText
+     * @param aSkinIconId
+     * @param aCommand 
+     */  
+    CAknButton* CreateButtonLC( TInt aNormalIconId,
+                                TInt aNormalMaskId,
+                                const TDesC& aTooltipText, 
+                                const TAknsItemID& aSkinIconId,
+                                TInt aCommand );
+    
+    
+    /**
+     * Constructor.
+     * 
+     * @param aCoeEnv 
+     */
+    CPhoneToolbarController( CCoeEnv& aCoeEnv );    
+    /**
+     * Symbian 2nd phase constructor.
+     * 
+     */
+    void ConstructL();
+    
+    /**
+     * Searches the tooltip text for the button using the 
+     * the given command id.
+     * 
+     * @param aCommandId the command id
+     * @param aText     the searched tooltip text
+     */
+    void  GetTooltipTextL( TInt aCommandId, HBufC*& aText ); 
+    
+    TAknsItemID GetSkinIdL( TInt aCommandId );
+
+        
+private: // data
+    /**
+     * AknToolbar. 
+     * Not own.  
+     */
+    CAknToolbar* iToolbar;
+
+    /**
+     * CoeEnv 
+     */
+    CCoeEnv& iCoeEnv;    
+        
+    TBool iMuteFlag;
+    
+    TBool iIhfFlag;
+
+    };
+
+#endif // CPHONETOOLBARCONTROLLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphoneuidisablednote.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  PhoneUI Note
+*
+*/
+
+/*
+*/
+
+#ifndef CPHONEUIDISABLEDNOTE_H
+#define CPHONEUIDISABLEDNOTE_H
+
+
+//  INCLUDES
+#include "tphonecmdparamnote.h"
+#include "cphonenote.h"
+
+// FORWARD DECLARATIONS
+class CAknNoteDialog;
+
+class CPhoneUIDisabledNote : public CPhoneNote
+    {
+    public:  // Constructors and destructor
+
+        /**
+         * Constructor.
+         * 
+         * @param    aSelfPtr            Pointer to self. 
+         *                               This pointer is set to NULL when the note is destroyed by the framework.
+         * @param    aCommandObserver    Observer to receive command events from the note.
+         */
+        CPhoneUIDisabledNote( CEikDialog** aSelfPtr, MEikCommandObserver& aCommandObserver );  
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneUIDisabledNote();  
+
+        /**
+        * Sets the type of the note.
+        */
+        void SetNoteType( TPhoneNoteType aNoteType );
+
+        /**
+        * Gets the type of the note.
+        */
+        TPhoneNoteType NoteType();
+        
+        /**
+        * Updates softkeys to note
+        * @param    aResourceId     Resource id
+        */
+        void UpdateSoftkeysL( TInt aResourceId );
+        
+    protected:
+
+        TKeyResponse OfferKeyEventL( 
+            const TKeyEvent& aKeyEvent,
+            TEventCode aType );
+
+        TBool OkToExitL( TInt aCommand );
+
+        void HandlePointerEventL( 
+            const TPointerEvent& aPointerEvent );
+
+        void SetSizeAndPosition( const TSize& aSize );
+        
+    protected:  // Data
+        
+        //The type of note. Not necessarily set.
+        //Used in security view
+        TPhoneNoteType iNoteType;
+    };
+
+#endif // CPHONEUIDISABLEDNOTE_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonevideoplayer.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,271 @@
+/*
+* 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:  Video ringing tone player.
+*
+*/
+
+
+#ifndef CPHONEVIDEOPLAYER_H
+#define CPHONEVIDEOPLAYER_H
+
+// INCLUDES
+
+#include <VideoPlayer.h>
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class CFileMan;
+class CVideoPlayerUtility;
+class MPhoneVideoPlayerObserver;
+class CPhoneRingingTone;
+
+// CLASS DECLARATION
+
+/**
+*  Video ringing tone player
+*  Uses CVideoPlayerUtility to play video clips.
+*
+*  @lib PhoneUIView.lib
+*  @since Series 60 3.1
+*/
+class CPhoneVideoPlayer : 
+    public CBase,
+    public MVideoPlayerUtilityObserver
+    {
+    public:
+        enum TVideoPlayerState // from MMF-VideoPlayer IF spec.
+            {
+            EVideoError = -1,
+            EVideoClosed,
+            EVideoOpening,
+            EVideoOpen,
+            EVideoPreparing,
+            EVideoReady, // player's stopped state
+            EVideoPlaying,
+            EVideoPaused
+            };
+
+        enum TRingingType
+            {
+            ETypeRinging,
+            ETypeRingingOnce,
+            ETypeAscending
+            };
+
+        enum TVideoResolution
+            {
+            EVideoQCIF,
+            EVideoSubQCIF
+            };
+
+    public:  // Constructor and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aRingingTone The ringing tone
+        * @param aPriority The priority for the playing
+        * @param aPreference The preference value
+        * @param aObserver Video player observer
+        * @param aVideo Window for video
+        * @return The instance of the video player.
+        */
+        static CPhoneVideoPlayer* NewL( 
+            const CPhoneRingingTone& aRingingTone, 
+            TInt aPriority, 
+            TUint aPreference,
+            MPhoneVideoPlayerObserver& aObserver, 
+            RWindow& aVideoTarget,
+            TBool aExtSecNeeded = EFalse );
+
+        /**
+        * Two-phased constructor (non leaving).
+        * @param aFileName The ringing tone
+        * @param aPriority The priority for the playing
+        * @param aPreference The preference value
+        * @param aObserver Video player observer
+        * @param aVideo Window for video
+        * @return The instance of the video player. NULL is
+        *         returned if creation failed.
+        */
+        static CPhoneVideoPlayer* New( 
+            const CPhoneRingingTone& aRingingTone, 
+            TInt aPriority, 
+            TUint aPreference,
+            MPhoneVideoPlayerObserver& aObserver, 
+            RWindow& aVideoTarget,
+            TBool aExtSecNeeded = EFalse );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneVideoPlayer();
+
+    public:
+        /**
+        * Plays the loaded video.
+        * @since Series 60 3.1
+        * @param aRingingType Ringing type.
+        * @param aVolume take value from 1 to 10
+        */
+        void Play( TRingingType aRingType, TInt aVolume );
+
+        /**
+        * Stops video playback.
+        * @since Series 60 3.1
+        */
+        void StopPlaying();
+
+       /**
+        * Pauses video playback.
+        * @since Series 60 3.1
+        * @return KErrNone is successful.
+        */
+        TInt PausePlaying();
+        
+        /**
+        * Resumes video playback.
+        * @since Series 60 3.1
+        */
+        void ResumePlaying();
+        
+        /**
+        * Make video to play silent.
+        * @since Series 60 3.1
+        */
+        void MuteAudio();
+
+        /**
+        * Get the state of the phone video player.
+        * @since Series 60 3.1
+        * @return The status of video player
+        */
+        TVideoPlayerState State() const;
+
+        /**
+        * Get the resolution of the loaded video.
+        * @since Series 60 3.1
+        * @return The resolution.
+        */
+        TVideoResolution VideoResolution() const;
+
+        /**
+        * Scales and crops video to cover target window.
+        * @since Series 60 3.1
+        * @param aDisplayWindow Window for video.
+        * @param aUncropPane Rectangle for cropping control.
+        */
+        void AdjustToWindow( RWindow& aDisplayWindow,
+        					 const TRect& aUncropPane );
+
+    private: // Functions from MVideoPlayerUtilityObserver
+        /** 
+        * MvpuoOpenComplete
+        */
+        void MvpuoOpenComplete( TInt aError );
+
+        /** 
+        * MvpuoPrepareComplete
+        */
+        void MvpuoPrepareComplete( TInt aError );
+
+        /** 
+        * MvpuoFrameReady
+        */
+        void MvpuoFrameReady( CFbsBitmap& aFrame ,TInt aError );
+
+        /** 
+        * MvpuoPlayComplete
+        */
+        void MvpuoPlayComplete( TInt aError );
+        
+        /** 
+        * MvpuoEvent
+        */
+        void MvpuoEvent( const TMMFEvent& aEvent );
+    
+    private: // Constructors
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneVideoPlayer();
+        
+        /**
+        * C++ constructor.
+        */
+        CPhoneVideoPlayer( MPhoneVideoPlayerObserver& aObserver );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL( 
+            const TDesC& aFileName, 
+            TInt aPriority, 
+            TUint aPreference,
+            RWindow& aVideoTarget );
+
+    private:
+        /**
+        * SetRingingType
+        */
+        void SetRingingType( TRingingType aRingingType );
+
+        /**
+        * SetVolume
+        */
+        void SetVolume( TInt aVolume );
+
+        /**
+        * VolumeRampTimerCallback
+        */
+        static TInt VolumeRampTimerCallback( TAny* aObj );
+
+        /**
+        * DoVolumeRamp
+        */
+        TInt DoVolumeRamp();
+        
+        /**
+        * Frame size
+        */
+        TSize VideoFrameSize() const;
+
+    private: //Data
+
+        MPhoneVideoPlayerObserver&  iObserver;
+        CVideoPlayerUtility*        iVideoPlayer;
+        TVideoPlayerState           iPlayerState;
+        TBool                       iToBePlayed;
+
+        // Ringing properties
+        TInt                        iVolume;
+        TRingingType                iRingingType;
+
+        // Ascending volume
+        TInt                        iRampedVolume;
+        CPeriodic*                  iVolumeRampTimer;
+        
+        // Ringing tone
+        RFile                       iFileHandle;
+        
+    };
+
+#endif // CPHONEVIDEOPLAYER
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphoneview.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,269 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 View
+*
+*/
+
+#ifndef __CPHONEVIEW_H
+#define __CPHONEVIEW_H
+
+//  INCLUDES
+
+#include <coecntrl.h>
+#include <coeview.h>
+
+// FORWARD DECLARATIONS
+class CAknsLayeredBackgroundControlContext;
+class TPhoneCommandParam;
+class CEikButtonGroupContainer;
+class MPhoneViewObserver;
+
+// CLASS DECLARATION
+
+/**
+*   Base class for protocol spesific call header views.
+*/
+class CPhoneView : public CCoeControl, public MCoeView
+    {
+    public:  // Constructors and destructor        
+
+        static CPhoneView* NewL( TRect aRect, CEikButtonGroupContainer& aCba );
+
+        virtual ~CPhoneView();
+
+    public: // Functions from base classes
+
+        /**
+        * Returns a TVwsViewId uniquely identifying the view.
+        * @return Represents a view in the server
+        */
+        TVwsViewId ViewId() const;
+
+        void ActivateL();
+
+        /**
+        * From CCoeControl; notifier for resource changes
+        * @param aType : Type of resource change
+        */
+        void HandleResourceChange( TInt aType );
+
+    public: // New functions
+
+        /**
+        * Sets the control as component.
+        * @param aControl It is the new component.
+        */
+        void SetControl( CCoeControl* aControl );
+        
+        /**
+        * Returns the control in the view.
+        * @return aControl The control.
+        */
+        CCoeControl* Control() const;
+        
+        /**
+        * Sets the bitmap
+        * @param aCommandParam a command parameter
+        */
+        void SetBitmap( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Gets the bitmap
+        * @param aCommandParam a command parameter
+        */
+        void GetBitmap( TPhoneCommandParam* aCommandParam );
+       
+        /**
+        * Sets the security mode flag ETrue or EFalse
+        * @param aStatus ETrue for the security mode. EFalse for the 
+        * normal mode.
+        */ 
+        void SetSecurityMode ( TBool aStatus );
+        
+        /**
+        * Get state of the security mode flag
+        * @return aStatus ETrue for the security mode. EFalse for the 
+        * normal mode.
+        */         
+        TBool IsSecurityMode();
+        
+        /**
+        * Gets the previous app flag value.
+        */ 
+        TBool GetActivatePreviousApp();
+        
+        /**
+        * Sets the fall back flag ETrue or EFalse
+        * @param aStatus ETrue if back activates previous app.
+        * EFalse if idle is to be opened.
+        */ 
+        void SetActivatePreviousApp( const TBool aStatus );
+        
+        /**
+        * Sets dialer activate flag to ETrue or EFalse
+        * @param aStatus ETrue if next activate view inside 
+        * phoneapp is dialer. EFalse if not dialer. 
+        */ 
+        void SetPhoneAppViewToDialer( const TBool aStatus );
+        
+        /**
+        * Returns dialer activate flag status.
+        */ 
+        TBool PhoneAppViewToDialer();
+        
+        /**
+        * Enables or disables pointer capture for phoneview 
+        * @param aStatus ETrue, pointer capture will be enabled 
+        */         
+        void CapturePointerEvents( const TBool aCapture );      
+        
+        /**
+         * Sets view observer for view events.
+         */
+        void SetPhoneViewObserver( MPhoneViewObserver& aObserver );
+        
+        /**
+         * Sets permission to activate dialer view.
+         */
+        void SetDialerActivation( TBool aActivation );
+        
+	public:  // Functions from base classes
+		
+		/**
+        * From CCoeControl
+        */
+        void SetRect( const TRect &aRect );        
+
+    protected:  // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        void HandlePointerEventL(
+            const TPointerEvent& aPointerEvent );
+
+        /**
+        * From CCoeControl
+        */
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+
+        /**
+        * From CCoeControl
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl
+        */
+        void Draw( const TRect& aRect ) const;
+
+        /**
+        * From CCoeControl, informs that the size is changed to update
+        * the sizes of component controls appropriately.
+        */
+        void SizeChanged();
+
+        /**
+        * From CCoeControl, informs that the position has been changed.
+        */
+        void PositionChanged();
+
+        /**
+        * From CCoeControl, MopSupplyObject
+        */
+        TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
+        
+        /**
+        * From CCoeControl
+        */        
+        void FocusChanged( TDrawNow aDrawNow );
+        
+    private: // Functions from base classes
+
+        /**
+        * Takes any action required on activation of the view. 
+        * Reimplemented versions should read the message text
+        * @param aCustomMessage message for any message type 
+        *                       identified by aCustomMessageId
+        * @param aCustomMessageId message ID that the view understands
+        * @param aPrevViewId The id of the previously active view 
+        *                    so that the view may switch back to its caller
+        *                    at some later stage
+        */
+        void ViewActivatedL( 
+            const TVwsViewId& aPrevViewId, 
+            TUid aCustomMessageId, 
+            const TDesC8& aCustomMessage );
+
+        /**
+        * Takes any action required on deactivation of the view e.g. to 
+        * make the controls owned by the view non-visible
+        * (thereby saving the window server uneccessary work).
+        */
+        void ViewDeactivated();
+
+    private:
+
+        CPhoneView( CEikButtonGroupContainer& aCba );
+
+        void ConstructL( TRect aRect );
+
+    private:
+
+        /**
+        * Updates size of the control.
+        */
+        void UpdateControlRect();
+
+    private:
+
+        // Region type.
+        typedef RRegionBuf< KPhoneRegionAmount > RPhoneRegionBuf;
+
+        // Owned: region
+        RPhoneRegionBuf iRegion;
+
+        // Owned: background context.
+        CAknsLayeredBackgroundControlContext* iBgContext;
+
+        // Pointer to active control.
+        CCoeControl* iControl;
+
+        // Owned: Active Idle main bitmap.
+        CFbsBitmap* iBitmap;
+        
+        //Id of the fullscreen AI plugin
+        TInt iFsAiId;
+        
+        //MainPane
+        TRect iMainPane;
+        
+        //Is security mode or not
+        TBool iSecurityMode;
+        
+        // Previous app flag.
+        TBool iActivatePreviousApp;
+        
+        // Dialer activation flag.
+        TBool iPhoneAppViewToDialer;
+        
+        CEikButtonGroupContainer& iCba;
+        
+        MPhoneViewObserver* iObserver;
+        
+        TBool iDialerActivation;
+        };
+
+#endif // __CPHONEVIEW_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphoneviewcontroller.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,750 @@
+/*
+* 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:  Controller for the PhoneUI View component
+*
+*/
+
+#ifndef CPHONEVIEWCONTROLLER_H
+#define CPHONEVIEWCONTROLLER_H
+
+//  INCLUDES
+#include <apgcli.h>
+#include <eikenv.h>
+#include <e32base.h>
+#include <cntdef.h>
+#include <cphcntspeeddialmonitor.h>
+
+#include "mphoneviewcommandhandle.h"
+#include "cphonerecoverysystem.h"
+#include "mphonestatuspaneobserver.h"
+#include "tphonecmdparamspeeddial.h"
+#include "aknkeylock.h"
+#include "tphonecmdparamtranseffect.h"
+
+#include "mphoneviewblockingdialogobserver.h"
+
+// FORWARD DECLARATIONS
+class CPhoneButtonsController;
+class CLogsClient;
+class CPhoneView;
+class CPhoneDialerView;
+class TPhoneViewId;
+class TPhoneCommandParam;
+class TPhoneCmdParamBoolean;
+class CEikButtonGroupContainer;
+class CPhoneMenuController;
+class CPhoneNoteController;
+class CPhoneQueryController;
+class CPhoneKeyCaptureController;
+class CSpdiaControl;
+class CEikStatusPane;
+class CAknNavigationControlContainer;
+class CPhoneBubbleWrapper;
+class CCoeControl;
+class CPhoneStatusPane;
+class TPhoneNoteType;
+class CPhoneNoteUtilities;
+class CPhoneIncallIndicator;
+class CPhoneTimer;
+class CPhoneContactController;
+class CPhoneCntSaveAddToName;
+class CPhCntSingleItemFetch;
+class CPhoneApplicationExit;
+class CPhoneAudioController;
+class CPhoneRingingTonePlayerAO;
+class RAknUiServer;
+class CPhoneSingleItemFetch;
+class CPhoneDialerController;
+class CAknIndicatorContainer;
+class CPhCntRfsHandler;
+class CPhoneToolbarController;
+
+class CEikonEnv;
+class CPhoneVmbxHandler;
+class CAknAppUi;
+class CDialer;
+class MPhoneNumberEntryChangedHandler;
+class MPhoneViewCustomization;
+
+class CPhoneViewController :
+    public CBase,
+    public MPhoneViewCommandHandle,
+    public MPhoneStatusPaneObserver,
+    public MPhoneViewBlockingDialogObserver
+    {
+    public:  // Constructors and destructor
+
+        IMPORT_C static CPhoneViewController* NewL( TRect aRect );
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneViewController();
+
+        IMPORT_C CPhoneView* PhoneView();
+
+        /**
+        * From MPhoneViewCommandHandle
+        */
+        IMPORT_C virtual void ExecuteCommandL(
+            TPhoneViewCommandId aCmdId );
+
+        /**
+        * From MPhoneViewCommandHandle
+        */
+        IMPORT_C virtual void ExecuteCommandL(
+            TPhoneViewCommandId aCmdId,
+            TInt aCallId );
+
+        /**
+        * From MPhoneViewCommandHandle
+        */
+        IMPORT_C virtual void ExecuteCommandL(
+            TPhoneViewCommandId aCmdId,
+            TPhoneCommandParam* aCommandParam );
+
+        /**
+        * From MPhoneViewCommandHandle
+        */
+        IMPORT_C virtual void ExecuteCommandL(
+            TPhoneViewCommandId aCmdId,
+            TInt aCallId,
+            TPhoneCommandParam* aCommandParam );
+
+        /**
+        * From MPhoneViewCommandHandle
+        */
+        IMPORT_C virtual void ExecuteCommandL(
+            TPhoneViewCommandId aCmdId,
+            TInt aCallId,
+            TDesC& aMessage );
+
+        /**
+        * From MPhoneViewCommandHandle
+        */
+        IMPORT_C virtual void ExecuteCommand(
+            TPhoneViewCommandId aCmdId );
+
+        /**
+        * From MPhoneViewCommandHandle
+        */
+        IMPORT_C virtual void ExecuteCommand(
+            TPhoneViewCommandId aCmdId,
+            TPhoneCommandParam* aCommandParam );
+
+        /**
+        * From MPhoneViewCommandHandle
+        */
+        IMPORT_C virtual TPhoneViewResponseId HandleCommandL(
+            TPhoneViewCommandId aCmdId );
+
+        /**
+        * From MPhoneViewCommandHandle
+        */
+        IMPORT_C virtual TPhoneViewResponseId HandleCommandL(
+            TPhoneViewCommandId aCmdId,
+            TPhoneCommandParam* aCommandParam );
+
+        /**
+        * From MPhoneViewCommandHandle
+        */
+        IMPORT_C virtual const TDesC& FetchContent();
+
+        /**
+        * @see MPhoneStatusPaneObserver.
+        */
+        void HandleTitlePaneActiveL( TBool aActive = ETrue );
+
+        /**
+        * Returns window group id of the phone application.
+        */
+        IMPORT_C TInt ApplicationWindowGroupId();
+
+        /**
+        * Returns window group id of the Idle application.
+        */
+        IMPORT_C TInt IdleWindowGroupId();
+
+        /**
+        * Returns window group id of the application that is currently
+        * in the foreground.
+        */
+        IMPORT_C TInt ForegroundApplicationWindowGroupId();
+
+        /**
+        * Fetches foreground application's window group id.
+        */
+        IMPORT_C static TInt DoFetchForegroundApplicationWindowGroupIdL(
+            CEikonEnv& aEnv );
+
+        /**
+        * Hides / makes visible Phone icon in fast swap menu.
+        * @since 2.8
+        * @param aHidden is application hidden or shown.
+        */
+        IMPORT_C void SetHiddenL( const TBool aHidden );
+
+        /**
+        * Get the help context
+        * @return Saved help context
+        */
+        IMPORT_C const TDesC& HelpContext();
+
+        /**
+        * From CCoeControl; notifier for resource changes
+        * @param aType : Type of resource change
+        */
+        IMPORT_C void HandleResourceChangeL( TInt aType );
+
+        /**
+        * From CCoeControl; notifier for layout changes
+        * @param aRect : screen size
+        */
+        IMPORT_C void HandleLayoutChange( TRect aRect );
+
+        /**
+        * Indicates that a blocking dialog is currently being displayed
+        * This is required by the AppUI to determine if
+        * the End key should be processed in HandleWsEventL()
+        */
+        IMPORT_C TBool BlockingDialogIsDisplayed() const;
+
+        /**
+        * Indicates that a status panel is currently being displayed
+        * This is required by the AppUI
+        */
+        IMPORT_C TBool StatusPaneDisplayed();
+
+        /**
+        * Set single item fetch content
+        */
+        void SetFetchContent( TDesC& aFetchContent );
+
+        /**
+        * Sets single item fetch type
+        * @aType   single item fetch type
+        */
+        void SetSingleItemFetchType( TInt aType );
+
+         /**
+        * From MPhoneViewBlockingDialogObserver
+        * Sets the is blocking dialogs in screen.
+        * @param aBlockingDialog ETrue if blocking dialog is
+        *                        displayed.
+        */
+        IMPORT_C void SetBlockingDialogIsDisplayed( TBool aBlockingDialog );
+
+    private:     // New functions
+
+        /**
+        * read IdleApplicationUid from PubSub
+        */
+        TInt IdleAppUid();
+
+        /**
+        * Indicates whether application needs to return to the
+        * background after being brought to the foreground using
+        * BringToForeground()
+        */
+        TBool NeedToSendToBackground();
+
+        /**
+        * Gets the blocking dialogs status
+        */
+        void GetBlockingDialogIsDisplayed( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Sets the required background status of the application
+        */
+        void SetNeedToSendToBackground( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Sends application to background.
+        */
+        void SendToBackgroundL();
+
+        /**
+        * Brings foreground given application.
+        * @param aCommandParam command parameter.
+        */
+        void BringAppToForeground( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Brings phone application to foreground.
+        * @param aCommandParam command parameter.
+        */
+        void BringPhoneAppToForeground( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Sets the top application
+        * @param aCommandParam command parameter
+        */
+        void SetTopApplicationL( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Gets the foreground application
+        * @param aCommandParam command parameter
+        */
+        void GetForegroundApplication( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Sets phone application windowgroup position.
+        */
+        void SetWindowGroupPosition();
+
+        /**
+        * Activate other application.
+        * @param aCommandParam command parameter
+        */
+        void ActivateAppL( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Activate other application with specific view.
+        * @param aCommandParam command parameter
+        */
+        void ActivateAppViewL( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Activate other application with specific view and custom message.
+        * @param aCommandParam command parameter
+        */
+        void ActivateAppViewWithCustomMessageL(
+            TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Activate other application with specific view with conventional way
+        * @param aCommandParam command parameter
+        */
+        void ActivateAppViewConventionalL( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Launches application.
+        */
+        void LaunchApplicationL();
+
+        /**
+        * Launches help application
+        * @param aHelpCommand help command string
+        */
+        void LaunchHelpApplicationL( const TDesC& aHelpCommand );
+
+        /**
+        * Continues construction of contact manager.
+        */
+        static TInt DoConstructContactControllerL( TAny* aAny );
+
+        void SetCbaL( TPhoneCommandParam* aCommandParam );
+
+        void ShowInfoNote( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Creates connection.
+        */
+        void CreateConnectionL();
+
+        /**
+        * Activate another instance of the application
+        */
+        void ActivateAppInstanceL( TUid aUid );
+
+        /**
+        * Set the global Avkon notifier disabler status
+        * @param aCommandParam a command parameter
+        */
+        void SetGlobalNotifiersDisabledL( TPhoneCommandParam* aCommandParam );
+
+        /* Set the Eikon notifier disable status
+        * @param aCommandParam a command parameter
+        */
+        void SetEikonNotifiersDisabled( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Cancel all notification from screen.
+        */
+        void CancelAllNotications();
+
+        /**
+        * Handles bubble updating
+        */
+        void HandleUpdateBubbleL(
+            TInt aCallId,
+            TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Remove Phone dialogs
+        */
+        void RemovePhoneDialogsL();
+
+        /**
+        * Remove add to contact dialog.
+        */
+        void RemoveAddToContactDialog();
+
+        /**
+        * Update menu and CBAs based on current audio path
+        * @param aCommandParam a command parameter
+        */
+        void UpdateAudioPathOptions( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Update menu and CBAs based on current audio availability
+        * @param aCommandParam a command parameter
+        */
+        void UpdateAudioAvailabilityOptions( TPhoneCommandParam* aCommandParam );
+
+        /**
+        /**
+        * Soft Reject feature enable status
+        */
+        TBool SoftRejectIsEnabled() const;
+
+        /**
+        * Set Speed Dial location
+        */
+        void SetSpeedDialLocation( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Get number from Speed Dial location
+        * @return   EFalse if user cancel or failed.
+        */
+        TBool GetNumberFromSpeedDialLocationL(
+            TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Assign Speed Dial location
+        * @param aCommandParam a command parameter
+        * @return ETrue if speed dial location is assigned
+        */
+        TBool AssignSpeedDialLocation( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Assign Speed Dial location
+        * @param aLocation a speed dial location
+        * @return ETrue if speed dial location is assigned
+        */
+        TBool AssignSpeedDialLocationL( TInt aLocation );
+
+        /**
+        * Opens Contact and adds address to contacts.
+        * @param aCommand a contact command
+        * @param aString a string to be added to contacts, if KNullDesC string
+        *                will be added from the number entry.
+        */
+        void OpenAddToContactL( TInt aCommand,
+                                const TDesC& aString = KNullDesC );
+
+        /**
+        * Launches Restore Factory Settings
+        * @param aDeepRfs - ETrue if deep rfs, EFalse if normal
+        */
+        void LaunchRfsL( TBool aDeepRfs );
+
+        /**
+        * Open the SMS or MMS message editor
+        */
+        void OpenMessageEditorL( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Open the soft reject message editor
+        */
+        void OpenSoftRejectMessageEditorL(TPhoneCommandParam* aCommandParam );
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        void ConstructL( TRect aRect );
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneViewController();
+
+        /**
+        * Fetches phone number's type for aSpeedDialLocation located number.
+        * @param aSpeedDialLocation - speed dial location of number.
+        * @return Phone number's type.
+        */
+        TPhoneNumberType SpeedDialNumberTypeL( TInt aSpeedDialLocation );
+
+        /**
+        * Convert number type from Speed Dial field info
+        * @param  aFieldInfo - field info
+        * @return Phone number's type
+        */
+        TPhoneNumberType ConvertNumberTypeFromSpeedDialFieldInfo(
+            CPhCntSpeedDialMonitor::TSpdDialFieldInfo aFieldInfo );
+
+        /**
+        * Open the Unified message editor and get
+        * number from number entry
+        */
+        void SendMessageL();
+
+        /**
+        * Set security mode to view and statuspane
+        */
+        void SetSecurityMode( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Get security mode status
+        */
+        void GetSecurityModeStatus ( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Set security mode to view and statuspane
+        */
+        void SetStatusPaneVisible( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Reads information is security code query displayed on the screen.
+        * @return ETrue if is displayed, otherwise EFalse
+        */
+        TBool IsSecurityCodeQuery() const;
+
+        /**
+        * Set update of FSW
+        */
+        void UpdateFSW();
+
+        /**
+
+        /**
+        * Creates Speed Dial Controller if it doesn't exist already.
+        */
+        void CreateSpeedDialControllerL();
+
+        /**
+        * Checks replace option.
+        * @return ETrue if active and waiting calls are both video or voice
+        */
+        TBool IsReplaceAllowed();
+
+        /**
+        * Open single item fecth dialod for Dialer.
+        */
+        void SingleItemFetchL();
+
+        /**
+        * Get Soft Reject Window Group Id.
+        */
+        void GetSoftRejectWindowGroupId( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Switch flat status pane.
+        */
+        void SwitchLayoutToFlatStatusPaneL( TBool aSwitch );
+
+        /**
+        * Swap empty indicator pane when secure state.
+        */
+        void SwapEmptyIndicatorPaneInSecureStateL ( const TBool aSwapEmpty );
+
+        /**
+        * Handles transition effect.
+        */
+        void HandleTransitionEffect( TPhoneTransEffectType aType );
+
+        /**
+        * Sets control to dialer.
+        */
+        void SetControltoDialerL();
+
+        /**
+        * Sets control to call handling.
+        */
+        void SetControltoCallHandlingL();
+
+        /**
+        * Sets control to dialer and makes control
+        * visible if needed.
+        */
+        void SetDialerControlAndVisibilityL();
+
+        /**
+        * Sets pointer capture.
+        * This is needed when statuspane must be inactive.
+        */
+        void CapturePointerEvents( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Returns allow waiting call header value.
+        */
+        void AllowWaitingCallHeaderL( TPhoneCommandParam* aCommandParam );
+
+        /**
+        * Checks if given window group id still exists in
+        * window group list.
+        *
+        * @aAppWgID     window group id to check
+        * @return TInt  KErrNotFound if app not exists anymore in the list
+        *                   otherwise app index in the list.
+        */
+        TInt FindAppByWgIDL( TInt aAppWgID );
+
+        /**
+        * Returns pointer to the control that is responsible of handling
+        * Phone Number Entry Changed events.
+        */
+        MPhoneNumberEntryChangedHandler* NumberEntryChangedHandler() const;
+
+       /**
+        * Returns single item fetch type
+        * @return single item fetch type
+        */
+        TInt SingleItemFetchType() const;
+
+        /**
+         * Checks screen lock status.        
+         */        
+        TBool IsKeyLockEnabled();
+        
+        /**
+         * Unlock keys & screen.        
+         */         
+        void DisableKeyLock();
+        
+    private:    // Data
+
+        CPhoneView* iPhoneView;
+
+		CPhoneDialerView* iDialerView;
+
+        // iCba
+        CEikButtonGroupContainer* iCba;
+
+        CPhoneStatusPane* iStatusPane;
+
+        // For accessing bubble
+        CPhoneBubbleWrapper* iBubbleWrapper;
+
+        // Controls the touch buttons
+        CPhoneButtonsController* iButtonsController;
+
+        // Controls the touch buttons
+        CPhoneDialerController* iDialerController;
+        
+        // Controls the toolbar
+        CPhoneToolbarController* iToolbarController;
+
+        // For accessing incall indicator
+        CPhoneIncallIndicator* iIncallIndicator;
+
+        CPhoneMenuController* iMenuController;
+
+        CPhoneNoteController* iNoteController;
+
+        CPhoneQueryController* iQueryController;
+
+        CPhoneKeyCaptureController* iKeyCaptureController;
+
+        CPhoneApplicationExit* iApplicationExit;
+
+        CPhoneAudioController* iAudioController;
+        
+        CPhoneRingingTonePlayerAO* iRingingTonePlayerAO;
+
+        // EikEnv for CPhoneKeyCaptureController, CPhoneNoteController,
+        // CPhoneMenuController and CPhoneQueryController
+        CEikonEnv& iEikEnv;
+
+        // Instance of keylock.
+        RAknKeyLock iKeyLock;
+
+        CPhoneContactController* iContactController;
+
+        // Window group of Idle application.
+        TInt iIdleWg;
+
+        // Boolean flag. ETrue if the application needs to return
+        // to the background
+        TBool iNeedToSendToBackground;
+
+        // Owned server session.
+        RApaLsSession iApaLsSession;
+
+        // Saved help context name retrieved indirectly from AppUI when
+        // the help application is launched
+        TPtrC iHelpCommand;
+
+        // Recovery id for contact manager construction.
+        TRecoveryId iContactControllerId;
+
+        // Boolean flag. ETrue if a blocking dialog is currently being
+        // displayed.
+        TBool iBlockingDialogIsDisplayed;
+
+        //Pointer to Akn UI server, not owned.
+        RAknUiServer* iAknUiServerClient;
+
+        //Uid of idle application
+        TInt iIdleUid;
+
+        // Voice mailbox handler
+        CPhoneVmbxHandler* iVmbxHandler;
+
+        // Reference to speed dialling monitor.
+        CPhCntSpeedDialMonitor* iSpeedDialController;
+
+
+        // Dialer - owned
+        CDialer* iDialer;
+
+        // Pointer to the CPhoneSingleItemFetch
+        CPhoneSingleItemFetch* iSingleItemFetch;
+
+        // Content of the SingleItemFetch
+        TBuf<KPhoneNumberEntryBufferSize> iFetchContent;
+
+        // Type of the SingleItemFetch
+        TInt iSingleItemFetchType;
+
+        // Pointer to CPhoneCntSaveAddToName.
+        CPhoneCntSaveAddToName* iContactSaveAddToName;
+
+        // Previous application Window group id.
+        TInt iPrevForegroundAppWg;
+
+        CAknAppUi* iAppui;
+
+        // Pointer to view customization.
+        MPhoneViewCustomization* iCustomization;
+
+        // Status if there is transition effect ongoing
+        TBool iEffectOngoing;
+
+        // Send back flag indicates send back need if it is
+        // EFalse phone was foregound and there is no need to send it
+        // background. Otherwise ETrue.
+        TBool iSendBack;
+
+        // Dialer status flag.
+        TBool iDialerActive;
+
+        CCoeControl* iPreviousIndicatorControl;
+
+        // Empty indicator pane - Owned.
+        CAknIndicatorContainer* iIndiContainer;
+
+        // Owned
+        CPhCntRfsHandler* iRfsHandler;
+
+        // Dialer send key flag.
+        TBool iDialerSendKeyActivation;
+
+        TInt iPrevious;
+
+        TBool iPriotityChanged;
+    };
+
+#endif // CPHONEVIEWCONTROLLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/cphonevmbxhandler.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  It provides voice/video mailbox related functionality.
+*
+*/
+
+
+#ifndef CPHONEVMBXGHANDLER_H
+#define CPHONEVMBXGHANDLER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <vmnumber.h>
+ 
+// CLASS DECLARATION
+class CPhApEVmbxMonitor; 
+/**
+*  Engine for voice/video mailbox
+*
+*/
+class CPhoneVmbxHandler :public CBase
+    {
+    public:  // Constructors and destructor
+     
+        static CPhoneVmbxHandler* NewL(); 
+             
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneVmbxHandler();
+
+    public: // New functions
+ 
+        /**
+        * Checks value of CR key KTelVideoMbxKey. 
+        * @return True if key 2 is assigned for videomailbox.
+        */
+        TBool IsStraightCallToVideoMailBox() const;  
+        
+        /**
+        * Checks value of CR key KVideoMbxSupport. 
+        * @return ETrue if Videomailbox configured.
+        */        
+        TBool IsVideoMailBoxConfigured() const;
+  
+        /**
+        * Perform speed dialling, either by speed dialling or one key dialling
+        * @param aSpdLocation the speed dialling location
+        * @param aNumber The number stored in the location
+        * @return error code
+        */
+        TInt GetStraightSpeedDialNumber( TInt aSpdLocation, 
+            TDes& aNumber );
+    
+        /**
+        * Get type of mailbox
+        */
+        TInt GetMailboxType();
+        
+        /**
+        * Launches the mailbox.
+        *
+        * @param aMailboxType Voice, Video or Voip mailbox.               
+        * @param aNumber phonenumber.        
+        * @return error code.
+		* @since 3.2
+        */            
+        TInt LaunchMbx( TInt aMailboxType, TDes& aNumber ); 
+        
+        
+       /**
+        * Launches the mailbox type query.
+        *        
+        * @return select mail box type.
+        * @param serviceId Contains the selected serviceId is on return
+        * @since 3.2
+        */ 
+        TInt SelectMailboxTypeL( TUint& aServiceId );
+        
+        /**
+         * Cancels the mailbox query.
+         *        
+         * @since 5.0
+         */         
+        void CancelVmbx();
+
+    private:
+
+        /**
+        * C++ constructor.
+        */
+        CPhoneVmbxHandler();
+    
+        /**
+        * Symbian OS constructor.
+        */
+        void ConstructL();
+        
+    private: // new functions
+    
+        /**
+        * Voice mailbox.
+        *      
+        * @param aNumber phonenumber.           
+        * @return error code.
+		* @since 3.2
+        */           
+        TInt CSVmbxL( TDes& aNumber );
+
+        /**
+        * VoIP mailbox.
+        *
+        * @param aNumber phonenumber.        
+        * @return error code.
+		* @since 3.2
+        */                        
+        TInt IPVmbxL( TDes& aNumber ); 
+                    
+        /**
+        * Video mailbox.
+        *
+        * @param aNumber phonenumber.        
+        * @return error code.
+		* @since 3.2
+        */                        
+        TInt VideoVmbxL( TDes& aNumber );   
+                               
+        /**
+        * Returns current networkMode.
+        *
+        * @return Network mode.
+		* @since 3.2
+        */                                 
+        TInt NetworkMode();                       
+
+        /**
+        * Is CSVideoTelephony feature enabled.
+        *
+        * @return ETrue is feature enabled otherwise EFalse.
+		* @since 3.2
+        */ 
+        TBool IsCsVideoTelFeature();
+        
+        /**
+        * Check if location is videombx '2' and videombx is configured.
+        *
+        * @param speeddialing location
+        * @return ETrue is location is '2' and videoMbx configured
+		* otherwise EFalse.
+		* @since 3.2
+        */ 
+        TBool IsVideoMbxLocationAndConfigured( TInt aSpdLocation ) const;
+        
+         /**
+        * Construct vmbx connection
+        */
+        void CreateVmbxL();
+        
+    private:    // Data
+          
+        //Indicates if CSVideoTelephony feature is enabled.
+        TBool iCsVideoTelFeature;
+        
+        // Mailbox
+        RVmbxNumber* iVmbx;
+         
+        // Type of mailbox 
+        TInt iMailboxType;
+
+        // ServiceId
+        TUint iServiceId;
+    };
+
+#endif      // CPHONEVMBXGHANDLER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/mphoneaudioplayerobserver.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,76 @@
+/*
+* 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:  Observer interface for audio player.
+*
+*/
+
+
+#ifndef MPHONEAUDIOPLAYEROBSERVER_H
+#define MPHONEAUDIOPLAYEROBSERVER_H
+
+// 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/phoneuiview/inc/mphonebuttoncustomization.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,44 @@
+/*
+* 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
+
+#include <bmtouchpaneinterface.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(
+                    MBubbleTouchPaneInterface& aTouchPane ) = 0;
+    
+
+
+    };
+    
+#endif // MPHONEBUTTONCUSTOMIZATION_H
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/mphonecoveruiobserver.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Mediator command responses sent by Cover UI are informed
+*								 via this observer.
+*
+*/
+
+
+#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/phoneuiview/inc/mphonedialercontroller.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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/phoneuiview/inc/mphonedisplayprovider.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,68 @@
+/*
+* 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:  Interface between ringing tone player and ui controls. 
+*
+*/
+
+
+
+#ifndef MPHONEDISPLAYPROVIDER_H
+#define MPHONEDISPLAYPROVIDER_H
+
+// CLASS DECLARATION
+
+/**
+*  Interface between ringing tone player and ui controls.
+*  Ringing tone player uses this interface to get display access for
+*  video ringing tone playback. 
+*
+*  @lib Phone.lib
+*  @since Series 60 3.0
+*/
+class MPhoneDisplayProvider
+    {
+    public:
+
+        enum TPhoneDisplayType
+            {
+            EIncomingCallQcifVideo,
+            EIncomingCallSubQcifVideo
+            };
+
+    public: // New functions
+
+        /**
+        * Activates a display. There can be one display active at time.
+        * This method may be called also to change display type.
+        * @since Series 60 3.0
+        * @param aDisplayType Type of the display requested.
+        * @param aClientWindow Window for client's use.
+        * @param aUncropPane Rectangle for cropping control, relative to screen.
+        * @return KErrNone If activation succeeded.                  
+        */
+        virtual TInt ActivateDisplay( 
+            TPhoneDisplayType aDisplayType,
+            RWindow& aClientWindow,
+            TRect& aUncropPane ) = 0;
+        
+        /**
+        * Deactivates the display active.
+        * @since Series 60 3.0
+        */
+        virtual void DeactivateDisplay() = 0;
+    };
+
+#endif      // MPHONEDISPLAYPROVIDER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/mphonenumberentry.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,80 @@
+/*
+* 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:  Abstract number entry interface. 
+*
+*/
+
+#ifndef M_PHONENUMBERENTRY_H
+#define M_PHONENUMBERENTRY_H
+
+// Forward declarations
+class MNumberEntry;
+
+/**
+ *  Abstract number entry interface.
+ *
+ *
+ *  @lib PhoneUiView.lib
+ *  @since S60 v5.0
+ */
+class MPhoneNumberEntry
+    {
+
+public:
+
+    /**
+    * Enables or disables tactile feedback
+    *
+    * @since S60 S60 v5.0
+    */
+    virtual void  EnableTactileFeedback( const TBool aEnable ) = 0;
+    
+    /**
+    * Indicates state whether numberentry is used or not
+    *
+    * @since S60 S60 v5.0
+    */    
+    virtual TBool IsNumberEntryUsed() const = 0;
+    
+    /**
+    * Returns count of characters in numberentry
+    *
+    * @since S60 S60 v5.0
+    */    
+    virtual TInt CountNumberEntryCharacters() = 0;
+    
+    /**
+    * Sets dialer's numberentry pointer 
+    *
+    * @since S60 S60 v5.0
+    */      
+    virtual void SetNumberEntry( MNumberEntry* aNumberEntry ) = 0;
+    
+    /**
+    * Sets content for numberentry
+    *
+    * @since S60 S60 v5.0
+    */
+    virtual void SetNumberEntryContent( const TDesC& aContent ) = 0;
+    
+    /**
+    * Sets prompt text for numberentry
+    *
+    * @since S60 S60 v5.0
+    */    
+    virtual void SetNumberEntryPromptText( const TDesC& aPromptText ) = 0; 
+    };
+
+
+#endif // M_PHONENUMBERENTRY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/mphonenumberentrychangedhandler.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,52 @@
+/*
+* 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:  Number entry state changed handler interface.
+*
+*/
+
+#ifndef MPHONENUMBERENTRYCHANGEDHANDLER_H
+#define MPHONENUMBERENTRYCHANGEDHANDLER_H
+
+#include "tphonecommandparam.h"
+
+/**
+* Defines Number Entry Changed Handler 
+*  
+* The implemenation of this interface defines the functionality that needs
+* to be done after Phone Number Entry has notified that the entry state  
+* has changed.
+* 
+*  @lib phoneuiview.lib
+*  @since S60 5.0 
+*/
+class MPhoneNumberEntryChangedHandler  
+    {
+    public:
+       
+        /**
+        * The implementing class contains the functionality about what is done
+        * when number entry state has changed
+        */
+        virtual void HandleNumberEntryChanged() = 0;
+        
+        /**
+         * Sets call back to an observer that wants to be notified about 
+         * the change in the content of the Phone Number Entry. 
+         */
+        virtual void SetNumberEntryChangedCallBack( 
+                            TPhoneCommandParam* aCommandParam ) = 0;  
+    };
+
+#endif /*MPHONENUMBERENTRYCHANGEDHANDLER_H*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/mphonequeryobserver.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*   Defines an interface for observing queries
+*
+*/
+
+
+#ifndef MPHONEQUERYOBSERVER_H
+#define MPHONEQUERYOBSERVER_H
+
+//  INCLUDES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*   Defines an interface for observing queries
+*/
+class MPhoneQueryObserver
+    {
+    public: // New functions
+
+        /**
+        * Set by the query when it is asynchronously deleted
+        * @param aQueryDeleted ETrue if query is deleted
+        */
+        virtual void SetQueryDeletedFlag( TBool aQueryDeleted ) = 0; 
+        
+        /**
+        * Reports query dialog's exit
+        * @param aCommand user selected action.
+        */  
+        virtual void ReportQueryCompleteAsync( TInt aCommand ) = 0;        
+    };
+
+#endif      // MPHONEQUERYOBSERVER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/mphoneringingtoneobserver.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Observer interface for ringing tone playing.
+*
+*/
+
+
+#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/phoneuiview/inc/mphonestatuspane.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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: 
+*       Manager for the statuspane, include navi pane and title pane
+*
+*/
+
+
+#ifndef MPHONESTATUSPANE_H
+#define MPHONESTATUSPANE_H
+
+// INCLUDES
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class MPhoneStatusPaneObserver;
+class CAknTitlePane;
+
+// CLASS DECLARATION
+
+/**
+*  Manager for the statuspane, include navi pane and title pane
+*  Usage:
+*  Every client in phone application that will change the title pane should
+*  use status pane manager, to avoid confliction. 
+*  - Always use iStatusPaneManager.TitlePane() to get the reference of status 
+*    pane.
+*  - in ConstructL() insert a new handler to status pane manager by 
+*    AddTitlePaneHandlerL( *this )
+*  - Reserve the title pane before you change the title pane by 
+*    ReserveTitlePane( *this )
+*  - Before changing the status pane, always check if I'm the topmost handler
+*    of the manager, by iStatusPaneManager->IsTitlePaneVisible()
+*  - release the title pane after the change
+*  
+*/
+class MPhoneStatusPane
+    {
+    public:
+
+        /**
+        * Destructor
+        */
+        virtual ~MPhoneStatusPane(){};
+
+        /**
+        * Returns ETrue if status pane is visible.
+        */
+        virtual TBool IsVisible() const = 0;
+
+        /**
+        * Get the reference of the title pane
+        * @return the reference of the title pane
+        */
+        virtual CAknTitlePane& TitlePane() const = 0;
+
+        /**
+        * Add title pane handler, returns reserve id
+        * @return reservatoin id
+        */
+        virtual void AddTitlePaneHandlerL(
+            MPhoneStatusPaneObserver& aObserver ) = 0;
+
+        /**
+        * Reserve the title pane
+        * @param the reserve id for release and get the visibility status
+        */
+        virtual void ReserveTitlePane(
+            MPhoneStatusPaneObserver& aObserver ) = 0;
+
+        /**
+        * Release title pane that has been reserved
+        * @param aReserveId the reserve id
+        */
+        virtual void ReleaseTitlePane( 
+            MPhoneStatusPaneObserver& aObserver ) = 0;
+
+        /**
+        * Remove the handler
+        */
+        virtual void RemoveTitlePaneHandler( 
+            MPhoneStatusPaneObserver& aObserver ) = 0;
+
+        /**
+        * Check if the title pane is visible
+        * @param aReserveId the reservation id
+        * @return ETrue if the title pane is visible
+        */
+        virtual TBool IsTitlePaneVisible( 
+            MPhoneStatusPaneObserver& aObserver ) const = 0;
+    };
+
+#endif      // MPhoneStatusPane_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/mphonestatuspaneobserver.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* 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 Status Pane Observer
+*
+*/
+
+
+#ifndef MPHONESTATUSPANEOBSERVER_H
+#define MPHONESTATUSPANEOBSERVER_H
+
+// INCLUDES
+#include <e32base.h>
+
+// CLASS DECLARATION
+
+class MPhoneStatusPaneObserver
+    {
+    public:  
+        /**
+        * Destructor
+        */
+        virtual ~MPhoneStatusPaneObserver(){};
+
+        virtual void HandleTitlePaneActiveL( TBool aActive = ETrue ) = 0;
+
+    };
+
+#endif      // MPhoneStatusPaneObserver_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/mphonevideoplayer.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,82 @@
+/*
+* 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:  Abstract video playing interface. 
+*
+*/
+
+#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/phoneuiview/inc/mphonevideoplayerobserver.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Video player observer interface.
+*
+*/
+
+
+#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/phoneuiview/inc/mphoneviewblockingdialogobserver.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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/phoneuiview/inc/mphoneviewcommandhandle.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View 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/phoneuiview/inc/mphoneviewcustomization.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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/phoneuiview/inc/mphoneviewobserver.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  MPhoneViewObserver 
+*
+*/
+
+
+
+#ifndef MPHONEVIEWOBSERVER_H
+#define MPHONEVIEWOBSERVER_H
+
+//  INCLUDES
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  MPhoneViewObserver class
+*
+*  @lib phoneuiview.lib
+*  @since Series60 5.0
+*/
+class MPhoneViewObserver
+    {
+    public:
+      
+    /**
+     * Informs when phone view is activated.
+     *
+     * @since S60 v5.0
+     */
+    virtual void PhoneViewActivatedL() = 0;         
+
+    };
+
+#endif      // MPHONEVIEWOBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/phonebubbleextension.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,178 @@
+/*
+* 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 plugin wrapper
+*
+*/
+
+
+#ifndef C_CPHONEBUBBLEEXTENSION_H
+#define C_CPHONEBUBBLEEXTENSION_H
+
+#include <e32base.h>
+#include <telbubbleextensionobserver.h>
+#include <telbubbleextensioninterface.h>
+
+class CTelBubbleCustomElement;
+class MTelBubbleExtensionData;
+class CTelBubbleExtension;
+class CBubbleManager;
+
+/**
+ *  Bubble extension plugin wrapper
+ *  This class wraps a plugin, hiding the actual plugin from the
+ *  phoneapp and phoneapp from the plugin.
+ *
+ *  @lib ?library
+ *  @since S60 ?S60_version *** for example, S60 v3.0
+ */
+class CPhoneBubbleExtension : public CBase,
+                              public MTelBubbleExtensionObserver,
+                              public MTelBubbleExtensionInterface
+    {
+public:
+
+    /**
+     * Two-phased constructor.
+     *
+     * @param aBubbleManager Reference to bubble manager
+     * @param aUid Plugin UID
+     * @param aPriority Priority of the plugin
+     */
+    static CPhoneBubbleExtension* NewL(
+            CBubbleManager& aBubbleManager,
+            TUid aUid,
+            TUint8 aPriority );
+
+    /**
+     * Two-phased constructor.
+     *
+     * @param aBubbleManager Reference to bubble manager
+     * @param aUid Plugin UID
+     * @param aPriority Priority of the plugin
+     */
+    static CPhoneBubbleExtension* NewLC(
+            CBubbleManager& aBubbleManager,
+            TUid aUid,
+            TUint8 aPriority );
+
+    /**
+    * Destructor.
+    */
+    virtual ~CPhoneBubbleExtension();
+
+// from base class MTelBubbleExtensionObserver
+
+    /**
+     * Call this before attach, detach and replace operations,
+     * when doing multipe changes outside BubbleUpdating() method. 
+     * UI is not redrawn until calling EndChanges() is called. 
+     */
+    void StartChanges();
+    
+    /**
+     * Call this when all changes have been done and UI can be
+     * redrawn.
+     */
+    void EndChanges();
+    
+    /**
+     * Attaches element to bubble. Causes redraw.
+     *
+     * @param aBubbleId Bubble id
+     * @param aElement Element to be attached, ownership is not transferred
+     */
+    void AttachElement( TInt aBubbleId, CTelBubbleCustomElement* aElement );
+
+    /**
+     * Replaces element in bubble. Causes redraw.
+     *
+     * @param aId Bubble id
+     * @param aOld Element to be detached, ownership is not transferred
+     * @param aNew Element to be attached, ownership is not transferred
+     */
+    void ReplaceElement(
+            TInt aBubbleId,
+            CTelBubbleCustomElement* aOld,
+            CTelBubbleCustomElement* aNew );
+
+    /**
+     * Detaches element in bubble. Causes redraw.
+     *
+     * @param aId Bubble id
+     * @param aElement Element to be detached, ownership is not transferred
+     */
+    void DetachElement( TInt aBubbleId, CTelBubbleCustomElement* aElement );
+
+
+// from base class MTelBubbleExtensionInterface
+
+    /**
+     * Notifies that a new customizable bubble is available
+     *
+     * @param aCallData Reference to call data.
+     */
+    void StartCustomizedBubble( MTelBubbleExtensionData& aCallData );
+
+    /**
+     * Notifies that a customizable bubble has been removed
+     *
+     * @param aCallData Reference to call data.
+     */
+    void StopCustomizedBubble( MTelBubbleExtensionData& aCallData );
+
+    /**
+     * Indicates that currently bubble drawing is started.
+     * Customizing is preferred to be done during this call.
+     */
+    void BubbleUpdating();
+
+private:
+
+    /**
+     * First-phase constructor.
+     *
+     * @param aBubbleManager Reference to bubble manager
+     * @param aUid Plugin UID
+     * @param aPriority Priority of the plugin
+     */
+    CPhoneBubbleExtension( CBubbleManager& aBubbleManager, TUid aUid, TUint8 aPriority );
+
+    void ConstructL();
+
+private: // data
+
+    /**
+     * Bubble manager reference
+     */
+    CBubbleManager& iBubbleManager;
+
+    /**
+     * Plugin UID
+     */
+    const TUid iUid;
+
+    /**
+     * Plugin priority
+     */
+    const TUint8 iPriority;
+
+    /**
+     * Loaded plugin.
+     * Own.
+     */
+    CTelBubbleExtension* iPlugin;
+
+    };
+
+#endif // C_CPHONEBUBBLEEXTENSION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/phonebubbleextensiondata.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,173 @@
+/*
+* 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:  Contains call data.
+*
+*/
+
+
+#ifndef C_PHONEBUBBLEEXTENSIONDATA_H
+#define C_PHONEBUBBLEEXTENSIONDATA_H
+
+#include <telbubbleextensiondata.h>
+
+class TPhoneCmdParamCallHeaderData;
+
+/**
+ * Call data.
+ * All data that plugins need to know about a call is collected here.
+ * Note that the data is changed to reflect changed call info before plugin
+ * is notified about changes, so plugin needs to save the current information
+ * if it needs it for comparison or otherwise.
+ *
+ *  @lib ?library
+ *  @since S60 5.0
+ */
+class CPhoneBubbleExtensionData : public CBase, public MTelBubbleExtensionData
+    {
+public:
+
+    /**
+     * Two-phased constructor.
+     * 
+     * @param aBubbleId Bubble Id this data relates to.
+     * @param aParams Phoneapp parameters
+     * @param aFirst Is this the first call. Default yes.
+     */
+    static CPhoneBubbleExtensionData* NewL(
+            TInt aBubbleId,
+            TPhoneCmdParamCallHeaderData* aParams,
+            TBool aFirst = ETrue );
+
+    /**
+     * Two-phased constructor.
+     * 
+     * @param aBubbleId Bubble Id this data relates to.
+     * @param aParams Phoneapp parameters
+     * @param aFirst Is this the first call. Default yes.
+     */
+    static CPhoneBubbleExtensionData* NewLC( 
+            TInt aBubbleId,
+            TPhoneCmdParamCallHeaderData* aParams,
+            TBool aFirst = ETrue );
+
+    /**
+    * Destructor.
+    */
+    virtual ~CPhoneBubbleExtensionData();
+
+    /**
+     * (Re)sets the call state
+     *
+     * @since S60 5.0
+     * @param aState New state (TPEState, not bubble state)
+     * @param aFirst Is this the first call. Default yes.
+     */
+    void SetState( TInt aState, TBool aFirst = ETrue );
+
+// from base class MTelBubbleExtensionData
+
+    /**
+     * Bubble ID this call is connected to.
+     * @return Bubble ID.
+     */
+    TInt BubbleId() const;
+
+    /**
+     * Call state information.
+     * @return Call state.
+     */
+    TCallState State() const;
+
+    /**
+     * Call type information
+     * @return Call type.
+     */
+    TCallType Type() const;
+
+    /**
+     * Call service id
+     * @return Call service
+     */
+    TUint32 ServiceId() const;
+
+    /**
+     * Contact Link related to this call.
+     * @return Reference to Contact Link
+     */
+    const TDesC8& ContactLink() const;
+
+    /**
+     * Remote phone number for this call.
+     * @return Remote phone number
+     */
+    const TDesC& RemotePhoneNumber() const;
+private:
+
+    /**
+     * First phase constructor.
+     * 
+     * @param aBubbleId Bubble Id this data relates to.
+     * @param aParams Phoneapp parameters
+     * @param aFirst Is this the first call
+     */
+    CPhoneBubbleExtensionData( 
+            TInt aBubbleId,
+            TPhoneCmdParamCallHeaderData* aParams, 
+            TBool aFirst );
+
+    /**
+     * Second phase constructor.
+     * 
+     * @param aParams Phoneapp parameters
+     * @param aFirst Is this the first call
+     */
+    void ConstructL( TPhoneCmdParamCallHeaderData* aParams );
+
+private: // data
+
+    /**
+     * Bubble ID
+     */
+    TInt iBubbleId;
+
+    /**
+     * Call state
+     */
+    TCallState iState;
+
+    /**
+     * Call type
+     */
+    TCallType iType;
+
+    /**
+     * Service id
+     */
+    TUint32 iService;
+
+    /**
+     * Contact Link
+     * Owned.
+     */
+    HBufC8* iContactLink;
+
+    /**
+     * Remote phone number
+     * Owned.
+     */
+    HBufC* iRemotePhoneNumber;
+    };
+
+
+#endif // C_PHONEBUBBLEEXTENSIONDATA_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/phonebubbleextensionmanager.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,135 @@
+/*
+* 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:  Manages the call bubble extension plugins.
+*
+*/
+
+
+#ifndef C_CPHONEBUBBLEEXTENSIONMANAGER_H
+#define C_CPHONEBUBBLEEXTENSIONMANAGER_H
+
+class TPhoneCmdParamCallHeaderData;
+class CPhoneBubbleExtensionData;
+class CPhoneBubbleExtension;
+class CBubbleManager;
+class TPriorityItem;
+
+/**
+ * Bubble extension plugin manager.
+ * Keeps track of the extension plugins.
+ *
+ *  @lib ?library
+ *  @since S60 5.0
+ */
+class CPhoneBubbleExtensionManager : public CBase
+    {
+public:
+
+    /**
+     * Two-phased constructor
+     *
+     * @param aBubbleManager Reference to bubble manager
+     */
+    static CPhoneBubbleExtensionManager* NewL( CBubbleManager& aBubbleManager );
+
+    /**
+     * Two-phased constructor
+     *
+     * @param aBubbleManager Reference to bubble manager
+     */
+    static CPhoneBubbleExtensionManager* NewLC( CBubbleManager& aBubbleManager );
+
+    virtual ~CPhoneBubbleExtensionManager();
+
+    /**
+     * Notifies the plugin framework about a new call.
+     *
+     * @param aBubbleId Bubble id of the new call
+     * @param aParams Call parameters
+     */
+    void StartCallL( TInt aBubbleId, TPhoneCmdParamCallHeaderData* aParams );
+
+    /**
+     * Notifies the plugin framework about cleared call.
+     *
+     * @param aId Bubble id of the call
+     */
+    void StopCall( TInt aBubbleId);
+    
+    /**
+     * Notifies the plugin framework about changed call state.
+     *
+     * @param aId Bubble id of the call
+     * @param aNewState New call state. (TPEState, not bubble state)
+     */
+    void UpdateCallState( TInt aBubbleId, TInt aNewState );
+
+    /**
+     * Loads all plugins
+     */
+    void InitializeL();
+    
+private:
+
+    /**
+     * First phase constructor
+     *
+     * @param aBubbleManager Reference to bubble manager
+     */
+    CPhoneBubbleExtensionManager( CBubbleManager& aBubbleManager );
+
+    void ConstructL();
+
+    /**
+     * Loads plugin priorities.
+     * TODO: Currently there is no plugin priorities, all plugins
+     *       use the default priority. Nothing is loaded.
+     */
+    void LoadPrioritiesL();
+    
+    /**
+     * Unloads all plugins, closes all calls
+     */
+    void Reset();
+    
+private: // data
+
+    /**
+     * Bubble manager reference
+     */
+    CBubbleManager& iBubbleManager;
+    
+    /**
+     * Array that holds all the loaded plugins
+     */
+    RPointerArray<CPhoneBubbleExtension> iPlugins;
+
+    /**
+     * Array that holds all the call data
+     */
+    RPointerArray<CPhoneBubbleExtensionData> iCalls;
+
+    /**
+     * Are the plugins already loaded?
+     */
+    TBool iInitialized;
+
+    /**
+     * Plugin priorities
+     */
+    RArray<TPriorityItem> iPriorityArray;
+    
+    };
+
+#endif // C_CPHONEBUBBLEEXTENSIONMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/phoneviewcommanddefinitions.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,247 @@
+/*
+* 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,
+    EPhoneViewMenuBarClose,
+    EPhoneViewDimCbaCommand, // 20
+    EPhoneViewUpdateCba,
+    EPhoneViewUpdateBubble,
+    EPhoneViewMenuPane,
+    EPhoneViewMenuBar,
+    EPhoneViewSetTitlePaneContent,
+    EPhoneViewSetNaviPaneContent,
+    EPhoneViewSetTitlePanePicture,
+    EPhoneViewGetTitlePaneIsVisibleStatus,
+    EPhoneViewActivateAudioPathUIChanges,
+    EPhoneViewActivateAudioAvailabilityUIChanges, //30
+    EPhoneViewActivateMuteUIChanges,
+    EPhoneViewShowNote,
+    EPhoneViewShowGlobalNote,
+    EPhoneViewShowProgressNote,
+    EPhoneViewRemoveNote,
+    EPhoneViewRemoveProgressNote,
+    EPhoneViewRemoveGlobalNote,
+    EPhoneViewGetIsNoteVisible, 
+    EPhoneViewGetIsProgressNoteVisible,
+    EPhoneViewShowQuery, // 40
+    EPhoneViewSetListQueryString,
+    EPhoneViewRemoveQuery,
+    EPhoneViewGetTextQueryContent,
+    EPhoneViewSetTopApplication,
+    EPhoneViewBringAppToForeground,
+    EPhoneViewSendToBackground,
+    EPhoneViewSetNeedToSendToBackgroundStatus,
+    EPhoneViewGetNeedToSendToBackgroundStatus, 
+    EPhoneViewGetTopApplicationIsDisplayedStatus,
+    EPhoneViewGetForegroundApplication, // 50
+    EPhoneViewSetBackgroundImageBitmap,
+    EPhoneViewGetBackgroundImageBitmap,
+    EPhoneViewActivateApp,
+    EPhoneViewActivateAppView,
+    EPhoneViewActivateAppViewWithCustomMessage,
+    EPhoneViewActivateAppViewConventional,
+    EPhoneViewLaunchApplication,
+    EPhoneViewLaunchHelpApplication, 
+    EPhoneViewOpenMessageEditor,
+    EPhoneViewExitApplications,  // 60
+    EPhoneViewUpdateIncallIndicator,
+    EPhoneViewStartCapturingKey,
+    EPhoneViewStopCapturingKey,
+    EPhoneViewSetGlobalNotifiersDisabled,
+    EPhoneViewSetSpeedDialLocation, 
+    EPhoneViewGetNumberFromSpeedDialLocation,
+    EPhoneViewAssignSpeedDialLocation,
+    EPhoneViewGetHoldFlag,
+    EPhoneViewSetHoldFlag,
+    EPhoneViewSetSoftRejectFlag, // 70
+    EPhoneViewGetSoftRejectFlag,
+    EPhoneViewSetServiceCodeFlag,
+    EPhoneViewUpdateContact,
+    EPhoneViewAddContact,
+    EPhoneViewOpenSingleItemFetchDialog,
+    EPhoneViewRemovePhoneDialogs,
+    EPhoneViewCreateConference,
+    EPhoneViewAddToConference,
+    EPhoneViewRemoveFromConference,
+    EPhoneViewPrivateFromConference, // 80
+    EPhoneViewSelectedConfMember,
+    EPhoneViewGetConferenceListVisibleFlag, 
+    EPhoneViewOpenConferenceList,
+    EPhoneViewGetCallState,
+    EPhoneViewGetCallIdByState,
+    EPhoneViewMoveHighLightInList,
+    EPhoneViewGetCountOfActiveCalls,
+    EPhoneViewSetNaviPaneAudioVolume,
+    EPhoneViewShowNaviPaneAudioVolume,
+    EPhoneViewHideNaviPaneAudioVolume, // 90 
+    EPhoneViewGetIsConference,
+    EPhoneViewGetCallExistsInConference,
+    EPhoneViewRemoveAllCallHeaders,
+    EPhoneViewPlayRingTone,
+    EPhoneViewMuteRingTone,
+    EPhoneViewStopRingTone,
+    EPhoneViewMuteRingToneOnAnswer,
+    EPhoneViewCipheringInfoChange,
+    EPhoneViewUpdateMaxConfMemberFlag,
+    EPhoneViewCloseFSW, // 100
+    EPhoneViewLaunchRfsDeep,
+    EPhoneViewLaunchRfsNormal,
+    EPhoneViewUpdateView,
+    EPhoneViewOpenSoftRejectEditor,
+    EPhoneViewSendMessage,
+    EPhoneViewSetBlockingDialogStatus,
+    EPhoneViewSetPhoneNumberAvailableInPhoneEngine,
+    EPhoneViewSetSecurityMode,
+    EPhoneViewGetSecurityModeStatus,
+    EPhoneViewSetStatusPaneVisible, // 110
+    EPhoneViewEnableKeyLock,
+    EPhoneViewEnableKeyLockWithoutNote,
+    EPhoneViewLaunchFaxModem,
+    EPhoneViewUpdateFSW,
+    EPhoneViewIsQuery,
+    EPhoneViewBringIdleToForeground, 
+    EPhoneViewSetIdleTopApplication,  
+    EPhoneViewBeginUpdate,
+    EPhoneViewEndUpdate,
+    EPhoneViewSetConfrenceOptionsFlag, // 120 
+    EPhoneViewRemoveConferenceBubble, 
+    EPhoneViewGetSoftRejectWindowGroupId,
+    EPhoneViewSetTouchPaneButtons,
+    EPhoneViewSetTouchPaneVisible,
+    EPhoneViewEnableTouchButton,
+    EPhoneViewDisableTouchButton, 
+    EPhoneResetTouchButtons, 
+    EPhoneViewGetIsConferenceInSelectionMode,
+    EPhoneViewIsStraightCallToVideoMailBox,
+    EPhoneViewSetDtmfDialerViewVisible, // 130
+    EPhoneViewSetRetrictedDialer, 
+    EPhoneViewIsConferenceInExpandedMode,
+    EPhoneViewIsMenuBarVisible,
+    EPhoneViewGetBlockingDialogStatus,
+    EPhoneViewYesSingleItemFetch,
+    EPhoneViewNoSingleItemFetch, 
+    EPhoneViewGetLocalizedNumberFromEntry,
+    EPhoneViewIsNoteActive,
+    EPhoneViewOpenNumberEntry,
+    EPhoneViewOpenCallHandling, // 140
+    EPhoneViewGetConferenceAndSingleFlag,
+    EPhoneViewSetConferenceAndSingleFlag,
+    EPhoneViewSetVideoCallFlag,
+    EPhoneViewSetDtmfOptionsFlag,
+    EPhoneViewShowVTSetupFailedCreateCallToSameContactQuery,
+    EPhoneViewGetAudioVolumeLevel, 
+    EPhoneViewIsIdleTopApp,
+    EPhoneViewUpdateToolbar,
+    EPhoneViewSetControlAndVisibility,
+    EPhoneViewAllowWaitingCallHeader, // 150
+    EPhoneViewBeginTransEffect,
+    EPhoneViewEndTransEffect,
+    EPhoneViewSetDialerControlVisible,
+    EPhoneViewCloseSingleItemFetchDialog,
+    EPhoneViewGetActivatePreviousApp,
+    EPhoneViewActivatePreviousApp, 
+    EPhoneViewSetPointerCapture,
+    EPhoneViewSetSendKeyDialerActivationFlag,
+    EPhoneViewPrepareIcons,
+    EPhoneViewKeypadAudioEnabled, // 160
+    EPhoneViewKeypadAudioDisabled,
+    EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel,
+    EPhoneViewRemoveDtmfNote,
+    EPhoneViewUpdatePhoneIconToFSW,
+    EPhoneViewSetEikonNotifiersDisabled, 
+    EPhoneViewCancelAllNotications, 
+    EPhoneViewSetVideoCallDTMFVisibilityFlag,
+    EPhoneViewIsKeyLockEnabled,
+    EPhoneViewDisableKeyLock,
+    EPhoneViewLoadPlugins, // 170
+    EPhoneViewOpenVirtualKeyBoard,
+    EPhoneViewUpdateNoteSoftkeys,
+
+    EPhoneViewSendAiwCommand,
+    EPhoneViewShowCustomizedDialer,
+    EPhoneViewHideCustomizedDialer,
+    EPhoneViewGetCustomizedDialerMenuResourceId,
+    EPhoneViewGetCustomizedDialerCbaResourceId,
+    EPhoneViewCipheringInfoChangePlayTone,
+	EPhoneViewCreatePhoneBookServices,
+	EPhoneViewDisableKeyLockWithoutNote, // 180
+	EPhoneViewGetKeyLockStatus,
+    EPhoneViewSetNumberEntryObserver,
+    EPhoneViewGetSingleItemFetchType,
+    EPhoneViewRemoveGlobalWaitNote,
+    EPhoneViewSetPhoneCustomization,
+    EPhoneViewSetViewCustomization,
+    EPhoneViewSetButtonCustomization,
+    EPhoneViewUpdateContactByString,
+    EPhoneViewAddContactByString,
+    EPhoneViewIsActiveNoteDissmissableByKeyEvent, // 190
+    EPhoneViewUpdateContextMenu,
+    EPhoneViewSetNoConnectedCalls,
+    EPhoneViewIsDTMFEditorVisible,
+    EPhoneViewSetToolbarDimming,
+	EPhoneViewEnableToolbarButton,
+	EPhoneViewHideToolbar,
+	EPhoneViewShowToolbar,
+    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/phoneuiview/src/cphoneapplicationexit.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,864 @@
+/*
+* 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:  Implementation of the CPhoneApplicationExit class.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "cphoneapplicationexit.h"
+#include    "cphonecenrepproxy.h"
+#include    "cphoneviewcontroller.h"
+#include    "telephonyvariant.hrh"
+#include    "telprivatecrkeys.h"
+#include    "phonelogger.h"
+
+#include    <w32std.h>
+#include    <e32hal.h>
+#include    <apgwgnam.h>
+#include    <apgtask.h>
+#include    <apgcli.h>
+#include    <avkon.hrh>
+#include    <telephonyvariant.hrh>
+#include    <gfxtranseffect/gfxtranseffect.h>     
+#include    <akntranseffect.h>      
+
+// CONSTANTS
+
+// MODULE DATA STRUCTURES
+
+/**
+* Abstract base class to handle rules when certain application should be
+* closed.
+* @since 2.6
+*/
+class CPhoneApplicationExit::CElement : public CBase
+    {
+    public: // New functions
+
+        /**
+        * Checks if this application should be accepted to be closed.
+        * @param aUid uid of the application.
+        * @return ETrue if should be closed, otherwise EFalse.
+        */
+        virtual TBool AcceptL( const TUid& aUid ) const = 0;
+    };
+
+/**
+* Element to handle any application and low memory cases.
+* @since 2.6
+*/
+class CPhoneApplicationExit::CElementBasic : 
+    public CPhoneApplicationExit::CElement
+    {
+    public: // Constructors
+
+        /**
+        * Enumerates types.
+        */
+        enum TTypeOfElement
+            {
+            // Any application.
+            EExitAnyApp,
+            // Only when low memory.
+            EExitWhenLowMemory
+            };
+
+        /**
+        * Constructor.
+        * @param aType type of element.
+        */
+        CElementBasic( TTypeOfElement aType );
+
+    public: // New functions
+
+        /**
+        * Checks if system is low in memory.
+        * @return ETrue if system is low in memory.
+        */
+        static TBool IsLowMemory();
+
+    public: // Functions from base classes
+
+        /**
+        * @see CPhoneApplicationExit::CElement::AcceptL.
+        */ 
+        virtual TBool AcceptL( const TUid& aUid ) const;
+
+    private:
+
+        // Type of element.
+        TTypeOfElement iType;
+
+    };
+
+/**
+* Element to handle applications UID of which are included in UID range.
+* @since 2.6
+*/
+class CPhoneApplicationExit::CElementUid :
+    public CPhoneApplicationExit::CElement
+    {
+    public: // Constructors
+
+        /**
+        * Constructor.
+        * @param aStart start of range.
+        * @param aEnd end of range.
+        */
+        CElementUid( const TUid& aStart, const TUid& aEnd );
+
+    public: // Functions from base classes
+
+        /**
+        * @see CPhoneApplicationExit::CElement::AcceptL.
+        */ 
+        virtual TBool AcceptL( const TUid& aUid ) const;
+
+    private:
+
+        // Start of the range.
+        TUid iStart;
+
+        // End of the range.
+        TUid iEnd;
+
+    };
+
+/**
+* Element to handle applications on specific drive.
+* @since 2.6
+*/
+class CPhoneApplicationExit::CElementDrive :
+    public CPhoneApplicationExit::CElement
+    {
+    public: // Constructors
+
+        /**
+        * Constructor.
+        * @param aDrive drive.
+        */
+        CElementDrive( const TChar& aDrive );
+
+    public: // Functions from base classes
+
+        /**
+        * @see CPhoneApplicationExit::CElement::AcceptL.
+        */ 
+        virtual TBool AcceptL( const TUid& aUid ) const;
+
+    private:
+
+        /**
+        * Checks if application has been installed on specified drive.
+        * @param aUid application UID.
+        * @return ETrue if application has been installed on specified drive.
+        */
+        TBool CheckApplicationDriveL( 
+            const TUid& aUid ) const;
+
+    private:
+
+        // Drive.
+        TChar iDrive; 
+        
+    };
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::CPhoneApplicationExit
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneApplicationExit::CPhoneApplicationExit(
+    CPhoneViewController* aViewController,
+    RWsSession& aWsSession,
+    const TInt aUikonWgId ) :
+    iViewController( aViewController ),
+    iWsSession( aWsSession ),
+    iUikonWgId( aUikonWgId )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPhoneApplicationExit* CPhoneApplicationExit::NewL(
+    CPhoneViewController* aViewController,
+    RWsSession& aWsSession,
+    const TInt aUikonWgId )
+    {
+    CPhoneApplicationExit* self = 
+        new ( ELeave ) CPhoneApplicationExit(
+            aViewController,
+            aWsSession,
+            aUikonWgId );
+    
+    return self;
+    }
+
+// Destructor
+CPhoneApplicationExit::~CPhoneApplicationExit()
+    {
+    iCloseList.ResetAndDestroy();
+    iCloseList.Close();
+
+    iDontCloseList.ResetAndDestroy();
+    iDontCloseList.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::ExitApplication
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneApplicationExit::ExitApplication()
+    {
+    TRAPD( err, ExitApplicationL() );
+#ifdef __PHENG_DEBUG_INFO__
+    if ( err != KErrNone )
+        {
+        __PHONELOG1( EBasic, EPhoneUIView, "CPhoneApplicationExit::ExitApplication err=%d", err );
+        }
+#endif
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::ExitApplicationL
+// -----------------------------------------------------------------------------
+//
+void CPhoneApplicationExit::ExitApplicationL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneApplicationExit::ExitApplicationL()" );
+    TInt foregroundWindowGroupId = iWsSession.GetFocusWindowGroup();
+    if ( foregroundWindowGroupId == iUikonWgId )
+        {
+        foregroundWindowGroupId = 
+            iViewController->ForegroundApplicationWindowGroupId();
+        }
+    if ( foregroundWindowGroupId == 
+        iViewController->ApplicationWindowGroupId() )
+        {
+        // No need to send event to itself.
+        __PHONELOG( EBasic, EPhoneUIView, "CPhoneApplicationExit::ExitApplicationL Phone is foreground application so don't close it" );
+        if ( IsApplicationClosingEnabled() )
+            {
+            ReadListsL();
+            }
+        return;
+        }
+    __PHONELOG1( EBasic, EPhoneUIView, "CPhoneApplicationExit::ExitApplicationL foregroundWindowGroupId=%d", foregroundWindowGroupId );
+    
+    CApaWindowGroupName* wgName = 
+        CApaWindowGroupName::NewLC(
+            iWsSession, 
+            foregroundWindowGroupId );
+
+    if ( IsApplicationClosingEnabled() )
+        {
+        __PHONELOG1( EBasic, EPhoneUIView, "CPhoneApplicationExit::ExitApplicationL Application closing is enabled wgName->AppUid().iUid=%d", wgName->AppUid().iUid );
+
+        if ( CheckApplicationClosingL( wgName->AppUid() ) )
+            {
+            // Transition effects end key handling
+            // This call makes it possible to show application exit effect
+            // whenever exiting application with the end key
+            GfxTransEffect::BeginFullScreen( 
+                         AknTransEffect::EApplicationExit, 
+                         TRect(), 
+                         AknTransEffect::EParameterType, 
+                         AknTransEffect::GfxTransParam( wgName->AppUid(), 
+                         AknTransEffect::TParameter::EActivateExplicitCancel | 
+                         AknTransEffect::TParameter::EEndCheck ) );
+ 
+            __PHONELOG( EBasic, EPhoneUIView, "CPhoneApplicationExit::ExitApplicationL Send exit event" );
+            TWsEvent event;
+            event.SetType( KAknUidValueEndKeyCloseEvent );
+            event.SetTimeNow();
+
+            iWsSession.SendEventToWindowGroup( 
+                foregroundWindowGroupId, 
+                event );
+            }
+        }
+    else
+        {
+        __PHONELOG( EBasic, EPhoneUIView, "CPhoneApplicationExit::ExitApplicationL Application closing is NOT enabled" );
+
+        // If the application is not system and system has low memory, then
+        // stop the application.
+        if ( !wgName->IsSystem() && CElementBasic::IsLowMemory() )
+            {
+            __PHONELOG( EBasic, EPhoneUIView, "CPhoneApplicationExit::ExitApplicationL Close non-system app because of low memory" );
+            // Close application
+            TApaTask task( iWsSession );
+            task.SetWgId( foregroundWindowGroupId );
+            task.EndTask();
+            }
+        }
+
+    CleanupStack::PopAndDestroy( wgName );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::CheckApplicationClosingL
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneApplicationExit::CheckApplicationClosingL( 
+    const TUid& aUid )
+    {
+    ReadListsL();
+
+    return 
+        IsIncludedToCloseListL( aUid ) && !IsIncludedToDontCloseListL( aUid );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::IsIncludedToCloseListL
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneApplicationExit::IsIncludedToCloseListL( 
+    const TUid& aUid ) const
+    {
+    __PHONELOG( EBasic, EPhoneUIView, "CPhoneApplicationExit::IsIncludedToCloseList()" );
+
+    TBool result = 
+        CheckListL( 
+            iCloseList, 
+            aUid );
+
+    __PHONELOG1( EBasic, EPhoneUIView, "CPhoneApplicationExit::IsIncludedToCloseList() result=%d", result );
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::IsIncludedToDontCloseListL
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneApplicationExit::IsIncludedToDontCloseListL( 
+    const TUid& aUid ) const
+    {
+    __PHONELOG( EBasic, EPhoneUIView, "CPhoneApplicationExit::IsIncludedToDontCloseList()" );
+
+    TBool result = 
+        CheckListL( 
+            iDontCloseList, 
+            aUid );
+
+    __PHONELOG1( EBasic, EPhoneUIView, "CPhoneApplicationExit::IsIncludedToDontCloseList() result=%d", result );
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::CheckListL
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneApplicationExit::CheckListL( 
+    const RPointerArray< CElement >& aTarget, 
+    const TUid& aUid ) const
+    {
+    TBool result = EFalse;
+
+    const TInt count = aTarget.Count();
+    
+    for ( TInt i = 0; i < count && !result; i++ )
+        {
+        result = aTarget[ i ]->AcceptL( aUid );
+        }
+    
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::ReadListsL
+// -----------------------------------------------------------------------------
+//
+void CPhoneApplicationExit::ReadListsL()
+    {
+    if ( !iListsRead )
+        {
+        iCloseList.ResetAndDestroy();
+        iDontCloseList.ResetAndDestroy();
+
+        // Acquire buffer for reading operations.
+        HBufC* tempBuffer = HBufC::NewLC( KPhoneTemporaryBufferMaxLength );
+        tempBuffer->Des().Zero();
+        TPtr ptr( tempBuffer->Des() );
+
+        TInt err = KErrNone;
+        // Read "close" list.
+        err = CPhoneCenRepProxy::Instance()->GetString(
+            KCRUidTelPrivateVariation,
+            KTelAppsCloseList,
+            ptr );
+        if ( err == KErrNone )
+            {
+            BuildListL( iCloseList, ptr, ETrue );
+            }
+        if ( err == KErrNotFound )
+            {
+            // Not defined.
+            err = KErrNone;
+            }
+        User::LeaveIfError( err );
+
+        // Read "don't close" list.
+        err = CPhoneCenRepProxy::Instance()->GetString(
+            KCRUidTelPrivateVariation,
+            KTelAppsKeepList,
+            ptr );
+        if ( err == KErrNone )
+            {
+            BuildListL( iDontCloseList, ptr, EFalse );
+            }
+        if ( err == KErrNotFound )
+            {
+            // Not defined.
+            err = KErrNone;
+            }
+        User::LeaveIfError( err );
+
+        // By default, applications are closed on OOM.
+        if ( !iCloseList.Count() && !iDontCloseList.Count() )
+            {
+            CElement* element = 
+                new ( ELeave ) CElementBasic( 
+                    CElementBasic::EExitWhenLowMemory );
+            CleanupStack::PushL( element );
+            User::LeaveIfError( iCloseList.Append( element ) );
+            CleanupStack::Pop( element );
+            }
+
+        CleanupStack::PopAndDestroy( tempBuffer );
+        iListsRead = ETrue;
+
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::BuildListL
+// -----------------------------------------------------------------------------
+//
+void CPhoneApplicationExit::BuildListL(
+    RPointerArray< CElement >& aTarget,
+    const TDesC& aSource,
+    TBool aOomAllowed )
+    {
+    aTarget.ResetAndDestroy();
+
+    TLex lexer( aSource );
+    lexer.SkipSpace();
+
+    TUid start;
+    TUid end;
+    TChar drive;
+
+    TInt length = lexer.Remainder().Length();
+    while ( length )
+        {
+        lexer.SkipSpace();
+
+        CElement* element = NULL;
+
+        if ( ParseString( lexer, KPhoneApplicationAnyApp ) )
+            {
+            element = 
+                new ( ELeave ) CElementBasic( 
+                    CElementBasic::EExitAnyApp );
+            }
+        else if ( ParseString( lexer, KPhoneApplicationOom ) )
+            {
+            if ( aOomAllowed )
+                {
+                element = 
+                    new ( ELeave ) CElementBasic( 
+                        CElementBasic::EExitWhenLowMemory );
+                }
+            }
+        else if ( ParseDrive( lexer, drive ) )
+            {
+            element = new ( ELeave ) CElementDrive( drive );
+            }
+        else if ( ParseUid( lexer, start, end ) )
+            {
+            
+            element = new ( ELeave ) CElementUid( start, end );
+            }
+        else
+            {
+            // No proceeding, stop.
+            length = 0;
+            }
+
+        if ( element )
+            {
+            CleanupStack::PushL( element );
+            User::LeaveIfError( aTarget.Append( element ) );
+            CleanupStack::Pop( element );
+            }
+
+        if ( length )
+            {
+            const TInt oldLength = length;
+            length = lexer.Remainder().Length();
+
+            if ( length == oldLength )
+                {
+                // No proceeding, stop.
+                length = 0;
+                }
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::ParseString
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneApplicationExit::ParseString( 
+    TLex& aLexer,
+    const TDesC& aString )
+    {
+    TBool result = EFalse;
+    TLexMark startMark;
+    aLexer.Mark( startMark );
+    const TInt length = aString.Length();
+    
+    TInt i;
+    for ( i = 0; 
+          i < length && ( aString[ i ] == TUint( aLexer.Peek() ) ); 
+          i++ )
+        {
+        aLexer.Inc();
+        }
+
+    result = ( ( i == length ) && CheckEnd( aLexer ) );
+
+    if ( !result )
+        {
+        aLexer.UnGetToMark( startMark );
+        }
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::ParseUid
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneApplicationExit::ParseUid( 
+    TLex& aLexer, 
+    TUid& aUidStart,
+    TUid& aUidEnd )
+    {
+    TBool result = EFalse;
+    TLexMark startMark;
+
+    // Read first UID.
+    aLexer.Mark( startMark );
+    while ( aLexer.Peek().IsHexDigit() )
+        {
+        aLexer.Inc();
+        }
+    TPtrC token = aLexer.MarkedToken( startMark );
+    if ( token.Length() )
+        {
+        TUint uid = 0;
+        result = ( TLex( token ).Val( uid, EHex ) == KErrNone );
+        if ( result )
+            {
+            aUidStart.iUid = uid;
+            aUidEnd.iUid = uid;
+            }
+        }
+
+    if ( result )
+        {
+        TLexMark afterUid;
+        aLexer.Mark( afterUid );
+        aLexer.SkipSpace();
+
+        // Check range separator.
+        if ( aLexer.Peek() == KPhoneApplicationRangeSeparator )
+            {
+            // Now there must be another UID as well.
+            result = EFalse; 
+            aLexer.Inc(); // skip separator character
+            aLexer.SkipSpace();
+
+            // Read second UID.
+            TLexMark mark;
+            aLexer.Mark( mark );
+            while ( aLexer.Peek().IsHexDigit() )
+                {
+                aLexer.Inc();
+                }
+
+            TPtrC token = aLexer.MarkedToken( mark );
+            if ( token.Length() )
+                {
+                TUint uid = 0;
+                result = ( TLex( token ).Val( uid, EHex ) == KErrNone );
+                if ( result )
+                    {
+                    result = CheckEnd( aLexer );
+                    aUidEnd.iUid = uid;
+                    }
+                }
+            }
+        else
+            {
+            // Only one UID, next must be space.
+            aLexer.UnGetToMark( afterUid );
+            result = CheckEnd( aLexer );
+            }
+        }
+
+    if ( !result )
+        {
+        aLexer.UnGetToMark( startMark );
+        }
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::ParseDrive
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneApplicationExit::ParseDrive(
+    TLex& aLexer, 
+    TChar& aChar )
+    {
+    TBool result = EFalse;
+    TChar ch = aLexer.Peek();
+    
+    if ( ch.IsAlpha() )
+        {
+        aLexer.Inc();
+        if ( aLexer.Peek() == KPhoneApplicationDriveIdentifier )
+            {
+            aLexer.Inc();
+            aChar = ch;
+            result = CheckEnd( aLexer );
+            if ( !result )
+                {
+                aLexer.UnGet(); // drive identifier
+                aLexer.UnGet(); // drive letter
+                }
+            }
+        else
+            {
+            aLexer.UnGet(); // drive letter
+            }
+        }
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::CheckEnd
+// -----------------------------------------------------------------------------
+//
+inline TBool CPhoneApplicationExit::CheckEnd( TLex& aLexer )
+    {
+    return ( aLexer.Eos() || aLexer.Peek().IsSpace() );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::IsApplicationClosingEnabled
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneApplicationExit::IsApplicationClosingEnabled() const
+    {
+    return CPhoneCenRepProxy::Instance()->IsTelephonyFeatureSupported( 
+        KTelephonyLVFlagCloseApplications );
+    }
+
+// Implementation of CPhoneApplicationExit::CElementBasic.
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::CElementBasic::CElementBasic
+// -----------------------------------------------------------------------------
+//
+CPhoneApplicationExit::CElementBasic::CElementBasic( TTypeOfElement aType ) :
+    iType( aType )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::CElementBasic::IsLowMemory
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneApplicationExit::CElementBasic::IsLowMemory()
+    {
+    // Fetch amount of free memory.
+    TMemoryInfoV1Buf memory;
+    UserHal::MemoryInfo( memory );
+    TInt freeRam = (TInt)( memory().iFreeRamInBytes );
+    TInt oomRamLowThreshold = 0;
+    /* MIGRATION NOTE - need new method to TelUtils for static get of one
+    value.
+    CRepository* cenRep = NULL;
+    TRAPD( error, cenRep = CRepository::NewL( KCRUidUiklaf ) );
+    if ( error == KErrNoMemory )        
+        {
+        return ETrue;
+        }
+    else if ( error != KErrNone )
+        {
+        // Error; don't know OOM status.
+        return EFalse;
+        }
+    cenRep->Get( KUikOOMRamLowThreshold, oomRamLowThreshold );
+    delete cenRep;*/
+    return ( freeRam < oomRamLowThreshold );    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::CElementBasic::AcceptL
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneApplicationExit::CElementBasic::AcceptL( 
+    const TUid& /*aUid*/ ) const
+    {
+    TBool result = EFalse;
+    switch ( iType )
+        {
+        case EExitAnyApp:
+            result = ETrue;
+            break;
+
+        case EExitWhenLowMemory:
+            result = IsLowMemory();
+            break;
+
+        default:
+            break;
+        }
+    return result;
+    }
+
+// Implementation of CPhoneApplicationExit::CElementUid.
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::CElementUid::CElementUid
+// -----------------------------------------------------------------------------
+//
+CPhoneApplicationExit::CElementUid::CElementUid( 
+    const TUid& aStart, 
+    const TUid& aEnd ) :
+    iStart( aStart ), 
+    iEnd( aEnd )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::CElementUid::AcceptL
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneApplicationExit::CElementUid::AcceptL( const TUid& aUid ) const
+    {
+    return ( iStart.iUid <= aUid.iUid && aUid.iUid <= iEnd.iUid );
+    }
+
+// Implementation of CPhoneApplicationExit::CElementDrive.
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::CElementDrive::CElementDrive
+// -----------------------------------------------------------------------------
+//
+CPhoneApplicationExit::CElementDrive::CElementDrive( const TChar& aDrive ) :
+    iDrive( aDrive )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::CElementDrive::AcceptL
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneApplicationExit::CElementDrive::AcceptL( const TUid& aUid ) const
+    {
+    return CheckApplicationDriveL( aUid );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneApplicationExit::CElementDrive::CheckApplicationDriveL
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneApplicationExit::CElementDrive::CheckApplicationDriveL( 
+    const TUid& aUid ) const
+    {
+    RApaLsSession session;
+    User::LeaveIfError( session.Connect() );
+    CleanupClosePushL( session );
+
+    TApaAppInfo* appInfo = new ( ELeave ) TApaAppInfo;
+    CleanupStack::PushL( appInfo );
+
+    TBool result = EFalse;
+    TInt count = KPhoneApplicationRetryCount;
+    while ( count )
+        {
+        TInt err = session.GetAppInfo( *appInfo, aUid );
+        
+        if ( err == KErrNone )
+            {
+            count = 0;
+            result = ETrue;
+            }
+        else if ( err == KErrNotFound )
+            {
+            count = 0;
+            result = EFalse;
+            }
+        else
+            {
+            User::LeaveIfError( err );
+
+            // GetAppInfo may return positive value indicating that
+            // application information is not ready.
+            count--;
+            User::After( KPhoneApplicationRetryInterval );
+            }
+        }
+
+    if ( result )
+        {
+        result = EFalse;
+        if ( appInfo->iFullName.Length() )
+            {
+            // First character is drive
+            TChar drive( appInfo->iFullName[ 0 ] );
+            drive.UpperCase();
+
+            TChar targetDrive( iDrive );
+            targetDrive.UpperCase();
+
+            result = ( drive == targetDrive );
+            }
+        }
+
+    CleanupStack::PopAndDestroy( appInfo );
+    CleanupStack::PopAndDestroy(); // CleanupClosePushL
+    return result;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphoneaudiocontroller.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,512 @@
+/*
+* 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 CPhoneAudioController class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <aknnavi.h>
+#include <aknnavide.h>
+#include <StringLoader.h>
+#include <avkon.rsg>
+#include <phoneui.rsg>
+#include <telephonyvariant.hrh>
+#include <eikenv.h>
+#include <eikappui.h>
+#include <AknUtils.h>
+#include "cphoneaudiocontroller.h"
+#include "cphonerecoverysystem.h"
+#include "cphonecenrepproxy.h"
+#include "cphonestatuspane.h"
+#include "cphonetimer.h"
+#include "tphonecommandparam.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "phoneconstants.h"
+#include "phonelogger.h"
+#include "phoneui.hrh"
+
+// CONSTANTS
+// Defines how long time volume control is shown when volume is changed 
+// while device is muted. Duration in microseconds.
+const TInt KPhoneDelayVolumeControlToDefaultAfterReleased = 1000000;
+
+// ================= MEMBER FUNCTIONS =======================
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneAudioController::CPhoneAudioController() :
+    iIhfVolume( KPhoneDefaultVolume ),
+    iEarVolume( KPhoneDefaultVolume )
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneAudioController::ConstructL()
+// Construction method for CPhoneAudioController.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CPhoneAudioController::ConstructL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneAudioController::ConstructL()");
+
+    // Start observing foreground events
+    CCoeEnv::Static()->AddForegroundObserverL( *this );
+
+    // Create the status pane singleton
+    iStatusPane = CPhoneStatusPane::Instance();
+
+    // Create volume controls
+    iEarVolumeControl = 
+        iStatusPane->NaviPane().CreateVolumeIndicatorL( 
+        R_AVKON_NAVI_PANE_EARPIECE_VOLUME_INDICATOR );
+    
+    iIhfVolumeControl = 
+        iStatusPane->NaviPane().CreateVolumeIndicatorL( 
+        R_AVKON_NAVI_PANE_VOLUME_INDICATOR );
+        
+    // To get touch input, pen check in HandleControlEventL()
+    iEarVolumeControl->DecoratedControl()->SetObserver( this );
+    iIhfVolumeControl->DecoratedControl()->SetObserver( this );            
+  
+    // Create "muted" navi decorator
+    HBufC* mutedText = StringLoader::LoadLC( R_PHONE_INCALL_MUTED_PANE );
+    iMutedControl = iStatusPane->NaviPane().CreateMessageLabelL( *mutedText );
+    CleanupStack::PopAndDestroy( mutedText );
+        
+    iNaviPaneUpdateTimer = CPhoneTimer::NewL();
+
+    iActivateRecoveryId = CPhoneRecoverySystem::Instance()->AddL( 
+        TCallBack( DoRecoverActivateL, this ),
+        CTeleRecoverySystem::EPhonePriorityStandard,
+        CTeleRecoverySystem::EPhoneStateIdle );   
+    }
+
+// ---------------------------------------------------------
+// CPhoneAudioController::NewL()
+// Two-phased constructor
+// (other items were commented in a header).
+// ---------------------------------------------------------
+CPhoneAudioController* CPhoneAudioController::NewL()
+    {   
+    CPhoneAudioController* self = 
+        new( ELeave ) CPhoneAudioController();
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// ---------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------
+// 
+CPhoneAudioController::~CPhoneAudioController()
+    {
+    CCoeEnv::Static()->RemoveForegroundObserver( *this );
+    CPhoneRecoverySystem::Remove( iActivateRecoveryId );
+     
+    delete iNaviPaneUpdateTimer;   
+    delete iMutedControl;
+    delete iIhfVolumeControl;
+    delete iEarVolumeControl;
+    }
+
+// ---------------------------------------------------------
+// CPhoneAudioController::ActivateVolumeControlL
+// ---------------------------------------------------------
+//
+void CPhoneAudioController::ActivateVolumeControlL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneAudioController::ActivateVolumeControlL()");
+    iVolumeControlCount++;
+    if ( iVolumeControlCount == 1 ) // First time activation
+        {
+        // Decide whether decorator should be Ear or ihf decorator
+        CAknNavigationDecorator& selectedDecorator = SelectDecoratorL(); 
+        PushL( selectedDecorator ); 
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneAudioController::DoRecoverUpdateL
+//
+// Callback function.
+// ---------------------------------------------------------
+//
+TInt CPhoneAudioController::DoRecoverActivateL( TAny* aAny )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneAudioController::DoRecoverActivateL()");
+    static_cast< CPhoneAudioController* >( aAny )->ActivateL();
+    return KErrNone;
+    }
+    
+// ---------------------------------------------------------
+// CPhoneAudioController::ActivateL
+//
+// Updates volume control according to current audio data.
+// ---------------------------------------------------------
+//
+void CPhoneAudioController::ActivateL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneAudioController::ActivateL()");
+    
+    if( iVolumeControlCount )
+        {
+        // Decide whether decorator should be Ear, Ihf or Muted decorator
+        CAknNavigationDecorator& selectedDecorator = SelectDecoratorL(); 
+        PushL( selectedDecorator );     
+        
+        if( &selectedDecorator != iMutedControl )
+            {            
+            TInt volumeLevel = VolumeLevel(); 
+            
+            SetVolumeLevel( VolumeControl(), volumeLevel );                 
+            }      
+        }
+    }
+    
+// ---------------------------------------------------------
+// CPhoneAudioController::DeactivateVolumeControl
+// ---------------------------------------------------------
+//
+void CPhoneAudioController::DeactivateVolumeControl()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView,"CPhoneAudioController::DeactivateVolumeControl()" );
+    if ( iOldControl )
+        {
+        iStatusPane->NaviPane().Pop( iOldControl );
+        iOldControl = NULL;
+        iVolumeControlCount = 0;
+        }
+    }
+    
+// ---------------------------------------------------------
+// CPhoneAudioController::HandleVolumeChangeL
+//
+// Updates incall indicator according to current call state.
+// ---------------------------------------------------------
+//
+void CPhoneAudioController::HandleVolumeChangeL(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneAudioController::HandleVolumeChangeL()");
+    if( !iPhoneInForeground )
+        {
+        // Telephony is in the background so it's not our responsibility
+        // to display the volume control.
+        __PHONELOG( EBasic, EPhoneUIView,"CPhoneAudioController::HandleVolumeChangeL - phone in the background" ); 
+        return;
+        }
+    
+    TPhoneCmdParamInteger* volumeParam =
+        static_cast<TPhoneCmdParamInteger*>( aCommandParam );
+
+    if ( iIhfMode )
+        {
+        iIhfVolume = volumeParam->Integer();
+        }
+    else
+        {
+        iEarVolume = volumeParam->Integer();
+        }
+    
+    if( iMuted )
+        {
+        // Enable timed control transition in muted state    
+        iTimedMuteTransferPending = ETrue; 
+        }
+    else
+        {        
+        iTimedMuteTransferPending = EFalse; 
+        }
+     
+    // Activate the approriate volume control
+    CPhoneRecoverySystem::Instance()->RecoverNow( 
+        iActivateRecoveryId, 
+        CTeleRecoverySystem::EPhonePriorityStandard );
+
+    if( iTimedMuteTransferPending )    
+        {
+        iTimedMuteTransferPending = EFalse;     
+        
+        // Cancel any pending request
+        iNaviPaneUpdateTimer->CancelTimer();
+
+        // Activate change to Muted decorator after given delay        
+        iNaviPaneUpdateTimer->After(                    
+            KPhoneDelayVolumeControlToDefaultAfterReleased,
+            TCallBack( DoUpdateNaviPaneToDefault, this ) );           
+        }
+    }
+    
+// ---------------------------------------------------------
+// CPhoneAudioController::HandleIhfChange
+//
+// Updates incall indicator according to current call state.
+// ---------------------------------------------------------
+//
+void CPhoneAudioController::HandleIhfChange(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneAudioController::HandleIhfChange()");
+    TPhoneCmdParamBoolean* booleanParam =
+        static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+    
+    iIhfMode = booleanParam->Boolean();    
+    
+    // Set state transition flag 
+    iIhfTransferPending = ETrue; 
+    }
+    
+// ---------------------------------------------------------
+// CPhoneAudioController::HandleMuteChange
+//
+// Updates incall indicator according to current call state.
+// ---------------------------------------------------------
+//
+void CPhoneAudioController::HandleMuteChange(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneAudioController::HandleMuteChange()");
+    TPhoneCmdParamBoolean* booleanParam =
+        static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+    iMuted = booleanParam->Boolean();
+    
+    // Decide whether decorator should be ear, ihf or muted decorator
+    TRAP_IGNORE( PushL( SelectDecoratorL() ) );
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneAudioController::PushL
+// -----------------------------------------------------------------------------
+//
+void CPhoneAudioController::PushL( CAknNavigationDecorator& aNew )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneAudioController::PushL()");
+    TInt err = KErrNone;
+    if ( !iOldControl )
+        {
+        __PHONELOG( EBasic, EPhoneUIView,"CPhoneAudioController::iStatusPane->NaviPane().PushL( aNew );" ); 
+        iStatusPane->NaviPane().PushL( aNew );
+        }
+    else if ( &aNew != iOldControl )
+        {
+        err = iStatusPane->NaviPane().ReplaceL( *iOldControl, aNew );
+        }
+    // otherwise iOldControl == &aNew.
+
+    if ( err == KErrNone )
+        {
+        iOldControl = &aNew;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioController::DoUpdateNaviPaneToDefault
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneAudioController::DoUpdateNaviPaneToDefault( TAny* aAny )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneAudioController::DoUpdateNaviPaneToDefault()");
+    CPhoneAudioController* self = static_cast< CPhoneAudioController* >( aAny );
+    CPhoneRecoverySystem::Instance()->RecoverNow( 
+        self->iActivateRecoveryId, 
+        CTeleRecoverySystem::EPhonePriorityStandard );
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioController::HandleControlEventL
+// -----------------------------------------------------------------------------
+//    
+void CPhoneAudioController::HandleControlEventL( 
+    CCoeControl* aControl, 
+    TCoeEvent aEventType )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView,"CPhoneAudioController::HandleControlEventL()" );
+    if ( aEventType == MCoeControlObserver::EEventStateChanged &&
+         AknLayoutUtils::PenEnabled() )
+        {
+        if ( aControl == iEarVolumeControl->DecoratedControl() )
+            {
+            TInt volume =  static_cast< CAknVolumeControl* > 
+                               ( iEarVolumeControl->DecoratedControl() )
+                               ->Value();
+            
+            if ( volume != iEarVolume )
+                {
+                // Volume level was changed via ui control
+                iEarVolume = volume;
+                CEikonEnv::Static()->EikAppUi()->HandleCommandL(
+                    EPhoneInCallCmdSetVolumeLevel );                        
+                }
+            }
+        else if ( aControl == iIhfVolumeControl->DecoratedControl() )
+            {
+            TInt volume =  static_cast< CAknVolumeControl* > 
+                               ( iIhfVolumeControl->DecoratedControl() )
+                               ->Value();
+            
+            if ( volume != iIhfVolume )
+                {
+                // Volume level was changed via ui control
+                iIhfVolume = volume;
+                CEikonEnv::Static()->EikAppUi()->HandleCommandL(
+                    EPhoneInCallCmdSetVolumeLevel );                        
+                }        
+            }            
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioController::VolumeLevelFromControl
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneAudioController::VolumeLevelFromControl()
+    {       
+    __LOGMETHODSTARTEND( EPhoneUIView,"CPhoneAudioController::VolumeLevelFromControl()" );         
+    TInt volume = VolumeControl().Value();     
+    
+    return volume; 
+    }
+        
+// -----------------------------------------------------------------------------
+// CPhoneAudioController::VolumeDecorator
+// -----------------------------------------------------------------------------
+//    
+CAknNavigationDecorator& CPhoneAudioController::VolumeDecorator()    
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView,"CPhoneAudioController::VolumeDecorator()" );                 
+    CAknNavigationDecorator* volumeDecorator = NULL;      
+    if ( iIhfMode )
+        {            
+        volumeDecorator = iIhfVolumeControl;
+        }
+    else
+        {
+        volumeDecorator = iEarVolumeControl;        
+        }
+        
+    return *volumeDecorator; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioController::VolumeControl
+// -----------------------------------------------------------------------------
+//    
+CAknVolumeControl& CPhoneAudioController::VolumeControl()      
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView,"CPhoneAudioController::VolumeControl()" );                     
+    CAknVolumeControl* volumeControl = NULL;     
+    volumeControl = static_cast< CAknVolumeControl* >( 
+        VolumeDecorator().DecoratedControl() ); 
+
+    return *volumeControl; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioController::VolumeLevel
+// -----------------------------------------------------------------------------
+//    
+TInt CPhoneAudioController::VolumeLevel()    
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView,"CPhoneAudioController::VolumeLevel()" );                             
+    TInt volumeLevel;     
+    if ( iIhfMode )
+        {            
+        volumeLevel = iIhfVolume; 
+        }
+    else
+        {
+        volumeLevel = iEarVolume;         
+        }        
+        
+    return volumeLevel;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioController::SelectDecoratorL
+// -----------------------------------------------------------------------------
+//    
+CAknNavigationDecorator& CPhoneAudioController::SelectDecoratorL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView,"CPhoneAudioController::SelectDecoratorL()" );                                     
+    CAknNavigationDecorator* newDecorator = NULL;    
+    if ( !iMuted )
+        {
+        __PHONELOG( EBasic, EPhoneUIView,"CPhoneAudioController::SelectDecoratorL() - volume decorator " );     
+        newDecorator = &VolumeDecorator();
+        }
+    else 
+        {
+        if ( iIhfTransferPending || !iTimedMuteTransferPending )
+            {
+            __PHONELOG( EBasic, EPhoneUIView,"CPhoneAudioController::SelectDecoratorL() - muted decorator " );         
+            newDecorator = iMutedControl;    
+            }            
+        else 
+            {
+            __PHONELOG( EBasic, EPhoneUIView,"CPhoneAudioController::SelectDecoratorL() - volume decorator " );         
+            newDecorator = &VolumeDecorator();
+            
+            // In muted state the volume decorator must be first 
+            // pushed to container to enable volume popup showing 
+            PushL( *newDecorator );             
+            }
+        }
+
+    // Clear IHF transfer flag. 
+    iIhfTransferPending = EFalse;
+           
+    return *newDecorator;         
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioController::SetVolumeLevel
+// -----------------------------------------------------------------------------
+//    
+void CPhoneAudioController::SetVolumeLevel(
+    CAknVolumeControl& aVolumeControl, 
+    TInt aVolumeLevel)
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView,"CPhoneAudioController::SetVolumeLevel()" );   
+    aVolumeControl.SetValue( aVolumeLevel ); 
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioController::HandleGainingForeground
+// -----------------------------------------------------------------------------
+//    
+void CPhoneAudioController::HandleGainingForeground()
+    {
+    iPhoneInForeground = ETrue;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioController::HandleLosingForeground
+// -----------------------------------------------------------------------------
+//    
+void CPhoneAudioController::HandleLosingForeground()
+    {
+    iPhoneInForeground = EFalse;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphoneaudioplayer.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,1064 @@
+/*
+* 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:  Audio player implementation.
+*
+*/
+
+
+// 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( EPhoneUIView, "CPhoneAudioPlayer::ConstructL()" );
+    if ( iFormat == EFormatTone )
+        {
+        iTonePlayer = CMdaAudioToneUtility::NewL( *this, aMdaServer );
+        iTonePlayer->PrepareToPlayFileSequence( aFileName );
+        iPlayerStatus = EToneLoading;
+        }
+    else
+        {
+        //audio sample player
+        __PHONELOG3( 
+            EBasic, 
+            EPhoneUIView, 
+            "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( EPhoneUIView, "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( EPhoneUIView, "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( EPhoneUIView, "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( EPhoneUIView, "CPhoneAudioPlayer::NewL()" );
+    __PHONELOG1( EBasic, EPhoneUIView, "CPhoneAudioPlayer::NewL - aExtSecNeeded(%d)",
+        aExtSecNeeded );
+    
+    // Check the file DRM property if extend secure is needed.
+    if ( aExtSecNeeded )
+        {
+        if ( !aRingingTone.IsFileInRom() &&
+             !aRingingTone.IsFileDrmProtected() )
+            {
+            __PHONELOG( EBasic, EPhoneUIView, "CPhoneAudioPlayer::NewL - DRM extend security check permission denied" );
+            User::Leave( KErrPermissionDenied );
+            }
+        __PHONELOG( EBasic, EPhoneUIView, "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( EPhoneUIView, "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( EPhoneUIView, "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( EPhoneUIView, "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( EPhoneUIView, "CPhoneAudioPlayer::Play()" );
+    __PHONELOG2( 
+        EBasic, 
+        EPhoneUIView, 
+        "CPhoneAudioPlayer::Play - iFormat(%d), iPlayerStatus(%d)",
+        iFormat, 
+        iPlayerStatus );
+    __PHONELOG3( 
+        EBasic, 
+        EPhoneUIView, 
+        "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( EPhoneUIView, "CPhoneAudioPlayer::ReStartPlaying()" );
+    __PHONELOG3( 
+        EBasic, 
+        EPhoneUIView, 
+        "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( EPhoneUIView, "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( EPhoneUIView, "CPhoneAudioPlayer::MapcInitComplete()" );
+    __PHONELOG1( EBasic, EPhoneUIView, "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( EPhoneUIView, "CPhoneAudioPlayer::MapcPlayComplete()" );
+    __PHONELOG2( EBasic, EPhoneUIView, "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( EPhoneUIView, "CPhoneAudioPlayer::MatoPrepareComplete()" );
+    __PHONELOG1( EBasic, EPhoneUIView, "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( EPhoneUIView, "CPhoneAudioPlayer::MatoPlayComplete()" );
+    __PHONELOG1( EBasic, EPhoneUIView, "CPhoneAudioPlayer::MatoPlayComplete - aError(%d)",
+        aError );
+    if ( aError != KErrNone )
+        {
+        iObserver.HandleAudioPlayerError( 
+            MPhoneAudioPlayerObserver::EAudioPlayerPlayingFailure, 
+            aError, iId );
+        }
+    else
+        {
+        iObserver.HandlePlayingComplete( iId );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::DoPlay
+// -----------------------------------------------------------------------------
+//
+void CPhoneAudioPlayer::DoPlay()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "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, EPhoneUIView, "CPhoneAudioPlayer::DoPlay c aud ");
+                 TRAP (err, iAudioOutput = CAudioOutput::NewL( *iSamplePlayer ) );
+                if ( err )
+                    {
+                    __PHONELOG1(EBasic, EPhoneUIView, 
+                        "P.AudPlayer.DoPlay.iAudioOutput.err ", err );
+                    }                      	        
+               }
+            if ( !err && iAudioOutput )
+                 {
+                 __PHONELOG( EBasic, EPhoneUIView, "CPhoneAudioPlayer::DoPlay EALL ");
+                 TRAP (err, iAudioOutput->SetAudioOutputL( CAudioOutput::EAll ) );
+                 if ( err )
+                     {
+                     __PHONELOG1( EBasic, EPhoneUIView, 
+                         "P.AudPlayer.DoPlay.SetAudioOutputL.err ", err );   
+                     }
+
+                 }
+            iSamplePlayer->Play();
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::SetRingingTypeProperties
+// -----------------------------------------------------------------------------
+//
+void CPhoneAudioPlayer::SetRingingTypeProperties()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneAudioPlayer::SetRingingTypeProperties()" );
+    __PHONELOG2( EBasic, EPhoneUIView, "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, 
+                        EPhoneUIView, 
+                        "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, 
+                        EPhoneUIView, 
+                        "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, 
+                    EPhoneUIView, 
+                    "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, 
+                        EPhoneUIView, 
+                        "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, 
+                        EPhoneUIView, 
+                        "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, 
+            EPhoneUIView, 
+            "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, 
+                    EPhoneUIView, 
+                    "CPhoneAudioPlayer::SetRingingTypeProperties - TTS, Set volume(%d)",
+                    iVolume );
+                break;
+            
+            default:
+                __ASSERT_DEBUG( EFalse, 
+                        Panic( EPhoneViewCaseNotHandled ) );
+            }
+        __PHONELOG( 
+            EBasic, 
+            EPhoneUIView, 
+            "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, 
+                        EPhoneUIView, 
+                        "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, 
+                        EPhoneUIView, 
+                        "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, 
+                    EPhoneUIView, 
+                    "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, 
+                        EPhoneUIView, 
+                        "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, 
+                        EPhoneUIView, 
+                        "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, 
+            EPhoneUIView, 
+            "CPhoneAudioPlayer::SetRingingTypeProperties - Sample" );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::SetNewVolumeAndRamptime
+// -----------------------------------------------------------------------------
+//    
+void CPhoneAudioPlayer::SetNewVolumeAndRamptime( TInt aVolume, TInt aRamptime )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneAudioPlayer::SetNewVolumeAndRamptime()" );
+   
+    //Check that volume is in valid range.
+   TInt volume = aVolume<1 ? 1:aVolume;
+    __PHONELOG1( EBasic, EPhoneUIView, "CPhoneAudioPlayer::SetNewVolumeAndRamptime - aVolume(%d)",
+        aVolume ); 
+            
+    if ( iFormat == EFormatTone && iTonePlayer )
+        {
+        iTonePlayer->SetVolumeRamp(TTimeIntervalMicroSeconds( aRamptime ) );
+        iTonePlayer->SetVolume( ConvertVolume( volume ) );
+        __PHONELOG( EBasic, EPhoneUIView, "CPhoneAudioPlayer::SetNewVolumeAndRamptime - Tone player" );
+        }
+    else if ( iFormat == EFormatTts && iTtsPlayer )
+        {
+        iTtsPlayer->SetVolumeRamp(TTimeIntervalMicroSeconds( aRamptime ) );
+        iTtsPlayer->SetVolume( ConvertVolume( volume ) );
+        __PHONELOG( EBasic, EPhoneUIView, "CPhoneAudioPlayer::SetNewVolumeAndRamptime - TTS player" );
+        }
+    else 
+        {
+        iSamplePlayer->SetVolumeRamp(TTimeIntervalMicroSeconds( aRamptime ) );
+        iSamplePlayer->SetVolume( ConvertVolume( volume ) );
+        __PHONELOG( EBasic, EPhoneUIView, "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/phoneuiview/src/cphonebubblemapping.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,379 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneBubbleMapping class.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "cphonebubblemapping.h"
+#include    "pevirtualengine.h"
+#include    "phoneui.pan"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleMapping::CPhoneBubbleMapping
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneBubbleMapping::CPhoneBubbleMapping()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleMapping::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleMapping::ConstructL( TInt aMaximumAmount )
+    {
+    iMappingReserve = aMaximumAmount;
+    iMapping = new ( ELeave ) CMappingArray( aMaximumAmount );
+    iMapping->SetReserveL( aMaximumAmount );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleMapping::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPhoneBubbleMapping* CPhoneBubbleMapping::NewL(
+    TInt aMaximumAmount )
+    {
+    CPhoneBubbleMapping* self = 
+        new ( ELeave ) CPhoneBubbleMapping;
+    
+    CleanupStack::PushL( self );
+    self->ConstructL( aMaximumAmount );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+CPhoneBubbleMapping::~CPhoneBubbleMapping()
+    {
+    delete iMapping;
+    }
+
+// ---------------------------------------------------------
+// CPhoneBubbleMapping::FindBubbleByCall
+// ---------------------------------------------------------
+//
+TBool CPhoneBubbleMapping::FindBubbleByCall( 
+    TInt aCallId,
+    CBubbleManager::TBubbleId& aId ) const
+    {
+    const TInt count = iMapping->Count();
+    TInt index;
+    TBool result = EFalse;
+
+    for ( index = 0; index < count; index++ )
+        {
+        TMappingItem& item = iMapping->At( index );
+
+        if ( aCallId == item.iCallId )
+            {    
+            result = ETrue;
+            aId = item.iBubbleId;
+            break;
+            }
+
+        }
+
+    return result;
+    }
+
+// ---------------------------------------------------------
+// CPhoneBubbleMapping::FindCallByBubble
+// ---------------------------------------------------------
+//       
+TBool CPhoneBubbleMapping::FindCallByBubble(
+    CBubbleManager::TBubbleId aId,
+    TInt& aCallId ) const
+    {
+    const TInt count = iMapping->Count();
+    TInt index;
+    TBool result = EFalse;
+
+    for ( index = 0; index < count; index++ )
+        {
+        TMappingItem& item = iMapping->At( index );
+
+        if ( aId == item.iBubbleId )
+            {    
+            result = ETrue;
+            aCallId = item.iCallId;
+            break;
+            }
+        }
+
+    return result;
+    }
+
+// ---------------------------------------------------------
+// CPhoneBubbleMapping::FindThumbnailByCall
+// ---------------------------------------------------------
+//       
+const CFbsBitmap* CPhoneBubbleMapping::FindThumbnailByCall( 
+    TInt aCallId ) const
+    {
+    TInt index;
+    const CFbsBitmap* thumbnail = NULL;
+
+    if ( FindIndexByCall( aCallId, index ) )
+        {
+        thumbnail = ThumbnailAt( index );
+        }
+
+    return thumbnail;
+    }
+
+// ---------------------------------------------------------
+// CPhoneBubbleMapping::AddToMappingL
+// ---------------------------------------------------------
+//       
+void CPhoneBubbleMapping::AddToMappingL( 
+    CBubbleManager::TBubbleId aId, 
+    TInt aCallId,
+    CBubbleManager::TPhoneCallState aCallState,
+    CFbsBitmap* aThumbnail )
+    {
+    CBubbleManager::TBubbleId bubbleId;
+
+    if ( !FindBubbleByCall( aCallId, bubbleId ) )
+        {
+        TMappingItem item;
+        item.iBubbleId = aId;
+        item.iCallId = aCallId;
+        item.iThumbnail = aThumbnail;
+        item.iCallState = aCallState;
+
+        if ( iMapping->Count() < iMappingReserve )
+            {
+            iMapping->AppendL( item ); // Doesn't leave.
+            return;
+            }
+        }
+    Panic( EPhoneViewInvariant );
+    }
+
+// ---------------------------------------------------------
+// CPhoneBubbleMapping::RemoveFromMapping
+// ---------------------------------------------------------
+//       
+void CPhoneBubbleMapping::RemoveFromMapping( 
+    TInt aCallId )
+    {
+    const TInt count = iMapping->Count();
+    TInt index;
+
+    for ( index = 0; index < count; index++ )
+        {
+        TMappingItem& item = iMapping->At( index );
+
+        if ( aCallId == item.iCallId )
+            {
+            iMapping->Delete( index );
+            iMapping->Compress();
+            return;
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneBubbleMapping::ItemCount
+// ---------------------------------------------------------
+//       
+TInt CPhoneBubbleMapping::ItemCount() const
+    {
+    return iMapping->Count();
+    }
+
+// ---------------------------------------------------------
+// CPhoneBubbleMapping::BubbleAt
+// ---------------------------------------------------------
+//       
+CBubbleManager::TBubbleId CPhoneBubbleMapping::BubbleAt( 
+    TInt aIndex ) const
+    {
+    __ASSERT_ALWAYS( aIndex >= 0 && aIndex < iMapping->Count(), 
+        Panic( EPhoneViewIndexOutOfBounds ) );
+    return iMapping->At( aIndex ).iBubbleId;
+    }
+
+// ---------------------------------------------------------
+// CPhoneBubbleMapping::CallAt
+// ---------------------------------------------------------
+//              
+TInt CPhoneBubbleMapping::CallIdAt( 
+    TInt aIndex ) const
+    {
+    __ASSERT_ALWAYS( aIndex >= 0 && aIndex < iMapping->Count(), 
+        Panic( EPhoneViewIndexOutOfBounds ) );
+    return iMapping->At( aIndex ).iCallId;
+    }
+
+// ---------------------------------------------------------
+// CPhoneBubbleMapping::ThumbnailAt
+// ---------------------------------------------------------
+//              
+const CFbsBitmap* CPhoneBubbleMapping::ThumbnailAt( 
+    TInt aIndex )  const
+    {
+    __ASSERT_ALWAYS( aIndex >= 0 && aIndex < iMapping->Count(), 
+        Panic( EPhoneViewIndexOutOfBounds ) );
+    return iMapping->At( aIndex ).iThumbnail;
+    }
+
+// ---------------------------------------------------------
+// CPhoneBubbleMapping::SetThumbnailAt
+// ---------------------------------------------------------
+//              
+void CPhoneBubbleMapping::SetThumbnailAt( 
+    TInt aIndex, 
+    CFbsBitmap* aThumbnail )  
+    {
+    __ASSERT_ALWAYS( aIndex >= 0 && aIndex < iMapping->Count(), 
+        Panic( EPhoneViewIndexOutOfBounds ) );
+        
+    TMappingItem& item = iMapping->At( aIndex );
+    item.iThumbnail = aThumbnail;
+    }
+    
+// ---------------------------------------------------------
+// CPhoneBubbleMapping::SetThumbnailByCall
+// ---------------------------------------------------------
+//              
+void CPhoneBubbleMapping::SetThumbnailByCall( 
+    TInt aCallId,
+    CFbsBitmap* aThumbnail ) 
+    {
+    TInt index;
+
+    // if a matching bubble is found
+    if ( FindIndexByCall( aCallId, index ) )
+        {
+        SetThumbnailAt( index, aThumbnail );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneBubbleMapping::CallStateAt
+// ---------------------------------------------------------
+//              
+CBubbleManager::TPhoneCallState CPhoneBubbleMapping::CallStateAt( 
+    TInt aIndex )  const
+    {
+    __ASSERT_ALWAYS( aIndex >= 0 && aIndex < iMapping->Count(), 
+        Panic( EPhoneViewIndexOutOfBounds ) );
+    return iMapping->At( aIndex ).iCallState;
+    }
+    
+// ---------------------------------------------------------
+// CPhoneBubbleMapping::SetCallStateAt
+// ---------------------------------------------------------
+//              
+void CPhoneBubbleMapping::SetCallStateAt( 
+    TInt aIndex, 
+    CBubbleManager::TPhoneCallState aCallState )  
+    {
+    __ASSERT_ALWAYS( aIndex >= 0 && aIndex < iMapping->Count(), 
+        Panic( EPhoneViewIndexOutOfBounds ) );
+    TMappingItem& item = iMapping->At( aIndex );
+    item.iCallState = aCallState;
+    }
+
+// ---------------------------------------------------------
+// CPhoneBubbleMapping::SetCallStateByCall
+// ---------------------------------------------------------
+//              
+void CPhoneBubbleMapping::SetCallStateByCall( 
+    TInt aCallId,
+    CBubbleManager::TPhoneCallState aCallState ) 
+    {
+    TInt index;
+
+    // if a matching bubble is found
+    if ( FindIndexByCall( aCallId, index ) )
+        {
+        SetCallStateAt( index, aCallState );
+        }
+    }
+    
+// ---------------------------------------------------------
+// CPhoneBubbleMapping::FindCallStateByCall
+// ---------------------------------------------------------
+//       
+CBubbleManager::TPhoneCallState CPhoneBubbleMapping::FindCallStateByCall( 
+    TInt aCallId ) const
+    {
+    TInt index;
+    CBubbleManager::TPhoneCallState callState = CBubbleManager::ENone;
+
+    if ( FindIndexByCall( aCallId, index ) )
+        {
+        callState = CallStateAt( index );
+        }
+
+    return callState;
+    }
+    
+// ---------------------------------------------------------
+// CPhoneBubbleMapping::FindCallIdByCallState
+// ---------------------------------------------------------
+//
+TInt CPhoneBubbleMapping::FindCallIdByCallState (
+    CBubbleManager::TPhoneCallState aCallState ) 
+    {
+    const TInt count = iMapping->Count();
+    TInt index;
+
+    for ( index = 0; index < count; index++ )
+        {
+        if ( CallStateAt( index ) == aCallState )
+            {
+            return CallIdAt( index );
+            }
+        }
+    return KErrNotFound; // Not found CallId by this callState
+    }
+
+// ---------------------------------------------------------
+// CPhoneBubbleMapping::FindIndexByCall
+// ---------------------------------------------------------
+//              
+TBool CPhoneBubbleMapping::FindIndexByCall( 
+    TInt aCallId,
+    TInt& aIndex ) const
+    {
+    TBool result = EFalse;
+
+    for ( aIndex = 0; aIndex < iMapping->Count(); aIndex ++ )
+        {
+        TMappingItem& item = iMapping->At( aIndex );
+
+        if ( aCallId == item.iCallId )
+            {
+            // Horray, we found it
+            result = ETrue;
+            break;
+            }
+        }    
+
+    return result;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonebubblewrapper.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,2506 @@
+/*
+* 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 CPhoneBubbleWrapper class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <AknPhoneNumberEditor.h>
+#include <featmgr.h>
+#include <StringLoader.h>
+#include <telephonyvariant.hrh>
+#include <eikspane.h>
+#include <layoutmetadata.cdl.h>
+#include <bautils.h>
+#include <bmtouchpaneinterface.h>
+#include <AknUtils.h>
+#include <spsettings.h>
+#include <spproperty.h>
+
+#include "cphonebubblewrapper.h"
+#include "cphonebubblemapping.h"
+#include "tphonecommandparam.h"
+#include "cphonecallheadertextanimation.h"
+#include "cphonemainresourceresolver.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamstring.h"
+#include "tphonecmdparamkeyevent.h"
+#include "tphonecmdparamdynmenu.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "tphonecmdparamemergencycallheaderdata.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "tphonecmdparamincallindicatordata.h"
+#include "cphonestatuspane.h"
+#include "phoneconstants.h"
+#include "phonerssbase.h"
+#include "cphonecenrepproxy.h"
+#include "phonelogger.h"
+#include "mphonevideoplayerobserver.h"
+#include "mphoneviewcommandhandle.h"
+#include "phoneui.pan"
+#include "mnumberentry.h"
+#include "mphonenumberentry.h"
+#include "cphonenumberentry.h"
+#include "phonebubbleextensionmanager.h"
+
+#include "mphonecustomization.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::CPhoneBubbleWrapper
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneBubbleWrapper::CPhoneBubbleWrapper( ) :
+    iNumberEntryVisible( EFalse ),
+    iConference( EFalse ),
+    iCipheringIndicatorAllowed( ETrue ),
+    iFlags ( 0 ),
+    iVideoCallAnimationHeader( NULL ),
+    iCallImageTextSupported ( EFalse ),
+    iVideoPlayerObserver ( NULL ),
+    iDialerNumberEntry ( NULL ),
+    iUseDialer ( EFalse ),
+    iIsNumberEntryModeNumeric( ETrue )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::ConstructL(
+    CCoeControl* aControl,
+    const TRect& aRect )
+    {
+    TPoint position ( 0, 0 );
+
+    // Construct bubble manager
+    iBubbleManager = CBubbleManager::NewL(
+        *aControl,
+        aRect,
+        ETrue  );
+    iBubbleManager->SetPosition( position );
+
+    CCoeControl* bubbleNe = iBubbleManager->GetNumberEntry()->Parent();
+    //cannot set bubblewrapper as an observer straight to CAknPhoneNumberEditor
+    //because BMBubbleOutlookNE will not receive control events then.
+    bubbleNe->SetObserver( this );
+    
+    // Construct extension manager
+    iBubbleExtensionManager = CPhoneBubbleExtensionManager::NewL(
+           *iBubbleManager );
+
+    iPhoneNumberEntry = CPhoneNumberEntry::NewL( *iBubbleManager );
+
+    // Construct bubble mapping
+    iMapping = CPhoneBubbleMapping::NewL( KMaxNumberOfCallerBubbles );
+
+    if( FeatureManager::FeatureSupported( KFeatureIdCallImagetext ) )
+	    {
+	    iCallTheme = CPhoneCallThemeMonitor::NewL();
+	    iCallImageTextSupported = ETrue;
+	    iBubbleManager->PreloadCallThemeImage(
+	            iCallTheme->CallImageThemeSettings() == 2  );
+	    iCallTheme->SetCallThemeSettingsObserver( this );
+	    }
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) )
+        {
+        iUseDialer = ETrue;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPhoneBubbleWrapper* CPhoneBubbleWrapper::NewL(
+    CCoeControl* aControl,
+    const TRect& aRect )
+    {
+    CPhoneBubbleWrapper* self = new( ELeave ) CPhoneBubbleWrapper( );
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aControl, aRect );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// Destructor
+CPhoneBubbleWrapper::~CPhoneBubbleWrapper()
+    {
+    delete iBubbleExtensionManager;
+    delete iPhoneNumberEntry;
+    delete iMapping;
+    delete iBubbleManager;
+    delete iVideoCallAnimationHeader;
+    if( iParticipants )
+	    {
+	    iParticipants->Reset();
+    	delete iParticipants;
+	    }
+	delete iCallTheme;
+
+	iVideoPlayerObserver = NULL;
+	iDialerNumberEntry = NULL;
+	
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper.::RemoveCallHeaderL
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::RemoveCallHeaderL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::RemoveCallHeader");
+    CBubbleManager::TBubbleId bubble;
+
+    if ( iMapping->FindBubbleByCall( aCallId, bubble ) )
+        {
+        iBubbleManager->StartChanges();
+
+		if( aCallId == KVideoTelephonyCallId1 ||
+			aCallId == KVideoTelephonyCallId2 )
+    		{
+    		CPhoneCallHeaderTextAnimation::InstanceL()->RemoveAnimatingVideoCallHeader();
+    		delete iVideoCallAnimationHeader;
+    		iVideoCallAnimationHeader = NULL;
+    		}
+
+        // remove the bubble
+		iBubbleExtensionManager->StopCall( bubble );
+        iBubbleManager->RemoveCallHeader( bubble );
+        iBubbleManager->EndChanges();
+        iMapping->RemoveFromMapping( aCallId );
+
+        __PHONELOG1(
+            EBasic,
+            EPhoneUIView,
+            "CPhoneBubbleWrapper::RemoveCallHeader ShownHeaderCount = %d",
+            iBubbleManager->ShownHeaderCount() );
+
+		if (!FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) &&
+		    iConference && ( iBubbleManager->ShownHeaderCount() == 1 ) )
+            {
+            SetConferenceExpand( ETrue );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper.::CreateCallHeaderL
+// -----------------------------------------------------------------------------
+//
+CBubbleManager::TBubbleId CPhoneBubbleWrapper::CreateCallHeaderL(
+    TInt aCallId,
+    TPhoneCommandParam *aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::CreateCallHeader");
+    CBubbleManager::TBubbleId bubble;
+
+    if ( iMapping->FindBubbleByCall( aCallId, bubble ) )
+        {
+        // Invalid - don't create a bubble
+        return bubble;
+        }
+
+    TPhoneCmdParamCallHeaderData* callHeaderParam =
+        static_cast<TPhoneCmdParamCallHeaderData*>( aCommandParam );
+
+    iCipheringIndicatorAllowed = callHeaderParam->CipheringIndicatorAllowed();
+
+    iBubbleManager->StartChanges();
+    // Create call header
+    bubble = iBubbleManager->CreateCallHeader();
+    iMapping->AddToMappingL( bubble, aCallId, CBubbleManager::ENone, NULL );
+
+    if ( iConference )
+	    {
+	    SetConferenceExpand( EFalse );
+	    }
+
+    // Set call state
+    PrepareCallStateL(
+        aCallId,
+        callHeaderParam->CallState(),
+        callHeaderParam->LabelText(),
+        callHeaderParam->ShortLabelText() );
+
+    // Set call flag ( EDivert... )    
+    iBubbleManager->SetCallFlags( 
+        bubble, 
+        callHeaderParam->CallFlag() );
+
+	 __PHONELOG1(
+	    EBasic,
+	    EPhoneUIView,
+	    "CPhoneBubbleWrapper::CreateCallHeader callHeaderParam->CLIText = %S",
+	    &callHeaderParam->CLIText() );
+
+    // Set CLI text
+    iBubbleManager->SetCLI(
+        bubble,
+        callHeaderParam->CLIText(),
+        callHeaderParam->CLITextClippingDirection() );
+    
+    // Set CNAP text if applicable
+    iBubbleManager->SetCNAP( 
+            bubble, 
+            callHeaderParam->CNAPText(), 
+            callHeaderParam->CNAPTextClippingDirection() );
+    
+    // Set CLI type to be used in conference call participant list
+    CBubbleManager::TBubbleParticipantListCLI partipantCli =
+        ( callHeaderParam->ParticipantCLI() ==
+          TPhoneCmdParamCallHeaderData::EPhoneParticipantCNAPText ) ?
+        CBubbleManager::EParticipantListCNAP :
+        CBubbleManager::EParticipantListCLIText;
+    iBubbleManager->SetParticipantListCLI( bubble, partipantCli );
+
+    // Set ciphering indicator
+    iBubbleManager->SetCallFlag(
+        bubble,
+        CBubbleManager::ENoCiphering,
+        iCipheringIndicatorAllowed &&
+        !callHeaderParam->Ciphering() );
+
+	 __PHONELOG1(
+	    EBasic,
+	    EPhoneUIView,
+	    "CPhoneBubbleWrapper::CreateCallHeader Line2() = %d",
+	    callHeaderParam->Line2() );
+
+    // Set line2 indicator
+    iBubbleManager->SetCallFlag(
+        bubble,
+        CBubbleManager::ELine2,
+        callHeaderParam->Line2() );
+
+    // Set number type indicator
+    SetNumberTypeIndicator( bubble, static_cast<TPEPhoneNumberIdType>(
+        callHeaderParam->NumberType() ) );
+
+    if ( !iCallImageTextSupported )
+		{
+        if( callHeaderParam->Thumbnail() )
+            {
+            // Thumbnail
+            iBubbleManager->SetThumbnail( bubble, callHeaderParam->Thumbnail(), NULL );
+            }
+		}
+    else  // call object display
+        {
+        if ( callHeaderParam->CallerText().Length() )
+            {
+            __PHONELOG(
+                EBasic,
+                EPhoneUIView,
+                "CPhoneBubbleWrapper::CreateCallHeaderL()-> Set 1.Call text");
+            // 1. Call text
+            iBubbleManager->SetCallObjectText( bubble, callHeaderParam->CallerText() );
+            }
+        else if( callHeaderParam->Picture().Length() )
+            {
+            __PHONELOG(
+                EBasic,
+                EPhoneUIView,
+                "CPhoneBubbleWrapper::CreateCallHeaderL()-> Set 2. Call image");
+            // 2. Call image
+            iBubbleManager->SetCallObjectImage( bubble, callHeaderParam->Picture() );
+            }
+        else if( callHeaderParam->HasThumbnail() )
+            {
+            __PHONELOG(
+                EBasic,
+                EPhoneUIView,
+                "CPhoneBubbleWrapper::CreateCallHeaderL()-> Set 3. Thumbnail");
+            // 3. Thumbnail
+            if ( callHeaderParam->Thumbnail() )
+                {
+                iBubbleManager->SetCallObjectImage( bubble, callHeaderParam->Thumbnail(), NULL );
+                }
+            }
+        else if ( iCallTheme->CallImageThemeSettings() == 2 )
+            {
+            __PHONELOG(
+                EBasic,
+                EPhoneUIView,
+                "CPhoneBubbleWrapper::CreateCallHeaderL()-> Set 4. Theme image");
+            // 4. Theme image
+            iBubbleManager->SetCallObjectFromTheme( bubble );
+            }
+        else if ( iCallTheme->CallImageThemeSettings() == 1 &&
+                  BaflUtils::FileExists( CCoeEnv::Static()->FsSession(),
+                                         iCallTheme->CallImageThemeFilePath() ) )
+            {
+            __PHONELOG(
+                EBasic,
+                EPhoneUIView,
+                "CPhoneBubbleWrapper::CreateCallHeaderL()-> Set 5. User defined theme image");
+            // 5. User defined theme image
+            iBubbleManager->SetCallObjectImage(
+                bubble,
+                iCallTheme->CallImageThemeFilePath() );
+            }
+        else
+            {
+            __PHONELOG(
+                EBasic,
+                EPhoneUIView,
+                "CPhoneBubbleWrapper::CreateCallHeaderL()-> Do nothing ");
+            // do nothing
+            }
+        }
+
+    iBubbleExtensionManager->StartCallL( bubble, callHeaderParam );
+    iBubbleManager->EndChanges();
+
+    return bubble;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper.::StartMOVideoCallAnimationHeaderL
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::StartMOVideoCallAnimationHeaderL(
+	CBubbleManager::TBubbleId aBubbleId,
+	const TDesC& aStateLabelText,
+    const TDesC& aStateShortLabelText)
+	{
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::StartMOVideoCallAnimationHeaderL");
+
+	// We have MO video call - start animating
+	iVideoCallAnimationHeader = CPhoneCallHeaderTextAnimation::InstanceL();
+	iVideoCallAnimationHeader->StartAnimatingVideoCallHeaderL(
+		aBubbleId,
+		aStateLabelText,
+		aStateShortLabelText,
+		*iBubbleManager );
+
+	}
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper.::CreateEmergencyCallHeaderL
+// -----------------------------------------------------------------------------
+//
+CBubbleManager::TBubbleId CPhoneBubbleWrapper::CreateEmergencyCallHeaderL(
+    TInt aCallId,
+    TPhoneCommandParam *aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::CreateEmergencyCallHeader");
+    TPhoneCmdParamEmergencyCallHeaderData* emergencyHeaderParam =
+        static_cast<TPhoneCmdParamEmergencyCallHeaderData*>(
+        aCommandParam );
+
+    iBubbleManager->StartChanges();
+
+    // Create the bubble if necessary
+    CBubbleManager::TBubbleId bubble;
+    if ( !iMapping->FindBubbleByCall( aCallId, bubble ) )
+        {
+        bubble = iBubbleManager->CreateCallHeader();
+        iMapping->AddToMappingL( bubble, aCallId, CBubbleManager::EActive, NULL );
+        }
+
+    iBubbleManager->SetState( bubble, CBubbleManager::EActive );
+
+    // Set the call header title
+    iBubbleManager->SetCLI(
+        bubble,
+        emergencyHeaderParam->HeaderText(),
+        CBubbleManager::ERight );
+
+    // Set ciphering indicator
+    iBubbleManager->SetCallFlag(
+        bubble,
+        CBubbleManager::ENoCiphering,
+        iCipheringIndicatorAllowed &&
+        !emergencyHeaderParam->Ciphering() );
+
+    // Set the call label as the CNAP text
+    SetCNAP( bubble, 
+            emergencyHeaderParam->LabelText(), 
+            CBubbleManager::ELeft );
+
+    // Set own phone number as the label
+    iBubbleManager->SetLabel(
+        bubble,
+        emergencyHeaderParam->OwnPhoneNumberText(),
+        CBubbleManager::ELeft );
+    iBubbleManager->EndChanges();
+
+    return bubble;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper.::UpdateCallHeaderDisplay
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::UpdateCallHeaderDisplay(
+    TInt aCallId,
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::UpdateCallHeaderDisplay");
+    CBubbleManager::TBubbleId bubble;
+
+    if ( iMapping->FindBubbleByCall( aCallId, bubble ) )
+        {
+        TPhoneCmdParamCallHeaderData* callHeaderParam =
+            static_cast<TPhoneCmdParamCallHeaderData*>( aCommandParam );
+
+        iBubbleManager->StartChanges();
+
+        SetCallHeaderParameters( bubble, callHeaderParam );
+
+		if( iVideoCallAnimationHeader )
+			{
+			if( callHeaderParam->CallState() != EPEStateDialing )
+				{
+				iVideoCallAnimationHeader->RemoveAnimatingVideoCallHeader();
+				delete iVideoCallAnimationHeader;
+    		    iVideoCallAnimationHeader = NULL;
+				}
+			}
+        // End changes
+        iBubbleManager->EndChanges();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper.::UpdateCallHeaderAndLabel
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::UpdateCallHeaderAndLabel(
+    TInt aCallId,
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::UpdateCallHeaderAndLabel");
+        CBubbleManager::TBubbleId bubble;
+
+    if ( iMapping->FindBubbleByCall( aCallId, bubble ) )
+        {
+        TPhoneCmdParamCallHeaderData* callHeaderParam =
+            static_cast<TPhoneCmdParamCallHeaderData*>( aCommandParam );
+
+        iBubbleManager->StartChanges();
+
+        SetCallHeaderParameters( bubble, callHeaderParam );
+
+        // Set the call label associated with the state
+        iBubbleManager->SetLabel(
+            bubble,
+            callHeaderParam->LabelText(),
+            CBubbleManager::ERight );
+
+        if( iVideoCallAnimationHeader )
+            {
+            if( callHeaderParam->CallState() != EPEStateDialing )
+                {
+                iVideoCallAnimationHeader->RemoveAnimatingVideoCallHeader();
+                delete iVideoCallAnimationHeader;
+                iVideoCallAnimationHeader = NULL;
+                }
+            }
+
+        // End changes
+        iBubbleManager->EndChanges();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper.::SetCallHeaderParameters
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::SetCallHeaderParameters(
+        TInt aBubble,
+        TPhoneCmdParamCallHeaderData* aCallHeaderParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::SetCallHeaderParameters");
+    __PHONELOG1(
+        EBasic,
+        EPhoneUIView,
+        "CPhoneBubbleWrapper::SetCallHeaderParameters callHeaderParam->CLIText = %S",
+        &aCallHeaderParam->CLIText() );
+
+    // Set CLI text
+    iBubbleManager->SetCLI(
+        aBubble,
+        aCallHeaderParam->CLIText(),
+        aCallHeaderParam->CLITextClippingDirection() );
+
+    // Set CNAP text if applicable
+    iBubbleManager->SetCNAP(
+            aBubble,
+            aCallHeaderParam->CNAPText(),
+            aCallHeaderParam->CNAPTextClippingDirection() );
+
+    iBubbleManager->SetCallFlags( aBubble, aCallHeaderParam->CallFlag() );
+
+    // Set ciphering indicator
+    iBubbleManager->SetCallFlag(
+        aBubble,
+        CBubbleManager::ENoCiphering, 
+        aCallHeaderParam->CipheringIndicatorAllowed() && 
+        !aCallHeaderParam->Ciphering() );
+
+    // Set line2 indicator
+    iBubbleManager->SetCallFlag(
+        aBubble,
+        CBubbleManager::ELine2,
+        aCallHeaderParam->Line2() );
+
+    if ( !iCallImageTextSupported )
+        {
+        if( aCallHeaderParam->Thumbnail() )
+            {
+            __PHONELOG(
+                EBasic,
+                EPhoneUIView,
+                "CPhoneBubbleWrapper::SetCallHeaderParameters()-> Set Thumbnail" );
+            // Thumbnail
+            iBubbleManager->SetThumbnail( aBubble, aCallHeaderParam->Thumbnail(), NULL );
+            }
+        }
+    else  // call object display
+        {
+        if ( aCallHeaderParam->CallerText().Length() )
+            {
+            __PHONELOG(
+                EBasic,
+                EPhoneUIView,
+                "CPhoneBubbleWrapper::SetCallHeaderParameters()-> Set 1.Call text");
+            // 1. Call text
+            iBubbleManager->SetCallObjectText( aBubble, aCallHeaderParam->CallerText() );
+            }
+        else if( aCallHeaderParam->Picture().Length() )
+            {
+            __PHONELOG(
+                EBasic,
+                EPhoneUIView,
+                "CPhoneBubbleWrapper::SetCallHeaderParameters()-> Set 2.Call image");
+            // 2. Call image
+            iBubbleManager->SetCallObjectImage( aBubble, aCallHeaderParam->Picture() );
+            }
+        else if( aCallHeaderParam->HasThumbnail() )
+            {
+            // 3. Thumbnail
+            __PHONELOG(
+                EBasic,
+                EPhoneUIView,
+                "CPhoneBubbleWrapper::SetCallHeaderParameters()-> Set 3.Thumbnail");
+            if ( aCallHeaderParam->Thumbnail() )
+                {
+                iBubbleManager->SetCallObjectImage( aBubble, aCallHeaderParam->Thumbnail(), NULL );
+                }
+            }
+        else
+            {
+            // do nothing
+            __PHONELOG(
+                EBasic,
+                EPhoneUIView,
+                "CPhoneBubbleWrapper::SetCallHeaderParameters()-> Do nothing");
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper.::SetNumberEntryContent
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::SetNumberEntryContent( const TDesC& aContent )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::SetNumberEntryContent");
+    iPhoneNumberEntry->SetNumberEntryContent( aContent );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper.::GetNumberEntryContent
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::GetNumberEntryContent(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::GetNumberEntryContent");
+
+    GetLocalizedNumberEntryContent( aCommandParam );
+
+    TPhoneCmdParamString* entryContent =
+        static_cast<TPhoneCmdParamString*>( aCommandParam );
+
+    __PHONELOG1( EBasic, EPhoneUIView,
+        "CPhoneBubbleWrapper::GetNumberEntryContent(%S)",
+        entryContent->String() );
+
+    AknTextUtils::ConvertDigitsTo( *entryContent->String(), EDigitTypeWestern );
+
+    __PHONELOG1( EBasic, EPhoneUIView,
+        "CPhoneBubbleWrapper::GetNumberEntryContent(%S)",
+        entryContent->String() );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper.::GetNumberEntryContent
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::GetLocalizedNumberEntryContent(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::GetLocalizedNumberEntryContent");
+    TPhoneCmdParamString* entryContent =
+        static_cast<TPhoneCmdParamString*>( aCommandParam );
+
+    // Get the initial number from number entry window
+    if ( iUseDialer )
+        {
+        iDialerNumberEntry->GetTextFromNumberEntry( *entryContent->String() );
+        }
+    else
+        {
+        iBubbleManager->GetTextFromNumberEntry( *entryContent->String() );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper.::CreateNumberEntry
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::CreateNumberEntry()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::CreateNumberEntry");
+
+    iIsNumberEntryModeNumeric = ETrue;
+    if ( iUseDialer )
+        {
+        iDialerNumberEntry->CreateNumberEntry();
+        }
+    else
+        {
+        iBubbleManager->ResetEditorToDefaultValues();
+        if( iPhoneCustomization && 
+            iPhoneCustomization->AllowAlphaNumericMode() )
+            {    
+            iBubbleManager->ChangeEditorMode( ETrue );  
+            }
+        TInt flags = iFlags;
+        flags &= ~EFlagNumberEntryExists;
+
+        flags |= EFlagNumberEntryExists;
+        flags |= EFlagNumberEntryVisible;
+
+        HandleFlagsUpdated( flags );
+        }
+    }
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper.::SetNumberEntryObserver
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::SetNumberEntryObserver( MNumberEntryObserver& aObserver )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::SetNumberEntryObserver");
+
+    if ( iUseDialer )
+        {
+        iDialerNumberEntry->SetNumberEntryObserver( aObserver );
+        }
+
+    }
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper.::SetNumberEntryPromptText
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::SetNumberEntryPromptText( const TDesC& aPromptText )
+    {
+    iPhoneNumberEntry->SetNumberEntryPromptText( aPromptText );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper.::SetNumberEntryVisible
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::SetNumberEntryVisible(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::SetNumberEntryVisible");
+    // Check is the given parameter valid
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* visible =
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+        if ( iUseDialer )
+            {
+            iDialerNumberEntry->SetNumberEntryVisible( visible->Boolean() );
+            }
+        else
+            {
+            TInt flags = iFlags;
+            flags &= ~EFlagNumberEntryVisible;
+            if ( visible->Boolean() )
+                {
+                flags |= EFlagNumberEntryVisible;
+                }
+            HandleFlagsUpdated( flags );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper.::RemoveNumberEntry
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::RemoveNumberEntry()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::RemoveNumberEntry");
+
+    if ( iUseDialer )
+        {
+        iDialerNumberEntry->RemoveNumberEntry( );
+        }
+    else
+        {
+        TInt flags = iFlags;
+        flags &= ~EFlagNumberEntryExists;
+
+        HandleFlagsUpdated( flags );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::GetNumberEntryCount
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::GetNumberEntryCount(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::CountNumberEntryCharacters");
+    TPhoneCmdParamInteger* integerParam = static_cast<TPhoneCmdParamInteger*>(
+        aCommandParam );
+
+    // Return the number of characters in the number entry
+    integerParam->SetInteger( CountNumberEntryCharacters() );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneBubbleWrapper::CountNumberEntryCharacters
+// ---------------------------------------------------------------------------
+//
+TInt CPhoneBubbleWrapper::CountNumberEntryCharacters()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::CountNumberEntryCharacters");
+
+    return iPhoneNumberEntry->CountNumberEntryCharacters();
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneBubbleWrapper::HandleNumberEntryChanged
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::HandleNumberEntryChanged()
+    {
+    iPhoneNumberEntry->HandleNumberEntryChanged();
+
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneBubbleWrapper::HandleNumberEntryCommand
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::SetNumberEntryChangedCallBack( 
+        TPhoneCommandParam* aCommandParam )
+    {
+    iPhoneNumberEntry->SetNumberEntryChangedCallBack( aCommandParam );
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneBubbleWrapper::HandleControlEventL
+//  
+//  This must be non leaving function, because others use it too.
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::HandleControlEventL( CCoeControl* aControl, 
+                                                     TCoeEvent aEventType)
+    {
+    if ( aControl == iBubbleManager->GetNumberEntry()->Parent() 
+         && aEventType == EEventStateChanged )
+        {
+        HandleNumberEntryChanged();
+                
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneBubbleWrapper::IsNumberEntryUsed
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneBubbleWrapper::IsNumberEntryUsed()
+    {
+    return iPhoneNumberEntry->IsNumberEntryUsed();
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneBubbleWrapper::IsNumberEntryVisible
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneBubbleWrapper::IsNumberEntryVisible()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::IsNumberEntryVisible");
+    __PHONELOG1(
+            EBasic,
+            EPhoneUIView,
+            "CPhoneBubbleWrapper::IsNumberEntryVisible() Visible = %d",
+            iNumberEntryVisible );
+
+    if ( iUseDialer )
+        {
+        return iDialerNumberEntry->IsNumberEntryUsed();
+        }
+    else
+        {
+        return iBubbleManager->IsNumberEntryUsed() && iNumberEntryVisible;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneBubbleWrapper::HandleKeyEventL
+// ---------------------------------------------------------------------------
+//
+TKeyResponse CPhoneBubbleWrapper::HandleKeyEventL(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::HandleKeyEventL");
+    TKeyResponse response = EKeyWasNotConsumed;
+
+    CCoeControl* control(NULL);
+    if ( iUseDialer )
+        {
+        control = iDialerNumberEntry->GetNumberEntry();
+        }
+    else
+        {
+        control = iBubbleManager->GetNumberEntry();
+        if ( iPhoneCustomization && control )
+            {
+            iBubbleManager->GetEditorMode();
+            }
+        }
+
+    if ( control )
+        {
+        // Check if the given parameter is valid
+        if ( aCommandParam->ParamId() ==
+            TPhoneCommandParam::EPhoneParamIdKeyEvent )
+            {
+            TPhoneCmdParamKeyEvent* keyEventParam =
+                static_cast<TPhoneCmdParamKeyEvent*>( aCommandParam );
+
+            response = control->OfferKeyEventL(
+                keyEventParam->KeyEvent(), keyEventParam->EventCode() );
+            }
+        }
+
+    return response;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneBubbleWrapper::SetPhoneMuted
+// Show or clear the "Mute" Icon.
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::SetPhoneMuted( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::SetPhoneMuted");
+    // Check if the given parameter is valid
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* booleanParam =
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+        iBubbleManager->StartChanges();
+        iBubbleManager->SetPhoneMuted( booleanParam->Boolean() );
+        iBubbleManager->EndChanges();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneBubbleWrapper::PrepareCallStateL
+// Prepare call bubble state.
+// (other items were commented in a header).
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::PrepareCallStateL(
+    TInt aCallId,
+    TPEState aState,
+    const TDesC& aStateLabelText,
+    const TDesC& aStateShortLabelText )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::PrepareCallState");
+
+    if ( aCallId == KConferenceCallId && !iConference )
+        {
+        return;
+        }
+
+    // JMK: moved these two lines temporarily here
+    iBubbleManager->StartChanges();
+    CBubbleManager::TBubbleId bubble;
+
+    if ( !iMapping->FindBubbleByCall( aCallId, bubble ) )
+        {
+        bubble = iBubbleManager->CreateCallHeader();
+        iMapping->AddToMappingL( bubble, aCallId, CBubbleManager::ENone, NULL );
+        }
+
+    // Set the call label associated with the state
+    iBubbleManager->SetLabel(
+        bubble,
+        aStateLabelText,
+        CBubbleManager::ERight );
+
+
+    if( aState == EPEStateDialing &&
+        ( aCallId == KVideoTelephonyCallId1 ||
+	    aCallId == KVideoTelephonyCallId2 ) )
+		{
+        StartMOVideoCallAnimationHeaderL( bubble,
+                                          aStateLabelText,
+                                          aStateShortLabelText );
+		}
+
+    // Stop video call header animation if no EPEStateDialing state
+	if( iVideoCallAnimationHeader && ( aState != EPEStateDialing ))
+    	{
+    	iVideoCallAnimationHeader->RemoveAnimatingVideoCallHeader();
+    	}
+
+    CBubbleManager::TPhoneCallState callState = GetBubbleState( aState );
+
+    // Set state
+    iBubbleManager->SetState( bubble, callState );
+    iMapping->SetCallStateByCall( aCallId, callState );
+
+    // inform extension plugins
+    iBubbleExtensionManager->UpdateCallState( bubble, aState );
+
+    iBubbleManager->EndChanges();
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneBubbleWrapper::UpdateCallDuration
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::UpdateCallDuration(
+    TInt aCallId,
+    const TDesC& aDurationText )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::UpdateCallDuration");
+    CBubbleManager::TBubbleId bubble;
+
+    if ( iMapping->FindBubbleByCall( aCallId, bubble ) )
+        {
+        iBubbleManager->UpdateCallTime( bubble, aDurationText );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneBubbleWrapper::CreateBubbleL
+// ---------------------------------------------------------------------------
+//
+CBubbleManager::TBubbleId CPhoneBubbleWrapper::CreateBubbleL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::CreateBubble");
+    CBubbleManager::TBubbleId bubble;
+
+    if ( !iMapping->FindBubbleByCall( aCallId, bubble ) )
+        {
+        bubble = iBubbleManager->CreateCallHeader();
+        iMapping->AddToMappingL( bubble, aCallId, CBubbleManager::ENone, NULL );
+        }
+
+    return bubble;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneBubbleWrapper::SetCLI
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::SetCLI(
+    CBubbleManager::TBubbleId aId,
+    const TDesC& aText,
+    CBubbleManager::TPhoneClippingDirection aDirection )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::SetCLI");
+
+    // Start bubble manager changes
+    iBubbleManager->StartChanges();
+
+    iBubbleManager->SetCLI(
+        aId,
+        aText,
+        aDirection );
+
+    // End bubble manager changes
+    iBubbleManager->EndChanges();
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneBubbleWrapper::SetCnap
+// needed because of __SERIES60_PHONE_CNAP
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::SetCNAP(
+    CBubbleManager::TBubbleId aId,
+    const TDesC& aCnapText, 
+    CBubbleManager::TPhoneClippingDirection aDirection )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::SetCNAP");
+
+    iBubbleManager->SetCNAP(
+        aId, 
+        aCnapText, 
+        aDirection );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneBubbleWrapper::SetNumberTypeIndicator
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::SetNumberTypeIndicator(
+    CBubbleManager::TBubbleId aBubbleId,
+    TPEPhoneNumberIdType aNumberType )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::SetNumberTypeIndicator");
+    CBubbleManager::TPhoneNumberType phoneNumberType =
+        CBubbleManager::ENotSet;
+
+    // map the number type to the bubble's number types
+    switch( aNumberType )
+        {
+        case EPEFaxNumber:
+            phoneNumberType = CBubbleManager::EFaxNumber;
+            break;
+
+        case EPEMobileNumber:
+            phoneNumberType = CBubbleManager::EMobile;
+            break;
+
+        case EPEPager:
+            phoneNumberType = CBubbleManager::EPager;
+            break;
+
+        case EPETelephoneNumber:
+            phoneNumberType = CBubbleManager::EPhone;
+            break;
+
+        case EPEAssistantNumber:
+            phoneNumberType = CBubbleManager::EAssistant;
+            break;
+
+        case EPECarNumber:
+            phoneNumberType = CBubbleManager::ECar;
+            break;
+
+        default:
+            break;
+        }
+
+    // signal the bubble manager to update the call type icon
+    iBubbleManager->SetNumberType( aBubbleId, phoneNumberType );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneBubbleWrapper::CreateConferenceL
+// (other items were commented in a header).
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::CreateConferenceL(
+    TInt aCallId,
+    TPhoneCommandParam *aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::CreateConference");
+
+    TPhoneCmdParamCallHeaderData* callHeaderParam =
+            static_cast<TPhoneCmdParamCallHeaderData*>( aCommandParam );
+
+	if( !iParticipants )
+		{
+		// Create participants array if doesn't exist
+	    iParticipants = new ( ELeave ) CParticipantArray(
+	        KConferenceMaxParticipants );
+	    iParticipants->SetReserveL( KConferenceMaxParticipants );
+		}
+
+    // find out call ids for initial conference members
+    TInt firstCallId( KErrNotFound );
+    TInt secondCallId( KErrNotFound );
+    TInt callCount = iMapping->ItemCount();
+
+    // Find bubbles to conference
+    for ( TInt index = 0; index < callCount; index++ )
+        {
+        TInt callId = iMapping->CallIdAt( index );
+        CBubbleManager::TPhoneCallState bubbleState;
+        bubbleState = iMapping->FindCallStateByCall( callId );
+
+
+        if ( firstCallId == KErrNotFound )
+            {
+            TInt callId = iMapping->CallIdAt( index );
+            if( bubbleState == CBubbleManager::EActive ||
+                bubbleState == CBubbleManager::EOnHold )
+                {
+                firstCallId = iMapping->CallIdAt( index );
+                }
+            }
+        else if ( secondCallId == KErrNotFound )
+            {
+            if( bubbleState == CBubbleManager::EActive ||
+                bubbleState == CBubbleManager::EOnHold )
+
+                {
+                secondCallId = iMapping->CallIdAt( index );
+                }
+            }
+        }
+
+    if ( firstCallId != KErrNotFound && secondCallId != KErrNotFound )
+        {
+        // get bubbles which have to connect to conference
+        CBubbleManager::TBubbleId first = CreateBubbleL( firstCallId );
+        CBubbleManager::TBubbleId second = CreateBubbleL( secondCallId );
+
+        iBubbleManager->StartChanges();
+        CBubbleManager::TBubbleId conference =
+            iBubbleManager->CreateConference( first, second );
+        iBubbleManager->SetState( conference, CBubbleManager::EActive );
+        iBubbleManager->SetLabel( conference, KNullDesC );
+        iBubbleManager->SetCallTime( conference, KNullDesC );
+        // Set CLI text
+        iBubbleManager->SetCLI(
+                conference, callHeaderParam->CLIText(), CBubbleManager::ERight );
+
+        // Set ciphering indicator
+        iBubbleManager->SetCallFlag(
+            conference,
+            CBubbleManager::ENoCiphering,
+            callHeaderParam->CipheringIndicatorAllowed() && 
+            !callHeaderParam->Ciphering() );
+
+        // add calls to participant list - conference call itself is not a participant
+        iParticipants->AppendL(firstCallId);
+        iParticipants->AppendL(secondCallId);
+
+        if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ||
+             callCount > KNumberOfActiveCalls )
+            {
+            SetConferenceExpand( EFalse );
+            }
+        else
+            {
+            SetConferenceExpand( ETrue );
+            }
+
+        // add conference to mapping
+        iMapping->AddToMappingL(conference, aCallId, CBubbleManager::EActive, NULL);
+
+        TInt count = iParticipants->Count();
+
+        for ( TInt index = 0; index < count; index++ )
+            {
+            CBubbleManager::TBubbleId bubble =
+                CreateBubbleL( iParticipants->At( index ) );
+            iBubbleManager->SetState( bubble, CBubbleManager::EActive );
+            iBubbleManager->SetLabel( bubble, KNullDesC );
+            iBubbleManager->SetCallTime( bubble, KNullDesC );
+            }
+
+    	// If image/text is enabled and theme image is set, use it
+      	if( iCallImageTextSupported )
+    	  	{
+            if ( iCallTheme->CallImageThemeSettings() == 2 )
+                {
+                // 4. Theme image
+                iBubbleManager->SetCallObjectFromTheme( conference );
+                }
+            else if ( iCallTheme->CallImageThemeSettings() == 1 )
+                {
+                // 5. User defined theme image
+                iBubbleManager->SetCallObjectImage(
+                    conference,
+                    iCallTheme->CallImageThemeFilePath() );
+                }
+    	  	}
+      	
+      	// Read and save internally the simplified conference call header 
+      	// setting for the service where conference is to be created.
+      	SetSimplifiedConferenceCallHeaderStatus( 
+      	    IsSimplifiedConferenceCallHeaderEnabledL( 
+      	        callHeaderParam->ServiceId() ) );
+      	
+        iBubbleManager->EndChanges();
+        iConference = ETrue;
+        }
+    else
+        {
+        __PHONELOG(
+            EBasic,
+            EPhoneUIView,
+            "CPhoneBubbleWrapper::CreateConference -> No valid call bubbles -> Can't Create conference " );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneBubbleWrapper::RemoveConferenceBubbleL
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CPhoneBubbleWrapper::RemoveConferenceBubbleL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::RemoveConferenceBubbleL");
+    iBubbleManager->SetState( CreateBubbleL( KConferenceCallId ), CBubbleManager::EDisconnected );
+    
+    SetConferenceExpand( EFalse );
+    SetConferenceHighlight( EFalse );
+    SetSimplifiedConferenceCallHeaderStatus( EFalse );
+    iBubbleManager->RemoveConference();
+    
+    // remove conference from mapping
+    iMapping->RemoveFromMapping( KConferenceCallId );
+    }
+
+// ---------------------------------------------------------
+// CPhoneBubbleWrapper::RemoveConferenceL
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CPhoneBubbleWrapper::RemoveConferenceL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::RemoveConference");
+
+	if ( iConference )
+		{
+		iBubbleManager->StartChanges();
+
+	    // Set conference bubble state and remove bubble
+	    RemoveConferenceBubbleL();
+
+	    TInt count = iParticipants->Count();
+
+	    // empty participants list
+	    iParticipants->Delete(0, count);
+
+	    iBubbleManager->EndChanges();
+
+	    iConference = EFalse;
+		}
+    }
+// ---------------------------------------------------------
+// CPhoneBubbleWrapper::AddToConferenceL
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CPhoneBubbleWrapper::AddToConferenceL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::AddToConference");
+
+    iBubbleManager->StartChanges();
+
+    CBubbleManager::TBubbleId bubble = CreateBubbleL( aCallId );
+
+    iBubbleManager->AddRowToConference( bubble );
+
+    iBubbleManager->SetState( bubble, CBubbleManager::EActive );
+    iBubbleManager->SetLabel( bubble, KNullDesC );
+    iBubbleManager->SetCallTime( bubble, KNullDesC );
+
+    if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) &&
+         iMapping->FindCallIdByCallState( CBubbleManager::EWaiting ) < 0 &&
+         iMapping->FindCallIdByCallState( CBubbleManager::EOutgoing ) < 0 &&
+         iMapping->FindCallIdByCallState( CBubbleManager::EDisconnected ) < 0 )
+        {
+        SetConferenceExpand( ETrue );
+        }
+
+    iParticipants->AppendL( aCallId );
+
+    iBubbleManager->EndChanges();
+    }
+
+// ---------------------------------------------------------
+// CPhoneBubbleWrapper::RemoveFromConferenceL
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CPhoneBubbleWrapper::RemoveFromConferenceL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::RemoveFromConference");
+    TInt pos = FindParticipantPosition( aCallId );
+
+    if ( pos != KErrNotFound )
+        {
+        iBubbleManager->StartChanges();
+        TInt count = iParticipants->Count();
+        CBubbleManager::TBubbleId bubble = CreateBubbleL( aCallId );
+	    iBubbleManager->RemoveRowFromConference( bubble );
+
+        // If there are enough participants for conference, then
+        // simply remove it from conference.
+        if ( count > KPhoneConferenceInitialSize )
+            {
+            iParticipants->Delete( pos );
+            }
+        else
+        // Otherwise we also have to clear the conference.
+            {
+            RemoveConferenceL();
+            }
+
+	    iBubbleManager->RemoveCallHeader( bubble );
+	    iMapping->RemoveFromMapping( aCallId );
+	    iBubbleManager->EndChanges();
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneBubbleWrapper::FindParticipantPosition
+// ---------------------------------------------------------
+//
+TInt CPhoneBubbleWrapper::FindParticipantPosition(
+    const TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::FindParticipantPosition");
+    TInt result = KErrNotFound;
+
+    TInt index;
+    TInt count = iParticipants->Count();
+
+    for ( index = 0; index < count; index++ )
+        {
+        if ( iParticipants->At( index ) == aCallId )
+            {
+            result = index;
+            break;
+            }
+        }
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::SetConferenceExpand
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::SetConferenceExpand( TBool aStatus )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::SetConferenceExpand");
+    TInt flags = iFlags;
+
+    flags &= ~EFlagConferenceExpanded;
+
+    if ( aStatus )
+        {
+        flags |= EFlagConferenceExpanded;
+        }
+
+    HandleFlagsUpdated( flags );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::SetConferenceHighlight
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::SetConferenceHighlight(TBool aStatus)
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::SetConferenceHighlight");
+    TInt flags = iFlags;
+    flags &= ~EFlagConferenceReqExpanded;
+
+    if ( aStatus )
+        {
+        flags |= EFlagConferenceReqExpanded;
+        }
+
+    HandleFlagsUpdated( flags );
+    }
+
+// ---------------------------------------------------------
+// CPhoneBubbleWrapper::HandleFlagsUpdated
+// ---------------------------------------------------------
+//
+void CPhoneBubbleWrapper::HandleFlagsUpdated(
+    TInt aNewFlags )
+    {
+    // If no changes, then just return.
+    if ( iFlags == aNewFlags )
+        {
+        return;
+        }
+
+    TInt old = iFlags;
+    iFlags = aNewFlags;
+
+    if ( !( iFlags & EFlagNumberEntryExists ) )
+        {
+        // Number entry can't be visible if it doesn't exist.
+        iFlags &= ~EFlagNumberEntryVisible;
+        iNumberEntryVisible = EFalse;
+        }
+
+    iBubbleManager->StartChanges();
+
+    // Check if number entry has been removed.
+    if ( old & ~iFlags & EFlagNumberEntryExists )
+        {
+        iBubbleManager->RemoveNumberEntry();
+        }
+
+    // If conference is required to expanded, then it must be
+    // kept so.
+    if ( iFlags & EFlagConferenceReqExpanded )
+        {
+        // If there has been change, then enable it.
+        if ( !( old & EFlagConferenceReqExpanded) )
+            {
+            iBubbleManager->SetExpandedConferenceCallHeader( ETrue );
+            iBubbleManager->SetSelectionInConference( 1 );
+            iBubbleManager->SetNumberEntryVisible( EFalse );
+            iNumberEntryVisible = EFalse;
+            }
+
+        // We do not have to anything else.
+        iBubbleManager->EndChanges();
+        return;
+        }
+
+    // Now we can consider that there is no highlight.
+    iBubbleManager->SetSelectionInConference( 0 );
+
+    // Number entry exists now.
+    if ( iFlags & EFlagNumberEntryExists )
+        {
+        // If there has been change, create number entry.
+        if ( !( old & EFlagNumberEntryExists ) )
+            {
+            iBubbleManager->CreateNumberEntry();
+            iNumberEntryVisible = ETrue;
+            }
+
+        // If number entry exists, then make it visible.
+        iBubbleManager->SetNumberEntryVisible( iFlags & EFlagNumberEntryVisible );
+        iNumberEntryVisible = ( iFlags & EFlagNumberEntryVisible );
+
+        // Shrink conference
+        iBubbleManager->SetExpandedConferenceCallHeader( EFalse );
+        }
+
+    // If conference expanded flag, then expand/shrink conference.
+    if ( iFlags == EFlagConferenceExpanded )
+        {
+        iBubbleManager->SetExpandedConferenceCallHeader( ETrue );
+        }
+    else if ( !( iFlags & EFlagConferenceExpanded ) )
+        {
+        iBubbleManager->SetExpandedConferenceCallHeader( EFalse );
+        }
+    
+    // Simplified conference call header setting overrides 
+    // EFlagConferenceExpanded setting.
+    if ( iFlags & EFlagSimplifiedConferenceCallHeader )
+        {
+        iBubbleManager->SetExpandedConferenceCallHeader( EFalse );
+        }
+    
+    iBubbleManager->EndChanges();
+    }
+
+// ---------------------------------------------------------
+// CPhoneBubbleWrapper::SelectedConfMemberCallIdL
+// ---------------------------------------------------------
+//
+TBool CPhoneBubbleWrapper::SelectedConfMemberCallIdL(
+    TPhoneCommandParam* aCommandParam )
+    {
+    CBubbleManager::TBubbleId selected =
+        iBubbleManager->SelectionIdInConference();
+    TInt callId;
+
+    TBool ok = iMapping->FindCallByBubble( selected, callId );
+
+    TPhoneCmdParamInteger* locationContent =
+        static_cast<TPhoneCmdParamInteger*>( aCommandParam );
+
+    locationContent->SetInteger( callId );
+    return ok;
+    }
+
+// ---------------------------------------------------------
+// CPhoneBubbleWrapper::OpenConferenceList
+// ---------------------------------------------------------
+//
+void CPhoneBubbleWrapper::OpenConferenceList(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::OpenConferenceList");
+    // Check if the given parameter is valid
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* booleanParam =
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+        SetConferenceHighlight( booleanParam->Boolean() );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::MoveHighlightInConference
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::MoveHighlightInConference(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::MoveHighlightInConference");
+    // Check Is selection list Highlight
+    if ( iFlags & EFlagConferenceReqExpanded )
+        {
+        if ( aCommandParam->ParamId() ==
+            TPhoneCommandParam::EPhoneParamIdKeyEvent )
+            {
+            TPhoneCmdParamKeyEvent* keyEventParam =
+                static_cast<TPhoneCmdParamKeyEvent*>( aCommandParam );
+
+            if ( keyEventParam->KeyEvent().iCode == EKeyUpArrow )
+                {
+                iBubbleManager->MoveHighlightOneUpInConference();
+                }
+            else if ( keyEventParam->KeyEvent().iCode == EKeyDownArrow  )
+                {
+                iBubbleManager->MoveHighlightOneDownInConference();
+                }
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::GetCallState
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneBubbleWrapper::GetCallState(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::GetCallState");
+    TPEState callState = EPEStateUnknown;
+
+    CBubbleManager::TPhoneCallState bubbleState = CBubbleManager::ENone;
+    if ( aCommandParam->ParamId() ==
+        TPhoneCommandParam::EPhoneParamIdCallStateData )
+        {
+        TPhoneCmdParamCallStateData* stateParam =
+            static_cast<TPhoneCmdParamCallStateData*>( aCommandParam );
+        bubbleState = iMapping->FindCallStateByCall( stateParam->CallId() );
+        callState = ConvertCallState(  bubbleState );
+        stateParam->SetCallState( callState );
+        }
+    return bubbleState;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::GetCallIdByState
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneBubbleWrapper::GetCallIdByState(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::GetCallIdByState");
+    TInt callId = KErrNotFound;
+
+    if ( aCommandParam->ParamId() ==
+        TPhoneCommandParam::EPhoneParamIdCallStateData )
+        {
+        TPhoneCmdParamCallStateData* stateParam =
+            static_cast<TPhoneCmdParamCallStateData*>( aCommandParam );
+        CBubbleManager::TPhoneCallState callState =
+            GetBubbleState( stateParam->CallState() );
+
+         __PHONELOG1(
+            EBasic,
+            EPhoneUIView,
+            "CPhoneBubbleWrapper::GetCallIdByState iConference = %d",
+            iConference );
+
+        if ( iConference )
+            {
+            if ( iMapping->FindCallStateByCall( KConferenceCallId ) == callState )
+                {
+                callId = KConferenceCallId;
+                }
+            else
+                {
+                callId = iMapping->FindCallIdByCallState( callState );
+
+                // check if this call conference member
+                if ( FindParticipantPosition( callId ) != KErrNotFound )
+                    {
+                    callId = KConferenceCallId;
+                    }
+
+                // Check if not found Incoming that is there waiting
+                if ( ( callId == KErrNotFound ) &&
+                    ( callState == CBubbleManager::EIncoming ) )
+                    {
+                    callId = iMapping->FindCallIdByCallState( CBubbleManager::EWaiting );
+                    }
+                }
+            }
+        else
+            {
+            callId = iMapping->FindCallIdByCallState( callState );
+            // Check if not found Incoming that is there waiting
+            if ( ( callId == KErrNotFound ) &&
+                ( callState == CBubbleManager::EIncoming ) )
+                {
+                callId = iMapping->FindCallIdByCallState(
+                    CBubbleManager::EWaiting );
+                }
+            }
+
+        stateParam->SetCallId( callId );
+        }
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::GetBubbleState
+// -----------------------------------------------------------------------------
+//
+CBubbleManager::TPhoneCallState CPhoneBubbleWrapper::GetBubbleState(
+    TPEState aState )
+    {
+    CBubbleManager::TPhoneCallState callState = CBubbleManager::ENone;
+    switch ( aState )
+        {
+        case EPEStateIdle:
+            callState = CBubbleManager::EDisconnected;
+            break;
+
+        case EPEStateDialing:
+            callState = CBubbleManager::EOutgoing;
+            break;
+
+        case EPEStateRinging:
+            if ( iMapping->ItemCount() > 1 )
+                {
+                callState = CBubbleManager::EWaiting;
+                }
+            else
+                {
+                callState = CBubbleManager::EIncoming;
+                }
+            break;
+
+        case EPEStateConnecting:
+            callState = CBubbleManager::EAlerting;
+            break;
+
+        case EPEStateConnected:
+            callState = CBubbleManager::EActive;
+            break;
+
+        case EPEStateHeld:
+            callState = CBubbleManager::EOnHold;
+            break;
+
+        case EPEStateDisconnecting:
+            callState = CBubbleManager::EDisconnected;
+            break;
+
+        case EPEStateConferenceIdle:
+            callState = CBubbleManager::EDisconnected;
+            break;
+
+        // GSM specific
+        case EPEStateConnectedConference:
+            callState = CBubbleManager::EActive;
+            break;
+
+        case EPEStateHeldConference:
+            callState = CBubbleManager::EOnHold;
+            break;
+
+        case EPEStateUnknown:
+            break;
+
+        default:
+            break;
+        }
+    return callState;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::ConvertCallState
+// -----------------------------------------------------------------------------
+//
+TPEState CPhoneBubbleWrapper::ConvertCallState(
+    CBubbleManager::TPhoneCallState aBubbleState )
+    {
+    TPEState callState = EPEStateUnknown;
+    switch ( aBubbleState )
+        {
+        case CBubbleManager::EOutgoing:
+            callState = EPEStateDialing;
+            break;
+        case CBubbleManager::EWaiting:
+        case CBubbleManager::EIncoming:
+            callState = EPEStateRinging;
+            break;
+        case CBubbleManager::EAlerting:
+            callState = EPEStateConnecting;
+            break;
+        case CBubbleManager::EActive:
+            callState = EPEStateConnected;
+            break;
+        case CBubbleManager::EOnHold:
+            callState = EPEStateHeld;
+            break;
+        case CBubbleManager::EDisconnected:
+            callState = EPEStateDisconnecting;
+            break;
+        default:
+            break;
+        }
+    return callState;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::ConferenceMemberToPrivateL
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::ConferenceMemberToPrivateL(
+        TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::ConferenceMemberToPrivate");
+    TInt pos = FindParticipantPosition( aCallId );
+
+    if ( pos != KErrNotFound )
+        {
+        TInt count = iParticipants->Count();
+
+        // If there are enough participants for conference, then
+        // simply remove it from conference.
+        if ( count > KPhoneConferenceInitialSize )
+            {
+            iParticipants->Delete( pos );
+            SetConferenceHighlight( EFalse );
+            SetConferenceExpand( EFalse );
+            iBubbleManager->StartChanges();
+            CBubbleManager::TBubbleId bubble = CreateBubbleL( aCallId );
+            iBubbleManager->RemoveRowFromConference( bubble );
+            iBubbleManager->EndChanges();
+            }
+        else
+        // Otherwise we also have to clear the conference.
+            {
+            RemoveConferenceL();
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::GetActiveCallsCount
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::GetActiveCallsCount( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::GetActiveCallsCount");
+
+    if ( aCommandParam->ParamId() ==
+        TPhoneCommandParam::EPhoneParamIdInteger )
+        {
+        TPhoneCmdParamInteger* intParam =
+            static_cast<TPhoneCmdParamInteger*>( aCommandParam );
+
+        intParam->SetInteger( CountNumberOfActiveCalls() );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::CountNumberOfActiveCalls
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneBubbleWrapper::CountNumberOfActiveCalls() const
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::CountNumberOfActiveCalls");
+    TInt callCount = iMapping->ItemCount();
+    TInt activeCallCount = 0;
+
+    if ( iConference )
+        {
+        if ( iMapping->FindCallIdByCallState(
+            CBubbleManager::EActive ) != KErrNotFound )
+            {
+            activeCallCount++;
+            }
+        if ( iMapping->FindCallIdByCallState(
+            CBubbleManager::EOnHold ) != KErrNotFound )
+            {
+            activeCallCount++;
+            }
+        if ( iMapping->FindCallIdByCallState(
+            CBubbleManager::EDisconnected ) != KErrNotFound )
+            {
+            activeCallCount++;
+            }
+        }
+    else
+        {
+        CBubbleManager::TPhoneCallState bubbleState = CBubbleManager::ENone;
+        TInt callId ( KErrNotFound );
+
+        for ( TInt index = ( callCount - 1 ); index >= 0; index-- )
+            {
+            callId = iMapping->CallIdAt( index );
+            bubbleState = iMapping->FindCallStateByCall( callId );
+
+            if ( bubbleState == CBubbleManager::EActive ||
+                 bubbleState == CBubbleManager::EOnHold ||
+                 bubbleState == CBubbleManager::EDisconnected )
+                {
+                activeCallCount++;
+                }
+            }
+        }
+    return activeCallCount;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::GetIsConference
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::GetIsConference( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::GetIsConference");
+
+    if( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* booleanValue =
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+        booleanValue->SetBoolean( iConference );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::CallExistsInConference
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::CallExistsInConference(
+    TInt aCallId,
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::CallExistsInConference");
+
+    if( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean*  conferenceDataValue =
+            static_cast<TPhoneCmdParamBoolean*>(
+            aCommandParam );
+        if ( FindParticipantPosition( aCallId ) == KErrNotFound )
+            {
+            conferenceDataValue->SetBoolean( EFalse );
+            }
+        else
+            {
+            conferenceDataValue->SetBoolean( ETrue );
+            }
+        }
+    }
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::RemoveAllCalls
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::RemoveAllCallHeadersL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "RemoveAllCallHeaders::RemoveAllCallHeadersL");
+    if ( iConference )
+        {
+        RemoveConferenceL();
+        }
+    TInt callCount = iMapping->ItemCount();
+
+    // Find bubbles to conference
+    // Delete in reverse order or otherwise mapping gets corrupted in between
+    for ( TInt index = ( callCount - 1 ); index >= 0; index-- )
+        {
+        RemoveCallHeaderL( iMapping->CallIdAt( index ));
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::AddToConferenceL
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::AddToConferenceL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::AddToConference");
+    if ( iConference && !IsMaxMembersInConf() )
+        {
+        TInt callCount = iMapping->ItemCount();
+        TInt index = callCount-1;
+        TInt callId;
+
+        while ( index >= 0 )
+            {
+            callId = iMapping->CallIdAt( index );
+            // Check that call not conference
+            if ( callId != KConferenceCallId &&
+                 iMapping->FindCallStateByCall( callId ) !=
+                        CBubbleManager::EWaiting )
+                {
+                if ( FindParticipantPosition( callId )
+                    == KErrNotFound )
+                    {
+                    AddToConferenceL( callId );
+                    return;
+                    }
+                }
+            index--;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::UpdateCipheringIndicator
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::UpdateCipheringIndicator(
+    TInt aCallId, TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::SetCiphering");
+    
+    TPhoneCmdParamCallHeaderData* callHeaderParam = 
+        static_cast<TPhoneCmdParamCallHeaderData*>( aCommandParam );
+        
+    iCipheringIndicatorAllowed = callHeaderParam->CipheringIndicatorAllowed();
+    
+    TInt callCount( iMapping->ItemCount() );
+    if( callCount > 0 )
+        {
+        iBubbleManager->StartChanges();
+
+        for( TInt i = 0; i < callCount; i++ )
+            {
+// Update ciphering to active bubble
+            CBubbleManager::TBubbleId bubble = iMapping->BubbleAt( i );
+            if ( aCallId == iMapping->CallIdAt( i ) )
+                {
+                iBubbleManager->SetCallFlag( 
+                    bubble, 
+                    CBubbleManager::ENoCiphering,
+                    iCipheringIndicatorAllowed && 
+                    !callHeaderParam->Ciphering() ); 
+                }
+            }
+            
+        iBubbleManager->EndChanges();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::IsMaxMembersInConf
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneBubbleWrapper::IsMaxMembersInConf() const
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::IsMaxMembersInConf");
+    return ( iParticipants->Count() == KConferenceMaxParticipants );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::PlayVideoRingTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::PlayVideoRingTone(
+    const TDesC& aFileName,
+    TPlayMode aPlayMode,
+    TInt aVolumeLevel,
+    TBool aArbitraryScaling,
+    MPhoneVideoPlayerObserver* aObserver )
+    {
+    // store the observer
+    iVideoPlayerObserver = aObserver;
+
+    // convert the play type
+    CBubbleManager::TBubbleVideoPlayMode bmPlayMode;
+    switch ( aPlayMode )
+        {
+        case EPlayOnce:
+            bmPlayMode = CBubbleManager::EPlayOnce;
+            break;
+        case EPlayAscending:
+            bmPlayMode = CBubbleManager::EPlayAscending;
+            break;
+        case EPlayInLoop:
+        default:
+            bmPlayMode = CBubbleManager::EPlayInLoop;
+            break;
+        }
+
+    iBubbleManager->StartChanges();
+    iBubbleManager->SetVideoRingTone( aFileName,
+                                     bmPlayMode,
+                                     aVolumeLevel,
+                                     aArbitraryScaling,
+                                     this );
+    iBubbleManager->EndChanges();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::StopVideoRingTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::StopVideoRingTone()
+    {
+    iBubbleManager->StopVideoRingTone();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::MuteVideoRingTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::MuteVideoRingTone()
+    {
+    iBubbleManager->MuteVideoRingTone();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::CancelVideoRingTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::CancelVideoRingTone()
+    {
+    iBubbleManager->StartChanges();
+    iBubbleManager->CancelVideoRingTone();
+    iBubbleManager->EndChanges();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::HandleBubbleVideoPlaybackEvent
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::HandleBubbleVideoPlaybackEvent(
+    TBubbleVideoPlaybackEvent aEvent )
+    {
+
+    if ( iVideoPlayerObserver )
+        {
+        switch ( aEvent )
+            {
+            case EPlayerInitComplete:
+                iVideoPlayerObserver->HandleVideoPlayerInitComplete();
+                break;
+            case EPlayingComplete:
+                iVideoPlayerObserver->HandleVideoPlayerPlayingComplete();
+                break;
+            default:
+                break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleManager::HandleBubbleVideoPlaybackError
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::HandleBubbleVideoPlaybackError(
+    TBubbleVideoPlaybackError aErrorType, TInt aErrorCode )
+    {
+
+    if ( iVideoPlayerObserver )
+        {
+        switch ( aErrorType )
+            {
+            case EPlayerInitFailure:
+                iVideoPlayerObserver->HandleVideoPlayerError(
+                    MPhoneVideoPlayerObserver::EVideoPlayerInitializingFailure,
+                    aErrorCode );
+                break;
+            case EPlaybackFailure:
+                iVideoPlayerObserver->HandleVideoPlayerError(
+                    MPhoneVideoPlayerObserver::EVideoPlayerPlayingFailure,
+                    aErrorCode );
+                break;
+            default:
+                break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleManager::HandleCommandL
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::HandleCommandL( TInt /*aCommand*/ )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneBubbleWrapper::HandleCommandL");
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::ToggleNumberEntryAlphaNumericMode
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::ToggleNumberEntryAlphaNumericMode(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView,
+        "CPhoneBubbleWrapper::ToggleNumberEntryAlphaNumericMode()" );
+    if( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean*  modeAlpha =
+            static_cast<TPhoneCmdParamBoolean*>(
+            aCommandParam );
+
+        if ( iIsNumberEntryModeNumeric )
+	        {
+	        iIsNumberEntryModeNumeric = EFalse;
+	        if ( IsNumberEntryNumericMode() )
+		        {
+		        if ( !iUseDialer )
+		            {
+		            if ( CountNumberEntryCharacters() == 1 )
+	                    {
+	                    // Number entry contents is cleared as specified in 
+	                    // In-Call Operations, 4.2 Option menu functions.
+	                    iBubbleManager->SetTextToNumberEntry( KNullDesC() );
+	                    }
+		            iBubbleManager->ChangeEditorMode( EFalse );
+		            }
+		        }
+	        }
+        else
+	        {
+	        iIsNumberEntryModeNumeric = ETrue;
+	        if ( !IsNumberEntryNumericMode() )
+		        {
+	             if ( !iUseDialer )
+	                 {
+	                 iBubbleManager->ChangeEditorMode( EFalse );
+	                 }
+		        }		
+	        }
+        modeAlpha->SetBoolean( !iIsNumberEntryModeNumeric );
+        }
+    }
+        
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::OpenVKBL
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::OpenVkbL()
+    {
+    if ( iUseDialer )
+        {
+        iDialerNumberEntry->OpenVkbL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::GetNumberEntryCursorPosition
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::GetNumberEntryCursorPosition(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView,
+        "CPhoneBubbleWrapper::GetNumberEntryCursorPosition()" );
+    if ( aCommandParam->ParamId() ==
+        TPhoneCommandParam::EPhoneParamIdInteger )
+        {
+        TPhoneCmdParamInteger* intParam =
+            static_cast<TPhoneCmdParamInteger*>( aCommandParam );
+
+        CAknPhoneNumberEditor* control(NULL); 
+            
+        if ( iUseDialer )
+            {
+            control = static_cast<CAknPhoneNumberEditor*>
+                ( iDialerNumberEntry->GetNumberEntry() );
+            }
+        else
+            {
+            control = static_cast<CAknPhoneNumberEditor*>
+                ( iBubbleManager->GetNumberEntry() );
+            }
+        intParam->SetInteger( control->CursorPos() );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::SetNumberEntryCursorPositionL
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::SetNumberEntryCursorPositionL(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView,
+        "CPhoneBubbleWrapper::SetNumberEntryCursorPositionL() ");
+    if ( aCommandParam->ParamId() ==
+        TPhoneCommandParam::EPhoneParamIdInteger )
+        {
+        TPhoneCmdParamInteger* intParam =
+            static_cast<TPhoneCmdParamInteger*>( aCommandParam );
+        CAknPhoneNumberEditor* control(NULL);
+            
+        if ( iUseDialer )
+            {    
+            control = static_cast<CAknPhoneNumberEditor*>
+                ( iDialerNumberEntry->GetNumberEntry() );
+            }
+        else
+            {
+            control = static_cast<CAknPhoneNumberEditor*>
+                ( iBubbleManager->GetNumberEntry() );
+            }
+        control->SetCursorPosL( intParam->Integer(), EFalse );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::IsNumberEntryNumericMode
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneBubbleWrapper::IsNumberEntryNumericMode() const
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneBubbleWrapper::IsNumberEntryNumericMode()" );
+    if ( iUseDialer )
+        { 
+        return iDialerNumberEntry->GetEditorMode() == EAknEditorNumericInputMode;
+        }
+    else
+        {
+        return iBubbleManager->GetEditorMode() == EAknEditorNumericInputMode;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::IsNENumericMode()
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneBubbleWrapper::IsNENumericMode() const
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneBubbleWrapper::IsNENumericMode()" );
+    
+    if ( iUseDialer )
+        {
+        return EAknEditorNumericInputMode == 
+            iDialerNumberEntry->GetEditorMode();
+        }
+    else
+        {
+        return iIsNumberEntryModeNumeric;    
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::StartChanges
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::StartChanges()
+    {
+    iBubbleManager->StartChanges();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::EndChanges
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::EndChanges()
+    {
+    iBubbleManager->EndChanges();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleManager::SetTouchPaneVisible
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::SetTouchPaneVisible( TBool aVisible )
+    {
+    iBubbleManager->StartChanges();
+    iBubbleManager->SetTouchPaneVisible( aVisible );
+    iBubbleManager->EndChanges();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::TouchPane
+// -----------------------------------------------------------------------------
+//
+MBubbleTouchPaneInterface& CPhoneBubbleWrapper::TouchPane() const
+    {
+    return *iBubbleManager->TouchPane();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::BubbleManager
+// -----------------------------------------------------------------------------
+//
+CBubbleManager& CPhoneBubbleWrapper::BubbleManager()
+    {
+    return *iBubbleManager;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::BubbleManager
+// -----------------------------------------------------------------------------
+//
+CCoeControl* CPhoneBubbleWrapper::Control()
+    {
+    return iBubbleManager;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::IsConferenceInExpandedMode
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneBubbleWrapper::IsConferenceInExpandedMode() const
+    {
+    return iFlags & EFlagConferenceReqExpanded;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::LoadPlugins
+// Loads the bubble extension plugins.
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::LoadPlugins()
+    {
+    TRAP_IGNORE( iBubbleExtensionManager->InitializeL() );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::SetPhoneCustomization
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::SetPhoneCustomization( 
+        MPhoneCustomization* aCustomization )
+    {
+    iPhoneCustomization = aCustomization;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::SetNumberEntry
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::SetNumberEntry( MNumberEntry* aNumberEntry )
+    {
+    iDialerNumberEntry = aNumberEntry;
+    iPhoneNumberEntry->SetNumberEntry( aNumberEntry );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::CallThemeSettingsChanged
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::CallThemeSettingsChanged()
+    {
+    iBubbleManager->PreloadCallThemeImage(
+            iCallTheme->CallImageThemeSettings() == 2 );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::KeypadAudioEnabled
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::KeypadAudioEnabled()
+    {
+    // Tactile sound feedback must be disabled when keypad volume is 1...5
+    // otherwise DTMF tone and tactile tone is played simultaneously.
+    iPhoneNumberEntry->EnableTactileFeedback( EFalse );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::KeypadAudioDisabled
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::KeypadAudioDisabled()
+    {
+    // Tactile sound feedback can be enabled when keypad volume is 0
+    iPhoneNumberEntry->EnableTactileFeedback( ETrue );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::IsSimplifiedConferenceCallHeaderEnabledL
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneBubbleWrapper::IsSimplifiedConferenceCallHeaderEnabledL( 
+        TUint32 aServiceId ) const
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, 
+        "CPhoneBubbleWrapper::IsSimplifiedConferenceCallHeaderEnabledL" );
+    
+    TBool isSimplifiedBubble = EFalse;
+    
+    CSPSettings* settings = CSPSettings::NewLC();
+    CSPProperty* property = CSPProperty::NewLC();
+    
+    TInt serviceMask = 0;
+    TInt result = settings->FindPropertyL( 
+        aServiceId, EPropertyServiceAttributeMask, *property );
+    if ( KErrNone == result ) 
+        {
+        result = property->GetValue( serviceMask );
+        if ( KErrNone == result ) 
+            {
+            isSimplifiedBubble =
+                ( serviceMask & static_cast<TInt>( ESimplifiedConferenceCallBubble ) );
+            }
+        }
+    
+    CleanupStack::PopAndDestroy( property );
+    CleanupStack::PopAndDestroy( settings );
+    
+    return isSimplifiedBubble; 
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneBubbleWrapper::SetSimplifiedConferenceCallHeaderStatus
+// -----------------------------------------------------------------------------
+//
+void CPhoneBubbleWrapper::SetSimplifiedConferenceCallHeaderStatus( 
+        TBool aOnOff )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, 
+        "CPhoneBubbleWrapper::SetSimplifiedConferenceCallHeaderStatus" );
+    
+    TInt flags = iFlags;
+    flags &= ~EFlagSimplifiedConferenceCallHeader;
+    
+    if ( aOnOff )
+        {
+        flags |= EFlagSimplifiedConferenceCallHeader;
+        }
+    
+    HandleFlagsUpdated( flags );
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonebuttonscontroller.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,944 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 the updating of touch buttons
+*
+*/
+
+
+#include <eikappui.h>
+#include <eikenv.h>
+#include <pevirtualengine.h>
+#include <AknsSkinInstance.h>
+#include <AknsUtils.h>
+#include <AknsConstants.h>
+#include <data_caging_path_literals.hrh>
+#include <phoneui.mbg>
+#include "cphonebuttonscontroller.h"
+#include "phoneui.hrh"
+#include "tphonecommandparam.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+
+_LIT( KPhoneUiScalableIconFile, "Z:phoneui.mif" );
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhoneButtonsController::CPhoneButtonsController(
+    MBubbleTouchPaneInterface& aTouchPane ) : 
+    iTouchPane( aTouchPane )
+    {
+    iTouchPane.SetIconProvider( this );
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhoneButtonsController::ConstructL()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhoneButtonsController* CPhoneButtonsController::NewL(
+    MBubbleTouchPaneInterface& aTouchPane )
+    {
+    CPhoneButtonsController* self = 
+        new (ELeave) CPhoneButtonsController( aTouchPane );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhoneButtonsController::~CPhoneButtonsController()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// SetButtonSet
+// ---------------------------------------------------------------------------
+//
+void CPhoneButtonsController::SetButtonSet(
+    TPhoneCommandParam* aCommandParam )
+    {
+    TPhoneCmdParamInteger* cbaResource = 
+        static_cast<TPhoneCmdParamInteger*>( aCommandParam );
+    TInt resourceId = cbaResource->Integer();
+    
+    iTouchPane.SetButtonSet( resourceId );
+    ReplaceAudioButton();
+    SetButtonDimming();
+    }
+
+
+// ---------------------------------------------------------------------------
+//  SetMuteFlag
+// ---------------------------------------------------------------------------
+//
+void CPhoneButtonsController::SetMuteFlag( 
+    TPhoneCommandParam* aCommandParam )
+    {
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* booleanParam = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+            
+        if ( booleanParam->Boolean() )
+            {
+            iFlags |= EButtonsPhoneMuted;     
+            }
+        else
+            {
+            iFlags &= ~EButtonsPhoneMuted;    
+            }            
+        
+        if ( iFlags & EButtonsPhoneMuted )
+            {
+            iTouchPane.SetButtonState( EPhoneInCallCmdUnmute );    
+            }
+        else
+            {
+            iTouchPane.SetButtonState( EPhoneInCallCmdMute );        
+            }            
+        
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// SetHoldFlag
+// ---------------------------------------------------------------------------
+//
+void CPhoneButtonsController::SetHoldFlag( 
+    TPhoneCommandParam* aCommandParam )
+    {
+    if ( aCommandParam->ParamId() == 
+        TPhoneCommandParam::EPhoneParamIdBoolean )
+        { 
+        TPhoneCmdParamBoolean* booleanParam = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+            
+        if ( booleanParam->Boolean() )
+            {
+            iFlags |= EButtonsCallOnHold;     
+            }
+        else
+            {
+            iFlags &= ~EButtonsCallOnHold;    
+            }            
+        
+        if ( iFlags & EButtonsCallOnHold )
+            {
+            iTouchPane.SetButtonState( EPhoneInCallCmdUnhold );
+            }
+        else
+            {
+            iTouchPane.SetButtonState( EPhoneInCallCmdHold );
+            }            
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// SetIhfFlag
+// ---------------------------------------------------------------------------
+//
+void CPhoneButtonsController::SetIhfFlag(
+    TPhoneCommandParam* aCommandParam )
+    {
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* booleanParam = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+            
+        if ( booleanParam->Boolean() )
+            {
+            iFlags |= EButtonsIhfActive;     
+            }
+        else
+            {
+            iFlags &= ~EButtonsIhfActive;    
+            }            
+         }    
+    }
+ 
+// ---------------------------------------------------------
+// CPhoneButtonsController::SetBTAccFlag
+// ---------------------------------------------------------
+//
+void CPhoneButtonsController::SetBTAccFlag( TPhoneCommandParam* aCommandParam )
+    {
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* booleanParam = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+            
+        if ( booleanParam->Boolean() )
+            {
+            iFlags |= EButtonsBTAcc;     
+            }
+        else
+            {
+            iFlags &= ~EButtonsBTAcc;    
+            }            
+        // Temporary unavailability
+        if ( ( iFlags & EButtonsBTAccAvail ) && !( iFlags & EButtonsBTAcc ) )
+            {
+            iFlags |= EButtonsBTAccTmpUn;     
+            }
+        else
+            {
+            iFlags &= ~EButtonsBTAccTmpUn;  
+            }      
+         }     
+    }
+ 
+ // ---------------------------------------------------------
+// CPhoneButtonsController::SetWiredAccFlag
+// ---------------------------------------------------------
+//
+void CPhoneButtonsController::SetWiredAccFlag( TPhoneCommandParam* aCommandParam )
+    {
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* booleanParam = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+            
+        if ( booleanParam->Boolean() )
+            {
+            iFlags |= EButtonsWiredAcc;     
+            }
+        else
+            {
+            iFlags &= ~EButtonsWiredAcc;    
+            }            
+        }     
+    }
+
+// ---------------------------------------------------------
+// CPhoneButtonsController::SetBTAccAvailableFlag
+// ---------------------------------------------------------
+//
+void CPhoneButtonsController::SetBTAccAvailableFlag( TPhoneCommandParam* aCommandParam )
+    {
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* booleanParam = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+           
+        if ( booleanParam->Boolean() )
+            {
+            iFlags |= EButtonsBTAccAvail;
+            }
+        else
+            {
+            iFlags &= ~EButtonsBTAccAvail;    
+            }
+        
+        // Temporary unavailability        
+        if ( ( iFlags & EButtonsBTAccAvail ) && !( iFlags & EButtonsBTAcc ) )
+            {
+            iFlags |= EButtonsBTAccTmpUn;     
+            }
+        else
+            {
+            iFlags &= ~EButtonsBTAccTmpUn;  
+            }            
+        }
+    }
+// ---------------------------------------------------------------------------
+//  SetVideoCallFlag
+// ---------------------------------------------------------------------------
+//
+void CPhoneButtonsController::SetVideoCallFlag( 
+    TPhoneCommandParam* aCommandParam )
+    {
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* booleanParam = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+            
+        if ( booleanParam->Boolean() )
+            {
+            iFlags |= EButtonsVideoCallOngoing;     
+            }
+        else
+            {
+            iFlags &= ~EButtonsVideoCallOngoing;    
+            }            
+        
+        if ( iFlags & EButtonsVideoCallOngoing )
+            {
+            iTouchPane.SetButtonState( EPhoneInCallCmdSwitchToVoice );
+            iTouchPane.SetButtonDimmed( EPhoneInCallCmdHold, ETrue );    
+            }
+        else
+            {
+            iTouchPane.SetButtonState( EPhoneInCallCmdSwitchToVideo );
+            iTouchPane.SetButtonDimmed( EPhoneInCallCmdHold, EFalse );
+            }            
+        }
+    }
+        
+
+// ---------------------------------------------------------
+// CPhoneButtonsController::SetInCallJoinEnabled
+// ---------------------------------------------------------
+//
+void CPhoneButtonsController::SetInCallJoinEnabled( TPhoneCommandParam* aCommandParam )
+    {
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* booleanParam = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+         if ( booleanParam->Boolean() )
+            {
+            iFlags |= EButtonsDimJoin;     
+            }
+        else
+            {
+            iFlags &= ~EButtonsDimJoin;    
+            }            
+        }
+    SetButtonDimming();     
+    }
+
+// ---------------------------------------------------------
+// SetButtonEnabled
+// ---------------------------------------------------------
+// 
+void CPhoneButtonsController::SetButtonEnabled( 
+    TPhoneCommandParam* aCommandParam )
+    {
+    if ( aCommandParam->ParamId() == 
+        TPhoneCommandParam::EPhoneParamIdInteger )
+        { 
+        TInt commandId =
+            static_cast<TPhoneCmdParamInteger*>( aCommandParam )->Integer();
+            
+        switch ( commandId )
+            {
+            case EPhoneCallComingCmdAnswer:
+                iFlags &= ~EButtonsDimAnswer;    
+                break;
+            case EPhoneInCallCmdPrivate:
+                iFlags &= ~EButtonsDimPrivate;
+                break;
+            case EPhoneCallComingCmdSilent:
+                iFlags &= ~EButtonsDimSilence;
+                break;
+            case EPhoneInCallCmdCreateConference:
+                iFlags &= ~EButtonsDimCreateConference;
+                break;
+            default:
+                break;                
+            }
+
+        SetButtonDimming(); 
+        }    
+    }
+
+// ---------------------------------------------------------
+// SetButtonDisabled
+// ---------------------------------------------------------
+//    
+void CPhoneButtonsController::SetButtonDisabled(
+    TPhoneCommandParam* aCommandParam )
+    {
+    if ( aCommandParam->ParamId() == 
+        TPhoneCommandParam::EPhoneParamIdInteger )
+        { 
+        TInt commandId =
+            static_cast<TPhoneCmdParamInteger*>( aCommandParam )->Integer();
+            
+        switch ( commandId )
+            {
+            case EPhoneCallComingCmdAnswer:
+                iFlags |= EButtonsDimAnswer;    
+                break;
+            case EPhoneInCallCmdPrivate:
+                iFlags |= EButtonsDimPrivate;
+                break;                
+            case EPhoneCallComingCmdSilent:
+                iFlags |= EButtonsDimSilence;
+                break;
+           case EPhoneInCallCmdCreateConference:
+                iFlags |= EButtonsDimCreateConference;
+                break;
+            default:
+                break;                
+            }
+
+        SetButtonDimming(); 
+        }
+    }
+ 
+// ---------------------------------------------------------------------------
+// SetToggleButtons
+// ---------------------------------------------------------------------------
+//
+void CPhoneButtonsController::SetToggleButtons()
+    {
+    TInt buttonCount = iTouchPane.NumberOfButtonsInPane();
+    
+    for ( TInt i=0; i < buttonCount ; i++ )
+        {
+        switch ( iTouchPane.ButtonCommandId( i ) )
+            {
+            case EPhoneInCallCmdMute:
+                {
+                if ( iFlags & EButtonsPhoneMuted )    
+                    {
+                    iTouchPane.SetButtonState( EPhoneInCallCmdUnmute );           
+                    }
+                }
+                break;
+                
+            case EPhoneInCallCmdUnmute:
+                {
+                if ( !( iFlags & EButtonsPhoneMuted ) )   
+                    {
+                    iTouchPane.SetButtonState( EPhoneInCallCmdMute );           
+                    }
+                }
+                break;
+                
+            case EPhoneInCallCmdHold:
+                {
+                if ( iFlags & EButtonsCallOnHold )    
+                    {
+                    iTouchPane.SetButtonState( EPhoneInCallCmdUnhold );           
+                    }    
+                }
+                break;
+                
+            case EPhoneInCallCmdUnhold:
+                {
+                if ( !( iFlags & EButtonsCallOnHold ) )
+                    {
+                    iTouchPane.SetButtonState( EPhoneInCallCmdHold );           
+                    }    
+                }
+                break;
+                
+            case EPhoneInCallCmdActivateIhf:
+                {
+                if ( iFlags & EButtonsIhfActive )
+                    {
+                    iTouchPane.SetButtonState( EPhoneInCallCmdDeactivateIhf );    
+                    }
+                }
+                break;
+                
+            case EPhoneInCallCmdDeactivateIhf:
+                {
+                if ( !( iFlags & EButtonsIhfActive ) )
+                    {
+                    iTouchPane.SetButtonState( EPhoneInCallCmdActivateIhf );    
+                    }
+                }
+                break;
+                
+            case EPhoneInCallCmdHandset:
+                {
+                if ( iFlags & EButtonsBTAccTmpUn )
+                    {
+                    iTouchPane.SetButtonState( EPhoneInCallCmdBtHandsfree );    
+                    }
+                }
+                break;
+            
+            case EPhoneInCallCmdBtHandsfree:
+                {
+                if ( iFlags & EButtonsBTAcc )
+                    {
+                    iTouchPane.SetButtonState( EPhoneInCallCmdHandset );    
+                    }
+                }
+                break;
+                
+            case EPhoneInCallCmdSwitchToVideo:
+                {
+                if ( iFlags & EButtonsVideoCallOngoing )    
+                    {
+                    iTouchPane.SetButtonState( EPhoneInCallCmdSwitchToVoice );           
+                    }
+                }
+                break;    
+                            
+            case EPhoneInCallCmdSwitchToVoice:
+                {
+                if ( !( iFlags & EButtonsVideoCallOngoing ) )   
+                    {
+                    iTouchPane.SetButtonState( EPhoneInCallCmdSwitchToVideo );           
+                    }
+                }
+                break;                         
+                                                            
+            default:
+                break;                                                                                                
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ReplaceAudioButton
+// ---------------------------------------------------------------------------
+//
+void CPhoneButtonsController::ReplaceAudioButton()
+    {
+  
+    TInt buttonCount = iTouchPane.NumberOfButtonsInPane();
+    
+    for ( TInt i=0; i < buttonCount; i++ )    
+        {
+        TInt commandId = iTouchPane.ButtonCommandId( i );
+        
+        if( commandId == EPhoneInCallCmdHandset ||
+            commandId == EPhoneInCallCmdBtHandsfree )
+            {
+            // wired connect
+            if ( iFlags & EButtonsWiredAcc )
+                {
+                // Bt disconnect when wired
+                if ( !( iFlags & EButtonsBTAccTmpUn ) )
+                    {
+                    iTouchPane.ReplaceButton( i, 
+                    CPhoneMainResourceResolver::Instance()->ResolveResourceID( EPhoneAudioDefButton ) );
+                    commandId = iTouchPane.ButtonCommandId( i );
+                    }
+                iTouchPane.SetButtonDimmed( commandId, ETrue);                    
+                }
+            // BTA connect or temporarary unavailable
+            else if ( iFlags & EButtonsBTAcc || iFlags & EButtonsBTAccTmpUn )
+                {
+                iTouchPane.SetButtonDimmed( commandId, EFalse );
+                }
+            else  
+                {
+                iTouchPane.ReplaceButton( i, 
+                    CPhoneMainResourceResolver::Instance()->ResolveResourceID( EPhoneAudioDefButton ) );
+                }
+            }
+         else if ( commandId == EPhoneInCallCmdActivateIhf ||
+                   commandId == EPhoneInCallCmdDeactivateIhf )
+            {
+            // wired connect
+            if ( iFlags & EButtonsWiredAcc )
+                {
+                // Bt connect when wired
+                if ( iFlags & EButtonsBTAccTmpUn )
+                    {
+                    iTouchPane.ReplaceButton( i, 
+                    CPhoneMainResourceResolver::Instance()->ResolveResourceID( EPhoneAudioBTAButton ) );
+                    commandId = iTouchPane.ButtonCommandId( i );
+                    }
+                iTouchPane.SetButtonDimmed( commandId, ETrue);                    
+                }
+            // BTA connect or temporarary unavailable
+            else if ( iFlags & EButtonsBTAcc || iFlags & EButtonsBTAccTmpUn )
+                {
+                iTouchPane.ReplaceButton( i, 
+                    CPhoneMainResourceResolver::Instance()->ResolveResourceID( EPhoneAudioBTAButton ) );
+                }
+            else
+                {
+                iTouchPane.SetButtonDimmed( commandId, EFalse ); 
+                }
+            
+            }
+        }
+    SetToggleButtons();        
+    }
+
+// ---------------------------------------------------------------------------
+// SetButtonDimming
+// ---------------------------------------------------------------------------
+//
+void CPhoneButtonsController::SetButtonDimming()
+    {
+    TInt buttonCount = iTouchPane.NumberOfButtonsInPane();
+    
+    for ( TInt i=0; i < buttonCount; i++ )    
+        {
+        TInt commandId = iTouchPane.ButtonCommandId( i );
+    
+        switch ( commandId )
+            {
+            case EPhoneCallComingCmdAnswer:
+                {
+                if ( iFlags & EButtonsDimAnswer )
+                    {
+                    iTouchPane.SetButtonDimmed( commandId, ETrue );
+                    }
+                else
+                    {
+                    iTouchPane.SetButtonDimmed( commandId, EFalse ); 
+                    }    
+                break;    
+                }                
+            case EPhoneInCallCmdPrivate:
+                {
+                if ( iFlags & EButtonsDimPrivate )
+                    {
+                    iTouchPane.SetButtonDimmed( commandId, ETrue );
+                    }
+                else
+                    {
+                    iTouchPane.SetButtonDimmed( commandId, EFalse ); 
+                    }
+                break;    
+                }
+            case EPhoneInCallCmdJoin:
+                {
+                if ( iFlags & EButtonsDimJoin )
+                    {
+                    iTouchPane.SetButtonDimmed( commandId, ETrue );
+                    }
+                else
+                    {
+                    iTouchPane.SetButtonDimmed( commandId, EFalse ); 
+                    }
+                break;    
+                }
+            case EPhoneInCallCmdHold:
+                {
+                if ( iFlags & EButtonsVideoCallOngoing )
+                    {
+                    iTouchPane.SetButtonDimmed( commandId, ETrue );
+                    }
+                else
+                    {
+                    iTouchPane.SetButtonDimmed( commandId, EFalse ); 
+                    }
+                break;    
+                }
+            case EPhoneCallComingCmdSilent:
+                {
+                if ( iFlags & EButtonsDimSilence )
+                    {
+                    iTouchPane.SetButtonDimmed( commandId, ETrue );
+                    }
+                else
+                    {
+                    iTouchPane.SetButtonDimmed( commandId, EFalse ); 
+                    }
+                break;    
+                }                
+            case EPhoneInCallCmdCreateConference:
+                {
+                if ( iFlags & EButtonsDimCreateConference )
+                    {
+                    iTouchPane.SetButtonDimmed( commandId, ETrue );
+                    }
+                else
+                    {
+                    iTouchPane.SetButtonDimmed( commandId, EFalse ); 
+                    }
+                break;  
+                }
+            default:
+                break;                    
+            } // switch
+        } // for
+
+    if ( iCustomization )
+        {
+        // Customizes touch pane button.
+        iCustomization->CustomizeTouchPaneButtons( iTouchPane );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneButtonsController::SetCustomization
+// -----------------------------------------------------------
+//
+void CPhoneButtonsController::SetCustomization(
+        MPhoneButtonCustomization* aCustomization )
+    {
+    iCustomization = aCustomization;
+    }
+  
+// ---------------------------------------------------------------------------
+// GetIconForCommandL
+// ---------------------------------------------------------------------------
+//
+CGulIcon* CPhoneButtonsController::GetIconForCommandL( TInt aCommandId )
+    {
+    TAknsItemID skinId( KAknsIIDNone );
+    TInt fileIndex( 0 );
+    TInt maskIndex(0);
+    switch ( aCommandId )
+        {
+        case EPhoneInCallCmdMute:
+            {
+            skinId =KAknsIIDQgnIndiButtonMuteMic; 
+            fileIndex = EMbmPhoneuiQgn_indi_button_mute_mic;
+            maskIndex = EMbmPhoneuiQgn_indi_button_mute_mic_mask;                     
+            break;
+            }
+        case EPhoneInCallCmdUnmute:
+            {
+            skinId = KAknsIIDQgnIndiButtonUnmuteMic; 
+            fileIndex = EMbmPhoneuiQgn_indi_button_unmute_mic;
+            maskIndex = EMbmPhoneuiQgn_indi_button_unmute_mic_mask;     
+            break;     
+            }
+        case EPhoneInCallCmdEndAllCalls:
+            {
+            skinId = KAknsIIDQgnIndiButtonEndAllCalls; 
+            fileIndex = EMbmPhoneuiQgn_indi_button_end_all_calls; 
+            maskIndex =  EMbmPhoneuiQgn_indi_button_end_all_calls_mask;   
+            break;           
+            }
+        case EPhoneInCallCmdHold:
+            {
+            skinId = KAknsIIDQgnIndiButtonHold; 
+            fileIndex = EMbmPhoneuiQgn_indi_button_hold; 
+            maskIndex = EMbmPhoneuiQgn_indi_button_hold_mask;               
+            break;            
+            }
+        case EPhoneInCallCmdUnhold:
+            {
+            skinId = KAknsIIDQgnIndiButtonUnhold; 
+            fileIndex = EMbmPhoneuiQgn_indi_button_unhold; 
+            maskIndex = EMbmPhoneuiQgn_indi_button_unhold_mask;                 
+            break;          
+            }
+        case EPhoneInCallCmdActivateIhf:
+            {
+            skinId = KAknsIIDQgnIndiButtonLoudspeaker;
+            fileIndex = EMbmPhoneuiQgn_indi_button_loudspeaker;
+            maskIndex = EMbmPhoneuiQgn_indi_button_loudspeaker_mask;                
+            break;          
+            }
+        case EPhoneInCallCmdDeactivateIhf:
+            {
+            skinId = KAknsIIDQgnIndiButtonHandset;   
+            fileIndex = EMbmPhoneuiQgn_indi_button_handset;
+            maskIndex = EMbmPhoneuiQgn_indi_button_handset_mask;                
+            break;           
+            }
+        case EPhoneInCallCmdHandset:
+            {
+            skinId = KAknsIIDQgnIndiButtonHandset;   
+            fileIndex = EMbmPhoneuiQgn_indi_button_handset;
+            maskIndex = EMbmPhoneuiQgn_indi_button_handset_mask;                 
+            break;
+            }
+        case EPhoneInCallCmdBtHandsfree:
+            {
+            skinId = KAknsIIDQgnIndiButtonBluetooth;    
+            fileIndex = EMbmPhoneuiQgn_indi_button_bluetooth;
+            maskIndex = EMbmPhoneuiQgn_indi_button_bluetooth_mask;                 
+            break;         
+            }
+        case EPhoneInCallCmdSwap:
+            {
+            skinId = KAknsIIDQgnIndiButtonSwap;  
+            fileIndex = EMbmPhoneuiQgn_indi_button_swap;
+            maskIndex = EMbmPhoneuiQgn_indi_button_swap_mask;                
+            break;
+            }
+        case EPhoneInCallCmdGoToIdle:
+            {
+            skinId = KAknsIIDQgnIndiButtonGoIdle; 
+            fileIndex = EMbmPhoneuiQgn_indi_button_go_idle;
+            maskIndex = EMbmPhoneuiQgn_indi_button_go_idle_mask;                
+            break;           
+            }
+        case EPhoneInCallCmdCreateConference:
+            {
+            skinId = KAknsIIDQgnIndiButtonConference; 
+            fileIndex = EMbmPhoneuiQgn_indi_button_conference;
+            maskIndex = EMbmPhoneuiQgn_indi_button_conference_mask;                
+            break;             
+            }
+        case EPhoneInCallCmdParticipants:
+            {
+            skinId = KAknsIIDQgnIndiButtonParticipants; 
+            fileIndex = EMbmPhoneuiQgn_indi_button_participants; 
+            maskIndex = EMbmPhoneuiQgn_indi_button_participants_mask;                
+            break;
+            }
+        case EPhoneInCallCmdDrop:
+            {
+            skinId = KAknsIIDQgnIndiButtonDrop; 
+            fileIndex = EMbmPhoneuiQgn_indi_button_drop;
+            maskIndex = EMbmPhoneuiQgn_indi_button_drop_mask;                 
+            break;
+            }
+        case EPhoneInCallCmdPrivate:
+            {
+            skinId = KAknsIIDQgnIndiButtonPrivate; 
+            fileIndex = EMbmPhoneuiQgn_indi_button_private; 
+            maskIndex = EMbmPhoneuiQgn_indi_button_private_mask;                 
+            break;
+            }
+        case EPhoneInCallCmdJoin:
+            {
+            skinId = KAknsIIDQgnIndiButtonJoin;  
+            fileIndex = EMbmPhoneuiQgn_indi_button_join;
+            maskIndex = EMbmPhoneuiQgn_indi_button_join_mask;                 
+            break;          
+            }
+        case EPhoneInCallCmdEndThisOutgoingCall: 
+            {
+            skinId = KAknsIIDQgnIndiButtonEndActiveCall;
+            fileIndex = EMbmPhoneuiQgn_indi_button_end_active_call;
+            maskIndex = EMbmPhoneuiQgn_indi_button_end_active_call_mask;
+            break;
+            }
+        case EPhoneCmdEnd:
+            {
+            skinId = KAknsIIDQgnIndiButtonEndCall;
+            fileIndex = EMbmPhoneuiQgn_indi_button_end_active_call;
+            maskIndex = EMbmPhoneuiQgn_indi_button_end_active_call_mask;
+            break;
+            }
+        case EPhoneCallComingCmdAnswer:
+            {
+            skinId = KAknsIIDQgnIndiButtonAnswer;
+            fileIndex = EMbmPhoneuiQgn_indi_button_answer;
+            maskIndex = EMbmPhoneuiQgn_indi_button_answer_mask;
+            break;
+            }
+        case EPhoneCallComingCmdReject:
+            {
+            skinId = KAknsIIDQgnIndiButtonReject;
+            fileIndex = EMbmPhoneuiQgn_indi_button_reject;
+            maskIndex = EMbmPhoneuiQgn_indi_button_reject_mask;
+            break;
+            }
+        case EPhoneInCallCmdSwitchToVideo:
+            {
+            skinId = KAknsIIDQgnIndiButtonVoiceToVideo;
+            fileIndex = EMbmPhoneuiQgn_indi_button_voice_to_video;
+            maskIndex = EMbmPhoneuiQgn_indi_button_voice_to_video_mask;
+            break;
+            }            
+        case EPhoneInCallCmdSwitchToVoice:
+            {
+            skinId = KAknsIIDQgnIndiButtonVideoToVoice;
+            fileIndex = EMbmPhoneuiQgn_indi_button_video_to_voice;
+            maskIndex = EMbmPhoneuiQgn_indi_button_video_to_voice_mask;
+            break;
+            }              
+        case EPhoneCallComingCmdSilent:
+            {
+            skinId = KAknsIIDQgnIndiButtonSilence;
+            fileIndex = EMbmPhoneuiQgn_indi_button_silence;
+            maskIndex = EMbmPhoneuiQgn_indi_button_silence_mask;
+            break;
+            }  
+
+        default:
+            return NULL; 
+        } // switch
+        
+    CGulIcon* icon = NULL;
+    if ( skinId != KAknsIIDNone )
+        {
+        TParse* fp = new( ELeave ) TParse();
+        CleanupStack::PushL( fp );
+        TInt err = fp->Set(KPhoneUiScalableIconFile, &KDC_APP_BITMAP_DIR, NULL); 
+
+        if (err != KErrNone)
+            {
+            User::Leave(err);
+            }
+
+        TBuf<KMaxFileName> fileName = fp->FullName();
+        CleanupStack::PopAndDestroy();  //fp
+            
+        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        
+        icon = AknsUtils::CreateGulIconL( skin, 
+                                          skinId, 
+                                          fileName, 
+                                          fileIndex,
+                                          maskIndex );
+        }
+
+    return icon;  
+    }
+    
+
+// ---------------------------------------------------------------------------
+// GetButtonForCommandL
+// ---------------------------------------------------------------------------
+//
+TAknsItemID CPhoneButtonsController::GetButtonForCommandL( TInt aCommandId )
+    {
+    TAknsItemID frameId( KAknsIIDNone );
+    switch ( aCommandId )
+        {
+        case EPhoneInCallCmdEndAllCalls:
+            {
+            frameId = KAknsIIDQsnFrButtonNormalReject; 
+            break;           
+            }
+        case EPhoneInCallCmdHold:
+            {
+            frameId = KAknsIIDQsnFrButtonNormalHold; 
+            break;            
+            }
+        case EPhoneInCallCmdUnhold:
+            {
+            frameId = KAknsIIDQsnFrButtonNormalHold; 
+            break;          
+            }
+        case EPhoneInCallCmdEndThisOutgoingCall: 
+            {
+            frameId = KAknsIIDQsnFrButtonNormalReject;
+            break;
+            }
+        case EPhoneCmdEnd:
+            {
+            frameId = KAknsIIDQsnFrButtonNormalReject;
+            break;
+            }
+        case EPhoneCallComingCmdAnswer:
+            {
+            frameId = KAknsIIDQsnFrButtonNormalAnswer;
+            break;
+            }
+        case EPhoneCallComingCmdReject:
+            {
+            frameId = KAknsIIDQsnFrButtonNormalReject;
+            break;
+            }
+
+        default:
+            frameId= KAknsIIDQsnFrButtonNormal;
+            break; 
+        } // switch
+        
+    return frameId;  
+    }
+
+
+// END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonecallheadertextanimation.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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 CPhoneCallHeaderTextAnimation class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cphonecallheadertextanimation.h"
+#include "phoneconstants.h"
+#include "phonelogger.h"
+#include "cphonetimer.h"
+
+// CONSTANTS
+const TUint16 KPhoneCallHeaderAnimationDot = 0x002E;
+const TInt KPhoneCallHeaderDotNum = 3;
+const TInt KOneSecond = 1000000;
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPhoneCallHeaderTextAnimation::CPhoneCallHeaderTextAnimation
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneCallHeaderTextAnimation::CPhoneCallHeaderTextAnimation() : 
+    CCoeStatic( KUidCallHeaderTextAnimationSingleton ),
+    iTimer( NULL ),
+    iDotNum( 0 ),
+    iBubbleManager( NULL ),
+    iActiveBubble( 0 )
+    {
+    }
+
+// Destructor
+CPhoneCallHeaderTextAnimation::~CPhoneCallHeaderTextAnimation()
+    { 
+    delete iTimer;
+    iTimer = NULL;  
+    }
+
+// ---------------------------------------------------------
+// CPhoneCallHeaderTextAnimation::InstanceL
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+CPhoneCallHeaderTextAnimation* CPhoneCallHeaderTextAnimation::InstanceL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneCallHeaderTextAnimation::InstanceL");
+    CPhoneCallHeaderTextAnimation* instance = static_cast<CPhoneCallHeaderTextAnimation*>(
+        CCoeEnv::Static( KUidCallHeaderTextAnimationSingleton ) );
+    if ( !instance )
+        {
+        instance = new ( ELeave ) CPhoneCallHeaderTextAnimation;
+        CleanupStack::PushL( instance );
+        instance->ConstructL();
+        CleanupStack::Pop( instance );
+        }
+    return instance;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneCallHeaderTextAnimation::CPhoneCallHeaderTextAnimation
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneCallHeaderTextAnimation::ConstructL()
+    {
+    iTimer = CPhoneTimer::NewL();
+    }
+
+// ---------------------------------------------------------
+// CPhoneCallHeaderTextAnimation::StartAnimatingVideoCallHeaderL
+// ---------------------------------------------------------
+//
+void CPhoneCallHeaderTextAnimation::StartAnimatingVideoCallHeaderL(
+	const CBubbleManager::TBubbleId aBubbleId,    
+    const TDesC& aNormalText,
+    const TDesC& aShortText,
+    CBubbleManager& aBubbleManager )
+	{
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneCallHeaderTextAnimation::StartAnimatingVideoCallHeaderL");
+	iActiveBubble = aBubbleId;
+	iBubbleManager = &aBubbleManager;
+
+	SetBubbleTexts( aNormalText, aShortText );
+	
+	// Update immediately when we start
+	HandleTimeOutL();		
+	}
+
+// ---------------------------------------------------------
+// CPhoneCallHeaderTextAnimation::RemoveAnimatingVideoCallHeader
+// ---------------------------------------------------------
+//
+void CPhoneCallHeaderTextAnimation::RemoveAnimatingVideoCallHeader()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneCallHeaderTextAnimation::RemoveAnimatingVideoCallHeader");
+    if( iTimer )
+        {
+        if( iTimer->IsActive() )
+            {
+            iTimer->CancelTimer();                
+            }          
+        }
+    iDotNum = 0;
+    }
+
+// ---------------------------------------------------------
+// CPhoneCallHeaderTextAnimation::HandleTimeOutL
+// ---------------------------------------------------------
+//
+void CPhoneCallHeaderTextAnimation::HandleTimeOutL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneCallHeaderTextAnimation::HandleTimeOutL");
+
+    iBubbleManager->UpdateCallHeaderText( iActiveBubble, 
+                iNormalText, iShortText, CBubbleManager::ERight );    
+
+    if ( iDotNum < KPhoneCallHeaderDotNum ) 
+        {
+        __PHONELOG( EBasic, EPhoneUIView, 
+            "CPhoneCallHeaderTextAnimation::HandleTimeOutL()->iDotNum < KPhoneCallHeaderDotNum" );
+        iNormalText.Append( &KPhoneCallHeaderAnimationDot, 1);
+        iShortText.Append( &KPhoneCallHeaderAnimationDot, 1);
+        iDotNum++;
+        }
+    else
+        {
+        __PHONELOG( EBasic, EPhoneUIView, 
+            "CPhoneCallHeaderTextAnimation::HandleTimeOutL()->else..." );
+        TInt normalLength = iNormalText.Length();
+        iNormalText.Delete( normalLength - KPhoneCallHeaderDotNum, KPhoneCallHeaderDotNum);
+
+        TInt shortLength = iShortText.Length();
+        iShortText.Delete( shortLength - KPhoneCallHeaderDotNum, KPhoneCallHeaderDotNum);
+        
+        iDotNum = 0;
+        }    	
+
+    // Start timer to update headers periodically
+    if ( !iTimer->IsActive() )
+        {
+        __PHONELOG( EBasic, EPhoneUIView, 
+            "CPhoneCallHeaderTextAnimation::HandleTimeOutL()-> Start timer to update headers periodically" );
+		iTimer->After( KOneSecond, this );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneCallHeaderTextAnimation::SetBubbleTexts
+// ---------------------------------------------------------
+//
+void CPhoneCallHeaderTextAnimation::SetBubbleTexts( const TDesC& aNormalText, 
+	const TDesC& aShortText )
+	{
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneCallHeaderTextAnimation::SetBubbleTexts");
+    __PHONELOG1( 
+        EBasic, 
+        EPhoneUIView, 
+        "CPhoneCallHeaderTextAnimation::SetBubbleTexts aNormalText = %S",
+        &aNormalText );
+        
+    __PHONELOG1( 
+        EBasic, 
+        EPhoneUIView, 
+        "CPhoneCallHeaderTextAnimation::SetBubbleTexts aShortText = %S",
+        &aShortText );
+        
+	if( aNormalText.Length() > KPhoneCallHeaderAnimationTextLength )
+		{
+		iNormalText = aNormalText.Left( KPhoneCallHeaderAnimationTextLength );	
+		}
+	else
+		{
+		iNormalText = aNormalText;			
+		}
+		
+	if( aShortText.Length() > KPhoneCallHeaderAnimationTextLength )
+		{
+		iShortText = aShortText.Left( KPhoneCallHeaderAnimationTextLength );		
+		}
+	else
+		{
+		iShortText = aShortText;			
+		}		
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonecontactcontroller.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,246 @@
+/*
+* 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:  Contact Controller
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "cphonecontactcontroller.h"
+#include    <cphonecntsaveaddtoname.h>
+#include    <cphcntsingleitemfetch.h>
+#include    <cphonecntfactory.h>
+#include    <eikenv.h>
+#include    <aknappui.h>
+#include	<cphcntrfshandler.h>
+#include    "phonelogger.h"
+
+
+// CONSTANTS
+
+// Library containing contact matcher.
+_LIT( KPhoneCntFinderLibrary, "phonecntfinder.dll" );
+
+// Ordinal position of function to create instance of CPhoneCntFactory.
+const TInt KPhoneCntFinderOrdinal = 1;
+
+// ================= MEMBER FUNCTIONS =======================
+
+CPhoneContactController* CPhoneContactController::NewL()
+    {
+    CPhoneContactController* self = 
+        new ( ELeave ) CPhoneContactController();
+
+    return self;
+    }
+        
+CPhoneContactController::~CPhoneContactController()
+    {
+    delete iFactory;
+    iLibrary.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneContactController::ContinueConstructL
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneContactController::ContinueConstructL( TInt aSteps )
+    {
+    __PHONELOG( EBasic, EPhoneUIView,
+                "CPhoneViewController::ContinueConstructL()" );
+    if ( aSteps == KConstructAll )
+        {
+        aSteps = ConstructionSteps();
+        }
+
+    // Perform as many steps as required..
+    for ( ; aSteps > 0; aSteps-- )
+        {
+        DoStepL();
+
+        // If we do not need any steps, stop.
+        if ( !ConstructionSteps() )
+            {
+            break;
+            }
+        }
+
+    return ConstructionSteps();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneContactController::ConstructionSteps
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneContactController::ConstructionSteps() const
+    {
+    return TInt( EStepDone - iCurrentStep );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneContactController::CreateSingleItemFetchL
+// ---------------------------------------------------------------------------
+//
+CPhCntSingleItemFetch* CPhoneContactController::CreateSingleItemFetchL()
+    {
+    ConstructCreateFactoryL();
+
+    return iFactory->CreateSingleItemFetchL();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneContactController::CreateSaveAddToNameL
+// -----------------------------------------------------------------------------
+//
+CPhoneCntSaveAddToName* CPhoneContactController::CreateSaveAddToNameL()
+    {
+    ConstructCreateFactoryL();
+
+    return iFactory->CreateSaveAddToNameL();
+    }
+
+
+CPhoneContactController::CPhoneContactController()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneContactController::DoStepL
+// -----------------------------------------------------------------------------
+//
+void CPhoneContactController::DoStepL()
+    {
+    // If all steps have been completed, then there is 
+    // nothing to do.
+    if ( iCurrentStep == EStepDone )
+        {
+        return;
+        }
+
+    // Perform one step; if it doesn't leave, then we have done it.
+    switch ( iCurrentStep )
+        {
+        case EStepLoadLibrary:
+            ConstructLoadLibraryL();
+            break;
+
+        case EStepCreateFactory:
+            ConstructCreateFactoryL();
+            break;
+
+        case EStepDone:
+        default:
+            return;
+        }
+
+    // Next step
+    iCurrentStep = NextStep( iCurrentStep );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneContactController::NextStep
+// -----------------------------------------------------------------------------
+//
+CPhoneContactController::TStep 
+    CPhoneContactController::NextStep( TStep aStep )
+    {
+    TStep result = EStepDone;
+
+    switch ( aStep )
+        {
+        case EStepLoadLibrary:
+            result = EStepCreateFactory;
+            break;
+
+        case EStepCreateFactory:
+            result = EStepDone;
+            break;
+
+        case EStepDone:
+            result = EStepDone;
+            break;
+
+        default:
+            break;
+        }
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneContactController::ConstructLoadLibraryL
+// -----------------------------------------------------------------------------
+//
+void CPhoneContactController::ConstructLoadLibraryL()
+    {
+    if ( !iLibrary.Handle() )
+        {
+        User::LeaveIfError( iLibrary.Load( KPhoneCntFinderLibrary ) );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneContactController::ConstructCreateFactoryL
+// -----------------------------------------------------------------------------
+//
+void CPhoneContactController::ConstructCreateFactoryL()
+    {
+    __PHONELOG( EBasic, EPhoneUIView,
+                    "CPhoneContactController::ConstructCreateFactoryL()" );
+    if ( !iFactory )
+        {
+        ConstructLoadLibraryL();
+
+        TInt res = iLibrary.Lookup( KPhoneCntFinderOrdinal )();
+        iFactory = (CPhCntFactory*)res;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneContactController::CreatePhoneBookServiceL
+// -----------------------------------------------------------------------------
+//
+void CPhoneContactController::CreatePhoneBookServiceL()
+    {
+    __PHONELOG( EBasic, EPhoneUIView,
+                    "CPhoneContactController::CreatePhoneBookServiceL()" );
+    if ( iFactory )
+        {
+        iFactory->CreatePhonebookServicesL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneContactController::CreateRfsHandlerL
+// -----------------------------------------------------------------------------
+//
+CPhCntRfsHandler* CPhoneContactController::CreateRfsHandlerL()
+    {
+    ConstructCreateFactoryL();
+
+    return iFactory->CreateRfsHandlerL();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneContactController::CreateSpeedDialMonitorL
+// -----------------------------------------------------------------------------
+//
+CPhCntSpeedDialMonitor* CPhoneContactController::CreateSpeedDialMonitorL()
+    {
+    ConstructCreateFactoryL();
+
+    return iFactory->CreateSpeedDialMonitorL();
+    }    
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonedialercontroller.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,745 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 the updating of dialer buttons
+*
+*/
+
+
+#include <eikappui.h>
+#include <eikenv.h>
+#include <eikapp.h>
+#include <eikcolib.h>
+#include <gulicon.h>
+#include <akntoolbar.h>
+#include <aknbutton.h>
+#include <StringLoader.h>
+#include <phoneui.rsg>
+#include <pevirtualengine.h>
+#include <data_caging_path_literals.hrh>
+
+#include "cphonedialercontroller.h"
+#include "cphonebubblewrapper.h"
+#include "phoneui.hrh"
+#include "phonerssbase.h"
+#include "tphonecmdparaminteger.h"
+#include "cphonemenucontroller.h"
+#include "cphonemainresourceresolver.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "tphonecmdparamboolean.h"
+#include "mphonedialercontroller.h"
+
+_LIT ( KPhoneMifFileName, "phoneui.mif" );
+_LIT( KDialerToolbarButtonEmptyStr, "" );
+
+const TInt KNumberOfButtons = 6;
+struct SPhoneDialerToolbarButton
+    {
+    TInt iIconIndex;
+    TInt iMaskIndex;
+    TInt iCommandId;    
+    };
+
+const SPhoneDialerToolbarButton bArray[KNumberOfButtons] =
+        {  
+            { EMbmPhoneuiQgn_indi_dialer_call_send,
+              EMbmPhoneuiQgn_indi_dialer_call_send_mask,
+              EPhoneDialerCmdLog
+            },
+            { EMbmPhoneuiQgn_indi_dialer_call_send,
+              EMbmPhoneuiQgn_indi_dialer_call_send_mask,
+              EPhoneNumberAcqCmdSendCommand
+            },        
+            
+            { EMbmPhoneuiQgn_indi_button_send_dtmf,
+              EMbmPhoneuiQgn_indi_button_send_dtmf_mask,
+              EPhoneCmdDtmfOk
+            },               
+            { EMbmPhoneuiQgn_indi_dialer_contacts,
+              EMbmPhoneuiQgn_indi_dialer_contacts_mask,
+              EPhoneDialerCmdContacts
+            },
+            { EMbmPhoneuiQgn_indi_dialer_add_contacts,
+              EMbmPhoneuiQgn_indi_dialer_add_contacts_mask,
+              EPhoneNumberAcqCmdAddToContacts
+            },            
+            { EMbmPhoneuiQgn_indi_dialer_clear,
+              EMbmPhoneuiQgn_indi_dialer_clear_mask,
+              EPhoneDialerCmdClear
+            }
+        }; 
+
+const TInt KDialerToolbarButtonCount = 6; 
+const TInt KDialerToolbarButtonKeyRepeatDelay = 300;
+const TInt KDialerToolbarKeyRepeatInterval = 75;
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhoneDialerController::CPhoneDialerController( 
+                                        CPhoneBubbleWrapper& aBubbleWrapper,
+                                        CCoeEnv& aCoeEnv,
+                                        CPhoneMenuController& aMenuController ):
+    iBubbleWrapper ( aBubbleWrapper ),
+    iCoeEnv ( aCoeEnv ),
+    iMenuController( aMenuController ),
+    iUpdateToolbar( EFalse )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhoneDialerController::ConstructL()
+    {
+   
+    iBubbleWrapper.SetNumberEntryObserver( *this );
+   
+    if ( !iToolbar )
+        {
+        iToolbar = CAknToolbar::NewL( R_PHONEUI_TOOLBAR );
+        }
+  
+    CEikAppUiFactory* appUiFactory =
+        static_cast<CEikAppUiFactory*>( CEikonEnv::Static()->AppUiFactory() );  
+    appUiFactory->SetViewFixedToolbar( iToolbar );
+    
+    if( iToolbar )
+        {
+        iToolbar->SetToolbarObserver( 
+                        static_cast<MAknToolbarObserver*>( this ));  
+        iToolbar->SetWithSliding( EFalse );
+        iToolbar->SetCloseOnAllCommands( EFalse );
+        iToolbar->SetFocusing( EFalse );
+        
+        CAknButton* button( NULL );
+
+        for( TInt i = 0; i < KDialerToolbarButtonCount; i++ )
+            {
+            TAknsItemID skinId = SkinId( bArray[i].iIconIndex );
+            // Load tooltip text.
+            HBufC* tooltipText;
+            GetTooltipTextL ( bArray[i].iCommandId, tooltipText );  
+            CleanupStack::PushL( tooltipText );      
+         
+            button = CreateButtonLC(
+                bArray[i].iIconIndex, 
+                bArray[i].iMaskIndex, 
+                *tooltipText, 
+                skinId,
+                bArray[i].iCommandId );
+            // Takes ownership of the button                    
+            iToolbar->AddItemL( button, EAknCtButton, bArray[i].iCommandId,0 );
+           
+            CleanupStack::Pop( button );
+            CleanupStack::PopAndDestroy( tooltipText );
+            }
+       
+        // Hide 'Send dtmf' icon
+        iToolbar->HideItem( EPhoneCmdDtmfOk, ETrue, EFalse );
+        TRAP_IGNORE(iToolbar->DisableToolbarL( ETrue ));
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// CreateButtonL
+// ---------------------------------------------------------------------------
+//
+CAknButton* CPhoneDialerController::CreateButtonLC( 
+    TInt aNormalIconId,
+    TInt aNormalMaskId,
+    const TDesC& aTooltipText,
+    const TAknsItemID& aSkinIconId,
+    TInt aCommand )
+    {
+    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
+        KDialerToolbarButtonEmptyStr(),
+        aTooltipText, // help
+        0, // flags
+        0, // state flags
+        aSkinIconId );
+                               
+    if( aCommand == EPhoneDialerCmdClear )
+        {
+        button->SetButtonFlags( KAknButtonKeyRepeat );
+        // delay 300 ms and repeat 75 ms interval   
+        button->SetKeyRepeatInterval( KDialerToolbarButtonKeyRepeatDelay,
+                                      KDialerToolbarKeyRepeatInterval );
+        }
+                                     
+    button->SetFocusing( EFalse );
+    button->SetBackground( iToolbar );
+
+    return button;
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhoneDialerController* CPhoneDialerController::NewL( 
+                                    CPhoneBubbleWrapper& aBubbleWrapper,
+                                    CCoeEnv& aCoeEnv,
+                                    CPhoneMenuController& aMenuController  )
+    {
+    CPhoneDialerController* self =  new (ELeave) CPhoneDialerController( 
+                                        aBubbleWrapper
+                                       , aCoeEnv
+                                       , aMenuController );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhoneDialerController::~CPhoneDialerController()
+    {
+    delete iToolbar;
+    }
+
+// ---------------------------------------------------------------------------
+// NumberEntryStateChanged
+// ---------------------------------------------------------------------------
+//
+void CPhoneDialerController::NumberEntryStateChanged( TBool aHidePromptText )
+    {
+    if( aHidePromptText != iPreviousHidePromptTextStatus )
+        {
+        iPreviousHidePromptTextStatus = aHidePromptText; 
+        iUpdateToolbar = ETrue;
+        }
+    
+    HandleNumberEntryChanged();
+    
+    }
+
+// ---------------------------------------------------------------------------
+// HandleNumberEntryChanged
+// ---------------------------------------------------------------------------
+//
+void CPhoneDialerController::HandleNumberEntryChanged()
+    {
+    if( iUpdateToolbar )
+        {
+        UpdateToolbar();
+        iUpdateToolbar = EFalse;        
+        }
+    
+    iBubbleWrapper.HandleNumberEntryChanged();
+    
+    } 
+
+// ---------------------------------------------------------------------------
+// HandleNumberEntryChanged
+// ---------------------------------------------------------------------------
+//
+void CPhoneDialerController::SetNumberEntryChangedCallBack( 
+        TPhoneCommandParam* aCommandParam )
+    {
+    iBubbleWrapper.SetNumberEntryChangedCallBack( aCommandParam );
+    
+    }
+     
+// ---------------------------------------------------------------------------
+// CreateButtonSetNumberEntryEmpty
+// ---------------------------------------------------------------------------
+//
+void CPhoneDialerController::CreateButtonSetNumberEntryEmpty()
+    {
+    
+    if( iToolbar )
+        {
+        if( iDtmfDialerVisible )
+            {
+            // Dim 'Send dtmf' 
+            iToolbar->SetItemDimmed( EPhoneCmdDtmfOk, ETrue, EFalse );
+            }
+        else if ( iCustomizedDialer )
+            {
+            iCustomizedDialer->HandleNumberEntryIsEmpty( ETrue );
+            }
+        else
+            {         
+            // Show 'Logs ' and 'Contacts' items
+            iToolbar->HideItem( EPhoneDialerCmdLog, EFalse,EFalse );
+            iToolbar->HideItem( EPhoneDialerCmdContacts, EFalse, EFalse );
+            
+            if ( iRestrictedDialer )
+                {
+                // Dim 'Logs' 
+                iToolbar->SetItemDimmed( EPhoneDialerCmdLog, ETrue
+                                       , EFalse );
+                // Dim 'Contacts' 
+                iToolbar->SetItemDimmed( EPhoneDialerCmdContacts, ETrue
+                                       , EFalse );
+                }
+                            
+            // Hide 'Send' and 'Add to contacts'        
+            iToolbar->HideItem( EPhoneNumberAcqCmdSendCommand, ETrue
+                                , EFalse );
+            iToolbar->HideItem( EPhoneNumberAcqCmdAddToContacts, ETrue
+                                , EFalse );                
+            }        
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CreateButtonSetNumberEntryNotEmpty
+// ---------------------------------------------------------------------------
+//
+void CPhoneDialerController::CreateButtonSetNumberEntryNotEmpty()
+    {
+    if( iToolbar )
+        {
+        if( iDtmfDialerVisible )
+            {
+            // Show 'Send dtmf' 
+            iToolbar->SetItemDimmed( EPhoneCmdDtmfOk, EFalse, EFalse );
+            }           
+        else if ( iCustomizedDialer )
+            {
+            iCustomizedDialer->HandleNumberEntryIsEmpty( EFalse );
+            }
+        else
+            {
+            // Show 'Send' and 'Add to contacts'
+            iToolbar->HideItem( EPhoneNumberAcqCmdAddToContacts, EFalse
+                              , EFalse );      
+            iToolbar->HideItem( EPhoneNumberAcqCmdSendCommand, EFalse
+                              , EFalse );  
+                    
+            if ( iRestrictedDialer )
+                {
+                // Dim 'Send' 
+                iToolbar->SetItemDimmed( EPhoneNumberAcqCmdSendCommand, ETrue
+                                       , EFalse );
+                // Dim 'Add to Contacts' 
+                iToolbar->SetItemDimmed( EPhoneNumberAcqCmdAddToContacts, ETrue
+                                       , EFalse );
+                }  
+                           
+            // Hide 'Logs ' and 'Contacts' 
+            iToolbar->HideItem( EPhoneDialerCmdLog, ETrue,EFalse );
+            iToolbar->HideItem( EPhoneDialerCmdContacts, ETrue, EFalse ); 
+            
+            TPhoneCmdParamCallStateData callStateData;
+            callStateData.SetCallState( EPEStateConnected );
+            iBubbleWrapper.GetCallIdByState( &callStateData );
+            TInt connected = callStateData.CallId();    
+             
+            //If there is a active emergency call, Send item must be dimmed.  
+            if ( connected == KEmergencyCallId )
+                {
+                //Dim Send
+                iToolbar->SetItemDimmed( EPhoneNumberAcqCmdSendCommand, ETrue
+                                        ,EFalse );                
+                }
+            else
+                {
+                //UnDim
+                iToolbar->SetItemDimmed( EPhoneNumberAcqCmdSendCommand, EFalse
+                                        ,EFalse );                     
+                }
+            }    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// SetDtmfDialerVisibleL
+// ---------------------------------------------------------------------------
+//
+void CPhoneDialerController::SetDtmfDialerVisibleL( TBool aVisible )
+    {
+    iDtmfDialerVisible = aVisible;
+    
+    if( iDtmfDialerVisible )
+        {
+        // Load prompt resource text to DTMF dialer.
+        TInt resourceId = CPhoneMainResourceResolver::Instance()->
+                    ResolveResourceID( EPhoneDtmfDialerNumberEntryPromptText ); 
+                    
+        HBufC* loadedText = StringLoader::LoadL( resourceId
+                                               , &iCoeEnv );
+
+        iBubbleWrapper.SetNumberEntryPromptText( loadedText->Des() );
+        
+        delete loadedText;
+        }
+    else        
+        { 
+        // Clear prompt text.    
+        iBubbleWrapper.SetNumberEntryPromptText( KNullDesC );  
+                 
+        // Hide
+        iToolbar->HideItem( EPhoneCmdDtmfOk, ETrue, EFalse );  
+           
+        // Show       
+        iToolbar->HideItem( EPhoneNumberAcqCmdSendCommand, EFalse, EFalse );
+        iToolbar->HideItem( EPhoneDialerCmdLog, EFalse, EFalse );            
+        iToolbar->HideItem( EPhoneNumberAcqCmdAddToContacts, EFalse, EFalse );    
+        // Dimming 
+        iToolbar->SetItemDimmed( EPhoneDialerCmdContacts, EFalse, EFalse );                
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// SetRestrictedDialerL
+// ---------------------------------------------------------------------------
+//
+void CPhoneDialerController::SetRestrictedDialer( TBool aRestricted )
+    {
+    iRestrictedDialer = aRestricted;
+    }
+// ---------------------------------------------------------------------------
+// UpdateToolbar
+// ---------------------------------------------------------------------------
+//
+void CPhoneDialerController::UpdateToolbar()
+    {
+    
+    TPhoneCmdParamInteger numberEntryCountParam;
+    iBubbleWrapper.GetNumberEntryCount( 
+                            (TPhoneCommandParam*) &numberEntryCountParam );
+    TInt neLength( numberEntryCountParam.Integer() );
+    
+    if ( neLength )
+        {
+        CreateButtonSetNumberEntryNotEmpty();
+        iToolbar->SetItemDimmed( EPhoneDialerCmdClear, EFalse, EFalse );  
+        iToolbar->DrawDeferred();     
+        
+        //Update also options menu via controller
+        iMenuController.SetNumberEntryEmptyFlag( EFalse );        
+        }
+        
+    else
+        {
+        CreateButtonSetNumberEntryEmpty();
+        iToolbar->SetItemDimmed( EPhoneDialerCmdClear, ETrue, EFalse );
+        iToolbar->DrawDeferred();
+        
+        //Update also options menu via controller
+        iMenuController.SetNumberEntryEmptyFlag( ETrue );                  
+        } 
+
+    }   
+
+// ---------------------------------------------------------------------------
+// OfferToolbarEventL
+// ---------------------------------------------------------------------------
+//
+void CPhoneDialerController::OfferToolbarEventL( TInt aCommand )
+    {
+    switch ( aCommand )
+        {
+        case EPhoneDialerCmdClear:
+            {
+            // Send key event.
+            TKeyEvent keyEvent;
+            keyEvent.iModifiers = 0;
+            keyEvent.iRepeats = 0;
+            keyEvent.iCode = EKeyBackspace;
+            keyEvent.iScanCode = EStdKeyBackspace;
+            iCoeEnv.SimulateKeyEventL( keyEvent, EEventKey );
+            }
+            break;   
+        default:
+            {
+            // Forward pressed toolbar button to the framework 
+            // so that we can handle it in active state            
+            static_cast<MEikCommandObserver*>( CEikonEnv::Static()->EikAppUi() )
+               ->ProcessCommandL( aCommand );            
+            }
+            break;    
+        }
+    } 
+   
+// ---------------------------------------------------------------------------
+// DynInitToolbarL
+// ---------------------------------------------------------------------------
+//
+void CPhoneDialerController::DynInitToolbarL( TInt aResourceId, 
+                                              CAknToolbar* /*aToolbar*/ )
+    { 
+    if ( aResourceId == R_PHONEUI_TOOLBAR )
+        {
+        if ( !iDtmfDialerVisible )
+            {
+            UpdateToolbar();
+            }
+        else
+            {
+            // initialize toolbar for dtmf dialer
+            //
+            // Show
+            iToolbar->HideItem( EPhoneCmdDtmfOk, EFalse, EFalse );
+            iToolbar->HideItem( EPhoneDialerCmdContacts, EFalse, EFalse );     
+            
+            // Hide
+            iToolbar->HideItem( EPhoneNumberAcqCmdSendCommand, ETrue, EFalse );
+            iToolbar->HideItem( EPhoneDialerCmdLog, ETrue, EFalse );            
+            iToolbar->HideItem( EPhoneNumberAcqCmdAddToContacts, ETrue
+                              , EFalse );     
+            
+            // Dimming
+            iToolbar->SetItemDimmed( EPhoneDialerCmdContacts, ETrue, EFalse ); 
+            iToolbar->SetItemDimmed( EPhoneCmdDtmfOk, ETrue, EFalse );                   
+            }
+        }     
+    }
+// ---------------------------------------------------------------------------
+// IsDTMFDialerVisible
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneDialerController::IsDTMFDialerVisible() const
+    {
+    return iDtmfDialerVisible;
+    }
+
+
+// ---------------------------------------------------------------------------
+// GetTooltipText
+//
+// Tooltip texts for toolbar buttons
+// ---------------------------------------------------------------------------
+//
+void  CPhoneDialerController::GetTooltipTextL( TInt aCommandId, HBufC*& aText ) 
+    {
+    TInt resourceId = 0;
+    switch( aCommandId )
+        {
+        case EPhoneDialerCmdLog:
+            resourceId = R_PHONEUI_DIALER_TOOLTIP_RECENT_CALLS;
+            break;              
+                  
+        case EPhoneNumberAcqCmdSendCommand:
+            resourceId = R_PHONEUI_DIALER_TOOLTIP_CALL;
+            break;      
+                          
+        case EPhoneCmdDtmfOk:
+            resourceId = R_PHONEUI_DIALER_TOOLTIP_SEND;
+            break;   
+                             
+        case EPhoneDialerCmdContacts:
+            resourceId = R_PHONEUI_DIALER_TOOLTIP_CONTACTS;
+            break;   
+                             
+        case EPhoneNumberAcqCmdAddToContacts:
+            resourceId = R_PHONEUI_DIALER_TOOLTIP_ADD_TO_CONTACTS;
+            break;   
+                             
+        case EPhoneDialerCmdClear:
+            resourceId = R_PHONEUI_DIALER_TOOLTIP_CLEAR;
+            break;
+        default:
+            aText = KNullDesC().Alloc();
+            break;
+        }
+        
+    if( resourceId )
+        {
+        aText = StringLoader::LoadL( resourceId, &iCoeEnv );
+        }
+        
+    }
+// ---------------------------------------------------------------------------
+// SetServiceCodeFlagL
+//
+// Change call button tooltip text between 'Send' or 'Call'
+// 
+// ---------------------------------------------------------------------------
+//
+void CPhoneDialerController::SetServiceCodeFlagL( 
+    TPhoneCommandParam* aCommandParam )
+    {
+    
+    // Check is the given parameter valid
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {   
+        TInt resourceId = 0;
+        TPhoneCmdParamBoolean* serviceCodeFlag = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+        // Sanity check
+        if( serviceCodeFlag->Boolean() == iServiceCodeFlag )
+            {
+            return;
+            }
+        // Get the toolbar button control
+        CAknButton* button = static_cast<CAknButton*>
+        ( iToolbar->ControlOrNull( EPhoneNumberAcqCmdSendCommand) );
+        
+        CAknButtonState* state = button->State();                              
+        if ( serviceCodeFlag->Boolean() )
+            {
+            iServiceCodeFlag = ETrue;
+            resourceId = R_PHONEUI_DIALER_TOOLTIP_SEND;
+            }
+        else
+            {
+            iServiceCodeFlag = EFalse;
+            resourceId = R_PHONEUI_DIALER_TOOLTIP_CALL;
+            }  
+                
+        if( resourceId )
+            {    
+            // Change text              
+            HBufC* tooltipText = StringLoader::LoadL( resourceId,
+                                             CCoeEnv::Static() );
+            CleanupStack::PushL( tooltipText );                                         
+            state->SetHelpTextL( *tooltipText );
+            CleanupStack::PopAndDestroy( tooltipText );   
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ShowToolbar
+//
+// ---------------------------------------------------------------------------
+//
+void CPhoneDialerController::ShowToolbar()
+    {
+    if ( iToolbar )
+        {
+        if ( iToolbar->IsToolbarDisabled() )
+            {
+            TRAP_IGNORE(iToolbar->DisableToolbarL( EFalse ));
+            }
+        iToolbar->HideItemsAndDrawOnlyBackground( EFalse );
+        iToolbar->SetToolbarVisibility( ETrue, EFalse );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// HideToolbar
+//
+// ---------------------------------------------------------------------------
+//
+void CPhoneDialerController::HideToolbar()
+    {
+    if ( iToolbar )
+        {
+        if( iToolbar->IsShown() )
+            {
+            iToolbar->HideItemsAndDrawOnlyBackground( ETrue );
+            }
+        else if ( iToolbar->IsToolbarDisabled() )
+            {
+            TRAP_IGNORE(iToolbar->DisableToolbarL( EFalse ));
+            iToolbar->HideItemsAndDrawOnlyBackground( ETrue );
+            iToolbar->SetToolbarVisibility( ETrue, EFalse );
+            }
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// ShowCustomizedDialerL
+//
+// Sets custom dialer buttons visible
+// 
+// ---------------------------------------------------------------------------
+//
+void CPhoneDialerController::ShowCustomizedDialerL( 
+    MPhoneDialerController* aCustomController )
+    {  
+    if ( aCustomController )
+        {
+        // Hide all buttons except clear button 
+        for ( TInt i = 0; i < KNumberOfButtons; i++ )
+            {
+            if ( bArray[ i ].iCommandId != EPhoneDialerCmdClear )
+                {
+                iToolbar->HideItem( bArray[ i ].iCommandId, ETrue, EFalse );
+                }
+            }
+ 
+        aCustomController->InitializeL( *iToolbar );
+        iBubbleWrapper.SetNumberEntryPromptText( 
+            aCustomController->NumberEntryPromptTextL() );
+        aCustomController->ShowButtons( ETrue );
+        }
+    iCustomizedDialer = aCustomController;
+    }
+
+// ---------------------------------------------------------------------------
+// HideCustomizedDialerL
+//
+// Hides custom dialer buttons 
+// 
+// ---------------------------------------------------------------------------
+//
+void CPhoneDialerController::HideCustomizedDialer()
+    {  
+    iCustomizedDialer->ShowButtons( EFalse );
+    iBubbleWrapper.SetNumberEntryPromptText( KNullDesC );              
+    iCustomizedDialer = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// IsCustomizedDialerVisible
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneDialerController::IsCustomizedDialerVisible() const
+    {
+    return ( NULL != iCustomizedDialer );
+    }
+
+// ---------------------------------------------------------------------------
+// CustomizedCbaResourceId
+// ---------------------------------------------------------------------------
+//
+TInt CPhoneDialerController::CustomizedCbaResourceId() const
+    {
+    TInt resourceId = KErrNotFound;
+    if ( iCustomizedDialer )
+        {
+        resourceId = iCustomizedDialer->CbaResourceId();
+        }
+    return resourceId;
+    }
+
+// ---------------------------------------------------------------------------
+// CustomizedMenuResourceId
+// ---------------------------------------------------------------------------
+//
+TInt CPhoneDialerController::CustomizedMenuResourceId() const
+    {
+    TInt resourceId = KErrNotFound;
+    if ( iCustomizedDialer )
+        {
+        resourceId = iCustomizedDialer->MenuResourceId();  
+        }
+    return resourceId;
+    }
+
+// END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonedialerview.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,432 @@
+/*
+* 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:  The dialer view of PhoneUI
+*
+*/
+
+
+// INCLUDE FILES
+#include "phoneconstants.h"
+#include "cphonedialerview.h"
+
+#include <eikenv.h>
+#include <eikapp.h> 
+#include <eikappui.h>
+#include <eikcmobs.h>
+
+#include <w32std.h>          // iWindowSrvSession
+
+#include <eikimage.h>
+#include <coemain.h>
+#include <gulutil.h>         // DrawUtils, egul.lib 
+#include <aknappui.h>
+#include <AknsLayeredBackgroundControlContext.h>
+#include <AknsDrawUtils.h>
+#include <AknsUtils.h>
+
+#include "cphonestatuspane.h"
+#include "tphonecmdparambitmap.h"
+#include "phonelogger.h"
+
+#include <AknUtils.h> // needed for AKN_LAF_COLOR in 3.0 environment
+
+
+#include "phoneui.hrh"
+#include "phoneviewcommanddefinitions.h"
+// Scalable UI 
+#include <aknlayout.cdl.h>
+#include <layoutmetadata.cdl.h>
+#include <aknlayoutscalable_apps.cdl.h>
+#include <aknlayoutscalable_avkon.cdl.h>
+#include <AknStatuspaneUtils.h>
+
+enum TPhoneBgLayers
+    {
+    EPhoneBgFirstLayer          = 0,
+    EPhoneBgLayersN             = 1
+    };
+
+#define LSC_VARIETY   0
+#define PRT_VARIETY   6
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::CPhoneDialerView
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneDialerView::CPhoneDialerView() :
+    iSecurityMode ( EFalse )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneDialerView::ConstructL( TRect aRect )
+    {
+    // Create background control context for skins.
+    iBgContext = CAknsLayeredBackgroundControlContext::NewL(
+        KAknsIIDQsnBgScreen, aRect, ETrue /*Parent absolute*/,
+        EPhoneBgLayersN );
+
+    CreateWindowL();
+    DrawableWindow()->SetPointerGrab( ETrue );
+
+    SetRect( aRect );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPhoneDialerView* CPhoneDialerView::NewL( TRect aRect )
+    {
+    CPhoneDialerView* self = new ( ELeave ) CPhoneDialerView();
+    
+    CleanupStack::PushL( self );
+    self->ConstructL( aRect );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// Destructor
+CPhoneDialerView::~CPhoneDialerView()
+    {
+     __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneDialerView::~CPhoneDialerView");
+    delete iBgContext;
+    iRegion.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::ViewId
+// -----------------------------------------------------------------------------
+//
+TVwsViewId CPhoneDialerView::ViewId() const
+    {
+    TVwsViewId id( 
+        iEikonEnv->EikAppUi()->Application()->AppDllUid(), 
+        KUidViewId );
+    return id;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::ViewActivatedL
+// -----------------------------------------------------------------------------
+//
+void CPhoneDialerView::ViewActivatedL( 
+    const TVwsViewId& /*aPrevViewId*/, 
+    TUid /*aCustomMessageId*/, 
+    const TDesC8& /*aCustomMessage*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::ViewDeactivated
+// -----------------------------------------------------------------------------
+//
+void CPhoneDialerView::ViewDeactivated()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::SetControl
+// 
+// Change the control. 
+// -----------------------------------------------------------------------------
+//
+void CPhoneDialerView::SetControl( CCoeControl* aControl )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneDialerView::SetControl()");
+    iControl = aControl;
+    UpdateControlRect();
+    iControl->MakeVisible( ETrue );
+    }
+
+    
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::Control
+// -----------------------------------------------------------------------------
+//
+CCoeControl* CPhoneDialerView::Control() const
+    {
+    return iControl;    
+    }    
+    
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::ComponentControl
+// -----------------------------------------------------------------------------
+//
+CCoeControl* CPhoneDialerView::ComponentControl( TInt /*aIndex*/ ) const
+    {
+    return iControl;        
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::CountComponentControls
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneDialerView::CountComponentControls() const
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneDialerView::CountComponentControls()");
+    TInt count = 0;
+
+    if ( iControl )
+        {
+        count = 1;
+        }
+
+    return count;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::MopSupplyObject
+// -----------------------------------------------------------------------------
+//
+TTypeUid::Ptr CPhoneDialerView::MopSupplyObject( TTypeUid aId )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneDialerView::MopSupplyObject()");
+    // Required during rendering of the background skin in Draw()
+    if (aId.iUid == MAknsControlContext::ETypeId)
+        {
+        return MAknsControlContext::SupplyMopObject( aId, iBgContext );
+        }
+    return CCoeControl::MopSupplyObject( aId );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::SetRect
+// -----------------------------------------------------------------------------
+//    
+void CPhoneDialerView::SetRect( const TRect &aRect )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneDialerView::SetRect()");
+    if ( !AknLayoutUtils::PenEnabled() )
+        {
+        CCoeControl::SetRect( aRect );
+        }
+    else
+        {
+        if ( iSecurityMode )
+            {
+            // In security mode aRect is ok.
+            CCoeControl::SetRect( aRect );    
+            iControlRect = Rect();
+            }
+        else
+            {
+            TAknLayoutRect viewRect;
+            
+            TRect screenRect;
+            AknLayoutUtils::LayoutMetricsRect( 
+                AknLayoutUtils::EScreen,
+                screenRect  );    
+
+            // dialer view
+            viewRect.LayoutRect( 
+                screenRect, 
+                TAknWindowComponentLayout::Compose(
+                    AknLayoutScalable_Avkon::application_window( 0 ),
+                    AknLayoutScalable_Avkon::main_pane( 7 ) ) );
+
+            CCoeControl::SetRect( viewRect.Rect() );    
+            
+            TInt variety ( PRT_VARIETY ) ; // portrait
+            if ( Layout_Meta_Data::IsLandscapeOrientation() )
+                {
+                variety = LSC_VARIETY;
+                }
+            
+            // reduce toolbar
+            TAknLayoutRect toolbarRect;
+            toolbarRect.LayoutRect( 
+                screenRect, 
+                TAknWindowComponentLayout::Compose(
+                AknLayoutScalable_Avkon::application_window( 0 ),
+                AknLayoutScalable_Avkon::area_side_right_pane( variety ) ) );
+            
+            if ( toolbarRect.Rect().Intersects( viewRect.Rect() ) )
+                {
+                iControlRect = Rect();
+                if ( variety == PRT_VARIETY ) // portrait
+                    {
+                    iControlRect.iBr.iY -= toolbarRect.Rect().Height();
+                    }
+                else
+                    {
+                    iControlRect.iBr.iX -= toolbarRect.Rect().Width();
+                    }
+                }
+            else
+                {
+                iControlRect = Rect();    
+                }                            
+            }                
+        }        
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::Draw
+// -----------------------------------------------------------------------------
+//
+void CPhoneDialerView::Draw(  const TRect& aRect ) const
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneDialerView::Draw()");
+    TRect rect = Rect();
+
+    if ( !rect.iTl.iY )
+        {
+        CWindowGc& gc = SystemGc();
+        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
+        
+        if ( iSecurityMode || 
+            !AknsDrawUtils::Background( skin, cc, this, gc, aRect ) )
+            {
+            gc.SetPenStyle(CGraphicsContext::ENullPen);
+            gc.SetBrushColor( AKN_LAF_COLOR( 0 ) ); // 0 for white
+            gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
+            gc.DrawRect( aRect ); 
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::HandlePointerEventL
+// -----------------------------------------------------------------------------
+//
+void CPhoneDialerView::HandlePointerEventL( const TPointerEvent& aPointerEvent )
+    {
+    // Calling base class implementation
+    CCoeControl::HandlePointerEventL( aPointerEvent );    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::ActivateL
+// -----------------------------------------------------------------------------
+//
+void CPhoneDialerView::ActivateL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneDialerView::ActivateL()");
+    CCoeControl::ActivateL();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::SizeChanged()
+// 
+// Expects that the controls are initialised otherwise.
+// -----------------------------------------------------------------------------
+//
+void CPhoneDialerView::SizeChanged()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneDialerView::SizeChanged()");
+    AknsUtils::RegisterControlPosition( this );
+
+    TRect screen;
+    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen );    
+    iBgContext->SetLayerImage( EPhoneBgFirstLayer, KAknsIIDQsnBgScreen );
+    iBgContext->SetParentPos( screen.iTl );
+    iBgContext->SetLayerRect( EPhoneBgFirstLayer, screen ) ;
+
+    UpdateControlRect();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::PositionChanged
+// -----------------------------------------------------------------------------
+//
+void CPhoneDialerView::PositionChanged()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneDialerView::PositionChanged()");
+    AknsUtils::RegisterControlPosition( this );
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::FocusChanged
+// -----------------------------------------------------------------------------
+//    
+void CPhoneDialerView::FocusChanged( TDrawNow /*aDrawNow*/ )
+    {
+    iControl->SetFocus( IsFocused () );
+    }    
+
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::UpdateControlRect
+// -----------------------------------------------------------------------------
+//
+void CPhoneDialerView::UpdateControlRect()
+    {    
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneDialerView::UpdateControlRect()");
+    if ( iControl )
+        {
+        if ( !AknLayoutUtils::PenEnabled() )
+            {
+            if ( Rect() != iControl->Rect() )
+                {
+                iControl->SetRect( Rect() );
+                }    
+            }
+        else
+            {
+            if ( iControlRect != iControl->Rect() )
+                {
+                iControl->SetRect( iControlRect );
+                }    
+            } 
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::HandleResourceChangeL
+// -----------------------------------------------------------------------------
+//
+void CPhoneDialerView::HandleResourceChange( TInt aType )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneDialerView::HandleResourceChange()");
+
+    if ( aType == KAknsMessageSkinChange || 
+         aType == KEikDynamicLayoutVariantSwitch )
+        {
+        DrawDeferred();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::SetSecurityMode
+// -----------------------------------------------------------------------------
+//
+void CPhoneDialerView::SetSecurityMode ( TBool aStatus )
+    {
+    if ( iSecurityMode != aStatus ) 
+        {
+        iSecurityMode = aStatus;
+        SizeChanged();    
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneDialerView::IsSecurityMode
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneDialerView::IsSecurityMode()    
+    {
+    return iSecurityMode;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonedtmfnumberlistquery.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,203 @@
+/*
+* 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:  NumberListQuery for DTMF strings.
+*
+*/
+
+
+
+#include    "cphonedtmfnumberlistquery.h"
+#include    "mphonequeryobserver.h"
+#include    "phoneui.hrh"
+#include    "phonelogger.h"
+#include    <mphcntmatch.h>
+#include    <StringLoader.h>
+#include    <phoneui.rsg>
+
+
+const TInt KPhoneManualDTMFString = R_QTN_ENTER_MANUALLY_QUERY_ITEM;
+const TInt KPhoneFindDTMFString = R_QTN_FIND_QUERY_ITEM;
+
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhoneDtmfNumberListQuery::CPhoneDtmfNumberListQuery(
+    MEikCommandObserver& aCommandObserver,
+    MPhoneQueryObserver& aQueryObserver,
+    HBufC*& aSelectedDtmfNumber ):
+      CAknListQueryDialog( &iIndex ),
+      iCommandObserver( aCommandObserver ),
+      iQueryObserver ( aQueryObserver ),
+      iSelectedDtmfNumber ( aSelectedDtmfNumber ),
+      iArray( 2 )
+    {
+    }
+// ---------------------------------------------------------------------------
+// CPhoneDtmfNumberListQuery::NewL
+// ---------------------------------------------------------------------------
+//
+CPhoneDtmfNumberListQuery* CPhoneDtmfNumberListQuery::NewL( MEikCommandObserver& aCommandObserver,
+                                                           MPhoneQueryObserver& aQueryObserver,
+                                                           HBufC*& aSelectedDtmfNumber  )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneDtmfNumberListQuery::NewL()");
+    CPhoneDtmfNumberListQuery* self = 
+                new ( ELeave ) CPhoneDtmfNumberListQuery( aCommandObserver, 
+                                                          aQueryObserver,
+                                                          aSelectedDtmfNumber );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CPhoneDtmfNumberListQuery::ConstructL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneDtmfNumberListQuery::ConstructL()");
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhoneDtmfNumberListQuery::~CPhoneDtmfNumberListQuery()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneDtmfNumberListQuery::~CPhoneDtmfNumberListQuery()");
+    iArray.Reset();
+    iQueryObserver.SetQueryDeletedFlag( ETrue );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneDtmfNumberListQuery::PostLayoutDynInitL
+// ---------------------------------------------------------------------------
+//
+void CPhoneDtmfNumberListQuery::PostLayoutDynInitL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneDtmfNumberListQuery::PostLayoutDynInitL()");
+    HBufC* manual = StringLoader::LoadLC( KPhoneManualDTMFString );
+    HBufC* find = StringLoader::LoadLC( KPhoneFindDTMFString );
+    iArray.AppendL( *find );
+    iArray.AppendL( *manual );
+    SetItemTextArray( &iArray );
+    SetOwnershipType( ELbmDoesNotOwnItemArray ); 
+    CleanupStack::PopAndDestroy( 2, manual ); //find, manual  
+    Layout();
+    DrawDeferred(); 
+    }
+    
+// ---------------------------------------------------------------------------
+// CPhoneDtmfNumberListQuery::OfferKeyEventL
+// ---------------------------------------------------------------------------
+//
+TKeyResponse CPhoneDtmfNumberListQuery::OfferKeyEventL( 
+    const TKeyEvent& aKeyEvent,
+    TEventCode aType )
+    {
+    if ( aType == EEventKey &&
+        ( aKeyEvent.iScanCode == EStdKeyNo || aKeyEvent.iCode == EKeyNo ) )
+        {
+        OkToExitL( EPhoneCmdEnd );
+        }
+    else if ( aKeyEvent.iScanCode == EStdKeyYes )
+        {
+        return EKeyWasConsumed;        
+        }        
+                
+    return CAknListQueryDialog::OfferKeyEventL( aKeyEvent, aType );     
+    } 
+        
+// ---------------------------------------------------------------------------
+// CPhoneDtmfNumberListQuery::AppendStringToArrayL
+// ---------------------------------------------------------------------------
+//    
+void CPhoneDtmfNumberListQuery::AppendStringToArrayL( TDesC& aString )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneDtmfNumberListQuery::AppendStringToArrayL()");
+    iArray.AppendL( aString );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneDtmfNumberListQuery::OkToExitL
+//
+// If softkey is select, result buffer can be filled with DTMF string.
+// Selection can be 'Find' then single item fetch is started.
+// 
+// Otherwise forward to base class. 
+//
+// ---------------------------------------------------------------------------
+//
+
+TBool CPhoneDtmfNumberListQuery::OkToExitL( 
+        TInt aButtonId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneDtmfNumberListQuery::OkToExitL()");
+    TInt index = 0;
+    TInt arraycount = 0;
+    TBool retVal = ETrue;
+    if ( aButtonId == EAknSoftkeySelect || aButtonId == EEikBidOk )
+        {
+        
+        index = ListBox()->CurrentItemIndex();
+        arraycount = ListBox()->Model()->
+                    MatchableTextArray()->MdcaCount();
+        
+        // 'Enter manually' selected.  
+        //  Last in the list.         
+        if ( index == ( arraycount-1 ) )
+            {
+            // Forward pressed CBA to the framework so that we can handle it
+            // in our active state
+            iQueryObserver.ReportQueryCompleteAsync( EPhoneInCallCmdDtmfManualQuery ); 
+            }
+
+        // Fill result buffer with DTMF string.
+        else if ( index <= ( arraycount-3 ) )     
+            {
+            TPtrC ptr = ListBox()->Model()->
+                    MatchableTextArray()->MdcaPoint( index );
+                    
+            // Caller is responsible to delete object
+            iSelectedDtmfNumber = HBufC::NewL( ptr.Length() );
+            iSelectedDtmfNumber->Des().Append( ptr );           
+            //Let the command observer handle this case.
+            iQueryObserver.ReportQueryCompleteAsync( EPhoneCmdDtmfOk );           
+            }
+           
+        //  Make single item fetch if 'Find' selected.  
+        // 'Find' item is second last.
+        else if ( index == ( arraycount-2 ) )
+            {
+             // Forward pressed CBA to the framework so that we can handle it
+            // in our active state
+            iQueryObserver.ReportQueryCompleteAsync( EPhoneInCallCmdDtmfListViewSearch );
+            }
+        }
+        
+    else if ( aButtonId == EPhoneCmdEnd )  
+        {
+        iQueryObserver.ReportQueryCompleteAsync( EPhoneCmdEnd ); 
+        }        
+    
+    return retVal;
+    }
+    
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonedtmfsendingnote.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneDtmfSendingNote class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cphonedtmfsendingnote.h"
+#include "phoneui.hrh"
+
+// ================= MEMBER FUNCTIONS =======================
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneDtmfSendingNote::CPhoneDtmfSendingNote( CEikDialog** aSelfPtr, MEikCommandObserver& aCommandObserver ) :
+    CPhoneNote( aSelfPtr, aCommandObserver ) 
+    {
+    }
+
+// ---------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------
+// 
+CPhoneDtmfSendingNote::~CPhoneDtmfSendingNote()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneDtmfSendingNote::OfferKeyEventL
+// ---------------------------------------------------------
+//
+TKeyResponse CPhoneDtmfSendingNote::OfferKeyEventL( 
+    const TKeyEvent& aKeyEvent,
+    TEventCode /*aType*/ )
+    {
+	if ( aKeyEvent.iScanCode == EStdKeyNo || aKeyEvent.iCode == EKeyNo )
+		{
+		OkToExitL( EPhoneCmdWaitNoteOk );
+		return EKeyWasNotConsumed;
+		}
+	else if( aKeyEvent.iScanCode == EStdKeyApplication0 ||
+	         aKeyEvent.iScanCode == EStdKeyYes || aKeyEvent.iCode == EKeyYes )
+		{
+		// Don't consume application and Yes -key
+		return EKeyWasNotConsumed;			
+		}
+	else
+		{
+		// Consume other key events
+	    return EKeyWasConsumed;		
+		}
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphoneincallindicator.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,311 @@
+/*
+* 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:  Incall indicator.
+*
+*/
+
+
+// INCLUDE FILES
+#include <ctsydomainpskeys.h>
+#include <AknIncallBubbleNotify.h>
+#include <avkon.hrh>
+
+#include "cphoneincallindicator.h"
+#include "cphonerecoverysystem.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparamincallindicatordata.h"
+#include "phonelogger.h"
+#include "phonerssbase.h"
+#include "cphonepubsubproxy.h"
+
+// CONSTANTS
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// ---------------------------------------------------------
+// CPhoneIncallIndicator::CPhoneIncallIndicator
+// ---------------------------------------------------------
+//
+CPhoneIncallIndicator::CPhoneIncallIndicator()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneIncallIndicator::~CPhoneIncallIndicator
+// ---------------------------------------------------------
+//
+CPhoneIncallIndicator::~CPhoneIncallIndicator()
+    {
+    CPhoneRecoverySystem::Remove( iUpdateRecoveryId );
+
+    delete iBubble;
+    delete iUpdater;
+    }
+
+// ---------------------------------------------------------
+// CPhoneIncallIndicator::NewL
+// ---------------------------------------------------------
+//
+CPhoneIncallIndicator* CPhoneIncallIndicator::NewL()
+    {
+    CPhoneIncallIndicator* self = new ( ELeave ) CPhoneIncallIndicator();
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CPhoneIncallIndicator::ConstructL
+// ---------------------------------------------------------
+//
+void CPhoneIncallIndicator::ConstructL()
+    {
+    iBubble = CAknIncallBubble::NewL();
+    iUpdater = CIdle::NewL( CActive::EPriorityHigh );
+    iUpdater->Start( TCallBack( DoUpdate, this ) );
+
+    iUpdateRecoveryId = CPhoneRecoverySystem::Instance()->AddL( 
+        TCallBack( DoRecoverUpdateL, this ),
+        CTeleRecoverySystem::EPhonePriorityStandard,
+        CTeleRecoverySystem::EPhoneStateIdle );   
+    }
+
+// ---------------------------------------------------------
+// CPhoneIncallIndicator::Update
+//
+// Shows the incall indicator according to current call state.
+// ---------------------------------------------------------
+//
+void CPhoneIncallIndicator::Update(
+    TPhoneCommandParam* aCommandParam )
+    {
+    TPhoneCmdParamIncallIndicatorData* incallIndicatorParam =
+        static_cast<TPhoneCmdParamIncallIndicatorData*>( aCommandParam );
+
+    iCallState = incallIndicatorParam->CallState();
+    iMode = incallIndicatorParam->Mode();    
+    iMuted = incallIndicatorParam->Mute();
+    iCipheringOff = !incallIndicatorParam->Ciphering();
+    iCipheringIndicatorAllowed = 
+        incallIndicatorParam->CipheringIndicatorAllowed();
+    iEmergency = incallIndicatorParam->Emergency();
+    iLine2 = incallIndicatorParam->Line2();
+    iVisible = incallIndicatorParam->LittleBubbleVisible();
+
+    Update();
+    }
+
+// ---------------------------------------------------------
+// CPhoneIncallIndicator::HandleMuteChange
+// ---------------------------------------------------------
+//
+void CPhoneIncallIndicator::HandleMuteChange( 
+    TPhoneCommandParam* aCommandParam )
+    {
+    TPhoneCmdParamBoolean* booleanParam =
+        static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+    iMuted = booleanParam->Boolean();
+
+    Update();
+    }
+
+// ---------------------------------------------------------
+// CPhoneIncallIndicator::HandleCipheringChange
+// ---------------------------------------------------------
+//
+void CPhoneIncallIndicator::HandleCipheringChange(  
+    TPhoneCommandParam* aCommandParam )
+    {
+    TPhoneCmdParamBoolean* booleanParam =
+        static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+    iCipheringOff = booleanParam->Boolean();
+
+    Update();
+    }
+
+// ---------------------------------------------------------
+// CPhoneIncallIndicator::Update
+//
+// Updates incall indicator according to current call state.
+// ---------------------------------------------------------
+//
+void CPhoneIncallIndicator::Update()
+    {
+    TInt state = KPhoneIncallIndicatorDefaultValue;
+    TBool sync = ETrue;
+
+    // Put base value appropriate to the state.
+    switch ( iCallState )
+        {
+        case EPSCTsyCallStateDialling:            
+            state = EAknStatusBubbleActive;
+            break;
+			
+        case EPSCTsyCallStateRinging:
+        case EPSCTsyCallStateAlerting:
+        case EPSCTsyCallStateAnswering:
+            state = EAknStatusBubbleAlerting;
+            sync = EFalse;
+            break;
+
+        case EPSCTsyCallStateConnected:
+            state = EAknStatusBubbleActive;
+            if ( iEmergency )
+                {
+                state |= EAknStatusBubbleEmergency;
+                }
+            break;
+
+        case EPSCTsyCallStateHold: // Held
+            state = EAknStatusBubbleOnHold;
+            break;
+
+        case EPSCTsyCallStateDisconnecting:
+            state = EAknStatusBubbleDisconnected;
+            break;
+
+        case EPSCTsyCallStateUninitialized:
+        case EPSCTsyCallStateNone:
+            iVisible = EFalse;
+            break;
+
+        default:
+            break;
+        }
+
+    // Put call mode flag if necessary.
+    switch ( iMode )
+        {
+        case EPSCTsyCallTypeFax:
+            state |= EAknStatusBubbleFax;
+            break;
+
+        case EPSCTsyCallTypeData:
+        case EPSCTsyCallTypeHSCSD:
+            state |= EAknStatusBubbleData;
+            break;
+        case EPSCTsyCallTypeH324Multimedia:
+            state |= EAknStatusBubbleVideo;
+            break;
+        case EPSCTsyCallTypeVoIP:
+            state |= EAknStatusBubbleVoIP;
+            break;
+        case EPSCTsyCallTypeNone:
+        case EPSCTsyCallTypeCSVoice: 
+        default:
+            break;
+        }
+    
+    if ( iMuted )
+        {
+        state |= EAknStatusBubbleMuted;
+        }
+
+    if ( iCipheringOff && iCipheringIndicatorAllowed )
+        {
+        state |= EAknStatusBubbleNoCiphering;
+        }
+        
+    if ( iLine2 )
+        {
+        state |= EAknStatusBubbleLine2;   
+        }
+
+    if ( iVisible )
+        {
+        state |= EAknStatusBubbleVisible;
+        }
+
+    SetState( state, sync );
+    }
+
+// ---------------------------------------------------------
+// CPhoneIncallIndicator::SetState
+//
+// Modify only if needed.
+// ---------------------------------------------------------
+//
+void CPhoneIncallIndicator::SetState( 
+    TInt aState,
+    TBool aSync )
+    {
+    if ( !aSync )
+        {
+        if ( aState != iState )
+            {
+            iState = aState;
+
+            if ( !iUpdater->IsActive() )
+                {
+                iUpdater->Start( TCallBack( DoUpdate, this ) );
+                }   
+            }
+        }
+    else
+        {
+        if ( aState != iState || iUpdater->IsActive() )
+            {
+            iState = aState;
+            UpdateWithRecovery();
+            iUpdater->Cancel();
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneIncallIndicator::UpdateWithRecovery
+// ---------------------------------------------------------
+//
+void CPhoneIncallIndicator::UpdateWithRecovery()
+    {
+    CPhoneRecoverySystem::Instance()->RecoverNow( 
+        iUpdateRecoveryId, 
+        CTeleRecoverySystem::EPhonePriorityStandard );
+    }
+
+// ---------------------------------------------------------
+// CPhoneIncallIndicator::DoRecoverUpdateL
+//
+// Callback function.
+// ---------------------------------------------------------
+//
+TInt CPhoneIncallIndicator::DoRecoverUpdateL( TAny* aAny )
+    {
+    CPhoneIncallIndicator* ind = static_cast<CPhoneIncallIndicator*>( aAny );
+
+    ind->iBubble->SetIncallBubbleFlagsL( ind->iState );
+
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------
+// CPhoneIncallIndicator::DoUpdate
+//
+// Callback function.
+// ---------------------------------------------------------
+//
+TInt CPhoneIncallIndicator::DoUpdate( TAny* aAny )
+    {
+    static_cast<CPhoneIncallIndicator*>( aAny )->UpdateWithRecovery();
+    
+    return KErrNone;
+    }
+
+//  End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonekeycapturecontroller.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,225 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 CPhoneKeyCaptureController class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <eikenv.h>
+#include <w32std.h>
+#include "cphonekeycapturecontroller.h"
+#include "tphonecmdparamKeycapture.h"
+#include "phoneconstants.h"
+#include "phonelogger.h"
+
+// ================= MEMBER FUNCTIONS =======================
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneKeyCaptureController::CPhoneKeyCaptureController( CEikonEnv& aEikEnv ): iEikEnv( aEikEnv )
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneKeyCaptureController::NewL()
+// Two-phased constructor
+// (other items were commented in a header).
+// ---------------------------------------------------------
+CPhoneKeyCaptureController* CPhoneKeyCaptureController::NewL( CEikonEnv& aEikEnv )
+    {
+    CPhoneKeyCaptureController* self = 
+        new( ELeave ) CPhoneKeyCaptureController( aEikEnv );
+    
+    return self;
+    }
+
+// ---------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------
+// 
+CPhoneKeyCaptureController::~CPhoneKeyCaptureController()
+    {
+    // should we have any captured keys, stop capturing now:
+    TInt capturedKeyCount = iCapturedKeys.Count();
+    for( TInt i = 0; i < capturedKeyCount ; i++ )
+        {
+        StopKeyCapture( iCapturedKeys[i] );
+        }
+
+    iCapturedKeys.Close();
+    }
+
+// ---------------------------------------------------------
+// CPhoneKeyCaptureController::StartCapturingKey
+// Starts capturing a key
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//      
+void CPhoneKeyCaptureController::StartCapturingKey( 
+    TPhoneCommandParam* aCommandParam ) 
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneKeyCaptureController::StartCapturingKey");
+    TPhoneCmdParamKeyCapture* keyCaptureParam = 
+        static_cast<TPhoneCmdParamKeyCapture*>( aCommandParam );
+
+    TInt32 handle = KErrNotFound;
+    TPhoneKeyCapture keyCapture;
+    
+    RWindowGroup& windowGroup = iEikEnv.RootWin();
+
+    if ( !IsKeyCaptured ( keyCaptureParam->Key() ) )
+        {
+        __PHONELOG1( 
+            EBasic, 
+            EPhoneUIView,
+            "Capture key %d here ", 
+            static_cast<TInt>( keyCaptureParam->Key() ) );
+
+        keyCapture.iKey = keyCaptureParam->Key();
+        keyCapture.iKeyCode = keyCaptureParam->KeyCode();
+        keyCapture.iHandle = 0; // set as initial value
+        keyCapture.iHandleForUpAndDown = 0; // set as initial value
+
+        switch( keyCaptureParam->CaptureType() )
+            {
+            case EPhoneKeyEvent:
+                keyCapture.iType = EPhoneKeyCaptureEvent;
+                keyCapture.iHandle = windowGroup.CaptureKey( 
+                    keyCapture.iKeyCode, 0, 0 );
+                handle = keyCapture.iHandle;
+                break;
+            case EPhoneKeyUpAndDownEvents:
+                keyCapture.iType = EPhoneKeyCaptureUpAndDownEvents;
+                keyCapture.iHandleForUpAndDown = 
+                    windowGroup.CaptureKeyUpAndDowns( 
+                    keyCapture.iKey, 0, 0 );
+                handle = keyCapture.iHandleForUpAndDown;
+                break;
+            default: // EPhoneKeyAllEvents
+                {
+                keyCapture.iType = EPhoneKeyCaptureAllEvents;
+                keyCapture.iHandle = windowGroup.CaptureKey( 
+                    keyCapture.iKeyCode, 0, 0 );
+                if ( keyCapture.iHandle >= 0 )
+                    {
+                    keyCapture.iHandleForUpAndDown = 
+                        windowGroup.CaptureKeyUpAndDowns( 
+                        keyCapture.iKey, 0, 0 );
+
+                    if ( keyCapture.iHandleForUpAndDown < 0 )
+                        {
+                        windowGroup.CancelCaptureKey( keyCapture.iHandle );
+                        }
+
+                    handle = keyCapture.iHandleForUpAndDown;
+                    }   
+                break;
+                }
+            } // switch
+
+        if ( handle >= 0 )
+            {
+            if ( iCapturedKeys.Append( keyCapture ) != KErrNone )
+                {
+                StopKeyCapture( keyCapture );
+                }
+            }
+        }   // if isKeyCaptured
+    }
+
+// ---------------------------------------------------------
+// CPhoneKeyCaptureController::StopCapturingKey
+// Stops capturing a key
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CPhoneKeyCaptureController::StopCapturingKey( 
+    TPhoneCommandParam* aCommandParam ) 
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneKeyCaptureController::StopCapturingKey");
+    TPhoneCmdParamKeyCapture* keyCaptureParam = 
+        static_cast<TPhoneCmdParamKeyCapture*>( aCommandParam );
+
+    const TInt capturedKeyCount = iCapturedKeys.Count();
+
+    __PHONELOG2( 
+        EBasic, 
+        EPhoneUIView,
+        "UnCapture key %d here (%d keys left)",
+        static_cast<TInt>( keyCaptureParam->Key() ), 
+        static_cast<TInt>( capturedKeyCount ) );
+
+    TBool foundKey = EFalse;
+
+    for( TInt i = 0; ( i < capturedKeyCount ) && !foundKey ; i++ )
+        {
+        if( iCapturedKeys[i].iKey == keyCaptureParam->Key() )
+            {
+            foundKey = ETrue;
+            StopKeyCapture( iCapturedKeys[i] );
+            iCapturedKeys.Remove(i);
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneKeyCaptureController::IsKeyCaptured
+// May be used to ask whether a key has been set to be captured
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//      
+TBool CPhoneKeyCaptureController::IsKeyCaptured( TStdScanCode aKey ) const
+    {
+    const TInt capturedKeyCount = iCapturedKeys.Count();
+    TBool isCaptured = EFalse;
+
+    for( TInt i = 0 ; ( i < capturedKeyCount ) && !isCaptured; i++ )
+        {
+        isCaptured = iCapturedKeys[i].iKey == aKey; 
+        }
+
+    return isCaptured;
+    }
+
+// ---------------------------------------------------------
+// CPhoneKeyCaptureController::StopKeyCapture
+// Stops capturing a key
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//      
+void CPhoneKeyCaptureController::StopKeyCapture( TPhoneKeyCapture aKeyCapture )
+    {
+    RWindowGroup& windowGroup = iEikEnv.RootWin();
+
+    switch ( aKeyCapture.iType )
+        {
+        case EPhoneKeyCaptureEvent:
+            windowGroup.CancelCaptureKey( aKeyCapture.iHandle );
+            break;
+        case EPhoneKeyCaptureUpAndDownEvents:
+            windowGroup.CancelCaptureKeyUpAndDowns( 
+                aKeyCapture.iHandleForUpAndDown );
+            break;
+        default: // EPhoneKeyCaptureAllEvents
+            {
+            windowGroup.CancelCaptureKey( aKeyCapture.iHandle );
+            windowGroup.CancelCaptureKeyUpAndDowns( 
+                aKeyCapture.iHandleForUpAndDown );
+            break;
+            }
+        }
+    }
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonelistquerydialog.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ListQueryDialog
+*
+*/
+
+
+// INCLUDES
+
+#include "cphonelistquerydialog.h"
+#include "mphonequeryobserver.h"
+#include "phoneui.hrh"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhoneListQueryDialog::CPhoneListQueryDialog(
+    MEikCommandObserver& aCommandObserver,
+    MPhoneQueryObserver& aQueryObserver, 
+    const RArray<TInt>& aCommands ) :
+    CAknListQueryDialog( &iIndex ), 
+    iCommandObserver( aCommandObserver ),
+    iQueryObserver ( aQueryObserver ) 
+    {
+    for ( TInt i( 0 ); i < aCommands.Count(); i++ )
+        {
+        iCommands.Append( aCommands[i] );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhoneListQueryDialog::~CPhoneListQueryDialog()
+    {
+    iCommands.Close(); 
+    iQueryObserver.SetQueryDeletedFlag( ETrue );
+    }
+    
+// ---------------------------------------------------------------------------
+// CPhoneListQueryDialog::OfferKeyEventL
+// ---------------------------------------------------------------------------
+//
+TKeyResponse CPhoneListQueryDialog::OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                                          TEventCode aType )
+    {
+    TKeyResponse ret = EKeyWasNotConsumed;
+    if ( aType == EEventKey &&
+        ( aKeyEvent.iScanCode == EStdKeyNo || aKeyEvent.iCode == EKeyNo ) )
+        {
+        OkToExitL( EPhoneCmdWaitNoteOk );
+        }       
+    else if ( aKeyEvent.iScanCode == EStdKeyYes )
+        {
+        ret =  EKeyWasConsumed;        
+        }    
+    else 
+        {
+        ret = CAknListQueryDialog::OfferKeyEventL( aKeyEvent, aType );              
+        }
+    
+    return ret;
+  
+    }    
+// ---------------------------------------------------------------------------
+// CPhoneListQueryDialog::PostLayoutDynInitL
+// 
+// 
+// ---------------------------------------------------------------------------
+//
+void CPhoneListQueryDialog::PostLayoutDynInitL()
+    {
+    CAknListQueryDialog::PostLayoutDynInitL();
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneListQueryDialog::OkToExitL
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneListQueryDialog::OkToExitL( TInt aKeyCode )
+    {    
+    if ( aKeyCode == EEikBidOk )
+        { 
+        if( !ListBox() )
+            {
+            User::Leave( KErrNotFound );
+            }
+        
+        TInt itemIndex = ListBox()->CurrentItemIndex();
+        
+        if( itemIndex >= iCommands.Count() || itemIndex < 0 )
+            {
+            User::Leave( KErrNotFound );
+            }
+        
+        iQueryObserver.ReportQueryCompleteAsync( iCommands [itemIndex] );        
+        }    
+    else if ( aKeyCode == EPhoneCmdWaitNoteOk )  
+        {
+        iQueryObserver.ReportQueryCompleteAsync( EPhoneCmdWaitNoteOk ); 
+        }
+    
+    return ETrue;
+    }
+    
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonemenucontroller.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,1062 @@
+/*
+* 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 CPhoneMenuController class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cphonemenucontroller.h"
+#include "tphonecommandparam.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamdynmenu.h"
+#include "tphonecmdparamboolean.h"
+#include "phoneconstants.h"
+#include "phonelogger.h"
+#include "tphonecmdparamincallindicatordata.h"
+#include "cphonepubsubproxy.h"
+#include "cphonecenrepproxy.h"
+
+
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikmenub.h> 
+#include <eikspane.h> 
+#include <featmgr.h>
+#include <ctsydomainpskeys.h>
+#include "phoneui.hrh"
+#include <phoneappvoipcommands.hrh>
+#include <phoneui.rsg>
+#include <telephonyvariant.hrh>
+
+#include <hwrmdomainpskeys.h>
+
+#include <AiwServiceHandler.h>
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPhoneMenuController::CPhoneMenuController
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneMenuController::CPhoneMenuController( CEikonEnv& aEikEnv ): 
+    iMenuResourceId( 0 ),
+    iOkMenuResourceId( 0 ),
+    iEikEnv( aEikEnv )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMenuController::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneMenuController::ConstructL()
+    {
+    iMenu = iEikEnv.AppUiFactory()->MenuBar();
+        
+    if ( FeatureManager::FeatureSupported( KFeatureIdMultimediaSharing ) )
+        {
+        __PHONELOG( EBasic, EPhoneUIView, "CPhoneViewController::CPhoneMenuController -> Going to instantiate CAiwServiceHandler");
+        //If multimedia sharing is supported, initialise instance to AIW handler
+        //and attach menu interest.        
+        iServiceHandler = CAiwServiceHandler::NewL();  
+        
+         // Attach menu service interests to AIW framework.
+        iServiceHandler->AttachMenuL( R_PHONEUI_CALLHANDLING_INCALL_OPTIONS_MENU,
+            R_PHONEUI_AIWSHARE_INTEREST );
+        __PHONELOG( EBasic, EPhoneUIView, "CPhoneViewController::CPhoneMenuController -> AIW Menu attached");       
+        }
+    
+    CPhonePubSubProxy::Instance()->NotifyChangeL(
+                                         KPSUidHWRM, KHWRMGripStatus, this );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMenuController::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPhoneMenuController* CPhoneMenuController::NewL( CEikonEnv& aEikEnv )
+    {   
+    CPhoneMenuController* self = new( ELeave ) CPhoneMenuController( aEikEnv );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// Destructor
+CPhoneMenuController::~CPhoneMenuController()
+    {
+    delete iServiceHandler;      
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::CloseMenuBar()
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::CloseMenuBar()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::CloseMenuBar()" );
+    iMenu->StopDisplayingMenuBar();
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::OpenMenuBar()
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::OpenMenuBarL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::OpenMenuBarL()" );
+    iMenu->SetMenuTitleResourceId( iMenuResourceId );
+    iMenu->TryDisplayMenuBarL();
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SetMenubarL
+// Set the Menubar to the specified setting
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::OpenMenuBarL( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::OpenMenuBarL()" );
+    // Check is the given parameter valid
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdInteger )
+        {
+        TPhoneCmdParamInteger* menuResource = 
+            static_cast<TPhoneCmdParamInteger*>( aCommandParam );
+
+        iMenuResourceId = menuResource->Integer();
+        ShowTaskSwapper( iMenuResourceId );
+
+        iMenu->SetMenuTitleResourceId( iMenuResourceId );
+        iMenu->TryDisplayMenuBarL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMenuController::IsSwivelClosed
+// This function checks from PubSubProxy that is
+// Swivel closed or not in product.
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneMenuController::IsSwivelClosed() const
+    {
+    if( CPhoneCenRepProxy::Instance()->
+            IsTelephonyFeatureSupported( KTelephonyLVFlagSwivelInDevice ))
+        {
+        return CPhonePubSubProxy::Instance()->Value(
+                                         KPSUidHWRM, KHWRMGripStatus ) == EPSHWRMGripClosed;        
+        }
+    else
+        {
+        return EFalse;
+        }
+
+    } 
+
+// ---------------------------------------------------------
+// CPhoneMenuController::DynInitMenuBar
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::DynInitMenuBar( 
+    TPhoneCommandParam* /*aCommandParam*/ )
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::DynInitMenuPaneL
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::DynInitMenuPaneL( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::DynInitMenuPaneL()" );
+    TPhoneCmdParamDynMenu* menu = 
+        static_cast<TPhoneCmdParamDynMenu*>( aCommandParam );
+
+    TInt resourceId = menu->ResourceId();
+    
+    __PHONELOG1( 
+        EBasic, 
+        EPhonePhoneapp, 
+        "CPhoneMenuController::DynInitMenuPaneL() - ResourceId = %d)", 
+        resourceId );
+ 
+    CEikMenuPane*  menuPane= 
+        reinterpret_cast<CEikMenuPane*>( menu->DynMenu() );
+ 
+    RArray<TInt> menuItemArray;
+    CleanupClosePushL( menuItemArray );
+
+    TInt menuItemCount = menuPane->NumberOfItemsInPane();
+    __PHONELOG1( 
+        EBasic, 
+        EPhonePhoneapp, 
+        "CPhoneMenuController::DynInitMenuPaneL() - MenuItemCount = %d)", 
+        menuItemCount );
+ 
+    // Menu items to array
+    for ( TInt i( 0 ); i < menuItemCount; i++ )
+        {
+        menuItemArray.Append( menuPane->MenuItemCommandId( i ) );
+        }
+    TBool onScreenDialer = FeatureManager::FeatureSupported( 
+                                    KFeatureIdOnScreenDialer );  
+                                           
+    // Menu items to be deleted 
+    for ( TInt i( 0 ); i < menuItemArray.Count(); i++ )
+        {
+        switch( menuItemArray[ i ] )
+            {
+            case EPhoneInCallCmdDialer:
+                if ( !onScreenDialer )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );    
+                    }
+                break;
+            case EPhoneInCallCmdLockKeypad:
+                if ( onScreenDialer || iHoldFlag )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );     
+                    }
+                break;
+            case EPhoneInCallCmdLockScreen:
+                if ( !onScreenDialer || iHoldFlag )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );     
+                    }
+                break;
+            case EPhoneNumberAcqCmdCall:
+                if ( onScreenDialer && iNumberEntryEmpty )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] ); 
+                    }
+                else if ( iServiceCodeFlag )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );
+                    }
+                break;
+                
+            case EPhoneNumberAcqCmdVideoCall:
+                if ( iServiceCodeFlag && 
+                     FeatureManager::FeatureSupported( 
+                         KFeatureIdVideocallMenuVisibility ))
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );
+                    }
+                else if( !( FeatureManager::FeatureSupported( 
+                        KFeatureIdCsVideoTelephony ) ) )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );
+                    }
+                break;
+ 
+            case EPhoneNumberAcqCmdSendMessage:            
+                if ( iNumberEntryEmpty )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] ); 
+                    }
+                break;                    
+                                
+            case EPhoneNumberAcqCmdSendCommand:
+                if ( !iServiceCodeFlag || iNumberEntryEmpty )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );
+                    }
+                break;
+                
+            case EPhoneNumberAcqCmdToggleNeAlphaMode:
+                if ( iAlphaMode )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );
+                    }
+                break;
+                         
+            case EPhoneNumberAcqCmdToggleNeNumericMode:
+                if ( !iAlphaMode )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );
+                    }
+                break;
+                
+                
+            case EPhoneInCallCmdGoToIdle:
+                if ( iNEVisible )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );    
+                    }
+                break;
+                
+            case EPhoneInCallCmdMute:
+                if ( iMuteFlag )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );
+                    }
+                break;
+                
+            case EPhoneInCallCmdUnmute:
+                if ( !iMuteFlag )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );
+                    }
+                break;
+                
+            case EPhoneInCallCmdHold: // fall through
+            case EPhoneInCallCmdConferenceHold:
+                if ( iHoldFlag && !iConferenceAndSingleFlag )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );
+                    }
+                break;
+                
+            case EPhoneInCallCmdDtmfListQuery:
+                if ( ( iHoldFlag && !iAllowDtmfOptionsFlag ) || iHideVideoCallDTMFVisibility )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );
+                    }
+                break;
+                
+            case EPhoneInCallCmdSwitchToVideo:
+                if( !iPhoneNumberAvailableInPhoneEngine  ||
+                    !( FeatureManager::FeatureSupported( 
+                            KFeatureIdCsVideoTelephony ) ) )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );                    
+                    }
+                 break;
+            case EPhoneInCallCmdSwitchToVoice:
+                if( !iPhoneNumberAvailableInPhoneEngine )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );                    
+                    }
+                break;
+                
+            case EPhoneCallComingCmdSoftReject:
+                if ( !iSoftRejectFlag )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );
+                    }
+                break;
+                
+            case EPhoneCallComingCmdAnswerHandPortableVideo:
+                if ( iWiredAccAvailableFlag || IsSwivelClosed() )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );        
+                    }
+                break;   
+                  
+            case EPhoneCallComingCmdAnswerHandPortable:
+                if ( !iBTAccAvailableFlag )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );
+                    }
+                 break;
+                 
+            case EPhoneInCallCmdConferenceUnhold: // fall through
+            case EPhoneInCallCmdUnhold:
+                if ( !iHoldFlag )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );
+                    }
+                break;
+                
+            case EPhoneInCallCmdCreateConference:
+                // Remove conference submenu item if:
+                // 1. Specific flag is set (calls are different type) OR
+                // 2. We are in Conference And Single state where the conference call is on hold and there
+                //    are maximum amount of participants in conference call (can't add single to the conference) OR
+                // 3. Conference call is on hold and we are in some other conference state than Conference And Single
+                if ( iRemoveConfrenceOptionsFlag || ( iHoldFlag && iConferenceAndSingleFlag && iMaxConfMembersFlag ) ||
+                     ( iHoldFlag && !iConferenceAndSingleFlag ) )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );
+                    }
+                break;
+                                
+            case EPhoneInCallCmdJoin:
+                 if( iMaxConfMembersFlag || iRemoveConfrenceOptionsFlag )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );
+                    }
+                break;
+                
+            case EPhoneInCallCmdReplace:
+                if ( !iReplace )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );
+                    }
+                break;
+                
+            case EPhoneInCallCmdActivateIhf:
+                if ( iWiredAccFlag || iIhfFlag )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );
+                    }
+                break;
+                
+            case EPhoneInCallCmdDeactivateIhf:
+                if ( iWiredAccFlag || !iIhfFlag || IsSwivelClosed() )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );
+                    }
+                break;
+                
+            case EPhoneInCallCmdBtHandsfree:
+                if ( iBTAccTmpUnFlag && !iWiredAccFlag  )
+                    {
+                    // None
+                    }
+                else
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[i] );
+                    }    
+                break;
+
+            case EPhoneInCallCmdHandset:
+                if ( iBTAccFlag && !iWiredAccFlag )
+                    {
+                    if ( IsSwivelClosed() )
+                        {
+                        menuPane->DeleteMenuItem( menuItemArray[i] );
+                        }
+                    }
+                 else
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[i] );
+                    }   
+                break; 
+
+            case EPhoneDialerCallHandling:
+                {
+                // no active call
+                if ( onScreenDialer && !iCallInProgress )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[i] );                    
+                    }                
+                }
+                break;
+            case EPhoneDialerCmdLog:
+                {
+                if ( onScreenDialer && !iNumberEntryEmpty  )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[i] );                    
+                    }                
+                }
+                break;
+            case EPhoneDialerCmdContacts:
+                {
+                if ( onScreenDialer && !iNumberEntryEmpty   )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[i] );                    
+                    }                
+                }
+                break;
+
+            case EPhoneNumberAcqCmdAddToContacts:
+                {
+                if ( onScreenDialer && iNumberEntryEmpty   )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[i] );                    
+                    }                
+                }
+                break;
+            case EPhoneDialerCmdSpeedDial:
+                {
+                if ( onScreenDialer && !iNumberEntryEmpty )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[i] );                         
+                    }
+                }
+                break;
+            case EPhoneCmdDtmfOk:
+                {
+                if ( onScreenDialer && iNumberEntryEmpty )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[i] );                     
+                    }
+                }
+                break;
+           case EPhoneInCallCmdPrivate:
+                {
+                if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) &&
+                    iHoldFlag && 
+                    iConferenceParticipantsListOpenFlag )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[i] );                      
+                    }
+                }
+                break;
+            case EPhoneDialerCmdTouchInput:
+                {
+                if ( !FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[i] );      
+                    }
+                }
+                break;
+            case EPhoneVideoSharing:
+                {
+                if( !FeatureManager::FeatureSupported( KFeatureIdMultimediaSharing ) )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[i] );      
+                    }
+                }
+                break;
+                
+            default:
+                break;                                                                                                
+             
+            }
+        }
+    
+    CleanupStack::PopAndDestroy(); // CleanupClosePushL
+    
+    if ( FeatureManager::FeatureSupported( KFeatureIdMultimediaSharing ) )
+        {
+        if( iServiceHandler->HandleSubmenuL( *menuPane ) )
+            {
+            // AIW handled this
+            __PHONELOG( EBasic, EPhoneUIView, "CPhoneViewController::CPhoneMenuController -> AIW handled this sub menu");
+            return;                
+            }
+            
+        if( iServiceHandler->IsAiwMenu( resourceId ) )
+            {
+            __PHONELOG( EBasic, EPhoneUIView, "CPhoneViewController::CPhoneMenuController -> Resource is in AIW menu");
+            iServiceHandler->InitializeMenuPaneL( 
+                *menuPane, 
+                resourceId, 
+                EPhoneVideoSharing, 
+                iServiceHandler->InParamListL() );                
+            __PHONELOG( EBasic, EPhoneUIView, "CPhoneViewController::CPhoneMenuController -> AIW menu initialized");
+            }        
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::AddMenuPaneL
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::AddMenuPaneL(
+    TInt /*aPaneResourceId*/,
+    CEikMenuPane* /*aMenuPane*/,
+    TBool /*aAddSeparator*/ )
+    { 
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SetMuteFlag
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SetMuteFlag( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::SetMuteFlag()" );
+    // Check is the given parameter valid
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* muteFlag = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+        iMuteFlag = muteFlag->Boolean();
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SetIhfFlag
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SetIhfFlag( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::SetIhfFlag()" );
+    // Check is the given parameter valid
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* ihfFlag = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+        iIhfFlag = ihfFlag->Boolean();
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SetHoldFlag
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SetHoldFlag( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::SetHoldFlag()" );
+    // Check is the given parameter valid
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* holdFlag = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+        iHoldFlag = holdFlag->Boolean();
+        }
+    }
+    
+// ---------------------------------------------------------
+// CPhoneMenuController::GetHoldFlag
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::GetHoldFlag( 
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::GetHoldFlag()" );
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* booleanValue = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+        booleanValue->SetBoolean( iHoldFlag );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SetConferenceAndSingleFlag
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SetConferenceAndSingleFlag( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::SetConferenceAndSingleFlag()" );
+    // Check is the given parameter valid
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* conferenceAndSingleFlag = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+        iConferenceAndSingleFlag = conferenceAndSingleFlag->Boolean();
+        }
+    }
+    
+// ---------------------------------------------------------
+// CPhoneMenuController::GetConferenceAndSingleFlag
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::GetConferenceAndSingleFlag( 
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::GetConferenceAndSingleFlag()" );
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* booleanValue = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+        booleanValue->SetBoolean( iConferenceAndSingleFlag );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SetSoftRejectFlag
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SetSoftRejectFlag(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::SetSoftRejectFlag()" );
+    // Check is the given parameter valid
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* softRejectFlag = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+        iSoftRejectFlag = softRejectFlag->Boolean();
+        }
+    }
+    
+// ---------------------------------------------------------
+// CPhoneMenuController::GetSoftRejectFlag
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::GetSoftRejectFlag(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::GetSoftRejectFlag()" );
+    // Check is the given parameter valid
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* softRejectFlag = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+        softRejectFlag->SetBoolean( iSoftRejectFlag );
+        }
+    }
+    
+// ---------------------------------------------------------
+// CPhoneMenuController::SetServiceCodeFlag
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SetServiceCodeFlag( 
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::SetServiceCodeFlag()" );
+    // Check is the given parameter valid
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* serviceCodeFlag = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+        iServiceCodeFlag = serviceCodeFlag->Boolean();
+        }
+    }
+    
+// ---------------------------------------------------------
+// CPhoneMenuController::SetWiredAccFlag
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SetWiredAccFlag( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::SetWiredAccFlag()" );
+    // Check is the given parameter valid
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* accFlag = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+        iWiredAccFlag = accFlag->Boolean();
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SetWiredAccAvailableFlag
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SetWiredAccAvailableFlag( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::SetWiredAccAvailableFlag()" );
+    // Check is the given parameter valid
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* accFlag = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+        iWiredAccAvailableFlag = accFlag->Boolean();
+        
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SetMaxConfMembersFlag
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SetMaxConfMembersFlag( TBool aIsMaxConfMembers )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::SetMaxConfMembersFlag()" );
+    iMaxConfMembersFlag = aIsMaxConfMembers;
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SetBTAccFlag
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SetBTAccFlag( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::SetBTAccFlag()" );
+    // Check is the given parameter valid
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* accFlag = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+        iBTAccFlag = accFlag->Boolean();
+        iBTAccTmpUnFlag = iBTAccAvailableFlag && !iBTAccFlag;
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SetBTAccAvailableFlag
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SetBTAccAvailableFlag( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::SetBTAccAvailableFlag()" );
+    // Check is the given parameter valid
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* accFlag = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+        iBTAccAvailableFlag = accFlag->Boolean();
+        iBTAccTmpUnFlag = iBTAccAvailableFlag && !iBTAccFlag;
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SetNEVisibleFlag
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SetNEVisibleFlag( TBool aVisible )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::SetNEVisibleFlag()" );
+    iNEVisible = aVisible;
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SetReplaceFlag
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SetReplaceFlag( TBool aReplace )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::SetReplaceFlag()" );
+    iReplace = aReplace;
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SetPhoneNumberAvailableInPhoneEngine
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SetPhoneNumberAvailableInPhoneEngine( 
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::SetPhoneNumberAvailableInPhoneEngine()" );
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* phoneNumberAvailable = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+        iPhoneNumberAvailableInPhoneEngine = phoneNumberAvailable->Boolean();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMenuController::ShowTaskSwapper
+// 
+// Decide if TaskSwapper is to be shown in menu.
+// -----------------------------------------------------------------------------
+//
+void CPhoneMenuController::ShowTaskSwapper( TInt aResourceId ) const
+    {
+    if ( aResourceId == R_PHONEUI_NUMBERACQ_OK_MENUBAR ||
+         aResourceId == R_PHONEUI_INCOMINGVIDEOCALL_MENUBAR || 
+         aResourceId == R_PHONEUI_INCOMINGCALL_MENUBAR ||
+         aResourceId == R_PHONEUI_INCOMINGCALL_MENUBAR_WITH_NUMBERENTRY ||
+         aResourceId == R_PHONEUI_INCOMINGVIDEOCALL_MENUBAR_WITH_NUMBERENTRY ||
+         aResourceId == R_PHONEUI_WAITING_LOCK_MENUBAR ||
+         aResourceId == R_PHONEUI_TWOSINGLES_WAITING_LOCK_MENUBAR  )
+        {
+        iMenu->SetMenuType( CEikMenuBar::EMenuOptionsNoTaskSwapper );
+        }
+    else
+        {
+        iMenu->SetMenuType( CEikMenuBar::EMenuOptions );
+        }
+    }    
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SendAiwCommandL
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SendAiwCommandL( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::SendAiwCommandL()" );
+    if( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdInteger )
+        {
+        TPhoneCmdParamInteger* command =
+            static_cast<TPhoneCmdParamInteger*>( aCommandParam );
+        CAiwGenericParamList& in = iServiceHandler->InParamListL();
+        iServiceHandler->ExecuteMenuCmdL( command->Integer(),
+                                          in,
+                                          iServiceHandler->OutParamListL() );                
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneMenuController::SetContextMenu
+// ---------------------------------------------------------------------------
+//
+void CPhoneMenuController::SetContextMenu( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, 
+                         "CPhoneMenuController::SetContextMenu" );
+    if( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdInteger )
+        {
+        TPhoneCmdParamInteger* command =
+               static_cast<TPhoneCmdParamInteger*>( aCommandParam );
+        iMenu->SetContextMenuTitleResourceId( command->Integer() );
+        
+        }
+    
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SetRemoveConfrenceOptionsFlag
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SetRemoveConfrenceOptionsFlag( TBool aRemoveConfrenceOptions )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::SetRemoveConfrenceOptionsFlag()" );
+    iRemoveConfrenceOptionsFlag = aRemoveConfrenceOptions;
+    }
+    
+// ---------------------------------------------------------
+// CPhoneMenuController::SetNumberEntryEmptyFlag
+// ---------------------------------------------------------
+//    
+void CPhoneMenuController::SetNumberEntryEmptyFlag( TBool aNumberEntryEmpty )
+    {
+    iNumberEntryEmpty = aNumberEntryEmpty;
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SetCallInProgressFlag
+// ---------------------------------------------------------
+// 
+void CPhoneMenuController::SetCallInProgressFlag( TPhoneCommandParam* aCommandParam )
+    {
+    TPhoneCmdParamIncallIndicatorData* param =
+        static_cast<TPhoneCmdParamIncallIndicatorData*>( aCommandParam );
+
+    TInt callState = param->CallState();    
+    switch ( callState )
+        {
+        case EPSCTsyCallStateAlerting:
+        case EPSCTsyCallStateRinging:
+        case EPSCTsyCallStateDialling:
+        case EPSCTsyCallStateAnswering:
+        case EPSCTsyCallStateConnected:
+        case EPSCTsyCallStateHold: 
+            {
+            //call in progress
+            iCallInProgress = ETrue;
+            break;
+            }                 
+        default:
+            {
+            iCallInProgress = EFalse;
+             //call not in progress
+            break;
+            } 
+        }
+    }
+    
+// ---------------------------------------------------------
+// CPhoneMenuController::IsMenuBarVisible()
+// ---------------------------------------------------------
+//
+TBool CPhoneMenuController::IsMenuBarVisible()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::IsMenuBarVisible()" );
+    return iMenu->IsDisplayed();
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SetConferenceParticipantsListVisibleFlag()
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SetConferenceParticipantsListVisibleFlag( 
+                                        TPhoneCommandParam* aCommandParam )
+    {
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* participantsListOpenFlag = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );  
+        iConferenceParticipantsListOpenFlag = participantsListOpenFlag->Boolean();
+        }    
+    }
+
+//-------------------------------------------------------------------------------
+// CPhoneMenuController::GetConferenceParticipantsListVisibleFlag
+//-------------------------------------------------------------------------------
+void CPhoneMenuController::GetConferenceParticipantsListVisibleFlag(
+        TPhoneCommandParam* aCommandParam )
+    {
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* participantsListOpenFlag = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );  
+        participantsListOpenFlag->SetBoolean( iConferenceParticipantsListOpenFlag );
+        } 
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SetAlphaModeFlag
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SetAlphaModeFlag( TBool aMode )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::SetAlphaModeFlag()" );
+    iAlphaMode = aMode;
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SetAllowDtmfOptionsFlag
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SetAllowDtmfOptionsFlag( TBool aMode )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::SetAllowDtmfOptionsFlag()" );
+    iAllowDtmfOptionsFlag = aMode;
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SetHideVideoCallDTMFVisibility
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SetHideVideoCallDTMFVisibilityFlag( TBool aHideVideoCallDTMFVisibility )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::SetHideVideocallDTMFVisibility()" );
+    iHideVideoCallDTMFVisibility = aHideVideoCallDTMFVisibility;
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::SetVoipEnabledFlag
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::SetVoipEnabledFlag(  
+                                        TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::SetVoipEnabledFlag()" );
+    
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* voipEnabled = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );  
+        iVoipEnabledFlag = voipEnabled->Boolean();
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneMenuController::HandlePropertyChangedL
+// ---------------------------------------------------------
+//
+void CPhoneMenuController::HandlePropertyChangedL( 
+        const TUid& aCategory,
+        const TUint aKey,
+        const TInt aValue )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneMenuController::HandlePropertyChangedL()" );
+    __PHONELOG1( EBasic, EPhoneUIView, 
+            "CPhoneMenuController::HandlePropertyChangedL - aCategory= %d", aCategory  );      
+    __PHONELOG1( EBasic, EPhoneUIView, 
+            "CPhoneMenuController::HandlePropertyChangedL - aKey= %d", aKey  );  
+    __PHONELOG1( EBasic, EPhoneUIView, 
+            "CPhoneMenuController::HandlePropertyChangedL - aValue= %d", aValue  );
+    if ( aCategory == KPSUidHWRM && 
+         aKey == KHWRMGripStatus && 
+         aValue != EPSHWRMGripStatusUninitialized && 
+         iMenu->IsDisplayed()  )
+        {
+        CloseMenuBar();
+        }
+    }
+
+     
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonenote.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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: Implementation of CPhoneNote class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cphonenote.h"
+#include "phoneui.hrh"
+#include <featmgr.h>
+
+// ================= MEMBER FUNCTIONS =======================
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneNote::CPhoneNote( CEikDialog** aSelfPtr, MEikCommandObserver& aCommandObserver ) :
+    CAknNoteDialog( aSelfPtr ),
+    iCommandObserver( aCommandObserver ) 
+    {
+    }
+
+// ---------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------
+// 
+CPhoneNote::~CPhoneNote()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneNote::OfferKeyEventL
+// ---------------------------------------------------------
+//
+TKeyResponse CPhoneNote::OfferKeyEventL( 
+    const TKeyEvent& aKeyEvent,
+    TEventCode /*aType*/ )
+    {
+	if ( ( aKeyEvent.iScanCode == EStdKeyNo || aKeyEvent.iCode == EKeyNo )
+		&& iNoteType != EPhoneNoteSecurity )
+		{
+		OkToExitL( EPhoneCmdWaitNoteOk );
+		return EKeyWasNotConsumed;
+		}        
+	else
+		{
+		// Let key events be handled by the application
+	    return EKeyWasNotConsumed;		
+		}
+    }
+
+// ---------------------------------------------------------
+// CPhoneNote::OkToExitL
+// ---------------------------------------------------------
+//
+TBool CPhoneNote::OkToExitL( TInt aCommand )
+    {
+    // Let the command observer process the command
+    iCommandObserver.ProcessCommandL( aCommand );
+
+    return EFalse; // so that the dialog will not disappear
+    }
+    
+// ---------------------------------------------------------
+// CPhoneNote::SetNoteType
+// ---------------------------------------------------------
+//
+void CPhoneNote::SetNoteType( TPhoneNoteType aNoteType )
+    {
+    iNoteType = aNoteType;
+    }
+
+// ---------------------------------------------------------
+// CPhoneNote::NoteType
+// ---------------------------------------------------------
+//
+TPhoneNoteType CPhoneNote::NoteType()
+    {
+    return iNoteType;
+    }
+
+// ---------------------------------------------------------
+// CPhoneNote::HandlePointerEventL
+// ---------------------------------------------------------
+//
+void CPhoneNote::HandlePointerEventL( 
+    const TPointerEvent& aPointerEvent )
+    {
+    if( ( iNoteType == EPhoneNoteError ) ||
+        ( iNoteType == EPhoneNoteWarning ) ||
+        ( iNoteType == EPhoneNoteInformation ) ||
+        ( iNoteType ==  EPhoneNoteConfirmation) ||
+        ( iNoteType == EPhoneNoteCustom ))
+        {
+        CEikDialog::HandlePointerEventL( aPointerEvent );
+        }
+     }
+
+// ---------------------------------------------------------
+// CPhoneNote::UpdateSoftkeysL
+// ---------------------------------------------------------
+//
+void CPhoneNote::UpdateSoftkeysL( TInt aResourceId )
+    {
+    CEikButtonGroupContainer& buttonGroup = ButtonGroupContainer();
+    buttonGroup.SetCommandSetL( aResourceId );
+    
+    buttonGroup.DrawDeferred();    
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonenotecontroller.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,608 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 CPhoneNoteController class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cphonenotecontroller.h"
+
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikprogi.h>
+#include <StringLoader.h>
+#include <aknnotedialog.h> // for CAknNoteDialog
+#include <AknGlobalNote.h> // for CAknGlobalNote
+
+#include "phoneui.pan"
+#include "tphonecommandparam.h"
+#include "tphonecmdparamnote.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparamprogressnote.h" 
+#include "tphonecmdparamglobalnote.h"
+#include "tphonecmdparaminteger.h"
+#include "phoneconstants.h"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+#include "phonelogger.h"
+#include "cphonetimer.h"
+#include "cphonenote.h"
+#include "cphonedtmfsendingnote.h"
+#include "cphoneuidisablednote.h"
+
+// CONSTANTS
+const TInt KPhoneIntervalDivider = 100;
+// ================= MEMBER FUNCTIONS =======================
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneNoteController::CPhoneNoteController( CEikonEnv& aEikEnv ) : iGlobalNoteId( KErrNotFound ), 
+                                                                   iEikEnv( aEikEnv ),
+                                                                   iNoteText( NULL )
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneNoteController::NewL()
+// Two-phased constructor
+// (other items were commented in a header).
+// ---------------------------------------------------------
+CPhoneNoteController* CPhoneNoteController::NewL( CEikonEnv& aEikEnv )
+    {   
+    CPhoneNoteController* self = 
+        new( ELeave ) CPhoneNoteController( aEikEnv );
+    
+    return self;
+    }
+
+// ---------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------
+// 
+CPhoneNoteController::~CPhoneNoteController()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneNoteController::~CPhoneNoteController");
+    DestroyNote();
+    DestroyProgressNote();
+    }
+
+// ---------------------------------------------------------
+// CPhoneNoteController::CreateNoteL
+// ---------------------------------------------------------
+//
+void CPhoneNoteController::CreateNoteL( 
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneNoteController::CreateNoteL");
+    TInt resourceId = 0;
+    CAknNoteDialog::TTone tone = CAknNoteDialog::ENoTone;
+    CAknNoteDialog::TTimeout timeout = CAknNoteDialog::ENoTimeout;
+
+    TPhoneCmdParamNote* noteParam = static_cast<TPhoneCmdParamNote*>(
+        aCommandParam );
+    
+    if( iNote && noteParam->Type() == EPhoneNoteDtmfSending )
+        {
+        // Dtmf sending ongoing.
+        UpdateNoteTextL( aCommandParam );
+        return;
+        }
+    
+    // Delete the existing note
+    DestroyNote();
+
+    // Setup parameters according to the type of note
+    switch ( noteParam->Type() )
+        {
+        case EPhoneNoteError:
+            resourceId = CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneInformationErrorNote );
+            timeout = CAknNoteDialog::ELongTimeout;
+            tone = CAknNoteDialog::EErrorTone;
+            break;
+            
+        case EPhoneNoteWarning:
+            resourceId = CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneInformationWarningNote );
+            timeout = CAknNoteDialog::ELongTimeout;
+            tone = CAknNoteDialog::EWarningTone;
+            break;
+            
+        case EPhoneNoteConfirmation:
+            resourceId = CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneInformationConfirmationNote );
+            timeout = CAknNoteDialog::EShortTimeout;
+            tone = CAknNoteDialog::EConfirmationTone;
+            break;
+            
+        case EPhoneNoteInformation:
+            resourceId = CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneInformationNote );
+            timeout = CAknNoteDialog::ELongTimeout;
+            tone = CAknNoteDialog::ENoTone;
+            break;
+        
+        case EPhoneNoteSecurity:
+        case EPhoneNoteCustom: // Fall through
+        case EPhoneNotePermanent:
+        case EPhoneNoteDtmfSending:
+            // Use the specified values
+            resourceId = noteParam->ResourceId();
+            timeout = noteParam->Timeout();
+            tone = noteParam->Tone();
+            break;
+
+        case EPhoneNoteUIDisabled:
+            // Use the specified values
+            resourceId = noteParam->ResourceId();
+            timeout = CAknNoteDialog::ENoTimeout;
+            tone = CAknNoteDialog::ENoTone;
+            break;
+            
+        default:
+            Panic( EPhoneViewCaseNotHandled );
+            break;
+        }
+
+	// Create correct note
+	if( noteParam->Type() == EPhoneNoteDtmfSending )
+		{
+		iNote = new ( ELeave ) CPhoneDtmfSendingNote( reinterpret_cast<CEikDialog**>( &iNote ), *iEikEnv.EikAppUi() );						
+		}
+	else if( noteParam->Type() == EPhoneNoteUIDisabled )
+        {
+        iNote = new ( ELeave ) CPhoneUIDisabledNote( reinterpret_cast<CEikDialog**>( &iNote ), *iEikEnv.EikAppUi() );
+        }
+	else
+		{
+		iNote = new ( ELeave ) CPhoneNote( reinterpret_cast<CEikDialog**>( &iNote ), *iEikEnv.EikAppUi() );			
+		}
+
+    // Override text if specified
+    if ( noteParam->Text().Length() )
+        {
+        if( !iNoteText )
+            {
+			iNoteText = noteParam->Text().AllocL();	            	
+            }
+        iNote->SetTextL( *iNoteText );
+        }
+    else if ( noteParam->TextResourceId() )
+        {
+        // Get the text associated with the resource Id
+        TBuf<KPhoneMaxCharsInNote> noteText;
+        StringLoader::Load( 
+            noteText, 
+            noteParam->TextResourceId(), 
+            &iEikEnv );
+
+        iNote->SetTextL( noteText );
+        }
+
+    // Override tone if specified
+    if ( tone != CAknNoteDialog::ENoTone )
+        {
+        iNote->SetTone( tone );
+        }
+
+    // Override timeout if specified
+    if ( timeout != CAknNoteDialog::ENoTimeout )
+        {
+        iNote->SetTimeout( timeout );
+        }
+    
+    iNote->SetNoteType( noteParam->Type() );
+ 
+    // Display the note
+	iNote->ExecuteLD( resourceId );
+    }
+
+// ---------------------------------------------------------
+// CPhoneNoteController::DestroyNote
+// ---------------------------------------------------------
+//
+void CPhoneNoteController::DestroyNote()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneNoteController::DestroyNote");
+    
+    // Delete note text if exists
+    if( iNoteText )
+        {
+        delete iNoteText;
+        iNoteText = NULL;            
+        }
+    
+    // Delete the note if it exists
+    if ( iNote )
+        {
+        delete iNote;
+        iNote = NULL;
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneNoteController::DestroyDTMFNote
+// ---------------------------------------------------------
+//
+void CPhoneNoteController::DestroyDTMFNote()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneNoteController::DestroyDTMFNote");
+   
+    // Delete DTFM note if exists
+    if ( iNote && ( iNote->NoteType() == EPhoneNoteDtmfSending ) )
+        {
+        // Delete note text if exists
+        if( iNoteText )
+            {
+            delete iNoteText;
+            iNoteText = NULL;            
+            }
+        delete iNote;
+        iNote = NULL;
+        }
+    }
+
+
+// ---------------------------------------------------------
+// CPhoneNoteController::DestroyGlobalNoteL
+// ---------------------------------------------------------
+//
+void CPhoneNoteController::DestroyGlobalNoteL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneNoteController::DestroyGlobalNoteL");
+    if( iGlobalNoteId != KErrNotFound )
+        {
+        CAknGlobalNote* glbNote = CAknGlobalNote::NewLC();
+        glbNote->CancelNoteL( iGlobalNoteId );
+        CleanupStack::PopAndDestroy( glbNote );        
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneNoteController::CreateGlobalNoteL
+// ---------------------------------------------------------
+//
+void CPhoneNoteController::CreateGlobalNoteL(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneNoteController::CreateGlobalNoteL");
+    TPhoneCmdParamGlobalNote* globalNoteParam = 
+        static_cast<TPhoneCmdParamGlobalNote*>( aCommandParam );
+    TBuf<KPhoneMaxCharsInNote> noteText;
+
+    // Check if the resource Id is specified
+    if ( globalNoteParam->TextResourceId() )
+        {
+        if ( globalNoteParam->Text().Length() )
+            {
+            HBufC* loadedText = StringLoader::LoadL( 
+                globalNoteParam->TextResourceId(), 
+                globalNoteParam->Text(), 
+                CCoeEnv::Static() );
+            noteText.Copy( *loadedText );
+            delete loadedText;
+            }
+        else
+            {
+            StringLoader::Load( 
+                noteText, 
+                globalNoteParam->TextResourceId(), 
+                &iEikEnv );
+            }
+        }
+    else if ( globalNoteParam->Text() != KNullDesC )
+        {
+        noteText.Copy( globalNoteParam->Text() );
+        }
+
+    if ( noteText.Length() > 0 )
+        {
+        CAknGlobalNote* glbNote = CAknGlobalNote::NewLC();
+
+        // Set the tone
+        glbNote->SetTone( globalNoteParam->Tone() );
+        if ( globalNoteParam->Softkeys())
+            {
+            glbNote->SetSoftkeys(  globalNoteParam->Softkeys() );   
+            }
+
+        // Show the global note
+        
+        if ( globalNoteParam->WaitForReady() )
+            {
+            TRequestStatus NoteReady;
+            iGlobalNoteId = glbNote->ShowNoteL( NoteReady, globalNoteParam->Type(), noteText );
+            User::WaitForRequest( NoteReady );
+            }
+        else
+            {
+            iGlobalNoteId = glbNote->ShowNoteL( globalNoteParam->Type(), noteText );
+            }
+        CleanupStack::PopAndDestroy( glbNote );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneNoteController::CreateProgressNoteL
+// ---------------------------------------------------------
+//
+void CPhoneNoteController::CreateProgressNoteL(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneNoteController::CreateProgressNoteL");
+    TPhoneCmdParamProgressNote* noteParam = static_cast<
+        TPhoneCmdParamProgressNote*>(aCommandParam );
+
+    TInt resourceId = noteParam->ResourceId();
+    iStartTime.UniversalTime();
+    
+    TTimeIntervalMicroSeconds32 waitTime =
+        noteParam->WaitTime();
+        
+    if( !iProgressUpdateTimer )
+        {
+        iProgressUpdateTimer = CPhoneTimer::NewL();            
+        }
+
+    iWaitTime = waitTime.Int();
+    
+    TInt final = waitTime.Int();
+    iInterval = final / KPhoneIntervalDivider;
+    iProgressBarCount = 0;
+        
+    iProgressUpdateTimer->After( iInterval, this );
+        
+    CPhoneProgressNote* dlg = 
+        new ( ELeave ) CPhoneProgressNote(
+             ( reinterpret_cast< CEikDialog** >( &iProgressNote )),
+             static_cast<MEikCommandObserver*>( iEikEnv.EikAppUi() ) );
+
+    iProgressNote = dlg;
+    dlg->PrepareLC( resourceId );
+
+    CEikProgressInfo* info = dlg->GetProgressInfoL();
+    
+    if ( info )
+        {
+        info->SetFinalValue( KPhoneIntervalDivider );
+        }
+    
+    dlg->RunLD();        
+    }
+    
+// ---------------------------------------------------------
+// CPhoneNoteController::DestroyProgressBar
+// ---------------------------------------------------------
+//
+void CPhoneNoteController::DestroyProgressNote()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneNoteController::DestroyProgressNote");
+
+    // Delete the progress note if it exists
+    if ( iProgressNote )
+        {
+        delete iProgressNote;
+        iProgressNote = NULL;
+        }
+    if ( iProgressUpdateTimer )
+        {
+        if( iProgressUpdateTimer->IsActive() )
+            {
+            iProgressUpdateTimer->CancelTimer();                
+            }
+            
+        delete iProgressUpdateTimer;
+        iProgressUpdateTimer = NULL;            
+        }
+    iProgressBarCount = 0; 
+    }
+    
+// ---------------------------------------------------------
+// CPhoneNoteController::HandleTimeOutL
+// ---------------------------------------------------------
+//
+void CPhoneNoteController::HandleTimeOutL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneNoteController::HandleTimeOutL");
+
+    if ( iProgressNote )
+        {
+        TTime current;
+        current.UniversalTime();
+        
+        CEikProgressInfo* info = iProgressNote->GetProgressInfoL();           
+
+        if ( info )
+            {
+            TTime current;
+            current.UniversalTime();
+            TInt64 timeDelta = 
+                    current.MicroSecondsFrom( iStartTime ).Int64();
+                    
+            iProgressBarCount = ( timeDelta / iInterval )+1 ;
+            if ( iProgressBarCount > KPhoneIntervalDivider )
+                {
+                 iProgressBarCount = KPhoneIntervalDivider;           
+                }
+            info->SetAndDraw( iProgressBarCount );                     
+            }        
+        
+        if ( !iProgressUpdateTimer->IsActive() )
+            {
+            iProgressUpdateTimer->After( iInterval, this );
+            }
+        }
+    else
+        {         
+        if( iProgressUpdateTimer->IsActive() )
+            {
+            iProgressUpdateTimer->CancelTimer();                
+            }
+            
+        delete iProgressUpdateTimer;
+        iProgressUpdateTimer = NULL;
+        iProgressBarCount = 0;            
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneNoteController::IsNoteVisible
+// ---------------------------------------------------------
+//
+void CPhoneNoteController::IsNoteVisible( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneNoteController::IsNoteVisible");
+
+    TPhoneCmdParamBoolean* booleanParam = 
+        static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+    if( iNote )
+        {
+        if( iNote->IsVisible() )
+            {
+            booleanParam->SetBoolean( ETrue );                
+            }
+        }
+    else
+        {
+        booleanParam->SetBoolean( EFalse );                
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneNoteController::IsProgressNoteVisible
+// ---------------------------------------------------------
+//
+void CPhoneNoteController::IsProgressNoteVisible( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneNoteController::IsProgressNoteVisible");
+
+    TPhoneCmdParamBoolean* booleanParam = 
+        static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+    if( iProgressNote )
+        {
+        if( iProgressNote->IsVisible() )
+            {
+            booleanParam->SetBoolean( ETrue );
+            }
+        }
+    else
+        {
+        booleanParam->SetBoolean( EFalse );                
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneNoteController::IsNoteActive
+// ---------------------------------------------------------
+//
+void CPhoneNoteController::IsNoteActive( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneNoteController::IsNote");
+
+    TPhoneCmdParamBoolean* booleanParam = 
+        static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+    if( iProgressNote || iNote )
+        {
+        booleanParam->SetBoolean( ETrue );                
+        }
+    else 
+        {
+        booleanParam->SetBoolean( EFalse );    
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneNoteController::IsActiveNoteDissmissableByKeyEvent
+// ---------------------------------------------------------
+//
+void CPhoneNoteController::IsActiveNoteDissmissableByKeyEvent( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneNoteController::IsActiveNoteDissmissableByKeyEvent");
+
+    TPhoneCmdParamBoolean* booleanParam = 
+        static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+    // check first that iNote is created. 
+    if( ( iNote ) &&
+        ( iNote->NoteType() == EPhoneNoteSecurity ) )
+        {
+        booleanParam->SetBoolean( ETrue );                
+        }
+    else 
+        {
+        booleanParam->SetBoolean( EFalse );    
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneNoteController::UpdateNoteTextL
+// ---------------------------------------------------------
+//
+void CPhoneNoteController::UpdateNoteTextL( TPhoneCommandParam* aCommandParam )
+    {
+    TPhoneCmdParamNote* noteParam = static_cast<TPhoneCmdParamNote*>(
+           aCommandParam );
+    
+    // Delete note text if exists
+    if( iNoteText )
+        {
+        delete iNoteText;
+        iNoteText = NULL;           
+        }
+    
+    if ( iNote )
+        {
+        // Override text if specified
+        if ( noteParam->Text().Length() )
+            {
+            if( !iNoteText )
+                {
+                iNoteText = noteParam->Text().Alloc();                  
+                }
+            iNote->SetTextL( *iNoteText );
+            }
+        else if ( noteParam->TextResourceId() )
+            {
+            // Get the text associated with the resource Id
+            TBuf<KPhoneMaxCharsInNote> noteText;
+            StringLoader::Load( 
+                noteText, 
+                noteParam->TextResourceId(), 
+                &iEikEnv );
+
+            iNote->SetTextL( noteText );
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneNoteController::UpdateNoteSoftkeysL
+// ---------------------------------------------------------
+//
+void CPhoneNoteController::UpdateNoteSoftkeysL( TPhoneCommandParam* aCommandParam )
+    {
+     
+    TPhoneCmdParamInteger* integerParam = 
+            static_cast<TPhoneCmdParamInteger*>( aCommandParam );
+    
+    if ( iNote )
+        {
+        iNote->UpdateSoftkeysL( integerParam->Integer() );
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonenumberentry.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,294 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 the updating of number entry
+*
+*/
+
+
+#include <featmgr.h>
+#include <bmbubblemanager.h>
+#include <AknPhoneNumberEditor.h>
+
+#include "cphonenumberentry.h"
+#include "mnumberentry.h"
+#include "phoneconstants.h"
+#include "tphonecmdparamnumberentryobserver.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhoneNumberEntry::CPhoneNumberEntry( CBubbleManager& aBubbleManager ):
+    iBubbleManager ( aBubbleManager )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhoneNumberEntry::ConstructL()
+    {
+    if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) )
+        {
+        iUseDialer = ETrue;
+        }
+    
+    iNumberEntryContents = HBufC::NewL( KPhoneNumberEntryBufferSize );
+    iPreviousNumberEntryContent = HBufC::NewL( KPhoneNumberEntryBufferSize );
+   
+    }
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhoneNumberEntry* CPhoneNumberEntry::NewL( CBubbleManager& aBubbleManager )
+    {
+    CPhoneNumberEntry* self = 
+        new (ELeave) CPhoneNumberEntry( aBubbleManager );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhoneNumberEntry::~CPhoneNumberEntry()
+    {
+    delete iNumberEntryContents;
+    delete iPreviousNumberEntryContent;
+    
+    }
+
+// ---------------------------------------------------------------------------
+// EnableTactileFeedback
+// ---------------------------------------------------------------------------
+//
+void CPhoneNumberEntry::EnableTactileFeedback( const TBool aEnable )
+    {
+    if ( iUseDialer )
+        {
+        iDialerNumberEntry->EnableTactileFeedback( aEnable );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// IsNumberEntryUsed
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneNumberEntry::IsNumberEntryUsed() const
+    {
+    // Get the initial number from number entry window
+    if ( iUseDialer )
+        {
+        return iDialerNumberEntry->IsNumberEntryUsed();
+        }
+    else
+        {
+        return iBubbleManager.IsNumberEntryUsed();
+        }
+    }
+    
+
+// ---------------------------------------------------------------------------
+//  
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneNumberEntry::CountNumberEntryCharacters( )
+    {
+    TInt result = 0;
+
+    if ( iUseDialer )
+        {
+        if ( iDialerNumberEntry->IsNumberEntryUsed() )
+            {
+            TPtr ptr( iNumberEntryContents->Des() );
+            iDialerNumberEntry->GetTextFromNumberEntry( ptr );        
+            result = iNumberEntryContents->Des().Length();
+            }
+        }
+    else
+        {
+        if ( iBubbleManager.IsNumberEntryUsed() )
+            {
+            TPtr ptr( iNumberEntryContents->Des() );
+            iBubbleManager.GetTextFromNumberEntry( ptr );        
+            result = iNumberEntryContents->Des().Length();
+            }
+        }
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// SetNumberEntry
+// -----------------------------------------------------------------------------
+//     
+void CPhoneNumberEntry::SetNumberEntry( MNumberEntry* aNumberEntry )
+    {
+    if ( iUseDialer )
+        {
+        iDialerNumberEntry = aNumberEntry;
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// SetNumberEntryContent
+// -----------------------------------------------------------------------------
+//     
+void CPhoneNumberEntry::SetNumberEntryContent( const TDesC& aContent )
+    {
+    if ( iUseDialer )
+        {
+        iDialerNumberEntry->SetTextToNumberEntry( aContent );
+        }
+    else
+        {
+        iBubbleManager.StartChanges();
+        iBubbleManager.SetTextToNumberEntry( aContent );
+        iBubbleManager.EndChanges();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// SetNumberEntryPromptText
+// -----------------------------------------------------------------------------
+//
+void CPhoneNumberEntry::SetNumberEntryPromptText( const TDesC& aPromptText ) 
+    {
+    if ( iUseDialer )
+        {
+        iDialerNumberEntry->SetNumberEntryPromptText( aPromptText );
+        }    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneNumberEntry::HandleNumberEntryChanged
+// -----------------------------------------------------------------------------
+//
+void CPhoneNumberEntry::HandleNumberEntryChanged( )
+    {
+    
+    TBool contentUpdated = CheckNumberEntryContent();
+    
+    if( contentUpdated && iNEChangedCallBack.iFunction )
+        {
+        iNEChangedCallBack.CallBack();
+        }
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneNumberEntry::SetNumberEntryCallBack
+// -----------------------------------------------------------------------------
+//
+void CPhoneNumberEntry::SetNumberEntryChangedCallBack( 
+        TPhoneCommandParam* aCommandParam )
+    {
+    TPhoneCmdParamNumberEntryObserver* neObserver = 
+           static_cast<TPhoneCmdParamNumberEntryObserver*>( aCommandParam );
+    
+    iNEChangedCallBack = neObserver->Observer();
+           
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneNumberEntry::CheckNumberEntryContent
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneNumberEntry::CheckNumberEntryContent()
+    {
+    
+    TBool update = UpdatePreviousNumberEntryContent( 
+                                DialerNumberEntryEditor() );
+    
+    if( !update  )
+        {
+        update = UpdatePreviousNumberEntryContent( BubbleNumberEntryEditor() );
+        }
+    
+    return update;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneNumberEntry::CheckNumberEntryContent
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneNumberEntry::UpdatePreviousNumberEntryContent( 
+        CCoeControl* aEditor )
+    {
+    TBool ret( EFalse );
+    
+    if( aEditor &&  iPreviousNumberEntryContent )
+        {
+        CAknPhoneNumberEditor* control = 
+                               static_cast<CAknPhoneNumberEditor*> ( aEditor );
+        TInt res = iPreviousNumberEntryContent->Compare( control->Text(0) );
+              
+        if( res != 0 ) //string are different
+            {
+            iPreviousNumberEntryContent->Des().Zero();
+            TPtr ptr( iPreviousNumberEntryContent->Des() );
+            control->GetText( ptr );
+            ret = ETrue;
+            }
+        }
+    
+    return ret;
+    }
+       
+       
+// -----------------------------------------------------------------------------
+// CPhoneNumberEntry::CheckNumberEntryContent
+// -----------------------------------------------------------------------------
+//
+CCoeControl* CPhoneNumberEntry::DialerNumberEntryEditor() const
+    {
+    CCoeControl* control = NULL;
+             
+    if ( iUseDialer )
+        {  
+        if ( iDialerNumberEntry->IsNumberEntryUsed() )
+            {
+            control = iDialerNumberEntry->GetNumberEntry();
+            }
+        }
+    
+    return control;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneNumberEntry::CheckNumberEntryContent
+// -----------------------------------------------------------------------------
+//
+CCoeControl* CPhoneNumberEntry::BubbleNumberEntryEditor() const
+    {
+    CCoeControl* control = NULL;
+
+    if ( iBubbleManager.IsNumberEntryUsed() )
+        {
+        control = iBubbleManager.GetNumberEntry(); 
+        }
+
+    return control;
+    }
+       
+// END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphoneprogressnote.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,86 @@
+/*
+* 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:  Progress note handler.
+*
+*/
+
+// INCLUDE FILES
+#include "cphoneprogressnote.h"
+// ================= MEMBER FUNCTIONS =======================
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneProgressNote::CPhoneProgressNote(
+        TInt aFinalValue,
+        TInt anIncrement,
+        TInt anInterval,
+        CEikDialog** aSelfPtr,
+        MEikCommandObserver* aCommandObserver )
+    : CAknProgressDialog( 
+        aFinalValue, 
+        anIncrement,
+        anInterval,
+        aSelfPtr ),
+      iCommandObserver( aCommandObserver )
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneProgressDialog::CPhoneProgressDialog
+// ---------------------------------------------------------
+//
+CPhoneProgressNote::CPhoneProgressNote(
+        CEikDialog** aSelfPtr,
+        MEikCommandObserver* aCommandObserver )
+    : CAknProgressDialog(
+        aSelfPtr ),
+      iCommandObserver( aCommandObserver )
+    {
+    }
+
+// ---------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------
+// 
+CPhoneProgressNote::~CPhoneProgressNote()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneProgressNote::OfferKeyEventL
+// ---------------------------------------------------------
+//
+TKeyResponse CPhoneProgressNote::OfferKeyEventL( 
+    const TKeyEvent& /*aKeyEvent*/,
+    TEventCode /*aType*/ )
+    {
+    // Let key events be handled by the application
+    return EKeyWasNotConsumed;
+    }
+
+// ---------------------------------------------------------
+// CPhoneProgressNote::OkToExitL
+// ---------------------------------------------------------
+//
+TBool CPhoneProgressNote::OkToExitL( TInt aCommand )
+    {
+    // Let the command observer process the command
+    if ( iCommandObserver )
+        {
+        iCommandObserver->ProcessCommandL( aCommand );
+        }
+    return EFalse; // so that the dialog will not disappear
+    }
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonequerycontroller.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,1047 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 CPhoneQueryController class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <AknGlobalConfirmationQuery.h>
+#include <eikenv.h>
+#include <StringLoader.h>
+#include <ccauireconnectquery.h>
+#include <mcauireconnectqueryobserver.h>
+#include <AknGlobalMsgQuery.h>
+#include <AknGlobalNote.h> // for CAknGlobalNote
+
+#include "phoneui.hrh"
+#include "cphonequerycontroller.h"
+#include "tphonecommandparam.h"
+#include "tphonecmdparamreconnectquery.h"
+#include "tphonecmdparamstring.h"
+#include "phonelogger.h"
+#include "cphonequerydialog.h"
+#include "tphonecmdparamboolean.h"
+#include "cphonedtmfnumberlistquery.h"
+#include "cphonelistquerydialog.h"
+#include "cphonetimer.h"
+
+// ================= MEMBER FUNCTIONS =======================
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneQueryController::CPhoneQueryController( CEikonEnv& aEikEnv )
+    : CActive ( EPriorityUserInput ),
+    iQueryDeleted( ETrue ),
+    iEikEnv( aEikEnv )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::NewL()
+// Two-phased constructor
+// (other items were commented in a header).
+// ---------------------------------------------------------
+CPhoneQueryController* CPhoneQueryController::NewL( CEikonEnv& aEikEnv )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::NewL( ) ");
+    CPhoneQueryController* self =
+        new( ELeave ) CPhoneQueryController( aEikEnv );
+
+    return self;
+    }
+
+// ---------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------
+//
+CPhoneQueryController::~CPhoneQueryController()
+    {
+    DestroyQuery();
+    ClearTimer();
+    DestroyGlobalQuery();
+    DestroyGlobalMsgQuery();
+
+    if( iCommandAsync )
+        {
+        delete iCommandAsync;
+        iCommandAsync = NULL;
+        }
+    iQueryPreviousText.Close();
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::CreateNoteL
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::CreateQueryL(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneQueryController::CreateQueryL()" );
+
+    // Cancel previous note. This prevents scheduler crashes.
+    // Canceling must be done here since iActiveAvkonQuery may be overwritten.
+    Cancel();
+
+    TPhoneCmdParamQuery& params = *static_cast<TPhoneCmdParamQuery*>( aCommandParam );
+    iCommandId = NULL;
+    iNoConnectedCalls = EFalse;
+    switch( params.ParamId() )
+	    {
+        case TPhoneCommandParam::EPhoneParamIdQuery:
+	    case TPhoneCommandParam::EPhoneParamIdVideoCallSetupFailedCreateVoiceCallToTheSameContactQuery:
+        case TPhoneCommandParam::EPhoneParamIdUnattendedTransferAcceptanceQuery:
+        case TPhoneCommandParam::EPhoneParamIdGlobalWaitNote:
+	    	CreateDefaultQueryL( params );
+	    	break;
+
+	    case TPhoneCommandParam::EPhoneParamIdReconnectQuery:
+	    	CreateReconnectQueryL( aCommandParam );
+	    	break;
+
+	    case TPhoneCommandParam::EPhoneParamRebootQuery:
+	        {
+	        TRequestStatus status = KRequestPending;
+	        CAknGlobalConfirmationQuery* query = CAknGlobalConfirmationQuery::NewLC();
+	        query->ShowConfirmationQueryL(
+	            status, params.QueryPrompt(), params.DefaultCba(), R_QGN_NOTE_INFO_ANIM );
+	        User::WaitForRequest( status );
+	        CleanupStack::PopAndDestroy( query );
+	        }
+	        break;
+
+	    default:
+	    	break;
+	    }
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::DestroyQuery
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::DestroyQuery()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::DestroyQuery( ) ");
+
+    // Delete the query if it exists
+    if ( iQuery )
+        {
+        delete iQuery;
+        iQuery = NULL;
+        }
+
+    iQueryNoteText.Close();
+    iQueryPrompt.Close();
+
+    if( iCallUiReconnectQuery )
+	    {
+        delete iCallUiReconnectQuery;
+        iCallUiReconnectQuery = NULL;
+	    }
+
+    if ( iDtmfNumberListQuery && !iQueryDeleted )
+        {
+        delete iDtmfNumberListQuery;
+        iDtmfNumberListQuery = NULL;
+        }
+
+  	if ( iTextQuery )
+  	    {
+  	    delete iTextQuery;
+  	    iTextQuery = NULL;
+  	    }
+
+    if ( iListQuery && !iQueryDeleted )
+        {
+        delete iListQuery;
+        iListQuery = NULL;
+        }
+
+    if( iTextQueryDisplayer )
+        {
+        delete iTextQueryDisplayer;
+        iTextQueryDisplayer = NULL;
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::DestroyGlobalQuery
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::DestroyGlobalQuery()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::DestroyGlobalQuery( ) ");
+
+    if ( iGlobalConfirmationQuery )
+        {
+        iGlobalConfirmationQuery->CancelConfirmationQuery();
+
+        delete iGlobalConfirmationQuery;
+        iGlobalConfirmationQuery = NULL;
+        }
+    DestroyGlobalWaitNote();
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::CreateQueryDialogL
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::CreateQueryDialogL(
+    const TPhoneCmdParamQuery& aParams )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::CreateQueryDialogL( ) ");
+
+    // Delete the existing query
+    DestroyQuery();
+
+    iQueryParam = aParams;
+
+    // Create the query
+	iQuery = CPhoneQueryDialog::NewL();
+
+    if ( iQuery )
+        {
+        // Set the prompt if specified
+        if ( aParams.QueryPrompt().Length() )
+            {
+            iQueryPrompt.Close();
+            iQueryPrompt.Create( aParams.QueryPrompt() );
+            iQuery->SetPromptL( iQueryPrompt );
+            }
+
+        // Display the query
+		TInt buttonId = iQuery->ExecuteLD( aParams.QueryResourceId() );
+        iQuery = NULL;
+
+		if( buttonId != EPhoneCmdDoNothing )
+			{
+            if ( iQueryParam.QueryCommandObserver() )
+                {
+                // Let observer handle command.
+                iQueryParam.QueryCommandObserver()->ProcessCommandL(
+                        iStatus.Int() );
+                return;
+                }
+            else
+                {
+                // Forward pressed CBA to the framework so that we can handle it
+                // in our active state
+                static_cast<MEikCommandObserver*>( iEikEnv.EikAppUi() )
+                    ->ProcessCommandL( buttonId );
+                }
+			}
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::CreateTextQueryDialogL
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::CreateTextQueryDialogL(
+        const TPhoneCmdParamQuery& aParams,
+        TInt aEikBidOkCmd )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::CreateTextQueryDialogL( ) ");
+
+    // Delete the existing query
+    DestroyQuery();
+
+    iQueryNoteText.Create( *aParams.DataText() );
+
+    iTextQuery = new( ELeave ) CPhoneTextQuery(
+        *this,
+        iQueryNoteText,
+        aParams.DefaultCba(),
+        aParams.ContentCba(),
+        aParams.SendKeyEnabled(),
+        aEikBidOkCmd );
+
+    // Set the prompt if specified
+    if ( aParams.QueryPrompt().Length() )
+        {
+        iQueryPrompt.Create( aParams.QueryPrompt() );
+        iTextQuery->SetPromptL( iQueryPrompt );
+        }
+
+    // Cut the call stack so that Phone UI is responsive
+    iTextQueryDisplayer = CIdle::NewL( EPriorityNormal );
+    iTextQueryDisplayer->Start( TCallBack( DisplayTextQueryCallBack, this ) );
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::SetNoConnectedCalls
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::SetNoConnectedCalls( TPhoneCommandParam* aCommandParam )
+    {
+    TPhoneCmdParamBoolean* booleanParam =
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+    iNoConnectedCalls = booleanParam->Boolean();
+    __PHONELOG1( EBasic, EPhoneUIView,
+           "CPhoneQueryController::SetNoConnectedCalls(%d)",
+           iNoConnectedCalls );
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::DisplayTextQueryCallBackL
+// ---------------------------------------------------------
+//
+TInt CPhoneQueryController::DisplayTextQueryCallBack( TAny* aCPhoneQueryController )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::DisplayTextQueryCallBack( ) ");
+
+    // Display the query
+    CPhoneQueryController* queryController =
+        static_cast<CPhoneQueryController*>( aCPhoneQueryController );
+
+    TInt leaveError = KErrNone;
+    TInt retVal = KErrNone;
+
+    TRAP( leaveError, (
+         retVal = queryController->iTextQuery->ExecuteLD( queryController->iQueryParam.QueryResourceId() ) ) );
+
+    queryController->iTextQuery = NULL;
+
+    // If iCommandId is EPhoneCmdEnd(User has pressed end dismiss DTMF query&dialog) or if iNoConnectedCalls
+    // is TRUE it is an indication that remote party has terminated call and there is no connected call in device
+    // therefore we dont need to reopen EPhoneInCallCmdDtmfListQuery.
+    if ( retVal == KErrNone &&
+         leaveError == KErrNone &&
+         queryController->iQueryParam.QueryType() == EPhoneDtmfTextQuery &&
+         queryController->iCommandId != EPhoneCmdEnd &&
+         !queryController->iNoConnectedCalls )
+        {
+        //User has exited DMTF query with cancel, rule says that
+        //we need to activate DTMF list query dialog.
+
+        // Forward pressed CBA to the framework so that we can handle it
+        // in our active state
+        TRAP_IGNORE( static_cast<MEikCommandObserver*>( queryController->iEikEnv.EikAppUi() )
+            ->ProcessCommandL( EPhoneInCallCmdDtmfListQuery ) );
+        }
+
+    queryController->iNoConnectedCalls = EFalse;
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::CreateListQueryL
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::CreateListQueryL( TInt aDialogResourceId,
+                                              const RArray<TInt>& aCommands )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::CreateListQueryL( ) ");
+    DestroyQuery();
+
+    if ( !iListQuery )
+       {
+       iListQuery = new (ELeave)
+                CPhoneListQueryDialog(
+                static_cast<MEikCommandObserver&>( *iEikEnv.EikAppUi() ),
+                *this, aCommands );
+       }
+    iQueryDeleted = EFalse;
+    iCommandHandled = EFalse;
+    iListQuery->ExecuteLD( aDialogResourceId );
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::CreateCustomListQueryL
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::CreateCustomListQueryL(
+        const TPhoneCmdParamQuery& aParams )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::CreateCustomListQueryL( ) ");
+    DestroyQuery();
+    RArray<TInt> commands;
+    CleanupClosePushL( commands );
+    const_cast<TPhoneCmdParamQuery&>(aParams).ItemTextArrayForListQuery();
+
+    MDesCArray* itemArray = aParams.ItemTextArrayForListQuery();
+
+    if ( NULL == itemArray )
+        {
+        User::Leave( KErrArgument );
+        }
+
+    for ( TInt i = 0; i < itemArray->MdcaCount(); i++ )
+        {
+        commands.Append( i );
+        }
+
+    if ( !iListQuery )
+       {
+       iListQuery = new (ELeave)
+                CPhoneListQueryDialog(
+                static_cast<MEikCommandObserver&>( *iEikEnv.EikAppUi() ),
+                *this, commands );
+       }
+
+    iListQuery->PrepareLC( aParams.QueryResourceId() );
+
+
+    iListQuery->SetItemTextArray( itemArray );
+    iListQuery->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    iListQuery->SetTone( aParams.Tone() );
+
+    iQueryDeleted = EFalse;
+    iCommandHandled = EFalse;
+
+    iListQuery->RunLD();
+
+    CleanupStack::PopAndDestroy( &commands );
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::CreateDtmfListQueryL
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::CreateDtmfListQueryL( TInt aDialogResourceId )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::CreateDtmfListQueryL( ) ");
+    DestroyQuery();
+
+    if ( !iDtmfNumberListQuery )
+        {
+        iDtmfNumberListQuery = CPhoneDtmfNumberListQuery::NewL(
+            static_cast<MEikCommandObserver&>( *iEikEnv.EikAppUi() ),
+                                               *this,
+                                               iResultBuffer );
+        }
+    iQueryDeleted = EFalse;
+    iDtmfNumberListQuery->ExecuteLD( aDialogResourceId );
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::GetTextQueryContentL
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::GetTextQueryContentL(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::GetTextQueryContentL( ) ");
+
+    TPhoneCmdParamString* stringParam =
+        static_cast<TPhoneCmdParamString*>( aCommandParam );
+
+    if ( iQueryPreviousText.Length() )
+        {
+        *stringParam->String() = iQueryPreviousText;
+        iQueryPreviousText.Close();
+        }
+    else if ( iTextQuery  )
+        {
+        iTextQuery->GetContent( *stringParam->String() );
+        }
+    else if ( iResultBuffer )
+        {
+        stringParam->String()->Append( iResultBuffer->Des() );
+        delete iResultBuffer;
+        iResultBuffer = NULL;
+        }
+
+    __PHONELOG1( EBasic, EPhoneUIView,
+        "CPhoneQueryController::GetTextQueryContentL(%S)",
+        stringParam->String() );
+
+    AknTextUtils::ConvertDigitsTo( *stringParam->String(), EDigitTypeWestern );
+
+    __PHONELOG1( EBasic, EPhoneUIView,
+        "CPhoneQueryController::GetTextQueryContentL(%S)",
+        stringParam->String() );
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::SetQueryDeletedFlag
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::SetQueryDeletedFlag( TBool aQueryDeleted )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::SetQueryDeletedFlag( ) ");
+    switch( iActiveAvkonQuery )
+        {
+        case EPhoneContactsListQuery:
+        case EPhoneCustomListQueryDialog:
+             {
+             iListQuery = NULL;
+
+             if ( iQueryParam.QueryCommandObserver() &&
+                  !iCommandHandled )
+                 {
+                 ReportQueryCompleteAsync( EAknSoftkeyCancel );
+                 }
+             }
+             break;
+        case EPhoneDtmfListQueryDialog:
+             {
+             iDtmfNumberListQuery = NULL;
+             }
+             break;
+        default:
+             break;
+        }
+    iQueryDeleted = aQueryDeleted;
+    }
+
+
+// ---------------------------------------------------------
+// CPhoneQueryController::CreateDefaultQueryL
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::CreateDefaultQueryL( const TPhoneCmdParamQuery& aParams )
+	{
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::CreateDefaultQueryL( ) ");
+
+    iQueryParam = aParams;
+    iActiveAvkonQuery = aParams.QueryType();
+
+    switch( iActiveAvkonQuery )
+        {
+        case EPhoneQueryDialog:
+            CreateQueryDialogL( aParams );
+            break;
+
+        case EPhoneTextQueryDialog:
+            CreateTextQueryDialogL( aParams );
+            break;
+
+       case EPhoneDtmfTextQuery:
+       case EPhoneGenericTextQuery:
+            CreateTextQueryDialogL( aParams,
+                                    EPhoneCmdDtmfOk );
+            break;
+
+        case EPhoneGlobalQueryDialog:
+            {
+            if ( aParams.ParamId() ==
+                TPhoneCommandParam::EPhoneParamIdVideoCallSetupFailedCreateVoiceCallToTheSameContactQuery )
+                {
+                iVideoCallSetupFailedQuery = ETrue;
+                }
+            else
+                {
+                iVideoCallSetupFailedQuery = EFalse;
+                }
+            // Use timeout if defined
+            TTimeIntervalMicroSeconds32 timeout = aParams.TimeOut() * 1000000;
+            if ( timeout.Int() > 0 && !iTimer )
+                {
+                iTimer = CPhoneTimer::NewL();
+                // Start timer.
+                iTimer->After( timeout, this );
+                }
+            // Create query
+            CreateGlobalQueryDialogL( aParams );
+            break;
+            }
+        case EPhoneCustomListQueryDialog:
+              {
+              CreateCustomListQueryL( aParams );
+              }
+            break;
+        case EPhoneDtmfListQueryDialog:
+              CreateDtmfListQueryL(
+                aParams.QueryResourceId() );
+             break;
+
+        case EPhoneContactsListQuery:
+              {
+              RArray<TInt> commands;
+              CleanupClosePushL( commands );
+              commands.Append( EPhoneNumberAcqCmdSave );
+              commands.Append( EPhoneNumberAcqCmdAddToName );
+              CreateListQueryL( aParams.QueryResourceId(), commands );
+              CleanupStack::PopAndDestroy(); // CleanupClosePushL
+              }
+            break;
+        case EPhoneGlobalMsgQuery:
+            {
+            iTransferAcceptanceQuery = ( aParams.ParamId() ==
+                TPhoneCommandParam::EPhoneParamIdUnattendedTransferAcceptanceQuery );
+
+            CreateGlobalMsgQueryL( aParams );
+            break;
+            }
+        case EPhoneGlobalWaitNote:
+            {
+            CreateGlobalWaitNoteL( aParams );
+            break;
+            }
+
+        default:
+            return;
+        }
+	}
+
+// ---------------------------------------------------------
+// CPhoneQueryController::CreateReconnectQueryL
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::CreateReconnectQueryL( TPhoneCommandParam* aCommandParam )
+	{
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::CreateReconnectQueryL( ) ");
+
+    TPhoneCmdParamReconnectQuery* queryParam =
+        static_cast<TPhoneCmdParamReconnectQuery*>( aCommandParam );
+
+	if( !iCallUiReconnectQuery )
+		{
+		iCallUiReconnectQuery =
+		    CCaUiReconnectQuery::NewL(
+		        queryParam->ReconnectQueryObserver());
+		}
+
+   	iCallUiReconnectQuery->ShowL( queryParam->PhoneNumber(),
+   	     queryParam->IncludeVideoCallOption() );
+	}
+
+// ---------------------------------------------------------
+// CPhoneQueryController::CreateGlobalQueryDialogL
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::CreateGlobalQueryDialogL( const TPhoneCmdParamQuery& aParams )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::CreateGlobalQueryDialogL( ) ");
+
+    // Delete the existing global query
+    DestroyGlobalQuery();
+
+    iGlobalConfirmationQuery = CAknGlobalConfirmationQuery::NewL();
+    iGlobalConfirmationQuery->ShowConfirmationQueryL(
+        iStatus,
+        aParams.QueryPrompt(),
+        aParams.DefaultCba(),
+        R_QGN_NOTE_QUERY_ANIM,
+        KNullDesC,
+        0,
+        0,
+        CAknQueryDialog::TTone(aParams.Tone() ) );
+
+    SetActive();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneQueryController::ReportQueryCompleteAsync
+// ---------------------------------------------------------------------------
+//
+void CPhoneQueryController::ReportQueryCompleteAsync( TInt aCommand )
+    {
+    iCommandHandled = ETrue;
+    Cancel();
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, aCommand );
+    SetActive();
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::RunL
+// EAknSoftkeyYes and EAknSoftkeyNo need to be used with
+// CAknGlobalConfirmationQuery. Others does not work
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::RunL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::RunL( ) ");
+    TInt buttonId( KErrNone );
+
+    if ( iQueryParam.QueryCommandObserver() )
+        {
+        // Let observer handle command.
+        iQueryParam.QueryCommandObserver()->ProcessCommandL(
+                iStatus.Int() );
+        return;
+        }
+
+    if ( iActiveAvkonQuery == EPhoneContactsListQuery ||
+         iActiveAvkonQuery == EPhoneDtmfListQueryDialog )
+        {
+        buttonId = iStatus.Int();
+        }
+    else if ( iActiveAvkonQuery == EPhoneGlobalQueryDialog )
+        {
+        if ( iStatus.Int() == EAknSoftkeyYes )
+            {
+            if ( iVideoCallSetupFailedQuery )
+                {
+                buttonId = EPhoneCmdYesVideoFailedNoMemorySwitchToVoice;
+                }
+            else
+                {
+                buttonId = EPhoneCmdYesBtDisconnectQuery;
+                }
+            }
+        else if ( iStatus.Int() == EAknSoftkeyNo  )
+            {
+            if ( iVideoCallSetupFailedQuery )
+                {
+                buttonId = EPhoneCmdNoVideoFailedNoMemorySwitchToVoice;
+                }
+            else
+                {
+                buttonId = EPhoneCmdNoBtDisconnectQuery;
+                }
+             }
+        ClearTimer();
+        iVideoCallSetupFailedQuery = EFalse;
+        DestroyGlobalQuery();
+        }
+    else if ( iActiveAvkonQuery == EPhoneGlobalMsgQuery )
+        {
+        buttonId = iQueryParam.CbaCommandMapping( iStatus.Int() );
+        if ( iTransferAcceptanceQuery )
+            {
+            iTransferAcceptanceQuery = EFalse;
+            }
+
+        ClearTimer();
+        DestroyGlobalMsgQuery();
+        }
+    else if ( iActiveAvkonQuery == EPhoneGlobalWaitNote )
+        {
+        // If note is destroyed through DestroyGlobalQuery() then KErrCancel
+        // is not mapped to any command.
+        if ( iStatus.Int() == KErrCancel &&
+             !iGlobalWaitNote )
+            {
+            ClearTimer();
+            return;
+            }
+        else
+            {
+            buttonId = iQueryParam.CbaCommandMapping( iStatus.Int() );
+            }
+
+        ClearTimer();
+        DestroyGlobalWaitNote();
+        }
+    // Forward pressed CBA to the framework so that we can handle it
+    // in our active state
+    static_cast<MEikCommandObserver*>( iEikEnv.EikAppUi() )
+	    ->ProcessCommandL( buttonId );
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::RunError
+// ---------------------------------------------------------
+//
+TInt CPhoneQueryController::RunError( TInt aError )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::RunError( ) ");
+
+    if ( aError )
+        {
+        __PHONELOG1( EBasic, EPhoneUIView,
+        "CPhoneQueryController::RunError: error: %d",
+        aError );
+        }
+    return aError;
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::DoCancel
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::DoCancel()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::DoCancel( ) ");
+
+    if ( iActiveAvkonQuery == EPhoneGlobalQueryDialog )
+        {
+        ClearTimer();
+        DestroyGlobalQuery();
+        if ( iVideoCallSetupFailedQuery )
+            {
+            iVideoCallSetupFailedQuery = EFalse;
+            TRAP_IGNORE(
+                static_cast<MEikCommandObserver*>( iEikEnv.EikAppUi() )
+	                ->ProcessCommandL(
+	                        EPhoneCmdNoVideoFailedNoMemorySwitchToVoice ) )
+            }
+        else if ( iQueryParam.QueryCommandObserver() )
+            {
+            // Let observer handle command.
+            TRAP_IGNORE( iQueryParam.QueryCommandObserver()->ProcessCommandL(
+                    EAknSoftkeyCancel ) );
+            }
+        }
+    if ( EPhoneGlobalMsgQuery == iActiveAvkonQuery )
+        {
+        ClearTimer();
+        DestroyGlobalMsgQuery();
+
+        TInt buttonId = 0;
+        TInt result = iQueryParam.GetCustomCommandForTimeOut( buttonId );
+        if ( KErrNone == result && iTransferAcceptanceQuery )
+            {
+            // timeout equals reject of unattended transfer request
+            iTransferAcceptanceQuery = EFalse;
+            TRAP_IGNORE(
+                static_cast<MEikCommandObserver*>( iEikEnv.EikAppUi() )
+                    ->ProcessCommandL( buttonId ) )
+            }
+        }
+
+    if ( EPhoneGlobalWaitNote == iActiveAvkonQuery )
+        {
+        ClearTimer();
+        TInt buttonId = 0;
+        TInt result = iQueryParam.GetCustomCommandForTimeOut( buttonId );
+        if ( KErrNone == result && iGlobalWaitNote )
+            {
+            DestroyGlobalWaitNote();
+
+            TRAP_IGNORE(
+                static_cast<MEikCommandObserver*>( iEikEnv.EikAppUi() )
+                    ->ProcessCommandL( buttonId ) )
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::IsQueryActive
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::IsQueryActive( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::IsQueryActive() ");
+    TPhoneCmdParamBoolean* booleanParam =
+        booleanParam = static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+    if ( iQuery ||
+         iTextQuery ||
+         iGlobalConfirmationQuery ||
+         !iQueryDeleted )
+        {
+        booleanParam->SetBoolean( ETrue );
+        }
+    else
+        {
+        booleanParam->SetBoolean( EFalse );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::IsDTMFQueryVisible
+// ---------------------------------------------------------
+//
+TBool CPhoneQueryController::IsDTMFQueryVisible()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::IsDTMFQueryVisible() ");
+    TBool dtmfVisible(EFalse);
+    if( ( iTextQuery && iQueryParam.QueryType() == EPhoneDtmfTextQuery ) ||
+        ( iDtmfNumberListQuery && iQueryParam.QueryType() == EPhoneDtmfListQueryDialog ) )
+        {
+        dtmfVisible = ETrue;
+        }
+    __PHONELOG1( EBasic, EPhoneUIView,
+            "CPhoneQueryController::IsDTMFQueryVisible :%d",
+            dtmfVisible );
+    return dtmfVisible;
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::SetListQueryStringL
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::SetListQueryStringL( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::SetListQueryStringL() ");
+    //Create new object if needed
+    if ( !iDtmfNumberListQuery )
+        {
+        iDtmfNumberListQuery = CPhoneDtmfNumberListQuery::NewL(
+        static_cast<MEikCommandObserver&>( *iEikEnv.EikAppUi() ),
+                                           *this,
+                                           iResultBuffer );
+        }
+    TPhoneCmdParamString* stringParam =
+        static_cast<TPhoneCmdParamString*>( aCommandParam );
+    iDtmfNumberListQuery->AppendStringToArrayL( *stringParam->String() );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneQueryController::HandleTimeOutL
+// -----------------------------------------------------------------------------
+//
+void CPhoneQueryController::HandleTimeOutL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::HandleTimeOutL()");
+    Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneQueryController::ClearTimer
+// -----------------------------------------------------------------------------
+//
+void CPhoneQueryController::ClearTimer()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::ClearTimer()");
+    if ( iTimer )
+        {
+        if ( iTimer->IsActive() )
+            {
+            iTimer->Cancel();
+            }
+        delete iTimer;
+        iTimer = NULL;
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::CreateGlobalMsgQueryL
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::CreateGlobalMsgQueryL(
+        const TPhoneCmdParamQuery& aParams )
+    {
+    iQueryNoteText.Close();
+    iQueryNoteText.Create( *aParams.DataText() );
+    iQueryPrompt.Close();
+    iQueryPrompt.Create( aParams.QueryPrompt() );
+
+    // use timeout if defined
+    const TInt KSecToUsFactor = 1000000;
+    TTimeIntervalMicroSeconds32 timeout = aParams.TimeOut() * KSecToUsFactor;
+    if ( 0 < timeout.Int() && !iTimer )
+        {
+        iTimer = CPhoneTimer::NewL();
+        iTimer->After( timeout, this );
+        }
+
+    DestroyGlobalMsgQuery();
+    iGlobalMsgQuery = CAknGlobalMsgQuery::NewL();
+
+    const TInt KNoImage     = 0;
+    const TInt KNoImageMask = -1;
+
+    iGlobalMsgQuery->ShowMsgQueryL( iStatus, iQueryNoteText, aParams.DefaultCba(),
+            iQueryPrompt, KNullDesC(), KNoImage, KNoImageMask,
+        static_cast<CAknQueryDialog::TTone>( aParams.Tone() ) );
+    SetActive();
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::DestroyGlobalMsgQuery
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::DestroyGlobalMsgQuery()
+    {
+    if ( iGlobalMsgQuery )
+        {
+        iGlobalMsgQuery->CancelMsgQuery();
+
+        delete iGlobalMsgQuery;
+        iGlobalMsgQuery = NULL;
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::CreateGlobalWaitNote
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::CreateGlobalWaitNoteL(
+        const TPhoneCmdParamQuery& aParams )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView,
+        "CPhoneQueryController::CreateGlobalWaitNote()");
+    if ( aParams.DataText()->Length() > 0 )
+        {
+        iWaitNoteText.Close();
+        iWaitNoteText.Create( *aParams.DataText() );
+        // use timeout if defined
+        const TInt KSecToUsFactor = 1000000;
+        TTimeIntervalMicroSeconds32 timeout = aParams.TimeOut() * KSecToUsFactor;
+        if ( 0 < timeout.Int() && !iTimer )
+            {
+            iTimer = CPhoneTimer::NewL();
+            iTimer->After( timeout, this );
+            }
+
+        DestroyGlobalWaitNote();
+        iGlobalWaitNote = CAknGlobalNote::NewL();
+        iGlobalWaitNote->SetSoftkeys( aParams.DefaultCba() );
+        // Show the global note
+        iGlobalWaitNote->ShowNoteL( iStatus, EAknGlobalWaitNote, *aParams.DataText()  );
+
+        SetActive();
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::DestroyGlobalWaitNote
+// ---------------------------------------------------------
+//
+void CPhoneQueryController::DestroyGlobalWaitNote()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView,
+          "CPhoneQueryController::DestroyGlobalWaitNote()");
+    if ( iGlobalWaitNote )
+        {
+        ClearTimer();
+        TRAP_IGNORE( iGlobalWaitNote->CancelNoteL( KErrCancel ) );
+
+        delete iGlobalWaitNote;
+        iGlobalWaitNote = NULL;
+        }
+    iWaitNoteText.Close();
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::ProcessCommand
+// ---------------------------------------------------------
+
+void CPhoneQueryController::ProcessCommandL( TInt aCommandId )
+    {
+	__LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::ProcessCommandL()");
+
+	iCommandId = aCommandId;
+
+    if ( iTextQuery )
+        { // Store text for next content getting
+        iQueryPreviousText.Close();
+        iQueryPreviousText.Create( KPhoneMaxCharsInNote );
+        iTextQuery->GetContent( iQueryPreviousText );
+        }
+
+    iCommandAsync = CIdle::NewL( EPriorityNormal );
+    iCommandAsync->Start( TCallBack( ProcessCommandCallBack, this ) );
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::ProcessCommandCallBack
+// ---------------------------------------------------------
+//
+TInt CPhoneQueryController::ProcessCommandCallBack( TAny* aCPhoneQueryController )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneQueryController::ProcessCommandCallBack() ");
+
+    CPhoneQueryController* queryController =
+        static_cast<CPhoneQueryController*>( aCPhoneQueryController );
+
+    delete queryController->iCommandAsync;
+    queryController->iCommandAsync = NULL;
+
+    TRAP_IGNORE( static_cast<MEikCommandObserver*>( queryController->iEikEnv.EikAppUi() )
+        ->ProcessCommandL( queryController->iCommandId ) );
+
+    return KErrNone;
+    }
+
+
+// end of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonequerydialog.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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: Implementation of CPhoneQueryDialog class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cphonequerydialog.h"
+#include "phoneui.hrh"
+
+// ================= MEMBER FUNCTIONS =======================
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneQueryDialog::CPhoneQueryDialog( const TTone& aTone ) :
+	CAknQueryDialog( aTone )
+    {
+    }
+
+// ---------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------
+// 
+CPhoneQueryDialog::~CPhoneQueryDialog()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneQueryController::NewL()
+// Two-phased constructor
+// ---------------------------------------------------------
+//
+CPhoneQueryDialog* CPhoneQueryDialog::NewL( const TTone& aTone )
+	{
+	CPhoneQueryDialog* self = new( ELeave )CPhoneQueryDialog( aTone );
+	return self;	
+	}
+
+// ---------------------------------------------------------
+// CPhoneQueryDialog::OfferKeyEventL
+// ---------------------------------------------------------
+//
+TKeyResponse CPhoneQueryDialog::OfferKeyEventL( 
+    const TKeyEvent& aKeyEvent,
+    TEventCode aType )
+    {
+	if ( aKeyEvent.iScanCode == EStdKeyNo || aKeyEvent.iCode == EKeyNo )
+		{
+		OkToExitL( EPhoneCmdDoNothing );
+		return EKeyWasNotConsumed;
+		}
+	else
+		{
+		return CAknQueryDialog::OfferKeyEventL( aKeyEvent, aType );
+ 		}
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphoneringingtone.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,287 @@
+/*
+* 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:  Class representing ringing tone
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "cphoneringingtone.h"
+#include <apgcli.h>
+#include <DRMHelper.h>
+#include <bldvariant.hrh>
+#include <pathinfo.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();
+    }
+
+// -----------------------------------------------------------------------------
+// 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 = aFileName.Alloc();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTone::FileName
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TDesC& CPhoneRingingTone::FileName() const
+    {
+    // iFileName is never NULL
+    return *iFileName;            
+    }
+
+// -----------------------------------------------------------------------------
+// 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();
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphoneringingtoneplayerao.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,1975 @@
+/*
+* Copyright (c) 2002-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:  Ringing tone player.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cphoneringingtoneplayerao.h"
+
+#include <cntdef.h>
+#include <f32file.h>
+#include <featmgr.h>
+#include <utility.h>
+#include <AudioPreference.h>
+#include <data_caging_path_literals.hrh>
+#include <MusicPlayerInternalCRKeys.h>
+#include <ProfileEngineDomainCRKeys.h>
+#include <telephonyvariant.hrh>
+#include <UikonInternalPSKeys.h>
+#include <DRMHelperServerInternalCRKeys.h>
+#include <DRMHelper.h>
+#include <activeidle2domainpskeys.h>
+
+#include "phoneui.pan"
+#include "phoneui.hrh"
+#include "mphoneringingtoneobserver.h"
+#include "cphonetimer.h"
+#include "cphonecenrepproxy.h"
+#include "phoneconstants.h"
+#include "phonelogger.h"
+#include "cphoneringingtone.h"
+#include "tphonecmdparamringtone.h"
+#include "cphonepubsubproxy.h"
+#include "cphonecenrepproxy.h"
+#include "cphonemediatorsender.h"
+
+// CONSTANTS
+
+// Minimum acceptable length of parsed DRM message.
+const TInt KPhoneMinDRMTextLength = 3;
+// Value field of parsed DRM string.
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::NewL
+// -----------------------------------------------------------------------------
+//
+CPhoneRingingTonePlayerAO* CPhoneRingingTonePlayerAO::NewL()
+    {
+    CPhoneRingingTonePlayerAO* self = 
+        new ( ELeave ) CPhoneRingingTonePlayerAO();
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::CPhoneRingingTonePlayerAO
+// -----------------------------------------------------------------------------
+//
+CPhoneRingingTonePlayerAO::CPhoneRingingTonePlayerAO() :
+    CActive( CActive::EPriorityStandard ),
+    iAsyncDeletePlayers( EPlayerCount )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::ConstructL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::ConstructL()" );
+    
+    for ( TInt i = EPlayerFirst; i <= EPlayerLast; i++ )
+        {
+        User::LeaveIfError( 
+            iAsyncDeletePlayers.Append( NULL ) );
+        }
+
+    // Construct timer.
+    iTimer = CPhoneTimer::NewL();
+    iTtsDelayTimer = CPhoneTimer::NewL();
+
+    // Checks if DRM extend security is needed
+    TInt extSecNeeded = KErrNone;
+    TInt err = CPhoneCenRepProxy::Instance()->GetInt(
+        KCRUidMusicPlayerFeatures,
+        KRequireDRMInPlayback,
+        extSecNeeded );
+ 
+    iExtSecNeeded = ( ( err == KErrNone ) && extSecNeeded ) ? ETrue : EFalse;
+    
+    
+    CPhoneCenRepProxy::Instance()->NotifyChangeL(
+        KCRUidDRMHelperServer, 
+        KDRMHelperServerNotificationPassive,
+        this );
+    
+
+    // Check video player configuration.
+    iArbitraryVideoScaling = 
+    CPhoneCenRepProxy::Instance()->IsTelephonyFeatureSupported( 
+            KTelephonyLVFlagArbitraryVideoScaling );
+ 
+    // Construct the default ringing tone
+    TBuf<KMaxFileName> defaultTone;
+    err = CPhoneCenRepProxy::Instance()->GetString(            
+        KCRUidProfileEngine,
+        KProEngDefaultRingingTone,
+        defaultTone );
+
+    if ( err == KErrNone )
+        {
+        iDefaultRingingTone = CPhoneRingingTone::NewL( defaultTone );
+        }
+
+    ConstructPlayers();
+    
+    GetMaxToneFileSizeL( iToneFileSizeLimitKB );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::~CPhoneRingingTonePlayerAO
+// -----------------------------------------------------------------------------
+//
+CPhoneRingingTonePlayerAO::~CPhoneRingingTonePlayerAO()
+    {
+    Cancel();
+    
+    iAsyncDeletePlayers.ResetAndDestroy();
+    iAsyncDeletePlayers.Close();
+        
+    CleanupPlayers();
+
+    delete iTimer;
+    delete iTtsDelayTimer;
+    delete iDefaultRingingTone;
+    delete iAudioVideoRingingTone;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::PlayRingToneL
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::PlayRingToneL( 
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::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() );
+            }
+        else if ( iAudioVideoRingingTone->FileName().Compare(
+            ringToneParam->RingTone() ) ) 
+            {
+            iAudioVideoRingingTone->SetFileName(
+                ringToneParam->RingTone() );
+            }
+        
+        // Caller contact text and image and image has
+        // higher priority than video ringing tone set for caller.
+        if ( iAudioVideoRingingTone->IsVideoRingingTone() &&
+             ringToneParam->IsCallerImage() )
+            {
+            // Play only audio from video ringingtone
+            PlayAudioRingTone(
+                    volume,
+                    ringingType );
+            }
+        else if ( iAudioVideoRingingTone->IsVideoRingingTone() &&
+                !ringToneParam->IsCallerText() )
+            {            
+            // 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() )
+                {
+                PlayTtsTone(
+                    ringToneParam->TextToSay(),
+                    volume,
+                    ringingType );
+                }
+            // Play audio ring tone
+            PlayAudioRingTone( 
+                volume, 
+                ringingType );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::PlayAudioRingTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::PlayAudioRingTone( 
+    TInt aVolume, 
+    TProfileRingingType aRingingType )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::PlayAudioRingTone()" );
+    __PHONELOG2( 
+        EBasic,
+        EPhoneUIView, 
+        "CPhoneRingingTonePlayerAO::PlayAudioRingTone - aVolume(%d), aRingingType(%d)",
+        aVolume,
+        aRingingType );
+ 
+    if ( !iAudioVideoRingingTone ||
+         !CheckAndHandleToneSizeLimit( iAudioVideoRingingTone ) )
+        {
+        PlayDefaultTone( aVolume, aRingingType );
+        }
+    else if ( aRingingType == EProfileRingingTypeSilent )
+        {
+        PlaySilentTone();
+        }
+    else if ( aRingingType == EProfileRingingTypeBeepOnce )
+        {
+        BeepOnce( aVolume );
+        }
+    else
+        {
+        // 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( aVolume, aRingingType );
+            }
+        else
+            {
+            __PHONELOG( 
+                EBasic, 
+                EPhoneUIView, 
+                "CPhoneRingingTonePlayerAO::PlayAudioRingTone - Start playing audio" );
+            iVolume = aVolume;
+            iRingingType = aRingingType;
+            AddTtsPlaybackIfNeeded( aRingingType );
+            iTonePlayingStatus = EAudioTonePlaying;
+            iAudioPlayer->Play( 
+                ConvertRingingType( aRingingType ),
+                aVolume,
+                iTtsToneToBePlayed );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::BeepOnce
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::BeepOnce( TInt aVolume )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::BeepOnce()" );
+    __PHONELOG1( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::BeepOnce - aVolume(%d)",
+        aVolume );
+
+    if ( !iBeepOncePlayer )
+        {
+        ConstructSequencePlayer( EPlayerBeepOnce );
+        }
+
+    if ( iBeepOncePlayer )
+        {
+        __PHONELOG( 
+            EBasic, 
+            EPhoneUIView, 
+            "CPhoneRingingTonePlayerAO::BeepOnce - Play" );
+        iTonePlayingStatus = EBeepOnce;
+        iBeepOncePlayer->Play( CPhoneAudioPlayer::ETypeRingingOnce, 
+            aVolume, EFalse );        
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::PlaySilentTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::PlaySilentTone()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::PlaySilentTone()" );
+
+    if ( !iSilentPlayer )
+        {
+        ConstructSequencePlayer( EPlayerSilent );
+        }
+
+    __ASSERT_DEBUG( iSilentPlayer, Panic( EPhoneViewGeneralError ) );
+
+    if ( iSilentPlayer )
+        {
+        __PHONELOG( 
+            EBasic, 
+            EPhoneUIView, 
+            "CPhoneRingingTonePlayerAO::PlaySilentTone - play" );
+        iTonePlayingStatus = ESilentTonePlaying;
+        iSilentPlayer->Play( CPhoneAudioPlayer::ETypeRinging, 0, EFalse );        
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::PlayUnsecureVoIPTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::PlayUnsecureVoIPTone()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::PlayUnsecureVoIPTone()" );
+    if ( !iUnsecureVoIPTonePlayer )
+        {
+        ConstructSequencePlayer( EPlayerUnsecureVoIP );
+        }
+    __ASSERT_DEBUG( iUnsecureVoIPTonePlayer, Panic( EPhoneViewGeneralError ) );
+
+    if ( iUnsecureVoIPTonePlayer )
+        {
+        iTonePlayingStatus = EUnsecureVoIPTonePlaying;
+        iUnsecureVoIPTonePlayer->Play( CPhoneAudioPlayer::ETypeRingingOnce,
+            KPhoneDefaultVolume, EFalse );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::MuteRingingToneOnAnswer
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::MuteRingingToneOnAnswer()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::MuteRingingToneOnAnswer()" );
+    
+    if ( iVideoPlayer && iTonePlayingStatus == EVideoTonePlaying ||
+         iTonePlayingStatus == EPersonalVideoTonePlaying )
+        {
+        // Mute the video audio
+        iVideoPlayer->MuteVideoRingTone();
+        iTonePlayingStatus = ESilentVideoTonePlaying;
+        iVolume = 0;
+        }
+    else
+        {
+        DoMuteRingingTone();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::MuteRingingTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::MuteRingingTone()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::MuteRingingTone()" );
+    
+    if ( iVideoPlayer && iTonePlayingStatus == EVideoTonePlaying ||
+         iTonePlayingStatus == EPersonalVideoTonePlaying )
+        {
+        // Mute the video audio
+        iVideoPlayer->MuteVideoRingTone();
+        iTonePlayingStatus = ESilentVideoTonePlaying;
+        iVolume = 0;
+        }
+    else
+        {
+        StopPlaying();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::StopPlaying
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::StopPlaying()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::StopPlaying()" );
+
+    iTtsToneToBePlayed = EFalse;
+    iTTsTimeOutCounter = 0;
+    iTtsDelayTimer->Cancel();
+    if ( iTtsPlayer )
+        {
+        iTtsPlayer->StopPlaying();
+        delete iTtsPlayer;
+        iTtsPlayer = NULL;
+        }
+    iTimer->Cancel();
+
+    switch( iTonePlayingStatus )
+        {
+        case EAudioTonePlaying:
+            if( iAudioPlayer )
+                {
+                // Commented stopping out, since with this, the screen is jammed
+                // when REComSession::FinalClose() is reached in 
+                // CPhoneAudioPlayer's destructor.
+                // Audio player is stopped anyway in its destructor.
+                // Fixes EKKI-7WYG2G and JKAN-7XNGQU.
+                // 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 EUnsecureVoIPTonePlaying:
+            if( iUnsecureVoIPTonePlayer )
+                {
+                iUnsecureVoIPTonePlayer->StopPlaying();
+                delete iUnsecureVoIPTonePlayer;
+                iUnsecureVoIPTonePlayer = NULL;
+                }
+            break;
+        case EVideoTonePlaying: // video ringing tone
+        case EPersonalVideoTonePlaying:
+        case ESilentVideoTonePlaying:
+            if ( iBeepOncePlayer != NULL )
+                {
+                iBeepOncePlayer->StopPlaying();
+                delete iBeepOncePlayer;
+                iBeepOncePlayer = NULL;                    
+                }
+                
+            if ( iSilentPlayer != NULL )
+                {
+                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;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::PlayTtsTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::PlayTtsTone( 
+    const TDesC& aTextToSay, 
+    TInt aVolume,
+    TProfileRingingType aRingingType )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::PlayTtsTone()" );
+    __PHONELOG2( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::PlayTtsTone - aVolume(%d), aRingingType(%d)",
+        aVolume, aRingingType );
+
+    if ( iTtsPlayer )
+        {
+        delete iTtsPlayer;
+        iTtsPlayer = NULL;
+        }
+
+    //Set ringingtype for Tts.
+    iTtsRingingType = aRingingType;
+    iTtsVolume = aVolume;
+
+    // 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, 
+            EPhoneUIView, 
+            "CPhoneRingingTonePlayerAO::PlayTtsTone - about to say %S",
+            &pPreparedString );
+
+        TRAPD( 
+            error, 
+            iTtsPlayer = CPhoneAudioPlayer::NewTtsL( 
+               *preparedString, 
+               KAudioPriorityPhoneCall, 
+               KAudioPrefTextToSpeechCallHardCoded,
+               *this, 
+               EPlayerTts ) );
+        if( error == KErrNone ) 
+            {
+            // To be played when default or personal tone will be played
+            iTtsToneToBePlayed = ETrue;
+            }
+        __PHONELOG2(
+            EBasic,
+            EPhoneUIView,
+            "CPhoneRingingTonePlayerAO::PlayTtsTone - error(%d), iTtsPhoneToBePlayed(%d)",
+            error, 
+            iTtsToneToBePlayed );
+
+        delete preparedString;  
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::HandleAudioPlayerError
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::HandleAudioPlayerError( 
+    TPhoneAudioPlayerErrorEvent /*aEvent*/, 
+    TInt aError, 
+    TInt /*aId*/ )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::HandleAudioPlayerError()" );
+    // This is called from CPhoneAudioPlayer - we do not 
+    // want to delete instances from which this method
+    // is called.
+    
+     __PHONELOG1( EBasic, 
+                 EPhoneUIView, 
+                 "CPhoneRingingTonePlayerAO::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.
+
+        ConstructPlayers(); // Ignore error code.
+        }
+
+    iTimer->Cancel();
+    DoHandlePlayerError( !deleteAll, EFalse );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::HandleAudioPlayerInitComplete
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::HandleAudioPlayerInitComplete( TInt aId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::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();
+        }
+   
+    if( iTtsToneToBePlayed && ( aId != EPlayerTts ) )  
+        {
+        // 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 ) );
+                }
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::HandlePlayingComplete
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::HandlePlayingComplete( TInt aId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::HandlePlayingComplete()" );
+    // This is called from CPhoneAudioPlayer - we do not 
+    // want to delete instances from which this method
+    // is called. 
+
+    __PHONELOG2(
+        EBasic, 
+        EPhoneUIView,
+        "CPhoneRingingTonePlayerAO::HandlePlayingComplete - aId(%d), iRingingType(%d)",
+        aId,
+        iRingingType );
+    __PHONELOG2(
+        EBasic, 
+        EPhoneUIView,
+        "CPhoneRingingTonePlayerAO::HandlePlayingComplete - iTtsToneToBePlayed(%d), iTtsDelayIndex(%d)",
+        iTtsToneToBePlayed,
+        iTtsDelayIndex );
+
+    if ( aId == EPlayerTts ) 
+        {
+        __PHONELOG( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::HandlePlayingComplete - resuming after TTS" );
+
+        // TTS playing complete, normal tone player should volume up.
+        if ( ( iTtsToneToBePlayed ) && ( ++iTtsDelayIndex < iTtsDelaysCount ) )  
+            {
+            __PHONELOG( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::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, EPhoneUIView, "CPhoneRingingTonePlayerAO::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   
+    else if ( iRingingType == EProfileRingingTypeRingingOnce && 
+        iTtsToneToBePlayed )   
+        {
+        __PHONELOG( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::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 ( iRingingType == EProfileRingingTypeRinging && iTtsToneToBePlayed )
+        {  
+        __PHONELOG( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::HandlePlayingComplete - ringing and TTS" );
+        if ( iTtsDelayIndex == iTtsDelaysCount )
+            {
+            //Case: Ringingtype is EProfileRingingTypeRinging. New TTS
+            //iterations are required.    
+            __PHONELOG( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::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;  
+        }
+
+    __PHONELOG1( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::HandlePlayingComplete - delete player - iTonePlayingStatus(%d)",
+        iTonePlayingStatus );    
+    switch( iTonePlayingStatus )
+        {
+        case EAudioTonePlaying:
+            DeletePlayerAsync( EPlayerAudio );
+            iAudioPlayer = NULL;
+            break;
+            
+        case EDefaultTonePlaying:
+            DeletePlayerAsync( EPlayerDefault );
+            iDefaultPlayer = NULL;
+            break;
+            
+        case ESilentTonePlaying:
+            DeletePlayerAsync( EPlayerSilent );
+            iSilentPlayer = NULL;
+            break;
+
+        case EUnsecureVoIPTonePlaying:
+            DeletePlayerAsync( EPlayerUnsecureVoIP );
+            iUnsecureVoIPTonePlayer = 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;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::HandleTimeOutL
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::HandleTimeOutL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::HandleTimeOutL()" );
+
+    // 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 );
+      }			
+		
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::DoHandlePlayerError
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::DoHandlePlayerError(
+    TBool aDelete,
+    TBool aSync )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::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;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::PlayDefaultTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::PlayDefaultTone( 
+    TInt aVolume, 
+    TProfileRingingType aRingingType )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::PlayDefaultTone()" );
+
+    if( aRingingType == EProfileRingingTypeSilent ||
+        aRingingType == EProfileRingingTypeBeepOnce )
+        {
+        return;
+        }
+        
+    if ( !iDefaultRingingTone )
+        {
+        __PHONELOG( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::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.
+    if ( !iDefaultPlayer )
+        {
+        __PHONELOG( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::PlayDefaultTone - player not constructed, play backup..." );
+        iTimer->Cancel();
+        PlayBackupTone( aVolume, aRingingType );
+        }
+    else
+        {
+        __PHONELOG( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::PlayDefaultTone - play" );
+        iVolume = aVolume;
+        iRingingType = aRingingType;
+        iTonePlayingStatus = EDefaultTonePlaying;
+        iDefaultPlayer->Play( 
+            ConvertRingingType( aRingingType ), aVolume, iTtsToneToBePlayed );
+        }
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::PlayBackupTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::PlayBackupTone( 
+    TInt aVolume, 
+    TProfileRingingType aRingingType )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::PlayBackupTone()" );
+    __ASSERT_DEBUG( iBackupPlayer, Panic( EPhoneViewGeneralError ) );
+
+    if ( !iBackupPlayer )
+        {
+        ConstructPlayers();
+        }
+
+    if ( iBackupPlayer )
+        {
+        __PHONELOG( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::PlayBackupTone - play" );
+        iTonePlayingStatus = EBackupTonePlaying;
+
+        // Cease 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 );        
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::ConstructTonePlayer
+// -----------------------------------------------------------------------------
+//
+CPhoneAudioPlayer* CPhoneRingingTonePlayerAO::ConstructTonePlayer( 
+    const CPhoneRingingTone& aRingingTone,
+    TInt aId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::ConstructTonePlayer()" );
+    return CPhoneAudioPlayer::New(
+        aRingingTone, 
+        KAudioPriorityPhoneCall, 
+        KAudioPrefIncomingCall,
+        *this, 
+        aId,
+        iMdaServer,
+        aId == EPlayerDefault ? EFalse : iExtSecNeeded );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::ConvertRingingType
+// -----------------------------------------------------------------------------
+//
+CPhoneAudioPlayer::TRingingType CPhoneRingingTonePlayerAO::ConvertRingingType(
+    TProfileRingingType aRingingType )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::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;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::ConvertVideoRingingType
+// -----------------------------------------------------------------------------
+//
+MPhoneVideoPlayer::TPlayMode CPhoneRingingTonePlayerAO::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;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::ConstructPlayers
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneRingingTonePlayerAO::ConstructPlayers()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::ConstructPlayers()" );
+    TRAPD( err, ConstructPlayersL() );
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::ConstructPlayersL
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::ConstructPlayersL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::ConstructPlayersL()" );
+
+    // Construct players.
+    if ( !iMdaServer )
+        {
+        iMdaServer = CMdaServer::NewL();
+        }
+
+    // Construct Backup player.
+    if ( !iBackupPlayer )
+        {
+        TFileName defaultSoundFile( KDriveZ );
+        defaultSoundFile.Append( KPhoneDefaultSoundFile );
+        iBackupPlayer = CPhoneAudioPlayer::NewL( 
+            defaultSoundFile,
+            KAudioPriorityPhoneCall,
+            KAudioPrefIncomingCall,
+            *this,
+            EPlayerBackup,
+            iMdaServer 
+            );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::ConstructSequencePlayer
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::ConstructSequencePlayer( TPlayerId aId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::ConstructSequencePlayer()" );
+
+    // Construct players.
+    TRAPD( err, ConstructSequencePlayerL( aId ) );
+    if ( err )
+        {
+        __PHONELOG1( EBasic, EPhoneUIView, 
+        "CPhoneRingingTonePlayerAO::ConstructSequencePlayer - err(%d)", err );    
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::ConstructSequencePlayerL
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::ConstructSequencePlayerL( TPlayerId aId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::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__
+        }        
+    
+    else if ( aId == EPlayerUnsecureVoIP )
+        {
+#ifdef __WINS__
+        TParse* fp = new (ELeave) TParse();
+        fp->Set( KPhoneBeepOnceSoundFile, &KDC_RESOURCE_FILES_DIR, NULL ); 
+        TFileName fileName( fp->FullName() );
+        delete fp;
+
+        iUnsecureVoIPTonePlayer = CPhoneAudioPlayer::NewL( 
+            fileName, 
+            KAudioPrioritySpecialInformationTone,
+            KAudioPrefSpecialInformation,
+            *this, 
+            EPlayerUnsecureVoIP );
+#else
+        iUnsecureVoIPTonePlayer = CPhoneAudioPlayer::NewSeqL(
+            KPhoneUnsecureVoIPCall(),
+            KAudioPrioritySpecialInformationTone,
+            KAudioPrefSpecialInformation,
+            *this,
+            EPlayerUnsecureVoIP );
+#endif // __WINS__
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::CleanupPlayers
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::CleanupPlayers()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::CleanupPlayers()" );
+
+    delete iAudioPlayer;
+    iAudioPlayer = NULL;
+
+    delete iDefaultPlayer;
+    iDefaultPlayer = NULL;
+
+    delete iBeepOncePlayer;
+    iBeepOncePlayer = NULL;
+
+    delete iSilentPlayer;
+    iSilentPlayer = NULL;
+    
+    delete iUnsecureVoIPTonePlayer;
+    iUnsecureVoIPTonePlayer = NULL;
+
+    delete iBackupPlayer;
+    iBackupPlayer = NULL;
+      
+    delete iMdaServer;
+    iMdaServer = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::DeletePlayerAsync
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::DeletePlayerAsync( TPlayerId aPlayer )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::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,
+        &iUnsecureVoIPTonePlayer,
+        &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();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::RunL
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::RunL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::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;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::DoCancel
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::DoCancel()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::DoCancel()" );
+    // Request is completed immediately before SetActive.
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::HandleTtsDelayTimeout
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneRingingTonePlayerAO::HandleTtsDelayTimeout( TAny* object )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::HandleTtsDelayTimeout()" );
+    static_cast<CPhoneRingingTonePlayerAO*>( object )->
+        DoHandleTtsDelayTimeout();
+    return KErrNone;
+    }
+        
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::DoHandleTtsDelayTimeout
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::DoHandleTtsDelayTimeout()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::DoHandleTtsDelayTimeout()" );
+    __PHONELOG2( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::DoHandleTtsDelayTimeout - iTtsRingingType(%d), iTTsTimeOutCounter(%d)",
+        iTtsRingingType, iTTsTimeOutCounter );
+
+    CPhoneAudioPlayer* currPlayer = NULL;
+    currPlayer = GetCurrentlyActiveAudioPlayerWithTTs();        
+    
+    if ( !currPlayer )
+        {
+        __PHONELOG( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::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, EPhoneUIView, "CPhoneRingingTonePlayerAO::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, EPhoneUIView, "CPhoneRingingTonePlayerAO::DoHandleTtsDelayTimeout - play normal" ); 
+        currPlayer->SetNewVolumeAndRamptime( iTtsVolume-5, 0 );                       
+        iTtsPlayer->Play(
+            ConvertRingingType( EProfileRingingTypeRingingOnce ),
+            iTtsVolume,
+            iTtsToneToBePlayed );
+        }
+      
+     iTTsTimeOutCounter++;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::AddTtsPlaybackIfNeeded
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::AddTtsPlaybackIfNeeded( 
+        TProfileRingingType /*aRingingType*/ )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::AddTtsPlaybackIfNeeded()" );
+    if ( iTtsToneToBePlayed )   
+        {
+        iTtsDelayIndex = 0;
+        iTtsDelaysCount = KPhoneTtsDelaysCount;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::SetVideoPlayer
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::SetVideoPlayer( 
+    MPhoneVideoPlayer* aVideoPlayer )
+    {
+    iVideoPlayer = aVideoPlayer;    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::PlayVideoRingingTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::PlayVideoRingingTone( 
+    const CPhoneRingingTone& aRingingTone, 
+    TInt aVolume, 
+    TProfileRingingType aRingingType,
+    TBool aPersonalTone )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::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, 
+                        EPhoneUIView, 
+                        "CPhoneRingingTonePlayerAO::HandleVideoPlayerError - PermissionDenied" );
+            PlayDefaultTone( iVolume, iRingingType );
+            return;
+            }
+        __PHONELOG( EBasic, 
+                    EPhoneUIView, 
+                    "CPhoneRingingTonePlayerAO::HandleVideoPlayerError - ExtSecChk ok" );            
+            }
+ 
+    __PHONELOG( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::PlayVideoRingingTone - play" );
+    switch( aRingingType )
+        {
+        case EProfileRingingTypeSilent:
+            iVideoPlayer->PlayVideoRingTone( 
+                aRingingTone.FileName(),
+                ConvertVideoRingingType( aRingingType ),
+                0,
+                iArbitraryVideoScaling,
+                this );
+            PlaySilentTone(); // To start vibra, video may fail.
+            iVolume = 0; // for repeat
+            startTimer = EFalse; // no need for fallback
+            break;
+        
+        case EProfileRingingTypeBeepOnce:
+            iVideoPlayer->PlayVideoRingTone( 
+                aRingingTone.FileName(),
+                ConvertVideoRingingType( aRingingType ),
+                0,
+                iArbitraryVideoScaling,
+                this );
+            BeepOnce( iVolume );
+            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 );
+        }
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::HandleVideoPlayerError
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::HandleVideoPlayerError( 
+    TPhoneVideoPlayerErrorEvent /*aEvent*/,
+    TInt aError )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::HandleVideoPlayerError()" );
+
+    if ( aError )
+        {
+        __PHONELOG1( EBasic, 
+                     EPhoneUIView, 
+                     "CPhoneRingingTonePlayerAO::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
+        PlayDefaultTone( iVolume, iRingingType );
+        }
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::HandleVideoPlayerInitComplete
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::HandleVideoPlayerInitComplete()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::HandleVideoPlayerInitComplete()" );
+    
+    // cancel guarding timer
+    iTimer->Cancel();
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::HandleVideoPlayerPlayingComplete
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::HandleVideoPlayerPlayingComplete()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::HandleVideoPlayerPlayingComplete()" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::PlayDefaultVideoAsync
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::PlayDefaultVideoAsync()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::PlayDefaultVideoAsync()" );    
+     
+    Cancel();
+
+    iState = EPlayingDefaultVideo; 
+
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, KErrNone );
+    SetActive();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::ExtendedSecurity
+// -----------------------------------------------------------------------------
+//    
+TBool CPhoneRingingTonePlayerAO::ExtendedSecurity() const
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::ExtendedSecurity()" );
+    return iExtSecNeeded;        
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::SolveNewVolumeAndRamptime
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::SolveNewVolumeAndRamptime( TTtsStatus aStatus )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::SolveNewVolumeAndRamptime()" );
+
+    CPhoneAudioPlayer* currPlayer = NULL;
+    currPlayer = GetCurrentlyActiveAudioPlayerWithTTs();
+    if ( !currPlayer )
+        {
+        __PHONELOG( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::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, EPhoneUIView, "CPhoneRingingTonePlayerAO::SolveNewVolumeAndRamptime - said once ascending - ramptime(%d)",
+                    ramptime ); 
+                currPlayer->SetNewVolumeAndRamptime( KPlayerVolumeAscendingRepeat, ramptime );
+                }
+            else
+                {
+                 //Normal ringingtone case. Adjust volume back to profile level. 
+                __PHONELOG1( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::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, EPhoneUIView, "CPhoneRingingTonePlayerAO::SolveNewVolumeAndRamptime - said twice ascending - ramptime(%d)",
+                    ramptime ); 
+                currPlayer->SetNewVolumeAndRamptime( iTtsVolume, ramptime );
+                }
+            else
+                {
+                 //Normal ringingtone case. Adjust volume back to profile level. 
+                __PHONELOG1( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::SolveNewVolumeAndRamptime - said twice normal - ramptime(%d)",
+                    ramptime ); 
+                currPlayer->SetNewVolumeAndRamptime( iTtsVolume, 0 );
+                }
+            break;
+        
+        default:
+            break;
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::GetCurrentlyActiveAudioPlayerWithTTs
+// -----------------------------------------------------------------------------
+//    
+CPhoneAudioPlayer* 
+CPhoneRingingTonePlayerAO::GetCurrentlyActiveAudioPlayerWithTTs()
+    {    
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::GetCurrentlyActiveAudioPlayerWithTTs()" );
+
+    if( iAudioPlayer )
+        {
+        __PHONELOG( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::GetCurrentlyActiveAudioPlayerWithTTs - audio player" ); 
+        return iAudioPlayer;         
+        }
+    else if ( iDefaultPlayer )
+        {
+        __PHONELOG( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::GetCurrentlyActiveAudioPlayerWithTTs - default player" ); 
+        return iDefaultPlayer;     
+        }
+    else if( iBackupPlayer )
+        {
+        __PHONELOG( EBasic, EPhoneUIView, "CPhoneRingingTonePlayerAO::GetCurrentlyActiveAudioPlayerWithTTs - backup player" ); 
+        return iBackupPlayer;
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::ReStartRingingTonePlayer
+// -----------------------------------------------------------------------------
+//      
+void CPhoneRingingTonePlayerAO::ReStartRingingTonePlayer()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::ReStartRingingTonePlayer()" );
+
+    //First get currently active player which plays among TTS player.
+    CPhoneAudioPlayer* currPlayer = NULL;
+    currPlayer = GetCurrentlyActiveAudioPlayerWithTTs();   
+    if ( currPlayer )
+        {
+        currPlayer->ReStartPlaying();
+        }      
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::CheckAndHandleToneSizeLimit
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneRingingTonePlayerAO::CheckAndHandleToneSizeLimit(
+     CPhoneRingingTone* aRingingTone )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::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( aRingingTone->FileName(), iToneFileSizeLimitKB) != KErrNone )
+            {
+            bValidSize = EFalse;
+            }            
+        }
+    __PHONELOG1( 
+        EBasic,
+        EPhoneUIView, 
+        "CPhoneRingingTonePlayerAO::CheckAndHandleToneSizeLimit - bValidSize(%d)",
+        bValidSize);
+        
+    return bValidSize;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::CheckToneFileSize
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneRingingTonePlayerAO::CheckToneFileSize( const TDesC& aFile, TInt aSizeLimitKB )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::CheckToneFileSize()" );
+    
+    // Get file size
+    TInt size = 0;
+    TInt error = KErrNone;
+    RFs& fs = CCoeEnv::Static()->FsSession();       
+    TEntry entry;
+    if (KErrNone == fs.Entry( aFile, entry ))
+		{
+		size = entry.iSize;
+		}    
+        
+    // Check
+    aSizeLimitKB *= Kkilo;
+    if ( aSizeLimitKB  &&  size > aSizeLimitKB )
+        {
+        error = KErrTooBig;
+        }
+    
+    __PHONELOG1( 
+        EBasic,
+        EPhoneUIView, 
+        "CPhoneRingingTonePlayerAO::CheckToneFileSize - size (%d)",
+        size );    
+    return error;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::GetMaxToneFileSizeL
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::GetMaxToneFileSizeL( TInt& aMaxSizeKB ) const
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::GetMaxToneFileSizeL()" );
+    
+    const TInt error = CPhoneCenRepProxy::Instance()->GetInt( 
+            KCRUidProfileEngine,
+            KProEngRingingToneMaxSize,
+            aMaxSizeKB );
+   
+   	if ( error != KErrNone )
+    	{
+        aMaxSizeKB = 0;
+    	}
+	if ( aMaxSizeKB < 0 )
+	    {
+	     aMaxSizeKB = 0;
+	    }
+  
+    __PHONELOG2( 
+        EBasic,
+        EPhoneUIView, 
+        "CPhoneRingingTonePlayerAO::GetMaxToneFileSizeL - error (%d), aMaxSizeKB(%d)",
+        error,
+        aMaxSizeKB );	    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::ActiveAudioPlayer
+// -----------------------------------------------------------------------------
+//
+CPhoneAudioPlayer* CPhoneRingingTonePlayerAO::ActiveAudioPlayer()
+	{
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::ActiveAudioPlayer()" );
+
+    switch( iTonePlayingStatus )
+        {
+        case EAudioTonePlaying:
+            if( iAudioPlayer != NULL )
+                {
+				return iAudioPlayer;
+                }
+            break;
+            
+        case EDefaultTonePlaying:
+            if ( iDefaultPlayer != NULL )
+                {
+				return iDefaultPlayer;
+                }
+            break;
+            
+        case EBeepOnce:
+            if( iBeepOncePlayer != NULL )
+                {
+				return iBeepOncePlayer;
+                }
+            break;
+            
+        case EBackupTonePlaying:
+            if( iBackupPlayer != NULL )
+                {
+                return iBackupPlayer;
+                }
+            break;
+            
+        case ESilentTonePlaying:
+            if( iSilentPlayer != NULL )
+                {
+                return iSilentPlayer;
+                }
+            break;
+            
+        case EUnsecureVoIPTonePlaying:
+            if( iUnsecureVoIPTonePlayer != NULL )
+                {
+                return iUnsecureVoIPTonePlayer;
+                }
+            break;
+            
+        case EVideoTonePlaying: // video ringing tone
+        case EPersonalVideoTonePlaying:
+        case ESilentVideoTonePlaying:
+            if ( iBeepOncePlayer != NULL )
+                {
+                return iBeepOncePlayer;                    
+                }    
+            else if ( iSilentPlayer != NULL )
+                {
+                return iSilentPlayer;                    
+                }    
+            break;
+            
+        default:
+            break;
+        }
+
+	return NULL;		
+	}
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTonePlayerAO::DoMuteRingingTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::DoMuteRingingTone()
+	{
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::DoMuteRingingTone()" );
+	
+	switch( iTonePlayingStatus )
+		{
+        case EVideoTonePlaying: // video ringing tone, fall through
+        case EPersonalVideoTonePlaying: // fall through
+        case ESilentVideoTonePlaying:
+            if ( iVideoPlayer != NULL )
+	            {
+                iVideoPlayer->MuteVideoRingTone();
+                return;	            	
+	            }
+	        break;
+	        
+	    default:
+	    	break;
+		}
+	
+	CPhoneAudioPlayer* activePlayer = ActiveAudioPlayer();
+	if( activePlayer != NULL )
+		{
+		activePlayer->MutePlaying();
+		}
+	}
+
+// -----------------------------------------------------------
+// CPhoneRingingTonePlayerAO::HandleCenRepChangeL
+// -----------------------------------------------------------
+//
+void CPhoneRingingTonePlayerAO::HandleCenRepChangeL( 
+    const TUid& aUid,
+    const TUint /*aId*/ )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneRingingTonePlayerAO::HandleCenRepChangeL()");
+    
+    if ( aUid == KCRUidDRMHelperServer )
+        {
+        TBuf<256> tempBuf16( KNullDesC );
+        
+        User::LeaveIfError( CPhoneCenRepProxy::Instance()->GetString(
+            KCRUidDRMHelperServer,
+            KDRMHelperServerNotificationPassive,
+            tempBuf16 ) );         
+       
+        const TBool idleIsTopApp = CPhonePubSubProxy::Instance()->Value(
+            KPSUidAiInformation, KActiveIdleState ) == EPSAiForeground;
+       
+        // Quick validity check and    
+        // The first Tuint8 is the times the content has been informed.
+        // Note should not shown until Idle.
+        if ( idleIsTopApp && tempBuf16.Length() >= KPhoneMinDRMTextLength )
+            { 
+            TBuf8<256> tempBuf8;
+            TPtrC8 ptr((TUint8*)tempBuf16.Ptr(), tempBuf16.Size());
+            HBufC8* buf8 = HBufC8::NewLC( 256 );
+            buf8->Des().Copy(ptr);  
+    	    // Extract URI etc. 
+    	    // buf8 format:
+    	    //<TUint8 aTimes><TUint8 aExpirationMark>
+    	    //<TUint8 aPermissionType>
+    	    //<TUint8 aAutomatedContentType><TDesC8 aContentID>
+     	    TInt8 count = (TInt8)(*(buf8->Ptr())); 
+    	    TChar mark = (TChar)(*(buf8->Ptr()+1));
+    	    TInt8 permtype = (TChar)(*(buf8->Ptr()+2));
+    	    TInt8 automcontenttype = (TChar)(*(buf8->Ptr()+3)); 
+    	    TBuf8<256> curi = buf8->Right( buf8->Length()-4);
+    		
+    		if (curi.Ptr()[curi.Size()-1] == 0)
+    		    {
+    		    // The last character in the descriptor is 0, which means
+    		    // that the original 16-bit desc was padded so
+    		    // remove the last char...
+    		    curi.SetLength(curi.Size()-1);
+    		    }
+    		        
+            // Create DRM helper.     
+            CDRMHelper* drmHelper = CDRMHelper::NewLC();            
+            // Show notification.
+            drmHelper->SetAutomatedType( (CDRMHelper::TDRMHelperAutomatedType)automcontenttype );
+            TInt error = drmHelper->CheckRightsAmountL( curi );
+
+            __PHONELOG1( EBasic, EPhoneUIView, 
+                "CPhoneRingingTonePlayerAO::HandleCenRepChangeL > CheckRightsAmountL, error: %d"
+                , error );
+                           
+            CleanupStack::PopAndDestroy( drmHelper ); 
+            CleanupStack::PopAndDestroy( buf8 ); 
+            } 
+        }
+    }
+    
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonesingleitemfetch.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,285 @@
+/*
+* 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:  Fetch items from Contacts
+*
+*/
+
+
+#include <eikenv.h>
+#include <cphcntsingleitemfetch.h>
+#include <cphcntcontactid.h>
+#include <PhCltUtils.h>
+#include <eikcmobs.h>
+#include <AknQueryDialog.h>
+
+#include "cphoneviewcontroller.h"
+#include "cphonecontactcontroller.h"
+#include "cphonesingleitemfetch.h"
+#include "tphonecommandparam.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamsingleitemfetch.h"
+#include "cphonestatuspane.h"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+#include "phonelogger.h"
+#include "cphoneview.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+// C++ default constructor can NOT contain any code, that
+// might leave
+// ---------------------------------------------------------------------------
+//
+CPhoneSingleItemFetch::CPhoneSingleItemFetch(
+    CEikonEnv& aEikEnv,
+    CPhoneViewController& aViewController,
+    CPhoneContactController& aContactController,
+    CPhoneStatusPane& aStatusPane )
+    : CActive ( EPriorityStandard ),
+    iEikEnv( aEikEnv ),
+    iViewController( aViewController ),
+    iContactController( aContactController ),
+    iStatusPane( aStatusPane )
+    {
+    CActiveScheduler::Add( this );
+    iViewController.PhoneView()->SetPhoneViewObserver( *this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneSingleItemFetch::NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CPhoneSingleItemFetch* CPhoneSingleItemFetch::NewL(
+    CEikonEnv& aEikEnv,
+    CPhoneViewController& aViewController,
+    CPhoneContactController& aContactController,
+    CPhoneStatusPane& aStatusPane )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneSingleItemFetch::NewL() ");
+    CPhoneSingleItemFetch* self =
+        new( ELeave ) CPhoneSingleItemFetch( aEikEnv,
+                                             aViewController,
+                                             aContactController,
+                                             aStatusPane );
+    return self;
+    }
+
+
+// ---------------------------------------------------------
+// CPhoneSingleItemFetch::RunL
+// ---------------------------------------------------------
+//
+void CPhoneSingleItemFetch::RunL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneSingleItemFetch::RunL()" );
+
+    iButtonId = EPhoneViewYesSingleItemFetch;
+
+    // First open the single item fetch dialog
+    HBufC* fetchContent = HBufC::NewLC( KPhoneNumberEntryBufferSize );
+    fetchContent->Des().Zero();
+    TPtr ptr( fetchContent->Des() );
+    TPhoneCmdParamSingleItemFetch singleItemFetchParam;
+
+    if ( iResourceId == EPhoneNewCallFetchTitle )
+        {
+        singleItemFetchParam.SetType( CPhCntSingleItemFetch::EFetchNewCall );
+        singleItemFetchParam.SetTitlePaneResourceId(
+            CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneNewCallFetchTitle ) );
+        singleItemFetchParam.SetCbaResourceId(
+            CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneNewCallFetchCBA ) );
+        singleItemFetchParam.SetString( &ptr );
+        }
+    else if ( iResourceId > EPhoneRssBaseLast )
+        {
+        singleItemFetchParam.SetType( CPhCntSingleItemFetch::EFetchNewPSCall );
+        singleItemFetchParam.SetTitlePaneResourceId(
+            CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneNewCallFetchTitle ) );
+        singleItemFetchParam.SetCbaResourceId(
+        CPhoneMainResourceResolver::Instance()->
+           ResolveResourceID( EPhoneNewCallFetchCBA ) );
+        singleItemFetchParam.SetString( &ptr );
+        }
+    else // EPhoneDtmfFetchTitle & EPhoneDtmfNumberQuery
+        {
+        singleItemFetchParam.SetType( CPhCntSingleItemFetch::EFetchDtmf );
+        singleItemFetchParam.SetTitlePaneResourceId(
+            CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneDtmfFetchTitle ) );
+        singleItemFetchParam.SetCbaResourceId(
+            CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( KPhoneDefaultFetchCBA ) );
+        singleItemFetchParam.SetString( &ptr );
+        }
+
+    // Change title pane contents
+    CBase* textTitlePane = iStatusPane.CreateTextTitlePaneLC(
+    singleItemFetchParam.TitlePaneResourceId() );
+
+    CPhCntSingleItemFetch::TFetchParams result;
+    result.iType = singleItemFetchParam.Type();
+    result.iString = singleItemFetchParam.String();
+    result.iCbaResource = singleItemFetchParam.CbaResourceId();
+    result.iNumberType = MPhCntMatch::ENone;
+    result.iContactId = NULL;
+
+    TInt retval = KErrNotFound;
+    if( iSingleItemFetch )
+        {
+        retval = iSingleItemFetch->FetchLD( result );
+        iFetchPerformed = ETrue;
+        iSingleItemFetch = NULL; // destructed in FetchLD
+        delete result.iContactId; // pointer which will leak otherwise
+        result.iContactId = NULL;
+        }
+
+    // The contact operation may be cancelled if the END key
+    // is pressed (res == KErrCancel).
+    // If so, the blocking dialog will be removed.
+    if ( !iViewController.BlockingDialogIsDisplayed() || ptr == KNullDesC )
+        {
+        // Indicate that the operation has been cancelled
+        iButtonId = EPhoneViewNoSingleItemFetch;
+        static_cast<MEikCommandObserver*>( iEikEnv.EikAppUi() )
+            ->ProcessCommandL( iButtonId );
+        iFetchPerformed = EFalse;
+        }
+    else if ( retval == KErrNone )
+        {
+        if ( CPhCntSingleItemFetch::EFetchNewPSCall !=
+                singleItemFetchParam.Type() )
+            {
+            // Remove garbage from buffer.
+            PhCltUtils::RemoveInvalidChars(
+                *( singleItemFetchParam.String() ) );
+            }
+        iViewController.SetFetchContent( ptr );
+        }
+
+    // restore title pane
+    CleanupStack::PopAndDestroy( textTitlePane );
+    CleanupStack::PopAndDestroy( fetchContent );
+    // Reset the flag
+    // ETrue if a blocking dialog is currently being displayed.
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( EFalse );
+    iViewController.ExecuteCommandL(
+        EPhoneViewSetBlockingDialogStatus,
+        &booleanParam );
+  }
+
+// ---------------------------------------------------------
+// CPhoneSingleItemFetch::RunError
+// ---------------------------------------------------------
+//
+TInt CPhoneSingleItemFetch::RunError( TInt /*aError */ )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneSingleItemFetch::RunError( ) ");
+    Delete();
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( EFalse );
+    TRAP_IGNORE( iViewController.ExecuteCommandL(
+        EPhoneViewSetBlockingDialogStatus, &booleanParam ))
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------
+// CPhoneSingleItemFetch::DoCancel
+// ---------------------------------------------------------
+//
+void CPhoneSingleItemFetch::DoCancel()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneSingleItemFetch::DoCancel()" );
+    Delete();
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhoneSingleItemFetch::~CPhoneSingleItemFetch()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView,
+        "CPhoneSingleItemFetch::~CPhoneSingleItemFetch()" );
+    Delete();
+    }
+
+
+// ---------------------------------------------------------
+// CPhoneSingleItemFetch::OpenSingleItemFetchDialogL
+// ---------------------------------------------------------
+//
+void CPhoneSingleItemFetch::OpenSingleItemFetchDialogL(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView,
+        "CPhoneSingleItemFetch::OpenSingleItemFetchDialogL()" );
+   if( !IsActive() )
+        {
+        TPhoneCmdParamInteger* resourceId 
+            = static_cast<TPhoneCmdParamInteger*>( aCommandParam );
+        iResourceId = resourceId->Integer();
+    
+        // Create the contact dialog
+        iSingleItemFetch = iContactController.CreateSingleItemFetchL();
+        
+        iViewController.SetSingleItemFetchType( iResourceId );
+        
+        SetActive();
+        TRequestStatus* status = &iStatus;
+        User::RequestComplete( status, KErrNone );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneSingleItemFetch::Delete
+// ---------------------------------------------------------
+//
+void CPhoneSingleItemFetch::Delete()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneSingleItemFetch::Delete()" );
+    if ( iSingleItemFetch )
+        {
+        iViewController.SetSingleItemFetchType( NULL );
+        
+        // Cancel request (FetchLD) by destroying the instance.
+        delete iSingleItemFetch;
+        iSingleItemFetch = NULL;
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneSingleItemFetch::PhoneViewActivatedL
+// ---------------------------------------------------------
+//
+void CPhoneSingleItemFetch::PhoneViewActivatedL()
+    {
+    // Phone view is fully activated, now provide selection to states.
+    if ( iFetchPerformed )
+        {
+        // reset flag
+        iFetchPerformed = EFalse;
+        static_cast<MEikCommandObserver*>( iEikEnv.EikAppUi() )
+            ->ProcessCommandL( iButtonId );
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonestatuspane.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,730 @@
+/*
+* 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 CPhoneTextTitlePane class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <aknappui.h>
+#include <eikspane.h>
+#include <akntitle.h>
+#include <aknnavi.h>
+#include <aknnavide.h>
+#include <aknnavilabel.h>
+#include <coemain.h>
+#include <avkon.rsg>
+#include <avkon.hrh>
+#include <AknIndicatorContainer.h>
+#include <barsread.h>
+#include <phoneui.rsg>
+#include <featmgr.h>
+#include <AknIconUtils.h> 
+#include <AknUtils.h> 
+#include <aknlayoutscalable_avkon.cdl.h> 
+
+#include "phoneui.pan"
+#include "cphonestatuspane.h"
+#include "mphonestatuspaneobserver.h"
+#include "cphonerecoverysystem.h"
+
+#include "tphonecommandparam.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparambitmap.h"
+#include "phonelogger.h"
+
+#include <stringloader.h>
+
+// CONSTANTS
+
+// MODULE DATA STRUCTURES
+
+/**
+*  It is title pane containing text.
+*/
+class CPhoneTextTitlePane : 
+    public CBase, 
+    private MPhoneStatusPaneObserver
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CPhoneTextTitlePane* NewLC( 
+            CPhoneStatusPane& aStatusPaneManager,
+            TInt aTextResourceId );
+        
+        /**
+        * Destructor.
+        */
+        ~CPhoneTextTitlePane();
+
+    public: // Functions from base classes
+
+        /**
+        * From MPhoneStatusPaneObserver, handles activation of title pane.
+        */
+        void HandleTitlePaneActiveL( TBool aActive );
+        
+    private:
+        
+        /**
+        * C++ constructor.
+        */
+        CPhoneTextTitlePane(
+            CPhoneStatusPane& aStatusPaneManager,
+            TInt aTextResourceId );
+      
+        /**
+        * Symbian OS constructor.
+        */
+        void ConstructL();
+        
+    private:  // Data
+
+        // Status pane manager.
+        CPhoneStatusPane& iStatusPaneManager;
+        
+        // Text resource id.
+        const TInt iTextResourceId;
+
+    };
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::Instance
+// Initializes the singleton object
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+CPhoneStatusPane* CPhoneStatusPane::Instance()
+    {
+    CPhoneStatusPane* instance = static_cast<CPhoneStatusPane*> 
+        ( CCoeEnv::Static ( KUidPhoneStatusPaneHandlerSingleton ) );
+    
+    if( !instance )
+        {
+        TRAPD( err, instance = CPhoneStatusPane::NewL() );
+        if ( err )
+	        {
+	        Panic( EPhoneUtilsCouldNotCreateSingleton );	
+	        }
+        }
+    return instance;
+    }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::CPhoneStatusPane
+// ---------------------------------------------------------
+//
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneStatusPane::CPhoneStatusPane( ) :
+    CCoeStatic( KUidPhoneStatusPaneHandlerSingleton, EThread ),
+    iTitlePaneList( NULL ),
+    iStatusPane( NULL ),
+    iTitlePane( NULL ),
+    iTitlePanePicture( NULL ),
+    iTitlePanePictureMask( NULL ),
+    iNaviPane( NULL ),
+    iNaviDecorator( NULL )
+    {
+    }
+
+// Symbian OS default constructor can leave.
+void CPhoneStatusPane::ConstructL()
+    {
+    iTitlePaneList = new ( ELeave ) CArrayFixFlat< THandlerTag > 
+        ( KPhoneTitlePaneListGranularity );
+
+    // Get pointer for title pane
+    iStatusPane = static_cast<CAknAppUi*>( CEikonEnv::Static()->
+        EikAppUi() )->StatusPane();
+    iTitlePane = static_cast<CAknTitlePane*>( iStatusPane->ControlL( 
+        TUid::Uid( EEikStatusPaneUidTitle ) ) );
+    iTitlePane->SetNumberOfVisibleTextRows( 1 );
+    
+    // Initialize display of title pane information
+    iTitlePaneTextIsDisplayed = ETrue;
+
+    // Get pointer for navigation pane
+    iNaviPane = static_cast<CAknNavigationControlContainer*>
+        ( iStatusPane->ControlL(TUid::Uid(EEikStatusPaneUidNavi)) );
+
+    if ( !FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) )
+        {
+        // Construct navi pane decorator
+        iNaviDecorator = iNaviPane->CreateNavigationLabelL( KNullDesC() );
+        iNaviPane->PushL( *iNaviDecorator );
+        }
+    
+    // Get recovery Id from recovery system
+    iUpdateTitlePaneRecoveryId = CPhoneRecoverySystem::Instance()->AddL( 
+        TCallBack( UpdateTitlePaneCallBackL, this ), 
+        CTeleRecoverySystem::EPhonePriorityStandard,
+        CTeleRecoverySystem::EPhoneStateIdle );
+    }
+
+// Constructor
+CPhoneStatusPane* CPhoneStatusPane::NewL()
+    {
+    CPhoneStatusPane* self = new (ELeave) CPhoneStatusPane();
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// Destructor
+CPhoneStatusPane::~CPhoneStatusPane()
+    {
+    if ( iTitlePaneList )
+        {
+        iTitlePaneList->Reset();
+        }
+    delete iTitlePaneList;
+    
+    iStatusPane = NULL;
+    iTitlePane = NULL;
+    
+    if( iTitlePanePicture )
+        {
+        delete iTitlePanePicture;
+        iTitlePanePicture = NULL;
+        }
+    if( iTitlePanePictureMask )
+        {
+        delete iTitlePanePictureMask;
+        iTitlePanePictureMask = NULL;
+        }
+    
+    iNaviPane = NULL;
+    
+    if ( iNaviDecorator )
+          {
+          delete iNaviDecorator;
+          iNaviDecorator = NULL;
+          }
+     
+    CPhoneRecoverySystem::Remove( iUpdateTitlePaneRecoveryId );
+    }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::UpdateTitlePane
+// ---------------------------------------------------------
+//
+void CPhoneStatusPane::UpdateTitlePane()
+    {
+    CPhoneRecoverySystem::Instance()->RecoverNow( 
+        iUpdateTitlePaneRecoveryId,
+        CTeleRecoverySystem::EPhonePriorityStandard );
+    }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::UpdateTitlePaneCallBackL
+// ---------------------------------------------------------
+//
+TInt CPhoneStatusPane::UpdateTitlePaneCallBackL( TAny* aAny )
+    {
+    reinterpret_cast<CPhoneStatusPane*>( aAny )->DoUpdateTitlePaneL();
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::DoUpdateTitlePaneL
+// ---------------------------------------------------------
+//
+void CPhoneStatusPane::DoUpdateTitlePaneL()
+    {
+    if ( iTitlePaneTextIsDisplayed )
+        {
+        iTitlePane->SetTextL( iTitleText );
+        }
+    else
+        {
+        // Title pane takes ownership of the picture
+        RenderBitmapOnTitlePaneL();
+        }
+   }
+
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::RenderBitmapOnTitlePaneL
+// ---------------------------------------------------------
+//
+void CPhoneStatusPane::RenderBitmapOnTitlePaneL()
+    {
+    if( !iTitlePanePicture )
+        {
+        return;
+        }
+
+    TSize size;
+
+    TRect titlePaneRect;
+    AknLayoutUtils::LayoutMetricsRect(
+        AknLayoutUtils::ETitlePane, titlePaneRect );
+
+    TAknLayoutRect oplogoLayout;
+
+    // stacon
+    oplogoLayout.LayoutRect( titlePaneRect,
+        AknLayoutScalable_Avkon::title_pane_stacon_g2(0).LayoutLine() );
+
+    size = oplogoLayout.Rect().Size();
+
+    // CAknIcon takes ownership of bitmaps.
+    CFbsBitmap* dupMain = new ( ELeave ) CFbsBitmap;
+    CleanupStack::PushL( dupMain );
+    User::LeaveIfError(
+        dupMain->Duplicate( iTitlePanePicture->Handle() ) );
+
+    CFbsBitmap* dupMask = NULL;
+    if ( iTitlePanePictureMask )
+        {
+        dupMask = new ( ELeave ) CFbsBitmap;
+        CleanupStack::PushL( dupMask );
+        User::LeaveIfError(
+            dupMask->Duplicate( iTitlePanePictureMask->Handle() ) );
+        }
+
+    //bitmapIcon is not pushed to cleanupstack, ownership
+    //is transferred later
+    CAknIcon* bitmapIcon = CAknIcon::NewL();
+    bitmapIcon->SetMask( dupMask ); // ownership transferred
+    if ( iTitlePanePictureMask )
+        {
+        CleanupStack::Pop( dupMask );
+        }
+
+    bitmapIcon->SetBitmap( dupMain ); // ownership transferred
+    CleanupStack::Pop( dupMain );
+
+    //ownership of bitmapIcon is transferred
+    CAknIcon* scalableIcon = AknIconUtils::CreateIconL( bitmapIcon );
+    CleanupStack::PushL( scalableIcon );
+
+    AknIconUtils::SetSize( scalableIcon->Bitmap(), size,
+                           EAspectRatioPreservedAndUnusedSpaceRemoved );
+    AknIconUtils::SetSize( scalableIcon->Mask(), size,
+                           EAspectRatioPreservedAndUnusedSpaceRemoved );
+
+    // Title pane takes ownership of icons.
+    CFbsBitmap* bitmap = new ( ELeave ) CFbsBitmap;
+    CleanupStack::PushL( bitmap );
+    User::LeaveIfError( bitmap->Duplicate( scalableIcon->Bitmap()->Handle() ) );
+
+    // Check if icon has mask
+    CFbsBitmap* bitmapMask = NULL;
+    if ( scalableIcon->Mask() )
+        {
+        bitmapMask = new ( ELeave ) CFbsBitmap;
+        CleanupStack::PushL( bitmapMask );
+        User::LeaveIfError(
+            bitmapMask->Duplicate( scalableIcon->Mask()->Handle() ) );
+        }
+
+    // Set the icon in title pane...
+    iTitlePane->SetPicture( bitmap, bitmapMask );
+
+    if ( bitmapMask )
+        {
+        CleanupStack::Pop( bitmapMask );
+        }
+    CleanupStack::Pop( bitmap );
+    CleanupStack::PopAndDestroy( scalableIcon );
+    }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::SetTitlePaneContentL
+// ---------------------------------------------------------
+//
+void CPhoneStatusPane::SetTitlePaneContentL( const TDesC& aContent )
+    {
+    iTitleText = aContent;
+    iTitlePane->SetTextL( iTitleText );
+    iTitlePaneTextIsDisplayed = ETrue;
+   }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::SetTitlePanePicture
+// ---------------------------------------------------------
+//
+void CPhoneStatusPane::SetTitlePanePictureL( 
+    TPhoneCommandParam* aCommandParam )
+    {
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBitmap )
+        {
+        TPhoneCmdParamBitmap* bitmapParam = static_cast<TPhoneCmdParamBitmap*>(
+            aCommandParam );
+        
+        delete iTitlePanePicture;
+        iTitlePanePicture = NULL;
+        iTitlePanePicture = bitmapParam->Bitmap();
+        
+        delete iTitlePanePictureMask;
+        iTitlePanePictureMask = NULL;
+        iTitlePanePictureMask = bitmapParam->MaskBitmap();
+        
+        RenderBitmapOnTitlePaneL();
+        iTitlePaneTextIsDisplayed = EFalse;
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::IsVisible
+// ---------------------------------------------------------
+//
+TBool CPhoneStatusPane::IsVisible() const
+    {
+    return iStatusPane->IsVisible();
+    }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::TitlePane
+// ---------------------------------------------------------
+//
+CAknTitlePane& CPhoneStatusPane::TitlePane() const
+    {
+    return *iTitlePane;
+    }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::StatusPane
+// ---------------------------------------------------------
+//
+CEikStatusPane& CPhoneStatusPane::StatusPane() const
+    {
+    return *iStatusPane;
+    }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::NaviPane
+// ---------------------------------------------------------
+//
+CAknNavigationControlContainer& CPhoneStatusPane::NaviPane() const
+    {
+    return *iNaviPane;
+    }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::NaviDecorator
+// ---------------------------------------------------------
+//
+CAknNavigationDecorator& CPhoneStatusPane::NaviDecorator() const
+    {
+    return *iNaviDecorator;
+    }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::AddTitlePaneHandlerL
+// ---------------------------------------------------------
+//
+void CPhoneStatusPane::AddTitlePaneHandlerL( 
+    MPhoneStatusPaneObserver& aObserver )
+    {
+    THandlerTag titleTag;
+    titleTag.iObserver = &aObserver;
+    titleTag.iLayer = -1; //-1 means it's not reserved
+    iTitlePaneList->AppendL( titleTag );
+    }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::ReserveTitlePane
+// ---------------------------------------------------------
+//
+void CPhoneStatusPane::ReserveTitlePane( 
+    MPhoneStatusPaneObserver& aObserver )
+    {
+    //notify the inactive of the topmost handler
+    THandlerTag* topmostHandler = FindTopmostTitlePaneHandler();
+    if ( topmostHandler && 
+        topmostHandler->iObserver != &aObserver )
+        {
+        NotifyHandlerOnActivation( *topmostHandler, EFalse );
+        }
+
+    THandlerTag* titleTag = FindTitlePaneHandler( aObserver );
+    if ( titleTag )
+        {
+        if ( topmostHandler )
+            {
+            titleTag->iLayer = topmostHandler->iLayer+1;
+            }
+        else
+            {
+            titleTag->iLayer = 0; // 0 is the lowest one
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::ReleaseTitlePane
+// ---------------------------------------------------------
+//
+void CPhoneStatusPane::ReleaseTitlePane( 
+    MPhoneStatusPaneObserver& aObserver )
+    {
+    THandlerTag* titleTag = FindTitlePaneHandler( aObserver );
+    if ( titleTag )
+        {
+        titleTag->iLayer = -1; //put it to the unreserved status
+        THandlerTag* topmostHandler = FindTopmostTitlePaneHandler();
+        if ( topmostHandler )
+            {
+            NotifyHandlerOnActivation( *topmostHandler, ETrue );
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::RemoveTitlePaneHandler
+// ---------------------------------------------------------
+//
+void CPhoneStatusPane::RemoveTitlePaneHandler( 
+    MPhoneStatusPaneObserver& aObserver )
+    {
+    TInt count = iTitlePaneList->Count();
+    for ( TInt i = 0; i<count; i++ ) 
+        {
+        THandlerTag& handler = iTitlePaneList->At( i );
+        if ( &aObserver == handler.iObserver )
+            {
+            iTitlePaneList->Delete( i );
+            break;
+            }
+        }
+    THandlerTag* topmostHandler = FindTopmostTitlePaneHandler();
+    if ( topmostHandler )
+        {
+        NotifyHandlerOnActivation( *topmostHandler, ETrue );
+        }
+    return;
+    }
+
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::IsTitlePaneVisible
+// ---------------------------------------------------------
+//
+TBool CPhoneStatusPane::IsTitlePaneVisible( 
+    MPhoneStatusPaneObserver& aObserver ) const
+    {
+    THandlerTag* titleTag = FindTitlePaneHandler( aObserver );
+    if ( titleTag )
+        {
+        return ( titleTag->iLayer != -1 ) && 
+            ( titleTag->iLayer == LargestLayerInTitlePaneList() );
+        }
+    return EFalse;
+    }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::CreateTextTitlePaneLC
+// ---------------------------------------------------------
+//
+CBase* CPhoneStatusPane::CreateTextTitlePaneLC( 
+    TInt aTextResourceId )
+    {
+    return CPhoneTextTitlePane::NewLC( *this, aTextResourceId );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneStatusPane::GetShape
+// -----------------------------------------------------------------------------
+//
+void CPhoneStatusPane::GetShape( TRegion& aRegion )
+    {
+    TRAPD( err, iStatusPane->GetShapeL( aRegion, ETrue, ETrue ) );
+    if ( err != KErrNone )
+        {
+        aRegion.Clear();
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::LargestLayerInTitlePaneList
+// ---------------------------------------------------------
+//
+TInt CPhoneStatusPane::LargestLayerInTitlePaneList() const
+    {
+    THandlerTag* topmostHandler = FindTopmostTitlePaneHandler();
+    if ( topmostHandler )
+        {
+        return topmostHandler->iLayer;
+        }
+    return -1; //-1 means no item in the list yet
+    }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::FindTopmostTitlePaneHandler
+// ---------------------------------------------------------
+//
+THandlerTag* CPhoneStatusPane::FindTopmostTitlePaneHandler() const
+    {
+    TInt largest = -1;
+    THandlerTag* handler = NULL;
+    TInt count = iTitlePaneList->Count();
+    for ( TInt i = 0; i<count; i++ )
+        {
+        THandlerTag& currentHandler = iTitlePaneList->At( i );
+        if ( largest < currentHandler.iLayer )
+            {
+            largest = currentHandler.iLayer;
+            handler = &currentHandler;
+            }
+        }
+    return handler;
+    }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::FindTitlePaneHandler
+// ---------------------------------------------------------
+//
+THandlerTag* CPhoneStatusPane::FindTitlePaneHandler( 
+    MPhoneStatusPaneObserver& aObserver ) const
+    {
+    TInt count = iTitlePaneList->Count();
+    for ( TInt i = 0; i<count; i++ ) 
+        {
+        THandlerTag* handler = &iTitlePaneList->At( i );
+        if ( &aObserver == handler->iObserver )
+            {
+            return handler;
+            }
+        }
+    return NULL;
+    }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::NotifyHandlerOnActivation
+// ---------------------------------------------------------
+//
+void CPhoneStatusPane::NotifyHandlerOnActivation( 
+    THandlerTag& aHandlerTag,
+    TBool aActive )
+    {
+    TRAP_IGNORE( aHandlerTag.iObserver->HandleTitlePaneActiveL( aActive ) );
+    }
+
+// ---------------------------------------------------------
+// CPhoneStatusPane::CreateEmptyIndicatorContainerL
+// ---------------------------------------------------------
+//
+CAknIndicatorContainer* CPhoneStatusPane::CreateEmptyIndicatorContainerL()
+    {
+    CCoeControl* container = StatusPane().
+    ContainerControlL( TUid::Uid( EEikStatusPaneUidIndic ) );
+    
+    CAknIndicatorContainer* indicatorContainer =
+         new (ELeave) CAknIndicatorContainer(
+             CAknIndicatorContainer::ENaviPaneEditorIndicators );
+ 
+     CleanupStack::PushL( indicatorContainer );
+     
+     indicatorContainer->SetContainerWindowL( *container );
+ 
+     TResourceReader reader;
+     CCoeEnv::Static()->CreateResourceReaderLC( reader,
+             R_PHONEUI_EMPTY_INDICATORS ); 
+     indicatorContainer->ConstructFromResourceL( reader );
+ 
+     CleanupStack::PopAndDestroy();  // resource reader
+     
+     TRect controlRect = StatusPane().PaneRectL( TUid::Uid( EEikStatusPaneUidIndic ) );
+     indicatorContainer->SetRect( TRect( controlRect.Size() ) );
+     indicatorContainer->ActivateL();
+ 
+     CleanupStack::Pop( indicatorContainer ); // indicatorContainer
+ 
+     return indicatorContainer;
+     }
+
+//
+// IMPLEMENTATION OF CPHONETEXTTITLEPANE 
+//
+// ---------------------------------------------------------
+// CPhoneTextTitlePane::NewLC
+// ---------------------------------------------------------
+//
+CPhoneTextTitlePane* CPhoneTextTitlePane::NewLC( 
+    CPhoneStatusPane& aStatusPaneManager,
+    TInt aTextResourceId )
+    {
+    CPhoneTextTitlePane* self = 
+        new (ELeave) CPhoneTextTitlePane(
+            aStatusPaneManager,
+            aTextResourceId );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+
+    return self;
+    }
+
+// Destructor      
+CPhoneTextTitlePane::~CPhoneTextTitlePane()
+    {
+    iStatusPaneManager.ReleaseTitlePane( *this );
+    iStatusPaneManager.RemoveTitlePaneHandler( *this );
+    }
+
+// ---------------------------------------------------------
+// CPhoneTextTitlePane::HandleTitlePaneActiveL
+// ---------------------------------------------------------
+//
+void CPhoneTextTitlePane::HandleTitlePaneActiveL( 
+    TBool /*aActive*/ )
+    {
+    if ( iStatusPaneManager.IsTitlePaneVisible( *this ) )
+        {
+        HBufC* text = StringLoader::LoadL( iTextResourceId );
+        iStatusPaneManager.TitlePane().SetText( text );
+        }
+    }
+        
+// -----------------------------------------------------------------------------
+// CPhoneTextTitlePane::CPhoneTextTitlePane
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneTextTitlePane::CPhoneTextTitlePane(
+    CPhoneStatusPane& aStatusPaneManager,
+    TInt aTextResourceId ) :
+    iStatusPaneManager( aStatusPaneManager ),
+    iTextResourceId( aTextResourceId )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneTextTitlePane::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneTextTitlePane::ConstructL()
+    {
+    iStatusPaneManager.AddTitlePaneHandlerL( *this );
+    iStatusPaneManager.ReserveTitlePane( *this );
+
+    HandleTitlePaneActiveL( ETrue );
+    }  
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonetextquery.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,182 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 CPhoneTextQuery class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cphonetextquery.h"
+#include "phoneui.hrh"
+#include "phonelogger.h"
+#include "phoneconstants.h"
+
+// ================= MEMBER FUNCTIONS =======================
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneTextQuery::CPhoneTextQuery( 
+    MEikCommandObserver& aCommandObserver, 
+    TDes& aDataText,
+    TInt aDefaultCbaResourceId,
+    TInt aContentCbaResourceId,
+    TBool aSendKeyEnabled,
+    TInt aEikBidOkCmd ) :
+    CAknTextQueryDialog( aDataText, CAknQueryDialog::ENoTone ),
+    iCommandObserver( aCommandObserver ),
+    iDefaultCbaResourceId( aDefaultCbaResourceId ),
+    iContentCbaResourceId( aContentCbaResourceId ),
+    iSendKeyHandlingEnabled( aSendKeyEnabled ),
+    iEikBidOkCmd( aEikBidOkCmd )
+    {
+    }
+
+// ---------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------
+// 
+CPhoneTextQuery::~CPhoneTextQuery()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneTextQuery::OfferKeyEventL
+// ---------------------------------------------------------
+//
+TKeyResponse CPhoneTextQuery::OfferKeyEventL( 
+    const TKeyEvent& aKeyEvent,
+    TEventCode aType )
+    {
+    TKeyResponse response ( EKeyWasConsumed );
+    // Send or Ok key down event
+    if ( aKeyEvent.iScanCode == EStdKeyYes && aType == EEventKeyDown )  
+        {
+        // Send key enabled
+        if ( iSendKeyHandlingEnabled )
+             {    
+             OkToExitL( EPhoneInCallCmdNewCallCall );
+             }
+        }
+    else if ( aType == EEventKey && 
+            ( aKeyEvent.iScanCode == EStdKeyNo || aKeyEvent.iCode == EKeyNo ) )
+		{
+		OkToExitL( EPhoneCmdEnd );
+		}
+    else if ( aKeyEvent.iCode == EKeyEnter && aType == EEventKey )
+        {
+        TInt commandID = FetchCommandFromCba();
+        if ( commandID )
+            {
+            TryExitL( commandID );
+            }
+        } 
+	else
+		{
+        UpdateSoftkeysL();		
+	    response = CAknTextQueryDialog::OfferKeyEventL( aKeyEvent, aType );		
+		}
+    return response;
+    }
+
+// ---------------------------------------------------------
+// CPhoneTextQuery::OkToExitL
+// ---------------------------------------------------------
+//
+TBool CPhoneTextQuery::OkToExitL( TInt aCommand )
+    {
+    // Let the command observer process the command
+    if ( aCommand == EEikBidOk )
+        {
+        iCommandObserver.ProcessCommandL( iEikBidOkCmd );
+        }
+    else
+        {
+        iCommandObserver.ProcessCommandL( aCommand );
+        }        
+
+    return ETrue;
+    }
+
+// ---------------------------------------------------------
+// CPhoneTextQuery::PostLayoutDynInitL
+// ---------------------------------------------------------
+//
+void CPhoneTextQuery::PostLayoutDynInitL()
+    {
+    CAknQueryControl* control =
+        static_cast< CAknQueryControl* >( Control( EGeneralQuery ) );    
+    
+    control->SetTextEntryLength( KPhoneNumberEntryBufferSize );
+    CAknTextQueryDialog::PostLayoutDynInitL();
+    UpdateSoftkeysL();
+    }
+
+// ---------------------------------------------------------
+// CPhoneTextQuery::UpdateSoftkeysL
+// ---------------------------------------------------------
+//
+void CPhoneTextQuery::UpdateSoftkeysL()
+    {
+    CAknQueryControl* control =
+        static_cast< CAknQueryControl* >( Control( EGeneralQuery ) );
+        
+    CEikButtonGroupContainer& buttonGroup = ButtonGroupContainer();
+
+    if ( control->GetTextLength() )
+        {
+        // There is text in cba; we can update softkeys to ok - cancel
+        buttonGroup.SetCommandSetL( iContentCbaResourceId );
+        MakeLeftSoftkeyVisible( ETrue );
+        }
+    else 
+        {
+        // There is no text in cba; update softkeys to find - cancel
+        buttonGroup.SetCommandSetL(  iDefaultCbaResourceId );
+        MakeLeftSoftkeyVisible( ETrue );
+        }
+
+    buttonGroup.DrawDeferred();    
+    }
+    
+// ---------------------------------------------------------
+// CPhoneTextQuery::GetContent
+// ---------------------------------------------------------
+//
+void CPhoneTextQuery::GetContent( TDes& aText )
+    {
+    CAknQueryControl* control =
+        static_cast< CAknQueryControl* >( Control( EGeneralQuery ) );
+
+    control->GetText( aText );        
+    }
+
+// ---------------------------------------------------------
+// CPhoneTextQuery::FetchCommandFromCba
+// ---------------------------------------------------------
+//
+TInt CPhoneTextQuery::FetchCommandFromCba()
+    {
+    TInt commandID = 0;
+    CEikCba* cba = NULL;
+    cba = MopGetObject( cba );
+
+    if ( cba )
+        {
+        commandID = cba->CommandId( 0 );
+        }
+    
+    return commandID;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonetoolbarcontroller.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,412 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 the updating of toolbar buttons
+*
+*/
+
+
+#include <eikappui.h>
+#include <eikenv.h>
+#include <eikapp.h>
+#include <eikcolib.h>
+#include <gulicon.h>
+#include <akntoolbar.h>
+#include <aknbutton.h>
+#include <StringLoader.h>
+#include <phoneui.rsg>
+#include <pevirtualengine.h>
+#include <data_caging_path_literals.hrh>
+#include <phoneappcommands.hrh>
+#include <phoneui.mbg>
+
+#include "cphonetoolbarcontroller.h"
+#include "PhoneUI.hrh"
+#include "PhoneRssBase.h"
+#include "TPhoneCmdParamInteger.h"
+#include "TPhoneCmdParamBoolean.h"
+#include "PhoneLogger.h"
+
+
+_LIT ( KPhoneMifFileName, "phoneui.mif" );
+_LIT( KToolbarButtonEmptyStr, "" );
+
+const TInt KNumberOfButtons = 5;
+struct SPhoneToolbarButton
+    {
+    TInt iIconIndex;
+    TInt iMaskIndex;
+    TInt iCommandId;
+    };
+
+const SPhoneToolbarButton bArray[KNumberOfButtons] =
+        { 
+            {  EMbmPhoneuiQgn_indi_dialer_contacts,
+               EMbmPhoneuiQgn_indi_dialer_contacts_mask,
+               EPhoneInCallCmdActivatEPhonebook
+            },
+            {  EMbmPhoneuiQgn_indi_tb_microphone_mute,
+	           EMbmPhoneuiQgn_indi_tb_microphone_mute_mask,
+	           EPhoneInCallCmdMute
+	        }, 
+	        {  EMbmPhoneuiQgn_indi_tb_microphone_unmute,
+	           EMbmPhoneuiQgn_indi_tb_microphone_unmute_mask,
+	           EPhoneInCallCmdUnmute
+	        },
+	        {  EMbmPhoneuiQgn_indi_tb_ihf_on,
+	           EMbmPhoneuiQgn_indi_tb_ihf_on_mask,
+	           EPhoneInCallCmdActivateIhf
+	        },
+	        {  EMbmPhoneuiQgn_indi_tb_handset,
+	           EMbmPhoneuiQgn_indi_tb_handset_mask,
+	           EPhoneInCallCmdHandset
+	        }
+        }; 
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhoneToolbarController::CPhoneToolbarController( CCoeEnv& aCoeEnv ):
+    iCoeEnv ( aCoeEnv )   
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhoneToolbarController::ConstructL()
+    {
+    if ( !iToolbar )
+        {
+        iToolbar = CAknToolbar::NewL( R_PHONEUI_TOOLBAR );
+        }
+  
+    CEikAppUiFactory* appUiFactory =
+        static_cast<CEikAppUiFactory*>( CEikonEnv::Static()->AppUiFactory() );  
+    appUiFactory->SetViewFixedToolbar( iToolbar );
+    
+    if( iToolbar )
+        {
+        iToolbar->SetToolbarObserver( 
+                        static_cast<MAknToolbarObserver*>( this ));  
+        iToolbar->SetWithSliding( EFalse );
+        iToolbar->SetCloseOnAllCommands( EFalse );
+        iToolbar->SetFocusing( EFalse );
+        
+        CAknButton* button( NULL );
+
+        for( TInt i = 0; i < KNumberOfButtons; i++ )
+            {
+            TAknsItemID skinId = GetSkinIdL( bArray[i].iCommandId );
+            // Load tooltip text.
+            HBufC* tooltipText;
+            GetTooltipTextL ( bArray[i].iCommandId, tooltipText );  
+            CleanupStack::PushL( tooltipText );      
+         
+            button = CreateButtonLC(
+                bArray[i].iIconIndex, 
+                bArray[i].iMaskIndex, 
+                *tooltipText, 
+                skinId,
+                bArray[i].iCommandId );
+            // Takes ownership of the button                    
+            iToolbar->AddItemL( button, EAknCtButton, bArray[i].iCommandId,0 );
+           
+            CleanupStack::Pop( button );
+            CleanupStack::PopAndDestroy( tooltipText );
+            }
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// CreateButtonL
+// ---------------------------------------------------------------------------
+//
+CAknButton* CPhoneToolbarController::CreateButtonLC( 
+    TInt aNormalIconId,
+    TInt aNormalMaskId,
+    const TDesC& aTooltipText,
+    const TAknsItemID& aSkinIconId,
+    TInt /*aCommand*/ )
+    {
+    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
+        KToolbarButtonEmptyStr(),
+        aTooltipText, // help
+        0, // flags
+        0, // state flags
+        aSkinIconId );
+                                     
+    button->SetFocusing( EFalse );
+    button->SetBackground( iToolbar );
+
+    return button;
+    }
+    
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhoneToolbarController* CPhoneToolbarController::NewL( CCoeEnv& aCoeEnv )
+    {
+    CPhoneToolbarController* self =  new (ELeave) CPhoneToolbarController( aCoeEnv);
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhoneToolbarController::~CPhoneToolbarController()
+    {
+    delete iToolbar;
+    }
+
+// ---------------------------------------------------------------------------
+// UpdateToolbar
+// ---------------------------------------------------------------------------
+//
+void CPhoneToolbarController::UpdateToolbar()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneToolbarController::UpdateToolbar()" );
+    // Show 'Mute'/'Unmute' icon
+    iToolbar->HideItem( EPhoneInCallCmdMute, iMuteFlag, EFalse );
+    iToolbar->HideItem( EPhoneInCallCmdUnmute, !iMuteFlag, ETrue );   
+
+    // Show 'Handset'/'Ihf' icon
+    iToolbar->HideItem( EPhoneInCallCmdActivateIhf, iIhfFlag, EFalse );
+    iToolbar->HideItem( EPhoneInCallCmdHandset, !iIhfFlag, ETrue );
+    }   
+
+// ---------------------------------------------------------------------------
+// OfferToolbarEventL
+// ---------------------------------------------------------------------------
+//
+void CPhoneToolbarController::OfferToolbarEventL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneToolbarController::OfferToolbarEventL()" );
+    // Forward pressed toolbar button to the framework 
+    // so that we can handle it in active state            
+    static_cast<MEikCommandObserver*>( CEikonEnv::Static()->EikAppUi() )
+       ->ProcessCommandL( aCommand );            
+    } 
+   
+// ---------------------------------------------------------------------------
+// DynInitToolbarL
+// ---------------------------------------------------------------------------
+//
+void CPhoneToolbarController::DynInitToolbarL( TInt aResourceId, 
+                                              CAknToolbar* /*aToolbar*/ )
+    { 
+    if ( aResourceId == R_PHONEUI_TOOLBAR )
+        {
+        UpdateToolbar();
+        }     
+    }
+
+// ---------------------------------------------------------------------------
+// GetTooltipText
+//
+// Tooltip texts for toolbar buttons
+// ---------------------------------------------------------------------------
+//
+void  CPhoneToolbarController::GetTooltipTextL( TInt aCommandId, HBufC*& aText ) 
+    {
+    TInt resourceId = 0;
+    switch( aCommandId )
+        {                     
+        case EPhoneInCallCmdActivatEPhonebook:
+            resourceId = R_PHONEUI_TOOLTIP_CONTACTS;
+            break; 
+            
+        case EPhoneInCallCmdMute:
+            resourceId = R_PHONEUI_TOOLTIP_MUTE;
+            break;
+            
+        case EPhoneInCallCmdActivateIhf:
+            resourceId = R_PHONEUI_TOOLTIP_LOUDSPEAKER;
+            break;
+            
+        case EPhoneInCallCmdUnmute:
+            resourceId = R_PHONEUI_TOOLTIP_UNMUTE;
+            break;
+            
+        case EPhoneInCallCmdHandset:
+            resourceId = R_PHONEUI_TOOLTIP_HANDSET;
+            break;
+            
+        default:
+            aText = KNullDesC().Alloc();
+            break;
+        }
+        
+    if( resourceId )
+        {
+        aText = StringLoader::LoadL( resourceId, &iCoeEnv );
+        }
+        
+    }
+
+// ---------------------------------------------------------------------------
+TAknsItemID CPhoneToolbarController::GetSkinIdL( TInt aCommandId ) 
+    {
+    TAknsItemID skinId = KAknsIIDNone;
+    switch( aCommandId )
+        {                       
+        case EPhoneInCallCmdActivatEPhonebook:
+            skinId = KAknsIIDQgnIndiDialerContacts;
+            break; 
+        case EPhoneInCallCmdMute:
+            skinId = KAknsIIDQgnIndiButtonMuteMic;
+            break;
+        case EPhoneInCallCmdActivateIhf:
+            skinId = KAknsIIDQgnIndiButtonLoudspeaker;
+            break;
+        case EPhoneInCallCmdUnmute:
+            skinId = KAknsIIDQgnIndiButtonUnmuteMic;
+            break;
+        case EPhoneInCallCmdHandset:
+            skinId = KAknsIIDQgnIndiButtonHandset;
+            break;
+        default:
+            skinId = KAknsIIDNone;
+            break;
+        }
+    return skinId;        
+    }
+// ShowToolbar
+//
+// ---------------------------------------------------------------------------
+//
+void CPhoneToolbarController::ShowToolbar()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneToolbarController::ShowToolbar()" );
+    if ( iToolbar )
+        {
+        if ( iToolbar->IsToolbarDisabled() )
+            {
+            TRAP_IGNORE(iToolbar->DisableToolbarL( EFalse ));
+            }
+        UpdateToolbar();
+        iToolbar->HideItemsAndDrawOnlyBackground( EFalse );
+        iToolbar->SetToolbarVisibility( ETrue, EFalse );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// HideToolbar
+//
+// ---------------------------------------------------------------------------
+//
+void CPhoneToolbarController::HideToolbar()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneToolbarController::HideToolbar()" );
+    if ( iToolbar )
+        {
+        if( iToolbar->IsShown() )
+            {
+            iToolbar->HideItemsAndDrawOnlyBackground( ETrue );
+            }
+        else if ( iToolbar->IsToolbarDisabled() )
+            {
+            TRAP_IGNORE(iToolbar->DisableToolbarL( EFalse ));
+            iToolbar->HideItemsAndDrawOnlyBackground( ETrue );
+            iToolbar->SetToolbarVisibility( ETrue, EFalse );
+            }
+        }        
+    }
+
+// ---------------------------------------------------------
+// CPhoneToolbarController::SetMuteFlag
+// ---------------------------------------------------------
+//
+void CPhoneToolbarController::SetMuteFlag( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneToolbarController::SetMuteFlag()" );
+    // Check is the given parameter valid
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* muteFlag = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+        iMuteFlag = muteFlag->Boolean();
+        UpdateToolbar();
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneToolbarController::SetIhfFlag
+// ---------------------------------------------------------
+//
+void CPhoneToolbarController::SetIhfFlag( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneToolbarController::SetIhfFlag()" );
+    // Check is the given parameter valid
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* ihfFlag = 
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+        iIhfFlag = ihfFlag->Boolean();
+        UpdateToolbar();
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneToolbarController::DimToolbar
+// ---------------------------------------------------------
+//
+void CPhoneToolbarController::DimToolbar( const TBool aDimmed )
+    {
+ //   __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneToolbarController::DimToolbar()" );
+
+    // Dim/Undim all toolbar buttons 
+    iToolbar->SetItemDimmed( EPhoneInCallCmdMute, aDimmed, ETrue );
+    iToolbar->SetItemDimmed( EPhoneInCallCmdUnmute, aDimmed, ETrue );
+    iToolbar->SetItemDimmed( EPhoneInCallCmdActivatEPhonebook, aDimmed, ETrue );
+    iToolbar->SetItemDimmed( EPhoneInCallCmdActivateIhf, aDimmed, ETrue );
+    iToolbar->SetItemDimmed( EPhoneInCallCmdHandset, aDimmed, ETrue );        
+    }
+
+// ---------------------------------------------------------
+// CPhoneToolbarController::SetToolbarButtonDimmed
+// ---------------------------------------------------------
+//
+void CPhoneToolbarController::SetToolbarButtonDimmed( const TInt aCommandId, const TBool aDimmed )
+    {
+ // __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneToolbarController::SetToolbarButtonDimmed()" );
+
+    // Dim toolbar button 
+    iToolbar->SetItemDimmed( aCommandId, aDimmed, ETrue );
+    }
+
+// END
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphoneuidisablednote.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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: Implementation of CPhoneUIDisabledNote class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cphoneuidisablednote.h"
+#include "aknnotedialog.h"
+#include "phoneui.hrh"
+#include <featmgr.h>
+#include <aknnotedialog.h>
+#include <eikdialg.h>
+#include <aknnotecontrol.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneUIDisabledNote::CPhoneUIDisabledNote( CEikDialog** aSelfPtr, MEikCommandObserver& aCommandObserver )
+    : CPhoneNote( aSelfPtr, aCommandObserver ) 
+    {
+    }
+
+// ---------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------
+// 
+CPhoneUIDisabledNote::~CPhoneUIDisabledNote()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIDisabledNote::OfferKeyEventL
+// ---------------------------------------------------------
+//
+TKeyResponse CPhoneUIDisabledNote::OfferKeyEventL( 
+    const TKeyEvent& aKeyEvent,
+    TEventCode /*aType*/ )
+    {
+    // Let key events be handled by the application
+	return EKeyWasNotConsumed;
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIDisabledNote::OkToExitL
+// ---------------------------------------------------------
+//
+TBool CPhoneUIDisabledNote::OkToExitL( TInt aCommand )
+    {
+    // Let the command observer process the command
+    iCommandObserver.ProcessCommandL( aCommand );
+
+    return EFalse; // so that the dialog will not disappear
+    }
+    
+// ---------------------------------------------------------
+// CPhoneUIDisabledNote::SetNoteType
+// ---------------------------------------------------------
+//
+void CPhoneUIDisabledNote::SetNoteType( TPhoneNoteType aNoteType )
+    {
+    iNoteType = aNoteType;
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIDisabledNote::NoteType
+// ---------------------------------------------------------
+//
+TPhoneNoteType CPhoneUIDisabledNote::NoteType()
+    {
+    return iNoteType;
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIDisabledNote::HandlePointerEventL
+// ---------------------------------------------------------
+//
+void CPhoneUIDisabledNote::HandlePointerEventL( 
+    const TPointerEvent& /* aPointerEvent */ )
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIDisabledNote::UpdateSoftkeysL
+// ---------------------------------------------------------
+//
+void CPhoneUIDisabledNote::UpdateSoftkeysL( TInt aResourceId )
+    {
+    CEikButtonGroupContainer& buttonGroup = ButtonGroupContainer();
+    buttonGroup.SetCommandSetL( aResourceId );
+    
+    buttonGroup.DrawDeferred();
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIDisabledNote::SetSizeAndPosition
+// ---------------------------------------------------------
+//
+void CPhoneUIDisabledNote::SetSizeAndPosition( const TSize& aSize )
+    {
+    CAknNoteDialog::SetSizeAndPosition( aSize );
+    
+	// Override the original layout position to prevent note to hide the call bubble
+	// Will be changed when layout is available	
+    TRect clientRect = CEikonEnv::Static()->EikAppUi()->ClientRect();
+    TRect noteRect;
+    TInt leftMargin = (TInt) ( (clientRect.Width() - aSize.iWidth) / 2);    // Set note to center
+
+    noteRect.SetRect( leftMargin,                // iTl.iX
+            clientRect.iBr.iY - aSize.iHeight,   // iTl.iY
+            leftMargin + aSize.iWidth,           // iBr.iX
+            clientRect.iBr.iY );                 // iBr.iY
+    
+    SetRect( noteRect );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonevideoplayer.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,715 @@
+/*
+* 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:  Video ringing tone player
+*
+*/
+
+
+// INCLUDE FILES
+#include "CPhoneVideoPlayer.h"
+
+#include "PhoneUI.pan"
+#include "MPhoneVideoPlayerObserver.h"
+#include "CPhoneRingingTone.h"
+#include "PhoneConstants.h"
+#include "PhoneLogger.h"
+
+#include <eikenv.h>        // CEikEnv 
+#include <coemain.h>       // CCoeEnv 
+#include <VideoPlayer.h>   // CVideoPlayerUtility
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES  
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhoneVideoPlayer::CPhoneVideoPlayer
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneVideoPlayer::CPhoneVideoPlayer(
+    MPhoneVideoPlayerObserver& aObserver )
+    :
+    iObserver( aObserver ),
+    iVideoPlayer( NULL ),
+    iPlayerState( EVideoClosed ),
+    iVolume( 0 )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVideoPlayer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneVideoPlayer::ConstructL( 
+    const TDesC& aFileName, 
+    TInt aPriority, 
+    TUint aPreference,
+    RWindow& aVideoTarget  )
+    {
+    // Screen and clip rectangles to window dimensions
+    TPoint wndPosition( aVideoTarget.AbsPosition() );
+    TSize wndSize( aVideoTarget.Size() );
+    TRect wndRect( wndPosition, wndSize );
+    
+    // Create video player instance
+    iVideoPlayer = CVideoPlayerUtility::NewL(
+        *this,
+        aPriority,
+        static_cast<TMdaPriorityPreference>( aPreference ),
+        CCoeEnv::Static()->WsSession(),
+        *CCoeEnv::Static()->ScreenDevice(),    
+        aVideoTarget,
+        wndRect, 
+        wndRect );
+
+    RFs fs = CEikonEnv::Static()->FsSession();
+    User::LeaveIfError( iFileHandle.Open( fs,
+                                          aFileName,
+                                          EFileShareReadersOnly | 
+                                          EFileStream | 
+                                          EFileRead ) );        
+    
+    iVideoPlayer->OpenFileL( iFileHandle ); // async
+
+    iPlayerState = EVideoOpening;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVideoPlayer::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPhoneVideoPlayer* CPhoneVideoPlayer::NewL(
+    const CPhoneRingingTone& aRingingTone, 
+    TInt aPriority, 
+    TUint aPreference,
+    MPhoneVideoPlayerObserver& aObserver, 
+    RWindow& aVideoTarget,
+    TBool aExtSecNeeded )
+    {
+    // Check the file DRM property if extend secure is needed.
+    if ( aExtSecNeeded )
+        {
+        __PHONELOG( EBasic, EPhoneUIView, "CPhoneVideoPlayer::NewL - check DRM extend security" );
+        if ( !aRingingTone.IsFileInRom() &&
+             !aRingingTone.IsFileDrmProtected() )
+            {
+            __PHONELOG( EBasic, EPhoneUIView, "CPhoneVideoPlayer::NewL - DRM extend security permission denied" );
+            User::Leave( KErrPermissionDenied );
+            }
+        __PHONELOG( EBasic, EPhoneUIView, "CPhoneVideoPlayer::NewL - check DRM extend security - ok" );
+        }
+    
+    CPhoneVideoPlayer* self = new(ELeave) CPhoneVideoPlayer( aObserver );
+        
+    CleanupStack::PushL( self );
+    self->ConstructL( 
+        aRingingTone.FileName(), 
+        aPriority, 
+        aPreference, 
+        aVideoTarget );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVideoPlayer::New
+// Two-phased constructor (non-leaving) 
+// -----------------------------------------------------------------------------
+//
+CPhoneVideoPlayer* CPhoneVideoPlayer::New(
+    const CPhoneRingingTone& aRingingTone,  
+    TInt aPriority, 
+    TUint aPreference,
+    MPhoneVideoPlayerObserver& aObserver, 
+    RWindow& aVideoTarget,
+    TBool aExtSecNeeded )
+    {
+    CPhoneVideoPlayer* self = NULL;
+
+    TRAP_IGNORE( self = CPhoneVideoPlayer::NewL(
+        aRingingTone, 
+        aPriority, 
+        aPreference,
+        aObserver,   
+        aVideoTarget,
+        aExtSecNeeded ) );
+    
+    return self; // this is NULL if NewL leaves
+    }
+
+// Destructor
+CPhoneVideoPlayer::~CPhoneVideoPlayer()
+    {
+    if ( iVolumeRampTimer )
+        {
+        iVolumeRampTimer->Cancel();
+        delete iVolumeRampTimer;
+        }
+
+    if ( iVideoPlayer )
+        {
+        iVideoPlayer->Close();
+        delete iVideoPlayer;
+        }
+
+    iFileHandle.Close();     
+             
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVideoPlayer::Play
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPhoneVideoPlayer::Play( 
+    TRingingType aRingType, 
+    TInt aVolume )
+    {
+    __PHONELOG2( 
+        EBasic, 
+        EPhoneUIView, 
+        "CPhoneVideoPlayer::Play - aRingType(%d), aVolume(%d)",
+        aRingType,
+        aVolume );
+
+    __ASSERT_DEBUG( iVideoPlayer, Panic( EPhoneViewGeneralError ) );
+    
+    iRingingType = aRingType;
+    iVolume = aVolume;
+
+    switch( iPlayerState )
+        {
+        case EVideoOpening:
+        case EVideoPreparing:
+        case EVideoOpen:
+            // see MvpuoPrepareComplete()
+            iToBePlayed = ETrue;   
+            break;
+        
+        case EVideoReady:
+            iVideoPlayer->Play();
+            iPlayerState = EVideoPlaying;
+            break;
+        
+        case EVideoPlaying:
+        case EVideoClosed:
+        case EVideoError:
+        default:
+            // NOP
+            break;
+        }
+
+    return;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVideoPlayer::StopPlaying
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPhoneVideoPlayer::StopPlaying()
+    {
+    __PHONELOG( EBasic, EPhoneUIView, "CPhoneVideoPlayer::StopPlaying" );
+
+    iToBePlayed = EFalse;
+
+    if ( iVolumeRampTimer )
+        {
+        iVolumeRampTimer->Cancel();
+        }
+    
+    if ( iPlayerState == EVideoPlaying )
+        {
+        iVideoPlayer->Stop();
+        iPlayerState = EVideoReady;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVideoPlayer::PausePlaying
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//    
+TInt CPhoneVideoPlayer::PausePlaying()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneVideoPlayer::StopPlaying ");
+    TInt err = KErrNone;
+    
+    if ( iPlayerState == EVideoPlaying )
+        {
+        TRAP( err, iVideoPlayer->PauseL() );
+        if ( err == KErrNone )    
+            {
+            iPlayerState = EVideoPaused;    
+            }
+        }
+    else
+        {
+        err = KErrNotReady;    
+        }        
+        
+    return err;        
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVideoPlayer::ResumePlaying
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//    
+void CPhoneVideoPlayer::ResumePlaying()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneVideoPlayer::ResumePlaying ");
+    
+    if ( iPlayerState == EVideoPaused )
+        {
+        iVideoPlayer->Play(); 
+        iPlayerState = EVideoPlaying;       
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVideoPlayer::MuteAudio
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPhoneVideoPlayer::MuteAudio()
+    {
+    __PHONELOG( EBasic, EPhoneUIView, "CPhoneVideoPlayer::MuteAudio" );
+    
+    if ( iVolumeRampTimer )
+        {
+        iVolumeRampTimer->Cancel();
+        }
+
+    iVolume = 0;
+    SetVolume( 0 );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVideoPlayer::SetVolume
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPhoneVideoPlayer::SetVolume( TInt aVolume )
+    {
+    __PHONELOG1( 
+        EBasic, 
+        EPhoneUIView, 
+        "CPhoneVideoPlayer::SetVolume - aVolume(%d)", 
+        aVolume );
+    
+    TInt maxVolume( iVideoPlayer->MaxVolume() );
+    maxVolume = ( maxVolume > 0 ) ? maxVolume : KPhoneVideoMaxVolumeLevel; 
+
+    TInt scaledVolume = ( aVolume * maxVolume ) / KPhoneVideoMaxVolumeLevel;
+    
+    TRAP_IGNORE( iVideoPlayer->SetVolumeL( scaledVolume ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVideoPlayer::SetRingingType
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPhoneVideoPlayer::SetRingingType( TRingingType aRingingType )
+    {
+    __PHONELOG1( 
+        EBasic, 
+        EPhoneUIView, 
+        "CPhoneVideoPlayer::SetRingingType - aRingingType(%d)",
+        aRingingType );
+    
+    if ( aRingingType == ETypeAscending )
+        {
+        if ( !iVolumeRampTimer )
+            {
+            iVolumeRampTimer = CPeriodic::New( CActive::EPriorityStandard );
+            }
+
+        if ( iVolumeRampTimer && !iVolumeRampTimer->IsActive() )
+            {
+            TCallBack cb( VolumeRampTimerCallback, this );
+
+            SetVolume( KPhoneVideoMinVolumeLevel );
+            iRampedVolume = KPhoneVideoMinVolumeLevel;
+            iVolumeRampTimer->Start( 
+                KPhoneVideoVolumeRampInterval, 
+                KPhoneVideoVolumeRampInterval, 
+                cb );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVideoPlayer::VolumeRampTimerCallback
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneVideoPlayer::VolumeRampTimerCallback( TAny* aObj )
+    {
+    return static_cast<CPhoneVideoPlayer*>( aObj )->DoVolumeRamp();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVideoPlayer::DoVolumeRamp
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneVideoPlayer::DoVolumeRamp()
+    {
+    if ( iRampedVolume < iVolume )
+        {
+        iRampedVolume = iRampedVolume + KPhoneVideoVolumeRampStep;
+        if ( iRampedVolume >= iVolume )
+            {
+            // target volume level reached
+            iRampedVolume = iVolume;
+            iVolumeRampTimer->Cancel();
+            }
+
+        SetVolume( iRampedVolume );
+        }
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVideoPlayer::State
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+CPhoneVideoPlayer::TVideoPlayerState CPhoneVideoPlayer::State() const
+    {
+    return iPlayerState;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVideoPlayer::VideoResolution
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+CPhoneVideoPlayer::TVideoResolution CPhoneVideoPlayer::VideoResolution() const
+    {
+    TSize frameSize( VideoFrameSize() );
+    
+    // SubQCCIF video resolution is 128x96 pixels
+    if ( frameSize.iWidth == KPhoneVideoSubQCCIFWidth && 
+    	frameSize.iHeight == KPhoneVideoSubQCCIFHeight )
+        {
+        return EVideoSubQCIF;
+        }
+
+    return EVideoQCIF;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVideoPlayer::VideoResolution
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//    
+TSize CPhoneVideoPlayer::VideoFrameSize() const
+    {
+    TSize frameSize( 0,0 );
+    
+    TRAPD( err, iVideoPlayer->VideoFrameSizeL( frameSize ) );
+    
+    if ( err != KErrNone )
+        {
+        return TSize(0,0);
+        }
+
+    return frameSize;            
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVideoPlayer::AdjustToWindow
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//    
+void CPhoneVideoPlayer::AdjustToWindow( RWindow& aDisplayWindow,
+	const TRect& aUncropPane )
+    {
+    __ASSERT_DEBUG( iPlayerState == EVideoReady, Panic( EPhoneViewGeneralError ) );
+        
+    // Get video frame dimensions
+    TSize frameSize( VideoFrameSize() );
+    
+    if ( frameSize.iWidth == 0 || frameSize.iHeight == 0  )
+        {
+        return;            
+        }
+    
+    // Uncrop pane dimensions
+    TSize uncropPaneSize( aUncropPane.Size() );
+        
+    // To cover display window:
+    // The video is scaled to match to dimensions of uncrop pane defined
+    // in Call Handling LAF. Video is centered to uncrop pane if exact
+    // match is not possible. 
+    // Assumption is that video can be scaled to 50,150 or 200
+    // percent from its original size (can't be scaled freely). 
+    
+    /////////////////////////////
+    // Calculate scaling factor
+    /////////////////////////////
+    TInt dScaleFactor( KBaseScaleFactor ); // use integer arithmetic 
+    
+    TInt xDelta( uncropPaneSize.iWidth - frameSize.iWidth );
+    TInt yDelta( uncropPaneSize.iHeight - frameSize.iHeight );
+            
+    if ( xDelta == 0 && yDelta == 0 )
+        {
+        // correct size, scaling not needed
+        }
+    else if ( xDelta < 0 && yDelta == 0 )
+        {
+        // wide, but cannot downscale -> just crop
+        }
+    else if ( yDelta < 0 && xDelta == 0 )
+        {
+        // tall, but cannot downscale -> just crop    
+        }    
+    else if ( xDelta > 0 && yDelta > 0 )
+        {            
+        // small, narrow and flat  -> enlarge
+        TInt xProp( ( KBaseScaleFactor * uncropPaneSize.iWidth ) / frameSize.iWidth );
+        TInt yProp( ( KBaseScaleFactor * uncropPaneSize.iHeight ) / frameSize.iHeight );
+        
+        dScaleFactor = xProp > yProp ? xProp : yProp;
+        }
+    else if ( xDelta < 0 && yDelta < 0 ) 
+        {
+        // large, wide and tall -> downscale
+        TInt xProp( ( KBaseScaleFactor * uncropPaneSize.iWidth ) / frameSize.iWidth );
+        TInt yProp( ( KBaseScaleFactor * uncropPaneSize.iHeight ) / frameSize.iHeight );
+        
+        dScaleFactor = xProp > yProp ? xProp : yProp;      
+        }
+    else if ( xDelta > 0 && yDelta <= 0 )
+        {
+        // narrow -> enlarge
+        dScaleFactor = ( KBaseScaleFactor * uncropPaneSize.iWidth ) / frameSize.iWidth;
+        }
+    else if ( yDelta > 0 && xDelta <= 0 )
+        {
+        // flat  -> enlarge
+        dScaleFactor = ( KBaseScaleFactor * uncropPaneSize.iHeight ) / frameSize.iHeight;
+        }
+    else
+        {
+        // do nothing
+        }
+    
+    // Convert to float: 0.5, 1.5, 2.0 ..
+    TInt scaleFactor( dScaleFactor / KBaseScaleFactor );
+    TInt remainder( dScaleFactor % KBaseScaleFactor );
+    TReal32 fScaleFactor = (TReal) scaleFactor ;
+    
+    if ( scaleFactor > 0 ) // upscale
+        {
+        if ( remainder > KHalfBaseScale )
+            {
+            fScaleFactor = fScaleFactor + KFullScaleFactor;    
+            }
+        else if ( remainder > 0 )
+            {
+            fScaleFactor = fScaleFactor + KHalfScaleFactor;    
+            }
+        else // 0
+            {
+            }
+        }
+    else // downscale
+        {
+        if ( remainder > KHalfBaseScale )
+            {
+            fScaleFactor = KFullScaleFactor;    
+            }
+        else
+            {
+            fScaleFactor = KHalfScaleFactor;    
+            }
+        }
+    
+    ////////////////////////////////////////////////
+    // Calculate scaled frame size (virtual canvas)
+    ////////////////////////////////////////////////
+    TReal32 canvasWidth = fScaleFactor * (TReal32)frameSize.iWidth;
+    TReal32 canvasHeight = fScaleFactor * (TReal32)frameSize.iHeight;
+    TSize canvasSize( (TInt)canvasWidth, (TInt)canvasHeight );
+    
+    ////////////////////////////////////////////////
+    // Crop by centering displayRect to canvasRect
+    ////////////////////////////////////////////////
+    TRect canvasRect( aUncropPane.iTl, canvasSize );     
+    TInt offsetX = (uncropPaneSize.iWidth - canvasSize.iWidth) / KCentering;
+    TInt offsetY = (uncropPaneSize.iHeight - canvasSize.iHeight) / KCentering;
+    canvasRect.Move( offsetX, offsetY );
+    
+    // Video is autoscaled by video player
+    // iVideoPlayer->SetScaleFactorL(...);
+    
+    TRect clipRect( aDisplayWindow.AbsPosition(), aDisplayWindow.Size() );
+    
+    ////////////////////////////////////////////////
+    // Update settings to player
+    ////////////////////////////////////////////////
+    TRAP_IGNORE( 
+        iVideoPlayer->SetDisplayWindowL( 
+            CCoeEnv::Static()->WsSession(),
+            *CCoeEnv::Static()->ScreenDevice(),
+            aDisplayWindow,
+            canvasRect,
+           clipRect ) );
+               
+    }
+
+
+// =========================================================
+// Callbacks from VideoPlayerutility
+// =========================================================
+
+// ---------------------------------------------------------
+// see MVideoPlayerUtilityObserver::MvpuoOpenComplete
+// ---------------------------------------------------------
+void CPhoneVideoPlayer::MvpuoOpenComplete( TInt aError )
+    {
+    __PHONELOG1( 
+        EBasic, 
+        EPhoneUIView, 
+        "CPhoneVideoPlayer::MvpuoOpenComplete - aError(%d)", 
+        aError );
+
+    if ( aError == KErrNone )
+        {
+        // Prepare clip for playing
+        iPlayerState = EVideoPreparing;
+        iVideoPlayer->Prepare();
+        }
+    else // Report error
+        {
+        iPlayerState = EVideoError;
+        iObserver.HandleVideoPlayerError( 
+            MPhoneVideoPlayerObserver::EVideoPlayerInitializingFailure,
+            aError );
+        }
+    }
+
+// ---------------------------------------------------------
+// see MVideoPlayerUtilityObserver::MvpuoPrepareComplete
+// ---------------------------------------------------------
+void CPhoneVideoPlayer::MvpuoPrepareComplete( TInt aError )
+    {
+    __PHONELOG1( 
+        EBasic, 
+        EPhoneUIView, 
+        "CPhoneVideoPlayer::MvpuoPrepareComplete - aError(%d)", 
+        aError );
+
+    if ( aError == KErrNone )
+        {
+        iPlayerState = EVideoReady;
+        iObserver.HandleVideoPlayerInitComplete();
+
+        SetVolume( iVolume );
+        SetRingingType( iRingingType );
+
+        if ( iToBePlayed )
+            {
+            iVideoPlayer->Play();
+            }
+        }
+    else  // Report error
+        {
+        iPlayerState = EVideoError;
+        iObserver.HandleVideoPlayerError( 
+            MPhoneVideoPlayerObserver::EVideoPlayerInitializingFailure,
+            aError );
+        }
+    }
+
+// ---------------------------------------------------------
+// see MVideoPlayerUtilityObserver::MvpuoFrameReady
+// ---------------------------------------------------------
+void CPhoneVideoPlayer::MvpuoFrameReady( CFbsBitmap& /*aFrame*/,
+                                         TInt /*aError*/ )
+    {
+    // NOP
+    }
+
+// ---------------------------------------------------------
+// see MVideoPlayerUtilityObserver::MvpuoPlayComplete
+// Trapping callback as leaving not allowed.
+// ---------------------------------------------------------
+void CPhoneVideoPlayer::MvpuoPlayComplete( TInt aError )
+    {
+    __PHONELOG1( 
+        EBasic, 
+        EPhoneUIView, 
+        "CPhoneVideoPlayer::MvpuoPlayComplete - aError(%d)", 
+        aError );
+
+    if ( aError == KErrNone )
+        {
+        iPlayerState = EVideoReady;
+        
+        if ( iRingingType == ETypeRingingOnce )
+            {
+            iObserver.HandleVideoPlayerPlayingComplete();
+            } 
+        else // continue playing
+            {
+            iVideoPlayer->Play();
+            iPlayerState = EVideoPlaying;
+            }        
+        }
+    else // report error
+        {
+        iPlayerState = EVideoError;
+        iObserver.HandleVideoPlayerError( 
+            MPhoneVideoPlayerObserver::EVideoPlayerPlayingFailure,
+            aError );
+        }
+    }
+        
+// ---------------------------------------------------------
+// see MVideoPlayerUtilityObserver::MvpuoEvent
+// Trapping callback as leaving not allowed.
+// ---------------------------------------------------------
+void CPhoneVideoPlayer::MvpuoEvent( const TMMFEvent& /*aEvent*/ )
+    {
+    // NOP
+    }
+    
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphoneview.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,595 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  The application view of PhoneUI
+*
+*/
+
+
+// INCLUDE FILES
+#include "phoneconstants.h"
+#include "cphoneview.h"
+
+#include <eikenv.h>
+#include <eikapp.h> 
+#include <eikappui.h>
+#include <eikcmobs.h>
+
+#include <w32std.h>          // iWindowSrvSession
+
+#include <eikimage.h>
+#include <coemain.h>
+#include <gulutil.h>         // DrawUtils, egul.lib 
+#include <aknappui.h>
+#include <AknsLayeredBackgroundControlContext.h>
+#include <AknsDrawUtils.h>
+#include <AknsUtils.h>
+
+#include "cphonestatuspane.h"
+#include "tphonecmdparambitmap.h"
+#include "phonelogger.h"
+#include "mphoneviewobserver.h" 
+
+#include <AknUtils.h> // needed for AKN_LAF_COLOR in 3.0 environment
+
+#include "phoneui.hrh"
+#include "phoneviewcommanddefinitions.h"
+// Scalable UI
+#include <aknlayout.cdl.h>
+#include <layoutmetadata.cdl.h>
+#include <aknlayoutscalable_apps.cdl.h>
+#include <aknlayoutscalable_avkon.cdl.h>
+#include <aknstatuspaneutils.h>
+
+enum TPhoneBgLayers
+    {
+    EPhoneBgFirstLayer          = 0,
+    EPhoneBgLayersN             = 1
+    };
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPhoneView::CPhoneView
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneView::CPhoneView( CEikButtonGroupContainer& aCba ) :
+    iSecurityMode ( EFalse ),
+    iActivatePreviousApp( EFalse ),
+    iPhoneAppViewToDialer( EFalse ),
+    iCba ( aCba ),
+    iDialerActivation( EFalse )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneView::ConstructL( TRect aRect )
+    {
+    // Create background control context for skins.
+    iBgContext = CAknsLayeredBackgroundControlContext::NewL(
+        KAknsIIDWallpaper, aRect, ETrue /*Parent absolute*/,
+        EPhoneBgLayersN );
+
+    // Create bitmap
+    iBitmap = new (ELeave) CFbsBitmap;
+    iBitmap->Reset();
+
+    CreateWindowL();
+    DrawableWindow()->SetPointerGrab( ETrue );
+
+    SetRect( aRect );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPhoneView* CPhoneView::NewL( TRect aRect, CEikButtonGroupContainer& aCba )
+    {
+    CPhoneView* self = new ( ELeave ) CPhoneView( aCba );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL( aRect );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// Destructor
+CPhoneView::~CPhoneView()
+    {
+     __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneView::~CPhoneView");
+    delete iBgContext;
+    delete iBitmap;
+    iRegion.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::ViewId
+// -----------------------------------------------------------------------------
+//
+TVwsViewId CPhoneView::ViewId() const
+    {
+    TVwsViewId id( 
+        iEikonEnv->EikAppUi()->Application()->AppDllUid(), 
+        KUidViewId );
+    return id;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::ViewActivatedL
+// -----------------------------------------------------------------------------
+//
+void CPhoneView::ViewActivatedL( 
+    const TVwsViewId& /*aPrevViewId*/, 
+    TUid aCustomMessageId, 
+    const TDesC8& /*aCustomMessage*/ )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneView::ViewActivatedL()");
+    switch ( aCustomMessageId.iUid )
+        {
+        case KTouchDiallerViewCommand:
+            {
+            if ( iDialerActivation )
+                {
+                if ( iSecurityMode )
+                    {
+                    static_cast<MEikCommandObserver*>( iEikonEnv->EikAppUi() )
+                    ->ProcessCommandL( EPhoneNumberAcqSecurityDialer );
+                    return;
+                    }
+                 else
+                    {
+                    iEikonEnv->WsSession().ClearAllRedrawStores();
+                    SetActivatePreviousApp( ETrue );            
+                    static_cast<MEikCommandObserver*>( iEikonEnv->EikAppUi() )
+                    ->ProcessCommandL( EPhoneViewOpenNumberEntry );
+                    } 
+                }
+            }
+            break;
+        case KTouchCallHandlingVievCommand:
+            {
+            iEikonEnv->WsSession().ClearAllRedrawStores();
+            SetActivatePreviousApp( EFalse );
+            static_cast<MEikCommandObserver*>( iEikonEnv->EikAppUi() )
+                ->ProcessCommandL( EPhoneViewOpenCallHandling );  
+            }
+            break;
+        default:
+            break;
+        }
+    
+    if ( iObserver )
+        {  
+        iObserver->PhoneViewActivatedL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::ViewDeactivated
+// -----------------------------------------------------------------------------
+//
+void CPhoneView::ViewDeactivated()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneView::ViewDeactivated()");
+    SetActivatePreviousApp( EFalse );
+  
+    DrawDeferred();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::SetControl
+// 
+// Change the control. 
+// -----------------------------------------------------------------------------
+//
+void CPhoneView::SetControl( CCoeControl* aControl )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneView::SetControl()");
+    iControl = aControl;
+    UpdateControlRect();
+    iControl->MakeVisible( ETrue );
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneView::Control
+// -----------------------------------------------------------------------------
+//
+CCoeControl* CPhoneView::Control() const
+    {
+    return iControl;    
+    }    
+   
+// -----------------------------------------------------------------------------
+// CPhoneView::ComponentControl
+// -----------------------------------------------------------------------------
+//
+CCoeControl* CPhoneView::ComponentControl( TInt /*aIndex*/ ) const
+    {
+    return iControl;        
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneView::CountComponentControls
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneView::CountComponentControls() const
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneView::CountComponentControls()");
+    TInt count = 0;
+
+    if ( iControl )
+        {
+        count = 1;
+        }
+
+    return count;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::SetBitmap
+// -----------------------------------------------------------------------------
+//
+void CPhoneView::SetBitmap( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneView::SetBitmap()");
+    TPhoneCmdParamBitmap* bitmapParam = static_cast<TPhoneCmdParamBitmap*>(
+        aCommandParam );
+    
+    if ( !iSecurityMode )
+        {
+        TInt err = KErrNone;
+        if ( bitmapParam->Bitmap()->Handle() )
+            {
+            err = iBitmap->Duplicate( bitmapParam->Bitmap()->Handle() );
+            }
+        else
+            {
+            iBitmap->Reset();
+            }
+            
+        if ( err == KErrNone )
+            {
+            DrawDeferred();
+            }    
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::GetBitmap
+// -----------------------------------------------------------------------------
+//
+void CPhoneView::GetBitmap( TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneView::GetBitmap()");
+    TPhoneCmdParamBitmap* bitmapParam = static_cast<TPhoneCmdParamBitmap*>(
+        aCommandParam );
+
+    bitmapParam->SetBitmap( iBitmap );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::MopSupplyObject
+// -----------------------------------------------------------------------------
+//
+TTypeUid::Ptr CPhoneView::MopSupplyObject( TTypeUid aId )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneView::MopSupplyObject()");
+    // Required during rendering of the background skin in Draw()
+    if (aId.iUid == MAknsControlContext::ETypeId)
+        {
+        return MAknsControlContext::SupplyMopObject( aId, iBgContext );
+        }
+    return CCoeControl::MopSupplyObject( aId );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::SetRect
+// -----------------------------------------------------------------------------
+//    
+void CPhoneView::SetRect( const TRect &aRect )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneView::SetRect()");
+    if ( !AknLayoutUtils::PenEnabled() )
+        {
+        CCoeControl::SetRect( aRect );
+        }
+    else
+        {
+        if ( Layout_Meta_Data::IsLandscapeOrientation() ||
+             iSecurityMode )
+            {
+            // In landscape and in security mode aRect is ok.
+            CCoeControl::SetRect( aRect );    
+            }
+        else
+            {     
+            TRect controlRect( aRect );
+            TAknLayoutRect viewRect;
+            
+            TRect screenRect;
+            AknLayoutUtils::LayoutMetricsRect( 
+                AknLayoutUtils::EScreen, 
+                screenRect  );    
+            
+            viewRect.LayoutRect( 
+                screenRect, 
+                TAknWindowComponentLayout::Compose(
+                    AknLayoutScalable_Avkon::application_window( 0 ),
+                    AknLayoutScalable_Avkon::main_pane( 8 ) ) );   
+            
+            // reduce toolbar
+            TAknLayoutRect toolbarRect;
+            toolbarRect.LayoutRect( 
+                screenRect, 
+                TAknWindowComponentLayout::Compose(
+                AknLayoutScalable_Avkon::application_window( 0 ),
+                AknLayoutScalable_Avkon::popup_toolbar2_fixed_window( 0 ) ) );
+            
+            if ( toolbarRect.Rect().Intersects( controlRect )  )
+                {
+                __PHONELOG( EBasic, EPhoneUIView,"CPhoneView::SetRect Update ");            
+                controlRect.iBr.iY -= toolbarRect.Rect().Height();
+                }            
+                     
+            CCoeControl::SetRect( controlRect );
+            }                
+        }        
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::Draw
+// -----------------------------------------------------------------------------
+//
+void CPhoneView::Draw(  const TRect& aRect ) const
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneView::Draw()");
+    TRect rect = Rect();
+
+    if ( !rect.iTl.iY )
+        {
+        CWindowGc& gc = SystemGc();
+
+        // Draw main area.
+        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
+        
+        if ( iSecurityMode || 
+            !AknsDrawUtils::Background( skin, cc, this, gc, aRect ) )
+            {
+            gc.SetPenStyle(CGraphicsContext::ENullPen);
+            gc.SetBrushColor( AKN_LAF_COLOR( 0 ) ); // 0 for white
+            gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
+            gc.DrawRect( aRect ); 
+            }
+
+        // Frozen Active Idle background image.
+        // TBD: set member variable from states to prevent display of
+        // image if emergency or security view
+        else if ( iBitmap && ( iBitmap->Handle() != 0 ) ) 
+            {
+            gc.BitBlt( TPoint( 0, 0 ), iBitmap );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::HandlePointerEventL
+// -----------------------------------------------------------------------------
+//
+void CPhoneView::HandlePointerEventL( const TPointerEvent& aPointerEvent )
+    {
+    if ( CapturesPointer() )
+        {
+        // Point Capture enabled 
+        // Modify position of pointerevent so that CBA gets valid data.
+        TPointerEvent pointerEvent = aPointerEvent; 
+        TPoint phoneviewPoint = PositionRelativeToScreen();
+        TPoint buttonGroupPoint =  iCba.ButtonGroup()->AsControl()->PositionRelativeToScreen();
+        
+        TPoint screenPoint = buttonGroupPoint-phoneviewPoint; 
+        
+        TPoint styluspoint =  aPointerEvent.iPosition;
+        TPoint currentpointer = styluspoint - screenPoint;
+
+        pointerEvent.iPosition = currentpointer;
+        iCba.ButtonGroup()->AsControl()->HandlePointerEventL( pointerEvent );
+        }
+    // Calling base class implementation
+    CCoeControl::HandlePointerEventL(aPointerEvent);    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::ActivateL
+// -----------------------------------------------------------------------------
+//
+void CPhoneView::ActivateL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneView::ActivateL()");
+    CCoeControl::ActivateL();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::SizeChanged()
+// 
+// Expects that the controls are initialised otherwise.
+// -----------------------------------------------------------------------------
+//
+void CPhoneView::SizeChanged()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneView::SizeChanged()");
+    AknsUtils::RegisterControlPosition( this );
+
+    TRect screen;
+    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen );    
+    iBgContext->SetLayerImage( EPhoneBgFirstLayer, KAknsIIDWallpaper );
+    iBgContext->SetParentPos( screen.iTl );
+    iBgContext->SetLayerRect( EPhoneBgFirstLayer, screen );            
+
+    UpdateControlRect();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::PositionChanged
+// -----------------------------------------------------------------------------
+//
+void CPhoneView::PositionChanged()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneView::PositionChanged()");
+    AknsUtils::RegisterControlPosition( this );
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneView::FocusChanged
+// -----------------------------------------------------------------------------
+//    
+void CPhoneView::FocusChanged( TDrawNow /*aDrawNow*/ )
+    {
+    iControl->SetFocus( IsFocused () );
+    }    
+
+// -----------------------------------------------------------------------------
+// CPhoneView::UpdateControlRect
+// -----------------------------------------------------------------------------
+//
+void CPhoneView::UpdateControlRect()
+    {    
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneView::UpdateControlRect()");
+    if ( iControl )
+        {
+        if ( iControl->Rect() != Rect() )
+            {
+            iControl->SetRect( Rect() );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::HandleResourceChangeL
+// -----------------------------------------------------------------------------
+//
+void CPhoneView::HandleResourceChange( TInt aType )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneView::HandleResourceChange()");
+
+    if ( aType == KAknsMessageSkinChange || 
+         aType == KEikDynamicLayoutVariantSwitch )
+        {
+        DrawDeferred();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::SetSecurityMode
+// -----------------------------------------------------------------------------
+//
+void CPhoneView::SetSecurityMode ( TBool aStatus )
+    {
+    if ( iSecurityMode != aStatus ) 
+        {
+        iSecurityMode = aStatus;
+        SizeChanged();    
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneView::IsSecurityMode
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneView::IsSecurityMode()    
+    {
+    return iSecurityMode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::GetActivatePreviousApp
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneView::GetActivatePreviousApp()
+    {
+    return iActivatePreviousApp;       
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::SetActivatePreviousApp
+// -----------------------------------------------------------------------------
+//
+void CPhoneView::SetActivatePreviousApp( const TBool aStatus )
+    {
+    __PHONELOG1( EBasic, 
+        EPhoneUIView,"CPhoneView::SetActivatePreviousApp() aStatus %d", 
+        aStatus );
+    iActivatePreviousApp = aStatus;        
+    }
+ 
+// -----------------------------------------------------------------------------
+// CPhoneView::SetPhoneAppViewToDialer
+// -----------------------------------------------------------------------------
+//
+void CPhoneView::SetPhoneAppViewToDialer( const TBool aStatus )
+    {
+    __PHONELOG1( EBasic, 
+        EPhoneUIView,"CPhoneView::SetPhoneAppViewToDialer() aStatus %d", 
+        aStatus );
+    iPhoneAppViewToDialer = aStatus;
+    }
+// -----------------------------------------------------------------------------
+// CPhoneView::CapturePointerEvents
+// -----------------------------------------------------------------------------
+//
+void CPhoneView::CapturePointerEvents( const TBool aCapture )
+    {
+    SetPointerCapture( aCapture );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::PhoneAppViewToDialer
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneView::PhoneAppViewToDialer()
+    {
+    __PHONELOG1( EBasic, 
+        EPhoneUIView,"CPhoneView::PhoneAppViewToDialer() iPhoneAppViewToDialer %d", 
+        iPhoneAppViewToDialer );
+    return iPhoneAppViewToDialer;       
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::SetViewObserver
+// -----------------------------------------------------------------------------
+//
+void CPhoneView::SetPhoneViewObserver( MPhoneViewObserver& aObserver )
+    {
+    iObserver = &aObserver;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneView::SetDialerActivation
+// -----------------------------------------------------------------------------
+//
+void CPhoneView::SetDialerActivation( TBool aActivation )
+    {
+    __PHONELOG1( EBasic, 
+        EPhoneUIView,"CPhoneView::SetDialerActivation() aActivation %d", 
+        aActivation );
+    iDialerActivation = aActivation;
+    }
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphoneviewcontroller.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,3909 @@
+/*
+* 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:  The control class of phone ui view in PhoneUI
+*
+*/
+
+
+// INCLUDE FILES
+#include "cphoneviewcontroller.h"
+
+#include "phoneui.pan"
+#include "cphonetoolbarcontroller.h"
+#include "cphonebuttonscontroller.h"
+#include "cphonedialercontroller.h"
+#include "cphonemenucontroller.h"
+#include "cphonenotecontroller.h"
+#include "cphonequerycontroller.h"
+#include "cphonekeycapturecontroller.h"
+#include "cphoneview.h"
+#include "cphonedialerview.h"
+#include "tphonecommandparam.h"
+#include "cphonebubblewrapper.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparamstring.h"
+#include "tphonecmdparamappinfo.h"
+#include "tphonecmdparammessageeditor.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "tphonecmdparamsingleitemfetch.h"
+#include "tphonecmdparamaudiooutput.h"
+#include "tphonecmdparamaudioavailability.h"
+#include "tphonecmdparamquery.h"
+#include "tphonecmdparamsfidata.h"
+#include "tphonecmdparamtranseffect.h"
+#include "phoneconstants.h"
+#include "cphonestatuspane.h"
+#include "cphonepubsubproxy.h"
+#include "cphoneincallindicator.h"
+#include "phonelogger.h"
+#include "cphonetimer.h"
+#include "cphonecenrepproxy.h"
+#include "cphonerecoverysystem.h"
+#include "cphonecontactcontroller.h"
+#include "cphoneapplicationexit.h"
+#include "cphoneaudiocontroller.h"
+#include "cphoneringingtoneplayerao.h"
+#include "cphonevmbxhandler.h"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+#include "telprivatecrkeys.h"
+#include "cphonesingleitemfetch.h"
+#include "mnumberentry.h"
+#include "cdialer.h"
+#include "dialer.hrh"
+#include "cphonemediatorfactory.h"
+#include "cphonemediatorsender.h"
+#include "mphoneviewcustomization.h"
+#include "tphonecmdparamcustomdialer.h"
+#include "tphonecmdparampointer.h"
+#include "dialer.hrh"
+#include "phoneui.hrh"
+#include <apgtask.h>
+#include <apgwgnam.h>
+#include <apacmdln.h>
+#include <coedef.h>  // TKeyResponse
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikmenub.h>
+#include <eikspane.h>
+#include <aknkeylock.h>
+#include <SpdiaControl.h>
+#include <hlplch.h>
+#include <aknnavide.h>
+#include <aknnavilabel.h>
+#include <AknNotifierController.h>
+#include <CMessageData.h> // CMessageData
+#include <sendui.h> // CSendUi
+#include <SenduiMtmUids.h> // KSenduiMtmIrUid
+#include <cphonecntsaveaddtoname.h>
+#include <PbkDataSaveAppUi.hrh>
+#include <PhCltUtils.h>
+#include <telephonyvariant.hrh>
+#include <ConeResLoader.h>
+#include <bldvariant.hrh>
+#include <data_caging_path_literals.hrh>
+#include <AknDlgShut.h> // Avkon dialog shutter.
+#include <cphcntrfshandler.h>
+#include <bautils.h>
+#include <CPbkContactEngine.h>
+#include <CPbkContactItem.h>
+#include <CPbkFieldInfo.h>
+#include <PbkFields.hrh>
+#include <cphcntcontactid.h>
+#include <AknUtils.h>
+#include <AknSgcc.h>
+#include <SettingsInternalCRKeys.h>
+#include <UikonInternalPSKeys.h>
+#include <startupdomainpskeys.h>
+#include <utf.h>
+#include <activeidle2domainpskeys.h>
+#include <telinternalpskeys.h>
+#include <featmgr.h>
+#include <layoutmetadata.cdl.h>
+#include <akntoolbar.h>
+#include <LogsUiCmdStarter.h>
+#include <AknIndicatorContainer.h>
+
+#include <SoftReject.rsg>
+#include <ConeResLoader.h>
+#include <StringLoader.h>
+#include <txtrich.h>
+
+#include <vmnumber.h>
+#include <coreapplicationuisdomainpskeys.h>
+#include <gfxtranseffect/gfxtranseffect.h>
+#include <akntranseffect.h>
+
+#include <GSLauncher.h> // Call Settings launch.
+
+// Kastor effect IDs, aknskincontent/101f84b9.sel
+const TInt KTouchDialerOpenEffect  = 1505;
+const TInt KTouchDialerCloseEffect = 1506;
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::CPhoneViewController
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// ---------------------------------------------------------------------------
+//
+CPhoneViewController::CPhoneViewController() :
+    iEikEnv( *CEikonEnv::Static() ),
+    iNeedToSendToBackground( EFalse ),
+    iHelpCommand( KINCAL_HLP_CALL_HANDLING ),
+    iBlockingDialogIsDisplayed( EFalse ),
+    iIdleUid( KErrNotFound ),
+    iFetchContent( KNullDesC ),
+    iEffectOngoing( EFalse ),
+    iSendBack( ETrue ),
+    iDialerActive( EFalse ),
+    iPriotityChanged( EFalse )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::ConstructL
+// Symbian 2nd phase constructor can leave.
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::ConstructL( TRect aRect )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneViewController::ConstructL()");
+    // Create the status pane singleton
+    iStatusPane = CPhoneStatusPane::Instance();
+    // Reserve the title pane
+    iStatusPane->AddTitlePaneHandlerL( *this );
+    iStatusPane->ReserveTitlePane( *this );
+
+    iAppui = (CAknAppUi*)iEikEnv.EikAppUi();
+    iCba = iEikEnv.AppUiFactory()->Cba();
+
+	iPhoneView = CPhoneView::NewL( aRect, *iCba );
+
+    iBubbleWrapper = CPhoneBubbleWrapper::NewL( iPhoneView, aRect  );
+
+    iPhoneView->SetControl( iBubbleWrapper->Control() );
+    iPhoneView->ActivateL(); // We're ready to activate view after the bubble is initialized
+
+    iIncallIndicator = CPhoneIncallIndicator::NewL();
+    iMenuController = CPhoneMenuController::NewL( iEikEnv );
+    iNoteController = CPhoneNoteController::NewL( iEikEnv );
+    iQueryController = CPhoneQueryController::NewL( iEikEnv );
+    iAudioController = CPhoneAudioController::NewL();
+
+    iRingingTonePlayerAO = CPhoneRingingTonePlayerAO::NewL();
+    // Set display provider for ringing tone player.
+    // Display access is needed for visual ringing tones.
+    iRingingTonePlayerAO->SetVideoPlayer( iBubbleWrapper );
+
+    // Contact
+    CPhoneContactController* contactManager =
+        CPhoneContactController::NewL();
+    iContactController = contactManager;
+
+    iContactControllerId =
+        CPhoneRecoverySystem::Instance()->AddL(
+            TCallBack( DoConstructContactControllerL, this ),
+            CTeleRecoverySystem::EPhonePriorityHigh,
+            CTeleRecoverySystem::EPhoneStateStarting );
+
+    iKeyCaptureController = CPhoneKeyCaptureController::NewL( iEikEnv );
+
+    iApplicationExit = CPhoneApplicationExit::NewL(
+        this,
+        iEikEnv.WsSession(),
+        iEikEnv.WsSession().FindWindowGroupIdentifier( 0, KPhoneEikonServer ) );
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        {
+        iButtonsController = CPhoneButtonsController::NewL( iBubbleWrapper->TouchPane() );
+        }
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) )
+        {
+        // Create dialer view
+        iDialerView = CPhoneDialerView::NewL( aRect );
+        iDialerView->DrawableWindow()->SetOrdinalPosition( -1 );
+        iDialerView->MakeVisible( EFalse );
+        // Create dialer
+        iDialer = CDialer::NewL( *iDialerView, aRect );
+        // Set NE for bubbleWrapper
+        iBubbleWrapper->SetNumberEntry( iDialer->NumberEntry() );
+        CCoeEnv* coeEnv = static_cast<CCoeControl*>(iDialer)->ControlEnv();
+        iDialerController = CPhoneDialerController::NewL( *iBubbleWrapper,
+                                                            *coeEnv,
+                                                            *iMenuController );
+        
+        iToolbarController = CPhoneToolbarController::NewL( *coeEnv  );
+                                                           
+      
+		iDialerView->SetControl( iDialer );
+		iDialerView->ActivateL();
+		iDialerActive = EFalse;
+        }
+
+    User::LeaveIfError( iKeyLock.Connect() );
+
+    // if you are using sgc-client's session to capserver,
+    //you are not allowed to close the session.
+    iAknUiServerClient = CAknSgcClient::AknSrv();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneViewController::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPhoneViewController* CPhoneViewController::NewL( TRect aRect )
+    {
+    __PHONELOG( EBasic, EPhoneUIView,
+            "CPhoneViewController::NewL()" );
+    CPhoneViewController* self = new (ELeave) CPhoneViewController;
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aRect );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// Destructor
+CPhoneViewController::~CPhoneViewController()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView,
+                        "CPhoneViewController::~CPhoneViewController()" );
+    delete iButtonsController;
+    delete iDialerController;
+    delete iToolbarController;
+    iKeyLock.Close();
+    delete iApplicationExit;
+    delete iSpeedDialController;
+    if ( iVmbxHandler )
+        {
+        delete iVmbxHandler;
+        iVmbxHandler = NULL;
+        }
+    delete iKeyCaptureController;
+    CPhoneRecoverySystem::Remove( iContactControllerId );
+    delete iContactController;
+    delete iRingingTonePlayerAO;
+    delete iAudioController;
+    delete iQueryController;
+    delete iNoteController;
+    delete iMenuController;
+    delete iIncallIndicator;
+    delete iBubbleWrapper;
+    delete iPhoneView;
+    delete iIndiContainer;
+    if ( iDialerView )
+        {
+        if(iAppui) //for codescanner
+            {
+            iAppui->RemoveFromStack( iDialerView );
+            }
+        delete iDialerView;
+        }
+    delete iDialer;
+    if ( iSingleItemFetch )
+        {
+        delete iSingleItemFetch;
+        iSingleItemFetch = NULL;
+        }
+    delete iRfsHandler;
+    RemoveAddToContactDialog();
+
+//    delete iStatusPane; <-- CCoeStatic are destroyed outside application
+
+    iApaLsSession.Close();
+
+    }
+
+// ---------------------------------------------------------
+// CPhoneViewController::PhoneView
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneView* CPhoneViewController::PhoneView()
+    {
+    return iPhoneView;
+    }
+
+// ---------------------------------------------------------
+// CPhoneViewController::ExecuteCommandL( aCmdId )
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneViewController::ExecuteCommandL(
+    TPhoneViewCommandId aCmdId )
+    {
+    __PHONELOGVIEWMSG( aCmdId, 0 );
+
+    switch ( aCmdId )
+        {
+        case EPhoneViewLaunchApplication:
+            LaunchApplicationL();
+            break;
+
+        case EPhoneViewMenuBarClose:
+             iMenuController->CloseMenuBar();
+            break;
+
+        case EPhoneViewRemoveNumberEntry:
+            if ( iDialer && iDialerActive )
+                {
+                SetControltoCallHandlingL();
+                iBubbleWrapper->RemoveNumberEntry();
+                iPhoneView->SetActivatePreviousApp( EFalse );
+                
+                TPhoneCmdParamCallStateData callStateData;
+                callStateData.SetCallState( EPEStateConnected );
+                iBubbleWrapper->GetCallIdByState( &callStateData );
+                TInt connected = callStateData.CallId();
+                    
+                // If video call
+                if( connected == KVideoTelephonyCallId1 ||
+                        connected == KVideoTelephonyCallId2 )
+                    {
+                    TPhoneCmdParamInteger uidParam;
+                    // Bring video telephone app in the foreground
+                    uidParam.SetInteger( KVtUiAppUidValue.iUid );
+                    BringAppToForeground( &uidParam );
+                    }
+                }
+            else
+                {
+                iBubbleWrapper->RemoveNumberEntry();
+                }
+            break;
+
+        case EPhoneViewRemoveNote:
+            iNoteController->DestroyNote();
+            break;
+
+        case EPhoneViewRemoveDtmfNote:
+            iNoteController->DestroyDTMFNote();
+            break;
+
+        case EPhoneViewRemoveGlobalNote:
+            iNoteController->DestroyGlobalNoteL();
+            break;
+
+        case EPhoneViewRemoveQuery:
+            iQueryController->DestroyQuery();
+            iQueryController->DestroyGlobalQuery();
+            break;
+
+        case EPhoneViewRemoveGlobalWaitNote:
+            iQueryController->DestroyGlobalWaitNote();
+            break;
+        case EPhoneViewRemoveProgressNote:
+            iNoteController->DestroyProgressNote();
+            break;
+
+        case EPhoneViewSendToBackground:
+            SendToBackgroundL();
+            break;
+
+        case EPhoneViewExitApplications:
+            iApplicationExit->ExitApplication();
+            break;
+
+        case EPhoneViewHideNaviPaneAudioVolume:
+            iAudioController->DeactivateVolumeControl();
+            break;
+
+        case EPhoneViewShowNaviPaneAudioVolume:
+            iAudioController->ActivateVolumeControlL();
+            break;
+
+        case EPhoneViewRemovePhoneDialogs:
+            RemovePhoneDialogsL();
+            break;
+            
+        case EPhoneViewRemoveAllCallHeaders:
+            iBubbleWrapper->RemoveAllCallHeadersL();
+            break;
+
+        case EPhoneViewMuteRingToneOnAnswer:
+            iRingingTonePlayerAO->MuteRingingToneOnAnswer();
+            break;
+
+        case EPhoneViewStopRingTone:
+            iRingingTonePlayerAO->StopPlaying();
+            break;
+            
+        case EPhoneViewMuteRingTone:
+            iRingingTonePlayerAO->MuteRingingTone();
+            break;
+
+        case EPhoneViewAddToConference:
+            iBubbleWrapper->AddToConferenceL();
+            break;
+
+        case EPhoneViewCreateNumberEntry:
+            // Keep menu controller in synch with number entry mode
+            iMenuController->SetAlphaModeFlag( EFalse );
+            iBubbleWrapper->CreateNumberEntry();
+            if ( iDialer && !iDialerActive )
+                {
+                SetControltoDialerL();
+                }
+            break;
+
+        case EPhoneViewUpdateMaxConfMemberFlag:
+            iMenuController->SetMaxConfMembersFlag(
+                iBubbleWrapper->IsMaxMembersInConf() );
+            if ( iButtonsController )
+                {
+                TPhoneCmdParamBoolean joinParam;
+                joinParam.SetBoolean( iBubbleWrapper->IsMaxMembersInConf() );
+                iButtonsController->SetInCallJoinEnabled( &joinParam );
+                }
+            break;
+
+        case EPhoneViewLaunchRfsDeep:
+            LaunchRfsL( ETrue );
+            break;
+
+        case EPhoneViewLaunchRfsNormal:
+            LaunchRfsL( EFalse );
+            break;
+
+        case EPhoneViewUpdateView:
+            iPhoneView->DrawDeferred();
+            break;
+
+        case EPhoneViewUpdateContact:
+            OpenAddToContactL( EPbkCmdDataSaveAddToExisting );
+            break;
+
+        case EPhoneViewAddContact:
+            OpenAddToContactL( EPbkCmdDataSaveCreateNew );
+            break;
+
+        case EPhoneViewSendMessage:
+            SendMessageL();
+            break;
+
+        case EPhoneViewEnableKeyLock:
+            iKeyLock.EnableKeyLock();
+            break;
+
+        case EPhoneViewEnableKeyLockWithoutNote:
+            iKeyLock.EnableWithoutNote();
+            break;
+            
+        case EPhoneViewDisableKeyLockWithoutNote:
+            iKeyLock.DisableWithoutNote();
+            break;
+
+        case EPhoneViewUpdateFSW:
+            SetHiddenL( !iBubbleWrapper->IsNumberEntryUsed() );
+            UpdateFSW();
+            break;
+
+        case EPhoneViewUpdatePhoneIconToFSW:
+            SetHiddenL( EFalse );
+            UpdateFSW();
+            break;
+
+        case EPhoneViewCloseFSW:
+            iEikEnv.DismissTaskList();
+            break;
+
+        case EPhoneViewBringIdleToForeground:
+            {
+            // bringe idle application to fore.
+            TPhoneCmdParamInteger uidParam;
+            uidParam.SetInteger( IdleAppUid() );
+            BringAppToForeground( &uidParam );
+            if ( iSingleItemFetch )
+                {
+                // Cancel the Single Item Fetch
+                iSingleItemFetch->Delete();
+                }
+            }
+            break;
+
+        case EPhoneViewSetIdleTopApplication:
+            {
+            TPhoneCmdParamInteger uidParam;
+            uidParam.SetInteger( IdleAppUid() );
+            SetTopApplicationL( &uidParam );
+            }
+            break;
+
+        case EPhoneViewRemoveConferenceBubble:
+            {
+            iBubbleWrapper->RemoveConferenceL();
+            }
+            break;
+
+        case EPhoneViewClearNumberEntryContent:
+            {
+            iBubbleWrapper->SetNumberEntryContent( KNullDesC );
+            }
+            break;
+
+        case EPhoneViewUpdateToolbar:
+            {
+            if ( iDialer )
+                {
+                iDialerController->UpdateToolbar();
+                }
+            }
+            break;
+
+        case EPhoneViewSetControlAndVisibility:
+            if ( iDialer )
+                {
+                SetDialerControlAndVisibilityL();
+                }
+            else
+                {
+                // If iDialer is false then set numberentry
+                // visible.
+                TPhoneCmdParamBoolean booleanParam;
+                booleanParam.SetBoolean( ETrue );
+                iBubbleWrapper->SetNumberEntryVisible( &booleanParam );
+                }
+            break;
+
+        case EPhoneViewActivatePreviousApp:
+            {
+            TApaTaskList appList( iEikEnv.WsSession() );
+            TApaTask bring = appList.FindApp( KUidPhoneApplication );
+            // If CheckSendBackRoundEventNeed returns false then the
+            // active/foreground application is phone&singleitemfetch and
+            // there is no need to make SendToBackRound event or update
+            // window group position.
+            if ( bring.Exists() )
+                {
+                CAknSgcClient::MoveApp( bring.WgId(),
+                                        ESgcMoveAppToBackground );
+                // Position needs to be updated to ensure that exit works
+                // from previous view.
+                SetWindowGroupPosition();
+                }
+            }
+            break;
+
+        case EPhoneViewKeypadAudioEnabled:
+            {
+            iBubbleWrapper->KeypadAudioEnabled();
+            }
+            break;
+
+        case EPhoneViewKeypadAudioDisabled:
+            {
+            iBubbleWrapper->KeypadAudioDisabled();
+            }
+            break;
+
+        case EPhoneViewCancelAllNotications:
+            {
+            CancelAllNotications();
+            }
+            break;
+        case EPhoneViewOpenVirtualKeyBoard:
+            {
+            iBubbleWrapper->OpenVkbL();
+            }
+            break;
+        case EPhoneViewCreatePhoneBookServices:
+            {
+            // Open and create phonebook services(phonebook stores etc).
+            iContactController->CreatePhoneBookServiceL();
+            break;
+            }
+        case EPhoneViewHideToolbar:
+            {
+            iToolbarController->HideToolbar();
+            }
+            break;  
+
+        case EPhoneViewDisableKeyLock:
+            {
+            DisableKeyLock();
+            }
+            break;
+
+        default:
+            __PHONELOG( EBasic, EPhonePhoneapp,
+                "CPhoneViewController::ExecuteCommandL -> UnKnownMessage !");
+            break;
+        }
+    CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::ExecuteCommandL( aCmdId, aCallId )
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneViewController::ExecuteCommandL(
+    TPhoneViewCommandId aCmdId,
+    TInt aCallId )
+    {
+    __PHONELOGVIEWMSG( aCmdId, aCallId );
+    __ASSERT_DEBUG( aCallId > KErrNotFound,
+                    Panic( EPhoneViewParameterNotInitialized ) );
+
+    switch ( aCmdId )
+        {
+        case EPhoneViewRemoveCallHeader:
+            iBubbleWrapper->RemoveCallHeaderL( aCallId );
+            break;
+
+        case EPhoneViewRemoveFromConference:
+            iBubbleWrapper->RemoveFromConferenceL( aCallId );
+            break;
+
+        case EPhoneViewPrivateFromConference:
+            iBubbleWrapper->ConferenceMemberToPrivateL( aCallId );
+            break;
+
+        default:
+            __PHONELOG( EBasic, EPhonePhoneapp,
+             "CPhoneViewController::ExecuteCommandL -> UnKnownMessage !!! ");
+            break;
+        }
+    CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId, aCallId );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::ExecuteCommandL( aCmdId, aCommandParam )
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneViewController::ExecuteCommandL(
+    TPhoneViewCommandId aCmdId,
+    TPhoneCommandParam* aCommandParam )
+    {
+    __PHONELOGVIEWMSG( aCmdId, 0 );
+
+    switch ( aCmdId )
+        {
+        case EPhoneViewSetSendKeyDialerActivationFlag:
+            {
+            TPhoneCmdParamBoolean* booleanParam =
+                static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+            iPhoneView->SetDialerActivation( booleanParam->Boolean() );
+            }
+            break;
+
+        case EPhoneViewAllowWaitingCallHeader:
+            AllowWaitingCallHeaderL( aCommandParam );
+            break;
+
+        case EPhoneViewCreateNumberEntry:
+            iBubbleWrapper->CreateNumberEntry();
+            if ( iDialer && !iDialerActive )
+                {
+                SetControltoDialerL();
+                }
+            // Pass the key event to number entry
+            iBubbleWrapper->HandleKeyEventL( aCommandParam );
+            break;
+
+        case EPhoneViewUpdateContextMenu:
+            {     
+            iMenuController->SetContextMenu( aCommandParam );     
+            } break; 
+
+        case EPhoneViewGetLocalizedNumberFromEntry:
+            iBubbleWrapper->GetLocalizedNumberEntryContent( aCommandParam );
+            break;
+
+        case EPhoneViewSetNumberEntryVisible:
+            if ( iDialer )
+                {
+                TPhoneCmdParamBoolean* booleanParam =
+                    static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+                if ( booleanParam->Boolean() )
+                    {
+                    SetControltoDialerL();
+                    }
+                else
+                    {
+                    // Set activate previous to false since dialer was set to
+                    // hidden status.
+                    iPhoneView->SetActivatePreviousApp( EFalse );
+                    SetControltoCallHandlingL();
+                    }
+                }
+            else
+                {
+                iBubbleWrapper->SetNumberEntryVisible( aCommandParam );
+                }
+            break;
+
+        case EPhoneViewGetNumberEntryCount:
+            iBubbleWrapper->GetNumberEntryCount( aCommandParam );
+            break;
+
+        case EPhoneViewMenuBarOpen:
+            iMenuController->SetNEVisibleFlag(
+                iBubbleWrapper->IsNumberEntryVisible() );
+            iMenuController->OpenMenuBarL( aCommandParam );
+            break;
+
+        case EPhoneViewUpdateCba:
+            SetCbaL( aCommandParam );
+            break;
+
+        case EPhoneViewMenuPane:
+            iMenuController->SetReplaceFlag( IsReplaceAllowed() );
+            iMenuController->DynInitMenuPaneL( aCommandParam );
+            break;
+
+        case EPhoneViewMenuBar:
+            iMenuController->DynInitMenuBar( aCommandParam );
+            break;
+
+        case EPhoneViewShowNote:
+            iNoteController->CreateNoteL( aCommandParam );
+            break;
+
+        case EPhoneViewShowGlobalNote:
+            iNoteController->CreateGlobalNoteL( aCommandParam );
+            break;
+
+        case EPhoneViewShowQuery:
+            iQueryController->CreateQueryL( aCommandParam );
+            break;
+
+        case EPhoneViewSetListQueryString:
+            iQueryController->SetListQueryStringL( aCommandParam );
+            break;
+
+        case EPhoneViewUpdateNoteSoftkeys:
+            iNoteController->UpdateNoteSoftkeysL( aCommandParam );
+            break;
+
+        case EPhoneViewShowProgressNote:
+            iNoteController->CreateProgressNoteL( aCommandParam );
+            break;
+
+        case EPhoneViewActivateAudioPathUIChanges:
+            UpdateAudioPathOptions( aCommandParam );
+            break;
+
+        case EPhoneViewActivateAudioAvailabilityUIChanges:
+            UpdateAudioAvailabilityOptions( aCommandParam );
+            break;
+
+        case EPhoneViewActivateMuteUIChanges:
+            iMenuController->SetMuteFlag( aCommandParam );
+            iBubbleWrapper->SetPhoneMuted( aCommandParam );
+            iIncallIndicator->HandleMuteChange( aCommandParam );
+            iAudioController->HandleMuteChange( aCommandParam );
+            iToolbarController->SetMuteFlag( aCommandParam );
+            if ( iButtonsController )
+                {
+                iButtonsController->SetMuteFlag( aCommandParam );
+                }
+            break;
+
+        case EPhoneViewBringAppToForeground:
+            {
+            TPhoneCmdParamInteger* integerParam =
+                   static_cast<TPhoneCmdParamInteger*>( aCommandParam );
+            // If uid is phone app then call phone app specific foreground
+            // method.
+            if ( KUidPhoneApplication.iUid == integerParam->Integer() )
+                {
+                BringPhoneAppToForeground( aCommandParam );
+                }
+            else
+                {
+                BringAppToForeground( aCommandParam );
+                }
+            }
+            break;
+
+        case EPhoneViewSetNeedToSendToBackgroundStatus:
+            SetNeedToSendToBackground( aCommandParam );
+            break;
+
+       case EPhoneViewSetBlockingDialogStatus:
+            {
+            TPhoneCmdParamBoolean* booleanParam =
+                static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+            SetBlockingDialogIsDisplayed( booleanParam->Boolean() );
+            }
+            break;
+
+       case EPhoneViewGetBlockingDialogStatus:
+            GetBlockingDialogIsDisplayed( aCommandParam );
+            break;
+
+        case EPhoneViewGetForegroundApplication:
+            GetForegroundApplication( aCommandParam );
+            break;
+
+        case EPhoneViewSetTopApplication:
+            SetTopApplicationL( aCommandParam );
+            break;
+
+        case EPhoneViewActivateApp:
+            ActivateAppL( aCommandParam );
+            break;
+
+        case EPhoneViewActivateAppView:
+            ActivateAppViewL( aCommandParam );
+            break;
+
+        case EPhoneViewActivateAppViewWithCustomMessage:
+            ActivateAppViewWithCustomMessageL( aCommandParam );
+            break;
+
+        case EPhoneViewActivateAppViewConventional:
+            ActivateAppViewConventionalL( aCommandParam );
+            break;
+
+        case EPhoneViewUpdateIncallIndicator:
+            iMenuController->CloseMenuBar();
+            iIncallIndicator->Update( aCommandParam );
+            iMenuController->SetCallInProgressFlag( aCommandParam );
+            break;
+
+        case EPhoneViewStartCapturingKey:
+            iKeyCaptureController->StartCapturingKey( aCommandParam );
+            break;
+
+        case EPhoneViewStopCapturingKey:
+            iKeyCaptureController->StopCapturingKey( aCommandParam );
+            break;
+
+        case EPhoneViewSetPointerCapture:
+            CapturePointerEvents( aCommandParam );
+            break;
+        case EPhoneViewSetGlobalNotifiersDisabled:
+            SetGlobalNotifiersDisabledL( aCommandParam );
+            break;
+        case EPhoneViewSetEikonNotifiersDisabled:
+            SetEikonNotifiersDisabled( aCommandParam );
+            break;
+
+        case EPhoneViewGetHoldFlag:
+            iMenuController->GetHoldFlag( aCommandParam );
+            break;
+
+        case EPhoneViewSetHoldFlag:
+            iMenuController->SetHoldFlag( aCommandParam );
+            if ( iButtonsController )
+                {
+                iButtonsController->SetHoldFlag( aCommandParam );
+                }
+            break;
+
+        case EPhoneViewSetVideoCallFlag:
+            if ( iButtonsController )
+                {
+                iButtonsController->SetVideoCallFlag( aCommandParam );
+                }
+            break;
+
+        case EPhoneViewGetConferenceAndSingleFlag:
+            iMenuController->GetConferenceAndSingleFlag( aCommandParam );
+            break;
+
+        case EPhoneViewSetConferenceAndSingleFlag:
+            iMenuController->SetConferenceAndSingleFlag( aCommandParam );
+            break;
+
+        case EPhoneViewGetSoftRejectFlag:
+            iMenuController->GetSoftRejectFlag( aCommandParam );
+            break;
+
+        case EPhoneViewSetSoftRejectFlag:
+            iMenuController->SetSoftRejectFlag( aCommandParam );
+            break;
+
+        case EPhoneViewSetServiceCodeFlag:
+            iMenuController->SetServiceCodeFlag( aCommandParam );
+
+            if ( iDialer )
+                {
+                iDialerController->SetServiceCodeFlagL( aCommandParam );
+                }
+            break;
+
+        case EPhoneViewGetTextQueryContent:
+            iQueryController->GetTextQueryContentL( aCommandParam );
+            break;
+
+        case EPhoneViewOpenSoftRejectEditor:
+            OpenSoftRejectMessageEditorL( aCommandParam );
+            break;
+
+        case EPhoneViewOpenMessageEditor:
+            OpenMessageEditorL( aCommandParam );
+            break;
+
+        case EPhoneViewOpenConferenceList:
+            iBubbleWrapper->OpenConferenceList( aCommandParam );
+            iMenuController->SetConferenceParticipantsListVisibleFlag(
+                                                              aCommandParam );
+            break;
+
+        case EPhoneViewGetConferenceListVisibleFlag:
+            iMenuController->GetConferenceParticipantsListVisibleFlag(
+                                                              aCommandParam );
+            break;
+
+        case EPhoneViewMoveHighLightInList:
+            iBubbleWrapper->MoveHighlightInConference( aCommandParam );
+            break;
+
+        case EPhoneViewGetCountOfActiveCalls:
+            iBubbleWrapper->GetActiveCallsCount( aCommandParam );
+            break;
+
+        case EPhoneViewSetNaviPaneAudioVolume:
+            iAudioController->HandleVolumeChangeL( aCommandParam );
+            break;
+
+        case EPhoneViewSetTitlePanePicture:
+            iStatusPane->SetTitlePanePictureL( aCommandParam );
+            break;
+
+       case EPhoneViewSetSecurityMode:
+            SetSecurityMode( aCommandParam );
+            break;
+
+       case EPhoneViewGetSecurityModeStatus:
+            GetSecurityModeStatus( aCommandParam );
+            break;
+
+       case EPhoneViewSetStatusPaneVisible:
+            SetStatusPaneVisible( aCommandParam );
+            break;
+
+        case EPhoneViewSetBackgroundImageBitmap:
+            iPhoneView->SetBitmap( aCommandParam );
+            break;
+
+        case EPhoneViewGetBackgroundImageBitmap:
+            iPhoneView->GetBitmap( aCommandParam );
+            break;
+
+        case EPhoneViewGetIsConference:
+            iBubbleWrapper->GetIsConference( aCommandParam );
+            break;
+
+        case EPhoneViewPlayRingTone:
+            iRingingTonePlayerAO->PlayRingToneL( aCommandParam );
+            break;
+
+        case EPhoneViewGetIsNoteVisible:
+            iNoteController->IsNoteVisible( aCommandParam );
+            break;
+
+        case EPhoneViewIsNoteActive:
+            iNoteController->IsNoteActive( aCommandParam );
+            break;
+
+        case EPhoneViewIsActiveNoteDissmissableByKeyEvent:
+            iNoteController->IsActiveNoteDissmissableByKeyEvent( aCommandParam );
+            break;
+
+        case EPhoneViewGetIsProgressNoteVisible:
+            iNoteController->IsProgressNoteVisible( aCommandParam );
+            break;
+
+        case EPhoneViewSetPhoneNumberAvailableInPhoneEngine:
+            iMenuController->SetPhoneNumberAvailableInPhoneEngine(
+            aCommandParam );
+            break;
+
+        case EPhoneViewSendAiwCommand:
+            iMenuController->SendAiwCommandL( aCommandParam );
+            break;
+
+        case EPhoneViewIsQuery:
+            iQueryController->IsQueryActive( aCommandParam );
+            break;
+
+        case EPhoneViewToggleNumberEntryAlphaNumericMode:
+            {
+            iBubbleWrapper->ToggleNumberEntryAlphaNumericMode( aCommandParam );
+            TPhoneCmdParamBoolean*  modeAlpha =
+                static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+            iMenuController->SetAlphaModeFlag( modeAlpha->Boolean() );
+            }
+            break;
+
+        case EPhoneViewSetConfrenceOptionsFlag:
+            {
+            TPhoneCmdParamBoolean* param =
+                            static_cast<TPhoneCmdParamBoolean*>(aCommandParam);
+            iMenuController->SetRemoveConfrenceOptionsFlag( param->Boolean() );
+            }
+            break;
+
+        case EPhoneViewGetSoftRejectWindowGroupId:
+            GetSoftRejectWindowGroupId( aCommandParam );
+            break;
+
+        case EPhoneViewSetTouchPaneButtons:
+            iButtonsController->SetButtonSet( aCommandParam );
+            break;
+
+        case EPhoneViewSetTouchPaneVisible:
+            {
+            TPhoneCmdParamBoolean* booleanParam =
+                static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+            iBubbleWrapper->SetTouchPaneVisible( booleanParam->Boolean() );
+            }
+            break;
+
+        case EPhoneViewSetDtmfDialerViewVisible:
+            {
+            if ( iDialer )
+                {
+                TPhoneCmdParamBoolean* booleanParam =
+                    static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+                iDialerController->SetDtmfDialerVisibleL(
+                                                booleanParam->Boolean() );
+                 }
+            break;
+            }
+
+        case EPhoneViewSetRetrictedDialer:
+            {
+            if ( iDialer )
+                {
+                TPhoneCmdParamBoolean* booleanParam =
+                    static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+                iDialerController->SetRestrictedDialer(
+                                                booleanParam->Boolean() );
+                }
+            break;
+            }
+        case EPhoneViewSetDtmfOptionsFlag:
+            {
+            TPhoneCmdParamBoolean*  booleanParam =
+                static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+            iMenuController->SetAllowDtmfOptionsFlag(
+                                                booleanParam->Boolean() );
+            break;
+            }
+
+        case EPhoneViewSetVideoCallDTMFVisibilityFlag:
+            {
+            TPhoneCmdParamBoolean*  booleanParam =
+                static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+            iMenuController->SetHideVideoCallDTMFVisibilityFlag(
+                                                    booleanParam->Boolean() );
+            break;
+            }
+
+        case EPhoneViewShowVTSetupFailedCreateCallToSameContactQuery:
+            iQueryController->CreateQueryL( aCommandParam );
+            break;
+
+        case EPhoneViewGetActivatePreviousApp:
+            {
+            TPhoneCmdParamBoolean*  booleanParam =
+                static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+            booleanParam->SetBoolean( iPhoneView->GetActivatePreviousApp() );
+            }
+            break;
+
+        case EPhoneViewShowCustomizedDialer:
+            {
+            TPhoneCmdParamCustomDialer* customDialerParam =
+                static_cast<TPhoneCmdParamCustomDialer*>( aCommandParam );
+            iDialerController->ShowCustomizedDialerL(
+                                      customDialerParam->DialerController() );
+            }
+            break;
+        case EPhoneViewGetNumberFromEntry:
+            {
+            iBubbleWrapper->GetNumberEntryContent( aCommandParam );
+            break;
+            }
+        case EPhoneViewUpdateContactByString:
+            {
+            TPhoneCmdParamString* paramString =
+                    static_cast<TPhoneCmdParamString*>( aCommandParam );
+
+            OpenAddToContactL( EPbkCmdDataSaveAddToExisting,
+                               *paramString->String() );
+            }
+            break;
+
+        case EPhoneViewAddContactByString:
+            {
+            TPhoneCmdParamString* paramString =
+                    static_cast<TPhoneCmdParamString*>( aCommandParam );
+
+            OpenAddToContactL( EPbkCmdDataSaveCreateNew,
+                               *paramString->String() );
+            }
+            break;
+        case EPhoneViewSetNoConnectedCalls:
+            {
+            iQueryController->SetNoConnectedCalls( aCommandParam );
+            }
+            break;
+        case EPhoneViewSetToolbarDimming:
+            {
+            TPhoneCmdParamBoolean*  booleanParam =
+                static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+            iToolbarController->DimToolbar( booleanParam->Boolean());
+            break;
+            }
+
+        default:
+            __PHONELOG( EBasic, EPhonePhoneapp,
+             "CPhoneViewController::ExecuteCommandL -> UnKnownMessage !!! " );
+            break;
+        }
+
+    CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId,
+                                                            *aCommandParam );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::ExecuteCommandL( aCmdId, aCallId, aCommandParam )
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneViewController::ExecuteCommandL(
+    TPhoneViewCommandId aCmdId,
+    TInt aCallId,
+    TPhoneCommandParam* aCommandParam )
+    {
+    __PHONELOGVIEWMSG( aCmdId, aCallId );
+
+    switch ( aCmdId )
+        {
+        case EPhoneViewUpdateBubble:
+            HandleUpdateBubbleL( aCallId, aCommandParam );
+            break;
+
+        case EPhoneViewCreateCallHeader:
+            iBubbleWrapper->CreateCallHeaderL( aCallId, aCommandParam );
+            break;
+
+        case EPhoneViewUpdateCallHeaderRemoteInfoData:
+            iBubbleWrapper->UpdateCallHeaderDisplay( aCallId, aCommandParam );
+            break;
+
+        case EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel:
+            iBubbleWrapper->UpdateCallHeaderAndLabel( aCallId, aCommandParam );
+            break;
+
+        case EPhoneViewCreateEmergencyCallHeader:
+            iBubbleWrapper->CreateEmergencyCallHeaderL( aCallId,
+                                                        aCommandParam );
+            break;
+
+        case EPhoneViewCreateConference:
+            iBubbleWrapper->CreateConferenceL( aCallId, aCommandParam );
+            break;
+
+        case EPhoneViewGetCallExistsInConference:
+            iBubbleWrapper->CallExistsInConference( aCallId, aCommandParam );
+            break;
+
+        case EPhoneViewCipheringInfoChange:
+            {
+            iBubbleWrapper->UpdateCipheringIndicator( aCallId, aCommandParam );
+            }
+            break;
+
+        default:
+            __PHONELOG( EBasic, EPhonePhoneapp,
+             "CPhoneViewController::ExecuteCommandL -> UnKnownMessage !!! " );
+            break;
+        }
+    CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId, aCallId,
+                                                            *aCommandParam );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::ExecuteCommandL( aCmdId, aCallId, aMessage )
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneViewController::ExecuteCommandL(
+    TPhoneViewCommandId aCmdId,
+    TInt aCallId,
+    TDesC& aMessage )
+    {
+    __PHONELOGVIEWMSG( aCmdId, aCallId );
+
+    switch( aCmdId )
+        {
+        case EPhoneViewSetNumberEntryContent:
+            iBubbleWrapper->SetNumberEntryContent( aMessage );
+            break;
+
+        case EPhoneViewSetTitlePaneContent:
+            iStatusPane->SetTitlePaneContentL( aMessage );
+            break;
+
+        case EPhoneViewSetNaviPaneContent:
+            {
+            if ( !iDialer )
+                {
+                CAknNaviLabel* naviLabel = static_cast<CAknNaviLabel*>(
+                    iStatusPane->NaviDecorator().DecoratedControl() );
+                naviLabel->SetTextL( aMessage );
+                iStatusPane->NaviDecorator().DrawDeferred();
+                }
+
+            }
+            break;
+
+        case EPhoneViewLaunchHelpApplication:
+            LaunchHelpApplicationL( aMessage );
+            break;
+
+        case EPhoneViewUpdateCallHeaderCallDuration:
+            iBubbleWrapper->UpdateCallDuration( aCallId, aMessage );
+            break;
+
+        default:
+            __PHONELOG (EBasic, EPhonePhoneapp, " CPhoneViewController::ExecuteCommandL -> UnHandledMessage !!! ");
+            break;
+        }
+    CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId, aCallId, &aMessage );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::ExecuteCommand( aCmdId )
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneViewController::ExecuteCommand(
+    TPhoneViewCommandId aCmdId )
+    {
+    switch( aCmdId )
+        {
+        case EPhoneResetTouchButtons:
+            if ( iButtonsController )
+                {
+                iButtonsController->SetToggleButtons();
+                }
+            break;
+
+        case EPhoneViewBeginUpdate:
+            {
+            iBubbleWrapper->StartChanges();
+            }
+            break;
+
+        case EPhoneViewEndUpdate:
+            {
+            iBubbleWrapper->EndChanges();
+            }
+            break;
+        case EPhoneViewCloseSingleItemFetchDialog:
+            {
+            if ( iSingleItemFetch )
+                {
+                // Cancel the Single Item Fetch
+                iSingleItemFetch->Delete();
+                iSingleItemFetch = NULL;
+                }
+            }
+          break;
+
+        case EPhoneViewPrepareIcons:
+          iBubbleWrapper->BubbleManager().PrepareIcons();
+          break;
+
+        case EPhoneViewLoadPlugins:
+          iBubbleWrapper->LoadPlugins();
+          break;
+
+        case EPhoneViewCipheringInfoChangePlayTone:
+            {
+            iRingingTonePlayerAO->PlayUnsecureVoIPTone();
+            }
+            break;
+
+        default:
+            __PHONELOG (EBasic, EPhonePhoneapp, " CPhoneViewController::ExecuteCommand -> UnHandledMessage !!! ");
+            break;
+        }
+    CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::ExecuteCommand( aCmdId, aCommandParam )
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneViewController::ExecuteCommand(
+    TPhoneViewCommandId aCmdId,
+    TPhoneCommandParam* aCommandParam )
+    {
+    __PHONELOGVIEWMSG( aCmdId, 0 );
+
+    switch ( aCmdId )
+        {
+        case EPhoneViewGetIsConferenceInSelectionMode:
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam )->SetBoolean(
+                iBubbleWrapper->BubbleManager().SelectionIdInConference() !=
+                KBubbleInvalidId );
+            break;
+
+        case EPhoneViewEnableTouchButton:
+            if ( iButtonsController )
+                {
+                iButtonsController->SetButtonEnabled( aCommandParam );
+                }
+            break;
+
+        case EPhoneViewDisableTouchButton:
+            if ( iButtonsController )
+                {
+                iButtonsController->SetButtonDisabled( aCommandParam );
+                }
+            break;
+
+        case EPhoneViewGetAudioVolumeLevel:
+            {
+            TInt level = iAudioController->VolumeLevelFromControl();
+            static_cast<TPhoneCmdParamInteger*>( aCommandParam )->SetInteger(
+                level );
+            }
+           break;
+
+        case EPhoneViewBeginTransEffect:
+            {
+            if ( iDialer )
+                {
+                TPhoneTransEffectType type =
+                    static_cast<TPhoneCmdParamTransEffect*>( aCommandParam )->Type();
+                TBool isForeground = iAppui->IsForeground();
+
+                if ( isForeground && // newer run effect if not at front
+                     ( ( type == EPhoneTransEffectDialerCreate && !iDialerActive ) ||
+                       ( type == EPhoneTransEffectDialerOpen && !iDialerActive &&
+                         iBubbleWrapper->IsNumberEntryUsed() ) ||
+                       ( type == EPhoneTransEffectDialerClose && iDialerActive ) ) )
+                    {
+                    HandleTransitionEffect( type );
+                    }
+                }
+            break;
+            }
+
+        case EPhoneViewEndTransEffect:
+            {
+            if ( iDialer )
+                {
+                HandleTransitionEffect(
+                    static_cast<TPhoneCmdParamTransEffect*>( aCommandParam )->Type() );
+                }
+            break;
+            }
+        case EPhoneViewGetNumberFromEntry:
+            {
+            iBubbleWrapper->GetNumberEntryContent( aCommandParam );
+            break;
+            }
+
+        case EPhoneViewGetKeyLockStatus:
+            {
+            TPhoneCmdParamBoolean*  booleanParam = static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+            booleanParam->SetBoolean( iKeyLock.IsKeyLockEnabled() );
+            }
+            break;
+
+        case EPhoneViewSetNumberEntryObserver:
+            {
+            NumberEntryChangedHandler()->SetNumberEntryChangedCallBack(
+                                                aCommandParam );
+            break;
+            }
+        case EPhoneViewGetSingleItemFetchType:
+            static_cast<TPhoneCmdParamInteger*>( aCommandParam )->SetInteger( SingleItemFetchType() );
+            break;
+
+        case EPhoneViewSetPhoneCustomization:
+            {
+            TPhoneCmdParamPointer* pointerParam =
+                static_cast<TPhoneCmdParamPointer*>( aCommandParam );
+            MPhoneCustomization* phoneCustomization =
+                static_cast<MPhoneCustomization*>( pointerParam->Pointer() );
+            iBubbleWrapper->SetPhoneCustomization( phoneCustomization );
+            }
+            break;
+     case EPhoneViewSetViewCustomization:
+            {
+            TPhoneCmdParamPointer* pointerParam =
+                static_cast<TPhoneCmdParamPointer*>( aCommandParam );
+            iCustomization =
+                static_cast<MPhoneViewCustomization*>( pointerParam->Pointer() );
+            }
+            break;
+        case EPhoneViewSetButtonCustomization:
+            {
+            if ( iButtonsController )
+                {
+                TPhoneCmdParamPointer* pointerParam =
+                    static_cast<TPhoneCmdParamPointer*>( aCommandParam );
+                MPhoneButtonCustomization* customization =
+                    static_cast<MPhoneButtonCustomization*>( pointerParam->Pointer() );
+                iButtonsController->SetCustomization( customization );
+                }
+            }
+            break;
+			
+        case EPhoneViewEnableToolbarButton:
+            TPhoneCmdParamInteger*  integerParam =
+                static_cast<TPhoneCmdParamInteger*>( aCommandParam );
+            iToolbarController->SetToolbarButtonDimmed( integerParam->Integer(), EFalse );
+            break;
+
+        default:
+            __PHONELOG( EBasic, EPhonePhoneapp, "CPhoneViewController::ExecuteCommand -> UnHandledMessage !!! " );
+            break;
+        }
+    CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId, *aCommandParam );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::HandleCommandL( aCmdId )
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TPhoneViewResponseId CPhoneViewController::HandleCommandL(
+    TPhoneViewCommandId aCmdId )
+    {
+    __PHONELOGVIEWMSG( aCmdId, 0 );
+
+    TPhoneViewResponseId viewResponse = EPhoneViewResponseSuccess;
+
+    switch ( aCmdId )
+        {
+        case EPhoneViewGetNumberEntryIsUsedStatus:
+            viewResponse = iBubbleWrapper->IsNumberEntryUsed() ?
+                EPhoneViewResponseSuccess :
+                EPhoneViewResponseFailed;
+            break;
+
+        case EPhoneViewGetNumberEntryIsVisibleStatus:
+            if ( iDialer )
+                {
+                viewResponse = iDialerActive ?
+                    EPhoneViewResponseSuccess :
+                    EPhoneViewResponseFailed;
+                }
+            else
+                {
+                viewResponse = iBubbleWrapper->IsNumberEntryVisible() ?
+                EPhoneViewResponseSuccess :
+                EPhoneViewResponseFailed;
+                }
+             break;
+
+        case EPhoneViewIsNumberEntryNumericMode:
+            viewResponse = iBubbleWrapper->IsNENumericMode() ?
+                EPhoneViewResponseSuccess :
+                EPhoneViewResponseFailed;
+            break;
+
+        case EPhoneViewGetNeedToSendToBackgroundStatus:
+            viewResponse = NeedToSendToBackground() ?
+                EPhoneViewResponseSuccess :
+                EPhoneViewResponseFailed;
+            break;
+
+        case EPhoneViewGetTopApplicationIsDisplayedStatus:
+            {
+            const TInt foregroundWg = ForegroundApplicationWindowGroupId();
+            const TBool topAppDisplayed = ( IdleWindowGroupId() == foregroundWg ) ||
+                ( ApplicationWindowGroupId() == foregroundWg );
+            viewResponse = topAppDisplayed ?
+                EPhoneViewResponseSuccess :
+                EPhoneViewResponseFailed;
+            }
+            break;
+
+        case EPhoneViewGetTitlePaneIsVisibleStatus:
+            viewResponse = iStatusPane->IsTitlePaneVisible( *this ) ?
+                EPhoneViewResponseSuccess :
+                EPhoneViewResponseFailed;
+            break;
+            
+        case EPhoneViewIsMenuBarVisible:
+            viewResponse = iMenuController->IsMenuBarVisible() ?
+                EPhoneViewResponseSuccess :
+                EPhoneViewResponseFailed;
+            break;
+
+        case EPhoneViewIsStraightCallToVideoMailBox:
+          {
+          if( !iVmbxHandler )
+              {
+              iVmbxHandler = CPhoneVmbxHandler::NewL();
+              }
+
+          viewResponse = iVmbxHandler->IsStraightCallToVideoMailBox() ?
+              EPhoneViewResponseSuccess :
+              EPhoneViewResponseFailed;
+          }
+          break;
+
+        case EPhoneViewIsKeyLockEnabled:
+            viewResponse = IsKeyLockEnabled() ?
+                EPhoneViewResponseSuccess :
+                EPhoneViewResponseFailed;
+            break;          
+
+    // Dialer specific commands start
+
+    // Dialer handles these commands.
+    // ** TODO Here we need just to flag if functionality creates blocking dialog.
+        case EPhoneDialerCmdLog:
+            {
+            LogsUiCmdStarter::CmdStartL( LogsUiCmdStarterConsts::KDialledView());
+            }
+            break;
+
+        case EPhoneDialerCmdSpeedDial:
+            {
+            // Launch speeddial application.
+            TPhoneCmdParamAppInfo appInfoParam;
+            appInfoParam.SetAppUid( KUidSpdia );
+            ExecuteCommandL( EPhoneViewActivateApp, &appInfoParam );
+            break;
+            }
+            
+        case EPhoneDialerCallSettings:
+            {
+            CGSLauncher* launcher = CGSLauncher::NewLC();
+            launcher->LaunchGSViewL( TUid::Uid( 0x102824A2),
+                                    TUid::Uid( 0x100058B3),
+                                    KNullDesC8 );
+            CleanupStack::PopAndDestroy( launcher );
+            break;
+            }
+            
+        case EPhoneViewIsDTMFEditorVisible:
+            if ( iDialer )
+                {
+                viewResponse = iDialerController->IsDTMFDialerVisible() ?
+                    EPhoneViewResponseSuccess :
+                    EPhoneViewResponseFailed;
+                }
+            else // non-touch.
+                {
+                viewResponse = iQueryController->IsDTMFQueryVisible() ?
+                    EPhoneViewResponseSuccess :
+                    EPhoneViewResponseFailed;
+                }
+            break;
+            
+        case EPhoneViewIsConferenceInExpandedMode:
+            viewResponse = iBubbleWrapper->IsConferenceInExpandedMode() ?
+                EPhoneViewResponseSuccess :
+                EPhoneViewResponseFailed;
+            break;
+
+        case EPhoneViewOpenNumberEntry:
+            if ( iDialer )
+                {
+                TPhoneCmdParamBoolean booleanParam;
+                booleanParam.SetBoolean( ETrue );
+
+                if ( iBubbleWrapper->IsNumberEntryUsed() )
+                    {
+                    // Launch dialer.
+                    ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &booleanParam );
+                    }
+                else // dialer doesnt exist.
+                    {
+                     // Create and launch dialer.
+                    ExecuteCommandL( EPhoneViewCreateNumberEntry, &booleanParam );
+                    }
+                // Set Number Entry CBA
+                TPhoneCmdParamInteger integerParam;
+                integerParam.SetInteger( CPhoneMainResourceResolver::Instance()->
+                    ResolveResourceID( EPhoneNumberAcqCBA ) );
+                ExecuteCommandL( EPhoneViewUpdateCba, &integerParam );
+                // Set flag to false because dialler is set to open status.
+                iPhoneView->SetPhoneAppViewToDialer( EFalse );
+              }
+          break;
+
+        case EPhoneViewOpenCallHandling:
+            if ( iDialer )
+                {
+                if ( iBlockingDialogIsDisplayed )
+                    {
+                    RemovePhoneDialogsL();
+                    }
+                // Remove DTMF dialer when exist
+                if ( iDialerController->IsDTMFDialerVisible() )
+                    {
+                    static_cast<MEikCommandObserver*>( CEikonEnv::Static()->EikAppUi() )
+                    ->ProcessCommandL( EPhoneDtmfDialerExit );
+                    }
+                else if ( iCustomization && 
+                          iDialerController->IsCustomizedDialerVisible() )
+                    {
+                    iCustomization->HandleCommandL( 
+                       *this, EPhoneViewOpenCallHandling, NULL );
+                    }
+                else
+                    {
+                    SetControltoCallHandlingL();
+                    }
+                }
+          break;
+
+        case EPhoneViewIsIdleTopApp:
+            {
+            viewResponse = CPhonePubSubProxy::Instance()->Value(
+                    KPSUidUikon, KUikVideoCallTopApp ) == IdleAppUid() ?
+                EPhoneViewResponseSuccess :
+                EPhoneViewResponseFailed;
+            }
+            break;
+
+        case EPhoneViewSetDialerControlVisible:
+            {
+            // If dialer was not active and needtosendback is false
+            // then check if dialer view is to be opened.
+            if ( !iDialerActive &&
+                 !iNeedToSendToBackground &&
+                 iPhoneView->PhoneAppViewToDialer() )
+                {
+                SetControltoDialerL();
+                // Reset flag.
+                iPhoneView->SetPhoneAppViewToDialer( EFalse );
+                viewResponse = EPhoneViewResponseSuccess;
+                }
+            else
+                {
+                // Reset flag.
+                iPhoneView->SetPhoneAppViewToDialer( EFalse );
+                viewResponse = EPhoneViewResponseFailed;
+                }
+            }
+            break;
+// Dialer specific commands end.
+
+        case EPhoneIsCustomizedDialerVisible:
+            {
+            viewResponse = iDialerController->IsCustomizedDialerVisible() ?
+                EPhoneViewResponseSuccess :
+                EPhoneViewResponseFailed;
+            }
+            break;
+
+        case EPhoneViewHideCustomizedDialer:
+            {
+            iDialerController->HideCustomizedDialer();
+            viewResponse = EPhoneViewResponseSuccess;
+            }
+            break;
+        case EPhoneViewShowToolbar:
+            {
+            iToolbarController->ShowToolbar();
+            }
+            break;
+        default:
+            viewResponse = EPhoneViewResponseFailed;
+            __PHONELOG( EBasic, EPhonePhoneapp, "CPhoneViewController::HandleCommandL -> UnKnownMessage !!! ");
+            break;
+        }
+
+    return viewResponse;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::HandleCommand( aCmdId, aCommandParam )
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TPhoneViewResponseId CPhoneViewController::HandleCommandL(
+    TPhoneViewCommandId aCmdId,
+    TPhoneCommandParam* aCommandParam )
+    {
+    __PHONELOGVIEWMSG( aCmdId, 0 );
+    TPhoneViewResponseId viewResponse = EPhoneViewResponseSuccess;
+    TInt err;
+    
+    switch ( aCmdId )
+        {
+        case EPhoneViewSendKeyEventToNumberEntry:
+            {
+            // Pass the key event to the Bubble Manager (ignore key
+            // reponse)
+            iBubbleWrapper->HandleKeyEventL( aCommandParam );
+
+            // Indicate whether the number entry has been cleared
+            if ( iBubbleWrapper->CountNumberEntryCharacters() == 0 && !iDialer )
+                {
+                viewResponse = EPhoneViewResponseNumberEntryCleared;
+                }
+            else
+                {
+                viewResponse = EPhoneViewResponseSuccess;
+                }
+            break;
+            }
+
+        case EPhoneViewAssignSpeedDialLocation:
+            {
+            if ( AssignSpeedDialLocation( aCommandParam ) )
+                {
+                viewResponse = EPhoneViewResponseSuccess;
+                }
+            else
+                {
+                viewResponse = EPhoneViewResponseFailed;
+                }
+            break;
+            }
+
+        case EPhoneViewSelectedConfMember:
+            {
+            if ( iBubbleWrapper->SelectedConfMemberCallIdL( aCommandParam ) )
+                {
+                viewResponse = EPhoneViewResponseSuccess;
+                }
+            else
+                {
+                viewResponse = EPhoneViewResponseFailed;
+                }
+            break;
+            }
+
+        case EPhoneViewGetCallState:
+            {
+            if ( iBubbleWrapper->GetCallState( aCommandParam ) )
+                {
+                viewResponse = EPhoneViewResponseSuccess;
+                }
+            else
+                {
+                viewResponse = EPhoneViewResponseFailed;
+                }
+            break;
+            }
+
+        case EPhoneViewGetCallIdByState:
+            {
+            if ( iBubbleWrapper->GetCallIdByState( aCommandParam ) )
+                {
+                viewResponse = EPhoneViewResponseFailed;
+                }
+            else
+                {
+                viewResponse = EPhoneViewResponseSuccess;
+                }
+            break;
+            }
+
+        case EPhoneViewOpenSingleItemFetchDialog:
+            {
+            // Create CPhoneSingleItemFetch, if not exist
+            if ( !iSingleItemFetch )
+                {
+                iSingleItemFetch = CPhoneSingleItemFetch::NewL(
+                    iEikEnv, *this, *iContactController, *iStatusPane );
+                }
+
+            iBlockingDialogIsDisplayed = ETrue;
+
+            TRAP( err, iSingleItemFetch->OpenSingleItemFetchDialogL( aCommandParam ))
+            if ( err )
+                {
+                iBlockingDialogIsDisplayed = EFalse;
+                User::Leave( err );
+                }
+            break;
+            }
+
+        case EPhoneViewGetNumberFromSpeedDialLocation:
+            if ( iBlockingDialogIsDisplayed )
+                {
+                viewResponse = EPhoneViewResponseFailed;
+                }
+            else
+                {
+                TBool status;
+                TRAP( err, status = GetNumberFromSpeedDialLocationL( aCommandParam ))
+                if ( err )
+                    {
+                    viewResponse = EPhoneViewResponseFailed;
+                    // Set and reset in GetNumberFromSpeedDialLocationL when not leave
+                    iBlockingDialogIsDisplayed = EFalse;
+                    }
+                else if ( status )
+                    {
+                    viewResponse = EPhoneViewResponseSuccess;
+                    }
+                else
+                    {
+                    viewResponse = EPhoneViewResponseFailed;
+                    }
+                }
+            break;
+
+        case EPhoneViewGetCustomizedDialerMenuResourceId:
+            {
+            TInt resId = iDialerController->CustomizedMenuResourceId();
+            static_cast<TPhoneCmdParamInteger*>( aCommandParam )->SetInteger( resId );
+            viewResponse = EPhoneViewResponseSuccess;
+            }
+            break;
+        case EPhoneViewGetCustomizedDialerCbaResourceId:
+            {
+            TInt resId = iDialerController->CustomizedCbaResourceId();
+            static_cast<TPhoneCmdParamInteger*>( aCommandParam )->SetInteger( resId );
+            viewResponse = EPhoneViewResponseSuccess;
+            }
+            break;
+
+        default:
+            if ( iCustomization )
+                {
+                // Let customization handle view command
+                if ( iCustomization->HandleCommandL(
+                        *this, aCmdId, aCommandParam ) )
+                    {
+                    viewResponse = EPhoneViewResponseSuccess;
+                    }
+                else
+                    {
+                    viewResponse = EPhoneViewResponseFailed;
+                    }
+                }
+            else
+                {
+                __PHONELOG( EBasic, EPhonePhoneapp, "CPhoneViewController::HandleCommandL -> UnKnownMessage !!! ");
+                }
+            break;
+        }
+
+    return viewResponse;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::HandleTitlePaneActiveL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::HandleTitlePaneActiveL( TBool aActive )
+    {
+    if ( aActive )
+        {
+        iStatusPane->UpdateTitlePane();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::ApplicationWindowGroupId
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CPhoneViewController::ApplicationWindowGroupId()
+    {
+    TInt phoneAppWg = iEikEnv.RootWin().Identifier();
+    __PHONELOG1( EBasic, EPhoneUIView,
+      "CPhoneViewController::ApplicationWindowGroupId - PhoneApplicationWindowGroupId = (%d)",
+      phoneAppWg );
+    return phoneAppWg;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::IdleWindowGroupId
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CPhoneViewController::IdleWindowGroupId()
+    {
+    if ( !iIdleWg )
+        {
+        // Save Idle window group.
+        TApaTaskList appList( iEikEnv.WsSession() );
+        TApaTask bring = appList.FindApp( TUid::Uid( IdleAppUid() ) );
+        if ( bring.Exists() )
+            {
+            iIdleWg = bring.WgId();
+            __PHONELOG1( EBasic, EPhoneUIView,
+              "CPhoneViewController::ConstructL -> iIdleWindowGroupId = (%d)",
+              iIdleWg );
+            }
+        }
+
+    return iIdleWg;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::GetSoftRejectWindowGroupId
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::GetSoftRejectWindowGroupId(
+                                    TPhoneCommandParam* aCommandParam )
+    {
+    TInt softRejectWg( KErrNotFound );
+    TPhoneCmdParamInteger* integerParam =
+        static_cast<TPhoneCmdParamInteger*>( aCommandParam );
+
+    TApaTaskList appList( iEikEnv.WsSession() );
+    TApaTask bring = appList.FindApp( TUid::Uid( KSenduiUniEditorUidValue ) );
+    if ( bring.Exists() )
+        {
+        softRejectWg = bring.WgId();
+        __PHONELOG1( EBasic, EPhoneUIView,
+            "CPhoneViewController::SoftRejectWindowGroupId = (%d)",
+            softRejectWg );
+        }
+    integerParam->SetInteger( softRejectWg );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::ForegroundApplicationWindowGroupId
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CPhoneViewController::ForegroundApplicationWindowGroupId()
+    {
+    TInt result(0);
+    TRAP_IGNORE( result = DoFetchForegroundApplicationWindowGroupIdL(
+                          iEikEnv ) );
+    __PHONELOG1( EBasic,
+            EPhoneUIView,
+            "CPhoneViewController::ForegroundApplicationWindowGroupId() GroupId %d",
+            result );
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::DoFetchForegroundApplicationWindowGroupIdL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CPhoneViewController::DoFetchForegroundApplicationWindowGroupIdL(
+    CEikonEnv& aEnv )
+    {
+    TInt result = 0;
+
+    RWsSession& wsSession = aEnv.WsSession();
+
+    const TInt numWg =
+        wsSession.NumWindowGroups(
+            KPhoneApplicationWindowGroupPriority );
+
+    CArrayFixFlat<TInt>* wgList =
+        new (ELeave) CArrayFixFlat<TInt>( numWg );
+    CleanupStack::PushL( wgList );
+    wgList->SetReserveL( numWg );
+
+    // Get list of window groups; all applications should be at priority 0.
+    //
+    if ( wsSession.WindowGroupList(
+        KPhoneApplicationWindowGroupPriority,
+        wgList ) == KErrNone )
+        {
+        if ( wgList->Count() )
+            {
+            result = wgList->At( 0 ); // The very first window group id
+            }
+        }
+
+    CleanupStack::PopAndDestroy( wgList );
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SetHiddenL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneViewController::SetHiddenL( const TBool aHidden )
+    {
+    __PHONELOG( EBasic, EPhoneUIView,"CPhoneViewController::SetHiddenL()" )
+    CApaWindowGroupName* windowGroupName =
+        CApaWindowGroupName::NewLC(
+            iEikEnv.WsSession(),
+            iEikEnv.RootWin().Identifier() );
+    windowGroupName->SetHidden( aHidden );
+    User::LeaveIfError(
+        windowGroupName->SetWindowGroupName(
+            iEikEnv.RootWin() ) );
+    CleanupStack::PopAndDestroy( windowGroupName );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::HandleResourceChangeL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneViewController::HandleResourceChangeL( TInt aType )
+    {
+    __PHONELOG( EBasic, EPhoneUIView,
+                        "CPhoneViewController::HandleResourceChangeL()" )
+    // Notify the bubble that there has been a resource change
+    iBubbleWrapper->Control()->HandleResourceChange( aType );
+
+    // Notify dialer and switch statuspane layout.
+    if ( iDialer )
+        {
+        if ( aType == KEikDynamicLayoutVariantSwitch )
+            {
+            SwitchLayoutToFlatStatusPaneL( iDialerActive );
+            
+            if ( !iDialerActive && Layout_Meta_Data::IsLandscapeOrientation() )
+                {        
+                iDialerController->HideToolbar(); 
+                }
+            }
+        static_cast<CCoeControl*>(iDialer)->HandleResourceChange( aType );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::BlockingDialogIsDisplayed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CPhoneViewController::BlockingDialogIsDisplayed() const
+    {
+    return iBlockingDialogIsDisplayed;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::HandleLayoutChange
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneViewController::HandleLayoutChange( TRect aRect )
+    {
+    __PHONELOG( EBasic, EPhoneUIView,"CPhoneViewController::HandleLayoutChange()" )
+    iPhoneView->SetRect( aRect );
+    if ( iDialerView )
+	    {
+		iDialerView->SetRect( aRect );
+		iStatusPane->UpdateTitlePane();
+	    }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::StatusPaneDisplayed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CPhoneViewController::StatusPaneDisplayed()
+    {
+    return  CPhoneStatusPane::Instance()->IsVisible();
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::IdleAppUid
+// ---------------------------------------------------------------------------
+//
+TInt CPhoneViewController::IdleAppUid()
+    {
+    if ( iIdleUid == KErrNotFound )
+        {
+        // Get Idle's UID from PubSub.
+        iIdleUid = CPhonePubSubProxy::Instance()->Value(
+            KPSUidAiInformation,
+            KActiveIdleUid );
+
+        __PHONELOG1( EBasic, EPhoneUIView,
+            "CPhoneViewController::ConstructL -> iIdleUid = (%d)", iIdleUid );
+        }
+    return iIdleUid;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SetBlockingDialogIsDisplayed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneViewController::SetBlockingDialogIsDisplayed(
+        TBool aBlockingDialog )
+    {
+    iBlockingDialogIsDisplayed = aBlockingDialog;
+    __PHONELOG1( EBasic, EPhoneUIView,
+        "CPhoneViewController::SetBlockingDialogIsDisplayed(%d)",
+        iBlockingDialogIsDisplayed );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::GetBlockingDialogIsDisplayed
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::GetBlockingDialogIsDisplayed(
+    TPhoneCommandParam* aCommandParam )
+    {
+    if( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* booleanValue =
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+        booleanValue->SetBoolean( iBlockingDialogIsDisplayed );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::GetSecurityModeStatus
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::GetSecurityModeStatus(
+    TPhoneCommandParam* aCommandParam )
+    {
+    if( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdBoolean )
+        {
+        TPhoneCmdParamBoolean* booleanValue =
+            static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+        booleanValue->SetBoolean( iPhoneView->IsSecurityMode() );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SetNeedToSendToBackground
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::SetNeedToSendToBackground(
+    TPhoneCommandParam* aCommandParam )
+    {
+    TPhoneCmdParamBoolean* booleanParam = static_cast<TPhoneCmdParamBoolean*>(
+        aCommandParam );
+
+    iNeedToSendToBackground = booleanParam->Boolean();
+    __PHONELOG1( EBasic, EPhoneUIView,
+        "CPhoneViewController::SetNeedToSendToBackground(%d)",
+        iNeedToSendToBackground );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::NeedToSendToBackground
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneViewController::NeedToSendToBackground()
+    {
+    return iNeedToSendToBackground;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SendToBackgroundL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::SendToBackgroundL()
+    {
+    __PHONELOG( EBasic, EPhoneUIView,
+        "CPhoneViewController::SendToBackgroundL" );
+
+    TApaTaskList appList( iEikEnv.WsSession() );
+    TApaTask phoneApp = appList.FindApp( KUidPhoneApplication );
+    iSendBack = EFalse;
+
+    __PHONELOG1( EBasic, EPhoneUIView,
+        "CPhoneViewController::SendToBackgroundL - phoneApp.WgId() (%d)",  phoneApp.WgId() );
+
+    // no need for sending phone background if it is not front
+    if ( ( phoneApp.Exists() ) && phoneApp.WgId() ==
+            ForegroundApplicationWindowGroupId() )
+        {
+        // make sure that previous application window group id is not
+        //telephony's
+        if( iPrevForegroundAppWg > 0 &&
+            iPrevForegroundAppWg != phoneApp.WgId() )
+            {
+            // check that previous app still exists. It might be for example
+            // add to contact - dialog that is allready destroyed.
+            TInt previousApp = FindAppByWgIDL( iPrevForegroundAppWg );
+
+            if( previousApp != KErrNotFound )
+                {
+                __PHONELOG1( EBasic, EPhoneUIView,
+                 "CPhoneViewController::SendToBackgroundL - Bring previous app to foreground (%d)"
+                        ,  iPrevForegroundAppWg );
+
+                CAknSgcClient::MoveApp( iPrevForegroundAppWg, ESgcMoveAppToForeground );
+                iSendBack = ETrue;
+                SetWindowGroupPosition();
+                }
+            }
+        else
+            {
+            __PHONELOG( EBasic, EPhoneUIView,
+                "CPhoneViewController::SendToBackgroundL - send telephony to background" );
+
+            iSendBack = ETrue;
+            CAknSgcClient::MoveApp( phoneApp.WgId(),
+                                    ESgcMoveAppToBackground );
+            }
+        }
+
+    // Clear the send to background flag
+    iNeedToSendToBackground = EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::FindAppByWgIDL
+// ---------------------------------------------------------------------------
+//
+TInt CPhoneViewController::FindAppByWgIDL( TInt aAppWgID )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView,
+        "CPhoneViewController::FindAppByWgIDL() ")
+
+    TInt appExists( KErrNotFound );
+
+    RWsSession& wsSession = iEikEnv.WsSession();
+
+    const TInt numWg = wsSession.NumWindowGroups(
+            KPhoneApplicationWindowGroupPriority );
+
+    CArrayFixFlat<TInt>* wgList =
+        new (ELeave) CArrayFixFlat<TInt>( numWg );
+    CleanupStack::PushL( wgList );
+    wgList->SetReserveL( numWg );
+
+    // Get list of window groups; all applications should be at priority 0.
+    //
+    if ( wsSession.WindowGroupList(
+        KPhoneApplicationWindowGroupPriority,
+        wgList ) == KErrNone )
+        {
+        for( TInt i = 0; i < wgList->Count(); i++ )
+            {
+            if( aAppWgID == wgList->At( i ) )
+                {
+                appExists = i;
+                break;
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy( wgList );
+
+    return appExists;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SetWindowGroupPosition
+// This is used when dialer has opened some other
+// app(Logs) and MT call arrives, when MT call is
+// answered phone is put to backround and it isnt anymore next
+// active app which means that when previous app is opened
+// after answer and user presses exit we need to update
+// ordinal position so that dialer is activated.
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::SetWindowGroupPosition()
+    {
+    iEikEnv.WsSession().SetWindowGroupOrdinalPosition(
+        ApplicationWindowGroupId(),
+        KPhoneWindowGroupPositionBackground );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::BringAppToForeground
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::BringAppToForeground(
+    TPhoneCommandParam* aCommandParam )
+    {
+    TPhoneCmdParamInteger* integerParam =
+            static_cast<TPhoneCmdParamInteger*>( aCommandParam );
+
+   TApaTaskList appList( iEikEnv.WsSession() );
+   TApaTask application = appList.FindApp(
+                                   TUid::Uid( integerParam->Integer() ) );
+
+   __PHONELOG1( EBasic, EPhoneUIView,
+                 "CPhoneViewController::BringAppToForeground - App WG ID: %d",
+                 application.WgId() );
+   if( application.Exists() )
+       {
+       iPrevForegroundAppWg = ForegroundApplicationWindowGroupId();
+       CAknSgcClient::MoveApp( application.WgId(), ESgcMoveAppToForeground );
+       __PHONELOG1( EBasic, EPhoneUIView,
+                     "CPhoneViewController::BringAppToForeground - Previous App WG ID: %d",
+                     iPrevForegroundAppWg );
+       }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::BringPhoneAppToForeground
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::BringPhoneAppToForeground(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __PHONELOG( EBasic, EPhoneUIView,
+        "CPhoneViewController::BringPhoneAppToForeground()" );
+
+    TPhoneCmdParamInteger* integerParam =
+        static_cast<TPhoneCmdParamInteger*>( aCommandParam );
+
+    TApaTaskList appList( iEikEnv.WsSession() );
+    TApaTask phoneApp = appList.FindApp(
+                                    TUid::Uid( integerParam->Integer() ) );
+
+    // Saves previous window group id. Test if app is allready in front.
+    if( phoneApp.Exists() &&
+        ForegroundApplicationWindowGroupId() !=  phoneApp.WgId() )
+        {
+        iPrevForegroundAppWg = ForegroundApplicationWindowGroupId();
+        CAknSgcClient::MoveApp( phoneApp.WgId(), ESgcMoveAppToForeground );
+        __PHONELOG1( EBasic, EPhoneUIView,
+                      "CPhoneViewController::BringPhoneAppToForeground - Previous App WG ID: %d",
+                      iPrevForegroundAppWg );        
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SetTopApplicationL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::SetTopApplicationL(
+    TPhoneCommandParam* aCommandParam )
+    {
+    // Set the top application
+    TPhoneCmdParamInteger* integerParam =
+        static_cast<TPhoneCmdParamInteger*>( aCommandParam );
+    CPhonePubSubProxy::Instance()->ChangePropertyValue(
+        KPSUidUikon,
+        KUikVideoCallTopApp,
+        integerParam->Integer() );
+
+    // Hide the Phone icon if it is not the top application
+    SetHiddenL( integerParam->Integer() != KUidPhoneApplication.iUid );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::GetForegroundApplication
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::GetForegroundApplication(
+    TPhoneCommandParam* aCommandParam )
+    {
+    // Get the foreground application window group id
+    TPhoneCmdParamInteger* integerParam =
+        static_cast<TPhoneCmdParamInteger*>( aCommandParam );
+    integerParam->SetInteger( ForegroundApplicationWindowGroupId() );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::ActivateAppViewConventionalL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::ActivateAppViewConventionalL(
+    TPhoneCommandParam* aCommandParam )
+    {
+    TPhoneCmdParamAppInfo* appInfoParam =
+        static_cast<TPhoneCmdParamAppInfo*>( aCommandParam );
+
+    TApaTaskList taskList( iEikEnv.WsSession() );
+    TApaTask task = taskList.FindApp( appInfoParam->AppUid() );
+    if ( task.Exists() )
+        {
+        CAknSgcClient::MoveApp( task.WgId(), ESgcMoveAppToForeground );
+        }
+    else
+        {
+        CreateConnectionL();
+        HBufC* param = HBufC::NewLC( appInfoParam->Param().Length() );
+        param->Des().Copy( appInfoParam->Param() );
+        TThreadId id;
+        User::LeaveIfError(
+            iApaLsSession.StartDocument( *param,
+            appInfoParam->AppUid(), id ) );
+        CleanupStack::PopAndDestroy( param );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::ActivateAppL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::ActivateAppL(
+    TPhoneCommandParam* aCommandParam )
+    {
+    TPhoneCmdParamAppInfo* appInfoParam =
+        static_cast<TPhoneCmdParamAppInfo*>( aCommandParam );
+
+    __PHONELOG( EBasic, EPhoneUIView,"CPhoneViewController::ActivateAppL()" );
+
+    CreateConnectionL();
+
+    if ( appInfoParam->MultipleInstances() )
+        {
+        ActivateAppInstanceL( appInfoParam->AppUid() );
+        }
+    else
+        {
+        TApaTaskList apaTaskList( iEikEnv.WsSession() );
+        TApaTask apaTask = apaTaskList.FindApp( appInfoParam->AppUid() );
+        if ( apaTask.Exists() )
+            {
+            __PHONELOG( EBasic, EPhoneUIView,
+                "CPhoneViewController::ActivateAppL() bring to foreground" );
+            CAknSgcClient::MoveApp( apaTask.WgId(), ESgcMoveAppToForeground );
+            }
+        else
+            {
+            ActivateAppInstanceL( appInfoParam->AppUid() );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::ActivateAppInstanceL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::ActivateAppInstanceL( TUid aUid )
+    {
+    __PHONELOG( EBasic, EPhoneUIView,
+        "CPhoneViewController::ActivateAppInstanceL()" );
+    CreateConnectionL();
+
+    TApaAppInfo appInfo;
+    User::LeaveIfError( iApaLsSession.GetAppInfo( appInfo, aUid ) );
+
+#ifdef SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1
+    CApaCommandLine* apaCommandLine = CApaCommandLine::NewLC(
+        appInfo.iFullName );
+#else
+    CApaCommandLine* apaCommandLine = CApaCommandLine::NewLC();
+    apaCommandLine->SetExecutableNameL( appInfo.iFullName );
+    apaCommandLine->SetCommandL( EApaCommandRun );
+#endif // SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1
+
+    User::LeaveIfError ( iApaLsSession.StartApp( *apaCommandLine ) );
+    CleanupStack::PopAndDestroy( apaCommandLine );
+    __PHONELOG( EBasic, EPhoneUIView,
+        "CPhoneViewController::ActivateAppInstanceL() done" );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::ActivateAppViewL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::ActivateAppViewL(
+    TPhoneCommandParam* aCommandParam )
+    {
+    TPhoneCmdParamAppInfo* appInfoParam =
+        static_cast<TPhoneCmdParamAppInfo*>( aCommandParam );
+
+    __PHONELOG( EBasic, EPhoneUIView,
+                "CPhoneViewController::ActivateAppViewL()" );
+
+    TVwsViewId view( appInfoParam->AppUid(), appInfoParam->ViewUid() );
+    iEikEnv.EikAppUi()->ActivateViewL( view );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::ActivateAppViewL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::ActivateAppViewWithCustomMessageL(
+    TPhoneCommandParam* aCommandParam )
+    {
+    TPhoneCmdParamAppInfo* appInfoParam =
+        static_cast<TPhoneCmdParamAppInfo*>( aCommandParam );
+
+    __PHONELOG( EBasic, EPhoneUIView,
+        "CPhoneViewController::ActivateAppViewWithCustomMessageL()" );
+
+    TVwsViewId view( appInfoParam->AppUid(), appInfoParam->ViewUid() );
+    iEikEnv.EikAppUi()->ActivateViewL(
+        view,
+        appInfoParam->CustomMessageId(),
+        appInfoParam->CustomMessage() );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::CreateConnectionL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::CreateConnectionL()
+    {
+    if ( !iApaLsSession.Handle() )
+        {
+        User::LeaveIfError( iApaLsSession.Connect() );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::LaunchApplicationL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::LaunchApplicationL()
+    {
+    //long 0 launches application defined in KTelAppLaunch key.
+    TInt appId(0);
+    TUid appUid;
+    User::LeaveIfError( CPhoneCenRepProxy::Instance()->GetInt(
+        KCRUidTelPrivateVariation,
+        KTelAppLaunch,
+        appId ) );
+    appUid.iUid = appId;
+
+    __PHONELOG1( EBasic, EPhoneUIView,
+        "CPhoneViewController::LaunchApplicationL appId: %d",
+        appId );
+
+    HBufC* params = HBufC::NewLC( KPhoneMaxParamLength );
+    TPtr ptr = params->Des();
+    User::LeaveIfError( CPhoneCenRepProxy::Instance()->GetString(
+        KCRUidTelPrivateVariation,
+        KTelAppLaunchParam,
+        ptr ) );
+
+    TApaTaskList taskList( iEikEnv.WsSession() );
+    TApaTask task = taskList.FindApp( appUid );
+    if ( task.Exists() )
+        {
+        // Uid is not used.
+        HBufC8* param = CnvUtfConverter::ConvertFromUnicodeToUtf8L( *params );
+        User::LeaveIfError( task.SendMessage( TUid::Uid( 0 ), *param ) );
+        delete param;
+        }
+    else
+        {
+        CreateConnectionL();
+        TThreadId thread;
+        User::LeaveIfError(
+            iApaLsSession.StartDocument(
+                *params,
+                appUid,
+                thread ) );
+        }
+    CleanupStack::PopAndDestroy( params ); // params
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::LaunchHelpApplicationL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::LaunchHelpApplicationL(
+    const TDesC& aHelpCommand )
+    {
+    // Save the help command
+    iHelpCommand.Set( aHelpCommand );
+
+    // Activate Help application
+    HlpLauncher::LaunchHelpApplicationL(
+       CCoeEnv::Static()->WsSession(),
+       iEikEnv.EikAppUi()->AppHelpContextL() );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::HelpContext
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TDesC& CPhoneViewController::HelpContext()
+    {
+    return iHelpCommand;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SetCbaL
+// Set the CBA to the specified setting
+// (other items were commented in a header).
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::SetCbaL( TPhoneCommandParam* aCommandParam )
+    {
+    TPhoneCmdParamInteger* cbaResource =
+        static_cast<TPhoneCmdParamInteger*>( aCommandParam );
+
+    TInt resourceId = cbaResource->Integer();
+
+    iCba->SetCommandSetL( resourceId );
+    iCba->DrawDeferred();
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SetEikonNotifiersDisabled
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::SetEikonNotifiersDisabled(
+    TPhoneCommandParam* aCommandParam )
+    {
+    TPhoneCmdParamBoolean* booleanParam =
+        static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+    if ( booleanParam->Boolean() )
+        {
+        if ( !iPriotityChanged )
+            {
+            //Store current ordinal priority.
+            iPrevious = CEikonEnv::Static()->RootWin().OrdinalPriority();
+            iPriotityChanged = ETrue;
+            //Rise window priority in order to get phoneview on top of eikon
+            //notifiers. e.g. Select USB mode notifier is the one which using
+            //eikon notiers.
+            CEikonEnv::Static()->RootWin().SetOrdinalPosition(
+                    0,
+                    ECoeWinPriorityAlwaysAtFront-1 );
+            __PHONELOG( EBasic, EPhoneUIView,
+            "CPhoneViewController::SetEikonNotifiersDisabled()_priority_rise" );
+            }
+        }
+    // enable notifiers, sametime reset previous rootwin priority
+    else if ( iPriotityChanged )
+        {
+        TInt ordinalPos = CEikonEnv::Static()->RootWin().OrdinalPosition();
+        CEikonEnv::Static()->RootWin().SetOrdinalPosition(
+                ordinalPos,
+                iPrevious );
+        iPriotityChanged = EFalse;
+        __PHONELOG( EBasic, EPhoneUIView,
+        "CPhoneViewController::SetEikonNotifiersDisabled()_priority_reset" );
+        }
+    __PHONELOG1( EBasic, EPhoneUIView,
+        "CPhoneViewController::SetEikonNotifiersDisabled(%d)",
+        booleanParam->Boolean() );
+    }
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SetGlobalNotifiersDisabledL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::SetGlobalNotifiersDisabledL(
+    TPhoneCommandParam* aCommandParam )
+    {
+    TPhoneCmdParamBoolean* booleanParam =
+        static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+    // Global note always removed if exists when notifiers disabled
+    if ( booleanParam->Boolean() )
+        {
+        ExecuteCommandL( EPhoneViewRemoveGlobalNote );
+        }
+    iKeyLock.EnableSoftNotifications( !booleanParam->Boolean() );
+    __PHONELOG1( EBasic, EPhoneUIView,
+        "CPhoneViewController::SetGlobalNotifiersDisabledL(%d)",
+        booleanParam->Boolean() );
+    }
+
+// ---------------------------------------------------------
+// CPhoneViewController::IsKeyLockEnabled
+// ---------------------------------------------------------
+//
+TBool CPhoneViewController::IsKeyLockEnabled()
+    {
+    TBool keylock;
+    keylock = iKeyLock.IsKeyLockEnabled();
+    __PHONELOG1( EBasic, EPhoneUIView,
+        "CPhoneViewController::IsKeyLockEnabled(%d)", keylock );
+    return keylock;
+    }
+
+// ---------------------------------------------------------
+// CPhoneViewController::DisableKeyLock
+// ---------------------------------------------------------
+//
+void CPhoneViewController::DisableKeyLock()
+    {
+    __PHONELOG( EBasic, EPhoneUIView,
+        "CPhoneViewController::DisableKeyLock()");
+    return iKeyLock.DisableWithoutNote();
+    }
+
+// CPhoneViewController::CancelAllNotications
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::CancelAllNotications()
+    {
+    iKeyLock.CancelAllNotifications();
+    __PHONELOG( EBasic, EPhoneUIView,
+        "CPhoneViewController::CancelAllNotications()");
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::HandleUpdateBubbleL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::HandleUpdateBubbleL(
+    TInt aCallId,
+    TPhoneCommandParam* aCommandParam )
+    {
+     // Check is the given parameter valid
+    if ( aCommandParam->ParamId() ==
+        TPhoneCommandParam::EPhoneParamIdCallHeaderData )
+        {
+        __PHONELOG( EBasic, EPhoneUIView,
+            "CPhoneViewController::HandleUpdateBubble()" );
+
+        TPhoneCmdParamCallHeaderData* callHeaderParam =
+            static_cast<TPhoneCmdParamCallHeaderData*>( aCommandParam );
+        iBubbleWrapper->PrepareCallStateL(
+            aCallId,
+            callHeaderParam->CallState(),
+            callHeaderParam->LabelText(),
+            callHeaderParam->ShortLabelText() );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SoftRejectIsEnabled
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneViewController::SoftRejectIsEnabled() const
+    {
+    // Check if phone is locked
+    const TBool phoneIsLocked =
+        CPhonePubSubProxy::Instance()->Value(
+        KPSUidCoreApplicationUIs,
+        KCoreAppUIsAutolockStatus ) > EAutolockOff;
+
+    if ( phoneIsLocked || IsSecurityCodeQuery() )
+        {
+        // Soft Reject is enabled if the phone is not locked. 
+		// Security Code query is checked because in the boot
+		// autolock status value is OFF even when it's actually
+		// ON so we need to do this double checking.
+        return EFalse;
+        }
+    return ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::IsSecurityCodeQuery
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneViewController::IsSecurityCodeQuery() const
+  {
+  return CPhonePubSubProxy::Instance()->Value(
+    KPSUidStartup,
+    KStartupSecurityCodeQueryStatus ) == ESecurityQueryActive;
+  }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::GetNumberFromSpeedDialLocationL
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneViewController::GetNumberFromSpeedDialLocationL(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView,
+        "CPhoneViewController::GetNumberFromSpeedDialLocationL() ");
+    TPhoneCmdParamSpeedDial* speedDialContent =
+        static_cast<TPhoneCmdParamSpeedDial*>( aCommandParam );
+    TBool retValue( ETrue );
+
+    if ( speedDialContent->Location() != KErrNotFound )
+        {
+        TBuf<KPhoneNumberEntryBufferSize> speedDialNumber;
+        speedDialNumber.Zero(); // empty the string
+
+        // Indicate that the speed dial controller is blocking key
+        // events from the Phone
+        iBlockingDialogIsDisplayed = ETrue;
+
+        CreateSpeedDialControllerL();
+
+        TInt err = iVmbxHandler->GetStraightSpeedDialNumber(
+                        speedDialContent->Location(),
+                        speedDialNumber );
+
+        // Straight number founded
+        if ( err == KErrNone && speedDialNumber.Length() != 0)
+            {
+            if ( iVmbxHandler->GetMailboxType() == EVmbxVideo )
+                {
+                speedDialContent->SetNumberType( EPhoneNumberTypeVideo );
+                }
+            else
+                {
+                speedDialContent->SetNumberType( EPhoneNumberTypeCS );
+                }
+            }
+        else if ( iVmbxHandler->IsStraightCallToVideoMailBox() &&
+              ( speedDialContent->Location() == KPhoneVideoMbxLocation ||
+              speedDialContent->Location() == KPhoneVoiceMailBoxLocation ))
+            {
+            // Mbx number field of given type was empty and assigning cancelled
+            retValue = EFalse;
+            }
+
+        else if ( speedDialContent->Location() == KPhoneVoiceMailBoxLocation )
+            {
+            // Get the voice mail box type and service ID
+            TUint serviceId( 0 );
+            TInt mailboxType = iVmbxHandler->SelectMailboxTypeL( serviceId );
+            speedDialContent->SetServiceId( serviceId );
+
+            // Get the voice mail box number
+            if ( mailboxType == EVmbxNone )
+              {
+              // Nothing selected from the mailbox selection
+              retValue = EFalse;
+              }
+            else if ( iVmbxHandler->LaunchMbx( mailboxType, speedDialNumber )
+                      == KErrNone )
+                {
+                if ( mailboxType == EVmbxVideo )
+                    {
+                    speedDialContent->SetNumberType( EPhoneNumberTypeVideo );
+                    }
+                else if ( mailboxType == EVmbxIP )
+                    {
+                    speedDialContent->SetNumberType( EPhoneNumberTypeVoip );
+                    }
+                else
+                    {
+                    speedDialContent->SetNumberType( EPhoneNumberTypeCS );
+                    }
+                }
+            else
+              {
+              // Mbx number field of given type was empty and assigning cancelled
+              retValue = EFalse;
+              }
+            }
+        else
+            {
+            // Get the number from the speed dial location
+            iSpeedDialController->GetSpeedDialFieldL(
+                speedDialContent->Location(), speedDialNumber );
+            if (speedDialNumber.Length() == 0 )
+                {
+                AssignSpeedDialLocationL( speedDialContent->Location() );
+                // Get the number from the speed dial location
+                iSpeedDialController->GetSpeedDialFieldL(
+                    speedDialContent->Location(), speedDialNumber );
+                }
+
+            // If assigned
+            if ( speedDialNumber.Length() )
+                {
+                speedDialContent->SetNumberType(
+                    SpeedDialNumberTypeL( speedDialContent->Location() ) );
+                }
+            else
+                {
+                retValue = EFalse;
+                }
+            }
+
+        // Reset the flag
+        iBlockingDialogIsDisplayed = EFalse;
+
+        TPtr* phoneNumber = speedDialContent->PhoneNumber();
+        phoneNumber->Append( speedDialNumber );
+
+        }
+    return retValue;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SpeedDialNumberTypeL
+// ---------------------------------------------------------------------------
+//
+TPhoneNumberType CPhoneViewController::SpeedDialNumberTypeL(
+        TInt aSpeedDialLocation )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView,
+            "CPhoneViewController::SpeedDialNumberTypeL() ");
+    CPhCntSpeedDialMonitor::TSpdDialFieldInfo fieldInfo;
+
+    TBuf<KPhoneNumberEntryBufferSize> number;
+    TContactItemId itemId = iSpeedDialController->GetSpeedDialFieldL( 
+                                aSpeedDialLocation, 
+                                number,
+                                fieldInfo );
+
+    __PHONELOG1( EBasic, EPhoneUIView,
+        "CPhoneViewController::SpeedDialNumberTypeL - itemId = %d ", itemId );
+
+    return ConvertNumberTypeFromSpeedDialFieldInfo( fieldInfo );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::ConvertNumberTypeFromSpeedDialFieldInfo
+// ---------------------------------------------------------------------------
+//
+TPhoneNumberType CPhoneViewController::ConvertNumberTypeFromSpeedDialFieldInfo(
+    CPhCntSpeedDialMonitor::TSpdDialFieldInfo aFieldInfo )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView,
+        "CPhoneViewController::ConvertNumberTypeFromSpeedDialFieldInfo() ");
+    TPhoneNumberType retValue;
+    switch( aFieldInfo.iNumberType )
+        {
+        case MPhCntMatch::EVideoNumber:
+            retValue =  EPhoneNumberTypeVideo;
+            break;
+        case MPhCntMatch::EVoipNumber:
+            retValue =  EPhoneNumberTypeVoip;
+            break;
+        case KErrNotFound:
+            retValue = EPhoneNumberTypeNotFound;
+            break;
+        default:
+            retValue = EPhoneNumberTypeCS;
+            break;
+        }
+    __PHONELOG1( EBasic, EPhoneUIView,
+        "CPhoneViewController::ConvertNumberTypeFromSpeedDialFieldInfo - number type = %d ",
+        retValue );
+
+    return retValue;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::AssignSpeedDialLocation
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneViewController::AssignSpeedDialLocation(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneViewController::AssignSpeedDialLocation( ) ")
+
+    TPhoneCmdParamInteger* locationParam =
+        static_cast<TPhoneCmdParamInteger*>( aCommandParam );
+
+    // Indicate that the contact operation is blocking key
+    // events from the Phone
+    iBlockingDialogIsDisplayed = ETrue;
+    TBool numberAssigned;
+    TRAPD( err,
+        numberAssigned = AssignSpeedDialLocationL(
+        locationParam->Integer()))
+
+    // Reset the flag
+    iBlockingDialogIsDisplayed = EFalse;
+
+    return err ? EFalse : numberAssigned;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::AssignSpeedDialLocationL
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneViewController::AssignSpeedDialLocationL(
+    TInt aLocation )
+    {
+  CreateSpeedDialControllerL();
+
+    // Assign speed dial location
+    TBuf<KPhoneNumberEntryBufferSize> number;
+
+    const TBool numberAssigned =
+        iSpeedDialController->AssignSpeedDialFieldL( aLocation, number );
+
+    return numberAssigned;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::OpenMessageEditorL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::OpenMessageEditorL(
+    TPhoneCommandParam* aCommandParam )
+    {
+    TPhoneCmdParamMessageEditor* messageEditorParam =
+        static_cast<TPhoneCmdParamMessageEditor*>( aCommandParam );
+
+    //Launch message editor standalone
+    TUid mtmUid = { KSenduiMtmUniMessageUidValue };
+
+    CSendUi* messageEditor = CSendUi::NewL();
+  CleanupStack::PushL( messageEditor );
+
+    // Inform the SendUi to open the message editor. This is not a blocking
+    // dialog so the flag does not need to be set.
+    messageEditor->CreateAndSendMessageL(
+        mtmUid,
+        messageEditorParam->MessageData(),
+        KNullUid,
+        EFalse );
+
+    CleanupStack::PopAndDestroy( messageEditor );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::OpenContactL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::OpenAddToContactL(
+    TInt aCommand,
+    const TDesC& aString )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneViewController::OpenAddToContactL( ) ")
+
+    TPhoneCmdParamString phoneNumberString;
+
+    HBufC *phoneNumber = HBufC::NewL( KPhoneNumberEntryBufferSize );
+
+    if ( KErrNone == aString.Compare( KNullDesC ) )
+        {
+        // get the number entry contents
+        TPtr ptr( phoneNumber->Des() );
+        phoneNumberString.SetString( &ptr );
+        iBubbleWrapper->GetNumberEntryContent( &phoneNumberString );
+        }
+    else
+        {
+        phoneNumber->Des().Copy( aString );
+        }
+
+    // Indicate that the contact operation is blocking key
+    // events from the Phone
+    iBlockingDialogIsDisplayed = ETrue;
+
+    TRAPD( err,
+        {
+        // Create the contact dialog
+        iContactSaveAddToName = iContactController->CreateSaveAddToNameL();
+
+        // The contact operation may be cancelled if the END key
+        // is pressed. If so, the blocking dialog will be removed.
+        if ( iBlockingDialogIsDisplayed )
+            {
+            // Inform the Contact to open the contacts
+            iContactSaveAddToName->HandlePbkOperationL(
+                *phoneNumber, // TelNum
+                aCommand );//CreateNew/Update
+            }
+        }) //TRAPD
+
+    RemoveAddToContactDialog();
+    delete phoneNumber;
+
+    // Reset the flag
+    iBlockingDialogIsDisplayed = EFalse;
+
+    User::LeaveIfError( err );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::RemovePhoneDialogsL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::RemovePhoneDialogsL()
+    {
+    __PHONELOG( EBasic, EPhoneUIView,
+        "CPhoneViewController::RemovePhoneDialogsL()" );
+    // Remove the note, if necessary
+    iNoteController->DestroyNote();
+
+    // Remove the query, if necessary.
+    // Global query not allowed to destroy in this phase.
+    iQueryController->DestroyQuery();
+
+    // Remove contact dialog.
+    RemoveAddToContactDialog();
+
+    // Dismiss queries from customization, if necessary
+   if ( iCustomization )
+        {
+        iCustomization->RemoveDialog();
+        }
+
+    // Remove speeddial dialogs.
+    if ( iSpeedDialController )
+        {
+        iSpeedDialController->Cancel();
+        }
+
+    if ( iSingleItemFetch )
+        {
+        // Cancel the Single Item Fetch
+        iSingleItemFetch->Delete();
+        }
+
+    if ( iVmbxHandler )
+        {
+        iVmbxHandler->CancelVmbx();
+        }
+
+    if ( iRfsHandler )
+        {
+        __PHONELOG( EBasic, EPhoneUIView,
+            "CPhoneViewController::RemovePhoneDialogsL() CPhCntRfsHandler::ERfsCmdCancel" );
+        iRfsHandler->ProcessCommandL( CPhCntRfsHandler::ERfsCmdCancel );
+        delete iRfsHandler;
+        iRfsHandler = NULL;
+        }
+
+    // Remove all blocking dialogs
+    if ( iBlockingDialogIsDisplayed )
+        {
+        // Reset the flag
+        iBlockingDialogIsDisplayed = EFalse;
+
+        __PHONELOG( EBasic, EPhoneUIView,
+            "CPhoneViewController::RemovePhoneDialogsL() AknDialogShutter::ShutDialogsL" );
+
+        TRAP_IGNORE(
+            AknDialogShutter::ShutDialogsL( iEikEnv ) );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::RemoveAddToContactDialog
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::RemoveAddToContactDialog()
+    {
+    if ( iContactSaveAddToName )
+        {
+        delete iContactSaveAddToName;
+        iContactSaveAddToName = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::DoConstructContactControllerL
+//
+// Callback function.
+// ---------------------------------------------------------------------------
+//
+TInt CPhoneViewController::DoConstructContactControllerL( TAny* aAny )
+    {
+    CPhoneViewController* viewController =
+        static_cast< CPhoneViewController* >( aAny );
+
+    return viewController->iContactController->ContinueConstructL();
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::UpdateAudioPathOptions
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::UpdateAudioPathOptions(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __PHONELOG( EBasic, EPhoneUIView,
+        "CPhoneViewController::UpdateAudioPathOptions()" );
+    TPhoneCmdParamBoolean ihfParam;
+    TPhoneCmdParamBoolean wiredParam;
+    TPhoneCmdParamBoolean btaaParam;
+
+    TPhoneCmdParamAudioOutput* outputParam =
+        static_cast<TPhoneCmdParamAudioOutput*>( aCommandParam );
+
+    ihfParam.SetBoolean(
+        outputParam->AudioOutput() == EPELoudspeaker );
+    wiredParam.SetBoolean(
+       ( outputParam->AudioOutput() == EPEWiredAudioAccessory ) ||
+       ( outputParam->AudioOutput() == EPETTY ) );
+
+    btaaParam.SetBoolean(
+        outputParam->AudioOutput() == EPEBTAudioAccessory );
+
+    // Wired options
+    iMenuController->SetWiredAccFlag( &wiredParam );
+
+    iMenuController->SetIhfFlag( &ihfParam );
+    iToolbarController->SetIhfFlag( &ihfParam );
+
+    // btaa menu options
+    iMenuController->SetBTAccFlag( &btaaParam );
+
+    iAudioController->HandleIhfChange( &ihfParam );
+
+    if ( iButtonsController )
+        {
+        iButtonsController->SetIhfFlag( &ihfParam );
+        iButtonsController->SetWiredAccFlag( &wiredParam );
+        iButtonsController->SetBTAccFlag( &btaaParam );
+        iButtonsController->ReplaceAudioButton();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::UpdateAudioAvailabilityOptions
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::UpdateAudioAvailabilityOptions(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __PHONELOG( EBasic, EPhoneUIView,
+        "CPhoneViewController::UpdateAudioAvailabilityOptions()" );
+
+    TPhoneCmdParamBoolean wiredAvailableParam;
+    TPhoneCmdParamBoolean btAvailableParam;
+
+    TPhoneCmdParamAudioAvailability* outputParam =
+        static_cast<TPhoneCmdParamAudioAvailability*>( aCommandParam );
+
+    wiredAvailableParam.SetBoolean(
+        outputParam->IsWiredAccAvailable() );
+
+    btAvailableParam.SetBoolean(
+        outputParam->IsBTAccAvailable());
+
+    // Wired options
+    iMenuController->SetWiredAccAvailableFlag( &wiredAvailableParam );
+
+    // btaa menu options
+    iMenuController->SetBTAccAvailableFlag( &btAvailableParam );
+
+    if ( iButtonsController )
+        {
+        iButtonsController->SetBTAccAvailableFlag( &btAvailableParam );
+        iButtonsController->ReplaceAudioButton();
+        }
+
+    __PHONELOG2(
+        EBasic,
+        EPhoneUIView,
+        "CPhoneViewController::UpdateAudioAvailabilityOptions( BT: (%d), Wired: (%d) ) )",
+        btAvailableParam.Boolean(),
+        wiredAvailableParam.Boolean() );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::LaunchRfsL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::LaunchRfsL( TBool aDeepRfs )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView,
+        "CPhoneViewController::LaunchRfsL()" );
+    CPhCntRfsHandler::TRfsCommand command;
+    if ( !iRfsHandler )
+        {
+        iRfsHandler = iContactController->CreateRfsHandlerL();
+        }
+
+    if( aDeepRfs )
+        {
+        command = CPhCntRfsHandler::ERfsCmdActivateDeep;
+        }
+    else
+        {
+        command = CPhCntRfsHandler::ERfsCmdActivateNormal;
+        }
+
+    // Indicate that the rfs dialog is blocking key
+    // events from the Phone
+    iBlockingDialogIsDisplayed = ETrue;
+
+    TRAPD( err,
+        {
+        if ( iDialer )
+            {
+            ExecuteCommandL( EPhoneViewClearNumberEntryContent );
+            }
+        else
+            {
+            // Remove number entry
+            ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+            }
+
+        iRfsHandler->ProcessCommandL( command );
+        })
+    delete iRfsHandler;
+    iRfsHandler = NULL;
+
+    iBlockingDialogIsDisplayed = EFalse;
+    User::LeaveIfError( err );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::OpenSoftRejectMessageEditorL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::OpenSoftRejectMessageEditorL(
+    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView,
+        "CPhoneViewController::OpenSoftRejectMessageEditorL ()" );
+
+    TPhoneCmdParamSfiData* sfiParam =
+        static_cast<TPhoneCmdParamSfiData*>( aCommandParam );
+
+    CMessageData* messageData = CMessageData::NewL();
+    CleanupStack::PushL( messageData );
+
+    // Get message body
+    HBufC* softRejectTxt = HBufC::NewLC( KPhoneSMSLength );
+    TPtr string( softRejectTxt->Des() );
+
+    TInt softRejectDefaultInUseValue = 0;
+    const TInt err = CPhoneCenRepProxy::Instance()->GetInt(
+        KCRUidTelephonySettings,
+        KSettingsSoftRejectDefaultInUse,
+        softRejectDefaultInUseValue );
+
+    if ( err == KErrNone && softRejectDefaultInUseValue )
+        {
+        // Default txt used or not
+        CPhoneCenRepProxy::Instance()->GetString(
+            KCRUidTelephonySettings,
+            KSettingsSoftRejectText,
+            string );
+        }
+    else
+        {
+
+        TParse fp;
+        fp.Set( KPhoneSoftRejectResource, &KDC_RESOURCE_FILES_DIR, NULL );
+        TFileName name( fp.FullName() );
+        // Open soft reject resource file
+        RConeResourceLoader coneResourceLoader( iEikEnv );
+        TInt softRejectResourceError = coneResourceLoader.Open( name );
+        if ( softRejectResourceError != KErrNone )
+            {
+            // Indicate that the soft reject feature cannot be enabled
+            Panic( EPhoneViewErrorInAddingResourceFile );
+            }
+
+        CleanupStack::PopAndDestroy( softRejectTxt );
+        softRejectTxt = StringLoader::LoadLC( R_SOFT_REJECT_DEFAULT_TXT );
+        string.Set( softRejectTxt->Des() );
+        coneResourceLoader.Close();
+        }
+
+    CRichText* text = CRichText::NewL(
+        iEikEnv.SystemParaFormatLayerL(),
+        iEikEnv.SystemCharFormatLayerL());
+    CleanupStack::PushL( text );
+    text->Reset();
+    text->InsertL( 0, string );
+
+    // Set body text
+    messageData->SetBodyTextL( text );
+
+    // store the remote caller's info
+    if ( sfiParam->Name().Length() )
+        {
+        // store both the name and the number
+        messageData->AppendToAddressL(
+            sfiParam->Number(), sfiParam->Name() );
+        }
+    else
+        {
+        // store the number
+        messageData->AppendToAddressL(
+            sfiParam->Number() );
+        }
+
+    // Inform SysAp not to re-activate keyguard even if the call ends.
+    CPhonePubSubProxy::Instance()->ChangePropertyValue(
+        KPSUidCoreApplicationUIs,
+        KCoreAppUIsSoftReject,
+        ECoreAppUIsSoftReject );
+
+    // Launch the Soft Reject message Editor.
+    TPhoneCmdParamMessageEditor messageEditorParam;
+    messageEditorParam.SetMessageData( messageData );
+    OpenMessageEditorL( &messageEditorParam );
+
+    CleanupStack::PopAndDestroy( text );
+    CleanupStack::PopAndDestroy( softRejectTxt );
+    CleanupStack::PopAndDestroy( messageData );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SendMessageL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::SendMessageL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView,
+        "CPhoneViewController::SendMessageL()" );
+    // get the number entry contents
+    HBufC *phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize );
+    TPtr ptr( phoneNumber->Des() );
+    TPhoneCmdParamString stringParam;
+    stringParam.SetString( &ptr );
+    iBubbleWrapper->GetNumberEntryContent( &stringParam );
+
+    // Launch the message Editor.
+    TPhoneCmdParamMessageEditor messageEditorParam;
+
+    // create the message data
+    CMessageData* messageData = CMessageData::NewLC();
+    messageData->AppendToAddressL( ptr );
+    messageEditorParam.SetMessageData( messageData );
+
+    if ( !iDialer )
+        {
+        // Remove number entry from screen
+        iPhoneView->SetControl( iBubbleWrapper->Control() );
+        ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        }
+
+    // Open the message editor
+    OpenMessageEditorL( &messageEditorParam );
+
+    CleanupStack::PopAndDestroy( messageData );
+    CleanupStack::PopAndDestroy( phoneNumber );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SetSecurityMode
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::SetSecurityMode(
+                                        TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView,
+        "CPhoneViewController::SetSecurityMode()" );
+    TPhoneCmdParamBoolean* booleanParam = static_cast<TPhoneCmdParamBoolean*>(
+        aCommandParam );
+    iPhoneView->SetSecurityMode( booleanParam->Boolean() );
+    iStatusPane->StatusPane().MakeVisible( !booleanParam->Boolean() );
+    }
+
+// -----------------------------------------------------------
+// CPhoneViewController::SetStatusPaneVisible
+// -----------------------------------------------------------
+//
+void CPhoneViewController::SetStatusPaneVisible(
+                                        TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView,
+        "CPhoneViewController::SetStatusPaneVisible()" );
+    TPhoneCmdParamBoolean* booleanParam = static_cast<TPhoneCmdParamBoolean*>(
+        aCommandParam );
+    iStatusPane->StatusPane().MakeVisible( booleanParam->Boolean() );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::UpdateFSW()
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::UpdateFSW()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneViewController::UpdateFSW()" );
+    iAknUiServerClient->UpdateTaskList();
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::CreateSpeedDialControllerL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::CreateSpeedDialControllerL()
+  {
+    __LOGMETHODSTARTEND( EPhoneUIView,
+        "CPhoneViewController::CreateSpeedDialControllerL()" );
+  if( !iSpeedDialController )
+        {
+        iSpeedDialController = iContactController->CreateSpeedDialMonitorL();
+        }
+
+    if( !iVmbxHandler )
+        {
+        iVmbxHandler = CPhoneVmbxHandler::NewL();
+        }
+  }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::IsReplaceAllowed()
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneViewController::IsReplaceAllowed()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView,
+                         "CPhoneViewController::IsReplaceAllowed()");
+
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateConnected );
+    iBubbleWrapper->GetCallIdByState( &callStateData );
+    TInt connected = callStateData.CallId();
+
+    callStateData.SetCallState( EPEStateRinging );
+    iBubbleWrapper->GetCallIdByState( &callStateData );
+    TInt waiting = callStateData.CallId();
+
+    return // both video or
+        (( connected == KVideoTelephonyCallId1 ||
+           connected == KVideoTelephonyCallId2 ) &&
+
+         ( waiting == KVideoTelephonyCallId1 ||
+           waiting == KVideoTelephonyCallId2 )) ||
+
+           // both voice ( including active conference )
+        ((( connected >= KVoiceCallIdFirst &&
+            connected < KEmergencyCallId ) ||
+            connected == KConferenceCallId ) &&
+
+         ( waiting >= KVoiceCallIdFirst &&
+           waiting < KEmergencyCallId ));
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SingleItemFetchL()
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::SingleItemFetchL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView,
+        "CPhoneViewController::SingleItemFetchL()" );
+
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger( EPhoneNewCallFetchTitle );
+
+    // Make sure the dialog is not ended prematurely
+    HandleCommandL(
+        EPhoneViewOpenSingleItemFetchDialog,
+        &integerParam );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SetFetchContent
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::SetFetchContent( TDesC& aFetchContent )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView,
+        "CPhoneViewController::SetFetchContent()" );
+    iFetchContent = aFetchContent;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::FetchContent
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TDesC& CPhoneViewController::FetchContent()
+   {
+   __LOGMETHODSTARTEND(EPhoneUIView,
+       "CPhoneViewController::FetchContent()" );
+   return iFetchContent;
+   }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SetSingleItemFetchType
+// -----------------------------------------------------------
+//
+void CPhoneViewController::SetSingleItemFetchType( TInt aType )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView,
+        "CPhoneViewController::SetSingleItemFetchType()" );
+    iSingleItemFetchType = aType;
+    }
+
+// -----------------------------------------------------------
+// CPhoneViewController::SingleItemFetchType
+// -----------------------------------------------------------
+//
+TInt CPhoneViewController::SingleItemFetchType() const
+   {
+   __LOGMETHODSTARTEND(EPhoneUIView,
+       "CPhoneViewController::SingleItemFetchType()" );
+
+   return iSingleItemFetchType;
+   }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SwitchLayoutToFlatStatusPaneL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::SwitchLayoutToFlatStatusPaneL( TBool aSwitch )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView,
+        "CPhoneViewController::SwitchLayoutToFlatStatusPaneL()" );
+
+    TInt currentLayout = iStatusPane->StatusPane().CurrentLayoutResId();
+
+    if ( aSwitch )
+        {
+        // If current layout is different than flat layout then we
+        // need to do PushDefault for navipane and SwitchLayoutL for
+        // statuspane.
+        if ( currentLayout != R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT ||
+             currentLayout != R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL )
+            {
+            SwapEmptyIndicatorPaneInSecureStateL( ETrue );
+
+            // Push default so that Operator name can be shown in title pane.
+            iStatusPane->NaviPane().PushDefaultL();
+
+            if ( !Layout_Meta_Data::IsLandscapeOrientation() )
+                {
+                iStatusPane->StatusPane().SwitchLayoutL
+                ( R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT );
+                }
+            else
+                {
+                iStatusPane->StatusPane().SwitchLayoutL
+                ( R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL );
+                }
+            }
+        }
+    else
+        {
+        // If current layout is flat layout then do Pop for navipane,
+        // layout is something else there is no need to do Pop and
+        // SwitchLayoutL for statuspane.
+        if ( currentLayout == R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT ||
+             currentLayout == R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL )
+            {
+            SwapEmptyIndicatorPaneInSecureStateL( EFalse );
+
+            iStatusPane->NaviPane().Pop();
+
+            if ( !Layout_Meta_Data::IsLandscapeOrientation() )
+                {
+                iStatusPane->StatusPane().SwitchLayoutL
+                        ( R_AVKON_STATUS_PANE_LAYOUT_IDLE );
+                }
+            else
+                {
+                iStatusPane->StatusPane().SwitchLayoutL
+                        ( R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE );
+                }
+            }
+        }
+    // ApplyCurrentSettingsL is called whenever statuspane
+    // visibility status or pane layout changes.
+    iStatusPane->StatusPane().ApplyCurrentSettingsL();
+    iStatusPane->StatusPane().DrawNow();
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SwapEmptyIndicatorPaneInSecureStateL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::SwapEmptyIndicatorPaneInSecureStateL(
+                                    const TBool aSwapEmpty )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView,
+        "CPhoneViewController::SwapEmptyIndicatorPaneInSecureStateL()" );
+
+    TPhoneCmdParamBoolean security;
+    GetSecurityModeStatus( &security );
+
+    if ( security.Boolean() )
+        {
+        if ( aSwapEmpty )
+            {
+            if ( !iIndiContainer )
+                {
+                iIndiContainer =
+                iStatusPane->CreateEmptyIndicatorContainerL();
+                }
+            //Save previous indicator control
+            iPreviousIndicatorControl =
+                                    iStatusPane->StatusPane().SwapControlL(
+            TUid::Uid( EEikStatusPaneUidIndic ), iIndiContainer );
+            }
+        else
+            {
+            //Restore previous indicator control
+            iStatusPane->StatusPane().SwapControlL(
+            TUid::Uid( EEikStatusPaneUidIndic ), iPreviousIndicatorControl );
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::HandleTransitionEffect
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::HandleTransitionEffect(
+    TPhoneTransEffectType aType )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView,
+        "CPhoneViewController::HandleTransitionEffect()" );
+
+    switch ( aType )
+        {
+        case EPhoneTransEffectDialerCreate:
+        case EPhoneTransEffectDialerOpen:
+            {
+            GfxTransEffect::BeginFullScreen(
+                KTouchDialerOpenEffect,
+                TRect(),
+                AknTransEffect::EParameterType,
+                AknTransEffect::GfxTransParam( KUidPhoneApplication ) );
+            iEffectOngoing = ETrue;
+            break;
+            }
+        case EPhoneTransEffectDialerClose:
+            {
+            GfxTransEffect::BeginFullScreen(
+                KTouchDialerCloseEffect,
+                TRect(),
+                AknTransEffect::EParameterType,
+                AknTransEffect::GfxTransParam( KUidPhoneApplication ) );
+            iEffectOngoing = ETrue;
+            break;
+            }
+        case EPhoneTransEffectStop:
+            {
+            if ( iEffectOngoing )
+                {
+                GfxTransEffect::EndFullScreen();
+                iEffectOngoing = EFalse;
+                }
+            break;
+            }
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SetControltoDialerL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::SetControltoDialerL()
+    {
+    __PHONELOG1( EBasic, EPhoneUIView,
+        "CPhoneViewController::SetControltoDialerL iDialerActive (%d)", iDialerActive );
+
+    if ( !iDialerActive )
+        {
+        iDialerActive = ETrue;
+
+        // Make dialer view top most
+        iDialerView->DrawableWindow()->SetOrdinalPosition(
+            iPhoneView->DrawableWindow()->OrdinalPosition() );
+        iDialerView->MakeVisible( ETrue );
+        iDialerView->DrawNow();
+
+        SwitchLayoutToFlatStatusPaneL( ETrue );
+
+        iPhoneView->DrawableWindow()->SetOrdinalPosition( -1 );
+        iPhoneView->MakeVisible( EFalse );
+
+        iToolbarController->HideToolbar();
+        iDialerController->ShowToolbar();
+
+        // Update control stack
+        iAppui->AddToStackL( iDialerView );
+		iAppui->RemoveFromStack( iPhoneView );
+		}
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SetControltoCallHandlingL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::SetControltoCallHandlingL()
+    {
+    __PHONELOG1( EBasic, EPhoneUIView,
+        "CPhoneViewController::SetControltoCallHandlingL iDialerActive (%d)", iDialerActive );
+
+    if ( iDialerActive )
+        {
+        iDialerActive = EFalse;
+
+        SwitchLayoutToFlatStatusPaneL( EFalse );
+
+		// Make call handling view top most
+		iPhoneView->DrawableWindow()->SetOrdinalPosition(
+            iDialerView->DrawableWindow()->OrdinalPosition() );
+        iPhoneView->MakeVisible( ETrue );
+        iPhoneView->DrawNow();
+
+		iDialerView->DrawableWindow()->SetOrdinalPosition( -1 );
+        iDialerView->MakeVisible( EFalse );
+
+        iDialerController->HideToolbar();
+
+        // Update control stack
+		iAppui->AddToStackL( iPhoneView );
+		iAppui->RemoveFromStack( iDialerView );
+		}
+	if ( !iPhoneView->IsSecurityMode() )
+		{
+    	iToolbarController->ShowToolbar();
+		}
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SetDialerControlAndVisibilityL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::SetDialerControlAndVisibilityL()
+    {
+    __PHONELOG( EBasic, EPhoneUIView,
+        "CPhoneViewController::SetDialerControlAndVisibilityL" );
+
+    if ( iBubbleWrapper->IsNumberEntryUsed() )
+        {
+        if ( !iSendBack )
+            {
+            SetControltoDialerL();
+            // Reset flag to default value.
+            iSendBack = ETrue;
+            }
+        // next active phone app view is dialer.
+        iPhoneView->SetPhoneAppViewToDialer( ETrue );
+        }
+    else
+        {
+        // Reset flag.
+        iPhoneView->SetPhoneAppViewToDialer( EFalse );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::CapturePointerEvents
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::CapturePointerEvents(
+                                    TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView,
+        "CPhoneViewController::CapturePointerEvents()" );
+    TPhoneCmdParamBoolean* booleanParam = static_cast<TPhoneCmdParamBoolean*>(
+        aCommandParam );
+    iPhoneView->CapturePointerEvents( booleanParam->Boolean() );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::AllowWaitingCallHeaderL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::AllowWaitingCallHeaderL(
+                                           TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIView,
+        "CPhoneViewController::AllowWaitingCallHeaderL()" );
+
+    TPhoneCmdParamBoolean* booleanParam =
+        static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
+
+    // Phone in foreground and control is in dialer ->
+    //do not show waiting call header.
+    if ( ( ( ApplicationWindowGroupId() ==
+             ForegroundApplicationWindowGroupId() ) &&
+         ( iDialerActive ) ) )
+        {
+        booleanParam->SetBoolean( EFalse );
+        }
+    // Phone isnt in foreground but since control is in dialer and save add to
+    // name service is active -> do not show waiting call header.
+    else if ( ( ( ApplicationWindowGroupId() !=
+                  ForegroundApplicationWindowGroupId() ) &&
+              ( iDialerActive ) && iContactSaveAddToName ) )
+        {
+        booleanParam->SetBoolean( EFalse );
+        }
+    // If Phone is in foreground and control is in bubble we need to check
+    // query status -> if query is active do not show waiting call header, if
+    // query is not active then show waiting call header.
+    else if ( ( ( ApplicationWindowGroupId() ==
+                  ForegroundApplicationWindowGroupId() ) &&
+              ( !iDialerActive ) ) )
+        {
+        TPhoneCmdParamBoolean isQueryDisplayed;
+        // Check is query displayed
+        ExecuteCommandL( EPhoneViewIsQuery, &isQueryDisplayed );
+
+        if ( isQueryDisplayed.Boolean() )
+            {
+            booleanParam->SetBoolean( EFalse );
+            }
+        else
+            {
+            booleanParam->SetBoolean( ETrue );
+            }
+        }
+    // Phone isnt in foreground but since control is in bubble and single item
+    // service is active(note! iBlockingDialogIsDisplayed must be true if it
+    // not then iSingleItemFetch is not active anymore) -> do not show waiting
+    // call header.
+    else if ( ( ( ApplicationWindowGroupId() !=
+                  ForegroundApplicationWindowGroupId() ) &&
+              ( !iDialerActive ) &&
+              ( iSingleItemFetch && iBlockingDialogIsDisplayed ) ) )
+        {
+        booleanParam->SetBoolean( EFalse );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneViewController::NumberEntryChangedHandler
+// ---------------------------------------------------------------------------
+//
+MPhoneNumberEntryChangedHandler* CPhoneViewController::NumberEntryChangedHandler() const
+    {
+    if( iDialerController )
+        return iDialerController;
+    else
+        return iBubbleWrapper;
+
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/cphonevmbxhandler.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,470 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 mailbox handler.
+*
+*/
+
+
+// INCLUDE FILES
+#include    <eikenv.h>
+#include    <e32property.h>
+#include    <featmgr.h>
+#include    <exterror.h>
+#include    <NetworkHandlingDomainPSKeys.h> 
+#include    <telvmbxsettingscrkeys.h>
+#include    <vmnumber.h>
+#include    <voicemailboxdomaincrkeys.h>
+
+#include    "cphonecenrepproxy.h"
+#include    "cphonevmbxhandler.h"
+#include    "phoneconstants.h"
+#include    "phonelogger.h"
+#include    "phoneui.pan"
+// CONSTANTS
+ 
+const TInt KVideoMbxVariabilityFeatureOn = 2;
+
+#ifdef _DEBUG
+const TInt KPhoneSpeedDialMaxLocation = 9;
+#endif // _DEBUG
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhoneVmbxHandler::CPhoneVmbxHandler
+// -----------------------------------------------------------------------------
+//
+CPhoneVmbxHandler::CPhoneVmbxHandler()
+    {
+    iCsVideoTelFeature = FeatureManager::FeatureSupported
+                                                  ( KFeatureIdCsVideoTelephony ); 
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVmbxHandler::NewL
+// -----------------------------------------------------------------------------
+//
+CPhoneVmbxHandler* CPhoneVmbxHandler::NewL() 
+    {
+    CPhoneVmbxHandler* self = 
+        new (ELeave) CPhoneVmbxHandler();
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVmbxHandler::~CPhoneVmbxHandler
+// -----------------------------------------------------------------------------
+//
+CPhoneVmbxHandler::~CPhoneVmbxHandler()
+    {
+    if ( iVmbx )
+        {
+        iVmbx->Close();
+        delete iVmbx;
+        }
+    }
+ 
+ // -----------------------------------------------------------------------------
+// CPhoneVmbxHandler::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneVmbxHandler::ConstructL()
+    {
+    }
+ 
+// -----------------------------------------------------------------------------
+// CPhoneVmbxHandler::IsStraightCallToVideoMailBox()
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneVmbxHandler::IsStraightCallToVideoMailBox() const
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneVmbxHandler::IsStraightCallToVideoMailBox()" );
+    
+    TInt callStraightToVideoMailBox = KErrNone;
+    TInt err = CPhoneCenRepProxy::Instance()->GetInt(         
+        KCRUidTelVideoMailbox, 
+        KTelVideoMbxKey, 
+        callStraightToVideoMailBox );
+                
+    if ( err == KErrNone )
+        {
+        return ( callStraightToVideoMailBox == KVideoMbxVariabilityFeatureOn );
+        }
+            
+    __PHONELOG1( EBasic, 
+                 EPhoneUIView,
+                 "CPhoneVmbxHandler::IsStraightCallToVideoMailBox -> err = (%d)", 
+                 err );
+                         
+    return EFalse;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneVmbxHandler::IsVideoMailBoxConfigured()
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneVmbxHandler::IsVideoMailBoxConfigured() const
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneVmbxHandler::IsVideoMailBoxConfigured()" );
+    
+    TInt videoMbxConfigured = KErrNone;
+    TInt err = CPhoneCenRepProxy::Instance()->GetInt(         
+        KCRUidVideoMailbox, 
+        KVideoMbxSupport, 
+        videoMbxConfigured );
+        
+    if ( err == KErrNone )
+        {
+        return videoMbxConfigured;
+        }
+
+    __PHONELOG1( EBasic, 
+                 EPhoneUIView,
+                 "CPhoneVmbxHandler::IsVideoMailBoxConfigured -> err = (%d)", 
+                 err );
+        
+    return EFalse;
+    }    
+ 
+ 
+// -----------------------------------------------------------------------------
+// CPhoneVmbxHandler::IsVideoMbxLocationAndConfigured
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneVmbxHandler::IsVideoMbxLocationAndConfigured( 
+        TInt aSpdLocation ) const
+    {
+    return ( aSpdLocation == KPhoneVideoMbxLocation && 
+                    IsVideoMailBoxConfigured() );
+    }
+
+// -----------------------------------------------------------------------------    
+// CPhoneVmbxHandler::GetStraightSpeedDialNumber
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneVmbxHandler::GetStraightSpeedDialNumber( 
+    TInt aSpdLocation, 
+    TDes& aNumber )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneVmbxHandler::GetStraightSpeedDialNumber()" );
+    
+    __ASSERT_DEBUG( ( aSpdLocation >=KPhoneVoiceMailBoxLocation && 
+        aSpdLocation <= KPhoneSpeedDialMaxLocation), 
+        Panic( EPhoneViewIndexOutOfBounds ) );
+      
+    TInt retVal( KErrNone );
+    
+    TBool straightCallToVideoMbx = IsStraightCallToVideoMailBox();
+    
+    /******************************************************
+    * -Separated Voice / Video 
+    * - Key '1' to VoiceMbx and Key '2' to VideoMbx,
+    *   if Video mailbox configured.
+    ******************************************************/
+    if ( IsCsVideoTelFeature() &&
+              straightCallToVideoMbx && 
+            ( IsVideoMbxLocationAndConfigured( aSpdLocation ) || 
+                aSpdLocation == KPhoneVoiceMailBoxLocation ) )
+        {
+        
+        TRAPD( error, CreateVmbxL() );
+        if ( !error )
+            {
+            if ( aSpdLocation == KPhoneVoiceMailBoxLocation )
+                {
+                // Get to voice mailbox number
+                retVal = LaunchMbx( EVmbx, aNumber );
+                }
+            else  
+                {
+                // Get to video mailbox number
+                retVal = LaunchMbx( EVmbxVideo, aNumber );            
+                }
+            }
+         else
+            {
+            retVal = error;        
+            }   
+        }
+    __PHONELOG1( EBasic, 
+             EPhoneUIView,"CPhoneVmbxHandler::GetStraightSpeedDialNumber -> retval = (%d)", 
+             retVal );
+                  
+    return retVal;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVmbxHandler::IsCsVideoTelFeature
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneVmbxHandler::IsCsVideoTelFeature()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneVmbxHandler::IsCsVideoTelFeature()" );
+    return iCsVideoTelFeature; 
+    }
+// -----------------------------------------------------------------------------
+// CPhoneVmbxHandler::LaunchMbx
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneVmbxHandler::LaunchMbx( TInt aMailboxType, TDes& aNumber )
+    {
+    TInt retVal( KErrNone );
+    iMailboxType = aMailboxType;
+    
+    switch ( aMailboxType )
+        {
+        case EVmbx:
+            {
+            TRAPD( error, retVal = CSVmbxL( aNumber ) );
+            if ( error )
+                {
+                retVal = error;
+                }
+            }
+            break; 
+        case EVmbxIP:
+            {
+            TRAPD( error,retVal = IPVmbxL( aNumber ) );
+            if ( error )
+                {
+                retVal = error;
+                }            
+            } 
+            break;
+        case EVmbxVideo:
+            {
+            TRAPD( error, retVal = VideoVmbxL( aNumber ) );
+            if ( error )
+                {
+                retVal = error;
+                }
+            }
+            break;
+            
+        default:
+            break;
+        }
+ 
+    __PHONELOG1( EBasic, 
+                 EPhoneUIView,"CPhoneVmbxHandler::LaunchMbx -> retval = (%d)", 
+                 retVal );
+    return retVal;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVmbxHandler::CSVmbxL
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneVmbxHandler::CSVmbxL( TDes& aNumber )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneVmbxHandler::CSVmbxL()" );
+    CreateVmbxL();
+    TInt err ( KErrNone );
+    err = iVmbx->GetVmbxNumber( aNumber );
+    
+    //check error code
+    if ( err != KErrNone && err != KErrNotFound )
+        {
+        User::Leave( err );
+        }
+
+    //If not assigned
+    if ( err == KErrNotFound )
+        {
+        aNumber.Zero();
+        if ( !( iVmbx->QueryNumberL( EVmbxNotDefinedQuery, aNumber ) ) )
+            {
+            err = KErrNotFound;
+            }
+        else
+            {
+            if ( aNumber.Length() != 0 )
+                {
+                err = KErrNone;
+                }
+            else
+                {
+                err = KErrNotFound;
+                }
+            }
+        }
+    return err;
+    }
+// -----------------------------------------------------------------------------
+// CPhoneVmbxHandler::IPVmbxL
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneVmbxHandler::IPVmbxL( TDes& aNumber )   
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneVmbxHandler::IPVmbxL()" );
+    CreateVmbxL();
+
+    TInt err = iVmbx->GetVmbxAddress( aNumber, iServiceId );
+
+    return err; 
+    }
+// -----------------------------------------------------------------------------
+// CPhoneVmbxHandler::VideoVmbxL
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneVmbxHandler::VideoVmbxL( TDes& aNumber )   
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneVmbxHandler::VideoVmbxL()" );
+    CreateVmbxL();
+    TInt err = iVmbx->GetVideoMbxNumber( aNumber );
+    //check error code
+    if ( err != KErrNone && err != KErrNotFound )
+        {
+        User::Leave( err );
+        }
+    //If not assigned
+    if ( err == KErrNotFound )
+        {
+        aNumber.Zero();
+        if ( !( iVmbx->QueryVideoMbxNumberL( EVmbxNotDefinedQuery, aNumber ) ) )
+            {
+            err = KErrNotFound;
+            }
+        else
+            {
+            if ( aNumber.Length() != 0 )
+                {
+                err = KErrNone;
+                }
+            else
+                {
+                err = KErrNotFound;
+                }
+            }
+        }
+    
+    __PHONELOG1( EBasic, 
+                 EPhoneUIView,"CPhoneVmbxHandler::VideoVmbxL -> err = (%d)", 
+                 err );    
+    return err; 
+    } 
+    
+    
+// -----------------------------------------------------------------------------
+// CPhoneVmbxHandler::NetworkMode
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneVmbxHandler::NetworkMode()
+    
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneVmbxHandler::NetworkMode()" );
+    TInt networkMode = ENWNetworkModeUnknown;
+    
+    RProperty::Get( KPSUidNetworkInfo, 
+                    KNWTelephonyNetworkMode,
+                    networkMode );
+    __PHONELOG1( EBasic, 
+                 EPhoneUIView,"CPhoneVmbxHandler::NetworkMode -> NWMode = (%d)", 
+                 networkMode );                    
+    return networkMode; 
+    } 
+  
+// ---------------------------------------------------------
+// CPhoneVmbxHandler::CreateVmbxL
+// ---------------------------------------------------------
+//
+void CPhoneVmbxHandler::CreateVmbxL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneVmbxHandler::CreateVmbxL()" );    
+    if ( !iVmbx )
+        {
+        RVmbxNumber* vmbx = new ( ELeave ) RVmbxNumber;
+        CleanupStack::PushL( vmbx );
+        User::LeaveIfError( vmbx->Open() );
+        CleanupStack::Pop( vmbx );
+        iVmbx = vmbx;
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneVmbxHandler::GetMailboxType
+// ---------------------------------------------------------
+//
+TInt CPhoneVmbxHandler::GetMailboxType()
+    {
+    return iMailboxType;
+    }
+
+// ---------------------------------------------------------
+// CPhoneVmbxHandler::SelectMailboxTypeL
+// ---------------------------------------------------------
+//
+TInt CPhoneVmbxHandler::SelectMailboxTypeL( TUint& aServiceId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneVmbxHandler::SelectMailboxTypeL()" );
+    CreateVmbxL();
+    
+    TInt err( KErrNotFound );
+    TInt err2( KErrNotFound );
+    TInt err3( KErrNotFound );
+    TInt type( EVmbxNone );
+    
+    TBuf<KPhoneNumberEntryBufferSize> number;
+    number.Zero(); // empty the string
+    // Voice mbx number
+    err = iVmbx->GetVmbxNumber( number );
+
+    // Video mbx number
+    if( IsCsVideoTelFeature() )
+        {
+        err2 = iVmbx->GetVideoMbxNumber( number );
+        }
+
+    if ( iVmbx->IsIpVoiceMailboxServices() )
+        {
+        err3 = KErrNone;
+        }
+
+    if ( ( err == KErrNotFound || err == KErrNotSupported ) &&
+         ( err2 == KErrNotFound || err2 == KErrNotSupported ) &&
+         ( err3 == KErrNotFound || err3 == KErrNotSupported ) )
+        {
+        type = iVmbx->SelectTypeL( EVmbxDefine );
+        }
+    else 
+        {
+        type =iVmbx->SelectTypeL( EVmbxCall, iServiceId );
+        aServiceId = iServiceId;
+        } 
+    
+    return type;
+    }
+   
+// ---------------------------------------------------------
+// CPhoneVmbxHandler::CancelVmbx
+// ---------------------------------------------------------
+//
+void CPhoneVmbxHandler::CancelVmbx()
+    {
+    if ( iVmbx )
+        {
+        iVmbx->Close();
+        delete iVmbx;
+        iVmbx = NULL;
+        }    
+    }
+
+//  End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/phonebubbleextension.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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 extension plugin wrapper
+*
+*/
+
+
+#include <telbubbleextension.h>
+#include <bmbubblemanager.h>
+
+#include "phonebubbleextension.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Two-phased constructor.
+// ---------------------------------------------------------------------------
+//
+CPhoneBubbleExtension* CPhoneBubbleExtension::NewL(
+    CBubbleManager& aBubbleManager,
+    TUid aUid,
+    TUint8 aPriority )
+    {
+    CPhoneBubbleExtension* self =
+        CPhoneBubbleExtension::NewLC( aBubbleManager, aUid, aPriority );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Two-phased constructor.
+// ---------------------------------------------------------------------------
+//
+CPhoneBubbleExtension* CPhoneBubbleExtension::NewLC(
+    CBubbleManager& aBubbleManager,
+    TUid aUid,
+    TUint8 aPriority )
+    {
+    CPhoneBubbleExtension* self =
+        new( ELeave ) CPhoneBubbleExtension( aBubbleManager, aUid, aPriority );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhoneBubbleExtension::~CPhoneBubbleExtension()
+    {
+    delete iPlugin;
+    }
+
+// --------------------------------------------------------------------------
+// From class MTelBubbleExtensionObserver.
+// 
+// --------------------------------------------------------------------------
+//
+void CPhoneBubbleExtension::StartChanges()
+    {
+    iBubbleManager.StartChanges();
+    }
+
+// --------------------------------------------------------------------------
+// From class MTelBubbleExtensionObserver.
+// 
+// --------------------------------------------------------------------------
+//
+void CPhoneBubbleExtension::EndChanges()
+    {
+    iBubbleManager.EndChanges();
+    }
+
+// --------------------------------------------------------------------------
+// From class MTelBubbleExtensionObserver.
+// Attaches element to bubble. Causes redraw.
+// --------------------------------------------------------------------------
+//
+inline void CPhoneBubbleExtension::AttachElement(
+    TInt aBubbleId,
+    CTelBubbleCustomElement* aElement )
+    {
+    ReplaceElement( aBubbleId, NULL, aElement);
+    }
+
+// ---------------------------------------------------------------------------
+// From class MTelBubbleExtensionObserver.
+// Replaces element in bubble. Causes redraw.
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleExtension::ReplaceElement(
+    TInt aBubbleId,
+    CTelBubbleCustomElement* aOld,
+    CTelBubbleCustomElement* aNew )
+    {
+    iBubbleManager.StartChanges();
+    if ( aOld )
+        {
+        iBubbleManager.RemoveCustomElement( aBubbleId, aOld );
+        }
+    if ( aNew )
+        {
+        iBubbleManager.AddCustomElement( aBubbleId, aNew, iPriority );
+        }
+    iBubbleManager.EndChanges();
+    }
+
+// --------------------------------------------------------------------------
+// From class MTelBubbleExtensionObserver.
+// Detaches element in bubble. Causes redraw.
+// --------------------------------------------------------------------------
+//
+inline void CPhoneBubbleExtension::DetachElement(
+    TInt aBubbleId,
+    CTelBubbleCustomElement* aElement )
+    {
+    ReplaceElement( aBubbleId, aElement, NULL);
+    }
+
+// ---------------------------------------------------------------------------
+// From class MTelBubbleExtensionInterface.
+// Notifies that a new customizable bubble is available
+// ---------------------------------------------------------------------------
+//
+inline void CPhoneBubbleExtension::StartCustomizedBubble(
+    MTelBubbleExtensionData& aCallData )
+    {
+    iPlugin->StartCustomizedBubble( aCallData );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MTelBubbleExtensionInterface.
+// Notifies that a customizable bubble has been removed
+// ---------------------------------------------------------------------------
+//
+inline void CPhoneBubbleExtension::StopCustomizedBubble(
+    MTelBubbleExtensionData& aCallData )
+    {
+    iPlugin->StopCustomizedBubble( aCallData );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MTelBubbleExtensionInterface.
+// Indicates that currently bubble drawing is started.
+// ---------------------------------------------------------------------------
+//
+inline void CPhoneBubbleExtension::BubbleUpdating()
+    {
+    iPlugin->BubbleUpdating();
+    }
+
+// ---------------------------------------------------------------------------
+// First phase constructor.
+// ---------------------------------------------------------------------------
+//
+CPhoneBubbleExtension::CPhoneBubbleExtension(
+    CBubbleManager& aBubbleManager,
+    TUid aUid,
+    TUint8 aPriority )
+    : iBubbleManager(aBubbleManager), iUid(aUid), iPriority(aPriority)
+    {
+    // no implementation needed
+    }
+
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleExtension::ConstructL()
+    {
+    iPlugin = CTelBubbleExtension::NewL( iUid );
+    iPlugin->InitializeL( *this );
+    }
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/phonebubbleextensiondata.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Contains call data.
+*
+*/
+
+
+#include "phonebubbleextensiondata.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "pevirtualengine.h"
+
+// --------------------------------------------------------------------------
+// Two-phased constructor.
+// --------------------------------------------------------------------------
+//
+CPhoneBubbleExtensionData* CPhoneBubbleExtensionData::NewL(
+    TInt aBubbleId,
+    TPhoneCmdParamCallHeaderData* aParams, 
+    TBool aFirst )
+    {
+    CPhoneBubbleExtensionData* self =
+        CPhoneBubbleExtensionData::NewLC( aBubbleId, aParams, aFirst );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// --------------------------------------------------------------------------
+// Two-phased constructor.
+// --------------------------------------------------------------------------
+//
+CPhoneBubbleExtensionData* CPhoneBubbleExtensionData::NewLC(
+    TInt aBubbleId,
+    TPhoneCmdParamCallHeaderData* aParams, 
+    TBool aFirst )
+    {
+    CPhoneBubbleExtensionData* self =
+        new( ELeave ) CPhoneBubbleExtensionData( aBubbleId, aParams, aFirst );
+    CleanupStack::PushL( self );
+    self->ConstructL( aParams );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhoneBubbleExtensionData::~CPhoneBubbleExtensionData()
+    {
+    delete iContactLink;
+    delete iRemotePhoneNumber;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the call state
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleExtensionData::SetState( TInt aState, TBool aFirst )
+    {
+    switch ( aState )
+        {
+        case EPEStateDialing:
+            iState = MTelBubbleExtensionData::EOutgoing;
+            break;
+
+        case EPEStateRinging:
+            if ( aFirst )
+                {
+                iState = MTelBubbleExtensionData::EIncoming;
+                }
+            else
+                {
+                iState = MTelBubbleExtensionData::EWaiting;
+                }
+            break;
+
+        case EPEStateConnecting:
+            iState = MTelBubbleExtensionData::EAlerting;
+            break;
+
+        case EPEStateHeld: // fall-through
+        case EPEStateHeldConference:
+            iState = MTelBubbleExtensionData::EOnHold;
+            break;
+
+        case EPEStateDisconnecting: // fall-through
+        case EPEStateConferenceIdle: // fall-through
+        case EPEStateIdle:
+            iState = MTelBubbleExtensionData::EDisconnected;
+            break;
+
+        case EPEStateConnected: // fall-through
+        case EPEStateConnectedConference:
+            iState = MTelBubbleExtensionData::EActive;
+            break;
+
+        case EPEStateUnknown: // fall-through
+        default:
+            break;
+        }
+    
+    }
+
+// ---------------------------------------------------------------------------
+// From class MTelBubbleExtensionData.
+// Bubble ID.
+// ---------------------------------------------------------------------------
+//
+inline TInt CPhoneBubbleExtensionData::BubbleId() const
+    {
+    return iBubbleId;
+    }
+
+// --------------------------------------------------------------------------
+// From class MTelBubbleExtensionData.
+// Call state information.
+// --------------------------------------------------------------------------
+//
+inline CPhoneBubbleExtensionData::TCallState
+    CPhoneBubbleExtensionData::State() const
+    {
+    return iState;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MTelBubbleExtensionData.
+// Call type information
+// ---------------------------------------------------------------------------
+//
+inline CPhoneBubbleExtensionData::TCallType
+    CPhoneBubbleExtensionData::Type() const
+    {
+    return iType;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MTelBubbleExtensionData.
+// Call service id
+// ---------------------------------------------------------------------------
+//
+inline TUint32 CPhoneBubbleExtensionData::ServiceId() const
+    {
+    return iService;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MTelBubbleExtensionData.
+// Contact Link related to this call.
+// ---------------------------------------------------------------------------
+//
+inline const TDesC8& CPhoneBubbleExtensionData::ContactLink() const
+    {
+    return *iContactLink;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MTelBubbleExtensionData.
+// Remote phone number related to this call.
+// ---------------------------------------------------------------------------
+//
+const TDesC& CPhoneBubbleExtensionData::RemotePhoneNumber() const
+    {
+    return *iRemotePhoneNumber;
+    }
+
+// ---------------------------------------------------------------------------
+// First phase constructor
+// ---------------------------------------------------------------------------
+//
+CPhoneBubbleExtensionData::CPhoneBubbleExtensionData( 
+    TInt aBubbleId,
+    TPhoneCmdParamCallHeaderData* aParams, 
+    TBool aFirst )
+    : iBubbleId(aBubbleId), iState(ENone), iType(EUninitialized), iService(0)
+    {
+    // call state
+    SetState( aParams->CallState(), aFirst );
+
+    // call type
+    switch ( aParams->CallType() )
+        {
+        case EPECallTypeCSVoice:
+            iType = MTelBubbleExtensionData::ECsVoice;
+            break;
+
+        case EPECallTypeVideo:
+            iType = MTelBubbleExtensionData::ECsVideo;
+            break;
+        
+        case EPECallTypeVoIP:
+            iType = MTelBubbleExtensionData::EPsVoice;
+            break;
+        
+        case EPECallTypeUninitialized:
+        default:
+            iType = MTelBubbleExtensionData::EUninitialized;
+            break;
+        }
+    
+    // service ID
+    iService = aParams->ServiceId();
+    }
+
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleExtensionData::ConstructL( 
+    TPhoneCmdParamCallHeaderData* aParams )
+    {
+    // Copy contact link to local buffer
+    iContactLink = HBufC8::NewL( aParams->ContactLink().Length() );
+    *iContactLink = aParams->ContactLink();
+    
+    // Copy phone number to local buffer
+    iRemotePhoneNumber = aParams->RemotePhoneNumber().AllocL();
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/src/phonebubbleextensionmanager.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,342 @@
+/*
+* 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:  Manages the call bubble extension plugins.
+*
+*/
+
+
+#include <badesca.h>
+#include <ecom.h>
+#include <telbubbleextension.h>
+
+#include "phonebubbleextension.h"
+#include "phonebubbleextensionmanager.h"
+#include "phonebubbleextensiondata.h"
+
+const TUint8 KDefaultPriority(255);
+
+/**
+* This is a support class that is used to carry relation of plugin UId and the
+* assigned priority. Used inside an ordered array only. 
+*/
+class TPriorityItem
+{
+public:
+    TPriorityItem( const TUid aUid, const TUint8 aPriority )
+            : iUid(aUid),iPriority(aPriority){};
+    const TUid Uid() const
+            { return iUid; };
+    TUint8 Priority() const
+            { return iPriority; };
+    TBool operator==( const TPriorityItem& aOther ) const
+            { return iUid == aOther.Uid(); };
+    TBool operator<( const TPriorityItem& aOther ) const
+            { return iUid.iUid < aOther.Uid().iUid; };
+    static TInt Compare( const TPriorityItem& aFirst, 
+            const TPriorityItem& aSecond )
+            {
+            if( aFirst < aSecond )
+                {
+                return -1;
+                }
+            if( aFirst == aSecond )
+                {
+                return 0;
+                }
+            return 1;
+            };
+private:
+    TPriorityItem();
+    
+private:
+    const TUid iUid;
+    const TUint8 iPriority;
+};
+
+
+// ======== LOCAL FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// ECOM array cleanupstack support function
+// ---------------------------------------------------------------------------
+//
+void CleanupEComArray(TAny* aArray)
+    {
+    (static_cast<RImplInfoPtrArray*> (aArray))->ResetAndDestroy();
+    (static_cast<RImplInfoPtrArray*> (aArray))->Close();
+    }
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Two-phase constructor
+// ---------------------------------------------------------------------------
+//
+CPhoneBubbleExtensionManager* CPhoneBubbleExtensionManager::NewL(
+    CBubbleManager& aBubbleManager )
+    {
+    CPhoneBubbleExtensionManager* self = 
+        CPhoneBubbleExtensionManager::NewLC( aBubbleManager );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Two-phase constructor
+// ---------------------------------------------------------------------------
+//
+CPhoneBubbleExtensionManager* CPhoneBubbleExtensionManager::NewLC(
+    CBubbleManager& aBubbleManager )
+    {
+    CPhoneBubbleExtensionManager* self = 
+        new( ELeave ) CPhoneBubbleExtensionManager( aBubbleManager );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// destructor
+// ---------------------------------------------------------------------------
+//
+CPhoneBubbleExtensionManager::~CPhoneBubbleExtensionManager()
+    {
+    Reset();
+    iPriorityArray.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// Notifies the plugin framework about a new call.
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleExtensionManager::StartCallL( 
+    TInt aBubbleId, 
+    TPhoneCmdParamCallHeaderData* aParams )
+    {
+    if ( !iInitialized )
+        {
+        // Load plugins (happens on first call)
+        InitializeL();
+        }
+    if ( iPlugins.Count() > 0 ) // Call added only if any plugins
+        {
+        // create call data
+        CPhoneBubbleExtensionData* callData = CPhoneBubbleExtensionData::NewLC( 
+                aBubbleId,
+                aParams,
+                ( iCalls.Count() == 0 ) );
+        
+        // insert to array
+        iCalls.AppendL( callData ); // ownership transferred
+        CleanupStack::Pop( callData );
+        
+        // notify all plugins
+        const TUint pluginCount = iPlugins.Count();
+        for ( TUint index(0); index < pluginCount; index++ )
+            {
+            iPlugins[index]->StartCustomizedBubble( *callData );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Notifies the plugin framework about cleared call.
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleExtensionManager::StopCall( TInt aBubbleId)
+    {
+    // find call data
+    TBool found(EFalse);
+    TUint callIndex(0);
+    const TUint callCount = iCalls.Count();
+    while ( callIndex < callCount && !found )
+        {
+        found = ( iCalls[callIndex]->BubbleId() == aBubbleId );
+        if ( !found )
+            {
+            callIndex++;
+            }
+        }
+    if ( found )
+        {
+        // notify all plugins
+        const TUint pluginCount = iPlugins.Count();
+        for ( TUint index(0); index < pluginCount; index++ )
+            {
+            iPlugins[index]->StopCustomizedBubble( *iCalls[callIndex] );
+            }
+        // destroy call data
+        delete iCalls[callIndex];
+        iCalls.Remove( callIndex );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Notifies the plugin framework about changed call state.
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleExtensionManager::UpdateCallState( 
+    TInt aBubbleId, 
+    TInt aNewState )
+    {
+    // find call data
+    TBool found(EFalse);
+    TUint callIndex(0);
+    const TUint callCount = iCalls.Count();
+    while ( callIndex < callCount && !found )
+        {
+        found = ( iCalls[callIndex]->BubbleId() == aBubbleId );
+        if ( !found )
+            {
+            callIndex++;
+            }
+        }
+    if ( found )
+        {
+        // modify call data
+        iCalls[callIndex]->SetState( aNewState, ( iCalls.Count() == 0 ) );
+        // notify all plugins
+        const TUint pluginCount = iPlugins.Count();
+        for ( TUint index(0); index < pluginCount; index++ )
+            {
+            iPlugins[index]->BubbleUpdating();
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Loads all plugins
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleExtensionManager::InitializeL()
+    {
+    if ( !iInitialized )
+        {
+        // load list of plugins
+        RImplInfoPtrArray pluginArray;
+        TCleanupItem cleanup( CleanupEComArray, &pluginArray );
+        CleanupStack::PushL( cleanup );
+        REComSession::ListImplementationsL(
+                KTelBubbleExtensionInterfaceUid, 
+                pluginArray);
+    
+        // loop through the list, load plugin and insert to array 
+        CPhoneBubbleExtension* plugin;
+        const TUint count( pluginArray.Count() );
+        for ( TUint index(0); index < count; index++ )
+            {
+            // Plugin UID
+            TUid uid = pluginArray[index]->ImplementationUid();
+            // Plugin priority
+            TUint8 priority( KDefaultPriority ); // for unknown plugins 
+            TInt priorityIndex = iPriorityArray.FindInOrder(
+                    TPriorityItem( uid, 0 ),
+                    TLinearOrder<TPriorityItem>( TPriorityItem::Compare ));
+            if ( priorityIndex >= 0)
+                {
+                // Priority for this plugin found.
+                priority = iPriorityArray[priorityIndex].Priority();
+                }
+
+            // Load plugin:
+            TRAP_IGNORE( 
+                plugin = CPhoneBubbleExtension::NewLC( iBubbleManager, 
+                                                       uid, 
+                                                       priority );
+
+                // Plugin was loaded successfully
+                iPlugins.AppendL( plugin ); // ownership trasferred
+                CleanupStack::Pop( plugin );
+                );
+            }
+    
+        // Clean up
+        CleanupStack::PopAndDestroy(); // pluginArray
+        iInitialized = ETrue;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// First phase constructor
+// ---------------------------------------------------------------------------
+//
+CPhoneBubbleExtensionManager::CPhoneBubbleExtensionManager(
+    CBubbleManager& aBubbleManager )
+    :iBubbleManager( aBubbleManager ), iInitialized(EFalse)
+    {
+    // no implementation needed
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleExtensionManager::ConstructL()
+    {
+    // Load priorities
+    LoadPrioritiesL();
+
+    // Currently, the plugins are loaded when the first call happens,
+    // not during construction. This avoids the situation where phone might
+    // panic during boot up if there's a bad plugin which panics when loaded.
+    }
+
+// ---------------------------------------------------------------------------
+// Loads plugin priorities.
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleExtensionManager::LoadPrioritiesL()
+    {
+    // Currently plugin priorities are not in use. No array is loaded,
+    // therefore all plugins get default priority as the priority is not
+    // found during the loading.
+    // Here's an example implementation how to insert loaded priority data
+    // (UID + priority pairs) into the array:
+    // iPriorityArray.InsertInOrderL(
+    //        TPriorityItem( TUid::Uid(0x12345789), 5 ),
+    //        TLinearOrder<TPriorityItem>( TPriorityItem::Compare ));
+
+    }
+
+// ---------------------------------------------------------------------------
+// Unloads all plugins, closes all calls
+// ---------------------------------------------------------------------------
+//
+void CPhoneBubbleExtensionManager::Reset()
+    {
+    // Close all calls
+    for ( TInt callIndex(0); callIndex < iCalls.Count(); callIndex++ )
+        {
+        // notify all plugins
+        const TUint pluginCount = iPlugins.Count();
+        for ( TUint index(0); index < pluginCount; index++ )
+            {
+            iPlugins[index]->StopCustomizedBubble( *iCalls[callIndex] );
+            }
+        // destroy call data
+        delete iCalls[callIndex];
+        }
+    iCalls.Close();
+
+    // Unload plugins
+    for ( TInt index(0); index < iPlugins.Count(); index++ )
+        {
+        delete iPlugins[index];
+        }
+    iPlugins.Close();
+    
+    iInitialized = EFalse;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/bwins/phoneuivoipextensionu.def	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,111 @@
+/*
+* 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.
+CAPABILITY CAP_APPLICATION MultiMediaDD PowerMgmt NetworkControl DRM DiskAdmin
+
+// 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
+SOURCE          tphonetouchpanewrapper.cpp
+SOURCE          cphonetransferdialercontroller.cpp
+SOURCE          cphoneviewcustomizationvoip.cpp
+SOURCE          cphonestateutilsvoip.cpp
+SOURCE          cphoneunattendedtransfercmdhandler.cpp
+SOURCE          cphonevcchandler.cpp
+SOURCE          cphonenewcallcmdhandler.cpp
+SOURCE          cphonecallforwardqueryhandler.cpp
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../phoneuicontrol/inc
+USERINCLUDE     ../../phoneuistates/inc
+USERINCLUDE     ../../phoneuiview/inc
+USERINCLUDE     ../../phoneui/inc
+USERINCLUDE     ../../phoneuiutils/inc
+USERINCLUDE     ../../phoneui/srcdata
+USERINCLUDE     ../../phoneui/loc
+
+APP_LAYER_SYSTEMINCLUDE         // Application layer domain APIs
+SYSTEMINCLUDE   ../../../inc    // Telephony internal headers
+
+
+
+#ifndef __SECURE_DATA__ 
+
+/* Languages */
+ LANG SC
+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__
+
+
+LIBRARY         bafl.lib
+LIBRARY         cch.lib 
+LIBRARY         commonengine.lib //StringLoader 
+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
+LIBRARY         vccuipropertyhandler.lib //For VCC Usage
+LIBRARY         ws32.lib
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/group/phoneuivoipextension_stub.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,181 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,421 @@
+/*
+* 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 CPhoneVccHandler;
+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 );
+        
+        /**
+        * Customizes touch pane buttons by extension.
+        * @leave KErrNotFound if extension not found.
+        * @param aTouchPane Interface to add and dimm
+        *                   bubble touch pane buttons.
+        */
+        void CustomizeTouchPaneUsingExtensionL(
+                        MBubbleTouchPaneInterface& aTouchPane );
+        
+        /**
+        * 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;
+        
+        /**
+         * Pointer to VCC handler
+         */
+        CPhoneVccHandler* iVccHandler; 
+
+        /**
+         * 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,130 @@
+/*
+* 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>
+#include "mphonebuttoncustomization.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();
+        
+        /**
+         * Customizes touch pane buttons.
+         * @param aServiceId Service id of the call.
+         * @param aArray Active call array
+         * @param aTouchPane Interface to add and dimm
+         *                   bubble touch pane buttons.
+         */
+        void CustomizeTouchPaneButtonsL(
+                TUint aServiceId,
+                RArray<CTelMenuExtension::TCallInfo>& aArray,
+                MBubbleTouchPaneInterface& aTouchPane );
+                        
+        /**
+         * 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,114 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,114 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*   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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Wrapper class to touch pane interface.
+*
+*/
+
+
+#ifndef TPHONETOUCHPANEWRAPPER_H
+#define TPHONETOUCHPANEWRAPPER_H
+
+// INCLUDES
+#include <e32base.h>
+#include <teltouchpaneextension.h>
+#include <bmtouchpaneinterface.h>
+
+
+/**
+ * Wrapper class to touch pane interface.
+ *
+ * @since S60 5.1
+ */
+NONSHARABLE_CLASS( TPhTouchPaneWrapper ): public MTelTouchPaneExtension
+    {
+
+public:
+
+    TPhTouchPaneWrapper( MBubbleTouchPaneInterface& aTouchPane );
+    
+    /**
+     * 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:
+    
+    /**
+     * Reference to touch pane interface
+     * Not own.
+     */
+    MBubbleTouchPaneInterface& iTouchPane;
+    
+    };
+
+
+#endif TPHONETOUCHPANEWRAPPER_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphonecallforwardqueryhandler.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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: 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"
+
+
+
+// ======== 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,1485 @@
+/*
+* 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 <bmbubblemanager.h>
+#include <phoneui.rsg>
+#include <avkon.rsg>
+#include <phoneuivoip.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 "cphonevcchandler.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;
+	delete iVccHandler;
+    }
+
+
+// -----------------------------------------------------------
+// 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 );
+		
+    if ( FeatureManager::FeatureSupported( KFeatureIdFfVoiceCallContinuity ) )
+        {
+        iVccHandler = CPhoneVccHandler::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 ( EPEStateRinging == aCommandParam->CallState() &&
+            !contactInfoAvailable )
+            {
+            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 ), 
+                    CBubbleManager::ERight );
+                // use line reserved for CNAP to show SIP URI
+                aCommandParam->SetCNAPText( 
+                    engineInfo.RemotePhoneNumber( aCallId ),
+                    CBubbleManager::ERight );
+                }
+            else if( KNullDesC() != engineInfo.RemotePhoneNumber( aCallId ) )
+                {
+                // Fit address to two rows if it doesnt fit to one
+                TBuf<KMaxLengthForSIPURI> sipURI;
+                TBuf<KMaxLengthForSIPURI> sipURIDomainPart;
+                HandleURIFittingToCallBubble( 
+                    aCommandParam->CLIText(),
+                    sipURI,
+                    sipURIDomainPart );
+                
+                aCommandParam->SetCLIText( sipURI, CBubbleManager::ERight );
+                aCommandParam->SetCNAPText( 
+                    sipURIDomainPart,
+                    CBubbleManager::ERight );
+                }
+            else
+                {
+                // No address or display name specified
+                // Do nothing
+                }
+            }
+        else
+            {
+            // Change clipping direction
+            aCommandParam->SetCLIText( 
+                aCommandParam->CLIText(), 
+                CBubbleManager::ERight );
+            
+            // Change clipping direction
+            aCommandParam->SetCNAPText( 
+                aCommandParam->CNAPText(), 
+                CBubbleManager::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:
+            iVccHandler->StartManualHandoverL( EPhoneVoIPWaitHandoverFromWlan );
+            handled = ETrue;
+            break;
+
+        
+        case EPhoneCmdHandoverToWlan:
+            iVccHandler->StartManualHandoverL( EPhoneVoIPWaitHandoverFromGsm );
+            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(
+        MBubbleTouchPaneInterface& aTouchPane )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::CustomizeTouchPaneButtons" );
+    
+    TRAPD( err, CustomizeTouchPaneUsingExtensionL( aTouchPane ) );
+    
+    if ( KErrNone != err )
+        {
+        // Extension plugin didn't handle touch pane dimming.
+        TInt buttonCount = aTouchPane.NumberOfButtonsInPane();
+            
+        for ( TInt i=0; i < buttonCount; i++ )    
+            {
+            TInt commandId = aTouchPane.ButtonCommandId( i );
+        
+            switch ( commandId )
+                {              
+                case EPhoneInCallCmdCreateConference:
+                case EPhoneInCallCmdJoin:
+                    {
+                    if ( !IsFeatureSupported( EFeatureConference ) )
+                        {
+                        // Conference not supported -> set item dimmed
+                        aTouchPane.SetButtonDimmed( commandId, ETrue );
+                        }               
+                    break;  
+                    }
+                default:
+                    break;                    
+                } // switch
+            } // for    
+        }
+    }
+
+
+// -----------------------------------------------------------
+// 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::CustomizeTouchPaneUsingExtensionL
+// -----------------------------------------------------------
+//
+void CPhoneCustomizationVoip::CustomizeTouchPaneUsingExtensionL(
+        MBubbleTouchPaneInterface& aTouchPane )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::CustomizeTouchPaneUsingExtensionL" );
+    
+    RArray<CTelMenuExtension::TCallInfo> array;
+    CleanupClosePushL( array );
+    
+    GetActiveCallArrayL( array );
+
+    // Use extensions for touch pane buttons dimming 
+    iExtensionHandler->CustomizeTouchPaneButtonsL(
+            ServiceIdForActivestCallL( array ),
+            array,
+            aTouchPane );
+    
+    __PHONELOG( EBasic, PhoneUIVoIPExtension,
+        "CPhoneCustomizationVoip::ModifyInCallMenuL() plugin exists" );
+    
+    CleanupStack::PopAndDestroy( &array );    
+    }
+
+
+// -----------------------------------------------------------
+// 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 KEnableServiceTimeOutInSecs = 60;
+    queryParam.SetTimeOut( KEnableServiceTimeOutInSecs );
+    // 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" );
+    
+    // Menu items to be added
+    if ( iVccHandler && AllowAlphaNumericMode() &&
+        ( aResourceId == R_PHONEUI_CALLHANDLING_INCALL_OPTIONS_MENU ||
+          aResourceId == R_PHONEUI_CALLWAITING_OPTIONS_MENU ||
+          aResourceId == R_PHONEUI_ACTIVEANDHELDCALL_OPTIONS_MENU ||
+          aResourceId == R_PHONEUI_ACTIVEANDHELDCONFCALL_OPTIONS_MENU ||
+          aResourceId == R_PHONEUI_CALLACTIVEHELDANDWAITING_OPTIONS_MENU 
+        ))
+        {        
+        RArray<CTelMenuExtension::TCallInfo> array;
+        CleanupClosePushL( array );
+        GetActiveCallArrayL( array );
+        
+        iVccHandler->AddHandoverMenuItemL( array, aResourceId, aMenuPane );
+        CleanupStack::PopAndDestroy( &array );   
+        }
+    }
+
+
+// -----------------------------------------------------------
+// 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,264 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <phoneui.rsg>
+#include <avkon.rsg>
+#include <phoneuivoip.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::CustomizeTouchPaneButtonsL
+// -----------------------------------------------------------
+//
+void CPhoneExtensionHandler::CustomizeTouchPaneButtonsL(
+        TUint aServiceId,
+        RArray<CTelMenuExtension::TCallInfo>& aArray,
+        MBubbleTouchPaneInterface& aTouchPane )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneExtensionHandler::CustomizeTouchPaneButtonsL" );
+    
+    CTelMenuExtension* interface = MenuExtensionL( aServiceId );
+    
+    TPhTouchPaneWrapper wrapper( aTouchPane );    
+    interface->ModifyExtensionsTouchPaneButtonsL(
+        aArray,
+        wrapper);
+    }
+
+
+// -----------------------------------------------------------
+// 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,311 @@
+/*
+* 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 <phoneuivoip.rsg>
+#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()
+    {
+    // Add resource file
+    // Create path to default resource file name
+    TFileName path( KDriveZ );
+    path.Append( KDC_APP_RESOURCE_DIR );
+    path.Append( KPhoneResourceFileVoIP );
+
+    RFs &fsSession= iEnv.FsSession();
+    BaflUtils::NearestLanguageFile( fsSession, path );
+    iVoIPResourceOffset = iEnv.AddResourceFileL( path );
+
+    BaseConstructL();
+    
+    // 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()
+    {
+    iEnv.DeleteResourceFile( iVoIPResourceOffset );
+    }
+
+// -----------------------------------------------------------------------------
+// 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:
+            retVal = R_PHONEUI_NUMBERACQ_OPTIONS_CALL_MENU_ITEM_XSP;
+            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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneStateAlertingVoIP class.
+*
+*/
+
+
+// INCLUDES
+#include <bmbubblemanager.h>
+#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( CBubbleManager::EVoIPCall );			
+		}
+
+	CPhoneAlerting::HandleConnectedL( aCallId );		
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphonestatecallsetupvoip.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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 CPhoneStateCallSetupVoIP class.
+*
+*/
+
+
+// INCLUDES
+#include <bmbubblemanager.h>
+#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( CBubbleManager::EVoIPCall );			
+		}
+		
+	CPhoneCallSetup::HandleConnectingL( aCallId );		
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphonestateidlevoip.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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( CBubbleManager::EVoIPCall );			
+		}
+
+	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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,314 @@
+/*
+* 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 <phoneui.mbg>
+#include <phoneui.rsg>
+#include <phoneuivoip.rsg>
+#include <data_caging_path_literals.hrh> // For KDC_APP_BITMAP_DIR
+
+#include "phoneui.pan"
+#include "phonelogger.h"
+#include "cphonetransferdialercontroller.h"
+#include "cphonemainresourceresolver.h"
+#include "phonerssvoip.h"
+#include "phoneappcommands.hrh"
+#include "phoneappvoipcommands.hrh"
+
+
+// CONSTANTS
+_LIT ( KPhoneMifFileName, "phoneui.mif" );
+
+// Number of buttons 
+const TInt KButtonCount = 2;
+
+class TPhoneDialerToolbarButton 
+    {
+public:
+    TInt iIconIndex;
+    TInt iMaskIndex;
+    TInt iCommandId;    
+    };
+
+const TPhoneDialerToolbarButton bArray[KButtonCount] = 
+        {  
+            { EMbmPhoneuiQgn_indi_button_send_dtmf,
+              EMbmPhoneuiQgn_indi_button_send_dtmf_mask,
+              EPhoneCmdTransferDialerOk
+            },
+            { EMbmPhoneuiQgn_indi_dialer_contacts,
+              EMbmPhoneuiQgn_indi_dialer_contacts_mask,
+              EPhoneCmdTransferDialerSearch
+            }                 
+        };  
+
+// ================= 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;
+        // Create transfer specific buttons and add them to the 
+        // toolbar starting from index 0
+        CAknButton* button( NULL );
+    
+        for( TInt i = 0; i < KButtonCount; i++ )
+            {
+            TAknsItemID skinId = SkinId( bArray[i].iIconIndex );
+            // Load tooltip text.
+            HBufC* tooltipText = GetTooltipTextL( bArray[i].iCommandId );  
+            CleanupStack::PushL( tooltipText );
+            button = CreateButtonLC(
+                    bArray[i].iIconIndex, 
+                    bArray[i].iMaskIndex, 
+                    *tooltipText, 
+                    skinId );
+            // Toolbar takes ownership of the button                    
+            iToolbar->AddItemL( button, EAknCtButton, bArray[i].iCommandId, 0, i );
+            CleanupStack::Pop( button );
+            CleanupStack::PopAndDestroy( tooltipText );
+            }      
+        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 ) );
+    for( TInt i = 0; i < KButtonCount; i++ )
+        {
+        iToolbar->HideItem( bArray[ i ].iCommandId, !aShow, EFalse );
+        }    
+    
+    if ( aShow )
+        {
+        iToolbar->SetItemDimmed( EPhoneCmdTransferDialerOk, ETrue, EFalse ); 
+        iToolbar->SetItemDimmed( EPhoneCmdTransferDialerSearch, EFalse, EFalse ); 
+        iToolbar->SetItemDimmed( EPhoneDialerCmdClear, ETrue, EFalse ); 
+        }
+    
+    iToolbar->DrawDeferred();
+    }
+
+// ---------------------------------------------------------------------------
+// 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;
+    
+    switch ( aIconIndex )
+        {
+        case EMbmPhoneuiQgn_indi_button_send_dtmf:
+            skinId = KAknsIIDQgnIndiButtonSendDtmf;
+            break;
+        case EMbmPhoneuiQgn_indi_dialer_contacts:
+            skinId = KAknsIIDQgnIndiDialerContacts;
+            break;                     
+        default:
+            skinId = KAknsIIDNone;        
+            break;            
+        }
+    
+    return skinId;  
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphoneuistatemachinefactoryvoip.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,555 @@
+/*
+* 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 <phoneui.rsg>
+#include <avkon.rsg>
+#include <phoneuivoip.rsg>
+#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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,586 @@
+/*
+* 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 <ccherror.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 );
+    
+    switch ( aErrorCode )
+        {
+        case KCCHErrorAccessPointNotDefined:
+            {
+            TUint32 serviceId = 
+                iStateMachine->PhoneEngineInfo()->ServiceIdCommand();
+            ShowErrorNoteWithServiceNameL( EPhoneVoIPNoConnectionsDefined,
+                serviceId );
+            break;
+            }
+        case KCCHErrorBandwidthInsufficient:   
+            {
+            TUint32 serviceId = 
+                iStateMachine->PhoneEngineInfo()->ServiceIdCommand();
+            ShowErrorNoteWithServiceNameL( EPhoneVoIPCallsNotSupported,
+                serviceId );
+            break;
+            }
+        case KCCHErrorInvalidSettings:
+            {
+            TUint32 serviceId = 
+                iStateMachine->PhoneEngineInfo()->ServiceIdCommand();
+            ShowErrorNoteWithServiceNameL( EPhoneVoIPDefectiveSettings,
+                serviceId );
+            break;
+            }
+        case KCCHErrorAuthenticationFailed:
+            {
+            SendGlobalErrorNoteL( EPhoneVoIPAuthenticationFailed );
+            break;
+            }
+        case KCCHErrorInvalidIap:
+        case KCCHErrorNetworkLost:
+        case KCCHErrorServiceNotResponding:
+            {
+            TUint32 serviceId = 
+                iStateMachine->PhoneEngineInfo()->ServiceIdCommand();
+            ShowErrorNoteWithServiceNameL( EPhoneVoIPNoConnectionsAvailable,
+                serviceId );
+            break;
+            }
+        case KCCHErrorLoginFailed: 
+        default:
+            {
+            TUint32 serviceId = 
+               iStateMachine->PhoneEngineInfo()->ServiceIdCommand();
+            ShowErrorNoteWithServiceNameL( EPhoneVoIPServiceUnavailable,
+               serviceId );
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+//  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,70 @@
+/*
+* 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( 
+        MBubbleTouchPaneInterface& aTouchPane ) :
+        iTouchPane( aTouchPane )    
+    {
+    }
+
+// ---------------------------------------------------------
+// TPhTouchPaneWrapper::TPhTouchPaneWrapper
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt TPhTouchPaneWrapper::NumberOfButtonsInPane() const
+   	{
+   	return iTouchPane.NumberOfButtonsInPane();
+   	}
+
+// ---------------------------------------------------------
+// TPhTouchPaneWrapper::ButtonCommandId
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt TPhTouchPaneWrapper::ButtonCommandId( 
+        TInt aButtonIndex ) const
+    {
+   	return iTouchPane.ButtonCommandId( aButtonIndex );
+   	}
+
+// ---------------------------------------------------------
+// TPhTouchPaneWrapper::SetButtonDimmed
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void TPhTouchPaneWrapper::SetButtonDimmed( TInt aCommand, TBool aDimmed )
+   {
+   iTouchPane.SetButtonDimmed( aCommand, aDimmed );   
+   }
+
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/srcdata/phoneuivoip.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,30 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,30 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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/PhoneCntFinder/BWINS/PHONECNTFINDERU.DEF	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,7 @@
+EXPORTS
+	?CreateCntFactoryL@@YAPAVCPhCntFactory@@XZ @ 1 NONAME ; class CPhCntFactory * CreateCntFactoryL(void)
+	??0CCntRawPhoneNumberExtractor@@QAE@XZ @ 2 NONAME ; CCntRawPhoneNumberExtractor::CCntRawPhoneNumberExtractor(void)
+	??1CPhoneCntSaveAddToName@@UAE@XZ @ 3 NONAME ; CPhoneCntSaveAddToName::~CPhoneCntSaveAddToName(void)
+	?HandlePbkOperationL@CPhoneCntSaveAddToName@@UAEXABV?$TBuf@$0GE@@@HW4TCntNumberType@@@Z @ 4 NONAME ; void CPhoneCntSaveAddToName::HandlePbkOperationL(class TBuf<100> const &, int, enum TCntNumberType)
+	?HandlePbkOperationL@CPhoneCntSaveAddToName@@UAEXABV?$TBuf@$0GE@@@H@Z @ 5 NONAME ; void CPhoneCntSaveAddToName::HandlePbkOperationL(class TBuf<100> const &, int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/CPhCntAIWService.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  AIW service wrapper
+*
+*/
+
+#ifndef CPHCNTAIWSERVICE_H
+#define CPHCNTAIWSERVICE_H
+
+#include <e32base.h>
+#include <AiwCommon.h>
+
+#include "CPhCntService.h"
+#include "mphcntaiwservice.h"
+
+/**
+ *  Wrapper for phonebook's AIW service.
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CPhCntAiwService ):     
+    public CPhCntService, 
+    public MPhCntAiwService
+    {
+public:
+    
+    /**
+     * Static constructor.
+     *
+     * @since S60 v3.2
+     */
+    static CPhCntAiwService* NewL();
+    
+    /**
+     * Destructor.
+     *
+     * @since S60 v3.2
+     */
+    virtual ~CPhCntAiwService();
+
+// from base class MPhCntService
+    
+    /**
+     * From MPhCntService
+     *
+     * @since S60 v3.2
+     * @see MPhCntService
+     */  
+    void ExecuteRequestL( 
+        MPhCntServiceRequestParam& aServiceRequestParams, 
+        MPhCntServiceResult& aResult,
+        MPhCntAiwServiceObserver& aObserver );       
+	    
+	/**
+     * From MPhCntAiwService
+     *
+     * @since S60 v3.2
+     * @see MPhCntService
+     */  
+	void Cancel();
+	
+	/** 
+	 * Indicates if service request is ongoing.
+	 */
+	TBool IsRequestActive() const;	
+
+protected:
+
+	/**
+	 * Indication that MAiwNotifyCallback is called.
+	 */
+	void ResponseReceived( TInt aError );
+	
+protected:
+
+    CPhCntAiwService();
+
+    void ConstructL();
+   	
+    /**
+     * Observer 
+     * Not own.  
+     */
+	MPhCntAiwServiceObserver* iObserver;
+
+    };
+
+#endif // CPHCNTAIWSERVICE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/CPhCntContact.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,336 @@
+/*
+* 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:  Contact
+*
+*/
+
+
+#ifndef CPHCNTCONTACT_H
+#define CPHCNTCONTACT_H
+
+#include <e32base.h>
+#include "MPhCntMatch.h"
+#include "tphcntnumber.h"
+
+class MPhCntContactFields;
+class CPhCntFoundContacts;
+class MPhCntContactManager;
+class MVPbkContactLinkArray;
+class MVPbkStoreContact;
+class MPbk2ImageGetObserver;
+class MPbk2ImageOperation;
+class CPhCntVPbkContactId;
+class TPhCntSipURI;
+class CCntRawPhoneNumberExtractor;
+
+/**
+ *  Contact data.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CPhCntContact ) : public CBase, public MPhCntMatch 
+    {
+public:
+    
+    /**
+     * Static constructor.
+     *
+     * @since S60 v3.1
+     * @param aContactFields Contact fields, takes ownership.
+     * @param aContactManager Contact manager.
+     */
+    static CPhCntContact* NewL( 
+        MPhCntContactFields* aContactFields,
+        MPhCntContactManager& aContactManager );
+    
+    /**
+     * Destructor.
+     */
+    ~CPhCntContact();
+    
+public:
+
+    /** 
+     * The number, which was used to match this contact, should be
+     * set here.
+     *
+     * @since S60 v3.1
+     * @param aNumber Number, which was used to match this contact.
+     */
+    void SetOriginalNumberL( const TDesC& aNumber );
+    
+    /**
+     * Gives the original number used for matching this contact.
+     * 
+     * @since S60 v3.1
+     * @return Origianl number used for matching this contact.
+     */
+    const TDesC& OriginalNumber() const;
+    
+    /**
+     * Sets the owner of this contact.
+     *
+     * @since S60 v3.1
+     * @param aContactOwner Owner of this contact.
+     */
+    void SetOwner( CPhCntFoundContacts* aContactOwner );
+    
+    /**
+     * Increase reference count.
+     *
+     * @since S60 v3.1
+     */
+    void IncreaseReferenceCount();
+    
+    /**
+     * Gives all phone numbers that this contact has.
+     * 
+     * @since S60 v3.2
+     * @return All phone numbers contact has.
+     */
+    virtual const RArray<TPhCntNumber>& AllNumbers() const;
+    
+    /**
+     * Gives DTMF number, which was selected by user.
+     *
+     * @since S60 v3.2
+     * @return DTMF number or empty descriptor if dmtf
+     * was not defined for this contact.
+     */
+    virtual TPtrC Dtmf() const;
+    
+    /**
+     * Sets the number that matched to the original number.
+     * 
+     * @since S60 v3.1
+     * @param aNumber Number.
+     */
+    void SetMatchedVoipNumber( const TPhCntSipURI& aSipUri );
+
+    
+// From base class MPhCntMatch
+
+    /**
+     * From base class MPhCntMatch
+     * @since S60 v3.1
+     * @see MPhCntMatch
+     */
+    void Release();
+    
+    /**
+     * From base class MPhCntMatch
+     * @since S60 v3.1
+     * @see MPhCntMatch
+     */
+    MPhCntMatch::TNumberType NumberType() const;
+    
+    /**
+     * From base class MPhCntMatch
+     * @since S60 v3.1
+     * @see MPhCntMatch
+     */
+    CPhCntContactId* ContactId() const;
+    
+    /**
+     * From base class MPhCntMatch
+     * @since S60 v3.1
+     * @see MPhCntMatch
+     */
+    MVPbkContactLink* ContactLink() const;
+
+    /**
+     * From base class MPhCntMatch
+     * @since S60 v3.1
+     * @see MPhCntMatch
+     */
+    TCliType Cli( HBufC*& aCliText ) const;
+
+    /**
+     * From base class MPhCntMatch
+     * @since S60 v3.1
+     * @see MPhCntMatch
+     */
+    TPtrC FirstName() const;
+
+    /**
+     * From base class MPhCntMatch
+     * @since S60 v3.1
+     * @see MPhCntMatch
+     */
+    TPtrC LastName() const;
+
+    /**
+     * From base class MPhCntMatch
+     * @since S60 v3.1
+     * @see MPhCntMatch
+     */
+    TPtrC CompanyName() const;
+
+    /**
+     * From base class MPhCntMatch
+     * @since S60 v3.1
+     * @see MPhCntMatch
+     */
+    TPtrC Number() const;
+
+	/**
+     * Finds a phone number for the requested speed dial position.
+     * @since S60 v3.2
+     * @param aPosition The speed dial position.
+     * @return Phone number. Empty if there isn't one specified.
+     */
+    TPhCntNumber SpeedDialNumber( const TInt aPosition );
+
+    /**
+     * From base class MPhCntMatch
+     * @since S60 v3.1
+     * @see MPhCntMatch
+     */
+    TPtrC PersonalRingingTone() const;
+    
+    /**
+     * From base class MPhCntMatch
+     * @since S60 v3.1
+     * @see MPhCntMatch
+     */
+    TBool BelongsToGroups( 
+        const CArrayFix<TContactItemId>& aGroupArray ) const;
+
+    /**
+     * From base class MPhCntMatch
+     * @since S60 v3.1
+     * @see MPhCntMatch
+     */
+    HBufC* TextToSpeechTextL() const;
+    
+    /**
+     * From base class MPhCntMatch
+     * @since S60 v3.1
+     * @see MPhCntMatch
+     */
+    TPtrC CallText() const;
+
+    /**
+     * From base class MPhCntMatch
+     * @since S60 v3.1
+     * @see MPhCntMatch
+     */
+    TPtrC CallImage() const;
+    
+    /**
+     * From base class MPhCntMatch
+     * @since S60 v3.1
+     * @see MPhCntMatch
+     */
+    TBool HasThumbnailImage() const;  
+    
+    /**
+     * Loads the thumbnail of this contact.
+     * 
+     * @since S60 3.1
+     * @param aObserver Observer of the loading.
+     * @return Operation, that can be canceled by deleting it. Ownership is given.
+     */
+    MPbk2ImageOperation* LoadThumbnailL(
+        MPbk2ImageGetObserver& aObserver ); 
+        
+    /**
+     * From base class MPhCntMatch
+     * @since S60 v3.2
+     * @see MPhCntMatch
+     */
+    CDesCArray& AllDtmfNumbers() const;          
+        
+      
+        
+protected:
+        
+    CPhCntContact(
+        MPhCntContactFields* aContactFields,
+        MPhCntContactManager& aContactManager );
+    
+    void ConstructL();
+    
+    /**
+     * Determines if this contact belongs to a group of contacts.
+     * 
+     * @since S60 v3.1.
+     * @param aGroup Array of contact links, which defines a group.
+     * @return ETrue - This contact belongs to group.
+     * EFalse - This contact does not belong to group.
+     */
+    TBool BelongsToGroupsL( MVPbkContactLinkArray* aGroups ) const;
+
+private:
+    
+    /**
+     * Get number type from number that matches with supplied number 
+     * @since S60 v3.2
+     * @param aNumber Number which type is unknown 
+     * @return Number type
+     */
+    MPhCntMatch::TNumberType NumberType( const TDesC& aNumber ) const;
+            
+protected: // Data
+    
+    /**
+     * Contacts fields
+     * Own.
+     */
+    MPhCntContactFields* iContactFields;
+    
+    /** 
+     * Number, which was used for matching this contact.
+     * Own.
+     */
+    HBufC* iOriginalNumber;
+    
+    /**
+     * Owner of this contact.
+     * Not Own.
+     */
+    CPhCntFoundContacts* iOwner;
+    
+    /**
+     * Number of references of this object.
+     */
+    TInt iReferenceCount;
+    
+    /**
+     * Contact manager.
+     * Not own.
+     */
+    MPhCntContactManager& iContactManager;
+    
+    /**
+     * Contact identifier.
+     * own.
+     */
+    CPhCntVPbkContactId* iContactId;
+    
+    /**
+     * Matched voip number.
+     * own.
+     */
+    HBufC* iMatchedVoipNumber;
+
+    /**
+     * Number extractor.
+     * Own.
+     */
+    CCntRawPhoneNumberExtractor* iNumberExtractor;
+    };
+
+#endif // CPHCNTCONTACT_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/CPhCntContactManager.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,362 @@
+/*
+* 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:  Offers services from phonebook.
+*
+*/
+
+#ifndef CPHCNTCONTACTMANAGER_H
+#define CPHCNTCONTACTMANAGER_H
+
+#include <e32base.h>
+#include <MVPbkContactStoreListObserver.h>
+#include "MPhCntContactManager.h"
+#include "mphcntvoipcontactfinder.h"
+
+class CVPbkContactManager;
+class CVPbkContactStoreUriArray;
+class MPbk2ContactNameFormatter;
+class CPbk2SortOrderManager;
+class CVPbkContactIdConverter;
+class CVPbkSpeedDialAttribute;
+class CPbk2ImageManager;
+class CVPbkFieldTypeRefsList;
+class CPhCntContactStoreUris;
+class MPhCntStoreLoaderObserver;
+
+/**
+ *  Offers services from phonebook.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CPhCntContactManager ): 
+    public CBase, 
+    public MPhCntContactManager, 
+    public MVPbkContactStoreListObserver,
+    public MPhCntVoipContactFinder
+    {
+public:
+    
+    /**
+     * Static constructor.
+     *
+     * @since S60 v3.1
+     */
+    static CPhCntContactManager* NewL();
+    
+    /**
+     * Destructor.
+     *
+     * @Since S60 v3.1
+     */
+    ~CPhCntContactManager();
+    
+    /**
+     * Gives reference to contact manager.
+     *
+     * @since S60 v3.2
+     * @return Contact manager.
+     */
+    CVPbkContactManager& ContactManager() const;
+    
+    /**
+     * Return list of additional contact stores
+     * @since S60 v3.2
+     * @return Array of additional contact stores
+     */
+    const CVPbkContactStoreUriArray& AdditionalContactStoreUris();
+
+    
+// From base class MPhCntContactManager
+
+	/**
+	 * From MPhCntContactManager.
+	 *
+	 * @since S60 v3.1
+	 * @see MPhCntContactManager.
+	 */
+    MVPbkContactOperationBase* RetrieveContactL(
+        const MVPbkContactLink& aLink,
+        MVPbkSingleContactOperationObserver& aObserver );
+       
+    /**
+	 * From MPhCntContactManager.
+	 *
+	 * @since S60 v3.1
+	 * @see MPhCntContactManager.
+	 */ 
+    MVPbkContactStoreList& ContactStoresL() const;
+   
+    /**
+     * From MPhCntContactManager.
+	 *
+	 * @since S60 v3.1
+	 * @see MPhCntContactManager.
+	 */
+    MPhCntContactMatchStrategy* CreateContactMatchStrategyL(
+            MVPbkContactFindObserver& aObserver,
+            TBool aRemoveDuplicates );
+   
+    /**
+     * From MPhCntContactManager.
+     *
+     * @since S60 v3.1
+     * @see MPhCntContactManager.
+     */         
+    MPbk2ContactNameFormatter& ContactNameFormatter();
+   
+    /**
+     * From MPhCntContactManager.
+     *
+     * @since S60 v3.1
+     * @see MPhCntContactManager.
+     */
+    MVPbkContactLinkArray* ConvertContactIdsToLinksL(  
+        const CArrayFix<TContactItemId>& aContactId ) const;
+    
+    /**
+     * From MPhCntContactManager.
+     *
+     * @since S60 v3.1
+     * @see MPhCntContactManager.
+     */    
+    MVPbkContactLink* ConvertContactIdToLinkL( 
+        TContactItemId aContactId ) const;   
+        
+    /**
+     * From MPhCntContactManager.
+     *
+     * @since S60 v3.1
+     * @see MPhCntContactManager.
+     */
+    TContactItemId ConvertContactLinkToContactId(
+        const MVPbkContactLink& aContactLink ) const;
+    
+    /**
+     * From MPhCntContactManager.
+     *
+     * @since S60 v3.2
+     * @see MPhCntContactManager.
+     */   
+    MVPbkContactLink* ConvertDescriptorToLinkL( const TDesC8& aPackedLink ) const;
+     
+    /**
+     * From MPhCntContactManager.
+     *
+     * @since S60 v3.1
+     * @see MPhCntContactManager.
+     */   
+    MVPbkContactOperationBase* RetrieveSpeedDialContactLinkL(
+        const TInt aSpeedDialPosition,
+        MVPbkContactFindObserver& aObserver );
+        
+    /**
+     * From MPhCntContactManager.
+     *
+     * @since S60 v3.2
+     * @see MPhCntContactManager.
+     */   
+	TBool HasSpeedDialL(        
+		const TInt aSpeedDialPosition,
+		const MVPbkStoreContactField& aField );
+    
+    /**
+     * Retrieves contacts thumbnail. To cancel the thumbnail
+     * fetch, delete operation.
+     *
+     * @since S60 v3.1
+     * @param aContact Contact, which thumbnail is fetched.
+     * @param aThumbnailFieldType Thumbnails field type.
+     * @param aObserver Observer of the fetch.
+     */
+    MPbk2ImageOperation* RetrieveImageL(
+        MVPbkStoreContact& aStoreContact,
+        const MVPbkFieldType& aThumbnailFieldType,
+        MPbk2ImageGetObserver& aObserver );
+    
+    /**
+     * From MPhCntContactManager.
+     *
+     * @since S60 v3.2
+     * @see MPhCntContactManager.
+     */   
+    CVPbkFieldTypeSelector* CreateFieldTypeSelectorL() const;
+    
+    /**
+     * From MPhCntContactManager.
+     *
+     * @since S60 v3.2
+     * @see MPhCntContactManager.
+     */  
+    void AppendFilterToSelectorL( CVPbkFieldTypeSelector& aSelector,
+        TVPbkContactViewFilter aFilter );
+
+    /**
+     * From MPhCntContactManager. 
+     *
+     * @since   S60 v9.1
+     * @see MPhCntContactManager.
+     */
+    void LoadContactStoreL( const TDesC8& aContactLink,
+        MPhCntStoreLoaderObserver& aObserver );
+
+    /**
+     * From MPhCntContactManager. 
+     *
+     * @since   S60 v9.1
+     * @see MPhCntContactManager.
+     */    
+    void LoadContactStoreWithUriL(
+        const TDesC& aStoreUri,
+        MPhCntStoreLoaderObserver& aObserver );
+ 
+    /**
+     * From MPhCntContactManager. 
+     *
+     * @since   S60 v9.1
+     * @see MPhCntContactManager.
+     */
+    CPhCntContactStoreUris& ContactStoreUrisL();
+	
+// From base class MPhCntContactFinder
+    
+    /**
+     * From base class MPhCntVoipContactFinder
+     * Finds voip contacts, with given URI or partial URI. To cancel
+     * the find, destroy the returned operation.
+     * @since S60 v3.1
+     * @param aSipURI Sip uri defining wanted matches.
+     * @param aObserver Observer of the operation.
+     * @return Operation.
+     */
+    MVPbkContactOperationBase* FindVoipContactsL( 
+        const TDesC& aSipURI,
+        MVPbkContactFindObserver& aObserver ) const;
+
+// From base class MVPbkContactStoreListObserver
+    
+    /**
+     * From MVPbkContactStoreListObserver.
+     * 
+     * @since S60 v3.1
+     * @see MVPbkContactStoreListObserver
+     */	
+    void OpenComplete();
+    
+// From base class MVPbkContactStoreObserver 
+
+    /**
+     * From MVPbkContactStoreObserver.
+     * 
+     * @since S60 v3.1
+     * @see MVPbkContactStoreObserver
+     */
+    void StoreReady( MVPbkContactStore& aContactStore );
+    
+    /**
+     * From MVPbkContactStoreObserver.
+     * 
+     * @since S60 v3.1
+     * @see MVPbkContactStoreObserver
+     */
+    void StoreUnavailable( MVPbkContactStore& aContactStore, TInt aReason );
+    
+    /**
+     * From MVPbkContactStoreObserver.
+     * 
+     * @since S60 v3.1
+     * @see MVPbkContactStoreObserver
+     */
+    void HandleStoreEventL(
+        MVPbkContactStore& aContactStore, 
+        TVPbkContactStoreEvent aStoreEvent);
+    
+private:
+        
+    CPhCntContactManager();
+    
+    void ConstructL();
+    
+    /**
+     * Adds voip field types.
+     * 
+     * @since S60 v3.1
+     * @param aVoipFieldType VoIP field type.
+     */
+    void AddVoipFieldTypeL( const MVPbkFieldType* aVoipFieldType );
+    
+private:
+
+    /**
+     * Contact manager.
+     * Own.
+     */
+    CVPbkContactManager* iContactManager;
+    
+    /**
+     * Contact name formatter.
+     * Own.
+     */
+    MPbk2ContactNameFormatter* iContactNameFormatter;
+    
+    /**
+     * Sort order.
+     * Own.
+     */
+    CPbk2SortOrderManager* iSortOrder;
+    
+    /**
+     * Contact id converter.
+     * Own.
+     */
+    CVPbkContactIdConverter* iContactIdConverter;
+    
+    /**
+     * Contact store.
+     * Not own.
+     */
+    MVPbkContactStore* iContactDBStore;
+    
+    /**
+     * Speed dial.
+     * Own 
+     */
+     CVPbkSpeedDialAttribute* iSpeedDialAttribute;
+     
+     /**
+      * For retrieveing thumbnail from contact.
+      * own.
+      */
+     CPbk2ImageManager* iImageManager;
+     
+     /**
+      * For finding voip contacts.
+      * Own.
+      */
+     CVPbkFieldTypeRefsList* iVoipFieldTypeList;
+    
+     /**
+      * Contact store uris
+      * Own.
+      */
+     CPhCntContactStoreUris* iContactStoreUris;
+    
+     /**
+      * Store loader observer.
+      * Not own.
+      */
+     MPhCntStoreLoaderObserver* iStoreLoaderObserver;
+    };
+
+#endif // CPHCNTCONTACTMANAGER_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/CPhCntContactStores.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,162 @@
+/*
+* 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:  Contact store
+*
+*/
+
+
+#ifndef CPHCNTCONTACTSTORES_H
+#define CPHCNTCONTACTSTORES_H
+
+#include <e32base.h>
+#include <MVPbkContactStoreListObserver.h>
+#include <MVPbkSingleContactOperationObserver.h>
+#include "MPhCntContactStores.h"
+
+class MVPbkContactLink;
+class MPhCntContactManager;
+class MPhCntContactFetchObserver;
+
+
+/**
+ *  Contact store, where contact can be fetched.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CPhCntContactStores ): 
+    public CBase, 
+    public MPhCntContactStores,
+    public MVPbkSingleContactOperationObserver
+    {
+public:
+
+    /**
+     * Static constructor.
+     * 
+     * @since S60 v3.1
+     * @param aContactManager Contact manager.
+     */
+    static CPhCntContactStores* NewL( MPhCntContactManager& aContactManager );
+    
+    /**
+     * Destructor.
+     *
+     * @since S60 v3.1
+     */
+    ~CPhCntContactStores();
+    
+// from base class MPhCntContactStores
+
+    /**
+     * From MPhCntContactStores.
+     *
+     * @since S60 v3.1
+     * @see MPhCntContactStores
+     */
+    TBool IsRequestActive() const;
+    
+    /**
+     * From MPhCntContactStores.
+     *
+     * @since S60 v3.1
+     * @see MPhCntContactStores
+     */
+    void CancelRequest();
+    
+    /**
+     * From MPhCntContactStores.
+     *
+     * @since S60 v3.1
+     * @see MPhCntContactStores
+     */
+    void FetchContactL( const MVPbkContactLink& aLink, 
+        MPhCntContactFetchObserver& aObserver );
+    
+    /**
+     * From MPhCntContactStores.
+     *
+     * @since S60 v3.1
+     * @see MPhCntContactStores
+     */
+    void FetchFirstContactL( const TDesC8& aContactLinks,
+        MPhCntContactFetchObserver& aObserver );
+    
+    /**
+     * From MPhCntContactStores.
+     *
+     * @since S60 v3.1
+     * @see MPhCntContactStores
+     */    
+    CVPbkContactLinkArray* CreateContactLinkArrayL( 
+        const TDesC8& aContactLinks );
+
+// From base class MVPbkSingeContactOperationObserver
+
+    /**
+     * From MVPbkSingeContactOperationObserver.
+     *
+     * @since S60 v3.1
+     * @see MVPbkSingeContactOperationObserver
+     */
+    void VPbkSingleContactOperationComplete(
+        MVPbkContactOperationBase& aOperation,
+        MVPbkStoreContact* aContact);
+    
+    /**
+     * From MVPbkSingeContactOperationObserver.
+     *
+     * @since S60 v3.1
+     * @see MVPbkSingeContactOperationObserver
+     */
+    void VPbkSingleContactOperationFailed(
+        MVPbkContactOperationBase& aOperation, 
+        TInt aError );
+        
+protected:
+    
+    CPhCntContactStores( MPhCntContactManager& aContactManager );
+    
+    void ConstructL();
+    
+private:
+
+    /**
+    * Handle to virtual phonebook.
+    * Not Own.
+    */
+    MPhCntContactManager& iContactManager;
+    
+    /**
+    * Contact fetch operation observer.
+    * Not own.
+    */
+    MPhCntContactFetchObserver* iContactFetchObserver;
+    
+    /**
+    * Contact operation
+    * Own
+    */
+    MVPbkContactOperationBase* iRetrieveContactOperation;
+ 
+    /** 
+     * Link is stored here during the fetch.
+     * Own.
+     */    
+    MVPbkContactLink* iLink;
+            
+    };
+
+
+#endif // CPHCNTCONTACTSTORES_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/CPhCntMatcherImpl.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,263 @@
+/*
+* 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:  Matcher implementation
+*
+*/
+
+#ifndef CPHCNTCNTMATCHERIMPL_H
+#define CPHCNTCNTMATCHERIMPL_H
+
+#include <e32base.h>
+#include "CPhCntMatcher.h"
+#include "MVPbkContactLink.h"
+
+class MPhCntContactStores;
+class CPhCntContactManager;
+class CPhCntContact;
+class CPhCntMatchContact;
+class CPhCntFetchContact;
+class MVPbkContactLink;
+class CPhCntFoundContacts;
+class CCntNumberParser;
+class MPhoneCntPbkOwner;
+class MPhCntContactMatchStrategy;
+class CVPbkContactStoreUriArray;
+
+
+/**
+ * CPhCntMatcher implementation.
+ *
+ * @since S60 v3.1
+ * @lib PhoneCntFinder.lib.
+ */
+NONSHARABLE_CLASS( CPhCntMatcherImpl ) : public CPhCntMatcher
+    {
+public:
+
+	/**
+	 * Static constructor.
+	 *
+	 * @since S60 v3.1
+	 * @param aOwner Phonebook owner.
+	 */
+    static CPhCntMatcherImpl* NewL( const MPhoneCntPbkOwner& aOwner );
+
+    /**
+     * Destructor.
+     *
+     * @since S60 v3.1
+     */
+    ~CPhCntMatcherImpl();
+
+// From base class CPhCntMatcher
+
+    /**
+     * From base class CPhCntMatcher
+     *
+     * @since S60 v3.1
+     * @see CPhCntMatcher.
+     */
+    TInt MatchNumber(
+        MPhCntMatch*& aMatch,
+        const TDesC& aTelNumber );
+
+    /**
+     * From base class CPhCntMatcher
+     *
+     * @since S60 v3.1
+     * @see CPhCntMatcher.
+     */
+    TInt MatchNumber(
+        MPhCntMatch*& aMatch,
+        const TDesC& aTelNumber,
+        const CPhCntContactId& aContactId );
+
+
+// NOT USED BY ANYONE?
+        /**
+    * 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.
+    * @param aFieldId Current field id (index from CnmModel);
+    * @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
+    */
+    TInt MatchNumber(
+        MPhCntMatch*& /*aMatch*/,
+        const TDesC& /*aTelNumber*/,
+        const CPhCntContactId& /*aContactId*/,
+        MPhCntMatch::TNumberType /*aNumberType*/ )
+        {
+        return KErrNotFound;
+        };
+
+    /**
+    * 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,
+        MDesCArray* aContactStoreUris,
+        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 );
+
+
+    /**
+     * From CPhCntMatcher
+     * 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.
+     */
+    TBool HasCSNumbers(
+        const CPhCntContactId& aContactId );
+
+private:
+
+    /**
+     * Tries to get a contact with known number.
+     *
+     * @since S60 v3.1
+     * @param aMatch Contact
+     * @param aTelNumber Phone number.
+     * @return Error code.
+     */
+    TInt GetContactL(
+        MPhCntMatch*& aMatch,
+        const TDesC& aTelNumber );
+
+    /**
+     * Match contacts against product specific stores.
+     *
+     * @since S60 v3.2
+     * @param aLinkArray Array of contacts to match
+     * @return Error code.
+     */
+    TInt MatchFromAdditionalStore( const MVPbkContactLinkArray& aLinkArray ) const;
+
+
+protected:
+
+    CPhCntMatcherImpl( const MPhoneCntPbkOwner& aOwner );
+
+    void ConstructL();
+
+    /**
+     * Delayed on-demand based construction (grabs leaves).
+     * Should be called from functions where a member attribute
+     * (those constructed here) is referenced.
+     */
+    TInt CreateMatcher();
+
+    /**
+     * Delayed on-demand based construction (leaving).
+     */
+    void DoCreateMatcherL();
+
+    /**
+     * Fetches contact pointed by aContactLink from
+     * contact stores.
+     *
+     * @since S60 v3.1
+     * @param aMatch Fetched contact. Is null if contact was not found.
+     * @param aContactLink Link to the contact.
+     * @param aOrigNumber Phone number that was used
+     * to find the contact.
+     * @return Error code.
+     */
+    TInt FetchContact(
+        CPhCntContact*& aMatch,
+        const MVPbkContactLink& aContactLink,
+        const TDesC& aOrigNumber );
+
+
+
+protected: // Data
+
+    /**
+     * Already found contacs.
+     * Own.
+     */
+    CPhCntFoundContacts* iFoundContacts;
+
+    /**
+     * Contact mathching operation.
+     * Own.
+     */
+    CPhCntMatchContact* iMatchContact;
+
+
+    /**
+     * Contact fetching operation.
+     * Own.
+     */
+    CPhCntFetchContact* iFetchContact;
+
+
+    /**
+     * Contact manager.
+     * Not own.
+     */
+    CPhCntContactManager& iContactManager;
+
+private: // Data
+
+    /**
+     * Contact stores
+     * Own.
+     */
+    MPhCntContactStores* iContactStores;
+
+    /**
+     * Owner of phone book.
+     * Not own.
+     */
+    const MPhoneCntPbkOwner& iPbkOwner;
+
+    /**
+     * Match strategy used for CS calls.
+     * Own.
+     */
+    MPhCntContactMatchStrategy* iCSMatchStrategy;
+
+    };
+
+#endif // CPHCNTCNTMATCHERIMPL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/CPhCntService.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  AIW service wrapper
+*
+*/
+
+#ifndef CPHCNTSERVICE_H
+#define CPHCNTSERVICE_H
+
+#include <e32base.h>
+#include <AiwCommon.h>
+
+#include "cphcntasynctosync.h"
+#include "MPhCntService.h"
+#include "tphcntaiwserviceobserver.h"
+
+class CAiwServiceHandler;
+class MPhCntServiceObserver;
+class CAiwGenericParamList;
+
+/**
+ *  Wrapper for phonebook's AIW service.
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CPhCntService ):     
+    public CPhCntAsyncToSync, 
+    public MPhCntService,
+    public MPhCntAiwServiceCompleteObserver
+    {
+public:
+    
+    /**
+     * Static constructor.
+     *
+     * @since S60 v3.1
+     */
+    static CPhCntService* NewL();
+    
+    /**
+     * Destructor.
+     *
+     * @since S60 v3.1
+     */
+    virtual ~CPhCntService();
+
+
+// from base class MPhCntService
+		
+    /**
+     * From MPhCntService
+     *
+     * @since S60 v3.1
+     * @see MPhCntService
+     */
+    void ExecuteRequestL( 
+        MPhCntServiceRequestParam& aServiceRequestParams, 
+        MPhCntServiceResult& aResult ); 
+
+// from base class MPhCntAiwServiceCompleteObserver
+    
+    /**
+     * From MPhCntAiwServiceCompleteObserver.
+     *
+     * Notification that AIW service request is done.
+     *
+     * @since S60 v3.2
+     * @see MPhCntAiwServiceCompleteObserver
+     */
+    void ServiceRequestComplete( TInt aError );
+
+protected:
+
+    /**
+     * Attach AIW criterias
+     */
+	void AttachCriteriasL();
+	
+	/**
+	 * Cancels request.
+	 * @return Error code.
+	 */
+	TInt CancelRequest();
+	
+protected:
+
+    CPhCntService();
+
+    void ConstructL();
+    
+    /**
+     * From CPhCntAsyncToSync.
+     *
+     * @since S60 v3.2
+     * @see CPhCntAsyncToSync.    
+     */
+    void DoMakeAsyncRequestL();
+    
+    void SetRequestAndResult( 
+        MPhCntServiceRequestParam& aServiceRequestParams, 
+        MPhCntServiceResult& aResult );
+    
+protected: // Protected because of unit testing.
+
+	/**
+	 * Result of the request.
+	 * Now own.
+	 */
+	MPhCntServiceResult* iResult;
+	
+	/**
+	 * Request params.
+	 * Not own.
+	 */
+	MPhCntServiceRequestParam* iParams;
+	
+private: // data
+
+    /**
+     * Handle to AIW service
+     * Own. 
+     */
+   	CAiwServiceHandler* iAiwService;
+	
+	/**
+	 * Criteria array.
+	 * Own.
+	 */
+	RCriteriaArray iCriteriaArray;
+	
+	/**
+	 * Options for the command, see TAiwServiceCmdOptions in AiwCommon.hrh.
+	 */	
+	TUint iCommandOptions;
+	
+	/**
+	 * Indication for that request has been canceled by client.
+	 */
+	TBool* iClientCanceledRequest;
+	
+protected:
+	
+	/**
+	 * Observes the AIW service.
+	 * Protected to ease unit testing.
+	 */
+	TPhCntAiwServiceObserver iAiwServiceObserver;
+
+    };
+
+#endif // CPHCNTSERVICE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/CPhCntSingleItemFetchService.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,182 @@
+/*
+* 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:  Service for fetching single contact field.
+*
+*/
+
+
+#ifndef CPHCNTSINGLEITEMFETCHSERVICE_H
+#define CPHCNTSINGLEITEMFETCHSERVICE_H
+
+#include <e32base.h>
+#include "CPhCntSingleItemFetch.h"
+
+class MPhCntContactStores;
+class MPhCntPhonebookServices;
+class MPhCntContactManager;
+class CPhCntServiceRequestParamFactory;
+
+NONSHARABLE_CLASS( CPhCntSelectionImpl ) : public CPhCntSelection
+    {
+public:
+    
+    /**
+     * Static constructor.
+     * Takes ownership of the parameters.
+     */
+    static CPhCntSelectionImpl* NewL( 
+        const TDesC& aNumber,
+        const CPhCntContactId& aContactId );
+        
+    ~CPhCntSelectionImpl();
+    
+    /**
+     * From CPhCntSelection
+     * @since s60 v3.2
+     * @see CPhCntSelection
+     */
+    const TDesC& Number() const;
+
+    /**
+     * From CPhCntSelection
+     * @since s60 v3.2
+     * @see CPhCntSelection
+     */
+    const CPhCntContactId& ContactId() const;
+    
+private:
+
+    CPhCntSelectionImpl();
+    
+    void ConstructL(
+        const TDesC& aNumber,
+        const CPhCntContactId& aContactId );
+        
+private: // Data
+
+    /**
+     * Number.
+     * Own.
+     */
+    HBufC* iNumber;
+
+    /**
+     * Contact identifier.
+     * Own.
+     */
+    CPhCntContactId* iContactId;
+    
+    };
+
+/**
+ * Service for fetching single contact item from phonebook.
+ *
+ * @since S60 v3.1
+ * @lib PhoneCntFinder.lib
+ */
+NONSHARABLE_CLASS( CPhCntSingleItemFetchService ): public CPhCntSingleItemFetch
+    {
+public:
+   	
+   	/**
+   	 * Static constructor.
+   	 *
+   	 * @since S60 v3.1
+   	 * @param aServices Phonebooks services
+   	 * @param aContactManager Contact manager
+   	 */     
+    static CPhCntSingleItemFetchService* NewL(
+        MPhCntContactStores& aServices,
+        MPhCntContactManager& aContactManager );
+
+    /**
+     * Destructor.
+     * 
+     * @since S60 v3.1
+     */
+    ~CPhCntSingleItemFetchService();
+    
+// From base class CPhCntSingleItemFetch
+
+    /**
+    * From base class CPhCntSingleItemFetch
+    *
+    * @see CPhCntSingleItemFetch
+    * @since S60 3.1
+    */
+    TInt FetchLD( TFetchParams& aParams );
+    
+    /**
+	* From base class CPhCntSingleItemFetch
+    *
+    * @see CPhCntSingleItemFetch
+    * @since S60 3.1
+	*/
+    TInt FetchPhoneNumberLD( 
+    	const TDesC8& aContactLink, 
+    	const CPhCntSingleItemFetch::TCallType aCallType,
+    	HBufC*& aNumber,
+    	HBufC8*& aFieldLink );
+    
+    /**
+	 * From base class CPhCntSingleItemFetch
+     *
+     * @see CPhCntSingleItemFetch
+     * @since S60 3.2
+	 */	
+    CPhCntSelection* SelectPhoneNumberLD();
+        
+private:
+
+    /**
+    * Sets return values (aParams) for client when fetching
+    * is completed.
+    * 
+    * @since S60 3.1
+    * @param aParams Parameters from client.
+    * @returns Possible error value
+    */
+    TInt SetFetchParams( TFetchParams& aParams,
+        const TDesC& aPhoneNumber ) const;
+        
+protected:
+        
+    CPhCntSingleItemFetchService();
+    
+    void ConstructL( 
+        MPhCntContactStores& aContactStores,
+        MPhCntContactManager& aContactManage );
+        
+protected:
+
+    /**
+     * Service to fetch the phone number.
+     * Own.
+     */
+    MPhCntPhonebookServices* iServices;
+    
+    /** 
+     * Indication if this is destroyed.
+     */
+    TBool* iDestroyed;
+    
+    /**
+     * Factory to create request params.
+     * Own.
+     */
+    CPhCntServiceRequestParamFactory* iParamFactory;
+
+    };
+
+#endif // CPHCNTSINGLEITEMFETCHSERVICE_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/MPhCntContactFetchObserver.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Observer interface for receiving contact.
+*
+*/
+
+
+#ifndef MPHCNTCONTACTFETCHOBSERVER_H
+#define MPHCNTCONTACTFETCHOBSERVER_H
+
+class CPhCntContact;
+
+/**
+ *  Observer interface for receiving contact.
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since S60 v3,1
+ */
+NONSHARABLE_CLASS( MPhCntContactFetchObserver ) 
+	{
+	
+public:
+
+    /**
+     * Indication that contact has been received.
+     * 
+     * aContact is NULL if getting the contact failed.
+     *
+     * @since S60 v3.1
+     * @param aContact Received contact. It is null, if there was an error
+     * during reception of the contact. Ownership is given to observer.
+     * @param aError Error code. 
+     */
+     virtual void ContactReceived( CPhCntContact* aContact, TInt aError ) = 0;
+
+    };
+
+
+#endif // MPHCNTCONTACTFECTHOBSERVER_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/MPhCntContactFetcherObserver.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,52 @@
+/*
+* 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:  Definition of MPhCntContactFetcherObserver class.
+*
+*/
+
+
+#ifndef MPHCNTCONTACTFETCHEROBSERVER_H
+#define MPHCNTCONTACTFETCHEROBSERVER_H
+
+class MVPbkStoreContact;
+
+/**
+ *  ?one_line_short_description
+ *
+ *  ?more_complete_description
+ *
+ *  @lib ?library
+ *  @since S60 ?S60_version *** for example, S60 v3.0
+ */
+NONSHARABLE_CLASS( MPhCntContactFetcherObserver )
+	{
+	
+public:
+
+    /**
+     * aContact is NULL if getting the contact failed.
+     *
+     * @since S60 ?S60_version
+     * @param ?arg1 ?description
+     * @param aContactLinks Links to contacts. Client should take a copy from the links, because
+     * aContactLinks is not valid after call to this method. 
+     * AContactLinks is length may be 0.
+     * @return ?description
+     */
+     virtual void PhoneNumberReceived( const TDesC& aPhoneNumber ) = 0;
+
+    };
+
+
+#endif // MPHCNTCONTACTFETCHEROBSERVER_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/MPhCntContactManager.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,229 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Interface for phonebook services.
+*
+*/
+
+
+#ifndef MPHCNTCONTACTMANAGER_H
+#define MPHCNTCONTACTMANAGER_H
+
+#include <cntdef.h>
+#include <VPbkContactView.hrh>
+
+class MVPbkContactLink;
+class MVPbkSingleContactOperationObserver;
+class MVPbkContactOperationBase;
+class MVPbkContactStoreList;
+class MVPbkContactFindObserver;
+class MPhCntContactMatchStrategy;
+class MPbk2ContactNameFormatter;
+class CVPbkContactIdConverter;
+class MVPbkContactLinkArray;
+class MVPbkContactFindObserver;
+class MPbk2ImageOperation;
+class MPbk2ImageGetObserver;
+class MVPbkFieldType;
+class MVPbkStoreContact;
+class MVPbkStoreContactField;
+class CVPbkFieldTypeSelector;
+class MPhCntStoreLoaderObserver;
+class CPhCntContactStoreUris;
+
+/**
+ * Interface for phonebook services.
+ *
+ * @since S60 v3.1
+ * @lib PhoneCntFinder.lib
+ */
+NONSHARABLE_CLASS(  MPhCntContactManager )
+    {
+public:
+    
+    /**
+     * Retrieves contact from phonebook.
+     * 
+     * @since S60 v3.1
+     * @param aLink Link to the contact.
+     * @param aObserver Observer for the retrieval.
+     * @return Handle to the retrieval operation.
+     */
+    virtual MVPbkContactOperationBase* RetrieveContactL(
+        const MVPbkContactLink& aLink,
+        MVPbkSingleContactOperationObserver& aObserver) = 0;
+        
+    /**
+     * Gives the list of contact stores.
+     * 
+     * @since S60 v3.1
+     * @return List of contact stores.
+     */
+    virtual MVPbkContactStoreList& ContactStoresL() const = 0;
+    
+    /**
+     * Factory method for creating contact match strategy.
+     *
+     * @since S60 v3.1
+     * @param aObserver Contact match strategy observer.
+     * @return New contact match strategy instance.
+     */
+    virtual MPhCntContactMatchStrategy* CreateContactMatchStrategyL(
+        MVPbkContactFindObserver& aObserver,
+        TBool aRemoveDuplicates )= 0;
+    
+    /**
+     * Gives access to contact name formatter.
+     *
+     * @since S60 v3.1
+     * @return Contact name formatter.
+     */    
+    virtual MPbk2ContactNameFormatter& ContactNameFormatter() = 0;
+    
+    /**
+     * Converts contact ids to contact links.
+     * 
+     * @since S60 v3.1
+     * @param aContactId Array of contact ids.
+     * @return Array of contact links. Ownership given.
+     */
+    virtual MVPbkContactLinkArray* ConvertContactIdsToLinksL(  
+        const CArrayFix<TContactItemId>& aContactId ) const = 0;
+        
+    /**
+     * Converts contact id to contact link.
+     * 
+     * @since S60 v3.1
+     * @param aContactId Contact id from Contact DB.
+     * @return Concact link, ownership is given to caller.
+     * If the aContactId is KNullContactId then then returned value is NULL.
+     */
+    virtual MVPbkContactLink* ConvertContactIdToLinkL( 
+        TContactItemId aContactId ) const = 0;
+        
+    /**
+     * Converts contact link to contact id.
+     *
+     * @since S60 v3.1
+     * @param aContactLink Reference to contactlink.
+     * @return Contact id.
+     */
+    virtual TContactItemId ConvertContactLinkToContactId(
+        const MVPbkContactLink& aContactLink ) const = 0;
+        
+    /**
+     * Converts packed link descriptor to contact link.
+     * 
+     * @since S60 v3.2
+     * @param aPackeLink Link prepresented as desctiptor.
+     * @return Contact link. Returns null if aPackedLink length is 0.
+     */
+    virtual MVPbkContactLink* ConvertDescriptorToLinkL( 
+        const TDesC8& aPackedLink ) const = 0;
+        
+    /**
+     * Retrieves contact, which has been assinged to speeddial position
+     * aSpeedDialPosition.
+     *
+     * @since S60 v3.1
+     * @param aSpeedDialPosition Speed dial position.
+     * @param aObserver Observer for operation.
+     * @return Operation, ownership is given to caller.
+     */
+    virtual MVPbkContactOperationBase* RetrieveSpeedDialContactLinkL(
+        const TInt aSpeedDialPosition,
+        MVPbkContactFindObserver& aObserver ) = 0;
+
+	/**
+     * Indicates whether the speed dial attribute has been set for the given position.
+     *
+     * @since S60 v3.2
+     * @see MPhCntContactManager.
+     * @param aSpeedDialPosition Speed dial position.
+     * @param aField Field to be evaluated.
+     * @return ETrue if aField has a matching speed dial position,
+     *         EFalse otherwise.     
+     */    
+	virtual TBool HasSpeedDialL(      
+		const TInt aSpeedDialPosition,  
+		const MVPbkStoreContactField& aField ) = 0;        
+
+    /**
+     * Retrieves contacts image. To cancel the thumbnail
+     * fetch, delete operation.
+     *
+     * @since S60 v3.1
+     * @param aContact Contact, which image is fetched.
+     * @param aFieldType Field type.
+     * @param aObserver Observer of the fetch.
+     */
+    virtual MPbk2ImageOperation* RetrieveImageL(
+        MVPbkStoreContact& aStoreContact,
+        const MVPbkFieldType& aFieldType,
+        MPbk2ImageGetObserver& aObserver ) = 0;
+        
+    /** 
+     * Creates field type selector.
+     *
+     * @since S60 v3.2
+     */    
+    virtual CVPbkFieldTypeSelector* CreateFieldTypeSelectorL() const = 0;
+    
+    /**
+     * Appends filter to selector.
+     *
+     * @since S60 v3.2
+     * @param aSelector Selector to append the filter.
+     * @param aFilter The filter to be appended.
+     */
+    virtual void AppendFilterToSelectorL( CVPbkFieldTypeSelector& aSelector,
+        TVPbkContactViewFilter aFilter ) = 0;
+   
+    /**
+     * Loads the store specified in the contact link and adds the store to 
+     * the list of stores handled by this manager.
+     *
+     * @since   S60 v9.1
+     * @param   aContactLink    A contact link containing store to load.
+     * @param   aObserver       An observer for the loading process.
+     */
+    virtual void LoadContactStoreL( const TDesC8& aContactLink,
+        MPhCntStoreLoaderObserver& aObserver ) = 0;
+   
+    /**
+     * Loads the store specified by the URI and adds the store to 
+     * the list of stores handled by this manager.
+     *
+     * @since   S60 v9.1
+     * @param   aStoreUri       A URI of the store to load.
+     * @param   aObserver       An observer for the loading process.
+     */
+    virtual void LoadContactStoreWithUriL( 
+        const TDesC& aStoreUri,
+        MPhCntStoreLoaderObserver& aObserver ) = 0;
+		
+    /** 
+     * Return contact store uri's.
+     *
+     * @since S60 v9.1
+     */ 
+    virtual CPhCntContactStoreUris& ContactStoreUrisL() = 0;
+	
+protected:
+
+    MPhCntContactManager(){};
+    
+    virtual ~MPhCntContactManager() {};
+    };
+
+#endif 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/MPhCntContactStores.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Contact match strategy interface.
+*
+*/
+
+#ifndef MPHCNTCONTACTSTORES_H
+#define MPHCNTCONTACTSTORES_H
+
+class MVPbkContactLink;
+class MPhCntContactFetchObserver;
+class CVPbkContactLinkArray;
+class CVPbkPhoneNumberMatchStrategy;
+class MVPbkContactFindObserver;
+
+/**
+ * Contact stores interface.
+ *
+ * @lib PhoneCntFinder.lib
+ * @since S60 v3.1
+ */
+NONSHARABLE_CLASS( MPhCntContactStores ) 
+    {
+    
+public:
+
+    /**
+     * Destructor.
+     *
+     * @since v3.1
+     */
+    virtual ~MPhCntContactStores() {};
+    
+    /**
+     * Determines if request is pending.
+     * @since S60 v3.2
+     */
+    virtual TBool IsRequestActive() const = 0;
+    
+    /**
+     * Cancels outstanding request if any.
+     */
+    virtual void CancelRequest() = 0;
+    
+    /**
+     * Fetches contact, which is pointed by contact link from 
+     * currently open contact stores. Observer is notified
+     * after the contact has been fetched or fetch was not
+     * successfull. Note that new fetch should not be
+     * started before the existing fetch has completed.
+     *
+     * @since S60 v3.1
+     * @param aLink Link to the contact.
+     * @param aObserver Observer of the fetch.
+     */
+     
+    virtual void FetchContactL( const MVPbkContactLink& aLink, 
+        MPhCntContactFetchObserver& aObserver ) = 0;
+    
+    /**
+     * Creates contact link array from descriptor, which 
+     * defines contact links.
+     *
+     * @since S60 v3.1
+     * @param aContactLinks Contact links in descriptor.
+     * @return Array of contactlinks, ownership given.
+     */
+    virtual CVPbkContactLinkArray* CreateContactLinkArrayL( 
+        const TDesC8& aContactLinks ) = 0;
+    
+    /**
+     * Fetches first contact in contact links, which are defined
+     * by aContactLinks. Observer is notified
+     * after the contact has been fetched or fetch was not
+     * successfull. Note that new fetch should not be
+     * started before the existing fetch has completed.
+     *
+     * @since S60 v3.1
+     * @param aContactLinks Links to a contacts.
+     * @param aObserver Observer of the fetch.
+     */
+    virtual void FetchFirstContactL( const TDesC8& aContactLinks,
+        MPhCntContactFetchObserver& aObserver ) = 0;
+        
+    };
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/MPhCntPhonebookServices.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,138 @@
+/*
+* 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 phonebook services.
+*
+*/
+
+
+#ifndef MPHCNTPHONEBOOKSERVICES_H
+#define MPHCNTPHONEBOOKSERVICES_H
+
+#include <e32std.h>
+#include "CPhCntSingleItemFetch.h"
+
+class CPhCntContactId;
+class MPhCntServiceRequestParam;
+class CPhCntContact;
+
+
+/**
+ *  Interface for phonebook services.
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( MPhCntPhonebookServices )
+    {
+
+public:
+
+    /**
+     * Virtual destructor.
+     * 
+     * @since S60 v3.2
+     */
+    virtual ~MPhCntPhonebookServices() {};
+
+    /**
+     * Gets user selected phone number and contact id.
+     *
+     * @since S60 v3.2
+     * @param aContactId Contact id of the contact, may be null
+     * @param aPhoneNumber Phone number, may be null.
+     * @leaves KErrCancel - User canceled the fetch
+     *         Other system wide error codes.
+     */
+    virtual void GetUserSelectedPhoneNumberL( 
+        CPhCntContactId*& aContactId, 
+        HBufC*& aPhoneNumber ) = 0;
+
+    /**
+     * Gets user selected voip address and contact id.
+     *
+     * @since S60 v5.0
+     * @param aContactId Contact id of the contact, may be null
+     * @param aVoIPAddress voip address, may be null.
+     * @leaves KErrCancel - User canceled the fetch
+     *         Other system wide error codes.
+     */
+    virtual void GetUserSelectedVoIPAddressL( 
+        CPhCntContactId*& aContactId, 
+        HBufC*& aVoIPAddress ) = 0;
+    
+    /**
+     * Gets user selected dtmf number and contact id.
+     *
+     * @since S60 v3.2
+     * @param aContactId Contact id of the contact, may be null
+     * @param aDtmfNumber Dtmf number, may be null.
+     * @leaves KErrCancel - User canceled the fetch
+     *         Other system wide error codes.
+     */    
+    virtual void GetUserSelectedDtmfNumberL(
+        CPhCntContactId*& aContactId,
+        HBufC*& aDtmfNumber ) = 0;
+        
+    /**
+     * Create new contact to phonebook.
+     *
+     * @since S60 v3.2
+     * @param aPhoneNumber Number of the new contact.
+     */
+    virtual void CreateNewContactL( const TDesC& aPhoneNumber ) = 0;
+    
+    /**
+     * Adds phonenumber to existing contact.
+     *
+     * @since S60 v3.2
+     * @param aPhoneNumber Phone number to be added to existing contact.
+     */
+    virtual void UpdateExistingContactL( const TDesC& aPhoneNumber ) = 0;  
+
+	/**
+	 * Gets a phone number from the contact.
+	 * @param aContactLink Contact link.
+	 * @param aCallType Number type.
+	 * @param aNumber User selected phone number.
+	 * @param aFieldLink Contact link (field link) to the number selected by user.
+	 */
+	virtual void GetPhoneNumberL(
+		const TDesC8& aContactLink, 
+		const CPhCntSingleItemFetch::TCallType aCallType,
+    	HBufC*& aNumber,
+    	HBufC8*& aFieldLink ) = 0;
+    	
+    /**
+     * Gets contact selected by user. 
+     *
+     * @since S60 v3.2
+     * @param aParam Parameters passed to AIW.
+     * @return Contact, selected by user. Ownership contact.
+     */   
+    virtual CPhCntContact* GetUserSelectedContactLC( 
+        MPhCntServiceRequestParam& aParam ) = 0;   
+    
+    /**
+	 * Cancels outstanding request.
+	 *
+	 * @since S60 v3.2
+	 */
+    virtual void CancelRequest() = 0;
+
+protected:
+
+    };
+
+
+#endif // MPHCNTPHONEBOOKSERVICES_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/MPhCntService.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Inteface for fetching contact links from AIW.
+*
+*/
+
+
+#ifndef MPHCNTSERVICE_H
+#define MPHCNTSERVICE_H
+
+class MPhCntServiceRequestParam;
+class MPhCntServiceResult;
+
+/**
+ * AIW service wrapper interface.
+ *
+ * @lib PhoneCntFinder.lib
+ * @since S60 v3.1
+ */
+NONSHARABLE_CLASS( MPhCntService )
+    {
+public:
+
+    /**
+     * Destructor.
+     *
+     * @since S60 v3.1
+     */
+    virtual ~MPhCntService() {};
+         
+    /**
+     * Makes AIW service request, synchronous
+     *
+     * @since S60 v3.1
+     * @param aService Parameters used with AIW.
+     * @param aResult Result of the request.
+     * @leaves KErrCancel - User or client canceled the request.
+     *         Other system wide error codes possible.
+     */
+    virtual void ExecuteRequestL( 
+        MPhCntServiceRequestParam& aServiceRequestParams, 
+        MPhCntServiceResult& aResult ) = 0;
+    
+    };
+
+#endif // MPHCNTSERVICE_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/cphcntasynctosync.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Converts asynchronous operation to synchronous
+*
+*/
+
+
+#ifndef CPHCNTASYNCTOSYNC_H
+#define CPHCNTASYNCTOSYNC_H
+
+#include <e32base.h>
+
+/**
+ *  Converts asynchronous operation to synchronous
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CPhCntAsyncToSync ) : public CBase
+    {
+protected:
+ 
+    /**
+     * Converts asynchronous call from DoMakeAsyncRequestL to synchronous. 
+     * Derived class has to implement the DoMakeAsyncRequestL method and make
+     * asynchronous call from there.
+     *
+     * @since S60 v3.1
+     */
+    TInt MakeAsyncRequest();
+     
+    /**
+     * Indication that asynchronous call from DoMakeAsyncRequestL has 
+     * completed. Derived class has to call this method, 
+     * when the asynchronous request completes.
+     *
+     * @since S60 v3.1
+     * @param Error code of the response.
+     */
+    virtual void ResponseReceived( TInt aErrorCode );
+
+    /**
+     * Checks if there are pending asynchronous requests available.
+     *
+     * @since S60 v5.0
+     */
+    TBool IsActive();
+     
+    CPhCntAsyncToSync();
+
+    void BaseConstructL();
+    
+    virtual ~CPhCntAsyncToSync();
+
+    /**
+     * Template method, which derived class has to implement. This is the
+     * place to make the asynchronous call, which is converted to synchronous.
+     *
+     * @since S60 v3.1
+     */
+    virtual void DoMakeAsyncRequestL() = 0;
+
+private: // data
+   
+    /**
+     * To make asynchronous operation synchronous
+     * Own.
+     */
+    CActiveSchedulerWait* iWait;
+    
+    /**
+     * Indication of response received from the async request.
+     */
+    TBool iResponseReceived;
+   
+    /**
+     * Error code from response.
+     */
+    TInt iResponseError;
+    };
+
+
+#endif // CPHCNTASYNCTOSYNC_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/cphcntcontactdataselection.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Service to show dialogs for user to select contact data.
+*
+*/
+
+
+#ifndef CPHCNTCONTACTDATASELECTION_H
+#define CPHCNTCONTACTDATASELECTION_H
+
+#include <e32base.h>
+#include "MPhCntMatch.h"
+
+NONSHARABLE_CLASS( CPhCntSelectedData ) : public CBase
+    {
+public:
+
+    /**
+     * Number selected by user.
+     */
+    virtual const TDesC& Data() const = 0;
+    
+    /**
+     * Phonebook's link, which points to the selected
+     * data.
+     */
+    virtual const TDesC8& FieldLink() const = 0;
+    
+    /**
+     * Number type
+     */
+    virtual MPhCntMatch::TNumberType NumberType() const = 0;
+   
+    };
+
+/**
+ * Observer for contact selection.
+ *
+ * @lib PhoneCntFinder.lib
+ * @since S60  v3.2
+ */
+class MPhCntSelectionObserver 
+    {
+public:
+    
+    /**
+     * Callback to indicate that selection is done. 
+     *
+     * @param aContactData Selected data. May be NULL if error occured. Ownership is not transferred.
+     * @param aErrorCode Possible system wide error code if error occured.
+     */
+    virtual void SelectionDone( CPhCntSelectedData* aContactData, TInt aErrorCode ) = 0;
+    };
+
+/**
+ *  Interface for showing dialogs for selectiong contact data.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CPhCntContactDataSelection ) : public CBase
+    {
+
+public:
+
+    /**
+	 * Phone number filtering
+	 * 
+	 * ECallPhoneNumber		- CS
+     * ECallVoip,          	- PS
+     * ECallVideoNumber,    - Video 
+	 */
+	enum TCallType
+        {
+        ECallPhoneNumber, 
+        ECallVoip, 
+        ECallVideoNumber 
+        };
+
+    /**
+     * Determines if request is active.
+     *
+     * @since S60 v3.2
+     * @return ETrue - Request is pending
+     *         EFalse - No requests active.
+     */
+    virtual TBool IsActive() const = 0;
+    
+    /**
+     * Cancels any outstanding request.
+     * 
+     * @post IsActive() == EFalse
+     *
+     * @since S60 v3.2
+     */
+    virtual void Cancel() = 0;
+
+    /**
+     * Shows a dialog for user to select a phonenumber from specified contact. 
+     * The contact is specified by the contact link. Observer is notified
+     * when the user has made the selection or canceled the dialog.
+     *
+     * @pre IsActive() == EFalse, leaves with error code KErrInUse.
+     * Otherwise may leave with system wide errorcode.
+     *
+     * @since S60 v3.2
+     * @param aContactLink Link to the contact, which number is to be selected.
+     * @param aCallType Type of number, which will be shown to be selected.
+     * @param aObserver Observer, which is notified when selection is done.
+     */
+     virtual void SelectPhoneNumberForCallL(
+        const TDesC8& aContactLink,
+        const TCallType& aCallType,
+        MPhCntSelectionObserver& aObserver ) = 0;
+
+    };
+
+#endif // CPHCNTCONTACTDATASELECTION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/cphcntcontactdataselectionimpl.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,226 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Service to show dialogs for user to select contact data.
+*
+*/
+
+
+#ifndef CPHCNTCONTACTDATASELECTIONIMPL_H
+#define CPHCNTCONTACTDATASELECTIONIMPL_H
+
+#include <e32base.h>
+
+#include "cphcntcontactdataselection.h"
+#include "tphcntcontactlinkresult.h"
+#include "mphcntaiwservice.h"
+#include "MPhCntContactFetchObserver.h"
+#include "MPhCntMatch.h"
+
+class MPhCntServiceRequestParamFactory;
+class MPhCntServiceRequestParam;
+class MPhCntContactStores;
+
+/**
+ * User selected data from phonebook services.
+ *
+ * @lib PhoneCntFinder
+ * @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CPhCntSelectedDataImpl ) : public CPhCntSelectedData
+    {
+public:
+    
+    /**
+     * Static constructor.
+     *
+     * @param aContact Selected contact. Note that aContact needs to
+     * be valid as long NewL is executed. So CPhCntContact can be 
+     * deleted after call to this NewL
+     */
+    static CPhCntSelectedDataImpl* NewL( CPhCntContact& aContact );
+    
+    ~CPhCntSelectedDataImpl();
+    
+// from base class CPhCntSelectedData
+
+    const TDesC& Data() const;
+    
+    /**
+     * Phonebook's link, which points to the selected
+     * data.
+     */
+    const TDesC8& FieldLink() const;
+    
+    /**
+     * Number type
+     */
+    MPhCntMatch::TNumberType NumberType() const;
+   
+    
+private:
+    CPhCntSelectedDataImpl();
+    
+    void ConstructL( CPhCntContact& aContact );
+    
+private: // Data
+
+    /**
+     * Own.
+     */
+    HBufC8* iFieldLink;
+    
+    /**
+     * Own
+     */
+    HBufC* iSelectedData;
+    
+    /**
+     * Specifies number type for selection
+     */
+    MPhCntMatch::TNumberType iNumberType;
+    
+    };
+
+/**
+ *  Implements the CPhCntContactDataSelection interface
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CPhCntContactDataSelectionImpl ) : 
+    public CPhCntContactDataSelection,
+    private MPhCntAiwServiceObserver,
+    private MPhCntContactFetchObserver
+    {
+
+public:
+
+    static CPhCntContactDataSelectionImpl* NewL(
+        MPhCntAiwService* aService,
+        MPhCntServiceRequestParamFactory* aParamFactory,
+        MPhCntContactStores* iContactStores );
+    
+    virtual ~CPhCntContactDataSelectionImpl();
+
+// from base class CPhCntContactDataSelection
+
+    /**
+     * From CPhCntContactDataSelection
+     *
+     * @see CPhCntContactDataSelection
+     * @since S60 v3.2
+     */
+    TBool IsActive() const;
+    
+    /**
+     * From CPhCntContactDataSelection
+     * ?description
+     *
+     * @see CPhCntContactDataSelection
+     * @since S60 v3.2
+     */
+    void Cancel();
+
+    /**
+     * From CPhCntContactDataSelection
+     *
+     * @see CPhCntContactDataSelection
+     * @since S60 v3.2
+     */
+    void SelectPhoneNumberForCallL(
+        const TDesC8& aContactLink,
+        const TCallType& aCallType,
+        MPhCntSelectionObserver& aObserver );
+        
+private:
+
+// from base class MPhCntAiwServiceObserver
+
+    /**
+     * From MPhCntAiwServiceObserver
+     * Indication that service has completed.
+     *
+     * @since S60 v3.2
+     * @param aError Error code
+     */ 
+    void RequestComplete( TInt aError );
+    
+// from base class MPhCntContactFetchObserver
+
+    /**
+     * From MPhCntContactFetchObserver
+     * Indication that contact is fetched.
+     *
+     * @since S60 v3.2
+     * @param aError Error code
+     */ 
+    void ContactReceived( CPhCntContact* aContact, TInt aError );
+   
+private:
+
+    CPhCntContactDataSelectionImpl( 
+        MPhCntAiwService* aService,
+        MPhCntServiceRequestParamFactory* aParamFactory,
+        MPhCntContactStores* aContactStores );
+
+    void ConstructL();
+
+private: // data
+
+        /**
+         * Service interface for accessing phonebook services.
+         * Own.
+         */
+        MPhCntAiwService* iService;
+        
+        /** 
+         * Factory to create service request parameters.
+         * Own.
+         */
+        MPhCntServiceRequestParamFactory* iParamFactory;
+        
+        /**
+         * Parameters used with service.
+         * Own.
+         */
+        MPhCntServiceRequestParam* iServiceParameter;
+        
+        /** 
+         * Result from service.
+         * Own.
+         */
+        TPhCntContactLinkResult iServiceResult;
+        
+        /**
+         * Field link from service.
+         * Own.
+         */
+        HBufC8* iFieldLink;
+        
+        
+        /** 
+         * Observer for the request.
+         * Not own.
+         */
+        MPhCntSelectionObserver* iObserver;
+        
+        /**
+         * Store to fetch contact.
+         * Own.
+         */
+        MPhCntContactStores* iContactStores;
+
+    };
+
+#endif // CPHCNTCONTACTDATASELECTIONIMPL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/cphcntcontactfieldsresolver.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,310 @@
+/*
+* 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:  Resolves contact fields.
+*
+*/
+
+
+
+#ifndef CPHCNTCONTACTFIELDSRESOLVER_H
+#define CPHCNTCONTACTFIELDSRESOLVER_H
+
+#include <e32base.h>
+
+#include "tphcntcontactfield.h"
+#include "MPhCntMatch.h"
+#include "mphcntcontactfields.h"
+
+class MVPbkContactLink;
+class MVPbkStoreContact;
+class MPbk2ContactNameFormatter;
+class MVPbkStoreContactField;
+class MPhCntContactManager;
+
+/**
+ *  Resolves contact's fields.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 ?S60_version *** for example, S60 v3.0
+ */
+NONSHARABLE_CLASS( CPhCntContactFieldsResolver ) : 
+    public CBase, public MPhCntContactFields
+    {
+public:
+
+    /**
+     * Static constructor.
+     *
+     * @since S60 v3.1
+     * @param aContactLink Link pointing to the contact, which fields are resolved.
+     * @param aContact Contact which fields are resolved.
+     * @param aNameFormatter Contact title formatter.
+     * @return New instance
+     */
+    static CPhCntContactFieldsResolver* NewL(
+        MVPbkContactLink* aContactLink,
+        MVPbkStoreContact* aContact,
+        MPhCntContactManager& aContactManager );
+
+    /**
+     * Static constructor.
+     *
+     * @since S60 v3.1
+     * @param aContactLink Link pointing to the contact, which fields are resolved.
+     * @param aContact Contact which fields are resolved.
+     * @param aNameFormatter Contact title formatter.
+     * @return New instance
+     */
+    static CPhCntContactFieldsResolver* NewLC(
+        MVPbkContactLink* aContactLink,
+        MVPbkStoreContact* aContact,
+        MPhCntContactManager& aContactManager );
+    
+    /**
+     * Destructor.
+     */    
+    virtual ~CPhCntContactFieldsResolver();
+
+// from base class MPhCntContactFields
+    
+    /**
+     * From base class MPhCntContactFields
+     * Get the number type.
+     * @since S60 v3.1
+     * @return Phonebook number type.
+     */
+    MPhCntMatch::TNumberType NumberType() const;
+    
+    /**    
+     * From base class MPhCntContactFields
+     * @since S60 v3.1
+     * @return Contact link, ownership is not given.
+     */
+    MVPbkContactLink* ContactLink() const;
+    
+    /**    
+     * From base class MPhCntContactFields
+     * @since S60 v3.1
+     * @return First name. Empty if there isn't one specified.
+     */
+    TPtrC FirstName() const;
+
+    /**    
+     * From base class MPhCntContactFields
+     * @since S60 v3.1
+     * @return Last name. Empty if there isn't one specified.
+     */
+    TPtrC LastName() const;
+
+    /**    
+     * From base class MPhCntContactFields
+     * @since S60 v3.1
+     * @return Company name. Empty if there isn't one specified.
+     */
+    TPtrC CompanyName() const;
+
+    /**    
+     * From base class MPhCntContactFields
+     * Returns the matched number.
+     * @since S60 v3.1
+     * @return Phone number. Empty if there isn't one specified.
+     */
+    TPtrC Number() const;
+    
+    /**
+     * From base class MPhCntContactFields
+     * 
+     * @since S60 v3.2
+     * @see MPhCntContactFields
+     */
+    TPtrC Dtmf() const;
+
+    /**    
+     * From base class MPhCntContactFields
+     * @since S60 v3.1
+     * @return Ringing tone. Empty if there isn't one specified.
+     */
+    TPtrC PersonalRingingTone() const;
+    
+    /**    
+     * From base class MPhCntContactFields
+     * @since S60 v3.1
+     * @return Second name. Empty if there isn't one specified.
+     */
+    TPtrC SecondName() const;
+    
+    /**    
+     * From base class MPhCntContactFields
+     * @since S60 v3.1
+     * @return First name's pronunction. May be zero length.
+     */
+    TPtrC FirstNamePronunciation() const;
+     
+    /**
+     * From base class MPhCntContactFields
+     * Last name pronunciation.
+     * 
+     * @since S60 v3.1
+     * @return Last name's pronunction. May be zero length.
+     */
+    TPtrC LastNamePronunciation() const;
+    
+    /**
+     * From base class MPhCntContactFields
+     * Company name pronunciation.
+     * 
+     * @since S60 v3.1
+     * @return Company name's pronunction. May be zero length.
+     */
+    TPtrC CompanyNamePronunciation() const;
+    
+    /**
+     * From base class MPhCntContactFields
+     * @since S60 v3.1
+     * @return Contact title. Ownership given.
+     */
+    HBufC* GetContactTitleL();
+    
+     /**    
+     * From base class MPhCntContactFields
+     * @since S60 v3.1
+     * @return Array of contact links to groups, where this contact belongs
+     */
+    MVPbkContactLinkArray* ContactGroupsLC() const;
+    
+     /**    
+     * From base class MPhCntContactFields
+     * @since S60 v3.1
+     * @return Contact store, where this contacts information is stored.
+     */
+    MVPbkStoreContact& StoreContact() const;
+    
+    /**    
+     * From base class MPhCntContactFields
+     * @since S60 v3.1
+     * @return Thumbnail field. Null if no thumbnail field defined.
+     */
+    const MVPbkFieldType* ThumbnailField() const;
+    
+    /**    
+     * From base class MPhCntContactFields
+     * @since S60 v3.1
+     * @return Call image. Empty if there isn't one specified.
+     */
+    TPtrC CallImage() const;
+    
+    /**    
+     * From base class MPhCntContactFields
+     * @since S60 v3.1
+     * @return Call text. Empty if there isn't one specified.
+     */
+    TPtrC CallText() const;
+
+    /**    
+     * From base class MPhCntContactFields
+     * @since S60 v3.1
+     * @return ETrue if contact has thumbnail field.
+     */
+    TBool HasThumbnail() const;
+    
+    /**
+     * From base class MPhCntContactFields
+     *
+     * @since S60 v3.2.
+     * @return Array of phone numbers.
+     */     
+    const RArray<TPhCntNumber>& AllNumbers() const;
+    
+    /**
+     * From base class MPhCntContactFields
+     *
+     * @since S60 v3.2.
+     * @return Array of predefined DTMF strings.
+     */        
+    CDesCArray* AllDtmfNumbers() const;     
+
+private:
+
+    CPhCntContactFieldsResolver(
+        MVPbkContactLink* aContactLink,
+        MVPbkStoreContact* aContact,
+        MPhCntContactManager& aContactManager );
+
+    void ConstructL();
+    
+    void ResolveFieldL( 
+        MVPbkStoreContactField& aContactField,
+        TBool aFieldPointedByContactLink );
+    
+    void ResolveFieldDataL( 
+        MVPbkStoreContactField& aContactField, 
+        const TPtrC aFieldTextData,
+        TBool aFieldPointedByContactLink );
+
+private: // data
+
+    
+    /**
+     * Resolvers for single fields
+     */
+    TPhCntPhoneNumber iPhoneNumberResolver;
+    TPhCntContactField iFirstNameResolver;
+    TPhCntContactField iLastNameResolver;
+    TPhCntContactField iCompanyNameResolver;
+    TPhCntContactField iSecondNameResolver;
+    TPhCntContactField iRingingToneResolver;
+    TPhCntContactField iFirstNamePronunciationResolver;
+    TPhCntContactField iLastNamePronunciationResolver;
+    TPhCntContactField iCompanyNamePronunciationResolver;
+    TPhCntContactField iCallImageResolver;
+    TPhCntContactField iCallTextResolver;
+    TPhCntContactField iDtmfResolver;
+        
+    /**
+     * Link to the contact.
+     * Own.
+     */
+    MVPbkContactLink* iContactLink;
+    
+    /**
+     * Contact
+     * Own.
+     */
+    MVPbkStoreContact* iContact;
+    
+    /**
+     * Handle to virtual phonebook.
+     * Not Own.
+     */
+    MPhCntContactManager& iContactManager;
+
+    /**
+     * Contact title formatter.
+     * Not own.
+     */
+    MPbk2ContactNameFormatter& iNameFormatter;
+    
+    /**
+     * Thumbnails field, if any
+     * Not own.
+     */
+    const MVPbkFieldType* iThumbnailField;
+
+    /**
+    * All DTMF numbers in array. Owned.
+    */
+    CDesCArray* iAllDtmfNumbers;
+    };
+
+#endif // CPHCNTCONTACTFIELDSRESOLVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/cphcntcontactlinkarrayfetch.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Base class for contact link fetchers.
+*
+*/
+
+
+#ifndef CPHCNTCONTACTLINKARRAYFETCH_H
+#define CPHCNTCONTACTLINKARRAYFETCH_H
+
+#include <MVPbkContactFindObserver.h>
+
+#include "cphcntasynctosync.h"
+
+class MVPbkContactLinkArray;
+
+/**
+ *  Base class for contact link fetchers.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CPhCntContactLinkArrayFetch ) :  
+    public CPhCntAsyncToSync,
+    public MVPbkContactFindObserver
+    {
+
+public: 
+    
+// from base class MVPbkContactFindObserver
+
+    /**
+     * From base class MVPbkContactFindObserver
+     * Called when find is complete. Callee takes ownership of the results.
+     * In case of an error during find, the aResults may contain only 
+     * partial results of the find.
+     *
+     * @since S60 v3.1
+     * @param aResults Array of contact links that matched the find.
+     *                 Callee must take ownership of this object in
+     *                 the end of the function, ie. in case the function
+     *                 does not leave.
+     */
+    void FindCompleteL( MVPbkContactLinkArray* aResults );
+
+    /**
+     * From base class MVPbkContactFindObserver
+     *
+     * @since S60 v3.1
+     * Called in case the find fails for some reason.
+     * 
+     * @param aError One of the system wide error codes.
+     */
+    void FindFailed( TInt aError );
+    
+protected:
+
+    virtual ~CPhCntContactLinkArrayFetch();
+    
+    void BaseConstructL();
+
+    CPhCntContactLinkArrayFetch();
+
+protected: // data
+
+    /**
+     * Fetched contact links
+     * Own, but derived class can destroy this if after deletion
+     * iFetchedContactLinks pointer is set to NULL.
+     */
+    MVPbkContactLinkArray* iFetchedContactLinks;
+
+    };
+
+#endif // CPHCNTCONTACTLINKARRAYFETCH_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/cphcntcontactmatchstrategy.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,206 @@
+/*
+* 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:  Contact matching strategy
+*
+*/
+
+
+#ifndef CPHCNTCONTACTMATCHSTRATEGY_H
+#define CPHCNTCONTACTMATCHSTRATEGY_H
+
+#include <e32base.h>
+#include <cenrepnotifyhandler.h>
+#include <CVPbkPhoneNumberMatchStrategy.h>
+
+#include "mphcntcontactmatchstrategy.h"
+#include "mphcntcontactstoreeventobserver.h"
+
+class CVPbkContactManager;
+class MVPbkContactFindObserver;
+class CVPbkPhoneNumberMatchStrategy;
+class CRepository;
+class CVPbkContactStoreUriArray;
+class CPhCntContactStoreUris;
+class CCntRawPhoneNumberExtractor;
+
+/**
+ *  Strategy for matcing CS contacts.
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CPhCntContactMatchStrategy ) :
+    public CBase,
+    public MPhCntContactMatchStrategy,
+    private MCenRepNotifyHandlerCallback,
+    private MPhCntContactStoreEventObserver
+    {
+public:
+
+    /**
+     * Static contstructor.
+     *
+     * @since S60 v3.1
+     * @param aContactManager Contact manager.
+     * @param aUriArray Array of contact store URI's used.
+     * @param aObserver Observer for finding contacts.
+     */
+    static CPhCntContactMatchStrategy* NewL(
+        CVPbkContactManager& aContactManager,
+        CPhCntContactStoreUris& aContactStoreUris,
+        MVPbkContactFindObserver& aObserver,
+        CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aMatchFlag );
+
+    /**
+     * Destructor.
+     *
+     * @since S60 v3.1
+     */
+    virtual ~CPhCntContactMatchStrategy();
+
+// from base class MPhCntContactMatchStrategy
+
+    /**
+     * From MPhCntContactMatchStrategy
+     *
+     * @since S60 v3.1
+     * @see MPhCntContactMatchStrategy
+     */
+    void FindMatchesL( const TDesC& aPhoneNumber );
+
+private:
+
+    /**
+     * Creates contact match strategy with given numbers
+     * of digits.
+     *
+     * @since S60 v3.1
+     * @return Error code.
+     */
+    TInt CreateContactMatchStrategy();
+
+// From base class MCenRepNotifyHandlerCallback
+
+    /**
+     * From base class MCenRepNotifyHandlerCallback
+     * This callback method is used to notify the client about
+     * changes for string value keys, i.e. key type is EStringKey.
+     *
+     * @param aId Id of the key that has changed.
+     * @param aNewValue The new value of the key.
+     */
+    void HandleNotifyString( TUint32 aId, const TDesC16& aNewValue );
+
+
+// From base class MPhCntContactStoreEventObserver
+
+    /**
+     * From MPhCntContactStoreEventObserver
+     *
+     * @since S60 v3.2
+     * @see MPhCntContactStoreEventObserver.
+     */
+    void ContactStoreAvailabilityChanged();
+
+    /**
+     * Removes postfix from aNumber and starts the matching.
+     */
+    void MatchL( const TDesC& aNumber );
+
+    /**
+     * Method to ease unit testing. Creates the actual instance of iMatchStrategy.
+     */
+    virtual TInt DoCreateMatchStrategy();
+    
+    /**
+     * Makes the actual matching request using number
+     * Declared virtual to ease unit testing.
+     */
+    virtual void DoMatchL( const TDesC& aNumber );
+
+protected:
+
+    CPhCntContactMatchStrategy(
+        CVPbkContactManager& aContactManager,
+        CPhCntContactStoreUris& aContactStoreUris,
+        MVPbkContactFindObserver& aObserver,
+        CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aMatchFlag );
+
+    void ConstructL();
+
+protected: // data
+    CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags iMatchFlag;
+	
+private: // data
+
+    /**
+     * Match strategy.
+     * Own.
+     */
+    CVPbkPhoneNumberMatchStrategy* iMatchStrategy;
+
+    /**
+     * Central repository instance, for getting
+     * number of numbers used with contact matching.
+     * Own.
+     */
+    CRepository* iCenRepSession;
+
+    /**
+     * For getting notifications of number of numbers
+     * used with contact matching changes.
+     * Own.
+     */
+    CCenRepNotifyHandler* iCenRepNotifyHandler;
+
+     /**
+      * Contact manager is needed with match strategy.
+      * Not own.
+      */
+    CVPbkContactManager& iContactManager;
+
+    /**
+     * Gives active contact store uris.
+     * Not own.
+     */
+    CPhCntContactStoreUris& iContactStoreUris;
+
+     /**
+     * Observer of matching.
+     * Now own.
+     */
+    MVPbkContactFindObserver& iObserver;
+
+     /**
+      * URI's of the active contact stores, where contacts are
+      * looked from.
+      * Own.
+      */
+    CVPbkContactStoreUriArray* iUriArray;
+
+    /**
+     * Number of digits used with matching.
+     */
+    TInt iNumberOfDigits;
+
+    /**
+     * Number extractor.
+     * Own.
+     */
+    CCntRawPhoneNumberExtractor* iNumberExtractor;
+
+    };
+
+
+#endif // CPHCNTCONTACTMATCHSTRATEGY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/cphcntcontactstoreuris.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,184 @@
+/*
+* 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:  Contact store Uris
+*
+*/
+
+
+#ifndef CPHCNTCONTACTSTOREURIS_H
+#define CPHCNTCONTACTSTOREURIS_H
+
+#include <e32base.h>
+
+#include "tphcntcontactstorestate.h"
+
+class CVPbkContactStoreUriArray;
+class TVPbkContactStoreUriPtr;
+class MPhCntContactStoreEventObserver;
+
+/**
+ *  Updates list of active contact store uris.
+ *
+ *  @lib PhoneCntFiner.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CPhCntContactStoreUris ): public CBase
+    {
+
+public:
+
+    static CPhCntContactStoreUris* NewL();
+
+    virtual ~CPhCntContactStoreUris();
+
+    /**
+     * Gives reference to all contact store uris that
+     * are used with contact matching.
+     *
+     * @since S60 v3.2
+     * @return Uris of contact stores.
+     */
+    CVPbkContactStoreUriArray& ContactStores() const;
+    
+    /**
+     * Gives URIs to currently active contact stores. The Uris
+     * are in priority order ie the first uri is a uri to a contact store, 
+     * where contact matching should be tried first
+     *
+     * @since S60 v3.2
+     * @return Uris of contact stores currently active, ownership is given to client.
+     */
+    CVPbkContactStoreUriArray* ActiveContactStoresL() const;
+    
+    /**
+     * Indication that contact store is ready to be used.
+     *
+     * @since S60 v3.2
+     * @aContactStoreUri URI of the contact store.
+     */
+    void StoreReady( TVPbkContactStoreUriPtr& aContactStoreUri );
+    
+    /**
+     * Indication that contact store has become unavailable.
+     *
+     * @since S60 v3.2
+     * @aContactStoreUri URI of the contact store.
+     */
+    void StoreUnavailable( TVPbkContactStoreUriPtr& aContactStoreUri );
+    
+    /**
+     * Sets observer for contact store events.
+     *
+     * @since S60 v3.2
+     * @param aObserver Observer of the events.
+     */
+    void SetObserver( MPhCntContactStoreEventObserver& aObserver );
+    
+    /**
+     * Returns array of additional contact stores.
+     *
+     * @since S60 v3.2
+     * @return Reference to Uris of additional contact stores
+     */
+    const CVPbkContactStoreUriArray& AdditionalContactStores() const;
+
+    /**
+     * Adds contact store to the base set of stores.
+     *
+     * @since   S60 v9.1
+     * @param   aContactStoreUri    Contact store to add.
+     */
+    void AddContactStoreL( 
+        const TVPbkContactStoreUriPtr& aContactStoreUri );
+    
+    /**
+     * Removes contact store from the base set of stores.
+     *
+     * @since   S60 v9.1
+     * @param   aContactStoreUri    Contact store to remove.
+     */
+    void RemoveContactStore( 
+        const TVPbkContactStoreUriPtr& aContactStoreUri );
+
+private:
+
+    CPhCntContactStoreUris();
+
+    void ConstructL();
+    
+    void SetContactStoreAvailability( 
+        TVPbkContactStoreUriPtr& aStoreUri, 
+        TBool aIsAvailable );
+        
+    /**
+     * Reads additional contact store URIs from CenRep.
+     *
+     * @since S60 v3.2
+     * @param aProductSpecificList Product specific list of additional stores
+     */
+    void ReadAdditionalContactStoreL( TDes* aProductSpecificList );
+    
+    /**
+     * Parses the additional contact store names from the string
+     * fetched from CenRep.
+     *
+     * @since S60 v3.2
+     * @param aProductSpecificList  Reference to product specific 
+     *                              list of additional stores
+     */
+    void ParseStoresL( const TDesC& aProductSpecificList );
+
+    /**
+     * Implements TIdentityRelation for class TPhCntContactStoreState.
+     *
+     * @since S60 v9.1
+     * @param aState1   First state object to compare.
+     * @param aState2   Second state object to compare.
+     * @return ETrue if objects are same.
+     */
+    static TBool MatchUris( 
+        const TPhCntContactStoreState& aState1,
+        const TPhCntContactStoreState& aState2 );
+        
+private: // data
+
+    /**
+     * Contact store uris used with contact matching.
+     * own.
+     */
+    CVPbkContactStoreUriArray* iContactStoreUriArray;
+    
+    /**
+     * Contact store uris used with contact matching.
+     * own.
+     */
+    CVPbkContactStoreUriArray* iAdditionalContactStoreUriArray;
+
+    
+    /**
+     * Contact stores states in priority order.
+     * Own.
+     */
+    RArray<TPhCntContactStoreState> iContactStoreStates;
+    
+    /**
+     * Observer for contact store events.
+     * Not own.
+     */
+    MPhCntContactStoreEventObserver* iObserver;
+    
+    };
+
+
+#endif // CPHCNTCONTACTSTOREURIS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/cphcntfetchcontact.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,124 @@
+/*
+* 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:  Definition of CPhCntFetchContact class.
+*
+*/
+
+
+#ifndef CPHCNTFETCHCONTACT_H
+#define CPHCNTFETCHCONTACT_H
+
+#include <e32base.h>
+
+#include "cphcntasynctosync.h"
+#include "MPhCntContactFetchObserver.h"
+
+class MPhCntContactStores;
+class MVPbkContactLink;
+class MVPbkStoreContact;
+
+/**
+ *  ?one_line_short_description
+ *
+ *  ?more_complete_description
+ *
+ *  @lib ?library
+ *  @since S60 ?S60_version *** for example, S60 v3.0
+ */
+NONSHARABLE_CLASS( CPhCntFetchContact ) : 
+    public CPhCntAsyncToSync,
+    public MPhCntContactFetchObserver
+    {
+public:
+    static CPhCntFetchContact* NewL( MPhCntContactStores& aContactStores );
+
+    static CPhCntFetchContact* NewLC( MPhCntContactStores& aContactStores );
+
+    virtual ~CPhCntFetchContact();
+    
+    /**
+     * Fetches contact, which aContactLink identifies.
+     *
+     * @since S60 ?S60_version
+     * @param ?arg1 ?description
+     * @param ?arg2 ?description
+     * @return ?description
+     */
+    TInt FetchContact( 
+        const MVPbkContactLink& aContactLink, 
+        CPhCntContact*& aContact );
+        
+     /**
+      * Fetches first contact from array of contact links.
+      *
+      * @since S60 v3.2
+      * @param aContactLinkArray Contact link array as descriptor.
+      * @param aContact Result of the fetch.
+      * @return Error code.
+      */
+     TInt FetchContact( 
+        const TDesC8& aContactLinkArray, 
+        CPhCntContact*& aContact );
+    
+// from base class CPhCntAsyncToSync
+
+    /**
+     * From CPhCntAsyncToSync
+     * ?description
+     *
+     * @since S60 ?S60_version
+     * @param ?arg1 ?description
+     */
+     void DoMakeAsyncRequestL();
+
+// from base class MPhCntContactFetchObserver
+
+    /**
+     * From MPhCntContactFetchObserver
+     * ?description
+     *
+     * @since S60 ?S60_version
+     * @param ?arg1 ?description
+     */
+     void ContactReceived( CPhCntContact* aContact, TInt aError );
+
+private:
+
+    CPhCntFetchContact( MPhCntContactStores& aContactStores );
+
+    void ConstructL();
+
+private: // data
+
+    /**
+     * Contact stores, where contact is fetched.
+     * Not own.
+     */
+    MPhCntContactStores& iContactStores;
+    
+    /**
+     * Received contact.
+     * Not own.
+     */
+    CPhCntContact* iReceivedContact;
+    
+    /**
+     * Link to the contact to be fetched.
+     * Not own.
+     */
+    const MVPbkContactLink* iContactLink;
+
+    };
+
+#endif // CPHCNTFETCHCONTACT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/cphcntfoundcontacts.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,115 @@
+/*
+* 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:  Stores found contacts and keeps track of the references.
+*
+*/
+
+
+
+#ifndef CPHCNTFOUNDCONTACTS_H
+#define CPHCNTFOUNDCONTACTS_H
+
+#include <e32base.h>
+
+class CPhCntContact;
+
+/**
+ * Responsible to hold found contacts. Takes the ownership of the contacts.
+ * The contacts must be removed using MPhCntContact::Release when contact
+ * no longer needed. 
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CPhCntFoundContacts ) : public CBase
+    {
+public:
+
+    static CPhCntFoundContacts* NewL();
+
+    static CPhCntFoundContacts* NewLC();
+
+    virtual ~CPhCntFoundContacts();
+
+    /**
+     * Adds contact. Takes the ownership.
+     *
+     * @since S60 v3.1
+     * @param aContact Contact
+     * @param aOriginalNumber Number used to match aContact.
+     */
+    void AddL( CPhCntContact* aContact, const TDesC& aOriginalNumber );
+    
+    /**
+    * Removes and deletes contact. Even if contact
+    * is not found, aContact is deleted.
+    * 
+    * @since S60 v3.1
+    * @param aContact Contact to be deleted.
+    */
+    void Remove( CPhCntContact* aContact );
+    
+    /**
+     * Finds a contact which has been stored here.
+     *
+     * @since S60 v3.1
+     * @param aTelNumber Number used for matching contact.
+     * @return Found contact or NULL if contact not found.
+     * Ownership is NOT given to client. CPhCntContact
+     * must be destroyed using Release method of CPhCntContact.
+     */
+    CPhCntContact* FindContact( const TDesC& aTelNumber );
+    
+    /**
+     * Finds a contact which has been stored here.
+     * 
+     * @since S60 v3.1
+     * @param aTelNumber Number used for matching contact.
+     * @param aContactLink ContactLink of the wanted contact.
+     * @return Found contact or NULL if contact not found.
+     * Ownership is NOT given to client. CPhCntContact
+     * can be destroyed using Release method of CPhCntContact.
+     */
+    CPhCntContact* FindContact( 
+        const TDesC& aTelNumber,
+        const MVPbkContactLink& aContactLink );
+        
+    /**
+     * Finds contact which has been stored here.
+     *
+     * @since s60 v3.1
+     * @param aContactLink Contact link of wanted contact.
+     * @return Found contact or NULL if contact not found.
+     * Ownership is NOT given to client. CPhCntContact
+     * can be destroyed using Release method of CPhCntContact. 
+     */
+    CPhCntContact* FindContact(const MVPbkContactLink& aContactLink );
+    
+private:
+
+    CPhCntFoundContacts();
+
+    void ConstructL();
+
+private: // data
+
+    /**
+     * Array of contacts already found.
+     * Own. 
+     */
+    RPointerArray<CPhCntContact> iFoundContacts;
+    };
+
+
+#endif // CPHCNTFOUNDCONTACTS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/cphcntmatchcontact.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,114 @@
+/*
+* 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:  Matches contact to phonenumber from phonebook.
+*
+*/
+
+
+#ifndef CPHCNTMATCHCONTACT_H
+#define CPHCNTMATCHCONTACT_H
+
+#include <e32base.h>
+
+#include "cphcntcontactlinkarrayfetch.h"
+
+class MVPbkContactLinkArray;
+class MPhCntContactManager;
+class MPhCntContactMatchStrategy;
+
+
+/**
+ *  Matches contacts to phone number.
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CPhCntMatchContact ): public CPhCntContactLinkArrayFetch
+    {
+public:
+
+    /**
+     * Static constructor.
+     *
+     * @since S60 v3.1
+     */
+    static CPhCntMatchContact* NewL();
+
+    /**
+     * Static constructor.
+     *
+     * @since S60 v3.1
+     */
+    static CPhCntMatchContact* NewLC();
+
+    /**
+     * Destructor.
+     */
+    virtual ~CPhCntMatchContact();
+
+    /**
+     * Finds contacts, which telephone number matches with aTelNumber.
+     * Note that aContactLinkArray ownership is not given. Client has
+     * to call MVPbkContactLink::CloneLC in order to take the ownership of the
+     * link in array. If error returned is KErrNone then there is at least
+     * one entry in aContactLinkArray.
+     *
+     * @since S60 v3.1
+     * @param aTelNumber Number, which is matched with contacts.
+     * @Param aContactLinkArray Array of found contacts.
+     *        Ownership of array nor links inside is NOT given to caller.
+     * @param aStrategy Matching strategy used for finding matches.
+     * @return Error code, KErrNotFound, if contact not found
+     *                     KErrAlreadyExists if many contacts found.
+     */
+    TInt MatchContact( const MVPbkContactLinkArray*& aContactLinkArray, 
+                        const TDesC& aTelNumber,
+                        MPhCntContactMatchStrategy& aStrategy );
+    
+protected:
+
+// from base class CPhCntAsyncToSync
+
+    /**
+     * From CPhCntAsyncToSync
+     * Makes the asynchronous request, which is converted to synchronous.
+     * @since S60 v3.1
+     */
+    void DoMakeAsyncRequestL();
+
+private:
+
+    CPhCntMatchContact();
+
+    void ConstructL();
+
+
+private: // data
+
+    /**
+     * Contact matching strategy
+     * Not own.
+     */
+    MPhCntContactMatchStrategy* iMatchStrategy;
+
+    /**
+     * Number to match contacts.
+     */
+    TPtrC iPhoneNumber;
+
+    };
+
+
+
+#endif // CPHCNTMATCHCONTACT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/cphcntmatchervoipimpl.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Implements VoIP specific matching methods.
+*
+*/
+
+
+#ifndef CPHCNTMATCHERVOIPIMPL_H
+#define CPHCNTMATCHERVOIPIMPL_H
+
+#include "CPhCntMatcherImpl.h"
+
+class CPhCntVoipContactMatchStrategy;
+class CPhCntStoreLoaderImpl;
+
+/**
+ *  Implements VoIP specific matching methods.
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CPhCntMatcherVoIPImpl ) : public CPhCntMatcherImpl
+    {
+public:
+    static CPhCntMatcherVoIPImpl* NewL( const MPhoneCntPbkOwner& aOwner );
+
+    virtual ~CPhCntMatcherVoIPImpl();
+    
+// From base class CPhCntMatcher
+
+    /**
+     * From CPhCntMatcher
+     * Match number to phonebook.
+     * @since S60 v3.2
+     * @param aMatch Found match, owership tranferred. NULL if not found any.
+     * @param aNumber Number to match against.
+     * @param aAllowUserNameMatch If true user name match is allowed.
+     * @param aCharsForMatching Characters for user name match. Match is started from
+     *                          the rigth of the user name part. (see CS call match)
+     * @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,
+        MDesCArray* aContactStoreUris,
+        TInt aCharsForMatching = 0 );
+        
+    /**
+     * From CPhCntMatcher
+     * From CPhCntMatcher, gets VoIP call contact info from phonebook
+     * by contact id.
+     * @since Series60 3.2
+     * @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 );
+
+    
+    /**
+     * From CPhCntMatcher
+     * From CPhCntMatcher
+     * 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.
+     */
+    TBool HasCSNumbers( 
+        const CPhCntContactId& aContactId );
+
+private:
+    
+    CPhCntMatcherVoIPImpl( const MPhoneCntPbkOwner& aOwner );
+    
+    void ConstructL();
+    
+    /**
+     * Determines if contact has other numbers than VoIP numbers.
+     * 
+     * @since S60 v3.2
+     */
+    TBool HasCSNumbers( 
+        const CPhCntContact* const aContact );
+
+    /**
+     * From CPhCntMatcher. Used for delayed construction.
+     * 
+     * @since S60 v3.2
+     */
+    TInt CreateMatcher();
+
+private: // data
+
+      
+    /**
+     * Match strategy used for Voip calls.
+     * Own.
+     */
+    CPhCntVoipContactMatchStrategy* iVoipMatchStrategy;
+
+    /**
+     * Used for loading service specific contact stores 
+    */
+    CPhCntStoreLoaderImpl* iContactStoreLoader;
+    
+    };
+
+#endif // CPHCNTMATCHERVOIPIMPL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/cphcntphonebookservices.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,235 @@
+/*
+* 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:  Phonebook services wrapper.
+*
+*/
+
+
+#ifndef CPHCNTPHONEBOOKSERVICES_H
+#define CPHCNTPHONEBOOKSERVICES_H
+
+#include <e32base.h>
+
+#include "MPhCntPhonebookServices.h"
+
+class MPhCntService;
+class MPhCntContactStores;
+class CPhCntFetchContact;
+class CPhCntContactId;
+class MPhCntContactManager;
+class MPhCntServiceRequestParam;
+class CPhCntContact;
+class MVPbkContactLinkArray;
+class CPhCntServiceRequestParamFactory;
+
+/**
+ *  Phonebook services.
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CPhCntPhonebookServices )
+    : public CBase, 
+    public MPhCntPhonebookServices
+    {
+public:
+
+    /**
+     * Static constructor.
+     *
+     * @since S60 v3.2
+     * @param aContactStores Reference of contact stores.
+     * @param aContactManager Reference to contact manager.
+     */
+    static CPhCntPhonebookServices* NewL( 
+        MPhCntContactStores& aContactStores,
+        MPhCntContactManager& aContactManager );
+
+    /**
+     * Destructor.
+     *
+     * @since S60 v3.2
+     */     
+    virtual ~CPhCntPhonebookServices();
+
+// From base class MPhCntPhonebookServices
+
+    /**
+     * From MPhCntPhonebookServices
+     *
+     * @since S60 v3.2
+     * @see MPhCntPhonebookServices
+     */
+    void GetUserSelectedPhoneNumberL( 
+        CPhCntContactId*& aContactId, 
+        HBufC*& aPhoneNumber );
+
+    /**
+     * From MPhCntPhonebookServices
+     *
+     * @since S60 v3.2
+     * @see MPhCntPhonebookServices
+     */
+    void GetUserSelectedVoIPAddressL( 
+        CPhCntContactId*& aContactId, 
+        HBufC*& aVoIPAddress );
+    
+    /**
+     * From MPhCntPhonebookServices
+     *
+     * @since S60 v3.2
+     * @see MPhCntPhonebookServices
+     */    
+    void GetUserSelectedDtmfNumberL(
+        CPhCntContactId*& aContactId,
+        HBufC*& aDtmfNumber );
+        
+    /**
+     * From MPhCntPhonebookServices
+     *
+     * @since S60 v3.2
+     * @see MPhCntPhonebookServices
+     */
+    void CreateNewContactL( const TDesC& aPhoneNumber );
+    
+    /**
+     * From MPhCntPhonebookServices
+     *
+     * @since S60 v3.2
+     * @see MPhCntPhonebookServices
+     */
+    void UpdateExistingContactL( const TDesC& aPhoneNumber );
+    
+    /**
+     * From MPhCntPhonebookServices
+     *
+     * @since S60 v3.2
+     * @see MPhCntPhonebookServices
+     */
+    void CPhCntPhonebookServices::GetPhoneNumberL(
+	    const TDesC8& aContactLink,
+	    const CPhCntSingleItemFetch::TCallType aCallType,
+    	HBufC*& aNumber,
+    	HBufC8*& aFieldLink );    
+    	
+    /**
+     * From MPhCntPhonebookServices
+     *
+     * @since S60 v3.2
+     * @see MPhCntPhonebookServices
+     */   
+    CPhCntContact* GetUserSelectedContactLC( 
+        MPhCntServiceRequestParam& aParam );
+    
+    /**
+     * From MPhCntPhonebookServices
+     *
+     * @since S60 v3.2
+     * @see MPhCntPhonebookServices
+     */     
+    void CancelRequest();
+
+protected:
+
+    CPhCntPhonebookServices( MPhCntContactManager& aContactManager );
+
+    void ConstructL( 
+        MPhCntContactStores& aContactStores );
+    
+private:
+
+    /**
+     * Gets link to a contact, that user selects.
+     * 
+     * @since S60 v3.2
+     * @param aParam Service request parameters.
+     * @return Array of contact links.
+     */
+    HBufC8* GetContactLinksLC(
+        MPhCntServiceRequestParam& aParam );
+    
+       
+    /**
+     * Sets result to client.
+     *
+     * @since S60 v3.2
+     * @param aReceivedNumber Received number.
+     * @param aReceivedContactId Received contact id.
+     * @param aClientResultNumber Number given to client.
+     * @param aClientResultContactId Id given to client.
+     */
+    void SetResultsL( 
+        const TDesC& aReceivedNumber, 
+        const CPhCntContactId* const aReceivedContactId,
+        HBufC*& aClinetResultNumber,
+        CPhCntContactId*& aClientResultContactId ) const;
+     
+    /**
+     * Gets user selected number from phonebook.
+     *
+     * @param aContactId Contact id of the contact where the number is got.
+     * @param aNumber Number user selected.
+     * @param aDTMFWanted ETrue - User is selecting DTMF or phone number.
+     *                    EFalse - User is selecting phone number.
+     */
+    void GetUserSelectedNumberL(
+        CPhCntContactId*& aContactId,
+        HBufC*& aNumber, TBool aDTMFWanted );
+     
+    /**
+     * Creates CPhCntService if needed.
+     * 
+     * @since S60 v3.2
+     */
+    void CreateCntServiceL();
+
+    /**
+     * Gets user selected voip address from phonebook.
+     *
+     * @param aContactId Contact id of the contact where the number is got.
+     * @param aVoIPAddress Address user selected.
+     */
+    void GetUserSelectedAddressL(
+        CPhCntContactId*& aContactId,
+        HBufC*& aVoIPAddress );
+
+protected: // data
+
+    /**
+     * AIW service wrapper.
+     * Own.
+     */
+    MPhCntService* iService;
+    
+    /**
+     * For fetching contact from phonebook.
+     * Own.
+     */
+    CPhCntFetchContact* iFetchContact;
+    
+    /**
+     * Contact manager.
+     * Not own.
+     */
+    MPhCntContactManager& iContactManager;
+    
+    /**
+     * Factory to create params.
+     * Own.
+     */
+    CPhCntServiceRequestParamFactory* iParamFactory;
+    
+    };
+
+#endif // CPHCNTPHONEBOOKSERVICES_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/cphcntspeeddialcontactlinkfetch.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Definition of CPhCntSpeedDialContactLinkFetch class.
+*
+*/
+
+
+#ifndef CPHCNTSPEEDDIALCONTACTFETCH_H
+#define CPHCNTSPEEDDIALCONTACTFETCH_H
+
+#include "cphcntcontactlinkarrayfetch.h"
+
+class MPhCntContactManager;
+class MVPbkContactLink;
+class MVPbkContactOperationBase;
+
+/**
+ *  ?one_line_short_description
+ *
+ *  ?more_complete_description
+ *
+ *  @lib ?library
+ *  @since S60 ?S60_version *** for example, S60 v3.0
+ */
+NONSHARABLE_CLASS( CPhCntSpeedDialContactLinkFetch ) : public CPhCntContactLinkArrayFetch
+    {
+
+public:
+
+    static CPhCntSpeedDialContactLinkFetch* NewL( 
+        MPhCntContactManager& aContactManager );
+
+    static CPhCntSpeedDialContactLinkFetch* NewLC(
+        MPhCntContactManager& aContactManager );
+
+    virtual ~CPhCntSpeedDialContactLinkFetch();
+    
+    /**
+     * Fetches contact link which is assigned to speed dial position.
+     *
+     * @since S60 v3.1
+     * @param aSpeedDialPosition Speed dial position.
+     * @return Contact link to speed dial contact.
+     */
+    const MVPbkContactLink& FetchSpeedDialLinkL( 
+        TInt aSpeedDialPosition );
+
+    /**
+     * From CPhCntAsyncToSync
+     *
+     * @since S60 ?S60_version
+     * @param ?arg1 ?description
+     * @param ?arg2 ?description
+     * @return ?description
+     */
+    void DoMakeAsyncRequestL();
+    
+
+// from base class ?base_class1
+
+    /**
+     * From ?base_class1.
+     * ?description
+     *
+     * @since S60 ?S60_version
+     * @param ?arg1 ?description
+     */
+
+// from base class ?base_class2
+
+private:
+
+    CPhCntSpeedDialContactLinkFetch( 
+        MPhCntContactManager& aContactManager );
+
+    void ConstructL();
+    
+
+private: // data
+
+    /**
+     * Contact manager.
+     * Not own.
+     */
+    MPhCntContactManager& iContactManager;
+     
+    /**
+     * Operation of contact link fetch.
+     * Own.
+     */
+    MVPbkContactOperationBase* iOperation;
+    
+    /**
+     * Parameter stored from FetchSpeedDialLinkL
+     */
+    TInt iSpeedDialPosition;
+
+    };
+    
+#endif // CPHCNTSPEEDDIALCONTACTFETCH_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/cphcntspeeddialimpl.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,180 @@
+/*
+* 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:  Definition of CPhCntSpeedDialImpl class.
+*
+*/
+
+
+#ifndef CPHCNTSPEEDDIALIMPL_H
+#define CPHCNTSPEEDDIALIMPL_H
+
+#include    <e32base.h>
+#include    "CPhCntSpeedDialMonitor.h"
+
+class CSpdiaDialogs;
+class MPhCntContactManager;
+class CPhCntSpeedDialContactLinkFetch;
+class CPhCntFetchContact;
+class CPhCntContactStores;
+class CPhCntContact;
+class CPhCntSpeedDialMonitor;
+class MPhoneCntPbkOwner;
+class CEikStatusPane;
+
+/**
+ *  ?one_line_short_description
+ *
+ *  ?more_complete_description
+ *
+ *  @lib ?library
+ *  @since S60 ?S60_version *** for example, S60 v3.0
+ */
+NONSHARABLE_CLASS( CPhCntSpeedDialImpl ) 
+    : public CPhCntSpeedDialMonitor
+    {
+    public:
+        
+        static CPhCntSpeedDialImpl* NewL( MPhoneCntPbkOwner& aPbkOwner );
+
+        static CPhCntSpeedDialImpl* NewLC( MPhoneCntPbkOwner& aPbkOwner );
+
+        virtual ~CPhCntSpeedDialImpl();
+    
+    public: // from base class CPhCntSpeedDialMonitor
+
+         /**
+         * From base class CPhCntSpeedDialMonitor
+         * @since S60 v3.2
+         * @see CPhCntSpeedDialMonitor
+         */
+        void GetSpeedDialFieldInfoL( TInt aSpeedDialPosition,
+            TSpdDialFieldInfo& aFieldInfo ); 
+         
+        /**
+         * From base class CPhCntSpeedDialMonitor
+         * @since S60 v3.2
+         * @see CPhCntSpeedDialMonitor
+         */
+        TInt GetSpeedDialFieldL( 
+            TInt aSpeedDialPosition, 
+            TDes& aPhoneNumber );
+
+        /**
+         * From base class CPhCntSpeedDialMonitor
+         * @since S60 v3.2
+         * @see CPhCntSpeedDialMonitor
+         */
+        TInt GetSpeedDialFieldL(
+            TInt aSpeedDialPosition, 
+            TDes& aPhoneNumber,
+            TSpdDialFieldInfo& aFieldInfo );
+            
+            
+        /**
+         * From base class CPhCntSpeedDialMonitor
+         * @since S60 v3.2
+         * @see CPhCntSpeedDialMonitor
+         */
+        TInt AssignSpeedDialFieldL(
+            TInt aSpeedDialPosition,
+            TDes& aPhoneNumber );
+
+        /**
+         * From base class CPhCntSpeedDialMonitor
+         * @since S60 v3.2
+         * @see CPhCntSpeedDialMonitor
+         */
+        TInt AssignSpeedDialFieldL(
+            TInt aSpeedDialPosition,
+            TDes& aPhoneNumber,
+            TSpdDialFieldInfo& aFieldInfo );
+            
+        /**
+         * From base class CPhCntSpeedDialMonitor
+         * @since S60 v3.2
+         * @see CPhCntSpeedDialMonitor
+         */
+        virtual void Cancel();
+        
+        /**
+         * From base class CPhCntSpeedDialMonitor
+         * @since S60 v3.2
+         * @see CPhCntSpeedDialMonitor
+         */
+        virtual CEikImage* CreateNumberTypeIconLC( TInt aNumberType );
+
+    private:
+
+        CPhCntSpeedDialImpl( MPhoneCntPbkOwner& aPbkOwner );
+
+        void ConstructL();
+
+        TInt FetchNumberL( TInt aSpeedDialPosition, TDes& aPhoneNumber );
+                
+        TInt FetchContact( TInt aSpeedDialPosition, CPhCntContact*& aContact );
+        
+        void CopyNumberL( TDes& aAppendTo, const TDesC& aNumber );
+        
+        /**
+         * Setups the field info with new attributes.
+         * @param aContact Contact information
+         * @param aSpeedDialPosition A speed dial position.
+         * @param aFieldInfo Speed dial contact information.
+         */
+        void CopyContactInfoToFieldInfoL( 
+            CPhCntContact& aContact,
+            TInt aSpeedDialPosition, 
+            TSpdDialFieldInfo& aFieldInfo );
+
+    private: // data
+
+        /**
+         * Contact manager for accessing virtual phonebook services.
+         * Not own.
+         */
+        MPhCntContactManager& iContactManager;
+        
+        /**
+         * Phonebook owner
+         * Own.
+         */ 
+        MPhoneCntPbkOwner& iPbkOwner;
+
+        /**
+         * Fetches speed dial contact link.
+         * Own.
+         */
+        CPhCntSpeedDialContactLinkFetch* iSpeedDialContactLinkFetcher;
+        
+        /**
+         * Fetches speed dial contact using speed dial contact link.
+         * Own.
+         */
+        CPhCntFetchContact* iContactFetcher;
+        
+        /**
+         * Service for contact fetching.
+         * Own.
+         */
+        CPhCntContactStores* iContactStores;
+        
+        /**
+         * Speed Dial Dialogs.
+         * Own.
+         */
+        CSpdiaDialogs* iSpdDial;   
+    };
+
+
+#endif // CPHCNTSPEEDDIALIMPL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/cphcntstoreloaderimpl.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,138 @@
+/*
+* 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 contact data store loader implementation.
+*
+*/
+
+
+#ifndef C_PHCNTSTORELOADERIMPL_H
+#define C_PHCNTSTORELOADERIMPL_H
+
+#include "mphcntstoreloader.h"
+#include "mphcntstoreloaderobserver.h"
+#include "cphcntasynctosync.h"
+
+class MPhCntContactManager;
+class MVPbkContactStore;
+
+/**
+ *  Implements services to load contact data stores.
+ *
+ *  @lib phonecntfinder
+ *  @since S60 9.1
+ */
+NONSHARABLE_CLASS( CPhCntStoreLoaderImpl ) 
+        : 
+        public CPhCntAsyncToSync,
+        public MPhCntStoreLoader, 
+        public MPhCntStoreLoaderObserver
+    {
+
+public:
+
+    /**
+     * Two-phased constructor.
+     * @param aManager  Contact manager.
+     */
+    static CPhCntStoreLoaderImpl* NewL( MPhCntContactManager& aManager );
+
+    /**
+     * Two-phased constructor.
+     * @param aManager  Contact manager.
+     */
+    static CPhCntStoreLoaderImpl* NewLC( MPhCntContactManager& aManager );
+    
+    /**
+    * Destructor.
+    */
+    virtual ~CPhCntStoreLoaderImpl();
+
+// from base class MPhCntStoreLoader
+
+    /**
+     * From MPhCntStoreLoader.
+     *
+     * @since S60 v9.1
+     * @see MPhCntStoreLoader.
+     */
+    TBool IsContactStoreLoaded( const TDesC8& aContactLink ) const;
+    
+    /**
+     * From MPhCntStoreLoader.
+     * 
+     * @since S60 v9.1
+     * @see MPhCntStoreLoader.
+     */
+    void LoadContactStoreL( const TDesC8& aContactLink,
+        MPhCntStoreLoaderObserver& aObserver );
+
+// from base class MPhCntStoreLoaderObserver
+
+    /**
+     * From MPhCntStoreLoaderObserver.
+     *
+     * @since S60 v9.1
+     * @see MPhCntStoreLoaderObserver.
+     */
+    void ContactStoreLoadingCompleted( 
+        MVPbkContactStore* aStore, TInt aErrorCode );
+public:   
+    /**
+     * Loads contact store with uri
+     * 
+     * @since S60 v5.1
+     * @param aStoreUri Uri of the store to be loaded.
+     */
+    TInt LoadContactStoreWithUri( const TDesC& aStoreUri );
+    
+protected:
+    /**
+     * From CPhCntAsyncToSync.
+     *
+     * @since S60 v3.2
+     * @see CPhCntAsyncToSync.    
+     */
+    void DoMakeAsyncRequestL();    
+private:
+
+    CPhCntStoreLoaderImpl( MPhCntContactManager& aManager );
+
+    void ConstructL();
+
+    TBool IsContactStoreLoadedL( const TDesC8& aContactLink ) const;
+
+    TBool IsContactStoreLoadedL( const TDesC16& aContactStoreUri ) const;
+private: // data
+
+    /**
+     * Contact manager.
+     * Not own.
+     */
+    MPhCntContactManager& iContactManager;
+    
+    /**
+     * Observer for contact store loading process.
+     * Not own.
+     */
+    MPhCntStoreLoaderObserver* iObserver;
+
+    /**
+     * Pointer to uri of the store to be loaded.
+     * Not own.
+     */
+    const TDesC* iStoreUri;
+    };
+
+#endif // C_PHCNTSTORELOADERIMPL_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/cphcntvoipcontactmatchstrategy.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Finds voip contacts from phonebook
+*
+*/
+
+
+#ifndef CPHCNTVOIPCONTACTMATCHSTRATEGY
+#define CPHCNTVOIPCONTACTMATCHSTRATEGY
+
+#include <e32base.h>
+#include <MVPbkContactFindObserver.h>
+
+#include "mphcntcontactmatchstrategy.h"
+
+class MPhCntVoipContactFinder;
+class MVPbkContactOperationBase;
+
+/**
+ *  Finds voip contacts from phonebook
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CPhCntVoipContactMatchStrategy ): 
+    public CBase, 
+    public MPhCntContactMatchStrategy,
+    private MVPbkContactFindObserver
+    {
+public:
+    
+    static CPhCntVoipContactMatchStrategy* NewL(
+        MPhCntVoipContactFinder& aVoipContactFinder,
+        MVPbkContactFindObserver& aObserver );
+
+    static CPhCntVoipContactMatchStrategy* NewLC(
+        MPhCntVoipContactFinder& aVoipContactFinder,
+        MVPbkContactFindObserver& aObserver );
+
+    virtual ~CPhCntVoipContactMatchStrategy();
+
+// from base class MPhCntContactMatchStrategy
+
+    /**
+     * From base class MPhCntContactMatchStrategy
+     * Starts finding contacts, which contact field matches with aMatchString.
+     *
+     * @since S60 v3.1
+     * @param aMatchString String which is matched against contact fields.
+     */
+    void FindMatchesL( const TDesC& aMatchString );
+
+private:
+
+    CPhCntVoipContactMatchStrategy( 
+        MPhCntVoipContactFinder& aVoipContactFinder,
+        MVPbkContactFindObserver& aObserver );
+
+    void ConstructL();
+    
+// from base class MVPbkContactFindObserver
+    
+    /**
+     * From base class MVPbkContactFindObserver
+     * Called when find is complete. Callee takes ownership of the results.
+     * In case of an error during find, the aResults may contain only 
+     * partial results of the find.
+     *
+     * @since S60 v3.1
+     * @param aResults Array of contact links that matched the find.
+     *                 Callee must take ownership of this object in
+     *                 the start of the function, ie. in case the function
+     *                 leaves the results must be destroyed. The find
+     *                 operation can be destroyed at the end of this callback.
+     */
+    void FindCompleteL( MVPbkContactLinkArray* aResults );
+
+    /** 
+     * From base class MVPbkContactFindObserver
+     * Called in case the find fails for some reason. The find operation
+     * can be destroyed at the end of this callback.
+     * 
+     * @Since S60 v3.1
+     * @param aError One of the system wide error codes.
+     *        KErrNotReady if store is not ready (not open or unavailable).
+     */
+    void FindFailed( TInt aError );
+
+private: // data
+
+    /**
+     * Voip contact finder.
+     * Not own.
+     */
+    MPhCntVoipContactFinder& iVoipContactFinder;
+    
+    /**
+     * Find operation.
+     * Own.
+     */
+    MVPbkContactOperationBase* iFindOperation;
+    
+    /**
+     * Observer of the operation.
+     * Not own.
+     */
+    MVPbkContactFindObserver& iObserver;
+
+    };
+#endif // CPHCNTVOIPCONTACTMATCHSTRATEGY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/cphcntvpbkcontactid.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Contact identifier used with virtual phonebook
+*
+*/
+
+
+#ifndef CPHCNTVPBKCONTACTID_H
+#define CPHCNTVPBKCONTACTID_H
+
+#include "cphcntcontactid.h"
+
+class MVPbkContactLink;
+class MPhCntContactManager;
+
+/**
+ *  Contact identifier.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CPhCntVPbkContactId ) : public CPhCntContactId
+    {
+public:
+
+    /**
+     * Static constructor.
+     * 
+     * @since S60 v3.1
+     * @param aContactLink Contact link, takes ownership.
+     * @param aContactManager Contact manager.
+     */
+    static CPhCntVPbkContactId* NewL( 
+        MVPbkContactLink* aContactLink,
+        MPhCntContactManager& aContactManager );
+
+    /**
+     * Static constructor.
+     * 
+     * @since S60 v3.1
+     * @param aContactLink Contact link, takes ownership.
+     * @param aContactManager Contact manager.
+     */
+    static CPhCntVPbkContactId* NewLC( 
+        MVPbkContactLink* aContactLink,
+        MPhCntContactManager& aContactManager );
+    
+    /**
+     * Static constructor.
+     * 
+     * @since S60 v3.1
+     * @param aContactId Contact identifier.
+     * @param aContactManager Contact manager.
+     */
+    static CPhCntVPbkContactId* NewL( 
+        TContactItemId aContactId,
+        MPhCntContactManager& aContactManager );
+    
+    /**
+     * Static constructor.
+     * 
+     * @since S60 v3.1
+     * @param aContactId Contact identifier.
+     * @param aContactManager Contact manager.
+     */
+    static CPhCntVPbkContactId* NewLC( 
+        TContactItemId aContactId,
+        MPhCntContactManager& aContactManager );
+        
+    /** 
+     * Static constructor.
+     * 
+     * @since S60 v3.2
+     * @param aContactLink MVPbkContactLink as descriptor.
+     * @param aContactManager.
+     */
+    static CPhCntVPbkContactId* NewL( 
+        const TDesC8& aContactLink,
+        MPhCntContactManager& aContactManager );
+
+        
+    /**
+     * Destructor. 
+     *
+     * @since S60 v3.1
+     */
+    virtual ~CPhCntVPbkContactId();
+
+    /**
+     * Gives access to contact link, which
+     * identifies a contact in contact store.
+     * @precond IsValid() returns ETrue
+     * @since S60 v3.1
+     * @return Contact link, which identifies contacts.
+     */
+    const MVPbkContactLink& ContactLink() const;
+
+// from base CPhCntContactId
+
+     /**
+      * From CPhCntContactId
+      *
+      * @since S60 v3.1
+      * @see CPhCntContactId
+      */
+     CPhCntContactId* CloneL() const;
+     
+     /**
+      * From CPhCntContactId
+      *
+      * @since S60 v3.1
+      * @see CPhCntContactId
+      */
+     void Invalidate();
+      
+     /**
+      * From CPhCntContactId
+      *
+      * @since S60 v3.1
+      * @see CPhCntContactId
+      */
+     TBool IsValid() const;
+     
+     /**
+      * From CPhCntContactId
+      *
+      * @since S60 v3.1
+      * @see CPhCntContactId
+      */
+     TContactItemId ContactId() const;
+      
+     /**
+      * From CPhCntContactId
+      *
+      * @since S60 v3.1
+      * @see CPhCntContactId
+      */
+     HBufC8* PackLC() const;
+      
+
+private:
+
+    CPhCntVPbkContactId( 
+        MVPbkContactLink* aContactLink,
+        MPhCntContactManager& aContactManager );
+
+    void ConstructL( TContactItemId aContactItemId );
+    
+    void ConstructL( const TDesC8& aContactLink );
+
+private: // data
+
+    /**
+     * Contact link, which identifies the contact.
+     * Own.
+     */
+    MVPbkContactLink* iContactLink;
+     
+    /**
+     * Contact manager for converting contact id to contact link.
+     * Not own.
+     */
+    MPhCntContactManager& iContactManager;     
+
+    };
+
+
+
+#endif // CPHCNTVPBKCONTACTID_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/cphcntvpbkthumbnailloader.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Thumbnail loader for loading thumbnails contact store.
+*
+*/
+
+
+#ifndef CPHCNTVPBKTHUMBNAILLOADER_H
+#define CPHCNTVPBKTHUMBNAILLOADER_H
+
+#include <MPbk2ImageOperationObservers.h>
+
+#include "cphcntthumbnailloaderbase.h"
+#include "MPhCntContactFetchObserver.h"
+
+class MPhCntContactStores;
+class CPhCntContact;
+class MVPbk2ImageOperation;
+
+/**
+ *  Loader for loading thumbnails from contact store.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CPhCntVPbkThumbnailLoader ) : 
+    public CPhCntThumbnailLoaderBase,
+    private MPhCntContactFetchObserver,
+    private MPbk2ImageGetObserver
+    {
+
+public:
+
+    /**
+     * Static constructor.
+     *
+     * @since S60 v3.1
+     * @param aContactStores Contact stores, where thunbnails are loaded.
+     */
+    static CPhCntVPbkThumbnailLoader* NewL( 
+        MPhCntContactStores& aContactStores );
+
+    /**
+     * Static constructor.
+     *
+     * @since S60 v3.1
+     * @param aContactStores Contact stores, where thunbnails are loaded.
+     */
+    static CPhCntVPbkThumbnailLoader* NewLC(
+        MPhCntContactStores& aContactStores );
+
+    /** 
+     * Destructor.
+     *
+     * @since S60 v3.1
+     */
+    virtual ~CPhCntVPbkThumbnailLoader();
+    
+// From base class MPhCntThumbnailLoader.
+
+    /**
+     * From base class MPhCntThumbnailLoader.
+     *
+     * @since S60 v3.1
+     * @see MPhCntThumbnailLoader
+     */
+    void Release();
+    
+    /**
+     * From base class MPhCntThumbnailLoader.
+     *
+     * @since S60 v3.1
+     * @see MPhCntThumbnailLoader
+     */
+    void Cancel();
+
+protected:
+
+// from base class CPhCntThumbnailLoaderBase
+    
+    /**
+     * From CPhCntThumbnailLoaderBase
+     *
+     * @since S60 v3.1
+     * @see CPhCntThumbnailLoaderBase
+     */
+    void DoLoadL( const CPhCntContactId& aContactId );
+    
+private:
+
+// From base class MPhCntContactFetchObserver
+
+    /**
+     * From MPhCntContactFetchObserver
+     *
+     * @since S60 v3.1
+     * @see MPhCntContactFectchObserver
+     */
+    void ContactReceived( CPhCntContact* aContact, TInt aError );
+    
+// from base class MPbk2ImageGetObserver
+
+    /**
+     * From base class MPbk2ImageGetObserver
+     *
+     * @since S60 v3.1
+     * @see MPbk2ImageGetObserver
+     */
+    void Pbk2ImageGetComplete
+        (MPbk2ImageOperation& aOperation, CFbsBitmap* aBitmap);
+
+    /**
+     * From base class MPbk2ImageGetObserver
+     *
+     * @since S60 v3.1
+     * @see MPbk2ImageGetObserver
+     */
+    void Pbk2ImageGetFailed
+        (MPbk2ImageOperation& aOperation, TInt aError);
+
+    CPhCntVPbkThumbnailLoader( MPhCntContactStores& aContactStores );
+
+    void ConstructL();
+
+private: // data
+
+    /**
+     * Contact stores for fetching contact.
+     * own.
+     */
+    MPhCntContactStores* iContactStores;
+    
+    /**
+     * Contact received.
+     * Own.
+     */
+    CPhCntContact* iReceivedContact;
+    
+    /**
+     * Thumbnail loading operation
+     * Own.
+     */
+    MPbk2ImageOperation* iOperation;
+
+    };
+
+#endif // CPHCNTVPBKTHUMBNAILLOADER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/mphcntaiwservice.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Inteface for fetching contact links from AIW.
+*
+*/
+
+
+#ifndef MPHCNTAIWSERVICE_H
+#define MPHCNTAIWSERVICE_H
+
+class MPhCntServiceRequestParam;
+class MPhCntServiceResult;
+
+NONSHARABLE_CLASS( MPhCntAiwServiceObserver )
+    {
+public:
+    
+    /**
+     * Indicates that AIW service request is complete.
+     * 
+     * @since S60 v3.2
+     * @param aError Possible error code.
+     */
+    virtual void RequestComplete( TInt aError ) = 0;
+    };
+
+/**
+ * AIW service wrapper interface.
+ *
+ * @lib PhoneCntFinder.lib
+ * @since S60 v3.2
+ */
+NONSHARABLE_CLASS( MPhCntAiwService )
+    {
+public:
+
+    /**
+     * Destructor.
+     *
+     * @since S60 v3.2
+     */
+    virtual ~MPhCntAiwService() {};
+    
+    /**
+     * Cancels the possible outstanding request.
+     * @since S60 v3.2
+     */
+    virtual void Cancel() = 0;
+    
+    /**
+     * Determines if request is active.
+     * @since S60 v3.2
+     */
+    virtual TBool IsRequestActive() const = 0;
+         
+    /**
+     * Makes AIW service request
+     *
+     * @since S60 v3.2
+     * @param aService Parameters used with AIW.
+     * @param aResult Result of the request.
+     * @param aObserver Observer, which is notified when request has completed.
+     */
+    virtual void ExecuteRequestL( 
+        MPhCntServiceRequestParam& aServiceRequestParams, 
+        MPhCntServiceResult& aResult,
+        MPhCntAiwServiceObserver& aObserver) = 0;
+    
+    };
+
+#endif // MPHCNTAIWSERVICE_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/mphcntcontactfields.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,223 @@
+/*
+* 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 contact fields.
+*
+*/
+
+#ifndef MPHCNTCONTACTFIELDS_H
+#define MPHCNTCONTACTFIELDS_H
+
+#include <e32std.h>
+#include "MPhCntMatch.h"
+#include "tphcntnumber.h"
+
+class MVPbkContactLinkArray;
+class MVPbkStoreContact;
+class MVPbkFieldType;
+
+/**
+ *  Interface for contact fields
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( MPhCntContactFields )
+    {
+public:
+    
+    /**
+     * Destructor.
+     *
+     * @since S60 v3.1
+     */
+    virtual ~MPhCntContactFields() {};
+
+    /**
+     * Gives the matched numbers number type. Note that
+     * this can be ENone when the contact fields were
+     * fetched from contact stores without matching.
+     *
+     * @since S60 v3.1
+     * @return Type of matched number.
+     */
+    virtual MPhCntMatch::TNumberType NumberType() const = 0;
+        
+    /**
+     * Gives the contact's link where these contact fields
+     * are from.
+     *
+     * @since S60 v3.1
+     * @return Contact link, ownership not given.
+     */
+    virtual MVPbkContactLink* ContactLink() const = 0;
+    
+    /**
+     * First name field from contact.
+     *
+     * @since S60 v3.1
+     * @return Field text. Empty if there isn't one specified.
+     */
+    virtual TPtrC FirstName() const = 0;
+
+    /**
+     * Last name field from contact.
+     *
+     * @since S60 v3.1
+     * @return Field text. Empty if there isn't one specified.
+     */
+    virtual TPtrC LastName() const = 0;
+
+    /**
+     * Company name field from contact.
+     *
+     * @since S60 v3.1
+     * @return Field text. Empty if there isn't one specified.
+     */
+    virtual TPtrC CompanyName() const = 0;
+
+    /**
+     * Number that matched. Note that this may be 
+     * zero length, if contactfields were fetched without 
+     * matching.
+     *
+     * @since S60 v3.1
+     * @return Field text. Empty if there isn't one specified.
+     */
+    virtual TPtrC Number() const = 0;
+    
+    /**
+     * Dtmf number, which was pointed by contact link.
+     *
+     * @since S60 v3.2
+     * @return Field text. Empty if there isn't one specified.
+     */
+    virtual TPtrC Dtmf() const = 0;
+
+    /**
+     * Ringing tone field from contact.
+     *
+     * @since S60 v3.1
+     * @return Field text. Empty if there isn't one specified.
+     */
+    virtual TPtrC PersonalRingingTone() const = 0;
+    
+    /**
+     * Second name from contact.
+     *
+     * @since S60 v3.1
+     * @return Field text. Empty if there isn't one specified.
+     */
+    virtual TPtrC SecondName() const = 0;
+    
+    /**
+     * First name pronunciation.
+     * 
+     * @since S60 v3.1
+     * @return First name's pronunction. May be zero length.
+     */
+    virtual TPtrC FirstNamePronunciation() const = 0;
+     
+    /**
+     * Last name pronunciation.
+     * 
+     * @since S60 v3.1
+     * @return Last name's pronunction. May be zero length.
+     */
+    virtual TPtrC LastNamePronunciation() const = 0;
+    
+    /**
+     * Company name pronunciation.
+     * 
+     * @since S60 v3.1
+     * @return Company name's pronunction. May be zero length.
+     */
+    virtual TPtrC CompanyNamePronunciation() const = 0;
+    
+    /**
+     * Creates contacts title. 
+     *
+     * @since S60 v3.1
+     * @return Title of the contact, ownership is given.
+     */
+    virtual HBufC* GetContactTitleL() = 0;
+    
+    /**
+     * Links to a contact groups that this contact information belongs to.
+     * Ownership of links is given. May be NULL.
+     *
+     * @since S60 v3.1
+     * @return Links to contact groups.
+     */
+    virtual MVPbkContactLinkArray* ContactGroupsLC() const = 0;
+    
+    /**
+     * Contact information in the store.
+     * 
+     * @since S60 v3.1
+     * @return Contact information
+     */     
+    virtual MVPbkStoreContact& StoreContact() const = 0;
+    
+    /**
+     * Pointer to thumbnails field.
+     * 
+     * @since S60 v3.1
+     * @return thumbnails field or null.
+     */
+    virtual const MVPbkFieldType* ThumbnailField() const = 0;
+    
+    /**
+     * Call image field from contact.
+     * 
+     * @since S60 v3.1
+     * @return Field text. Empty if there isn't one specified.
+     */
+    virtual TPtrC CallImage() const = 0;
+    
+    /**
+     * Call text field from contact.
+     * 
+     * @since S60 v3.1
+     * @return Field text. Empty if there isn't one specified.
+     */
+    virtual TPtrC CallText() const = 0;
+    
+    /**
+     * Call text field from contact.
+     * 
+     * @since S60 v3.1
+     * @return ETrue if contact has thumbnail field, otherwise EFalse.
+     */
+    virtual TBool HasThumbnail() const = 0;
+    
+    /**
+     * Gives all phone numbers that contact has.
+     *
+     * @since S60 v3.2.
+     * @return Array of phone numbers.
+     */     
+    virtual const RArray<TPhCntNumber>& AllNumbers() const = 0;
+
+    /**
+     * Gives all DTMF numbers that contact has.
+     *
+     * @since S60 v3.2.
+     * @return Array of DTMF numbers.
+     */     
+    
+    virtual CDesCArray* AllDtmfNumbers() const = 0; 
+    };
+
+
+#endif // MPHCNTCONTACTFIELDS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/mphcntcontactmatchstrategy.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,47 @@
+/*
+* 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:  Contact match strategy interface.
+*
+*/
+
+
+#ifndef MPHCNTCONTACTMATCHSTRATEGY_H
+#define MPHCNTCONTACTMATCHSTRATEGY_H
+
+#include <e32std.h>
+
+/**
+ * Interface for finding contacts.
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( MPhCntContactMatchStrategy ) 
+    {
+
+public:
+
+    virtual ~MPhCntContactMatchStrategy() {};
+
+    /**
+     * Starts finding contacts, which contact field matches with aMatchString.
+     *
+     * @since S60 v3.1
+     * @param aMatchString String which is matched against contact fields.
+     */
+    virtual void FindMatchesL( const TDesC& aMatchString ) = 0;
+
+    };
+
+#endif // MPHCNTCONTACTMATCHSTRATEGY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/mphcntcontactstoreeventobserver.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,45 @@
+/*
+* 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 contact store events.
+*
+*/
+
+
+#ifndef MPHCNTCONTACTSTOREEVENTOBSERVER_H
+#define MPHCNTCONTACTSTOREEVENTOBSERVER_H
+
+/**
+ *  Observer interface for contact store events.
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since S60 v3.2
+ */
+class MPhCntContactStoreEventObserver
+    {
+
+public:
+
+    /**
+     * Indication that contact store availability has changed.
+     *
+     * @since S60 v3.2
+     */
+    virtual void ContactStoreAvailabilityChanged() = 0;
+
+protected:
+
+    };
+
+
+#endif // MPHCNTCONTACTSTOREEVENTOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/mphcntservicerequestparam.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Abstract base class for service request param.
+*
+*/
+
+
+#ifndef MPHCNTSERVICEREQUESTPARAM_H
+#define MPHCNTSERVICEREQUESTPARAM_H
+
+#include <e32std.h>
+#include <AiwCommon.hrh>
+
+class CAiwGenericParamList;
+
+/**
+ *  Abstract base class for service request param
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( MPhCntServiceRequestParam )
+    {
+public:
+    
+    virtual ~MPhCntServiceRequestParam() {};
+    
+    /**
+     * Gives the AIW command, that this parameter represents.
+     * 
+     * @since S60 v3,1
+     * @return AIW command.
+     */
+    virtual TAiwServiceCommands Command() const = 0;
+
+    /**
+     * Gives the AIW InParamList
+     * 
+     * @since S60 v3,1
+     * @return AIW param list..
+     */
+    virtual const CAiwGenericParamList& InParamList() const = 0;
+
+    
+    };
+
+
+#endif // MPHCNTSERVICEREQUESTPARAM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/mphcntservicerequestparamfactory.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Abstract base class for param factory
+*
+*/
+
+
+#ifndef MPHCNTSERVICEREQUESTPARAMFACTORY_H
+#define MPHCNTSERVICEREQUESTPARAMFACTORY_H
+
+#include "CPhCntSingleItemFetch.h"
+#include "cphcntcontactdataselection.h"
+
+class MPhCntServiceRequestParam;
+class MVPbkContactLinkArray;
+class MPhCntContactManager;
+
+/**
+ *  Abstract base class for creating AIW service request params.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( MPhCntServiceRequestParamFactory )
+    {
+public:
+
+    virtual ~MPhCntServiceRequestParamFactory() {};
+    
+    /**
+     * Creates new parameter for creating new contact.
+     *
+     * @since S60 v3.1
+     * @param aPhoneNumber Phone number of new contact.
+     * @return New instance.
+     */
+    virtual MPhCntServiceRequestParam* 
+        CreateCreateNewContactRequestParamLC( const TDesC& aPhoneNumber ) const = 0;
+        
+    /**
+     * Creates new paramater for updating existing contact.
+     *
+     * @since S60 v3.1
+     * @param aPhoneNumber Phone number added to existing contact.
+     * @return New param.
+     */   
+    virtual MPhCntServiceRequestParam* 
+        CreateUpdateContactRequestParamLC( const TDesC& aPhoneNumber ) const = 0;
+        
+    /**
+     * Creates new parameter for fetching user selected phone number link.
+     *
+     * @since S60 v3.1
+     * @return New parameter instance.
+     */
+    virtual MPhCntServiceRequestParam* 
+        CreateGetUserSelectedPhoneNumberLinkParamLC() const = 0;
+        
+    /**
+     * Creates new parameter for fetching user selected dtmf number link.
+     *
+     * @since S60 v3.2
+     * @param aContactManager Contact manager reference.
+     * @return New parameter instance.
+     */
+    virtual MPhCntServiceRequestParam* 
+        CreateGetUserSelectedDtmfNumberLinkLC( 
+            MPhCntContactManager& aContactManager ) const = 0;
+
+    /**
+     * Creates new parameter for fetching user selected voip address link.
+     *
+     * @since S60 v5.0
+     * @param aContactManager Contact manager reference.
+     * @return New parameter instance.
+     */  
+    virtual MPhCntServiceRequestParam* 
+        CreateGetUserSelectedVoIPAddressLinkParamLC( 
+            MPhCntContactManager& aContactManager ) const = 0;
+
+    /**
+     * Creates parameter for fetching user selected VoIPumber.
+     * The left soft key is 'Select."
+     *
+     * @since S60 v5.0
+     * @param aContactManager Contact manager reference.
+     * @return New parameter instance.
+     */
+    virtual MPhCntServiceRequestParam* 
+        CreateGetUserSelectedVoIPAddressLC( 
+            MPhCntContactManager& aContactManager ) const = 0;
+
+    /**
+     * Creates new parameter for fetching a phone number from
+     * known contact, which is identified by contact link.
+     * @since S60 v3.2
+     * @param aContactLink Link to a contact.
+     * @param aCallType Number type.
+     * @return New parameter instance.
+     */         
+    virtual MPhCntServiceRequestParam*         
+        CreateGetPhoneNumberFromContactParamLC( 
+            const TDesC8& aContactLink,
+            const CPhCntSingleItemFetch::TCallType aCallType ) const = 0;
+    
+    /**
+     * Creates new parameter for fetching a phone number from
+     * known contact, which is identified by contact link.
+     * @since S60 v3.2
+     * @param aContactLink Link to a contact.
+     * @param aCallType Number type.
+     * @return New parameter instance.
+     */    	
+    virtual MPhCntServiceRequestParam* CreateGetPhoneNumberFromContactParamL(
+        const TDesC8& aContactLink,
+        const CPhCntSingleItemFetch::TCallType aCallType ) const = 0;
+        	
+    };
+
+
+#endif // MPHCNTSERVICEREQUESTPARAMFACTORY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/mphcntserviceresult.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Base class for service results.
+*
+*/
+
+
+#ifndef MPHCNTSERVICERESULT_H
+#define MPHCNTSERVICERESULT_H
+
+class CAiwGenericParamList;
+
+/**
+ *  Interface of the MPhCntService results.
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since S60 v3.2
+ */
+class MPhCntServiceResult 
+    {
+public:
+    /**
+     * Result from MPhCntService request.
+     *
+     * @since S60 v3.2
+     * @param aResult Result of the service request.
+     */
+    virtual void ParseResult( 
+        CAiwGenericParamList& aResult ) = 0;
+    };
+
+
+#endif // MPHCNTSERVICERESULT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/mphcntstoreloader.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Interface for loading contact stores.
+*
+*/
+
+
+#ifndef M_MPHCNTSTORELOADER_H
+#define M_MPHCNTSTORELOADER_H
+
+#include <e32base.h>
+
+class MPhCntStoreLoaderObserver;
+
+/**
+ *  Interface for loading contact stores.
+ *
+ *  @lib phonecntfinder.lib
+ *  @since S60 v9.1
+ */
+class MPhCntStoreLoader
+    {
+
+public:
+
+    /**
+    * Destructor.
+    */
+    virtual ~MPhCntStoreLoader() { };
+
+    /**
+     * Checks is the specified contact store loaded.
+     *
+     * @since   S60 v9.1
+     * @param   aContactLink      A contact link containing store to load.
+     * @return  ETrue if store is loaded, EFalse otherwise.
+     */
+    virtual TBool IsContactStoreLoaded( 
+        const TDesC8& aContactLink ) const = 0;
+    
+    /**
+     * Starts to load specified contact store if not yet loaded.
+     * MPhCntStoreLoaderObserver::ContactStoreLoaded is called when contact
+     * store is loaded and ready for use.
+     *
+     * @since   S60 v9.1
+     * @param   aContactLink      A contact link containing store to load.
+     * @param   aObserver         An observer for the loading process.
+     */
+    virtual void LoadContactStoreL( const TDesC8& aContactLink,
+        MPhCntStoreLoaderObserver& aObserver ) = 0;
+    };
+
+#endif // M_MPHCNTSTORELOADER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/mphcntstoreloaderobserver.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Observer interface for contact data store loading process.
+*
+*/
+
+
+#ifndef M_MPHCNTSTORELOADEROBSERVER_H
+#define M_MPHCNTSTORELOADEROBSERVER_H
+
+#include <e32base.h>
+
+class MVPbkContactStore;
+
+/**
+ * Observer interface for contact data store loading process.
+ *
+ * @lib phonecntfinder.lib
+ * @since S60  v9.1
+ */
+class MPhCntStoreLoaderObserver 
+    {
+public:
+    
+    /**
+     * Callback to indicate that contact data store loading process is
+     * completed. 
+     *
+     * @param   aStore          The contact store which was loaded or NULL if
+     *                          error occured. Ownership is not transferred. 
+     * @param   aErrorCode      System wide error code if error occured.
+     */
+    virtual void ContactStoreLoadingCompleted( 
+        MVPbkContactStore* aStore, TInt aErrorCode ) = 0;
+    };
+
+#endif // M_MPHCNTSTORELOADEROBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/mphcntvoipcontactfinder.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,56 @@
+/*
+* 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 finding voip contacts.
+*
+*/
+
+
+#ifndef MPHCNTVOIPCONTACTFINDER_H
+#define MPHCNTVOIPCONTACTFINDER_H
+
+#include <e32std.h>
+
+class MVPbkContactOperationBase;
+class MVPbkContactFindObserver;
+
+/**
+ *  Interface for finding voip contacts.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+class MPhCntVoipContactFinder
+    {
+public:
+
+    /**
+     * Finds voip contacts, with given URI or partial URI. To cancel
+     * the find, destroy the returned operation.
+     * @since S60 v3.1
+     * @param aSipURI Sip uri defining wanted matches.
+     * @param aObserver Observer of the operation.
+     * @return Operation.
+     */
+    virtual MVPbkContactOperationBase* FindVoipContactsL( 
+        const TDesC& aSipURI,
+        MVPbkContactFindObserver& aObserver ) const = 0;
+
+protected:
+
+    virtual ~MPhCntVoipContactFinder() {};
+    
+    };
+
+
+#endif // MPHCNTVOIPCONTACTFINDER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/tphcntaiwserviceobserver.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,158 @@
+/*
+* Copyright (c) 2007-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 Phonebook AIW services.
+*
+*/
+
+
+#ifndef TPHCNTAIWSERVICEOBSERVER_H
+#define TPHCNTAIWSERVICEOBSERVER_H
+
+#include <e32std.h>
+
+#include <AiwCommon.h>
+
+class MPhCntServiceResult;
+class MPhCntAiwServiceCompleteObserver;
+class MPhCntServiceRequestParam;
+
+/**
+ * Callback to indicate when phonebook's AIW service request
+ * is complete.
+ *
+ * @lib PhoneCngFinder.lib
+ * @since S60 3.2
+ */
+NONSHARABLE_CLASS( MPhCntAiwServiceCompleteObserver )
+    {
+public:
+    
+    /**
+     * Called when Phonebook's AIW service request is complete.
+     * @param aError Error code.
+     */
+    virtual void ServiceRequestComplete( TInt aError ) = 0;
+    
+    };
+
+/**
+ *  Observes Phonebook AIW services.
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since S60 3.2
+ */
+NONSHARABLE_CLASS( TPhCntAiwServiceObserver ) : public MAiwNotifyCallback
+    {
+public:
+
+    /**
+     * Constructor.
+     * @param aObserver Callback to indicate when Phonebook's AIW service
+     * request is complete.
+     */
+    TPhCntAiwServiceObserver(MPhCntAiwServiceCompleteObserver& aObserver);
+    
+    /**
+     * Activates observing. When Phonebook AIW service request is complete,
+     * aResult will be notfied that request is done and 
+     * MPhCntAiwServiceCompleteObserver is notified.
+     * 
+     * @param aParams The requests parameters that this class is set to 
+     * observ.
+     * @aResult Result handler.
+     */
+    void SetRequestAndResult( 
+        MPhCntServiceRequestParam* aParams,
+        MPhCntServiceResult* aResult
+        );
+    
+// from base class MAiwNotifyCallback
+    
+    /**
+      * From MAiwNotifyCallback
+      *
+      * @since S60 v3.1
+      * @see MAiwNotifyCallback
+      */
+     TInt HandleNotifyL(
+		TInt aCmdId,
+		TInt aEventId,
+		CAiwGenericParamList& aEventParamList,
+		const CAiwGenericParamList& aInParamList);
+		
+private:
+    
+    /** 
+     * Parses error value from paramlist when KAiwEventError comes
+     * from service provider.
+     *
+     * @since S60 v3.1
+     * @parma aEventParamList Event parameters.
+     */
+	TInt ParseErrorCode( const CAiwGenericParamList& aEventParamList );
+	
+	/**
+	 * Finds first TInt value from param list.
+	 * 
+	 * @since S60 v3.1
+	 * @Returns KErrNotFound if paramter with aParameterId not found.
+	 */
+	TInt FindFirstTInt32Value( 
+	    const CAiwGenericParamList& aEventParamList, 
+	    TGenericParamId aParameterId,
+	    TInt& aValue ) const;
+	
+	/**
+	 * Indication that response for request has arrived.
+	 * @param aError Possible error code.
+	 */
+	void ResponseReceived( TInt aError );
+
+    /**
+     * Checks if current process is Phone application process.
+     * @since S60 v3.1
+     * @return ETrue - Running in phone app process.
+     */	
+	TBool RunningInPhoneAppProcess() const;
+		
+private: 
+    
+    /**
+	 * Result of the request.
+	 * Now own.
+	 */
+	MPhCntServiceResult* iResult;
+	
+	/**
+	 * Request params.
+	 * Not own.
+	 */
+	MPhCntServiceRequestParam* iParams;
+	
+	/**
+	 * Service request observer.
+	 * Not own.
+	 */
+	MPhCntAiwServiceCompleteObserver& iObserver;
+	
+	/**
+	 * State variable indicating that AIW service is shutting down, because
+	 * user has pressed end key.
+	 */
+	TBool iAiwServiceShuttingDown;
+
+    };
+
+    
+#endif // TPHCNTAIWSERVICEOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/tphcntcontactfield.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,208 @@
+/*
+* 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:  Resolves and represents the contact field information
+*
+*/
+
+#ifndef TPHCNTCONTACTFIELD_H
+#define TPHCNTCONTACTFIELD_H
+
+
+#include <e32base.h>
+#include <TVPbkFieldVersitProperty.h>
+#include "MPhCntMatch.h"
+#include "tphcntnumber.h"
+
+class MPhCntContactManager;
+class MVPbkStoreContactField;
+
+
+/**
+ *  Contact field from contact.
+ *
+ *  Resolves the type of the contact field ysing contact field id.
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( TPhCntContactField ) 
+    {
+public:
+    
+    /**
+     * Constructor.
+     * 
+     * @since S60 v3.1
+     * @param aContactFieldId Contact field identifier.
+     */
+    TPhCntContactField( TInt aContactFieldId );
+    
+    /**
+     * Constructor.
+     *
+     * @since S60 v3.1
+     */
+    TPhCntContactField();
+    
+    /**
+     * Destructor.
+     *
+     * @since S60 v3.1
+     */
+    virtual ~TPhCntContactField();
+        
+    /** 
+     * Resolves if the contact field data belongs to this
+     * contact field. If the contact field data belongs to this then
+     * the data is stored to this field.
+     *
+     * @since S60 v3.1
+     * @param aContactFieldId aFieldData's field identifier.
+     * @param aFieldData Data in the contact field.
+     * @param aPointedField Was the field data pointed by contact link.
+     */
+    virtual void Resolve( 
+        TInt aContactFieldId, 
+        const TDesC& aFieldData, 
+        TBool aPointedField );
+
+    /**
+     * Data of the field.
+     *
+     * @since S60 v3.1
+     * @return Data.
+     */
+    const TDesC& Data() const;
+
+protected:
+
+    /**
+     * Sets the data.
+     */
+    void SetData( const TDesC& aData, TBool aPointedData );
+    
+protected: // data 
+
+    /**
+     * Was the data set by pointed field.
+     */
+    TBool iDataPointedByContactLink;
+
+private: // data
+
+    /**
+     * Data of the contact field.
+     */
+    TPtrC iContactFieldData;
+    
+    /**
+     * Possible field id, which identifies this field.
+     */
+    TInt iContactFieldId;
+    
+    };
+    
+/**
+ *  Phonenumber contact field.
+ *
+ *  Resolves phone numbers from virtual phonebook. 
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( TPhCntPhoneNumber ): public TPhCntContactField
+    {
+public:
+
+    /**
+     * Constructor.
+     *
+     * @since S60 v3.1
+     */
+    TPhCntPhoneNumber();
+    
+    /**
+     * Destructor.
+     *
+     * @since S60 v3.1
+     */
+    ~TPhCntPhoneNumber();
+    
+    /**
+     * Gives the phone number that was matched(pointed by VPB) from contact.
+     * If there wasn't number that were pointed by VPB this number does
+     * not contain information.
+     *
+     * @since S60 v3.1.
+     * @return Possible number which was pointed by virtual phonebook
+     */
+    const TPhCntNumber& Number() const;
+    
+    /**
+     * Gives array of all resolved numbers, including possible matched number.
+     *
+     * @since S60 v3.1.
+     * @return Array of phone numbers.
+     */     
+    const RArray<TPhCntNumber>& AllNumbers() const;
+            	
+// from base class TPhCntContactField
+
+    /**
+     * From TPhCntContactField.
+     *
+     * @since S60 v3.1
+     * @see TPhCntContactField.
+     */
+    void ResolveL( 
+        TInt aContactFieldId, 
+        const TDesC& aFieldData, 
+        TBool aPointedField,
+        MPhCntContactManager& aContactManager,
+    	MVPbkStoreContactField& aContactField
+        );                  
+    
+protected: 
+
+	/**
+     * Evaluates the type of a phone number field.
+     * @param aContactFieldId Field to be resolved.
+     * @return Resolved phone number type, 
+     *         MPhCntMatch::ENone if the type was other than a phone number
+     */
+    MPhCntMatch::TNumberType PhoneNumberType( 
+    	TInt aContactFieldId );    	
+    	
+    void SetNumber( const TDesC& aNumber, 
+                    MPhCntMatch::TNumberType aNumberType, 
+                    TBool aPointedField,
+                    TInt aSpeedDialPosition );
+        
+private: // Data
+    
+    /**
+     * Phone number that was pointed by contact link.
+     */
+    TPhCntNumber iPointedNumber;
+    
+    /**
+     * Array of all resolved phone numbers, including
+     * pointed number.
+     * Own.
+     */
+    RArray<TPhCntNumber> iAllNumbers;
+
+    };
+
+#endif // TPHCNTCONTACTFIELD_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/tphcntcontactlinkresult.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* 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:  Result of getting user selected contact link.
+*
+*/
+
+
+#ifndef TPhCntContactLinkResult_H
+#define TPhCntContactLinkResult_H
+
+#include <e32std.h>
+
+#include "mphcntserviceresult.h"
+
+/**
+ *  Result of the request to get the user selected phone numbers link.
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( TPhCntContactLinkResult )
+    : public MPhCntServiceResult
+    {
+    
+public: 
+
+    /**
+     * Constructor.
+     *
+     * @since S60 v3.2
+     * @param aLink Descriptor where the contact link is set (may be null) when
+     * MPhCntService request completes. 
+     */
+    TPhCntContactLinkResult( HBufC8*& aLink );
+    
+// from base class MPhCntServiceResult
+
+    /**
+     * From MPhCntServiceResult
+     * Parses the result.
+     *
+     * @since S60 v3.2
+     * @see MPhCntServiceResult
+     */
+    void ParseResult( 
+        CAiwGenericParamList& aResult );
+
+private: // data
+
+    /**
+     * Link
+     * Now own.
+     */
+    HBufC8*& iLink;
+
+    };
+
+#endif // TPhCntContactLinkResult_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/tphcntcontactstorestate.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Holds state of a contact store.
+*
+*/
+
+
+#ifndef TPHCNTCONTACTSTORESTATE_H
+#define TPHCNTCONTACTSTORESTATE_H
+
+#include <e32std.h>
+#include <TVPbkContactStoreUriPtr.h>
+
+/**
+ *  Holds contact store state.
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since S60 v3.2
+ */
+class TPhCntContactStoreState
+    {
+public:
+
+    /**
+     * Constructor.
+     *
+     * @since S60 v3.2
+     * @param aContactStoreUri Uri of the contact store.
+     */
+    TPhCntContactStoreState( TVPbkContactStoreUriPtr aContactStoreUri );
+
+    /**
+     * Determines if contact store is available.
+     *
+     * @since S60 v3.2
+     * @return Contact store availability
+     */
+    TBool IsAvailable() const;
+    
+    /**
+     * Gives the URI of the contact store.
+     * 
+     * @since S60 v3.2
+     * @return Contact store URI.
+     */
+    const TVPbkContactStoreUriPtr& ContactStoreUri() const;
+    
+    /**
+     * Set availability.
+     *
+     * @since S60 v3.2
+     * @param aAvailable - ETrue, store is available.
+     *                     EFalse, store is unavailable.
+     */
+    void SetAvailability( TBool aIsAvailable );
+    
+private: // data
+
+    /**
+     * Uri of the contact store.
+     */
+    TVPbkContactStoreUriPtr iContactStoreUri;
+    
+    /**
+     * Contact store availability.
+     */
+    TBool iIsAvailable;
+
+    };
+
+#endif // TPHCNTCONTACTSTORESTATE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/tphcntcontactutil.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Contact utilitiest class
+*
+*/
+
+
+#ifndef PHCNTCONTACTUTIL_H
+#define PHCNTCONTACTUTIL_H
+
+#include "CPhCntContact.h"
+
+/**
+ *  Contact utilities.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v5.1
+ */
+NONSHARABLE_CLASS( TPhCntContactUtil ) 
+    {
+public:
+    
+    /**
+     * Checks are name fields same in both contacts.
+     * Checked fields are First name, Last name and Company name.
+     *
+     * @since S60 v5.1
+     * @param aFirstContact First Contact to be checked.
+     * @param aSecondContact Second Contact to be checked.
+     * @return ETrue if name fields are same in both contacts.
+     */
+    static TBool AreFirstAndLastAndCompanyNameSame( 
+            const CPhCntContact& aFirstContact,
+            const CPhCntContact& aSecondContact );
+    
+    };
+
+#endif // PHCNTCONTACTUTIL_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/tphcntnullserviceresult.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Empty service result.
+*
+*/
+
+
+#ifndef TPHCNTNULLSERVICERESULT_H
+#define TPHCNTNULLSERVICERESULT_H
+
+#include <e32std.h>
+
+#include "mphcntserviceresult.h"
+
+/**
+ *  Service result, which does not parse the result.
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( TPhCntNullServiceResult ) : public MPhCntServiceResult
+    {
+public:
+
+    TPhCntNullServiceResult();
+
+// from base class MPhCntServiceResult
+
+    /**
+     * From MPhCntServiceResult
+     *
+     * @since S60 v3.2
+     * @see MPhCntServiceResult
+     */
+    void ParseResult( CAiwGenericParamList& aResult );
+
+    };
+
+#endif // TPHCNTNULLSERVICERESULT_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/tphcntnumber.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Phone number
+*
+*/
+
+
+#ifndef TPHCNTNUMBER_H
+#define TPHCNTNUMBER_H
+
+#include <e32std.h>
+
+#include "MPhCntMatch.h"
+
+/**
+ *  Represents phone number.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3,1
+ */
+class TPhCntNumber 
+    {
+    
+public:
+    /**
+     * Constructor.
+     * 
+     * @since S60 v3.1
+     * @param aNumber Phone number. Given number has to stay accessible 
+     * as long as this class is used. Does not copy the number.
+     * @param aNumberType Number's type.
+     * @param aSpeedDialPosition Speed dial position (a value between 1 and 9).
+     */
+    TPhCntNumber( const TDesC& aNumber, MPhCntMatch::TNumberType aNumberType, TInt aSpeedDialPosition );
+    
+    /**
+     * Constructs empty number.
+     *
+     * @since S60 v3.2.
+     */
+    TPhCntNumber();
+
+    /**
+     * Gives the number
+     *
+     * @since S60 v3.1
+     * @return Number
+     */
+    const TDesC& Number() const;
+    
+    /**
+     * Gives the number type
+     *
+     * @since S60 v3.1
+     * @return Number type
+     */
+    MPhCntMatch::TNumberType Type() const;
+    
+    /**
+     * Gives the speed dial position
+     *
+     * @since S60 v3.2
+     * @return Position
+     */
+    TInt Position() const;    
+    
+    /**
+     * Sets the number and its type. Note that ownership of the data is 
+     * not taken ie the data has to live as long as this instance.
+     *
+     * @since S60 v3.2.
+     * @param aNumber Phone number. Given number has to stay accessible 
+     * as long as this class is used. Does not copy the number.
+     * @param aNumberType Number's type.
+     * @param aSpeedDialPosition Speed dial position or 0.
+     */
+    void Set( const TDesC& aNumber, MPhCntMatch::TNumberType aNumberType, TInt aSpeedDialPosition );
+    
+private: // data
+
+    /**
+     * Phone number.
+     */
+    TPtrC iNumber;
+    
+    /**
+     * Number's type.
+     */
+    MPhCntMatch::TNumberType iNumberType;     
+    
+    /**
+     * Speed dial position.
+     */
+    TInt iSpeedDialPosition;    
+
+    };
+
+#endif // TPHCNTNUMBER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/tphcntservicerequestparamfactory.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,166 @@
+/*
+* 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:  Factory for creating service request params.
+*
+*/
+
+
+#ifndef TPHCNTSERVICEREQUESTPARAMFACTORY_H
+#define TPHCNTSERVICEREQUESTPARAMFACTORY_H
+
+#include <e32base.h>
+
+#include "mphcntservicerequestparamfactory.h"
+
+class MPhCntServiceRequestParam;
+class MPhCntContactManager;
+
+/**
+ *  Factory class for creating service request params.
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CPhCntServiceRequestParamFactory ): 
+    public CBase, 
+    public MPhCntServiceRequestParamFactory
+    {
+public:
+ 
+    /**
+     * Static constructor.
+     * @since S60 v3.2
+     */
+    static CPhCntServiceRequestParamFactory* NewL( 
+        MPhCntContactManager& aContactManager );
+    
+    /**
+     * Static constructor.
+     * @since S60 v3.2
+     */
+    static CPhCntServiceRequestParamFactory* NewLC( 
+        MPhCntContactManager& aContactManager );
+   
+    /**
+     * Destructor.
+     *
+     * @since S60 v3.1
+     */
+    ~CPhCntServiceRequestParamFactory();
+    
+// From base class MPhCntServiceRequestParamFactory
+
+    /**
+     * From base class MPhCntServiceRequestParamFactory
+     *
+     * @since S60 v3.1
+     * @see MPhCntServiceRequestParamFactory
+     */
+    MPhCntServiceRequestParam* 
+        CreateCreateNewContactRequestParamLC( const TDesC& aPhoneNumber ) const;
+        
+    /**
+     * From base class MPhCntServiceRequestParamFactory
+     *
+     * @since S60 v3.1
+     * @see MPhCntServiceRequestParamFactory
+     */  
+    MPhCntServiceRequestParam* 
+        CreateUpdateContactRequestParamLC( const TDesC& aPhoneNumber ) const;
+        
+    /**
+     * From base class MPhCntServiceRequestParamFactory
+     *
+     * @since S60 v3.1
+     * @see MPhCntServiceRequestParamFactory
+     */  
+    MPhCntServiceRequestParam* 
+        CreateGetUserSelectedPhoneNumberLinkParamLC() const;
+        
+    /**
+     * Creates paramter for fetching user selected phonenumber.
+     * The left soft key is 'Select."
+     *
+     * @since S60 v3.2
+     * @return New instance of request parameter. Ownership given.
+     */
+    MPhCntServiceRequestParam* 
+        CreateGetUserSelectedPhoneNumberLC() const;
+    
+    /**
+     * From base class MPhCntServiceRequestParamFactory
+     *
+     * @since S60 v3.1
+     * @see MPhCntServiceRequestParamFactory
+     */ 
+    MPhCntServiceRequestParam* 
+        CreateGetUserSelectedDtmfNumberLinkLC( 
+            MPhCntContactManager& aContactManager ) const;
+
+    /**
+     * From base class MPhCntServiceRequestParamFactory
+     *
+     * @since S60 v3.2
+     * @see MPhCntServiceRequestParamFactory
+     */  
+    MPhCntServiceRequestParam* 
+        CreateGetUserSelectedVoIPAddressLinkParamLC( 
+            MPhCntContactManager& aContactManager ) const;
+
+    /**
+     * Creates paramter for fetching user selected VoIPumber.
+     * The left soft key is 'Select."
+     *
+     * @since S60 v3.2
+     * @return New instance of request parameter. Ownership given.
+     */
+    MPhCntServiceRequestParam* 
+        CreateGetUserSelectedVoIPAddressLC( 
+            MPhCntContactManager& aContactManager ) const;
+    
+    /**
+     * From base class MPhCntServiceRequestParamFactory
+     *
+     * @since S60 v3.2
+     * @see MPhCntServiceRequestParamFactory
+     */
+    MPhCntServiceRequestParam*         
+        CreateGetPhoneNumberFromContactParamLC( const TDesC8& aContactLink,
+            const CPhCntSingleItemFetch::TCallType aCallType ) const;
+    /**
+     * From base class MPhCntServiceRequestParamFactory
+     *
+     * @since S60 v3.2
+     * @see MPhCntServiceRequestParamFactory
+     */   	
+    MPhCntServiceRequestParam* CreateGetPhoneNumberFromContactParamL(
+        const TDesC8& aContactLink,
+        const CPhCntSingleItemFetch::TCallType aCallType ) const;
+            
+        
+protected:
+        
+    CPhCntServiceRequestParamFactory( MPhCntContactManager* aContactManager );
+    
+private: // Data
+
+    /**
+     * Contact manager.
+     * Not own.
+     */
+    MPhCntContactManager* iContactManager;
+
+    };
+
+#endif // TPHCNTSERVICEREQUESTPARAMFACTORY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/tphcntservicerequestparams.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,357 @@
+/*
+* 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:  Classes for service requests made to CPhCntService
+*
+*/
+
+
+#ifndef TPHCNTSERVICEREQUESTPARAMS_H
+#define TPHCNTSERVICEREQUESTPARAMS_H
+
+#include <e32base.h>
+#include <AiwCommon.hrh>
+#include <RVPbkContactFieldDefaultPriorities.h>
+
+#include "mphcntservicerequestparam.h"
+#include "CPhCntSingleItemFetch.h"
+
+class CAiwGenericParamList;
+class MPhCntContactManager;
+class MVPbkContactLinkArray;
+
+/**
+ *  Base class for service request params.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CPhCntServiceRequestParams ) : 
+    public CBase, 
+    public MPhCntServiceRequestParam
+    {
+
+public:
+
+    /** 
+     * Destructor.
+     *
+     * @since S60 v3.1
+     */
+    ~CPhCntServiceRequestParams();
+    
+// From base class MPhCntServiceRequestParam
+
+    /**
+     * From base class MPhCntServiceRequestParam
+     * 
+     * @since S60 v3,1
+     * @see MPhCntServiceRequestParam
+     */
+    TAiwServiceCommands Command() const;
+    
+    /**
+     * From base class MPhCntServiceRequestParam
+     * 
+     * @since S60 v3,1
+     * @see MPhCntServiceRequestParam
+     */
+    const CAiwGenericParamList& InParamList() const;
+    
+protected:
+    
+    /**
+     * Constructor.
+     *
+     * @since S60 v3.1
+     * @param aAiwCommand AIW command.
+     */
+    CPhCntServiceRequestParams( TAiwServiceCommands aAiwCommand );
+    
+    void BaseConstructL();
+    
+
+private: // data
+
+    /**
+     * Command used with aiw.
+     */
+    TAiwServiceCommands iAiwCommand;
+    
+protected:
+
+    /**
+     * Param list used with AIW.
+     * Own.
+     */
+    CAiwGenericParamList* iGenericParamList;
+    
+    /**
+     * Default numbers.
+     * Own.
+     */
+    RVPbkContactFieldDefaultPriorities iDefaultPriorities; 
+    };
+    
+/**
+ *  Request parameters for creating new contact.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CPhCntCreateNewContactParams ) 
+    : public CPhCntServiceRequestParams
+    {
+public:
+    
+    /**
+     * Static constructor.
+     * 
+     * @since S60 v3.1
+     * @param aPhoneNumber Phone number of the new contact.
+     */
+    static CPhCntCreateNewContactParams* NewL( 
+        const TDesC& aPhoneNumber );  
+    
+    /**
+     * Static constructor.
+     * 
+     * @since S60 v3.1
+     * @param aPhoneNumber Phone number of the new contact.
+     */
+    static CPhCntCreateNewContactParams* NewLC(
+        const TDesC& aPhoneNumber );  
+    
+private:
+    
+    CPhCntCreateNewContactParams( const TDesC& aPhoneNumber );
+    
+    void ConstructL();
+    
+private:
+    
+    /**
+     * Phone number set to created contact.
+     * Not own.
+     */
+    const TDesC& iPhoneNumber;
+    
+    };
+    
+/**
+ *  Request parameters for updating existing contact.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CPhCntUpdateExistingContact ) 
+    : public CPhCntServiceRequestParams
+    {
+public:
+    
+    /**
+     * Static constructor.
+     * 
+     * @since S60 v3.1
+     * @param aPhoneNumber Phone number to be added to existing contact..
+     */
+    static CPhCntUpdateExistingContact* NewL( 
+        const TDesC& aPhoneNumber );  
+    
+    /**
+     * Static constructor.
+     * 
+     * @since S60 v3.1
+     * @param aPhoneNumber Phone number to be added to existing contact..
+     */
+    static CPhCntUpdateExistingContact* NewLC(
+        const TDesC& aPhoneNumber );  
+    
+private:
+    
+    CPhCntUpdateExistingContact( const TDesC& aPhoneNumber );
+    
+    void ConstructL();
+    
+private:
+    
+    /**
+     * Phone number set to created contact.
+     * Not own.
+     */
+    const TDesC& iPhoneNumber;
+    
+    };
+class CVPbkFieldTypeSelector;
+    
+/**
+ *  Request parameter for getting user selected phone number link.
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since  v3.2
+ */
+NONSHARABLE_CLASS( CPhCntGetUserSelectedPhoneNumberLink ) : 
+    public CPhCntServiceRequestParams
+    {
+public:
+
+    /**
+     * Static constructor.
+     * 
+     * @since S60 v3.1
+     * @param aCallUsedWithLSK ETrue - Left softkey is 'Call'
+     *                   EFalse - Left softkey is 'Select'
+     * @param aContactManager Reference to contact manager.
+     */
+    static CPhCntGetUserSelectedPhoneNumberLink* NewLC( TBool aCallUsedWithLSK,
+                                        MPhCntContactManager& aContactManager );
+    
+    ~CPhCntGetUserSelectedPhoneNumberLink();
+
+private:
+    
+    CPhCntGetUserSelectedPhoneNumberLink();
+    
+    void ConstructL( TBool aCallUsedWithLSK, 
+                     MPhCntContactManager& aContactManager );
+
+private: // data
+
+	/**
+     * Filter
+     * Own.
+     */
+    CVPbkFieldTypeSelector* iContactViewFilter; 
+    };
+    
+/**
+ *  Request parameter for getting user selected voip address link.
+ *
+ *  @lib PhoneCntFinder.lib
+ *  @since  v3.2
+ */
+NONSHARABLE_CLASS( CPhCntGetUserSelectedVoIPAddressLink ) : 
+    public CPhCntServiceRequestParams
+    {
+public:
+
+    /**
+     * Static constructor.
+     * 
+     * @since S60 v3.1
+     */
+    static CPhCntGetUserSelectedVoIPAddressLink* NewLC(
+        MPhCntContactManager& aContactManager,
+        TBool aCallUsedWithLSK = ETrue );
+    
+private:
+    
+    CPhCntGetUserSelectedVoIPAddressLink();
+    
+    void ConstructL(
+        MPhCntContactManager& aContactManager,
+        TBool aCallUsedWithLSK );
+
+private:
+        
+    /**
+     * Filter
+     * Own.
+     */
+    CVPbkFieldTypeSelector* iContactViewFilter; 
+    };
+
+/**
+ * Request parameter for getting user selected dtmf number link.
+ *
+ * @lib PhoneCntFinder.lib
+ * @since v3.2
+ */
+NONSHARABLE_CLASS( CPhCntGetUserSelectedDtmfNumberLink ) : 
+    public CPhCntServiceRequestParams
+    {
+public:
+
+    /**
+     * Static constructor.
+     *
+     * @since S60 v3.2
+     * @param aContactManager Reference to contact manager.
+     */
+    static CPhCntGetUserSelectedDtmfNumberLink* NewLC(
+        MPhCntContactManager& aContactManager );
+        
+    ~CPhCntGetUserSelectedDtmfNumberLink();
+    
+private:
+
+    CPhCntGetUserSelectedDtmfNumberLink();
+    
+    void ConstructL( MPhCntContactManager& aContactManager );
+    
+private:
+
+    /**
+     * Filter
+     * Own.
+     */
+    CVPbkFieldTypeSelector* iContactViewFilter; 
+    };
+
+
+
+/**
+ * Request parameter for getting a phone number from a contact link.
+ *
+ * @lib PhoneCntFinder.lib
+ * @since v3.2
+ */
+NONSHARABLE_CLASS( CPhCntGetPhoneNumberReqParam ) : 
+    public CPhCntServiceRequestParams
+    {
+public:
+
+    /**
+     * Static constructor.
+     *
+     * @since S60 v3.2
+     * @param aContactLink Contact link
+     */
+    static CPhCntGetPhoneNumberReqParam* NewL(
+    	MPhCntContactManager& aContactManager,
+    	MVPbkContactLinkArray& aLinkArray,
+    	const CPhCntSingleItemFetch::TCallType aCallType
+        );
+        
+    ~CPhCntGetPhoneNumberReqParam();
+    
+private:
+
+    CPhCntGetPhoneNumberReqParam();
+    
+    void ConstructL( 
+    	MPhCntContactManager& aContactManager, 
+    	MVPbkContactLinkArray& aLinkArray, 
+    	const CPhCntSingleItemFetch::TCallType aCallType
+    	);
+    
+private: // data
+
+	/**
+     * Filter
+     * Own.
+     */
+    CVPbkFieldTypeSelector* iContactViewFilter; 
+    };
+
+#endif // TPHCNTSERVICEREQUESTPARAMS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/tphcntsipuri.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,106 @@
+/*
+* 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:  SIP URI descriptor
+*
+*/
+
+
+#ifndef TPHCNTSIPURI_H
+#define TPHCNTSIPURI_H
+
+#include <e32std.h>
+
+/**
+ *  SIP URI descriptor
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+class TPhCntSipURI 
+    {
+
+public:
+
+    /**
+     * Constructor.
+     *
+     * @since S60 v3.1
+     * @param aSipURI Sip URI.
+     */
+    TPhCntSipURI( 
+        const TDesC& aSipURI,
+        TInt aDigitsForMatching = 0 );
+
+    /**
+     * Gives the username part.
+     *
+     * @since S60 v3.1
+     * @return Username part of SIP URI.
+     */
+    const TDesC& UserNamePart() const;
+
+    /**
+     * Gives the sip uri, where extra SIP chars has been removed.
+     * Sip uri will be in format "username@domain"
+     *
+     * @since S60 v3.1
+     * @return Sip uri
+     */
+    const TDesC& SipURI() const;
+    
+    /**
+     * Gives the fixed username part.
+     * User part is 
+     *
+     * @since S60 v3.1
+     * @return Username part of SIP URI.
+     */
+    const TDesC& FixedUserNamePart() const;
+    
+protected:
+
+    void RemoveUnusedChars();
+     
+private: // Data
+
+    /** 
+     * Descriptor containing sip uri.
+     */
+    const TDesC& iSipURI;
+    
+    /**
+     * Sip uri, where not needed parts has been removed.
+     */
+    TPtrC iSipURIStripped;
+    
+    /**
+     * Username part.
+     */
+    TPtrC iUserNamePart;
+    
+     /**
+     * Fixed username part.
+     */
+    TPtrC iFixedUserNamePart;
+    
+     /**
+     * Digits for matchig.
+     */
+    TInt iDigitsForMatching;
+    
+    };
+
+
+
+#endif // TPHCNTSIPURI_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/tphcnttxttospeech.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Constructs text to speech descriptor.
+*
+*/
+
+
+#ifndef TPHCNTTXTTOSPEECH_H
+#define TPHCNTTXTTOSPEECH_H
+
+#include <e32std.h>
+
+/**
+ *  Constructs text to speech descriptor.
+ *  Converts data from contact to text to speech descriptor.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+class TPhCntTxtToSpeech 
+    {
+public:
+
+    /**
+     * Constructor.
+     *
+     * @since S60 v3.1
+     * @param aFirstName First name from contact.
+     * @param aSecondName aSecondName from contact.
+     * @param aLastName Last name from contact.
+     * @param aCompanyName Company name from contact.
+     * @param aFirstNamePronunciation First name pronunciation from contact.
+     * @param aLastNamePronunciation Last name pronunciation from contact.
+     * @param aCompanyNamePronunciation Company name pronunciation from contact.
+     * @param aCurrentLanguage Current language in use.
+     */
+    TPhCntTxtToSpeech( 
+        const TDesC& aFirstName,
+        const TDesC& aSecondName,
+        const TDesC& aLastName,
+        const TDesC& aCompanyName,
+        const TDesC& aFirstNamePronunciation,
+        const TDesC& aLastNamePronunciation,
+        const TDesC& aCompanyNamePronunciation,
+        TLanguage aCurrentLanguage
+    );
+
+    /**
+     * Constructs txt to speech string from contact field data, 
+     * given in constructor.
+     *
+     * @since S60 v3.1
+     * @param aTxtToSpeech Creates instance of txt to speech. May be null.
+     */
+     void GetTextToSpeechL( HBufC*& aTxtToSpeech ) const;
+
+private:
+
+    HBufC* AllocAndTrimL( const TDesC& aText ) const;
+    
+    TBool SwapNameOrder() const;
+    
+    HBufC* GetTrimmedNameLC( 
+        const TDesC& aWritenName, 
+        const TDesC& aNamePronunciation ) const;
+        
+    TInt CalculateTxtToSpeechLength( const HBufC* const aComponent, const HBufC* const aComponent2 ) const;
+
+private: // data
+
+    /** 
+     * Contact field data.
+     * Not own.
+     */
+    const TDesC& iFirstName;
+    const TDesC& iSecondName;
+    const TDesC& iLastName;
+    const TDesC& iCompanyName;
+    const TDesC& iFirstNamePronunciation;
+    const TDesC& iLastNamePronunciation;
+    const TDesC& iCompanyNamePronunciation;
+    TLanguage iCurrentLanguage;
+    };
+
+#endif // TPHCNTTXTTOSPEECH_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/tphcntvoipmatchArray.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Array of voip matches.
+*
+*/
+
+
+#ifndef TPHCNTVOIPMATCHARRAY_H
+#define TPHCNTVOIPMATCHARRAY_H
+
+#include <e32std.h>
+
+class CPhCntContact;
+class TPhCntSipURI;
+
+/**
+ *  Array of voip matches
+ *
+ *  Offers way to figure out correct match from many matches.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+class TPhCntVoipMatchArray 
+    {
+public:
+    TPhCntVoipMatchArray();
+    
+    ~TPhCntVoipMatchArray();
+    
+    /**
+     * Adds contact, takes ownership if the contact.
+     *
+     * @since S60 v3.1
+     * @param aVoipMatch Voip match.
+     */
+    void AppendL( CPhCntContact* aVoipMatch );
+
+    /**
+     * Finds first matched contact, which number
+     * is matches aSipNumber. If no such match is found, null is
+     * returned. Note that the found match is not in this
+     * array after this call. Ownership of match is given
+     * to client.
+     *
+     * @since S60 v3.1
+     * @return Contact, which voip number is aSipURI
+     */
+    CPhCntContact* FindFullMatch( const TPhCntSipURI& aSipURI );
+    
+    /**
+     * Finds full or just username match from contacts added to this array.
+     * If no full matches are found then possible username match is given.
+     * Note that the found match is not in this array after this call. 
+     * Ownership of match is given to client.
+     * 
+     * @since S60 v3.1
+     * @param aSipUri Sip URI that the match is compared against.
+     * @return Found match. Null is returned if no match is found.
+     */
+    CPhCntContact* FindFullOrUsernameMatch( 
+        const TPhCntSipURI& aSipUri,
+        const TInt aCharsForMatch = 0 );
+    
+    /**
+     * Releases the matches. Needs to be called before this class goes 
+     * out of scope.
+     * @since S60 
+     */
+    void ReleaseMatches();
+    
+private:
+    
+    /**
+     * Removes contact from array of iMatches. If aMatch does not
+     * exist in iMatches then nothing is done.
+     * 
+     * @since S60 v3.1
+     * @param aContact Contact to be removed from iMatches.
+     */
+    void RemoveMatchFromArray( const CPhCntContact* const aContact );    
+
+    /**
+     * Match type.
+     */
+    enum TMatchType 
+        {
+        ENone,
+        EFullMatch,
+        EUserNameMatch,
+        };
+         
+    /**
+     * Determines if contact has aSipURI voip number.
+     *
+     * @since S60 v3.2
+     * @param aContact Contact, which is checked.
+     * @param aSipURI SIP URI
+     * @return ENone Contact does not have aSipURI voip number.
+     *         EFullMatch Contact has aSipUri voip number.
+     *         EUserNameMatch Contact has voip number which user name part
+     *         equals to aSupURI's user name part.
+     */
+    TMatchType HasVoipNumber( 
+        CPhCntContact& aContact,
+        const TPhCntSipURI& aSipURI,
+        const TInt aCharsForMatch = 0 ) const;
+    
+    /**
+     * Finds contact, which voip number is aSipUri or username part
+     * are same.
+     * 
+     * @since S60 v3.2
+     * @param aSipURI Voip number of wanted contact.
+     * @param aContact Contact found or null.
+     * @return ENone - No contact found.
+     *         EFullMatch Contact found with full match.
+     *         EUserNameMatch contact found that has same user name part
+     *         than aSipURI.
+     */
+    TMatchType FindFullOrUsernameMatch( 
+        const TPhCntSipURI& aSipUri,
+        CPhCntContact*& aFoundContact,
+        const TInt aCharsForMatch = 0 );
+      
+    
+private: // data
+
+    /**
+     * Array of contact matches.
+     * Own.
+     */
+    RPointerArray<CPhCntContact> iMatches;
+
+    };
+
+#endif // TPHCNTVOIPMATCHARRAY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/CPhCntAIWService.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Aiw service wrapper.
+*
+*/
+
+
+#include "CPhCntAIWService.h"
+#include <AiwServiceHandler.h>
+#include <AiwGenericParam.hrh>
+#include <AiwCommon.hrh>
+#include <AiwContactSelectionDataTypes.h>
+#include "mphcntservicerequestparam.h"
+#include "mphcntserviceresult.h"
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntAiwService* CPhCntAiwService::NewL() 
+	{
+	CPhCntAiwService* self = 
+	    new( ELeave )CPhCntAiwService();
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	CleanupStack::Pop( self );
+	return self;
+	}
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//	
+CPhCntAiwService::~CPhCntAiwService() 
+	{
+	}
+
+// ---------------------------------------------------------------------------
+// Cancels request if request is outstanding.
+// ---------------------------------------------------------------------------
+//    
+void CPhCntAiwService::Cancel()
+    {
+    if ( IsRequestActive() )
+    	{
+    	CancelRequest();
+    	iObserver = NULL;
+        iResult = NULL;
+        iParams = NULL;
+    	}
+    }
+
+// ---------------------------------------------------------------------------
+// Response received from AIW.
+// ---------------------------------------------------------------------------
+//   
+void CPhCntAiwService::ResponseReceived( 
+    TInt aError )
+    {
+    if( iObserver )
+        {
+        iObserver->RequestComplete( aError );
+        }
+    iObserver = NULL;
+    iResult = NULL;
+    iParams = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Indicates if request is active.
+// ---------------------------------------------------------------------------
+//  
+TBool CPhCntAiwService::IsRequestActive() const
+    {
+    return iObserver && iResult && iParams;
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntService
+// Executes AIW service request.
+// ---------------------------------------------------------------------------
+//
+void CPhCntAiwService::ExecuteRequestL( 
+    MPhCntServiceRequestParam& aServiceRequestParams, 
+    MPhCntServiceResult& aResult,
+    MPhCntAiwServiceObserver& aObserver)
+    {
+    CancelRequest();
+    iObserver = &aObserver;
+    SetRequestAndResult( aServiceRequestParams,aResult );
+   	DoMakeAsyncRequestL();
+    }
+
+// ---------------------------------------------------------------------------
+// Second-phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhCntAiwService::ConstructL() 
+	{
+	CPhCntService::ConstructL();
+	}
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//	
+CPhCntAiwService::CPhCntAiwService() :
+    CPhCntService()
+	{
+	}
+	
+
+     
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/CPhCntContact.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,531 @@
+/*
+* 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:  Contact data.
+*
+*/
+
+
+#include <CPbk2ImageManager.h>
+
+#include <featmgr.h>         // Feature Manager
+#include "CPhCntContact.h"
+#include "mphcntcontactfields.h"
+#include "cphcntfoundcontacts.h"
+#include "MPhCntContactManager.h"
+#include "MVPbkContactLink.h"
+#include "MVPbkContactLinkArray.h"
+#include "PhCntTrace.h"
+#include "cphcntvpbkcontactid.h"
+#include "tphcnttxttospeech.h"
+
+#include "tphcntsipuri.h"
+#include "CPhoneRawMatchNumberExtractor.h"
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntContact* CPhCntContact::NewL( 
+    MPhCntContactFields* aContactFields,
+    MPhCntContactManager& aContactManager )
+    {
+    CPhCntContact* self = 
+        new( ELeave )CPhCntContact( 
+            aContactFields, aContactManager );
+            
+    CleanupStack::PushL( self);
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+  
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//  
+CPhCntContact::~CPhCntContact()
+    {
+    delete iContactFields;
+    delete iOriginalNumber;
+    delete iContactId;
+        
+    delete iMatchedVoipNumber;
+    if( iNumberExtractor )
+        {
+        iNumberExtractor->Release();    
+        }
+    FeatureManager::UnInitializeLib();
+    }
+    
+// ---------------------------------------------------------------------------
+// Setter
+// ---------------------------------------------------------------------------
+//
+void CPhCntContact::SetOriginalNumberL( const TDesC& aNumber )
+    {
+    HBufC* number = aNumber.AllocL();
+    delete iOriginalNumber;
+    iOriginalNumber = number;
+    }
+
+// ---------------------------------------------------------------------------
+// Getter
+// ---------------------------------------------------------------------------
+//    
+const TDesC& CPhCntContact::OriginalNumber() const
+    {
+    return *iOriginalNumber;
+    }
+    
+// ---------------------------------------------------------------------------
+// Sets the owner.
+// ---------------------------------------------------------------------------
+//
+void CPhCntContact::SetOwner( CPhCntFoundContacts* aOwner )
+    {
+    iOwner = aOwner;
+    }
+    
+// ---------------------------------------------------------------------------
+// Increases reference count.
+// ---------------------------------------------------------------------------
+//
+void CPhCntContact::IncreaseReferenceCount()
+    {
+    iReferenceCount++;
+    }
+
+// ---------------------------------------------------------------------------
+// All phone numbers
+// ---------------------------------------------------------------------------
+//    
+const RArray<TPhCntNumber>& CPhCntContact::AllNumbers() const
+    {
+    return iContactFields->AllNumbers();
+    }
+
+// ---------------------------------------------------------------------------
+// DTMF number
+// ---------------------------------------------------------------------------
+//    
+TPtrC CPhCntContact::Dtmf() const
+    {
+    return iContactFields->Dtmf();
+    }
+    
+// ---------------------------------------------------------------------------
+// Sets matched number in Voip case. 
+// ---------------------------------------------------------------------------
+//   
+void CPhCntContact::SetMatchedVoipNumber( 
+    const TPhCntSipURI& aSipUri )
+    {
+    delete iMatchedVoipNumber;
+    iMatchedVoipNumber = NULL;
+	//just ignore possible alloc failure
+	TRAP_IGNORE( iMatchedVoipNumber = HBufC::NewL( 
+		aSipUri.SipURI().Length() ) )
+    if( iMatchedVoipNumber ) 
+        {
+        iMatchedVoipNumber->Des().Append( aSipUri.SipURI() );
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Releases this contact if no more references found.
+// ---------------------------------------------------------------------------
+//
+void CPhCntContact::Release() 
+    {
+    iReferenceCount--;
+    // TODO: Panic if reference count < 0
+    if( iReferenceCount == 0 )
+        {
+        // TODO: Panic if iOwner == NULL;
+        iOwner->Remove( this );    
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// From base class MPhCntMatch
+// Getter
+// ---------------------------------------------------------------------------
+//
+CPhCntContactId* CPhCntContact::ContactId() const 
+    {   
+    return iContactId;
+    }
+
+// ---------------------------------------------------------------------------
+// From base class MPhCntMatch
+// Getter
+// ---------------------------------------------------------------------------
+//
+MVPbkContactLink* CPhCntContact::ContactLink() const 
+    {   
+    return iContactFields->ContactLink();
+    }
+
+// ---------------------------------------------------------------------------
+// From base class MPhCntMatch
+// Getter
+// ---------------------------------------------------------------------------
+//
+MPhCntMatch::TNumberType CPhCntContact::NumberType() const   
+    {
+    MPhCntMatch::TNumberType numberType = iContactFields->NumberType();
+    // check if numbertype was found
+    if ( numberType == MPhCntMatch::ENone )  
+        {
+        // if not, then try to find numbertype among all numbers
+        if ( iOriginalNumber )
+            {
+            numberType = NumberType( *iOriginalNumber );
+            }
+        }
+    if( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
+        {
+        // If we have iMatchedNumber then there was voip match.
+        if( iMatchedVoipNumber ) 
+            {
+            numberType = MPhCntMatch::EVoipNumber;
+            }
+        }
+    return numberType;
+    }    
+
+// ---------------------------------------------------------------------------
+// Get number type from number that matches to supplied number 
+// Getter
+// ---------------------------------------------------------------------------
+//    
+MPhCntMatch::TNumberType CPhCntContact::NumberType( const TDesC& aNumber ) const   
+    {
+    const RArray<TPhCntNumber>& allNumbers = AllNumbers();		
+    MPhCntMatch::TNumberType numberType = MPhCntMatch::ENone;
+    // try to find number from allnumbers array
+    for ( TInt i = 0; i < allNumbers.Count(); i++ )
+        {
+        TPhCntNumber number( allNumbers[i] );
+        // compare 7 last digits
+        TBuf<KPhMatcherNumberCount> contactNumber;
+        TBuf<KPhMatcherNumberCount> originalNumber;
+    	iNumberExtractor->ExtractRawNumber( number.Number(), contactNumber ); 
+    	iNumberExtractor->ExtractRawNumber( aNumber, originalNumber ); 
+    
+        if ( originalNumber.Compare( contactNumber ) == KErrNone )
+            {
+            // number found, get numbertype
+            numberType = number.Type();
+            break;
+            }
+        }   
+    return numberType;
+    } 
+       
+// ---------------------------------------------------------------------------
+// From base class MPhCntMatch
+// Constructs the cli
+// ---------------------------------------------------------------------------
+//
+MPhCntMatch::TCliType CPhCntContact::Cli( HBufC*& aCliText ) const
+    {
+    TCliType cliType = ECliEmpty;
+    
+    HBufC* contactTitle = NULL;
+    TRAP_IGNORE( contactTitle = iContactFields->GetContactTitleL() );
+    
+    if( contactTitle ) 
+        {
+        aCliText = contactTitle;
+        cliType = ECliName;
+        }
+    else
+        {
+        // No contact title so try to use phonenumber
+        const TPtrC phoneNumber = Number();
+        if( phoneNumber.Length() > 0 )
+            {
+            contactTitle = phoneNumber.Alloc();
+            if( contactTitle ) 
+                {
+                cliType = ECliNumber;
+                }
+            }
+        }
+        
+    if( cliType == ECliName )
+        {
+        // Is the contact title as contact title.
+        if( CompanyName().Compare( contactTitle->Des() ) == 0 &&
+            FirstName().Length() == 0 &&
+            LastName().Length() == 0 )
+            {
+            cliType = ECliCompany;
+            }
+        }
+        
+    aCliText = contactTitle;
+    return cliType;
+    }
+
+// ---------------------------------------------------------------------------
+// From base class MPhCntMatch
+// Getter
+// ---------------------------------------------------------------------------
+//
+TPtrC CPhCntContact::FirstName() const 
+    {
+    return iContactFields->FirstName();
+    }
+
+// ---------------------------------------------------------------------------
+// From base class MPhCntMatch
+// Getter
+// ---------------------------------------------------------------------------
+//
+TPtrC CPhCntContact::LastName() const 
+    {
+    return iContactFields->LastName();
+    }
+
+// ---------------------------------------------------------------------------
+// From base class MPhCntMatch
+// Getter
+// ---------------------------------------------------------------------------
+//
+TPtrC CPhCntContact::CompanyName() const 
+    {
+    return iContactFields->CompanyName();
+    }
+
+// ---------------------------------------------------------------------------
+// From base class MPhCntMatch
+// Getter
+// ---------------------------------------------------------------------------
+//
+TPtrC CPhCntContact::Number() const
+    {
+    TPtrC number = iContactFields->Number();
+    if( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
+        {
+        if( iMatchedVoipNumber ) 
+            {
+            number.Set( *iMatchedVoipNumber );
+            }
+        }
+    return number;
+    }
+    
+// ---------------------------------------------------------------------------    
+// Finds a phone number for the requested speed dial position.
+// ---------------------------------------------------------------------------
+//         
+TPhCntNumber CPhCntContact::SpeedDialNumber( const TInt aPosition )
+	{
+	TPhCntNumber contactNumber;
+	const RArray<TPhCntNumber>& allNumbers = AllNumbers();		
+    const TInt count( allNumbers.Count() );
+	for ( TInt numberIndex = 0; numberIndex < count && contactNumber.Type() == MPhCntMatch::ENone; numberIndex++ )
+		{
+		TPhCntNumber number( allNumbers[numberIndex] );	
+		if ( number.Position() == aPosition )
+			{						
+			contactNumber.Set( number.Number(), number.Type(), number.Position() );		
+			}
+		}	
+	return contactNumber;
+	}    
+
+// ---------------------------------------------------------------------------
+// From base class MPhCntMatch
+// Getter
+// ---------------------------------------------------------------------------
+//
+TPtrC CPhCntContact::PersonalRingingTone() const 
+    {
+    return iContactFields->PersonalRingingTone();
+    }
+ 
+// ---------------------------------------------------------------------------
+// From base class MPhCntMatch
+// Getter
+// ---------------------------------------------------------------------------
+// 
+CDesCArray& CPhCntContact::AllDtmfNumbers() const 
+    {
+    return *iContactFields->AllDtmfNumbers();
+    }
+    
+// ---------------------------------------------------------------------------
+// From base class MPhCntMatch
+// Determines if this contact belongs to some of the groups
+// ---------------------------------------------------------------------------
+//   
+TBool CPhCntContact::BelongsToGroups( 
+    const CArrayFix<TContactItemId>& aGroupArray ) const 
+    {
+    PRINT( "PhCnt: Contact.BelongsToGroups" );
+    TBool belongsToGroup = EFalse;
+    MVPbkContactLinkArray* groupLinks = NULL;
+    TRAP_IGNORE( 
+        groupLinks = 
+            iContactManager.ConvertContactIdsToLinksL( aGroupArray );
+        belongsToGroup = BelongsToGroupsL( groupLinks );
+        );
+    delete groupLinks;
+    return belongsToGroup;
+    }
+
+// ---------------------------------------------------------------------------
+// From base class MPhCntMatch
+// Getter
+// ---------------------------------------------------------------------------
+//
+HBufC* CPhCntContact::TextToSpeechTextL() const 
+    {
+    TPhCntTxtToSpeech txtToSpeech( 
+        iContactFields->FirstName(), 
+        iContactFields->SecondName(),
+        iContactFields->LastName(),
+        iContactFields->CompanyName(),
+        iContactFields->FirstNamePronunciation(),
+        iContactFields->LastNamePronunciation(),
+        iContactFields->CompanyNamePronunciation(),
+        User::Language() );
+    
+    HBufC* textToSpeech = NULL;
+    txtToSpeech.GetTextToSpeechL( textToSpeech );
+    return textToSpeech;
+    }
+
+// ---------------------------------------------------------------------------
+// From base class MPhCntMatch
+// Getter
+// ---------------------------------------------------------------------------
+//
+TPtrC CPhCntContact::CallImage() const
+    {
+    return iContactFields->CallImage();
+    }
+    
+// ---------------------------------------------------------------------------
+// From base class MPhCntMatch
+// Getter
+// ---------------------------------------------------------------------------
+//
+TPtrC CPhCntContact::CallText() const
+    {
+    return iContactFields->CallText();
+    }
+    
+// ---------------------------------------------------------------------------
+// From base class MPhCntMatch
+// Getter
+// ---------------------------------------------------------------------------
+//
+TBool CPhCntContact::HasThumbnailImage() const
+    {
+    return iContactFields->HasThumbnail();
+    }
+    
+// ---------------------------------------------------------------------------
+// Loads thumbnail of this contact.
+// ---------------------------------------------------------------------------
+//
+MPbk2ImageOperation* CPhCntContact::LoadThumbnailL(
+    MPbk2ImageGetObserver& aObserver )
+    {
+    const MVPbkFieldType* thumbnailFieldType = 
+        iContactFields->ThumbnailField();
+    
+    MPbk2ImageOperation* oper = NULL;
+    if( thumbnailFieldType ) 
+        {
+        oper = iContactManager.RetrieveImageL( 
+                    iContactFields->StoreContact(),
+                    *thumbnailFieldType,
+                    aObserver );    
+        }
+    else
+        {
+        User::Leave( KErrNotFound );
+        }
+    return oper;
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntContact::CPhCntContact( 
+    MPhCntContactFields* aContactFields,
+    MPhCntContactManager& aContactManager ) :
+    iContactFields( aContactFields ),
+    iContactManager( aContactManager )
+    {
+    
+    } 
+
+// ---------------------------------------------------------------------------
+// Secondphase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhCntContact::ConstructL(  ) 
+    {
+    iOriginalNumber = KNullDesC().AllocL();
+    MVPbkContactLink* contactLink = iContactFields->ContactLink();
+    MVPbkContactLink* clonedLink = NULL;
+    if( contactLink ) 
+        {
+        clonedLink = contactLink->CloneLC();
+        CleanupStack::Pop(); // clonedLink
+        }
+    iContactId = CPhCntVPbkContactId::NewL( clonedLink, iContactManager );
+    iNumberExtractor = new( ELeave )CCntRawPhoneNumberExtractor();
+    iNumberExtractor->ConstructL();
+    FeatureManager::InitializeLibL();
+    }
+
+// ---------------------------------------------------------------------------
+// Checks if this belongs to any of the groups.
+// ---------------------------------------------------------------------------
+//    
+TBool CPhCntContact::BelongsToGroupsL( 
+    MVPbkContactLinkArray* aGroups ) const
+    {
+    TBool belongsToGroups = EFalse;
+    if( aGroups )
+        {
+        MVPbkContactLinkArray* groupsThisContactBelongsTo =
+            iContactFields->ContactGroupsLC();
+
+        if( groupsThisContactBelongsTo )
+            {
+            PRINTF( "PhCnt: Contact.BelongsToGroups.group count.%d", groupsThisContactBelongsTo->Count() );
+            for( TInt i = 0; i < aGroups->Count() && !belongsToGroups; i++ )
+                {
+                const MVPbkContactLink& linkToGroup( aGroups->At( i ) );
+                
+                // Find returns index if found from array.
+                if( groupsThisContactBelongsTo->Find( linkToGroup ) >= 0 )
+                    {
+                    belongsToGroups = ETrue;
+                    }
+                }
+            CleanupStack::PopAndDestroy(); // groupsThisContactBelongsTo
+            }
+        }
+    return belongsToGroups;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/CPhCntContactManager.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,523 @@
+/*
+* 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:  Contact manager
+*
+*/
+
+#include <CVPbkContactManager.h>
+#include <CVPbkContactStoreUriArray.h>
+#include <TVPbkContactStoreUriPtr.h>
+#include <MVPbkContactStoreList.h>
+#include <MPbk2ContactNameFormatter.h>
+#include <CPbk2SortOrderManager.h>
+#include <Pbk2ContactNameFormatterFactory.h>
+#include <CVPbkContactIdConverter.h>
+#include <MVPbkContactStore.h>
+#include <MVPbkContactLink.h>
+#include <CVPbkContactLinkArray.h>
+#include <MVPbkContactAttributeManager.h>
+#include <CVPbkSpeedDialAttribute.h>
+#include <CPbk2ImageManager.h>
+#include <MVPbkStoreContact.h>
+#include <VPbkContactStoreUris.h>
+#include <MVPbkFieldType.h>
+#include <CVPbkFieldTypeRefsList.h>
+#include <VPbkEng.rsg>
+#include <MVPbkContactStoreProperties.h>
+#include <CVPbkFieldTypeSelector.h>
+#include <VPbkContactViewFilterBuilder.h>
+#include <talogger.h>
+
+#include "cphcntcontactmatchstrategy.h"
+#include "CPhCntContactManager.h"
+#include "CPhCntContact.h"
+#include "cphcntcontactstoreuris.h"
+#include "mphcntstoreloaderobserver.h"
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntContactManager* CPhCntContactManager::NewL()
+    {
+    CPhCntContactManager* self = new( ELeave )CPhCntContactManager();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhCntContactManager::~CPhCntContactManager()
+    {
+    delete iVoipFieldTypeList;
+    delete iImageManager;
+    delete iSpeedDialAttribute;
+    delete iContactIdConverter;
+    delete iContactNameFormatter;
+    delete iSortOrder;
+    if( iContactManager )
+        {
+        TRAP_IGNORE( iContactManager->ContactStoresL().CloseAll( *this ) );
+        }
+    delete iContactManager;
+    delete iContactStoreUris;
+    }
+
+// ---------------------------------------------------------------------------
+// Gives contact manager.
+// ---------------------------------------------------------------------------
+//
+CVPbkContactManager& CPhCntContactManager::ContactManager() const
+    {
+    return *iContactManager;
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntContactManager
+// Retrieves contact from contact stores.
+// ---------------------------------------------------------------------------
+//
+MVPbkContactOperationBase* CPhCntContactManager::RetrieveContactL(
+    const MVPbkContactLink& aLink,
+    MVPbkSingleContactOperationObserver& aObserver)
+    {
+    return iContactManager->RetrieveContactL( aLink, aObserver );
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntContactManager
+// Gives contact stores.
+// ---------------------------------------------------------------------------
+//
+MVPbkContactStoreList& CPhCntContactManager::ContactStoresL() const
+    {
+    return iContactManager->ContactStoresL();
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntContactManager
+// Creates contact match strategy.
+// ---------------------------------------------------------------------------
+//
+MPhCntContactMatchStrategy* CPhCntContactManager::CreateContactMatchStrategyL(
+    MVPbkContactFindObserver& aObserver,
+    TBool aRemoveDuplicates )
+    {
+    return CPhCntContactMatchStrategy::NewL(
+        *iContactManager,
+        *iContactStoreUris,
+        aObserver,
+        aRemoveDuplicates ?
+        CVPbkPhoneNumberMatchStrategy::EVPbkDuplicatedContactsMatchFlag :
+        CVPbkPhoneNumberMatchStrategy::EVPbkMatchFlagsNone );
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntContactManager
+// Converts contact ids to contact links.
+// ---------------------------------------------------------------------------
+//
+MVPbkContactLinkArray* CPhCntContactManager::ConvertContactIdsToLinksL(
+        const CArrayFix<TContactItemId>& aContactId ) const
+    {
+    CVPbkContactLinkArray* contactLinks = CVPbkContactLinkArray::NewLC();
+
+    const TInt contactIdCount( aContactId.Count() );
+    for( TInt i = 0; i < contactIdCount; i++ )
+        {
+        MVPbkContactLink* link =
+            ConvertContactIdToLinkL( aContactId.At( i ) );
+
+        if( link )
+            {
+            contactLinks->AppendL( link );
+            }
+        }
+    CleanupStack::Pop( contactLinks );
+    return contactLinks;
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntContactManager
+// Converts contact id to contact link.
+// ---------------------------------------------------------------------------
+//
+MVPbkContactLink* CPhCntContactManager::ConvertContactIdToLinkL(
+    TContactItemId aContactId ) const
+    {
+    MVPbkContactLink* link = NULL;
+    if( aContactId != KNullContactId )
+        {
+        link = iContactIdConverter->IdentifierToLinkLC( aContactId );
+        CleanupStack::Pop(); // link
+        }
+    return link;
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntContactManager
+// Converts contact link to contact id.
+// ---------------------------------------------------------------------------
+//
+TContactItemId CPhCntContactManager::ConvertContactLinkToContactId(
+    const MVPbkContactLink& aContactLink ) const
+    {
+    return iContactIdConverter->LinkToIdentifier( aContactLink );
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntContactManager
+// Converts contact link descriptor to contact link.
+// ---------------------------------------------------------------------------
+//
+MVPbkContactLink* CPhCntContactManager::ConvertDescriptorToLinkL(
+    const TDesC8& aPackedLink ) const
+    {
+    MVPbkContactLink* link = NULL;
+    if( aPackedLink.Length() > 0 )
+        {
+        MVPbkContactLinkArray* links =
+            iContactManager->CreateLinksLC( aPackedLink );
+        if( links && links->Count() > 0 )
+            {
+            link = links->At( 0 ).CloneLC();
+            CleanupStack::Pop(); // Link from CloneLC
+            }
+        CleanupStack::PopAndDestroy(); // Links
+        }
+    return link;
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntContactManager
+// Retrieves speed dial contact link.
+// ---------------------------------------------------------------------------
+//
+MVPbkContactOperationBase* CPhCntContactManager::RetrieveSpeedDialContactLinkL(
+        const TInt aSpeedDialPosition,
+        MVPbkContactFindObserver& aObserver )
+    {
+    MVPbkContactAttributeManager& attributeManager =
+        iContactManager->ContactAttributeManagerL();
+
+    iSpeedDialAttribute->SetIndex( aSpeedDialPosition );
+
+
+    return attributeManager.ListContactsL(
+                *iSpeedDialAttribute,
+                aObserver );
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntContactManager
+// Indicates whether the field had a speed dial attribute set.
+// ---------------------------------------------------------------------------
+//
+TBool CPhCntContactManager::HasSpeedDialL(
+		const TInt aSpeedDialPosition,
+		const MVPbkStoreContactField& aField )
+    {
+    TBool result = EFalse;
+
+    MVPbkContactAttributeManager& attributeManager =
+        iContactManager->ContactAttributeManagerL();
+
+	CVPbkSpeedDialAttribute* attr = CVPbkSpeedDialAttribute::NewL( aSpeedDialPosition );
+    CleanupStack::PushL( attr );
+
+    result = attributeManager.HasFieldAttributeL(
+    			*attr,
+    			aField );
+
+	CleanupStack::PopAndDestroy( attr );
+
+	return result;
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntContactManager
+// Retrieves contacts image.
+// ---------------------------------------------------------------------------
+//
+MPbk2ImageOperation* CPhCntContactManager::RetrieveImageL(
+    MVPbkStoreContact& aStoreContact,
+    const MVPbkFieldType& aFieldType,
+    MPbk2ImageGetObserver& aObserver )
+    {
+
+    return iImageManager->GetImageAsyncL(
+        	NULL,
+            aStoreContact,
+            aFieldType,
+            aObserver );
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntContactManager
+// Creates field type selector.
+// ---------------------------------------------------------------------------
+//
+CVPbkFieldTypeSelector* CPhCntContactManager::CreateFieldTypeSelectorL() const
+    {
+    return CVPbkFieldTypeSelector::NewL( iContactManager->FieldTypes() );
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntContactManager
+// Appends filter to selector.
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactManager::AppendFilterToSelectorL(
+    CVPbkFieldTypeSelector& aSelector,
+    TVPbkContactViewFilter aFilter )
+    {
+    VPbkContactViewFilterBuilder::BuildContactViewFilterL(
+		aSelector,
+		aFilter,
+		*iContactManager );
+    }
+
+
+//-----------------------------------------------------------------------------
+// From base class MPhCntContactFinder.
+// Loads the contact store specified in the given contact link.
+//-----------------------------------------------------------------------------
+//
+void CPhCntContactManager::LoadContactStoreL( const TDesC8& aContactLink,
+        MPhCntStoreLoaderObserver& aObserver )
+    {
+    __ASSERT_ALWAYS( NULL == iStoreLoaderObserver, User::Leave( KErrInUse ) );
+
+    MVPbkContactLink* link = ConvertDescriptorToLinkL( aContactLink );
+
+    // Link conversion has a side effect of loading store plug-in, but
+    // make sure that store really gets loaded.
+    const TVPbkContactStoreUriPtr uri
+        = link->ContactStore().StoreProperties().Uri();
+    delete link;
+    iContactManager->LoadContactStoreL( uri );
+
+    // Start asynchronous opening of the store.
+    MVPbkContactStore* store = iContactManager->ContactStoresL().Find( uri );
+    __ASSERT_ALWAYS( NULL != store, User::Leave( KErrNotFound ) );
+
+    store->OpenL( *this );
+    iStoreLoaderObserver = &aObserver;
+    }
+
+//-----------------------------------------------------------------------------
+// From base class MPhCntContactManager.
+//-----------------------------------------------------------------------------
+//
+CPhCntContactStoreUris& CPhCntContactManager::ContactStoreUrisL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPhCntContactManager::ContactStoreListL" );
+    return *iContactStoreUris;
+    }
+
+//-----------------------------------------------------------------------------
+// From base class MPhCntContactFinder.
+// Constructs fieldtype list, which identifies voip fields and
+// performs the find for voip fields.
+//-----------------------------------------------------------------------------
+//
+MVPbkContactOperationBase* CPhCntContactManager::FindVoipContactsL(
+    const TDesC& aSipURI,
+    MVPbkContactFindObserver& aObserver ) const
+    {
+    return iContactManager->FindL( aSipURI, *iVoipFieldTypeList, aObserver );
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntContactManager
+// Gives contact name formatter.
+// ---------------------------------------------------------------------------
+//
+MPbk2ContactNameFormatter& CPhCntContactManager::ContactNameFormatter()
+    {
+    return *iContactNameFormatter;
+    }
+
+// ---------------------------------------------------------------------------
+// From MVPbkContactStoreListObserver
+// Indication that contact stores has been opened.
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactManager::OpenComplete()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// From MVPbkContactStoreListObserver
+// Indication that contact store has been opened.
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactManager::StoreReady(
+    MVPbkContactStore& aContactStore )
+    {
+    TVPbkContactStoreUriPtr uri = aContactStore.StoreProperties().Uri();
+
+    if ( iStoreLoaderObserver
+            && !iContactStoreUris->ContactStores().IsIncluded( uri ) )
+        {
+        TRAP_IGNORE( iContactStoreUris->AddContactStoreL( uri ) );
+
+        iStoreLoaderObserver->ContactStoreLoadingCompleted(
+            &aContactStore, KErrNone );
+        iStoreLoaderObserver = NULL;
+        }
+    iContactStoreUris->StoreReady( uri );
+    }
+
+// ---------------------------------------------------------------------------
+// From MVPbkContactStoreListObserver
+// Indication that contact store has become unavailable.
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactManager::StoreUnavailable(
+    MVPbkContactStore& aContactStore,
+    TInt /*aReason*/ )
+    {
+    TVPbkContactStoreUriPtr uri = aContactStore.StoreProperties().Uri();
+    iContactStoreUris->StoreUnavailable( uri );
+    }
+
+// ---------------------------------------------------------------------------
+// From MVPbkContactStoreListObserver
+// Contact store event.
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactManager::HandleStoreEventL(
+    MVPbkContactStore& aContactStore,
+    TVPbkContactStoreEvent aStoreEvent )
+    {
+    switch( aStoreEvent.iEventType )
+        {
+        case TVPbkContactStoreEvent::EStoreRestoreBeginning:
+        case TVPbkContactStoreEvent::EStoreBackupBeginning:
+            StoreUnavailable( aContactStore, KErrNone );
+            break;
+
+        case TVPbkContactStoreEvent::EStoreBackupRestoreCompleted:
+            StoreReady( aContactStore );
+            break;
+        default:
+            break;
+        }
+    }
+
+//-----------------------------------------------------------------------------
+// From base class MPhCntContactFinder.
+// Loads the contact store specified with URI.
+//-----------------------------------------------------------------------------
+void CPhCntContactManager::LoadContactStoreWithUriL(
+    const TDesC& aStoreUri,
+    MPhCntStoreLoaderObserver& aObserver )
+    {
+    __ASSERT_ALWAYS( NULL == iStoreLoaderObserver, User::Leave( KErrInUse ) );
+    iContactManager->LoadContactStoreL( aStoreUri );
+
+    // Start asynchronous opening of the store.
+    MVPbkContactStore* store = iContactManager->ContactStoresL().Find( aStoreUri );
+    __ASSERT_ALWAYS( NULL != store, User::Leave( KErrNotFound ) );
+
+    store->OpenL( *this );
+    iStoreLoaderObserver = &aObserver;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntContactManager::CPhCntContactManager()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactManager::ConstructL()
+    {
+    iContactStoreUris = CPhCntContactStoreUris::NewL();
+
+    iContactManager =
+        CVPbkContactManager::NewL( iContactStoreUris->ContactStores() );
+
+    // Open stores so that they are accesible.
+    iContactManager->ContactStoresL().OpenAllL( *this );
+
+    const MVPbkFieldTypeList& fieldTypes = iContactManager->FieldTypes();
+
+    iSortOrder = CPbk2SortOrderManager::NewL( fieldTypes );
+
+    iContactNameFormatter = Pbk2ContactNameFormatterFactory::CreateL(
+            KNullDesC, fieldTypes,
+            *iSortOrder );
+    MVPbkContactStoreList& contactStores = iContactManager->ContactStoresL();
+    TVPbkContactStoreUriPtr uri(VPbkContactStoreUris::DefaultCntDbUri() );
+    iContactDBStore = contactStores.Find( uri );
+    iContactIdConverter = CVPbkContactIdConverter::NewL( *iContactDBStore );
+    iSpeedDialAttribute = CVPbkSpeedDialAttribute::NewL();
+
+    iImageManager = CPbk2ImageManager::NewL( *iContactManager );
+
+    iVoipFieldTypeList = CVPbkFieldTypeRefsList::NewL();
+    AddVoipFieldTypeL( fieldTypes.Find( R_VPBK_FIELD_TYPE_VOIPGEN ) );
+    AddVoipFieldTypeL( fieldTypes.Find( R_VPBK_FIELD_TYPE_VOIPHOME ) );
+    AddVoipFieldTypeL( fieldTypes.Find( R_VPBK_FIELD_TYPE_VOIPWORK ) );
+    AddVoipFieldTypeL( fieldTypes.Find( R_VPBK_FIELD_TYPE_MOBILEPHONEHOME ) );
+    AddVoipFieldTypeL( fieldTypes.Find( R_VPBK_FIELD_TYPE_MOBILEPHONEWORK ) );
+    AddVoipFieldTypeL( fieldTypes.Find( R_VPBK_FIELD_TYPE_MOBILEPHONEGEN ) );
+    AddVoipFieldTypeL( fieldTypes.Find( R_VPBK_FIELD_TYPE_LANDPHONEHOME ) );
+    AddVoipFieldTypeL( fieldTypes.Find( R_VPBK_FIELD_TYPE_LANDPHONEWORK ) );
+    AddVoipFieldTypeL( fieldTypes.Find( R_VPBK_FIELD_TYPE_LANDPHONEGEN ) );
+    AddVoipFieldTypeL( fieldTypes.Find( R_VPBK_FIELD_TYPE_CARPHONE ) );
+    AddVoipFieldTypeL( fieldTypes.Find( R_VPBK_FIELD_TYPE_IMPP ) );
+    AddVoipFieldTypeL( fieldTypes.Find( R_VPBK_FIELD_TYPE_SIP ) );
+    AddVoipFieldTypeL( fieldTypes.Find( R_VPBK_FIELD_TYPE_PAGERNUMBER ) );
+    AddVoipFieldTypeL( fieldTypes.Find( R_VPBK_FIELD_TYPE_FAXNUMBERGEN ) );
+    AddVoipFieldTypeL( fieldTypes.Find( R_VPBK_FIELD_TYPE_FAXNUMBERHOME ) );
+    AddVoipFieldTypeL( fieldTypes.Find( R_VPBK_FIELD_TYPE_FAXNUMBERWORK ) );
+    AddVoipFieldTypeL( fieldTypes.Find( R_VPBK_FIELD_TYPE_VIDEONUMBERHOME ) );
+    AddVoipFieldTypeL( fieldTypes.Find( R_VPBK_FIELD_TYPE_VIDEONUMBERWORK ) );
+    AddVoipFieldTypeL( fieldTypes.Find( R_VPBK_FIELD_TYPE_VIDEONUMBERGEN ) );
+    AddVoipFieldTypeL( fieldTypes.Find( R_VPBK_FIELD_TYPE_ASSTPHONE ) );
+    }
+
+// ---------------------------------------------------------------------------
+// Adds voip field type to array.
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactManager::AddVoipFieldTypeL(
+    const MVPbkFieldType* aVoipFieldType )
+    {
+    if( aVoipFieldType )
+        {
+        iVoipFieldTypeList->AppendL( *aVoipFieldType );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Return list of additional contact store uris.
+// ---------------------------------------------------------------------------
+//
+const CVPbkContactStoreUriArray& CPhCntContactManager::AdditionalContactStoreUris()
+    {
+    return iContactStoreUris->AdditionalContactStores();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/CPhCntContactStores.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,213 @@
+/*
+* 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:  Contact stores.
+*
+*/
+
+
+#include "CPhCntContactStores.h"
+#include "MPhCntContactManager.h"
+#include "MPhCntContactFetchObserver.h"
+#include "CPhCntContact.h"
+#include "cphcntcontactfieldsresolver.h"
+#include <MVPbkContactOperationBase.h>
+#include <CVPbkContactLinkArray.h>
+#include <MVPbkStoreContact.h>
+#include <MVPbkContactLink.h>
+
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntContactStores* CPhCntContactStores::NewL( 
+    MPhCntContactManager& aContactManager ) 
+    {
+    CPhCntContactStores* self = new( ELeave )CPhCntContactStores( aContactManager );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhCntContactStores::~CPhCntContactStores() 
+    {
+    CancelRequest();
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntContactStores
+// Determines if request is active.
+// ---------------------------------------------------------------------------
+//     
+TBool CPhCntContactStores::IsRequestActive() const
+    {
+    TBool isActive( EFalse );
+    if( iRetrieveContactOperation )
+        {
+        isActive = ETrue;
+        }
+    return isActive;
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntContactStores
+// Cancels the request.
+// ---------------------------------------------------------------------------
+//       
+void CPhCntContactStores::CancelRequest()
+    {
+    delete iRetrieveContactOperation;
+    iRetrieveContactOperation = NULL;
+    }
+ 
+// ---------------------------------------------------------------------------
+// From MPhCntContactStores
+// Fetches contact from contact store.
+// ---------------------------------------------------------------------------
+//   
+void CPhCntContactStores::FetchContactL( 
+    const MVPbkContactLink& aLink, 
+    MPhCntContactFetchObserver& aObserver ) 
+    {
+    // If we already have somebody fetching contact...
+    if ( iContactFetchObserver )
+        {
+        User::Leave(KErrInUse);
+        }
+            
+    iLink = aLink.CloneLC();
+    CleanupStack::Pop( 1 );
+    iContactFetchObserver = &aObserver;
+    iRetrieveContactOperation = 
+        iContactManager.RetrieveContactL( *iLink, *this ); 
+     
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntContactStores
+// Fetches first contact pointed by contact links.
+// ---------------------------------------------------------------------------
+//    
+void CPhCntContactStores::FetchFirstContactL( 
+    const TDesC8& aContactLinks,
+    MPhCntContactFetchObserver& aObserver ) 
+    {
+    if ( iContactFetchObserver )
+        {
+        User::Leave(KErrInUse);
+        }
+        
+    CVPbkContactLinkArray* linkArray = 
+        CreateContactLinkArrayL( aContactLinks );
+    CleanupStack::PushL( linkArray );
+    
+    if( linkArray->Count() > 0 ) 
+        {
+        const MVPbkContactLink& link = linkArray->At( 0 );
+        MVPbkContactLink* cloneLink = link.CloneLC();
+        CleanupStack::Pop(); // cloneLink
+        iLink = cloneLink;
+        iContactFetchObserver = &aObserver;
+        iRetrieveContactOperation = 
+            iContactManager.RetrieveContactL( *iLink, *this ); 
+        }
+    else
+        {
+        aObserver.ContactReceived( NULL, KErrNotFound );
+        }
+    CleanupStack::PopAndDestroy( linkArray );
+    }
+    
+// ---------------------------------------------------------------------------
+// From MPhCntContactStores
+// Creates contact link array
+// ---------------------------------------------------------------------------
+//
+CVPbkContactLinkArray* CPhCntContactStores::CreateContactLinkArrayL( 
+    const TDesC8& aLinks ) 
+    {
+    CVPbkContactLinkArray* linkArray = 
+        CVPbkContactLinkArray::NewLC( 
+            aLinks, iContactManager.ContactStoresL() );
+    CleanupStack::Pop( linkArray );
+    return linkArray;
+    }
+    
+// ---------------------------------------------------------------------------
+// From MVPbkSingeContactOperationObserver
+// Resolves the received contact and notifies the observer about 
+// contact reception.
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactStores::VPbkSingleContactOperationComplete(
+    MVPbkContactOperationBase& /*aOperation*/,
+    MVPbkStoreContact* aContact ) 
+    {
+    CancelRequest();
+
+    CPhCntContact* contact = NULL;
+    CPhCntContactFieldsResolver* resolver = NULL;
+    TRAPD( err, 
+        resolver = 
+            CPhCntContactFieldsResolver::NewLC( 
+                iLink, aContact, iContactManager );
+            
+        contact =  
+            CPhCntContact::NewL( resolver, iContactManager );
+        CleanupStack::Pop( resolver );
+    )
+        
+    iContactFetchObserver->ContactReceived( contact, err );
+    iContactFetchObserver = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// From MVPbkSingeContactOperationObserver
+// Notify observer that contact fetch failed.
+// ---------------------------------------------------------------------------
+//   
+void CPhCntContactStores::VPbkSingleContactOperationFailed(
+    MVPbkContactOperationBase& /*aOperation*/, 
+    TInt aError ) 
+    {
+    CancelRequest();
+    
+    delete iLink;
+    iLink = NULL;
+    iContactFetchObserver->ContactReceived( NULL, aError );
+    iContactFetchObserver = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//    
+CPhCntContactStores::CPhCntContactStores( 
+    MPhCntContactManager& aContactManager ) :
+    iContactManager( aContactManager )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase constructor.
+// ---------------------------------------------------------------------------
+//    
+void CPhCntContactStores::ConstructL()
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/CPhCntMatcherImpl.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,358 @@
+/*
+* 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:  Matcher implementation
+*
+*/
+
+
+
+#include <CVPbkPhoneNumberMatchStrategy.h>
+#include <MVPbkContactLinkArray.h>
+#include <CPbk2StoreConfiguration.h>
+#include <MVPbkContactStoreProperties.h>
+#include <MVPbkContactStore.h>
+#include <CVPbkContactStoreUriArray.h>
+
+
+#include "CPhCntMatcherImpl.h"
+#include "cphcntmatchcontact.h"
+#include "cphcntfetchcontact.h"
+#include "cphcntfoundcontacts.h"
+#include "CPhCntContact.h"
+#include "CPhCntContactManager.h"
+#include "CPhCntContactStores.h"
+#include "MPhoneCntPbkOwner.h"
+#include "cphcntvpbkcontactid.h"
+#include "cphcntcontactmatchstrategy.h"
+#include <talogger.h>
+
+
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntMatcherImpl* CPhCntMatcherImpl::NewL(
+    const MPhoneCntPbkOwner& aOwner )
+    {
+    CPhCntMatcherImpl* self = new( ELeave )CPhCntMatcherImpl( aOwner );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhCntMatcherImpl::~CPhCntMatcherImpl()
+    {
+    delete iCSMatchStrategy;
+    delete iFoundContacts;
+    delete iContactStores;
+    delete iMatchContact;
+    delete iFetchContact;
+    }
+
+// ---------------------------------------------------------------------------
+// From CPhCntMatcher
+// Tries to find a contact which has aTelNumber.
+// ---------------------------------------------------------------------------
+//
+TInt CPhCntMatcherImpl::MatchNumber(
+    MPhCntMatch*& aMatch,
+    const TDesC& aTelNumber )
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPhCntMatcherImpl::MatchNumber" );
+    TInt err = CreateMatcher();
+    if ( !err )
+    	{
+	    // Check if we already have the contact.
+	    CPhCntContact* contact = iFoundContacts->FindContact( aTelNumber );
+
+	    err = KErrNone;
+	    if( !contact )
+	        {
+	        // Get contact from contact stores
+	        TRAPD( traperr, err = GetContactL( aMatch, aTelNumber ));
+	        if ( traperr )
+	            {
+	            err = traperr;
+	            }
+	        }
+	    else
+	        {
+	        aMatch = contact;
+	        }
+    	}
+    TEFLOGSTRING2( KTAOBJECT, "CNT CPhCntMatcherImpl::MatchNumber %d " , err);
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// From CPhCntMatcher
+// Tries to find a contact which has aTelNumber.
+// ---------------------------------------------------------------------------
+//
+TInt CPhCntMatcherImpl::MatchNumber(
+    MPhCntMatch*& aMatch,
+    const TDesC& aTelNumber,
+    const CPhCntContactId& aContactId )
+    {
+    TInt err = CreateMatcher();
+    if ( !err )
+	    {
+	    if( aContactId.IsValid() )
+	        {
+	        // Do we have existing contact for the link and number.
+	        const CPhCntVPbkContactId& contactId =
+	            static_cast<const CPhCntVPbkContactId&>( aContactId );
+	        const MVPbkContactLink& link = contactId.ContactLink();
+	        aMatch =
+	            iFoundContacts->FindContact( aTelNumber, link );
+	        if( !aMatch )
+	            {
+	            // Get the contact.
+	            CPhCntContact* match = NULL;
+	            err = FetchContact( match, link, aTelNumber );
+	            if( !err )
+	                {
+	                aMatch = match;
+	                }
+	            }
+	        }
+	    else
+	        {
+	        err = MatchNumber( aMatch, aTelNumber );
+	        }
+	    }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// From CPhCntMatcher
+// Empty implementation. Implemented in CPhCntMatcherVoIPImpl.
+// ---------------------------------------------------------------------------
+//
+TInt CPhCntMatcherImpl::MatchVoipNumber(
+    MPhCntMatch*& /*aMatch*/,
+    const TDesC& /*aMatchString*/,
+    TBool /*aAllowUserNameMatch*/,
+    MDesCArray* /*aContactStoreUris*/,
+    TInt /*aCharsForMatching*/ )
+    {
+    return KErrNotFound;
+    }
+
+// ---------------------------------------------------------------------------
+// From CPhCntMatcher
+// Empty implementation. Implemented in CPhCntMatcherVoIPImpl.
+// ---------------------------------------------------------------------------
+//
+TInt CPhCntMatcherImpl::MatchVoipNumber(
+    MPhCntMatch*& /*aMatch*/,
+    const CPhCntContactId& /*aContactId*/ )
+    {
+    return KErrNotFound;
+    }
+
+// ---------------------------------------------------------------------------
+// From CPhCntMatcher
+// Empty implementation. Implemented in CPhCntMatcherVoIPImpl.
+// ---------------------------------------------------------------------------
+//
+TBool CPhCntMatcherImpl::HasCSNumbers(
+    const CPhCntContactId& /*aContactId*/ )
+    {
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// Gets contact from contact stores
+// ---------------------------------------------------------------------------
+//
+TInt CPhCntMatcherImpl::GetContactL(
+    MPhCntMatch*& aMatch,
+    const TDesC& aTelNumber )
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPhCntMatcherImpl::GetContactL" );
+    // Try to find matching contact.
+    const MVPbkContactLinkArray* linkArray = NULL;
+    delete iCSMatchStrategy;
+    iCSMatchStrategy = 0;
+    iCSMatchStrategy = iContactManager.CreateContactMatchStrategyL( *iMatchContact,
+        EFalse ); // don't remove duplicates
+    TInt err( iMatchContact->MatchContact( linkArray, aTelNumber,
+        *iCSMatchStrategy ) );
+
+    CPhCntContact* match( NULL );
+    TInt index( KErrNotFound );
+
+    // Apply exact match on additional stores first.
+    // If match is found, don't care about other stores as
+    // these come first.
+    if(  !err && ( linkArray->Count() > 1 ) )
+        {
+        index = MatchFromAdditionalStore( *linkArray );
+
+        // Single match on additonal stores
+        if ( index != KErrNotFound && index != KErrAlreadyExists )
+            {
+            FetchContact( match, linkArray->At( index ), aTelNumber );
+            aMatch = match;
+            return err;
+            }
+        else if ( index == KErrAlreadyExists ) //Several matches on additional stores
+            {
+            aMatch = match;
+            return KErrNotFound;
+            }
+        }
+
+    if(  !err && ( linkArray->Count() > 1 ) )
+        {
+        delete iCSMatchStrategy;
+        iCSMatchStrategy = 0;
+        iCSMatchStrategy = iContactManager.CreateContactMatchStrategyL(
+            *iMatchContact, ETrue ); //remove duplicates
+        err = iMatchContact->MatchContact( linkArray, aTelNumber,
+            *iCSMatchStrategy );
+        }
+    if ( !err )
+        {
+        // If only one contact, no additional checks needed
+        if ( linkArray->Count() == 1 )
+            {
+            index = 0;
+            }
+        }
+
+
+    // Finally fetch contact details
+    if ( index != KErrNotFound )
+        {
+        FetchContact( match, linkArray->At( index ), aTelNumber );
+        }
+
+    aMatch = match;
+    return err;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntMatcherImpl::CPhCntMatcherImpl( const MPhoneCntPbkOwner& aOwner ) :
+    iContactManager( *aOwner.ContactManager() ),
+    iPbkOwner( aOwner )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Delayed on-demand based construction
+// ---------------------------------------------------------------------------
+//
+void CPhCntMatcherImpl::DoCreateMatcherL()
+	{
+	TEFLOGSTRING( KTAOBJECT, "CNT CPhCntMatcherImpl::DoCreateMatcherL" );
+	if ( !iContactStores )
+		{
+		iFoundContacts = CPhCntFoundContacts::NewL();
+	    iContactStores = CPhCntContactStores::NewL( iContactManager );
+	    iMatchContact = CPhCntMatchContact::NewL();
+	    iFetchContact = CPhCntFetchContact::NewL( *iContactStores );
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// Delayed on-demand based construction
+// ---------------------------------------------------------------------------
+//
+TInt CPhCntMatcherImpl::CreateMatcher()
+	{
+	TRAPD( err, DoCreateMatcherL() );
+	return err;
+	}
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhCntMatcherImpl::ConstructL()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Fetches contact
+// ---------------------------------------------------------------------------
+//
+TInt CPhCntMatcherImpl::FetchContact(
+    CPhCntContact*& aMatch,
+    const MVPbkContactLink& aContactLink,
+    const TDesC& aTelNumber )
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPhCntMatcherImpl::FetchContact" );
+    CPhCntContact* contact = NULL;
+    TInt err = iFetchContact->FetchContact( aContactLink,  contact );
+    if( !err )
+        {
+        TRAP( err, iFoundContacts->AddL( contact, aTelNumber ) );
+        if( err )
+            {
+            delete contact;
+            }
+        else
+            {
+            aMatch = contact;
+            }
+        }
+    return err;
+    }
+
+// --------------------------------------------------------------------------
+// CPhCntMatcherImpl::MatchFromAdditionalStore
+// --------------------------------------------------------------------------
+//
+TInt CPhCntMatcherImpl::MatchFromAdditionalStore(
+    const MVPbkContactLinkArray& linkArray ) const
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPhCntMatcherImpl::MatchFromAdditionalStore" );
+    TInt ret( KErrNotFound );
+    TInt found(0); // count of found contacts from additional stores.
+
+    for ( TInt i = 0; i < linkArray.Count(); i++ )
+        {
+        TVPbkContactStoreUriPtr uri =
+            linkArray.At( i ).ContactStore().StoreProperties().Uri();
+
+        // Compare if contact is from additional store.
+        if ( iContactManager.AdditionalContactStoreUris().IsIncluded( uri ) )
+            {
+            // Contact found from additional store.
+            found++;
+            ret = i;
+            }
+        }
+
+    if ( found > 1)
+        {
+        // Multiple matches from additional stores -> no match.
+        ret = KErrAlreadyExists;
+        }
+
+    return ret;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/CPhCntService.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,213 @@
+/*
+* 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:  Aiw service wrapper.
+*
+*/
+
+
+#include "CPhCntService.h"
+#include <AiwServiceHandler.h>
+#include <AiwGenericParam.hrh>
+#include <AiwCommon.hrh>
+#include <AiwContactSelectionDataTypes.h>
+#include "mphcntservicerequestparam.h"
+#include "mphcntserviceresult.h"
+
+_LIT8( KContentType ,EGenericParamContactItemStr );
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntService* CPhCntService::NewL() 
+	{
+	CPhCntService* self = 
+	    new( ELeave )CPhCntService();
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	CleanupStack::Pop( self );
+	return self;
+	}
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//	
+CPhCntService::~CPhCntService() 
+	{
+	CancelRequest();
+	if( iAiwService ) 
+	    {
+        iAiwService->Reset();	    
+	    }
+	iCriteriaArray.ResetAndDestroy();
+	iCriteriaArray.Close();
+	
+	delete iAiwService;
+	}
+	
+// ---------------------------------------------------------------------------
+// Attach AIW criterias
+// ---------------------------------------------------------------------------
+//
+void CPhCntService::AttachCriteriasL() 
+	{
+	// Note take array to member variable and detach from aiw when destructing.
+	CAiwCriteriaItem* selectCriteria = 
+		CAiwCriteriaItem::NewLC( KAiwCmdSelect, KAiwCmdSelect, KContentType ); 
+    TUid uid;
+	uid.iUid = KAiwClassBase;
+	selectCriteria->SetServiceClass( uid );
+	selectCriteria->SetMaxProviders( 1 );
+	iCriteriaArray.AppendL( selectCriteria );
+	CleanupStack::Pop( selectCriteria );
+		
+    CAiwCriteriaItem* assignCriteria = 
+        CAiwCriteriaItem::NewLC( KAiwCmdAssign, KAiwCmdAssign, KContentType );
+	
+	uid.iUid = KAiwClassMenu;
+	assignCriteria->SetServiceClass( uid );
+	assignCriteria->SetMaxProviders( 1 );
+	
+	
+	iCriteriaArray.AppendL( assignCriteria  );
+	iAiwService->AttachL( iCriteriaArray ); 
+	CleanupStack::Pop( assignCriteria );
+	}
+
+        
+// ---------------------------------------------------------------------------
+// Cancels request if request is outstanding.
+// ---------------------------------------------------------------------------
+//    
+TInt CPhCntService::CancelRequest()
+    {
+    TInt err( KErrNone );
+    if ( iParams )
+    	{
+    	if( iClientCanceledRequest )
+    	    {
+    	    *iClientCanceledRequest = ETrue;
+    	    }
+    	// Cancel old requests
+	    iCommandOptions |= KAiwOptCancel;
+	    // Cancel is synchronous and we have request ongoing so
+	    // do not use base class MakeAsyncRequest, because it uses
+	    // CActiveSchedulerWait to make synchronisation and the 
+	    // wait scheduler is already waiting. If we would call the 
+	    // wait scheduler again, it would crash.
+    	TRAP( err, DoMakeAsyncRequestL() );
+        iCommandOptions = 0; // Reset the command options
+    	}
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntService
+// Executes AIW service rewuest.
+// ---------------------------------------------------------------------------
+//	
+void CPhCntService::ExecuteRequestL( 
+    MPhCntServiceRequestParam& aParams,
+    MPhCntServiceResult& aResult )
+    {
+    if( !IsActive() )
+        {
+        // Destructor can indicate canceling of request using 
+        // iClientCanceledRequest.
+        TBool requestCanceledByClient = EFalse;
+        iClientCanceledRequest = &requestCanceledByClient;
+        
+        SetRequestAndResult( aParams, aResult );
+        TInt err( KErrNone );
+        TRAPD( applicationShuttingdown, err = MakeAsyncRequest() );
+        // If application using phonecntfinder is ended from task switcher, then
+        // underlying CActiveSchedulerWait::Wait leaves. This needs to be
+        // trapped because we are using clients aParams and aResult, which 
+        // are stack based objects. 
+        if( applicationShuttingdown )
+            {
+            // Cancel possible outstanding request
+           	    CancelRequest();
+           	    iResult = NULL;
+                iParams = NULL;
+           	    User::Leave( applicationShuttingdown );
+           	    }
+           
+            if( !requestCanceledByClient )
+                {
+                iResult = NULL;
+                iParams = NULL;
+                }
+            else
+                {
+                err = KErrCancel;
+                }
+    
+        User::LeaveIfError( err );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MPhCntAiwServiceCompleteObserver
+// Notifies link fetch observer that links are fetched.
+// ---------------------------------------------------------------------------
+//    
+void CPhCntService::ServiceRequestComplete( TInt aError )
+    {
+    ResponseReceived( aError );
+    }
+	
+void CPhCntService::ConstructL() 
+	{
+    BaseConstructL();
+	iAiwService = CAiwServiceHandler::NewL();
+	AttachCriteriasL();
+
+	}
+	
+CPhCntService::CPhCntService() : 
+    iAiwServiceObserver( *this )
+	{
+	}
+	
+// ---------------------------------------------------------------------------
+// From CPhCntAsyncToSync
+// Makes the actual aiw request.
+// ---------------------------------------------------------------------------
+//
+void CPhCntService::DoMakeAsyncRequestL()  
+    {
+    iAiwService->ExecuteServiceCmdL( 
+        iParams->Command(), 
+        iParams->InParamList(), 
+        iAiwService->OutParamListL(), 
+        iCommandOptions, 
+        &iAiwServiceObserver );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets variables
+// ---------------------------------------------------------------------------
+//    
+void CPhCntService::SetRequestAndResult( 
+    MPhCntServiceRequestParam& aServiceRequestParams, 
+    MPhCntServiceResult& aResult )
+    {
+    iResult = &aResult;
+   	iParams = &aServiceRequestParams;
+   	iAiwServiceObserver.SetRequestAndResult( iParams, iResult );
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/CPhCntSingleItemFetchService.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Service for fetching single contact field.
+*
+*/
+
+
+#include <featmgr.h>         // Feature Manager
+#include "CPhCntSingleItemFetchService.h"
+#include "cphcntphonebookservices.h"
+#include "tphcntservicerequestparamfactory.h"
+#include "cphcntcontactid.h"
+#include "CPhCntContact.h"
+
+   
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntSelectionImpl* CPhCntSelectionImpl::NewL(
+    const TDesC& aNumber, 
+    const CPhCntContactId& aContactId )
+    {
+    CPhCntSelectionImpl* self = new( ELeave )CPhCntSelectionImpl();
+    CleanupStack::PushL( self );
+    self->ConstructL( aNumber, aContactId );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//    
+CPhCntSelectionImpl::CPhCntSelectionImpl()
+    {
+    }
+    
+// ---------------------------------------------------------------------------
+// Second-phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhCntSelectionImpl::ConstructL(
+    const TDesC& aNumber, 
+    const CPhCntContactId& aContactId)
+    {
+    iNumber = aNumber.AllocL();
+    iContactId = aContactId.CloneL();
+    FeatureManager::InitializeLibL();
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+// 
+CPhCntSelectionImpl::~CPhCntSelectionImpl()
+    {
+    delete iNumber;
+    delete iContactId;
+    FeatureManager::UnInitializeLib();
+    }
+
+// ---------------------------------------------------------------------------
+// Returns number
+// ---------------------------------------------------------------------------
+//     
+const TDesC& CPhCntSelectionImpl::Number() const
+    {
+    return *iNumber;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns contact id
+// ---------------------------------------------------------------------------
+// 
+const CPhCntContactId& CPhCntSelectionImpl::ContactId() const
+    {
+    return *iContactId;
+    }
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntSingleItemFetchService* CPhCntSingleItemFetchService::NewL(
+    MPhCntContactStores& aContactStores,
+    MPhCntContactManager& aContactManager )
+    {
+    CPhCntSingleItemFetchService* self = 
+        new( ELeave )CPhCntSingleItemFetchService();
+    CleanupStack::PushL( self );
+    self->ConstructL( 
+        aContactStores, aContactManager );
+    CleanupStack::Pop( self );
+    return self;    
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//    
+CPhCntSingleItemFetchService::~CPhCntSingleItemFetchService() 
+    {
+    delete iParamFactory;
+    delete iServices;
+    if( iDestroyed ) 
+        {
+        *iDestroyed = ETrue;
+        }
+    }
+   
+// ---------------------------------------------------------------------------
+// From CPhCntSingleItemFetch
+// Fetches phone number
+// ---------------------------------------------------------------------------
+//
+TInt CPhCntSingleItemFetchService::FetchLD( 
+    TFetchParams& aParams ) 
+    {
+    TBool destroyed = EFalse;
+    iDestroyed = &destroyed;
+    HBufC* number = NULL;
+    TInt err = KErrNone;
+    if( aParams.iType == CPhCntSingleItemFetch::EFetchDtmf )
+        {
+        TRAP( err, 
+            iServices->GetUserSelectedDtmfNumberL( 
+                aParams.iContactId, number ) );
+        }
+    else if( aParams.iType == CPhCntSingleItemFetch::EFetchNewCall )
+        {
+        TRAP( err, 
+            iServices->GetUserSelectedPhoneNumberL( 
+                aParams.iContactId, number ) );
+        }
+    else if( aParams.iType == CPhCntSingleItemFetch::EFetchNewPSCall && 
+             FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
+        {
+        TRAP( err, 
+            iServices->GetUserSelectedVoIPAddressL( 
+                aParams.iContactId, number ) );
+        }
+    else
+        {
+        User::Leave( KErrNotSupported );
+        }
+    // Do not touch member variables after this, because service is canceled
+    // by deleting this instance. Deletion causes above request to complete and
+    // execution will be here after deletion.
+        
+    TInt error = KErrNone;
+    if( !err )
+        {
+        error = SetFetchParams( aParams, *number );
+        }
+    else if( err == KErrCancel )
+        {
+        error = KErrCancel;
+        }
+    else 
+        {
+        if( !destroyed )
+            {
+            iDestroyed = NULL;
+            delete this;
+            }
+        User::Leave( err );     
+        }
+    delete number;
+    if( !destroyed )
+        {
+        iDestroyed = NULL;
+        delete this;
+        }
+    return error;
+    }
+
+// ---------------------------------------------------------------------------
+// From CPhCntSingleItemFetch
+// Fetches phone number
+// ---------------------------------------------------------------------------
+//
+TInt CPhCntSingleItemFetchService::FetchPhoneNumberLD( 
+    const TDesC8& aContactLink,
+    const CPhCntSingleItemFetch::TCallType aCallType,
+    HBufC*& aNumber,
+    HBufC8*& aFieldLink ) 
+    {
+    TBool destroyed = EFalse;
+    iDestroyed = &destroyed;    
+    TInt err = KErrNone;
+        
+    TRAP( err, 
+    	iServices->GetPhoneNumberL( aContactLink, aCallType, aNumber, aFieldLink ) 
+    	);                        
+
+    // Do not touch member variables after this, because service is canceled
+    // by deleting this instance. Deletion causes above request to complete and
+    // execution will be here after deletion.
+    
+    TInt error = KErrNone;    
+    if( err )
+    	{
+    	delete aNumber;
+    	aNumber = NULL;
+    	delete aFieldLink;
+    	aFieldLink = NULL;
+	    if( err == KErrCancel )
+	        {
+	        error = KErrCancel;
+	        }
+	    else 
+	        {
+	        if( !destroyed )
+	            {
+	            iDestroyed = NULL;
+	            delete this;
+	            }
+	        User::Leave( err );     
+	        }	
+    	}
+                    
+    if( !destroyed )
+        {
+        iDestroyed = NULL;
+        delete this;
+        }
+    return error;
+    }
+
+// ---------------------------------------------------------------------------
+// From CPhCntSingleItemFetch
+// Fetches phone number
+// ---------------------------------------------------------------------------
+//    
+CPhCntSelection* CPhCntSingleItemFetchService::SelectPhoneNumberLD()
+    {
+    TBool destroyed = EFalse;
+    iDestroyed = &destroyed;    
+    CPhCntSelectionImpl* selection = NULL;
+
+    CPhCntContact* contact = NULL;
+    TRAPD( err, 
+        MPhCntServiceRequestParam* param = 
+            iParamFactory->CreateGetUserSelectedPhoneNumberLC();
+        contact = iServices->GetUserSelectedContactLC( *param );
+        CleanupStack::Pop( contact );
+        CleanupStack::PopAndDestroy( 1 ); // param
+        );
+    if( !destroyed )
+        {
+        iDestroyed = NULL;
+        delete this;
+        }
+        
+    if( !err )
+        {
+        CleanupStack::PushL( contact );
+        selection = CPhCntSelectionImpl::NewL( 
+            contact->Number(), *contact->ContactId() );
+        CleanupStack::PopAndDestroy( contact );
+        }
+    else
+        {
+        // If the request is canceled then do not leave, because
+        // of agreement with clients.
+        if( err != KErrCancel )
+            {
+            User::Leave( err );    
+            }
+        }
+        
+    
+    return selection;
+    }
+// ---------------------------------------------------------------------------
+// Sets possible error values and return values.
+// ---------------------------------------------------------------------------
+// 
+TInt CPhCntSingleItemFetchService::SetFetchParams( 
+    TFetchParams& aParams,
+    const TDesC& aReceivedPhoneNumber  ) const
+    {
+    TInt errorValue( KErrNone );
+    
+    if( aReceivedPhoneNumber.Length() >= aParams.iString->MaxLength() ) 
+        {
+        errorValue = KErrOverflow;
+        }
+    
+    if( errorValue == KErrNone ) 
+        {
+        aParams.iString->Zero();
+        aParams.iString->Copy( aReceivedPhoneNumber );
+        }
+    
+    
+    return errorValue;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//     
+CPhCntSingleItemFetchService::CPhCntSingleItemFetchService()
+    {
+    }
+    
+// ---------------------------------------------------------------------------
+// Seconds phase constructor
+// ---------------------------------------------------------------------------
+//     
+void CPhCntSingleItemFetchService::ConstructL( 
+    MPhCntContactStores& aContactStores,
+    MPhCntContactManager& aContactManager )
+    {
+    iParamFactory = CPhCntServiceRequestParamFactory::NewL( aContactManager );
+    iServices = CPhCntPhonebookServices::NewL( 
+        aContactStores, aContactManager );
+    }
+
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/cphcntasynctosync.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Converts asynchronous call to synchronous.
+*
+*/
+
+
+#include "cphcntasynctosync.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntAsyncToSync::CPhCntAsyncToSync()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Second phase constructor.
+// ---------------------------------------------------------------------------
+//
+void CPhCntAsyncToSync::BaseConstructL()
+    {
+    iWait = new( ELeave )CActiveSchedulerWait();
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhCntAsyncToSync::~CPhCntAsyncToSync()
+    {
+    delete iWait;
+    }
+
+// ---------------------------------------------------------------------------
+// Converts asyncrhonous call to synchronous.
+// ---------------------------------------------------------------------------
+//
+TInt CPhCntAsyncToSync::MakeAsyncRequest()
+    {
+    iResponseReceived = EFalse;
+    TRAPD( err, DoMakeAsyncRequestL() );
+    if( !err )
+        {
+        // Check that response is not already received, we cannot 
+        // start the scheduler if response is received, otherwise
+        // scheduler waits forever.
+        if( !iResponseReceived )
+            {
+            iWait->Start();
+            }    
+        err = iResponseError;
+        }
+    return err;
+    }
+    
+// ---------------------------------------------------------------------------
+// Indication that response has been received from async request.
+// ---------------------------------------------------------------------------
+//
+void CPhCntAsyncToSync::ResponseReceived( TInt aErrorCode )
+    {
+    iResponseReceived = ETrue;
+    iResponseError = aErrorCode;
+    if( iWait->IsStarted() )
+        {
+        iWait->AsyncStop();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Checks if there are pending asynchronous requests available.
+// ---------------------------------------------------------------------------
+//
+TBool CPhCntAsyncToSync::IsActive()
+    {
+    return iWait->IsStarted();
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/cphcntcontactdataselectionimpl.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,225 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Service to show dialogs for user to select contact data.
+*
+*/
+
+
+#include "cphcntcontactdataselectionimpl.h"
+#include "mphcntservicerequestparamfactory.h"
+#include "mphcntservicerequestparam.h"
+#include "MPhCntContactStores.h"
+#include "CPhCntContact.h"
+#include "cphcntcontactid.h"
+
+CPhCntSelectedDataImpl* CPhCntSelectedDataImpl::NewL( 
+    CPhCntContact& aContact )
+    {
+    CPhCntSelectedDataImpl* self = new( ELeave )CPhCntSelectedDataImpl();
+    CleanupStack::PushL( self );
+    self->ConstructL( aContact );
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+CPhCntSelectedDataImpl::~CPhCntSelectedDataImpl()
+    {
+    delete iSelectedData;
+    delete iFieldLink;
+    }
+    
+CPhCntSelectedDataImpl::CPhCntSelectedDataImpl()
+    {
+    }
+    
+void CPhCntSelectedDataImpl::ConstructL( CPhCntContact& aContact )
+    {
+    iSelectedData = aContact.Number().AllocL();
+    iFieldLink = aContact.ContactId()->PackLC();
+    iNumberType = aContact.NumberType();
+    CleanupStack::Pop( iFieldLink );
+    }
+    
+const TDesC& CPhCntSelectedDataImpl::Data() const
+    {
+    return *iSelectedData;
+    }
+    
+const TDesC8& CPhCntSelectedDataImpl::FieldLink() const
+    {
+    return *iFieldLink;
+    }
+
+MPhCntMatch::TNumberType CPhCntSelectedDataImpl::NumberType() const
+    {
+    return iNumberType;
+    }
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntContactDataSelectionImpl::CPhCntContactDataSelectionImpl(
+    MPhCntAiwService* aService,
+    MPhCntServiceRequestParamFactory* aParamFactory,
+    MPhCntContactStores* aContactStores ) : 
+    iService( aService ),
+    iParamFactory( aParamFactory ),
+    iServiceResult( iFieldLink ),
+    iContactStores( aContactStores )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactDataSelectionImpl::ConstructL()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntContactDataSelectionImpl* CPhCntContactDataSelectionImpl::NewL(
+    MPhCntAiwService* aService,
+    MPhCntServiceRequestParamFactory* aParamFactory,
+    MPhCntContactStores* aContactStores )
+    {
+    CPhCntContactDataSelectionImpl* self = new( ELeave ) 
+        CPhCntContactDataSelectionImpl(
+            aService, aParamFactory, aContactStores );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhCntContactDataSelectionImpl::~CPhCntContactDataSelectionImpl()
+    {
+    if( iService )
+        {
+        iService->Cancel();
+        }
+    delete iService;
+    delete iParamFactory;
+    delete iServiceParameter;
+    delete iFieldLink;
+    if( iContactStores )
+        {
+        iContactStores->CancelRequest();
+        }
+    delete iContactStores;
+    }
+
+// ---------------------------------------------------------------------------
+// From class CPhCntContactDataSelection
+// Determines if there is active request pending.
+// ---------------------------------------------------------------------------
+//
+TBool CPhCntContactDataSelectionImpl::IsActive() const
+    {
+    return iService->IsRequestActive() | iContactStores->IsRequestActive();
+    }
+    
+// ---------------------------------------------------------------------------
+// From class CPhCntContactDataSelection
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//    
+void CPhCntContactDataSelectionImpl::Cancel()
+    {
+    iService->Cancel();
+    iContactStores->CancelRequest();
+    iObserver = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// From class CPhCntContactDataSelection
+// Starts phone number selection.
+// ---------------------------------------------------------------------------
+//   
+void CPhCntContactDataSelectionImpl::SelectPhoneNumberForCallL(
+    const TDesC8& aContactLink,
+    const TCallType& aCallType,
+    MPhCntSelectionObserver& aObserver )
+    {
+    if( IsActive() ) 
+        {
+        User::Leave( KErrInUse );
+        }
+    iObserver = &aObserver;
+    delete iServiceParameter;
+    iServiceParameter = NULL;
+    iServiceParameter = iParamFactory->CreateGetPhoneNumberFromContactParamL( 
+        aContactLink,
+        static_cast<CPhCntSingleItemFetch::TCallType>(aCallType ) );
+    iService->ExecuteRequestL( *iServiceParameter, iServiceResult, *this );
+    }
+    
+// ---------------------------------------------------------------------------
+// From class MPhCntServiceObserver
+// Indication from Aiw service that request has completed.
+// ---------------------------------------------------------------------------
+//  
+void CPhCntContactDataSelectionImpl::RequestComplete( TInt aError )
+    {
+    if( !aError )
+        {
+        TRAPD( err, iContactStores->FetchFirstContactL( *iFieldLink, *this ) );
+        if( iObserver && err )
+            {
+            iObserver->SelectionDone( NULL, err );
+            }
+        }
+    else
+        {
+        if( iObserver )
+            {
+            iObserver->SelectionDone( NULL, aError );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPhCntContactFetchObserver
+// Indication from contact stores that contact is now received.
+// ---------------------------------------------------------------------------
+//  
+void CPhCntContactDataSelectionImpl::ContactReceived( 
+    CPhCntContact* aContact, TInt aError )
+    {
+    if( !aError )
+        {
+        CPhCntSelectedDataImpl* selectedData = NULL;
+        TRAPD( err, 
+            selectedData = CPhCntSelectedDataImpl::NewL( *aContact ) );
+        iObserver->SelectionDone( selectedData, err );
+        delete selectedData;
+        }
+    else
+        {
+        iObserver->SelectionDone( NULL, aError );
+        }
+    delete aContact;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/cphcntcontactfieldsresolver.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,434 @@
+/*
+* 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:  Resolves contact's fields
+*
+*/
+
+
+#include <MVPbkContactLink.h>
+#include <MVPbkStoreContact.h>
+#include <MPbk2ContactNameFormatter.h>
+#include <MVPbkStoreContactFieldCollection.h>
+#include <MVPbkFieldType.h>
+#include <MVPbkContactFieldData.h>
+#include <MVPbkContactFieldTextData.h>
+#include <MVPbkContactFieldUriData.h>
+#include <TVPbkFieldVersitProperty.h>
+#include <VPbkEng.rsg>
+#include <badesca.h>
+
+#include "MPhCntContactManager.h"
+#include "cphcntcontactfieldsresolver.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntContactFieldsResolver::CPhCntContactFieldsResolver(
+    MVPbkContactLink* aContactLink,
+    MVPbkStoreContact* aContact,
+    MPhCntContactManager& aContactManager ) : 
+    iFirstNameResolver( R_VPBK_FIELD_TYPE_FIRSTNAME ),
+    iLastNameResolver(R_VPBK_FIELD_TYPE_LASTNAME),
+    iCompanyNameResolver( R_VPBK_FIELD_TYPE_COMPANYNAME ),
+    iSecondNameResolver( R_VPBK_FIELD_TYPE_SECONDNAME ),
+    iRingingToneResolver( R_VPBK_FIELD_TYPE_RINGTONE ),
+    iFirstNamePronunciationResolver( R_VPBK_FIELD_TYPE_FIRSTNAMEREADING ),
+    iLastNamePronunciationResolver( R_VPBK_FIELD_TYPE_LASTNAMEREADING ),
+    iCompanyNamePronunciationResolver( R_VPBK_FIELD_TYPE_COMPANYNAME ),
+    iCallImageResolver( R_VPBK_FIELD_TYPE_CALLEROBJIMG ),
+    iCallTextResolver( R_VPBK_FIELD_TYPE_CALLEROBJTEXT ),
+    iDtmfResolver( R_VPBK_FIELD_TYPE_DTMFSTRING ),    	    
+	iContactLink( aContactLink ),
+    iContact( aContact ),    
+    iContactManager( aContactManager ),
+    iNameFormatter( aContactManager.ContactNameFormatter() )
+    {
+   
+    }
+
+
+// ---------------------------------------------------------------------------
+// Secondphase constructor.
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactFieldsResolver::ConstructL()
+    {
+    iAllDtmfNumbers = new ( ELeave ) CDesCArrayFlat( 2 );
+    // Check if contactlink is pointing directly to some contact field.
+    // If there is pointed field, then it is going to be in resolved contact fields.
+    // For example there migth be many phonenumbers in contact, but the 
+    // we want to have only the pointed number resolved.
+    MVPbkStoreContactField* field = iContact->Fields().
+        RetrieveField( *iContactLink );
+    if( field != NULL ) 
+        {
+        ResolveFieldL( *field, ETrue );
+        }
+    
+    // Go through the contact's field and resolve the fields.              
+    MVPbkStoreContactFieldCollection& fields = iContact->Fields();
+    const TInt fieldCount( fields.FieldCount() );
+    for( TInt i = 0; i < fieldCount; i++ ) 
+        {
+        MVPbkStoreContactField& field = fields.FieldAt( i );
+        ResolveFieldL( field, EFalse );
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Resolves contact's fields
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactFieldsResolver::ResolveFieldL( 
+    MVPbkStoreContactField& aContactField, 
+    TBool aFieldPointedByContactLink )
+    {
+     MVPbkContactFieldData& fieldData = aContactField.FieldData();
+        
+    const MVPbkFieldType* fieldType = aContactField.BestMatchingFieldType();
+    if( fieldType ) 
+        {
+        const TInt fieldId( fieldType->FieldTypeResId() );
+        if( fieldData.DataType() == EVPbkFieldStorageTypeText )
+            {
+            const TPtrC fieldTextData = 
+                MVPbkContactFieldTextData::Cast( fieldData ).Text();
+            
+            ResolveFieldDataL( aContactField,
+                               fieldTextData,
+                               aFieldPointedByContactLink );   
+                                       
+            // DTMF field is only used if the contact link was pointing to it.
+            if( aFieldPointedByContactLink )
+                {
+                iDtmfResolver.Resolve( 
+                    fieldId, 
+                    fieldTextData, 
+                    aFieldPointedByContactLink );
+                }
+                
+             if ( fieldId == R_VPBK_FIELD_TYPE_DTMFSTRING )
+                {
+                TRAP_IGNORE( iAllDtmfNumbers->AppendL( fieldTextData ) );
+                }               
+            }
+        else if ( fieldData.DataType() == EVPbkFieldStorageTypeUri )
+            {
+            MVPbkContactFieldUriData& textData =
+                MVPbkContactFieldUriData::Cast( fieldData );
+            TPtrC fieldTextData = textData.Text();
+            
+            ResolveFieldDataL( aContactField,
+                               fieldTextData,
+                               aFieldPointedByContactLink );
+                                       
+            }
+            
+        // Check for thumbnail field.
+        if( fieldId == R_VPBK_FIELD_TYPE_THUMBNAILPIC )
+            {
+            iThumbnailField = fieldType;    
+            }
+                
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Resolves contact's fields
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactFieldsResolver::ResolveFieldDataL( 
+    MVPbkStoreContactField& aContactField,
+    const TPtrC aFieldTextData,
+    TBool aFieldPointedByContactLink )
+    {
+    MVPbkContactFieldData& fieldData = aContactField.FieldData();
+        
+    const MVPbkFieldType* fieldType = aContactField.BestMatchingFieldType();
+    const TInt fieldId( fieldType->FieldTypeResId() );
+           
+    iPhoneNumberResolver.ResolveL( fieldId, aFieldTextData,
+        aFieldPointedByContactLink, iContactManager, aContactField );
+    iFirstNameResolver.Resolve(  fieldId, aFieldTextData,
+        aFieldPointedByContactLink );
+    iLastNameResolver.Resolve(  fieldId, aFieldTextData,
+        aFieldPointedByContactLink );
+    iCompanyNameResolver.Resolve(  fieldId, aFieldTextData,
+        aFieldPointedByContactLink );
+    iSecondNameResolver.Resolve(  fieldId, aFieldTextData,
+        aFieldPointedByContactLink );
+    iRingingToneResolver.Resolve(  fieldId, aFieldTextData,
+        aFieldPointedByContactLink );
+    iFirstNamePronunciationResolver.Resolve( fieldId, aFieldTextData,
+        aFieldPointedByContactLink );
+    iLastNamePronunciationResolver.Resolve( fieldId, 
+            aFieldTextData, aFieldPointedByContactLink ); 
+    iCompanyNamePronunciationResolver.Resolve( fieldId,
+            aFieldTextData, aFieldPointedByContactLink );
+    
+    iCallImageResolver.Resolve( fieldId, 
+                                aFieldTextData, 
+                                aFieldPointedByContactLink ); 
+    
+    iCallTextResolver.Resolve( fieldId, 
+                               aFieldTextData, 
+                               aFieldPointedByContactLink );    
+
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntContactFieldsResolver* CPhCntContactFieldsResolver::NewL(
+    MVPbkContactLink* aContactLink,
+    MVPbkStoreContact* aContact,
+    MPhCntContactManager& aContactManager )
+    {
+    CPhCntContactFieldsResolver* self = 
+        CPhCntContactFieldsResolver::NewLC(
+            aContactLink, aContact, aContactManager );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntContactFieldsResolver* CPhCntContactFieldsResolver::NewLC(
+    MVPbkContactLink* aContactLink,
+    MVPbkStoreContact* aContact,
+    MPhCntContactManager& aContactManager ) 
+    {
+    CPhCntContactFieldsResolver* self = 
+        new( ELeave ) CPhCntContactFieldsResolver(
+            aContactLink,
+            aContact,
+            aContactManager );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhCntContactFieldsResolver::~CPhCntContactFieldsResolver()
+    {
+    delete iContact;
+    delete iContactLink;
+    delete iAllDtmfNumbers;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+//
+MVPbkContactLink* CPhCntContactFieldsResolver::ContactLink() const 
+    {   
+    return iContactLink;
+    }
+  
+// ---------------------------------------------------------------------------
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+// 
+MPhCntMatch::TNumberType
+    CPhCntContactFieldsResolver::NumberType() const   
+    {
+    return iPhoneNumberResolver.Number().Type();
+    }    
+
+// ---------------------------------------------------------------------------
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+//
+TPtrC CPhCntContactFieldsResolver::FirstName() const 
+    {
+    return iFirstNameResolver.Data();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+//
+TPtrC CPhCntContactFieldsResolver::LastName() const 
+    {
+    return iLastNameResolver.Data();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+//
+TPtrC CPhCntContactFieldsResolver::CompanyName() const 
+    {
+    return iCompanyNameResolver.Data();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+//
+TPtrC CPhCntContactFieldsResolver::Number() const
+    {
+    return iPhoneNumberResolver.Number().Number();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+//   
+TPtrC CPhCntContactFieldsResolver::Dtmf() const
+    {
+    return iDtmfResolver.Data();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+//
+TPtrC CPhCntContactFieldsResolver::PersonalRingingTone() const 
+    {
+    return iRingingToneResolver.Data();
+    }
+    
+// ---------------------------------------------------------------------------
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+//
+TPtrC CPhCntContactFieldsResolver::SecondName() const
+    {
+    return iSecondNameResolver.Data();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+//
+TPtrC CPhCntContactFieldsResolver::FirstNamePronunciation() const
+    {
+    return iFirstNamePronunciationResolver.Data();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+//     
+TPtrC CPhCntContactFieldsResolver::LastNamePronunciation() const
+    {
+    return iLastNamePronunciationResolver.Data();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+//    
+TPtrC CPhCntContactFieldsResolver::CompanyNamePronunciation() const
+    {
+    return iCompanyNamePronunciationResolver.Data();
+    }
+    
+// ---------------------------------------------------------------------------
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+//
+HBufC* CPhCntContactFieldsResolver::GetContactTitleL()
+    {
+    return iNameFormatter.GetContactTitleOrNullL(
+        iContact->Fields(), 
+        MPbk2ContactNameFormatter::EPreserveLeadingSpaces | 
+        MPbk2ContactNameFormatter::EUseSeparator |
+        MPbk2ContactNameFormatter::EReplaceNonGraphicChars );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+//
+MVPbkContactLinkArray* CPhCntContactFieldsResolver::ContactGroupsLC() const
+    {
+    return iContact->GroupsJoinedLC();
+    }
+ 
+// ---------------------------------------------------------------------------
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+//   
+ MVPbkStoreContact& CPhCntContactFieldsResolver::StoreContact() const
+    {
+    return *iContact;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+//       
+const MVPbkFieldType* CPhCntContactFieldsResolver::ThumbnailField() const
+    {
+    return iThumbnailField;
+    }
+    
+// ---------------------------------------------------------------------------
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+// 
+TPtrC CPhCntContactFieldsResolver::CallImage() const 
+    {
+    return iCallImageResolver.Data();
+    }
+
+// ---------------------------------------------------------------------------    
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+//
+TPtrC CPhCntContactFieldsResolver::CallText() const 
+    {
+    return iCallTextResolver.Data();
+    }
+
+// ---------------------------------------------------------------------------    
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+//
+TBool CPhCntContactFieldsResolver::HasThumbnail() const 
+    {
+    return ( iThumbnailField != NULL );
+    }        
+
+// ---------------------------------------------------------------------------    
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+// 
+const RArray<TPhCntNumber>& CPhCntContactFieldsResolver::AllNumbers() const
+    {
+    return iPhoneNumberResolver.AllNumbers();
+    }
+
+// ---------------------------------------------------------------------------    
+// From class MPhCntContactFields
+// ---------------------------------------------------------------------------
+//        
+CDesCArray* CPhCntContactFieldsResolver::AllDtmfNumbers() const
+    {
+    return iAllDtmfNumbers;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/cphcntcontactlinkarrayfetch.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Base class for contactlink array fetchers.
+*
+*/
+
+
+#include <MVPbkContactLinkArray.h>
+
+#include "cphcntcontactlinkarrayfetch.h"
+#include <talogger.h>
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntContactLinkArrayFetch::CPhCntContactLinkArrayFetch()
+    {
+
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhCntContactLinkArrayFetch::~CPhCntContactLinkArrayFetch()
+    {
+    delete iFetchedContactLinks;
+    }
+    
+// ---------------------------------------------------------------------------
+// Secondphase constructor.
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactLinkArrayFetch::BaseConstructL() 
+    {
+    CPhCntAsyncToSync::BaseConstructL();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MVPbkContactFindObserver
+// Notifies the base class that response from asynchronous request
+// has been received succesfully.
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactLinkArrayFetch::FindCompleteL( MVPbkContactLinkArray* aResults )
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPhCntContactLinkArrayFetch::FindCompleteL" );
+    delete iFetchedContactLinks;
+    iFetchedContactLinks = aResults;
+    // Indicate base class that response from fetch has been received.
+    ResponseReceived( KErrNone );
+    }
+    
+// ---------------------------------------------------------------------------
+// From class MVPbkContactFindObserver
+// Notifies the base class that response from asynchronous request
+// has been received succesfully.
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactLinkArrayFetch::FindFailed( TInt aError )
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPhCntContactLinkArrayFetch::FindFailed" );
+    delete iFetchedContactLinks;
+    iFetchedContactLinks = NULL;
+    // Indicate base class that response from fetch has been received.
+    ResponseReceived( aError );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/cphcntcontactmatchstrategy.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,265 @@
+/*
+* 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:  Contact matching strategy
+*
+*/
+
+
+#include <CVPbkContactManager.h>
+#include <centralrepository.h>
+#include <telconfigcrkeys.h>
+#include <CVPbkContactStoreUriArray.h>
+
+#include "cphcntcontactmatchstrategy.h"
+#include "cphcntcontactstoreuris.h"
+#include "CPhoneRawMatchNumberExtractor.h"
+
+// Digit count used to match CS number.
+const TInt KPhCntMatchMin = 7;
+const TInt KPhCntMatchMax = 11;
+const TInt KPhCntMatchDefault = KPhCntMatchMin;
+
+// ======== MEMBER FUNCTIONS ========
+
+
+CPhCntContactMatchStrategy::CPhCntContactMatchStrategy(
+    CVPbkContactManager& aContactManager,
+    CPhCntContactStoreUris& aContactStoreUris,
+    MVPbkContactFindObserver& aObserver,
+    CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aMatchFlag ) :
+    iContactManager( aContactManager ),
+    iContactStoreUris( aContactStoreUris ),
+    iObserver( aObserver ),
+    iMatchFlag( aMatchFlag )
+    {
+    iContactStoreUris.SetObserver( *this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactMatchStrategy::ConstructL()
+    {
+    iCenRepSession = CRepository::NewL( KCRUidTelConfiguration );
+    iCenRepNotifyHandler = 
+        CCenRepNotifyHandler::NewL(
+            *this, 
+            *iCenRepSession, 
+            CCenRepNotifyHandler::EIntKey,
+            KTelMatchDigits );
+            
+    iCenRepNotifyHandler->StartListeningL();
+    
+    iNumberOfDigits = KPhCntMatchDefault;
+    TInt sdMatchValue = KErrNotFound;
+
+    // Find digit count to be used with matching.
+    if ( iCenRepSession->Get( KTelMatchDigits, sdMatchValue )
+         == KErrNone )
+        {
+        // If we can find a proper value from the cenrep, use it.
+        if ( sdMatchValue >= KPhCntMatchMin && sdMatchValue <= KPhCntMatchMax )
+            {
+            iNumberOfDigits = sdMatchValue;
+            }
+        }
+    User::LeaveIfError( CreateContactMatchStrategy() );
+    
+    iNumberExtractor = new( ELeave )CCntRawPhoneNumberExtractor();
+    iNumberExtractor->ConstructL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// Static constructor.
+// ---------------------------------------------------------------------------
+//
+CPhCntContactMatchStrategy* CPhCntContactMatchStrategy::NewL(
+    CVPbkContactManager& aContactManager,
+    CPhCntContactStoreUris& aContactStoreUris,
+    MVPbkContactFindObserver& aObserver,
+    CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aMatchFlag )
+    {
+    CPhCntContactMatchStrategy* self = 
+        new( ELeave ) CPhCntContactMatchStrategy( 
+            aContactManager,
+            aContactStoreUris, 
+            aObserver,
+            aMatchFlag );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CPhCntContactMatchStrategy::~CPhCntContactMatchStrategy()
+    {
+    if( iNumberExtractor )
+        {
+        iNumberExtractor->Release();    
+        }
+    
+    if( iCenRepNotifyHandler )
+        {
+        iCenRepNotifyHandler->StopListening();    
+        }
+    delete iCenRepNotifyHandler;
+    delete iCenRepSession;
+    delete iMatchStrategy;
+    delete iUriArray;
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntContactMatchStrategy
+// Starts to find contacts which has aPhoneNumber.
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactMatchStrategy::FindMatchesL( const TDesC& aPhoneNumber )
+    {
+    if( iMatchStrategy )
+        {
+        MatchL( aPhoneNumber );
+        }
+    else
+        {
+        const TInt err( CreateContactMatchStrategy() );
+        if( !err )
+            {
+            MatchL( aPhoneNumber );
+            }
+        else
+            {
+            User::Leave( KErrNotFound );            
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Creates contact match strategy and destroys the old one.
+// ---------------------------------------------------------------------------
+//    
+TInt CPhCntContactMatchStrategy::CreateContactMatchStrategy()
+    {
+    TInt err = KErrNone;
+    if( !iUriArray )
+        {
+        TRAP( err, iUriArray = iContactStoreUris.ActiveContactStoresL() );
+        }
+    
+    if( iUriArray )
+        {
+        delete iMatchStrategy;
+        iMatchStrategy = NULL;
+        err = DoCreateMatchStrategy();
+         
+        }
+    else
+        {
+        err = KErrGeneral;
+        }
+    
+    return err;                
+    }
+
+// ---------------------------------------------------------------------------
+// From base class MCenRepNotifyHandlerCallback
+// Notification from CenRep
+// ---------------------------------------------------------------------------
+//  
+void CPhCntContactMatchStrategy::HandleNotifyString( 
+    TUint32 aUid, 
+    const TDesC16& aValue )
+    {
+    if ( aUid == KTelMatchDigits )
+        {
+        TLex lexer( aValue );
+        TInt value;
+        const TInt err( lexer.Val( value ) );
+        
+        if( !err ) 
+            {
+            if ( value < KPhCntMatchMin || value > KPhCntMatchMax )
+                {
+                iNumberOfDigits = KPhCntMatchDefault;
+                }
+            else
+                {
+                iNumberOfDigits = value;
+                }
+            CreateContactMatchStrategy();
+            }
+     
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From base class MPhCntContactStoreEventObserver
+// Updates match strategy.
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactMatchStrategy::ContactStoreAvailabilityChanged()
+    {
+    delete iUriArray;
+    iUriArray = NULL;
+    CreateContactMatchStrategy();
+    }
+
+// ---------------------------------------------------------------------------
+// Removes extra characters from number and matches with raw number.
+// ---------------------------------------------------------------------------
+//         
+void CPhCntContactMatchStrategy::MatchL( 
+    const TDesC& aPhoneNumber )
+    {
+    HBufC* rawNumber = HBufC::NewLC( aPhoneNumber.Length() );
+    TPtr rawNumberPtr = rawNumber->Des();
+    iNumberExtractor->ExtractRawNumber( aPhoneNumber, rawNumberPtr );
+    DoMatchL( *rawNumber );
+    CleanupStack::PopAndDestroy( rawNumber );
+    }
+
+// ---------------------------------------------------------------------------
+// Creates contact match strategy
+// ---------------------------------------------------------------------------
+//     
+TInt CPhCntContactMatchStrategy::DoCreateMatchStrategy()
+    {
+    CVPbkPhoneNumberMatchStrategy::TConfig config( 
+            iNumberOfDigits,
+            *iUriArray,
+            CVPbkPhoneNumberMatchStrategy::EVPbkSequentialMatch, 
+            iMatchFlag
+            );
+    TRAPD( err, iMatchStrategy = CVPbkPhoneNumberMatchStrategy::NewL( 
+                    config, 
+                    iContactManager, 
+                    iObserver ) );       
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Makes the actual matching request.
+// ---------------------------------------------------------------------------
+//     
+void CPhCntContactMatchStrategy::DoMatchL( 
+    const TDesC& aNumber )
+    {
+    iMatchStrategy->MatchL( aNumber );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/cphcntcontactstoreuris.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,346 @@
+/*
+* 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:  Contact store Uris
+*
+*/
+
+#include <CVPbkContactStoreUriArray.h>
+#include <VPbkContactStoreUris.h>
+#include <TVPbkContactStoreUriPtr.h>
+#include <centralrepository.h>
+#include <talogger.h>
+
+#include "telinternalcrkeys.h"
+#include "cphcntcontactstoreuris.h"
+#include "mphcntcontactstoreeventobserver.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntContactStoreUris* CPhCntContactStoreUris::NewL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPhCntContactStoreUris::NewL" );
+    CPhCntContactStoreUris* self = new( ELeave ) CPhCntContactStoreUris;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhCntContactStoreUris::~CPhCntContactStoreUris()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPhCntContactStoreUris::~CPhCntContactStoreUris" );
+    delete iContactStoreUriArray;
+    delete iAdditionalContactStoreUriArray;    
+    iContactStoreStates.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// Contact store uris
+// ---------------------------------------------------------------------------
+//
+CVPbkContactStoreUriArray& CPhCntContactStoreUris::ContactStores() const
+    {
+    return *iContactStoreUriArray;
+    }
+    
+// ---------------------------------------------------------------------------
+// Currently active contact stores.
+// ---------------------------------------------------------------------------
+//
+CVPbkContactStoreUriArray* CPhCntContactStoreUris::ActiveContactStoresL() const
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPhCntContactStoreUris::ActiveContactStoresL" );
+    CVPbkContactStoreUriArray* array = CVPbkContactStoreUriArray::NewLC();
+    const TInt count( iContactStoreStates.Count() );
+    for( TInt i = 0; i < count; i++ )
+        {
+        const TPhCntContactStoreState& storeState = iContactStoreStates[i];
+        if( storeState.IsAvailable() )
+            {
+            TEFLOGSTRING2( KTAOBJECT,
+                    "CNT CPhCntContactStoreUris::ActiveContactStoresL - Append store: %S", 
+                    &storeState.ContactStoreUri().UriDes() );
+            array->AppendL( storeState.ContactStoreUri() );
+            }
+        }
+    CleanupStack::Pop( array );
+    return array;
+    }
+
+// ---------------------------------------------------------------------------
+// Updates store availability
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactStoreUris::StoreReady( 
+    TVPbkContactStoreUriPtr& aContactStoreUri )
+    {
+    TEFLOGSTRING2( KTAOBJECT, "CNT CPhCntContactStoreUris::StoreReady = %S", 
+                &aContactStoreUri.UriDes() );
+    SetContactStoreAvailability( aContactStoreUri, ETrue );
+    }
+
+// ---------------------------------------------------------------------------
+// Updates store availability
+// ---------------------------------------------------------------------------
+//    
+void CPhCntContactStoreUris::StoreUnavailable( 
+    TVPbkContactStoreUriPtr& aContactStoreUri )
+    {
+    TEFLOGSTRING2( KTAOBJECT, "CNT CPhCntContactStoreUris::StoreUnavailable = %S", 
+            &aContactStoreUri.UriDes() );
+    SetContactStoreAvailability( aContactStoreUri, EFalse );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets observer
+// ---------------------------------------------------------------------------
+//     
+void CPhCntContactStoreUris::SetObserver( 
+    MPhCntContactStoreEventObserver& aObserver )
+    {
+    iObserver = &aObserver;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntContactStoreUris::CPhCntContactStoreUris()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactStoreUris::ConstructL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPhCntContactStoreUris::ConstructL" );
+    iAdditionalContactStoreUriArray = CVPbkContactStoreUriArray::NewL();
+        
+    // Read additional, product configured contact stores.
+    HBufC* productSpecificList = HBufC::NewLC( 
+        NCentralRepositoryConstants::KMaxUnicodeStringLength );
+    TPtr productSpecificListPtr( productSpecificList->Des() );
+    ReadAdditionalContactStoreL( &productSpecificListPtr );
+    
+    // Append additional stores to contact store array
+    TInt count( iAdditionalContactStoreUriArray->Count() );       
+    for( TInt i = 0; i < count; i++ )
+        {
+        iContactStoreStates.AppendL( (*iAdditionalContactStoreUriArray)[i] );
+        }            
+    
+    iContactStoreStates.AppendL( 
+        TVPbkContactStoreUriPtr( 
+            VPbkContactStoreUris::DefaultCntDbUri() ) );
+    iContactStoreStates.AppendL( 
+        TVPbkContactStoreUriPtr( 
+            VPbkContactStoreUris::SimGlobalOwnNumberUri() ) );
+    iContactStoreStates.AppendL( 
+        TVPbkContactStoreUriPtr( 
+            VPbkContactStoreUris::SimGlobalAdnUri() ) );
+    iContactStoreStates.AppendL( 
+        TVPbkContactStoreUriPtr( 
+            VPbkContactStoreUris::SimGlobalFdnUri() ) );
+    iContactStoreStates.AppendL( 
+        TVPbkContactStoreUriPtr( 
+            VPbkContactStoreUris::SimGlobalSdnUri() ) );
+            
+    const TInt count_2( iContactStoreStates.Count() );
+    iContactStoreUriArray = CVPbkContactStoreUriArray::NewL();
+    for( TInt i = 0; i < count_2; i++ )
+        {
+        TEFLOGSTRING3( KTAOBJECT, 
+                "CNT CPhCntContactStoreUris::ConstructL - Append store  = %S, Available: %d", 
+                &iContactStoreStates[i].ContactStoreUri().UriDes(),
+                iContactStoreStates[i].IsAvailable() );
+        iContactStoreUriArray->AppendL( iContactStoreStates[i].ContactStoreUri() );
+        }
+    CleanupStack::PopAndDestroy( productSpecificList );                    
+    }
+
+// ---------------------------------------------------------------------------
+// Sets contact stores availability
+// ---------------------------------------------------------------------------
+//    
+void CPhCntContactStoreUris::SetContactStoreAvailability( 
+        TVPbkContactStoreUriPtr& aStoreUri, 
+        TBool aIsAvailable )
+    {
+    TEFLOGSTRING( KTAOBJECT, "CPhCntContactStoreUris::SetContactStoreAvailability" );
+    const TInt count( iContactStoreStates.Count() );
+    for( TInt i = 0; i < count; i++ )
+        {
+        TPhCntContactStoreState& storeState = iContactStoreStates[i];
+        if( storeState.ContactStoreUri().Compare( 
+            aStoreUri, 
+            TVPbkContactStoreUriPtr::EContactStoreUriAllComponents ) 
+            == KErrNone ) 
+            {
+            TEFLOGSTRING2( KTAOBJECT, "SetAvailability: %d", aIsAvailable );
+            storeState.SetAvailability( aIsAvailable );
+            }
+        }
+    if( iObserver )
+        {
+        iObserver->ContactStoreAvailabilityChanged();
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Read list of additional contact stores from cenrep
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactStoreUris::ReadAdditionalContactStoreL( TDes* aProductSpecificList )
+    {
+    // Read The product specific VPBK stores from cenrep
+    CRepository* repository = CRepository::NewLC( KCRUidTelVariation );
+    
+    TInt err( KErrNone );        
+    err = repository->Get( KTelAdditionalStores, *aProductSpecificList );
+
+    if ( err == KErrNone && aProductSpecificList->Length() )
+        {
+        ParseStoresL( *aProductSpecificList );
+        } // if ( err == KErrNone && product...    
+     CleanupStack::PopAndDestroy( repository );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Adds contact store.
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactStoreUris::AddContactStoreL( 
+        const TVPbkContactStoreUriPtr& aContactStoreUri )
+    {
+    TPhCntContactStoreState candidate 
+        = TPhCntContactStoreState( aContactStoreUri );
+    
+    TInt index = iContactStoreStates.Find( candidate, MatchUris );
+    if ( KErrNotFound == index )
+        {
+        iContactStoreStates.AppendL( candidate );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Removes contact store.
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactStoreUris::RemoveContactStore( 
+        const TVPbkContactStoreUriPtr& aContactStoreUri )
+    {
+    TPhCntContactStoreState candidate 
+        = TPhCntContactStoreState( aContactStoreUri );
+    
+    TInt index = iContactStoreStates.Find( candidate, MatchUris );
+    if ( KErrNotFound != index )
+        {
+        iContactStoreStates.Remove( index );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Parses store names from comma separated list.
+// ---------------------------------------------------------------------------
+//
+void CPhCntContactStoreUris::ParseStoresL( const TDesC& aProductSpecificList )
+    {
+    const TChar KStoreSeparatorComma = ',';
+    TChar chr;
+    TLex storeToken ( aProductSpecificList );        
+    HBufC* db;
+    
+    while ( !storeToken.Eos() )
+        {
+        // Skip spaces 
+        // e.g. "  store1,store2"
+        storeToken.SkipSpaceAndMark();  
+
+        // if several commas in row, skip them all.
+        while ( storeToken.Peek() == KStoreSeparatorComma )
+            {
+            // e.g. ",,store1,store2"
+            storeToken.SkipAndMark(1);
+            // Or ",[space],,"
+            storeToken.SkipSpaceAndMark();
+            }
+
+        // Loop until ',' or eof to parse next store
+        do 
+            {
+            chr = storeToken.Get();
+            }
+            while ( chr != KStoreSeparatorComma && !storeToken.Eos() );
+
+        if ( !storeToken.Eos()  )
+            {
+            // Reverse not to include comma.
+            storeToken.UnGet();
+            }
+
+        if ( storeToken.TokenLength() )
+            {
+            // Append to parsed stores array, so that visibility of
+            // all additional DB URIs is maintained.
+            db = HBufC::NewLC( storeToken.TokenLength() );            
+            db->Des().Copy( storeToken.MarkedToken() ); 
+            
+            // Append to additional store array.
+            iAdditionalContactStoreUriArray->AppendL( TVPbkContactStoreUriPtr( *db ) );
+            CleanupStack::PopAndDestroy( db );  
+            //CleanupStack::Pop( db );                      
+            }
+
+        } // while ( !storeToken.Eos() )..        
+    }
+
+// ---------------------------------------------------------------------------
+// Additional Contact store uris
+// ---------------------------------------------------------------------------
+//
+const CVPbkContactStoreUriArray& CPhCntContactStoreUris::AdditionalContactStores() const
+    {
+    return *iAdditionalContactStoreUriArray;
+    }    
+
+// ---------------------------------------------------------------------------
+// Implements TIdentityRelation for class TPhCntContactStoreState.
+// ---------------------------------------------------------------------------
+//
+TBool CPhCntContactStoreUris::MatchUris( 
+        const TPhCntContactStoreState& aState1,
+        const TPhCntContactStoreState& aState2 )
+    {
+    TVPbkContactStoreUriPtr uri1( aState1.ContactStoreUri() );
+    TVPbkContactStoreUriPtr uri2( aState2.ContactStoreUri() );
+    
+    return ( 
+        uri1.Compare( uri2, 
+            TVPbkContactStoreUriPtr::EContactStoreUriAllComponents ) 
+                == 0 );
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/cphcntfetchcontact.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Fetches contact
+*
+*/
+
+
+#include "cphcntfetchcontact.h"
+#include "MPhCntContactStores.h"
+#include "MVPbkContactLink.h"
+#include <CVPbkContactLinkArray.h>
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntFetchContact::CPhCntFetchContact( 
+    MPhCntContactStores& aContactStores ) :
+    iContactStores( aContactStores )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhCntFetchContact::ConstructL()
+    {
+    BaseConstructL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntFetchContact* CPhCntFetchContact::NewL(
+    MPhCntContactStores& aContactStores )
+    {
+    CPhCntFetchContact* self = CPhCntFetchContact::NewLC( aContactStores );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntFetchContact* CPhCntFetchContact::NewLC( 
+    MPhCntContactStores& aContactStores )
+    {
+    CPhCntFetchContact* self = 
+        new( ELeave ) CPhCntFetchContact( aContactStores );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CPhCntFetchContact::~CPhCntFetchContact()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Starts fetching the contact.
+// ---------------------------------------------------------------------------
+//
+TInt CPhCntFetchContact::FetchContact( 
+    const MVPbkContactLink& aContactLink,
+    CPhCntContact*& aContact )
+    {
+    iContactLink = &aContactLink;
+     // Converts asynchronous request to synchronous.
+    const TInt error( MakeAsyncRequest() );
+    if( !error )
+        {
+        aContact = iReceivedContact;
+        iReceivedContact = NULL;
+        }
+    iContactLink = NULL;
+    
+    return error;
+    }
+
+// ---------------------------------------------------------------------------
+// Starts fetching the first contact.
+// ---------------------------------------------------------------------------
+//    
+TInt CPhCntFetchContact::FetchContact( 
+    const TDesC8& aContactLinkArray, 
+    CPhCntContact*& aContact )
+    {
+    CVPbkContactLinkArray* contactLinkArray = NULL;
+    TRAPD( err, 
+        contactLinkArray = 
+            iContactStores.CreateContactLinkArrayL( aContactLinkArray ) );  
+    
+    if( !err )
+        {
+        if( contactLinkArray && contactLinkArray->Count() > 0 )
+            {
+            const MVPbkContactLink& contactLink = contactLinkArray->At( 0 );
+            err = FetchContact( contactLink, aContact );
+            }     
+        else 
+            {
+            err = KErrNotFound;
+            }
+        delete contactLinkArray;
+        }
+ 
+    
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// From class CPhCntAsyncToSync
+// Fetches the contact from contact stores.
+// ---------------------------------------------------------------------------
+//
+void CPhCntFetchContact::DoMakeAsyncRequestL()
+    {
+    iContactStores.FetchContactL( *iContactLink, *this );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPhCntContactFetchObserver
+// Takes the contact and notifies base class that contact has been received.
+// ---------------------------------------------------------------------------
+//
+ void CPhCntFetchContact::ContactReceived( 
+    CPhCntContact* aContact, 
+    TInt aError )
+    {
+    iReceivedContact = aContact;    
+    ResponseReceived( aError ); // Indicate that asynchronous operation is complete.
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/cphcntfoundcontacts.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,173 @@
+/*
+* 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:  Stores found contacts and keeps track of the references.
+*
+*/
+
+
+#include <MVPbkContactLink.h>
+
+#include "cphcntfoundcontacts.h"
+#include "CPhCntContact.h"
+#include <talogger.h>
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntFoundContacts::CPhCntFoundContacts() 
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Secondphase constructor.
+// ---------------------------------------------------------------------------
+//
+void CPhCntFoundContacts::ConstructL()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntFoundContacts* CPhCntFoundContacts::NewL()
+    {
+    CPhCntFoundContacts* self = CPhCntFoundContacts::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntFoundContacts* CPhCntFoundContacts::NewLC()
+    {
+    CPhCntFoundContacts* self = new( ELeave ) CPhCntFoundContacts;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhCntFoundContacts::~CPhCntFoundContacts()
+    {
+    iFoundContacts.ResetAndDestroy();
+    }
+
+// ---------------------------------------------------------------------------
+// Adds contact-
+// ---------------------------------------------------------------------------
+//
+void CPhCntFoundContacts::AddL( 
+    CPhCntContact* aContact,
+    const TDesC& aMatchingNumber )
+    {
+    aContact->SetOriginalNumberL( aMatchingNumber );
+    iFoundContacts.AppendL( aContact );
+    aContact->SetOwner( this );
+    // There is already reference to aContact, because it is added.
+    aContact->IncreaseReferenceCount();
+    }
+    
+// ---------------------------------------------------------------------------
+// Removes contact from array and deletes the contact.
+// ---------------------------------------------------------------------------
+//
+void CPhCntFoundContacts::Remove( CPhCntContact* aContact )
+    {
+    const TInt errorOrIndex( iFoundContacts.Find( aContact ) );
+    if( errorOrIndex >= 0 ) 
+        {
+        iFoundContacts.Remove( errorOrIndex );
+        }
+    delete aContact;
+    }
+    
+// ---------------------------------------------------------------------------
+// Finds contact, which number is same as aTelNumber
+// ---------------------------------------------------------------------------
+//
+CPhCntContact* CPhCntFoundContacts::FindContact( const TDesC& aTelNumber )
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPhCntFoundContacts::FindContact" );
+    const TInt foundContactCount( iFoundContacts.Count() );
+    CPhCntContact* foundContact = NULL;
+    for( TInt i = 0; i < foundContactCount && !foundContact; i++ )
+        {
+        CPhCntContact* contact = iFoundContacts[i];
+        if( aTelNumber.Compare( contact->OriginalNumber() ) == KErrNone )
+            {
+            foundContact = contact;
+            foundContact->IncreaseReferenceCount();
+            }
+        }
+    return foundContact;
+    }
+    
+// ---------------------------------------------------------------------------
+// Finds contact, which number and contact link are same.
+// ---------------------------------------------------------------------------
+//
+CPhCntContact* CPhCntFoundContacts::FindContact( 
+    const TDesC& aTelNumber,
+    const MVPbkContactLink& aContactLink )
+    {
+    CPhCntContact* foundContact = FindContact( aContactLink );
+    if( foundContact )
+        {
+        if( aTelNumber.Compare( foundContact->OriginalNumber() ) != KErrNone )
+            {
+            // contact did not match with the number, so release.
+            foundContact->Release();
+            foundContact = NULL;
+            }
+        }
+    return foundContact;
+    }
+
+// ---------------------------------------------------------------------------
+// Finds contact, which contact link matches with aContactLink
+// ---------------------------------------------------------------------------
+//    
+CPhCntContact* CPhCntFoundContacts::FindContact(
+    const MVPbkContactLink& aContactLink )
+    {
+    const TInt foundContactCount( iFoundContacts.Count() );
+    CPhCntContact* foundContact = NULL;
+    for( TInt i = 0; i < foundContactCount && !foundContact; i++ )
+        {
+        CPhCntContact* contact = iFoundContacts[i];
+        if( aContactLink.IsSame( *contact->ContactLink() ) )
+            {
+            foundContact = contact;
+            foundContact->IncreaseReferenceCount();
+            }
+        }
+    return foundContact;
+    }
+
+    
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/cphcntmatchcontact.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,130 @@
+/*
+* 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:  Matches contact
+*
+*/
+
+#include <talogger.h>
+
+#include <MVPbkContactLinkArray.h>
+
+#include "cphcntmatchcontact.h"
+#include "mphcntcontactmatchstrategy.h"
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntMatchContact::CPhCntMatchContact( )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Secondphase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhCntMatchContact::ConstructL()
+    {
+    BaseConstructL();
+    }
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntMatchContact* CPhCntMatchContact::NewL()
+    {
+    CPhCntMatchContact* self = CPhCntMatchContact::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntMatchContact* CPhCntMatchContact::NewLC()
+    {
+    CPhCntMatchContact* self = new( ELeave ) CPhCntMatchContact;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhCntMatchContact::~CPhCntMatchContact()
+    {
+    }
+ 
+
+// ---------------------------------------------------------------------------
+// Matches the contact.
+// ---------------------------------------------------------------------------
+//
+TInt CPhCntMatchContact::MatchContact( 
+    const MVPbkContactLinkArray*& aContactLinkArray, 
+    const TDesC& aTelNumber,
+    MPhCntContactMatchStrategy& aMatchStrategy )
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPhCntMatchContact::MatchContact" );
+    
+    iMatchStrategy = &aMatchStrategy;
+    iPhoneNumber.Set( aTelNumber );
+    TInt error = MakeAsyncRequest();
+    
+    if( !error )
+        {
+        if( iFetchedContactLinks )        
+            {
+            const TInt numberOfFoundContactLinks( 
+                iFetchedContactLinks->Count() );
+            if( numberOfFoundContactLinks == 0 )
+                {
+                error = KErrNotFound;
+                }
+            else 
+                {
+                aContactLinkArray = iFetchedContactLinks;                
+                }
+            }
+        else
+            {
+            error = KErrNotFound;
+            }
+        }
+    
+    if( error )
+        {
+        delete iFetchedContactLinks;
+        iFetchedContactLinks = NULL;
+        }
+        
+    return error;
+    }
+    
+// ---------------------------------------------------------------------------
+// From class CPhCntAsynctToSync.
+// Makes the asynchronous request to find matches for phone number.
+// ---------------------------------------------------------------------------
+//
+void CPhCntMatchContact::DoMakeAsyncRequestL()
+    {
+    iMatchStrategy->FindMatchesL( iPhoneNumber );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/cphcntmatchervoipimpl.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,359 @@
+/*
+* 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:  Implements VoIP specific matching methods.
+*
+*/
+
+
+#include <MVPbkContactLinkArray.h>
+#include <TVPbkContactStoreUriPtr.h>
+#include <MVPbkContactStore.h>
+#include <MVPbkContactStoreProperties.h>
+
+#include "cphcntmatchervoipimpl.h"
+#include "tphcntsipuri.h"
+#include "cphcntfoundcontacts.h"
+#include "cphcntmatchcontact.h"
+#include "cphcntvoipcontactmatchstrategy.h"
+#include "tphcntvoipmatchArray.h"
+#include "MPhCntMatch.h"
+#include "CPhCntContact.h"
+#include "cphcntvpbkcontactid.h"
+#include "cphcntfetchcontact.h"
+#include "CPhCntContactManager.h"
+
+#include "cphcntstoreloaderimpl.h" //
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntMatcherVoIPImpl* CPhCntMatcherVoIPImpl::NewL(
+    const MPhoneCntPbkOwner& aOwner )
+    {
+    CPhCntMatcherVoIPImpl* self = 
+        new( ELeave ) CPhCntMatcherVoIPImpl( aOwner );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhCntMatcherVoIPImpl::~CPhCntMatcherVoIPImpl()
+    {
+    delete iVoipMatchStrategy;
+    delete iContactStoreLoader;
+    }
+    
+// ---------------------------------------------------------------------------
+// From class CPhCntMatcher
+// Matches voip contacts
+// ---------------------------------------------------------------------------
+//    
+TInt CPhCntMatcherVoIPImpl::MatchVoipNumber(
+    MPhCntMatch*& aMatch,
+    const TDesC& aMatchString,
+    TBool aAllowUserNameMatch,
+    MDesCArray* aContactStoreUris,
+    TInt aCharsForMatching )
+    {    
+    TPhCntSipURI sipUri( aMatchString, aCharsForMatching );
+    TInt err = CreateMatcher();    
+
+    if ( err == KErrNone )
+    {
+    CPhCntContact* existingContact = 
+        iFoundContacts->FindContact( sipUri.SipURI() );
+    if( !existingContact )
+        {
+        // Check for service specific contact stores and
+        // open stores if not open
+        if ( aContactStoreUris )
+            {
+            TInt storeCount = aContactStoreUris->MdcaCount();
+            for( TInt i = 0; i < storeCount ; i++ )
+                {
+                TPtrC storeUri = aContactStoreUris->MdcaPoint( i );
+               
+                err = iContactStoreLoader->LoadContactStoreWithUri( storeUri );              
+                }  
+            }
+
+        const MVPbkContactLinkArray* linkArray = NULL;
+        
+        // Find possible contacts.
+        if( aAllowUserNameMatch && !aCharsForMatching )
+            {
+            err = iMatchContact->MatchContact(
+                linkArray, sipUri.UserNamePart(), *iVoipMatchStrategy );
+            }
+        else if ( aCharsForMatching )
+            {
+            err = iMatchContact->MatchContact(
+                linkArray, sipUri.FixedUserNamePart(), *iVoipMatchStrategy );            
+            }
+        else
+            {
+            err = iMatchContact->MatchContact( 
+                linkArray, sipUri.SipURI() , *iVoipMatchStrategy );    
+            }
+        
+            
+        MPhCntMatch* match = NULL;
+        if( !err )
+            {
+            // Fetch all the matched contacts, because iVoipMatchStrategy
+            // could give us a match that is matched to wrong contact field.
+            const TInt matchedContacts( linkArray->Count() );
+
+            // Find real matches.
+            TPhCntVoipMatchArray voipMatches;
+            for( TInt i = 0; i < matchedContacts; i++ )
+                {
+                // Get contacts from phone book.
+                CPhCntContact* match = NULL;
+                err = FetchContact( match, linkArray->At( i ), sipUri.SipURI() );
+                if( !err )
+                    {
+                    TRAP_IGNORE( voipMatches.AppendL( match ) );
+                    }
+                else
+                    {
+                    // Error in fetching contacts 
+                    break;
+                    }
+                }
+                
+            if( aAllowUserNameMatch || aCharsForMatching )   
+                {
+                match = voipMatches.FindFullOrUsernameMatch( sipUri, aCharsForMatching );
+                }
+            else
+                {
+                // Take the first match, that is voip contact. Gives NULL if match not found.
+                match = voipMatches.FindFullMatch( sipUri );
+                }
+            
+            // Release extra matches
+            voipMatches.ReleaseMatches();
+            }
+        
+        // If no error and match still null pointer, then no contacts were found.
+        if( !err && !match )        
+            {
+            err = KErrNotFound;
+            }
+        else
+            {
+            aMatch = match;
+            }
+        }
+    else
+        {
+        aMatch = existingContact;
+        }
+    }
+
+    return err;
+    }
+    
+// ---------------------------------------------------------------------------
+// From class CPhCntMatcher
+// Matches voip contacts
+// ---------------------------------------------------------------------------
+TInt CPhCntMatcherVoIPImpl::MatchVoipNumber(
+            MPhCntMatch*& aMatch,
+            const CPhCntContactId& aContactId )
+    {
+    const CPhCntVPbkContactId& contactId = 
+            static_cast<const CPhCntVPbkContactId&>( aContactId );
+            
+    const MVPbkContactLink& contactLink = contactId.ContactLink();
+    
+    
+    TInt err = CreateMatcher();    
+
+    const TVPbkContactStoreUriPtr uri 
+        = contactLink.ContactStore().StoreProperties().Uri(); 
+
+    // Open contact store if not opened earlier
+    iContactStoreLoader->LoadContactStoreWithUri( uri.UriDes() );
+    
+    if ( err == KErrNone )
+    {
+    CPhCntContact* existingContact = 
+        iFoundContacts->FindContact( contactLink );
+     
+    
+    if( !existingContact )
+        {
+        CPhCntContact* contact = NULL;
+        err = iFetchContact->FetchContact( contactLink,  contact );
+
+        if( !err )
+            {
+            const RArray<TPhCntNumber>& allNumbers = 
+                contact->AllNumbers();
+            const TInt count( allNumbers.Count() );
+            for( TInt i = 0; i < count; i++ )
+                {
+                // Take first voip number and set it as contacts number.
+                TPhCntNumber number = allNumbers[i];
+                if( number.Type() == MPhCntMatch::EVoipNumber ||
+                    number.Type() == MPhCntMatch::EMobileNumber ||
+                    number.Type() == MPhCntMatch::EStandardNumber ||
+                    number.Type() == CPhCntContact::EPagerNumber ||
+                    number.Type() == CPhCntContact::EVideoNumber ||
+                    number.Type() == CPhCntContact::EAssistantNumber ||
+                    number.Type() == CPhCntContact::EFaxNumber ||
+                    number.Type() == CPhCntContact::ECarNumber ) 
+                    {
+                    contact->SetMatchedVoipNumber( TPhCntSipURI( number.Number() ) );
+                    break;
+                    }
+                }
+            TPhCntSipURI sipUri( contact->Number() );
+            TRAP( err, iFoundContacts->AddL( contact, sipUri.SipURI() ) );
+            if( err )
+                {
+                delete contact;
+                }
+            else
+                {
+                aMatch = contact;
+                }
+         
+            }
+        }
+    else
+        {
+        aMatch = existingContact;
+        }
+    }
+    return err;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class CPhCntMatcher
+// Determines if contact has CS numbers.
+// ---------------------------------------------------------------------------
+//
+TBool CPhCntMatcherVoIPImpl::HasCSNumbers( 
+    const CPhCntContactId& aContactId )
+    {
+    TBool hasCSNumbers = EFalse;
+    const CPhCntVPbkContactId& contactId = 
+            static_cast<const CPhCntVPbkContactId&>( aContactId );
+    
+    if ( CreateMatcher() == KErrNone )
+        {
+            
+    // Check if we have contact already.
+    CPhCntContact* contact = 
+        iFoundContacts->FindContact( contactId.ContactLink() );
+        
+    if( contact ) 
+        {
+        hasCSNumbers = HasCSNumbers( contact );
+        contact->Release();
+        }
+    else
+        {
+        // Fetch the contact from Virtual phonebook.
+        const TInt err = 
+            iFetchContact->FetchContact( contactId.ContactLink(), contact );
+        hasCSNumbers = HasCSNumbers( contact );
+        
+        // We can delete the contact, because it is not added to 
+        // iFoundContacts.
+        delete contact;
+        }
+    
+        }
+
+    return hasCSNumbers;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntMatcherVoIPImpl::CPhCntMatcherVoIPImpl(
+    const MPhoneCntPbkOwner& aOwner ) : 
+    CPhCntMatcherImpl( aOwner )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhCntMatcherVoIPImpl::ConstructL()
+    {
+    CPhCntMatcherImpl::ConstructL();
+    iContactStoreLoader = CPhCntStoreLoaderImpl::NewL( iContactManager ); 
+    }
+
+
+// ---------------------------------------------------------------------------
+// Determines if contat has other phone numbers than CS numbers.
+// ---------------------------------------------------------------------------
+//  
+TBool CPhCntMatcherVoIPImpl::HasCSNumbers( 
+    const CPhCntContact* const aContact )
+    {
+    
+    TBool hasCSNumbers = EFalse;
+    if( aContact )
+        {
+        const RArray<TPhCntNumber>& allNumbers = aContact->AllNumbers();
+        const TInt count( allNumbers.Count() );
+        for( TInt i = 0; i < count; i++ )
+            {
+            const MPhCntMatch::TNumberType type = allNumbers[i].Type();
+            if( type != MPhCntMatch::ENone &&
+                type != MPhCntMatch::EFaxNumber &&
+                type != MPhCntMatch::EPagerNumber &&
+                type != MPhCntMatch::EVoipNumber 
+                )
+                {
+                hasCSNumbers = ETrue;
+                }
+            }
+        }
+    return hasCSNumbers;
+    }
+
+TInt CPhCntMatcherVoIPImpl::CreateMatcher()
+    {
+    TInt err = CPhCntMatcherImpl::CreateMatcher();
+    if (!err && !iVoipMatchStrategy )
+        {
+        TRAP( err, iVoipMatchStrategy = 
+            CPhCntVoipContactMatchStrategy::NewL( iContactManager, 
+            *iMatchContact ) );
+        }
+    return err;
+    }
+
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/cphcntphonebookservices.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,355 @@
+/*
+* 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:  Phonebook services wrapper.
+*
+*/
+
+
+#include <MVPbkContactLinkArray.h>
+#include <MVPbkContactLink.h>
+#include "MPhCntContactManager.h"
+#include "cphcntphonebookservices.h"
+#include "tphcntservicerequestparamfactory.h"
+#include "mphcntservicerequestparam.h"
+#include "CPhCntService.h"
+#include "tphcntcontactlinkresult.h"
+#include "cphcntfetchcontact.h"
+#include "CPhCntContact.h"
+#include "cphcntcontactid.h"
+#include "tphcntnullserviceresult.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntPhonebookServices* CPhCntPhonebookServices::NewL(
+    MPhCntContactStores& aContactStores,
+    MPhCntContactManager& aContactManager )
+    {
+    CPhCntPhonebookServices* self = 
+        new( ELeave ) CPhCntPhonebookServices( aContactManager );
+    CleanupStack::PushL( self );
+    self->ConstructL( aContactStores );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhCntPhonebookServices::~CPhCntPhonebookServices()
+    {
+    delete iService;
+    delete iFetchContact;
+    delete iParamFactory;
+    }
+
+// ---------------------------------------------------------------------------
+// Gets user select phonenumber from phonebook.
+// ---------------------------------------------------------------------------
+//
+void CPhCntPhonebookServices::GetUserSelectedPhoneNumberL(
+    CPhCntContactId*& aContactId, 
+    HBufC*& aPhoneNumber )
+    {
+    GetUserSelectedNumberL( aContactId, aPhoneNumber, EFalse );
+    }
+
+// ---------------------------------------------------------------------------
+// Gets user select phonenumber from phonebook.
+// ---------------------------------------------------------------------------
+//
+void CPhCntPhonebookServices::GetUserSelectedVoIPAddressL(
+    CPhCntContactId*& aContactId, 
+    HBufC*& aVoIPAddress )
+    {
+    GetUserSelectedAddressL( aContactId, aVoIPAddress );
+    }
+
+// ---------------------------------------------------------------------------
+// Gets user select dtmf number from phonebook.
+// ---------------------------------------------------------------------------
+//    
+void CPhCntPhonebookServices::GetUserSelectedDtmfNumberL(
+    CPhCntContactId*& aContactId,
+    HBufC*& aDtmfNumber )
+    {
+    GetUserSelectedNumberL( aContactId, aDtmfNumber, ETrue );
+    }
+ 
+// ---------------------------------------------------------------------------
+// Cancels request.
+// ---------------------------------------------------------------------------
+//
+void CPhCntPhonebookServices::CancelRequest()
+    {
+    delete iService;
+    iService = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Creates CPhCntService if needed.
+// ---------------------------------------------------------------------------
+//
+void CPhCntPhonebookServices::CreateCntServiceL()
+    {
+    if ( !iService )
+        {
+        iService = CPhCntService::NewL();
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Creates new contact to phonebook.
+// ---------------------------------------------------------------------------
+//    
+void CPhCntPhonebookServices::CreateNewContactL( 
+    const TDesC& aPhoneNumber )
+    {
+    CreateCntServiceL();
+   
+    MPhCntServiceRequestParam* param = 
+        iParamFactory->CreateCreateNewContactRequestParamLC( aPhoneNumber );
+        
+    TPhCntNullServiceResult noResult;
+    iService->ExecuteRequestL( *param, noResult );
+    
+    CleanupStack::PopAndDestroy( 1 ); // param
+    }
+    
+// ---------------------------------------------------------------------------
+// Updates existing contact from phonebook.
+// ---------------------------------------------------------------------------
+//    
+void CPhCntPhonebookServices::UpdateExistingContactL( 
+    const TDesC& aPhoneNumber )
+    {
+    CreateCntServiceL();
+    MPhCntServiceRequestParam* param = 
+        iParamFactory->CreateUpdateContactRequestParamLC( aPhoneNumber );
+        
+    TPhCntNullServiceResult noResult;
+    iService->ExecuteRequestL( *param, noResult );
+    
+    CleanupStack::PopAndDestroy( 1 ); // param
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntPhonebookServices::CPhCntPhonebookServices(
+    MPhCntContactManager& aContactManager ) : 
+    iContactManager( aContactManager )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhCntPhonebookServices::ConstructL(
+    MPhCntContactStores& aContactStores )
+    {
+    iFetchContact = CPhCntFetchContact::NewL( aContactStores );
+    CreateCntServiceL();
+    iParamFactory = CPhCntServiceRequestParamFactory::NewL( iContactManager );
+    }
+
+// ---------------------------------------------------------------------------
+// Gets contact links
+// ---------------------------------------------------------------------------
+//    
+HBufC8* CPhCntPhonebookServices::GetContactLinksLC(
+    MPhCntServiceRequestParam& aParam )
+    {
+    CreateCntServiceL();
+    HBufC8* linkToContact = NULL;
+    TPhCntContactLinkResult result( linkToContact );
+    iService->ExecuteRequestL( aParam, result );
+    CleanupStack::PushL( linkToContact );
+    return linkToContact;
+    }
+
+// ---------------------------------------------------------------------------
+// Gets contact links and fetches the contact pointed by link
+// ---------------------------------------------------------------------------
+// 
+CPhCntContact* CPhCntPhonebookServices::GetUserSelectedContactLC( 
+    MPhCntServiceRequestParam& aParam )
+    {
+    CPhCntContact* contact = NULL;
+    HBufC8* linkToContact = GetContactLinksLC( aParam );
+    if( linkToContact && linkToContact->Length() > 0 ) 
+        {
+        User::LeaveIfError( 
+            iFetchContact->FetchContact( *linkToContact, contact ) );
+        }
+    else 
+        {
+        User::Leave( KErrNotFound );
+        }
+    CleanupStack::PopAndDestroy( linkToContact );
+    CleanupStack::PushL( contact );
+    return contact;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets result to client.
+// ---------------------------------------------------------------------------
+// 
+void CPhCntPhonebookServices::SetResultsL( 
+    const TDesC& aReceivedNumber, 
+    const CPhCntContactId* const aReceivedContactId,
+    HBufC*& aClientResultNumber,
+    CPhCntContactId*& aClientResultContactId ) const
+    {
+    if( aReceivedNumber.Length() > 0 && aReceivedContactId ) 
+        {
+        HBufC* number = aReceivedNumber.AllocLC();
+        aClientResultContactId = aReceivedContactId->CloneL();
+        aClientResultNumber = number; 
+        CleanupStack::Pop( number ); 
+        }
+    else 
+        {
+        User::Leave( KErrNotFound );
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// Gets user selected number from phonebook.
+// ---------------------------------------------------------------------------
+// 
+void CPhCntPhonebookServices::GetUserSelectedNumberL(
+    CPhCntContactId*& aContactId,
+    HBufC*& aNumber, TBool aDTMFWanted )
+    {
+   
+    MPhCntServiceRequestParam* param = NULL;
+    if( aDTMFWanted )
+        {
+        param = 
+            iParamFactory->CreateGetUserSelectedDtmfNumberLinkLC( 
+                iContactManager );
+        }
+    else
+        {
+        param = iParamFactory->CreateGetUserSelectedPhoneNumberLinkParamLC();
+        }
+        
+    CPhCntContact* contact = GetUserSelectedContactLC( *param );
+        
+    if( contact )
+        {
+        TPtrC number;
+        if( aDTMFWanted )
+            {
+            number.Set( contact->Dtmf() );        
+            }
+        // If dtmf not valid, then use phonenumber        
+        if( number.Length() == 0 )
+            {
+            number.Set( contact->Number() );
+            }
+        SetResultsL( 
+            number, 
+            contact->ContactId(), 
+            aNumber, 
+            aContactId );
+        CleanupStack::PopAndDestroy( contact );
+        }
+    else 
+        {
+        User::Leave( KErrNotFound );
+        }
+    CleanupStack::PopAndDestroy( 1 );  // param
+    }
+
+// ---------------------------------------------------------------------------
+// Gets user selected VoIP Address from phonebook.
+// ---------------------------------------------------------------------------
+// 
+void CPhCntPhonebookServices::GetUserSelectedAddressL(
+    CPhCntContactId*& aContactId,
+    HBufC*& aVoIPAddress )
+    {  
+    MPhCntServiceRequestParam* param = NULL;
+    param = iParamFactory->CreateGetUserSelectedVoIPAddressLinkParamLC(
+                iContactManager );
+ 
+    CPhCntContact* contact = GetUserSelectedContactLC( *param );
+        
+    if( contact )
+        {
+        TPtrC number;
+
+        if( number.Length() == 0 )
+            {
+            number.Set( contact->Number() );
+            }
+        
+        SetResultsL( 
+            number, 
+            contact->ContactId(), 
+            aVoIPAddress, 
+            aContactId );
+        CleanupStack::PopAndDestroy( contact );
+        }
+    else 
+        {
+        User::Leave( KErrNotFound );
+        }
+    CleanupStack::PopAndDestroy( 1 ); // contact
+    }
+
+// ---------------------------------------------------------------------------
+// Gets a phone number for a contact link.
+// ---------------------------------------------------------------------------
+// 
+void CPhCntPhonebookServices::GetPhoneNumberL(
+    const TDesC8& aContactLink, 
+    const CPhCntSingleItemFetch::TCallType aCallType,
+    HBufC*& aNumber,
+    HBufC8*& aFieldLink )    
+	{			
+	// Setup AIW parameters	for a service request		
+	MPhCntServiceRequestParam* param = 
+	    iParamFactory->CreateGetPhoneNumberFromContactParamLC( 
+	        aContactLink, aCallType );
+	// Execute the service request
+	CPhCntContact* contact = GetUserSelectedContactLC( *param );	
+	
+	// If a contact was found
+	if( contact )
+	    {
+	    if( contact->Number().Length() > 0 &&
+	        contact->ContactLink() )
+            {        
+            aNumber = contact->Number().AllocLC();
+            aFieldLink = contact->ContactLink()->PackLC();
+            CleanupStack::Pop( 2, aNumber ); // aNumber & aFieldLink
+            }
+        CleanupStack::PopAndDestroy( contact );
+	    }
+    else 
+        {
+        User::Leave( KErrNotFound );
+        }			
+	CleanupStack::PopAndDestroy( 1 ); // param.	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/cphcntspeeddialcontactlinkfetch.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,134 @@
+/*
+* 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:  Implementation of CPhCntSpeedDialContactL class.
+*
+*/
+
+
+#include "cphcntspeeddialcontactlinkfetch.h"
+#include "MPhCntContactManager.h"
+#include "MVPbkContactLinkArray.h"
+#include "MVPbkContactOperationBase.h"
+
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+CPhCntSpeedDialContactLinkFetch::CPhCntSpeedDialContactLinkFetch(
+    MPhCntContactManager& aContactManager ) :
+    iContactManager( aContactManager )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+void CPhCntSpeedDialContactLinkFetch::ConstructL()
+    {
+    CPhCntContactLinkArrayFetch::BaseConstructL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+CPhCntSpeedDialContactLinkFetch* CPhCntSpeedDialContactLinkFetch::NewL(
+    MPhCntContactManager& aContactManager )
+    {
+    CPhCntSpeedDialContactLinkFetch* self = 
+        CPhCntSpeedDialContactLinkFetch::NewLC( aContactManager );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+CPhCntSpeedDialContactLinkFetch* CPhCntSpeedDialContactLinkFetch::NewLC(
+    MPhCntContactManager& aContactManager )
+    {
+    CPhCntSpeedDialContactLinkFetch* self = 
+        new( ELeave ) CPhCntSpeedDialContactLinkFetch( aContactManager );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+CPhCntSpeedDialContactLinkFetch::~CPhCntSpeedDialContactLinkFetch()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//
+const MVPbkContactLink& CPhCntSpeedDialContactLinkFetch::FetchSpeedDialLinkL( 
+    TInt aSpeedDialPosition )
+    {
+    iSpeedDialPosition = aSpeedDialPosition;
+    TInt error( MakeAsyncRequest() );
+    
+    delete iOperation; 
+    iOperation = NULL;
+    
+    const MVPbkContactLink* contactLink = NULL;
+    if( !error ) 
+        {
+        if( iFetchedContactLinks && iFetchedContactLinks->Count() == 1 )
+            {
+            contactLink = &iFetchedContactLinks->At( 0 );
+            }
+        else
+            {
+            delete iFetchedContactLinks;
+            iFetchedContactLinks = NULL;
+            error = KErrNotFound;
+            }
+        }
+    User::LeaveIfError( error );
+    
+    return *contactLink;
+    }
+
+// ---------------------------------------------------------------------------
+// From CPhCntAsyncToSync
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//
+void CPhCntSpeedDialContactLinkFetch::DoMakeAsyncRequestL()
+    {
+    if( !IsActive() )
+        {
+        iOperation = iContactManager.RetrieveSpeedDialContactLinkL( 
+            iSpeedDialPosition, *this );
+        }
+    else
+        {
+        User::Leave( KErrInUse );
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/cphcntspeeddialimpl.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,362 @@
+/*
+* 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:  Implementation of CPhCntSpeedDialImpl class.
+*
+*/
+
+
+#include <spdiadialogs.h>
+#include <MVPbkContactLink.h>
+#include <PbkFields.hrh>
+#include <avkon.mbg>
+#include <eikimage.h> 
+#include <aknconsts.h>
+
+#include "CPhCntSpeedDialMonitor.h"
+#include "cphcntspeeddialimpl.h"
+#include "cphcntspeeddialcontactlinkfetch.h"
+#include "MPhoneCntPbkOwner.h"
+#include "cphcntfetchcontact.h"
+#include "CPhCntContactStores.h"
+#include "MPhCntContactManager.h"
+#include "CPhCntContact.h"
+#include "cphcntvpbkcontactid.h"
+#include "CPhCntContactManager.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Default constructor.
+// ---------------------------------------------------------------------------
+//
+CPhCntSpeedDialImpl::CPhCntSpeedDialImpl( MPhoneCntPbkOwner& aPbkOwner ) : 
+    iContactManager( *aPbkOwner.ContactManager() ),
+    iPbkOwner( aPbkOwner )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntSpeedDialImpl::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CPhCntSpeedDialImpl::ConstructL()
+    {
+    iSpeedDialContactLinkFetcher = 
+        CPhCntSpeedDialContactLinkFetch::NewL( iContactManager );
+        
+    iContactStores = CPhCntContactStores::NewL( iContactManager );
+        
+    iContactFetcher = CPhCntFetchContact::NewL( *iContactStores );
+    }
+    
+// ---------------------------------------------------------------------------
+//  CPhCntSpeedDialImpl::FetchContact
+// ---------------------------------------------------------------------------
+//
+TInt CPhCntSpeedDialImpl::FetchContact( 
+    TInt aSpeedDialPosition,
+    CPhCntContact*& aContact )
+    {
+    TRAPD( err, 
+        const MVPbkContactLink& linkToSpeedDialContact = 
+            iSpeedDialContactLinkFetcher->FetchSpeedDialLinkL( 
+                aSpeedDialPosition );
+                
+    
+        err = 
+            iContactFetcher->FetchContact( linkToSpeedDialContact, aContact );
+    )
+    return err;
+    }
+    
+// ---------------------------------------------------------------------------
+//  CPhCntSpeedDialImpl::CopyNumberL
+// ---------------------------------------------------------------------------
+//
+void CPhCntSpeedDialImpl::CopyNumberL( 
+    TDes& aCopyTo, 
+    const TDesC& aNumber )
+    {
+    if( aCopyTo.MaxLength() >= aNumber.Length() ) 
+        {
+        aCopyTo.Copy( aNumber );
+        }
+    else
+        {
+        User::Leave( KErrArgument );
+        }
+    }
+// ---------------------------------------------------------------------------
+//  CPhCntSpeedDialImpl::CopyContactInfoToFieldInfoL
+// ---------------------------------------------------------------------------
+//  
+void CPhCntSpeedDialImpl::CopyContactInfoToFieldInfoL( 
+        CPhCntContact& aContact,
+        TInt aSpeedDialPosition, 
+        TSpdDialFieldInfo& aFieldInfo )
+    {
+    
+    MVPbkContactLink* contactLink = aContact.ContactLink()->CloneLC();
+    CPhCntVPbkContactId* contactId = 
+        CPhCntVPbkContactId::NewL( contactLink, iContactManager );
+    CleanupStack::Pop(); // contactLink
+    aFieldInfo.iContactId = contactId;
+        
+    aFieldInfo.iThumbIndex = KErrNotFound;
+	TPhCntNumber speedDial = aContact.SpeedDialNumber( aSpeedDialPosition );    
+	aFieldInfo.iNumberType = speedDial.Type();
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntSpeedDialImpl::NewL
+// ---------------------------------------------------------------------------
+//
+CPhCntSpeedDialImpl* CPhCntSpeedDialImpl::NewL(
+    MPhoneCntPbkOwner& aPbkOwner )
+    {
+    CPhCntSpeedDialImpl* self = 
+        CPhCntSpeedDialImpl::NewLC( aPbkOwner );
+        
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntSpeedDialImpl::NewLC
+// ---------------------------------------------------------------------------
+//
+CPhCntSpeedDialImpl* CPhCntSpeedDialImpl::NewLC(
+    MPhoneCntPbkOwner& aPbkOwner )
+    {
+    CPhCntSpeedDialImpl* self = new( ELeave ) 
+        CPhCntSpeedDialImpl( aPbkOwner );
+        
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhCntSpeedDialImpl::~CPhCntSpeedDialImpl()
+    {
+    delete iContactFetcher;
+    delete iContactStores;
+    delete iSpeedDialContactLinkFetcher;
+    delete iSpdDial;
+    }
+
+// ---------------------------------------------------------------------------
+//  CPhCntSpeedDialImpl::GetSpeedDialFieldInfoL
+// ---------------------------------------------------------------------------
+//
+void CPhCntSpeedDialImpl::GetSpeedDialFieldInfoL( 
+    TInt aSpeedDialPosition,
+    TSpdDialFieldInfo& aFieldInfo )
+    {    
+    CPhCntContact* contact = NULL;
+    User::LeaveIfError( FetchContact( aSpeedDialPosition, contact ) );
+    
+    CleanupStack::PushL( contact );
+   
+    CopyContactInfoToFieldInfoL( *contact, aSpeedDialPosition, aFieldInfo );
+        
+    CleanupStack::PopAndDestroy( contact );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntSpeedDialImpl::GetSpeedDialFieldL
+// ---------------------------------------------------------------------------
+//
+TInt CPhCntSpeedDialImpl::GetSpeedDialFieldL( 
+    TInt aSpeedDialPosition, 
+    TDes& aPhoneNumber )
+    {
+    CPhCntContact* contact = NULL;
+    const TInt err = FetchContact( aSpeedDialPosition, contact );
+    if( !err )
+        {
+        CleanupStack::PushL( contact );
+        TPhCntNumber speedDial( contact->SpeedDialNumber( aSpeedDialPosition ) );
+        CopyNumberL( aPhoneNumber, speedDial.Number() );        
+        CleanupStack::PopAndDestroy( contact );
+        }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntSpeedDialImpl::GetSpeedDialFieldL
+// ---------------------------------------------------------------------------
+//
+TInt CPhCntSpeedDialImpl::GetSpeedDialFieldL(
+    TInt aSpeedDialPosition, 
+    TDes& aPhoneNumber,
+    TSpdDialFieldInfo& aFieldInfo )
+    {
+    CPhCntContact* contact = NULL;
+    const TInt err = FetchContact( aSpeedDialPosition, contact );
+    
+    if( !err )
+        {
+        CleanupStack::PushL( contact );
+        TPhCntNumber speedDial( contact->SpeedDialNumber( aSpeedDialPosition ) );
+        CopyNumberL( aPhoneNumber, speedDial.Number() );         
+        CopyContactInfoToFieldInfoL( *contact, aSpeedDialPosition, aFieldInfo );        
+        CleanupStack::PopAndDestroy( contact );
+        }
+    return err;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhCntSpeedDialImpl::FetchNumberL
+// -----------------------------------------------------------------------------
+//
+TInt CPhCntSpeedDialImpl::FetchNumberL(
+            TInt aSpeedDialPosition,
+            TDes& aPhoneNumber )
+    {
+    CPhCntContact* contact = NULL;
+    TInt err = FetchContact( aSpeedDialPosition, contact );
+    
+    if( !err )
+        {
+        CleanupStack::PushL( contact );
+        TPhCntNumber speedDial( contact->SpeedDialNumber( aSpeedDialPosition ) );
+        CopyNumberL( aPhoneNumber, speedDial.Number() );        
+        CleanupStack::PopAndDestroy( contact );
+        }
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntSpeedDialImpl::AssignSpeedDialFieldL
+// -----------------------------------------------------------------------------
+//
+TInt CPhCntSpeedDialImpl::AssignSpeedDialFieldL(
+            TInt aSpeedDialPosition,
+            TDes& aPhoneNumber )
+    {
+    CVPbkContactManager* contactMg = 
+        &iPbkOwner.ContactManager()->ContactManager();
+    if ( !iSpdDial )
+        {
+        iSpdDial = CSpdiaDialogs::NewL( *contactMg );    
+        }    
+    MVPbkContactLink *link = NULL;
+    TInt err = iSpdDial->ShowAssign( aSpeedDialPosition, link );
+    delete iSpdDial;
+    iSpdDial = NULL;
+    if ( err == KErrNone )
+        {
+        err = FetchNumberL( aSpeedDialPosition, aPhoneNumber );    
+        }
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntSpeedDialImpl::AssignSpeedDialFieldL
+// -----------------------------------------------------------------------------
+//
+TInt CPhCntSpeedDialImpl::AssignSpeedDialFieldL(
+            TInt aSpeedDialPosition,
+            TDes& aPhoneNumber,
+            TSpdDialFieldInfo& aFieldInfo )
+    {
+    TInt err = AssignSpeedDialFieldL( aSpeedDialPosition, aPhoneNumber );
+    if ( err == KErrNone )
+        {
+        GetSpeedDialFieldInfoL( aSpeedDialPosition, aFieldInfo );
+        }
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntSpeedDialImpl::Cancel
+// -----------------------------------------------------------------------------
+//
+void CPhCntSpeedDialImpl::Cancel()
+    {
+    if ( iSpdDial )
+        {
+        iSpdDial->Cancel();
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhCntSpeedDialImpl::CreateNumberTypeIconLC
+// -----------------------------------------------------------------------------
+//
+CEikImage* CPhCntSpeedDialImpl::CreateNumberTypeIconLC( 
+    TInt aNumberType )
+    {
+    TUint icon;
+    TUint mask;
+    switch ( aNumberType )
+        {
+        case EPbkFieldIdPhoneNumberMobile:
+            icon = EMbmAvkonQgn_prop_nrtyp_mobile;
+            mask = EMbmAvkonQgn_prop_nrtyp_mobile_mask;
+            break;
+        case EPbkFieldIdPagerNumber:
+            icon = EMbmAvkonQgn_prop_nrtyp_pager;
+            mask = EMbmAvkonQgn_prop_nrtyp_pager_mask;
+            break;
+        case EPbkFieldIdPhoneNumberVideo:
+            icon = EMbmAvkonQgn_prop_nrtyp_video;
+            mask = EMbmAvkonQgn_prop_nrtyp_video_mask;
+            break;
+        case EPbkFieldIdVOIP:
+            icon = EMbmAvkonQgn_prop_nrtyp_voip;
+            mask = EMbmAvkonQgn_prop_nrtyp_voip_mask;
+            break;
+        case EPbkFieldIdPhoneNumberGeneral:
+        case EPbkFieldIdPhoneNumberHome:
+        case EPbkFieldIdPhoneNumberWork:
+        case EPbkFieldIdFaxNumber:
+        default:
+            icon = EMbmAvkonQgn_prop_nrtyp_phone;
+            mask = EMbmAvkonQgn_prop_nrtyp_phone_mask;
+            break;
+        }
+
+    CEikImage* iconImg = new ( ELeave ) CEikImage;
+    CleanupStack::PushL( iconImg );
+
+    CFbsBitmap* iconBmp = new ( ELeave ) CFbsBitmap;
+    CleanupStack::PushL( iconBmp );
+    User::LeaveIfError( iconBmp->Load( 
+        KAvkonBitmapFile(),
+        icon,
+        ETrue ) );
+
+    CFbsBitmap* iconMaskBmp = new ( ELeave ) CFbsBitmap;
+    CleanupStack::PushL( iconMaskBmp );
+    User::LeaveIfError( iconMaskBmp->Load( 
+        KAvkonBitmapFile(), 
+        mask,
+        ETrue ) );
+    
+    CleanupStack::Pop( iconMaskBmp );
+    CleanupStack::Pop( iconBmp );
+
+    iconImg->SetPicture( iconBmp, iconMaskBmp );
+    iconImg->SetPictureOwnedExternally( EFalse );
+
+    return iconImg;
+    }
+        
+//  End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/cphcntstoreloaderimpl.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,202 @@
+/*
+* 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 CPhCntStoreLoaderImpl class.
+*
+*/
+
+
+#include <CVPbkContactLinkArray.h>
+#include <TVPbkContactStoreUriPtr.h>
+#include <MVPbkContactStoreList.h>
+#include "cphcntstoreloaderimpl.h"
+#include "MPhCntContactManager.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CPhCntStoreLoaderImpl::CPhCntStoreLoaderImpl
+// C++ default constructor can NOT contain any code, that might leave.
+// ---------------------------------------------------------------------------
+//
+CPhCntStoreLoaderImpl::CPhCntStoreLoaderImpl( MPhCntContactManager& aManager )
+        :
+        iContactManager( aManager )
+    {
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// Two-phased constructor.
+// ---------------------------------------------------------------------------
+//
+CPhCntStoreLoaderImpl* CPhCntStoreLoaderImpl::NewL( 
+        MPhCntContactManager& aManager )
+    {
+    CPhCntStoreLoaderImpl* self = CPhCntStoreLoaderImpl::NewLC( aManager );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Two-phased constructor.
+// ---------------------------------------------------------------------------
+//
+CPhCntStoreLoaderImpl* CPhCntStoreLoaderImpl::NewLC( 
+        MPhCntContactManager& aManager )
+    {
+    CPhCntStoreLoaderImpl* self 
+        = new( ELeave ) CPhCntStoreLoaderImpl( aManager );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+CPhCntStoreLoaderImpl::~CPhCntStoreLoaderImpl()
+    {
+    iObserver = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Secondphase constructor.
+// ---------------------------------------------------------------------------
+//
+void CPhCntStoreLoaderImpl::ConstructL()
+    {
+    BaseConstructL();
+    }
+// ---------------------------------------------------------------------------
+// From class MPhCntStoreLoader.
+// Checks is the specified contact store loaded.
+// ---------------------------------------------------------------------------
+//
+TBool CPhCntStoreLoaderImpl::IsContactStoreLoaded( 
+        const TDesC8& aContactLink ) const
+    {
+    TBool isStoreLoaded( EFalse );
+    TRAP_IGNORE( isStoreLoaded = IsContactStoreLoadedL( aContactLink ) );
+    
+    return isStoreLoaded;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MPhCntStoreLoader.
+// Starts asynchronous loading process for the store specified by the given
+// contact link.
+// ---------------------------------------------------------------------------
+//
+void CPhCntStoreLoaderImpl::LoadContactStoreL( const TDesC8& aContactLink,
+        MPhCntStoreLoaderObserver& aObserver )
+    {
+    __ASSERT_ALWAYS( NULL == iObserver, User::Leave( KErrInUse ) );
+    
+    iObserver = &aObserver;
+    iContactManager.LoadContactStoreL( aContactLink, *this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MPhCntStoreLoaderObserver.
+// Called when contact store loading process is completed. 
+// ---------------------------------------------------------------------------
+//
+void CPhCntStoreLoaderImpl::ContactStoreLoadingCompleted( 
+        MVPbkContactStore* aStore, TInt aErrorCode )
+    {
+    // Loading with contact store uri was completed  
+    if ( iStoreUri )
+        {
+        ResponseReceived( aErrorCode );
+        iStoreUri = NULL;
+        }
+    // Loading with contact link was completed   
+    else if ( iObserver )
+        {
+        iObserver->ContactStoreLoadingCompleted( aStore, aErrorCode );
+        iObserver = NULL;
+        }
+    else
+        {
+        ASSERT( NULL != iObserver );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntStoreLoaderImpl::LoadContactStoreWithUri.
+// Loads contact store (specified by the given URI) synchronously.
+// ---------------------------------------------------------------------------
+//
+TInt CPhCntStoreLoaderImpl::LoadContactStoreWithUri( const TDesC& aStoreUri )
+    {      
+    TInt err = KErrNone;
+    TBool storeLoaded = EFalse;
+    TRAP_IGNORE( storeLoaded = IsContactStoreLoadedL( aStoreUri ) );
+    if ( !storeLoaded )
+        {
+        iStoreUri = &aStoreUri;
+        // convert Asynch store loading to synch 
+        err = MakeAsyncRequest();
+        }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// From class CPhCntAsyncToSync
+// Issues asynchronous request for contact store loading.
+// ---------------------------------------------------------------------------
+//
+void CPhCntStoreLoaderImpl::DoMakeAsyncRequestL()
+    {
+    __ASSERT_ALWAYS( NULL != iStoreUri, User::Leave( KErrArgument ) );
+    iContactManager.LoadContactStoreWithUriL( *iStoreUri, *this );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntStoreLoaderImpl::IsContactStoreLoadedL.
+// Checks is the contact store (specified by the given contact link) loaded.
+// ---------------------------------------------------------------------------
+//
+TBool CPhCntStoreLoaderImpl::IsContactStoreLoadedL( 
+        const TDesC8& aContactLink ) const
+    {
+    CVPbkContactLinkArray* linkArray = CVPbkContactLinkArray::NewLC( 
+        aContactLink, iContactManager.ContactStoresL() );
+    
+    TBool storeLoaded( linkArray->Count() != 0 );
+    CleanupStack::PopAndDestroy( linkArray );
+    
+    return storeLoaded;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntStoreLoaderImpl::IsContactStoreLoadedL.
+// Checks is the contact store (specified by the given URI) loaded.
+// ---------------------------------------------------------------------------
+//
+TBool CPhCntStoreLoaderImpl::IsContactStoreLoadedL( 
+        const TDesC16& aContactStoreUri ) const
+    {
+    MVPbkContactStoreList& storeList = iContactManager.ContactStoresL();
+    TVPbkContactStoreUriPtr uriPtr( aContactStoreUri );
+    MVPbkContactStore* store = storeList.Find( uriPtr );
+    return ( NULL != store );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/cphcntvoipcontactmatchstrategy.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Finds voip contacts from phonebook
+*
+*/
+
+
+#include <MVPbkContactOperationBase.h>
+
+#include "cphcntvoipcontactmatchstrategy.h"
+#include "mphcntvoipcontactfinder.h"
+#include "PhCntPanic.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntVoipContactMatchStrategy::CPhCntVoipContactMatchStrategy(
+    MPhCntVoipContactFinder& aVoipContactFinder,
+    MVPbkContactFindObserver& aObserver ) :
+    iVoipContactFinder( aVoipContactFinder ),
+    iObserver( aObserver )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Secondphase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhCntVoipContactMatchStrategy::ConstructL()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntVoipContactMatchStrategy* CPhCntVoipContactMatchStrategy::NewL(
+    MPhCntVoipContactFinder& aVoipContactFinder,
+    MVPbkContactFindObserver& aObserver )
+    {
+    CPhCntVoipContactMatchStrategy* self = 
+        CPhCntVoipContactMatchStrategy::NewLC( aVoipContactFinder, aObserver );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntVoipContactMatchStrategy* CPhCntVoipContactMatchStrategy::NewLC(
+    MPhCntVoipContactFinder& aVoipContactFinder,
+    MVPbkContactFindObserver& aObserver )
+    {
+    CPhCntVoipContactMatchStrategy* self = 
+        new( ELeave ) CPhCntVoipContactMatchStrategy( 
+            aVoipContactFinder, aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhCntVoipContactMatchStrategy::~CPhCntVoipContactMatchStrategy()
+    {
+    delete iFindOperation;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPhCntContactMatchStrategy
+// Starts the find
+// ---------------------------------------------------------------------------
+//
+ void CPhCntVoipContactMatchStrategy::FindMatchesL( 
+    const TDesC& aMatchString )
+    {
+    __ASSERT_ALWAYS( !iFindOperation, 
+        PhCntPanic( EPhCntOperationAlreadyOngoing ) );
+    iFindOperation = 
+        iVoipContactFinder.FindVoipContactsL( aMatchString, *this );
+    }
+ 
+// ---------------------------------------------------------------------------
+// From class MVPbkContactFindObserver
+// Notification that find is done succesfully
+// ---------------------------------------------------------------------------
+//   
+ void CPhCntVoipContactMatchStrategy::FindCompleteL( 
+    MVPbkContactLinkArray* aResults )
+    {
+    delete iFindOperation;
+    iFindOperation = NULL;
+    iObserver.FindCompleteL( aResults );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MVPbkContactFindObserver
+// Notification that find failed
+// ---------------------------------------------------------------------------
+//     
+void CPhCntVoipContactMatchStrategy::FindFailed( 
+    TInt aError )
+    {
+    delete iFindOperation;
+    iFindOperation = NULL;
+    iObserver.FindFailed( aError );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/cphcntvpbkcontactid.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,227 @@
+/*
+* 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:  Contact identifier used with virtual phonebook
+*
+*/
+
+
+#include "MPhCntContactManager.h"
+#include "cphcntvpbkcontactid.h"
+#include "MVPbkContactLink.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntVPbkContactId::CPhCntVPbkContactId( 
+    MVPbkContactLink* aContactLink,
+    MPhCntContactManager& aContactManager ) : 
+    iContactLink( aContactLink ),
+    iContactManager( aContactManager )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CPhCntVPbkContactId::ConstructL( 
+    TContactItemId aContactItemId )
+    {
+    iContactLink = 
+        iContactManager.ConvertContactIdToLinkL( aContactItemId );
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CPhCntVPbkContactId::ConstructL( const TDesC8& aContactLink )
+    {
+    iContactLink =
+        iContactManager.ConvertDescriptorToLinkL( aContactLink );
+    }
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntVPbkContactId* CPhCntVPbkContactId::NewL(
+    MVPbkContactLink* aContactLink,
+    MPhCntContactManager& aContactManager )
+    {
+    CPhCntVPbkContactId* self = 
+        CPhCntVPbkContactId::NewLC( aContactLink, aContactManager );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntVPbkContactId* CPhCntVPbkContactId::NewLC( 
+    TContactItemId aContactId,
+    MPhCntContactManager& aContactManager )
+    {
+    CPhCntVPbkContactId* self = 
+        new( ELeave ) CPhCntVPbkContactId( 
+            NULL, aContactManager );
+    CleanupStack::PushL( self );
+    self->ConstructL( aContactId );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntVPbkContactId* CPhCntVPbkContactId::NewL(
+    TContactItemId aContactId,
+    MPhCntContactManager& aContactManager )
+    {
+    CPhCntVPbkContactId* self = 
+        CPhCntVPbkContactId::NewLC( aContactId, aContactManager );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntVPbkContactId* CPhCntVPbkContactId::NewLC( 
+    MVPbkContactLink* aContactLink,
+    MPhCntContactManager& aContactManager )
+    {
+    CPhCntVPbkContactId* self = 
+        new( ELeave ) CPhCntVPbkContactId( 
+            aContactLink,
+            aContactManager );
+    CleanupStack::PushL( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//    
+CPhCntVPbkContactId* CPhCntVPbkContactId::NewL( 
+    const TDesC8& aContactLink,
+    MPhCntContactManager& aContactManager )
+    {
+    CPhCntVPbkContactId* self = 
+        new( ELeave )CPhCntVPbkContactId( NULL, aContactManager );
+    CleanupStack::PushL( self );
+    self->ConstructL( aContactLink );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhCntVPbkContactId::~CPhCntVPbkContactId()
+    {
+    delete iContactLink;
+    }
+
+// ---------------------------------------------------------------------------
+// Gives the contact link
+// ---------------------------------------------------------------------------
+//
+const MVPbkContactLink& CPhCntVPbkContactId::ContactLink() const
+    {
+    return *iContactLink;
+    }
+
+// ---------------------------------------------------------------------------
+// From class CPhCntContactId
+// Clones this object.
+// ---------------------------------------------------------------------------
+//
+CPhCntContactId* CPhCntVPbkContactId::CloneL() const
+    {
+    CPhCntContactId* clone = NULL;
+    if( iContactLink ) 
+        {
+        MVPbkContactLink* clonedLink = iContactLink->CloneLC();
+        clone = CPhCntVPbkContactId::NewL( clonedLink, iContactManager );
+        CleanupStack::Pop(); // clonedLink
+        }
+    return clone;
+    }
+    
+// ---------------------------------------------------------------------------
+// From class CPhCntContactId
+// Invalidates this contact id
+// ---------------------------------------------------------------------------
+//
+void CPhCntVPbkContactId::Invalidate()
+    {
+    delete iContactLink;
+    iContactLink = NULL;
+    }
+    
+// ---------------------------------------------------------------------------
+// From class CPhCntContactId
+// Is valid
+// ---------------------------------------------------------------------------
+//
+TBool CPhCntVPbkContactId::IsValid() const
+    {
+    TBool isValid = EFalse;
+    if( iContactLink )
+        {
+        isValid = ETrue;
+        }
+    return isValid;
+    }
+    
+// ---------------------------------------------------------------------------
+// From class CPhCntContactId
+// Contact id
+// ---------------------------------------------------------------------------
+//
+TContactItemId CPhCntVPbkContactId::ContactId() const
+    {
+    TContactItemId contactId = KNullContactId;
+    if( iContactLink ) 
+        {
+        contactId = iContactManager.ConvertContactLinkToContactId( *iContactLink );
+        }
+    return contactId;
+    }
+    
+// ---------------------------------------------------------------------------
+// From class CPhCntContactId
+// Packs contact link.
+// ---------------------------------------------------------------------------
+//
+HBufC8* CPhCntVPbkContactId::PackLC() const
+    {
+    HBufC8* pack = NULL;
+    if( iContactLink )
+        {
+        pack = iContactLink->PackLC();
+        }
+    return pack;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/cphcntvpbkthumbnailloader.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Thumbnail loader for loading thumbnails from VirtualPhonebook
+*
+*/
+
+
+#include <CPbk2ImageManager.h>
+
+#include "cphcntvpbkthumbnailloader.h"
+#include "MPhCntContactStores.h"
+#include "cphcntvpbkcontactid.h"
+#include "CPhCntContact.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntVPbkThumbnailLoader::CPhCntVPbkThumbnailLoader(
+    MPhCntContactStores& aContactStores ) : 
+    iContactStores( &aContactStores )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CPhCntVPbkThumbnailLoader::ConstructL()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntVPbkThumbnailLoader* CPhCntVPbkThumbnailLoader::NewL(
+    MPhCntContactStores& aContactStores )
+    {
+    CPhCntVPbkThumbnailLoader* self = 
+        CPhCntVPbkThumbnailLoader::NewLC( aContactStores );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntVPbkThumbnailLoader* CPhCntVPbkThumbnailLoader::NewLC(
+    MPhCntContactStores& aContactStores )
+    {
+    CPhCntVPbkThumbnailLoader* self = 
+        new( ELeave ) CPhCntVPbkThumbnailLoader( aContactStores );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// destructor.
+// ---------------------------------------------------------------------------
+//
+CPhCntVPbkThumbnailLoader::~CPhCntVPbkThumbnailLoader()
+    {
+    delete iContactStores;
+    delete iOperation;
+    delete iReceivedContact;
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// From class MPhCntThumbnailLoader
+// ---------------------------------------------------------------------------
+//
+void CPhCntVPbkThumbnailLoader::Cancel()
+    {
+    delete iReceivedContact;
+    iReceivedContact = NULL;
+    delete iOperation;
+    iOperation = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPhCntThumbnailLoader
+// ---------------------------------------------------------------------------
+//
+void CPhCntVPbkThumbnailLoader::Release()
+    {
+    // Nothing to do.
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class CPhCntThumbnailLoaderBase
+// Starts the loading of thumbnail
+// ---------------------------------------------------------------------------
+//
+void CPhCntVPbkThumbnailLoader::DoLoadL( const CPhCntContactId& aContactId ) 
+    {
+    // Cast is safe because compile time variation makes sure that 
+    // CPhCntContactId is only subclassed by CPhCntVPbkContactId.
+    const CPhCntVPbkContactId& contactId = 
+        reinterpret_cast<const CPhCntVPbkContactId&>( aContactId );
+        
+    // Fetch the contact.
+    iContactStores->FetchContactL( contactId.ContactLink(), *this );
+    }
+ 
+// ---------------------------------------------------------------------------
+// From class MPhCntContactFetchObserver
+// Indication that contact has been fetched from contact stores.
+// Starts loading the thumbnail from contact.
+// ---------------------------------------------------------------------------
+//   
+void CPhCntVPbkThumbnailLoader::ContactReceived( 
+    CPhCntContact* aContact, 
+    TInt aError )
+    {
+    if( aError == KErrNone )
+        {
+        iReceivedContact = aContact;
+        TRAPD( err, iOperation = iReceivedContact->LoadThumbnailL( *this ) );
+        if( err != KErrNone ) 
+            {
+            NotifyObserver( NULL, err );
+            delete iReceivedContact;
+            iReceivedContact = NULL;
+            }
+        }
+    else 
+        {
+        NotifyObserver( NULL, aError );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPbk2ImageGetObserver
+// ---------------------------------------------------------------------------
+//  
+void CPhCntVPbkThumbnailLoader::Pbk2ImageGetComplete( 
+    MPbk2ImageOperation& /*aOperation*/, 
+    CFbsBitmap* aBitmap )
+    {
+    delete iOperation;
+    iOperation = NULL;
+    
+    delete iReceivedContact;
+    iReceivedContact = NULL;
+    
+    NotifyObserver( aBitmap, KErrNone );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPbk2ImageGetObserver
+// ---------------------------------------------------------------------------
+//
+void CPhCntVPbkThumbnailLoader::Pbk2ImageGetFailed( 
+    MPbk2ImageOperation& /*aOperation*/, 
+    TInt aError )
+    {
+    delete iOperation;
+    iOperation = NULL;
+    
+    delete iReceivedContact;
+    iReceivedContact = NULL;
+    
+    NotifyObserver( NULL, aError );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/tphcntaiwserviceobserver.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,217 @@
+/*
+* Copyright (c) 2007-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 Phonebook AIW services.
+*
+*/
+
+
+#include "tphcntaiwserviceobserver.h"
+#include "mphcntservicerequestparam.h"
+#include "mphcntserviceresult.h"
+
+// Phonebook2 AIW service constants
+const TInt KServiceTermiationAllowed = 0; 
+const TInt KProcessTerminationAllowed = 1;
+
+// Phone Process Uid.
+const TInt KPhoneProcess = 0x100058B3;
+const TBool KDoNotAllowProcessTermination = EFalse;
+const TBool KAllowProcessTermination = ETrue;
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+TPhCntAiwServiceObserver::TPhCntAiwServiceObserver(
+    MPhCntAiwServiceCompleteObserver& aObserver) : 
+    iResult( NULL ),
+    iParams( NULL ),
+    iObserver( aObserver ),
+    iAiwServiceShuttingDown( EFalse )
+    {
+    }
+   
+// ---------------------------------------------------------------------------
+// Sets params and result
+// ---------------------------------------------------------------------------
+// 
+void TPhCntAiwServiceObserver::SetRequestAndResult( 
+    MPhCntServiceRequestParam* aParams,
+    MPhCntServiceResult* aResult )
+    {
+    iParams = aParams;
+    iResult = aResult;
+    }
+
+// ---------------------------------------------------------------------------
+// From MAiwNotifyCallback
+// Handles the Phonebooks AIW callbacks.
+// ---------------------------------------------------------------------------
+//
+TInt TPhCntAiwServiceObserver::HandleNotifyL(
+    TInt aCmdId,
+    TInt aEventId,
+    CAiwGenericParamList& aEventParamList,
+    const CAiwGenericParamList& /*aInParamList*/ )
+	{
+	TInt response = KErrNone;
+	if( iResult && iParams )
+	    {
+	    if( aCmdId == iParams->Command() ) 
+	        {
+	        switch( aEventId )
+	            {
+	            // User canceled the service.
+	            case KAiwEventCanceled:
+	                // if AIW service is shutting down (ie user has pressed end key), 
+	                // do not indicate that response has received yet, because
+	                // we still have to wait KAiwEventQueryExit.
+	                if( !iAiwServiceShuttingDown )
+	                    {
+	                    ResponseReceived( KErrCancel );
+	                    }
+	                break;
+	            
+	            // Service provider had an internal error.
+	            case KAiwEventError:
+	                ResponseReceived( ParseErrorCode( aEventParamList ) );
+	                break;
+	                
+	            // Service provider stopped from some reason.
+	            case KAiwEventStopped:
+	                ResponseReceived( KErrGeneral );
+	                break;
+	            
+	            case KAiwEventCompleted:
+	                iResult->ParseResult( aEventParamList );
+	                ResponseReceived( KErrNone );
+	                break;
+	                
+	            // We are not interested to check the client selection.
+	            case KAiwEventOutParamCheck: 
+	                response = ETrue;
+	                break;
+	                
+	                
+	            // QUERY EXIT is three phase operation.
+	            // First time when KAiwEventQueryExit comes, Phonebook AIW service
+	            // provider is asking if service is allowed to be terminated (KServiceTermiationAllowed).
+	            // After that service request is completed with event KAiwEventCanceled.
+	            // Last phase is KAiwEventQueryExit event with query to allow process termination 
+	            // (KProcessTerminationAllowed).
+	            case KAiwEventQueryExit:
+
+	                TInt queryType;
+                    if( !FindFirstTInt32Value( 
+	                        aEventParamList, EGenericParamApplication, queryType ) )
+                        {
+                        if( queryType == KServiceTermiationAllowed )
+                            { 
+                            // AIW service is always allowed to exit. After this
+                            // AIW service provider cancels the outstanding
+                            // request with event KAiwEventCanceled.
+                            response = iAiwServiceShuttingDown = ETrue;
+                            }
+                        else if( queryType == KProcessTerminationAllowed )
+                            {
+                            if ( RunningInPhoneAppProcess() )
+                                {
+                                // Phone app process is not allowed to be 
+                                // terminated.
+                                response = KDoNotAllowProcessTermination;    
+                                }
+                            else
+                                {
+                                response = KAllowProcessTermination;
+                                }                          
+                            ResponseReceived( KErrCancel );
+                            }
+                        }
+                    break;
+	              
+	            // Other events are not handled and we wait for
+	            // next event.
+                default:
+                    break;
+	            }           
+	        }
+	    }
+	    
+	return response;
+	}
+	
+// ---------------------------------------------------------------------------
+// Takes error code from generic param list.
+// ---------------------------------------------------------------------------
+//	
+TInt TPhCntAiwServiceObserver::ParseErrorCode( 
+    const CAiwGenericParamList& aEventParamList )
+    {
+    TInt errorValue = KErrGeneral;
+    FindFirstTInt32Value( aEventParamList, EGenericParamError, errorValue );
+    return errorValue;
+    }
+
+// ---------------------------------------------------------------------------
+// Takes integer value from aEventParamList.
+// ---------------------------------------------------------------------------
+//	    
+TInt TPhCntAiwServiceObserver::FindFirstTInt32Value( 
+    const CAiwGenericParamList& aEventParamList, 
+    TGenericParamId aParameterId,
+    TInt& aValue ) const
+    {
+    TInt err( KErrNotFound );
+    TInt index( 0 );
+    const TAiwGenericParam* param =
+        aEventParamList.FindFirst( index, aParameterId );
+    if ( index != KErrNotFound && param )
+        {
+        aValue = param->Value().AsTInt32();
+        err = KErrNone;
+        }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Notifies observer.
+// ---------------------------------------------------------------------------
+//
+void TPhCntAiwServiceObserver::ResponseReceived( TInt aError )
+    {
+    iObserver.ServiceRequestComplete( aError );
+    iResult = NULL;
+    iParams = NULL;
+    iAiwServiceShuttingDown = EFalse;
+    }
+    
+// ---------------------------------------------------------------------------
+// Checks if running in phone process. The handling of KAiwEventQueryExit
+// is done differently if running in phone process.
+// ---------------------------------------------------------------------------
+//
+TBool TPhCntAiwServiceObserver::RunningInPhoneAppProcess() const
+    {
+    RProcess currentProcess;
+	TBool phoneProcess( EFalse );
+	TUid processID = currentProcess.Identity();
+	if ( processID.iUid == KPhoneProcess )
+        {
+        phoneProcess = ETrue;    
+        }
+    return phoneProcess;
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/tphcntcontactfield.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,261 @@
+/*
+* 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:  Implementation of TPhCntContactField class.
+*
+*/
+
+
+#include <VPbkFieldType.hrh>
+#include <TVPbkFieldTypeParameters.h>
+#include <VPbkEng.rsg>
+#include <MVPbkStoreContactField.h>
+
+#include "MPhCntContactManager.h"
+#include "tphcntcontactfield.h"
+#include "PhCntTrace.h"
+
+// Speed dial related constants
+const TInt KPhCntPositionNotSet = 0;
+const TInt KPhCntPositionMin = 1;
+const TInt KPhCntPositionMax = 9;
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+TPhCntContactField::TPhCntContactField() :
+    iDataPointedByContactLink( EFalse ),
+    iContactFieldId( 0 )
+    {
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//    
+TPhCntContactField::TPhCntContactField(
+    TInt aContactFieldId ) :
+    iDataPointedByContactLink( EFalse ),
+    iContactFieldId( aContactFieldId )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//    
+TPhCntContactField::~TPhCntContactField()
+    {
+    }
+   
+
+// ---------------------------------------------------------------------------
+// Gives the contact field data.
+// ---------------------------------------------------------------------------
+//
+const TDesC& TPhCntContactField::Data() const
+    {
+    return iContactFieldData;
+    }
+
+// ---------------------------------------------------------------------------
+// Checks if this resolver is received datas resolver. If so then sets
+// the contact field data.
+// ---------------------------------------------------------------------------
+//
+void TPhCntContactField::Resolve(
+    TInt aContactFieldId, 
+    const TDesC& aFieldData,
+    TBool aPointedData )
+    {
+    if( iContactFieldId == aContactFieldId )
+        {
+        SetData( aFieldData, aPointedData );
+        }
+    }
+ 
+// ---------------------------------------------------------------------------
+// Sets the contact field data if the possible earlier data is not 
+// data which has been pointed by contact link.
+// ---------------------------------------------------------------------------
+//   
+void TPhCntContactField::SetData( 
+    const TDesC& aData,
+    TBool aPointedData )
+    {
+    if( !iDataPointedByContactLink )
+        {
+        iDataPointedByContactLink = aPointedData;
+        PRINTF( "PhCnt: ContactField.SetData: %S", &aData );
+        iContactFieldData.Set( aData );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+TPhCntPhoneNumber::TPhCntPhoneNumber() : 
+    TPhCntContactField( EVPbkVersitNameTEL )
+    {
+    }
+    
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+TPhCntPhoneNumber::~TPhCntPhoneNumber()
+    {
+    iAllNumbers.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// Gives the phone number pointed by contact link
+// ---------------------------------------------------------------------------
+//    
+const TPhCntNumber& TPhCntPhoneNumber::Number() const
+    {
+    return iPointedNumber;
+    }
+
+// ---------------------------------------------------------------------------
+// Gives all numbers resolved.
+// ---------------------------------------------------------------------------
+//    
+const RArray<TPhCntNumber>& TPhCntPhoneNumber::AllNumbers() const
+    {
+    return iAllNumbers;
+    }
+ 
+// ---------------------------------------------------------------------------
+// Resolves phone number and its type.
+// ---------------------------------------------------------------------------
+//   
+void TPhCntPhoneNumber::ResolveL(
+    TInt aContactFieldId, 
+    const TDesC& aFieldData,
+    TBool aPointedData,
+    MPhCntContactManager& aContactManager,
+    MVPbkStoreContactField& aContactField )
+    {        	
+    
+    // Evaluate fields type information
+    const MPhCntMatch::TNumberType numberType = PhoneNumberType( aContactFieldId );    
+    if ( numberType != MPhCntMatch::ENone ) 
+    	{    									
+    	TBool speedDial = EFalse;    									
+		// Test all speed dial positions
+		for( TInt positionIndex = KPhCntPositionMin; positionIndex <= KPhCntPositionMax; positionIndex++ )
+			{
+			if ( aContactManager.HasSpeedDialL( positionIndex, aContactField ) )			
+				{					
+				speedDial = ETrue;
+				// Add phone number & position specific entry
+				SetNumber( aFieldData, numberType, aPointedData, positionIndex ); 				
+				}
+			}				      
+		if ( !speedDial )
+			{
+			// Add at least one phone number entry without any positions
+			SetNumber( aFieldData, numberType, aPointedData, KPhCntPositionNotSet );	
+			}		
+        }              		        
+    }
+
+// ---------------------------------------------------------------------------
+// Evaluates the type of a phone number field.
+// ---------------------------------------------------------------------------
+//   
+MPhCntMatch::TNumberType TPhCntPhoneNumber::PhoneNumberType( 
+	TInt aContactFieldId )
+	{
+	MPhCntMatch::TNumberType numberType = MPhCntMatch::ENone;
+	
+    switch( aContactFieldId ) 
+        {
+        case R_VPBK_FIELD_TYPE_MOBILEPHONEGEN:
+        case R_VPBK_FIELD_TYPE_MOBILEPHONEWORK:
+        case R_VPBK_FIELD_TYPE_MOBILEPHONEHOME:
+            numberType = MPhCntMatch::EMobileNumber;            
+            break;
+            
+        case R_VPBK_FIELD_TYPE_VOIPHOME:
+        case R_VPBK_FIELD_TYPE_VOIPWORK:
+        case R_VPBK_FIELD_TYPE_VOIPGEN:
+        case R_VPBK_FIELD_TYPE_IMPP:
+        case R_VPBK_FIELD_TYPE_SIP:
+            numberType = MPhCntMatch::EVoipNumber;            
+            break;
+            
+        case R_VPBK_FIELD_TYPE_LANDPHONEHOME:
+        case R_VPBK_FIELD_TYPE_LANDPHONEWORK:
+        case R_VPBK_FIELD_TYPE_LANDPHONEGEN:
+            
+            numberType = MPhCntMatch::EStandardNumber;            
+            break;
+            
+        case R_VPBK_FIELD_TYPE_PAGERNUMBER:
+            numberType = MPhCntMatch::EPagerNumber;            
+            break;
+            
+        case R_VPBK_FIELD_TYPE_FAXNUMBERGEN:
+        case R_VPBK_FIELD_TYPE_FAXNUMBERHOME:
+        case R_VPBK_FIELD_TYPE_FAXNUMBERWORK:
+           numberType = MPhCntMatch::EFaxNumber;           
+           break;
+           
+        case R_VPBK_FIELD_TYPE_VIDEONUMBERHOME:
+        case R_VPBK_FIELD_TYPE_VIDEONUMBERWORK:
+        case R_VPBK_FIELD_TYPE_VIDEONUMBERGEN:
+            numberType = MPhCntMatch::EVideoNumber;
+            break;
+            
+        case R_VPBK_FIELD_TYPE_ASSTPHONE:
+			numberType = MPhCntMatch::EAssistantNumber;
+			break;
+		
+        case R_VPBK_FIELD_TYPE_CARPHONE:
+            numberType = MPhCntMatch::ECarNumber;
+            break;                   
+                            
+        default:
+            // Not a phone number.
+            break;
+        }
+        return numberType;	
+    }
+ 
+// ---------------------------------------------------------------------------
+// Sets number 
+// ---------------------------------------------------------------------------
+//   
+void TPhCntPhoneNumber::SetNumber( 
+    const TDesC& aNumber, 
+    MPhCntMatch::TNumberType aNumberType, 
+    TBool aPointedField,
+    TInt aSpeedDialPosition )
+    {
+    if( aPointedField && !iDataPointedByContactLink ) 
+        {
+        iDataPointedByContactLink = ETrue;
+        iPointedNumber.Set( aNumber, aNumberType, aSpeedDialPosition );    
+        }
+    iAllNumbers.Append( TPhCntNumber( aNumber, aNumberType, aSpeedDialPosition ) );
+    }
+    
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/tphcntcontactlinkresult.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,53 @@
+/*
+* 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:  Result of getting user selected contact link.
+*
+*/
+
+
+#include <AiwGenericParam.h>
+#include "tphcntcontactlinkresult.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+TPhCntContactLinkResult::TPhCntContactLinkResult( 
+    HBufC8*& aLink ) : 
+    iLink( aLink )
+    {
+    
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPhCntServiceResult
+// Takes the contact link descriptor from AIW result.
+// ---------------------------------------------------------------------------
+//
+void TPhCntContactLinkResult::ParseResult( 
+    CAiwGenericParamList& aResult )
+    {
+    TInt index = 0;
+    const TAiwGenericParam* param =
+        aResult.FindFirst( index, EGenericParamContactLinkArray );
+    if ( param )
+        {
+        delete iLink;
+        iLink = NULL;
+        iLink = param->Value().AsData().Alloc();
+        }
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/tphcntcontactstorestate.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,61 @@
+/*
+* 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:  Holds state of a contact store.
+*
+*/
+
+
+#include "tphcntcontactstorestate.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+TPhCntContactStoreState::TPhCntContactStoreState(
+    TVPbkContactStoreUriPtr aContactStoreUri) : 
+    iContactStoreUri( aContactStoreUri ),
+    iIsAvailable( EFalse )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Determines if contact store is available.
+// ---------------------------------------------------------------------------
+//
+TBool TPhCntContactStoreState::IsAvailable() const
+    {
+    return iIsAvailable;
+    }
+
+// ---------------------------------------------------------------------------
+// Gives contact store uri.
+// ---------------------------------------------------------------------------
+//   
+const TVPbkContactStoreUriPtr& 
+    TPhCntContactStoreState::ContactStoreUri() const
+    {
+    return iContactStoreUri;
+    }
+ 
+// ---------------------------------------------------------------------------
+// Sets availability
+// ---------------------------------------------------------------------------
+//      
+void TPhCntContactStoreState::SetAvailability( 
+    TBool aIsAvailable )
+    {
+    iIsAvailable = aIsAvailable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/tphcntcontactutil.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Contact utilitiest class.
+*
+*/
+
+
+#include "tphcntcontactutil.h"
+
+// ---------------------------------------------------------------------------
+// Checks are name fields same in both contacts.
+// ---------------------------------------------------------------------------
+//
+TBool TPhCntContactUtil::AreFirstAndLastAndCompanyNameSame( 
+            const CPhCntContact& aFirstContact,
+            const CPhCntContact& aSecondContact )
+    {
+    // Returns ETrue if first name, last name and company name are same
+    // in both contacts.
+    return KErrNone == aFirstContact.FirstName().Compare( 
+                        aSecondContact.FirstName() )  &&
+           KErrNone == aFirstContact.LastName().Compare( 
+                        aSecondContact.LastName() ) &&
+           KErrNone == aFirstContact.CompanyName().Compare( 
+                        aSecondContact.CompanyName() );
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/tphcntnullserviceresult.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Empty service result.
+*
+*/
+
+
+#include "tphcntnullserviceresult.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+TPhCntNullServiceResult::TPhCntNullServiceResult()
+    {
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// From class MPhCntServiceResult
+// Empty implementation
+// ---------------------------------------------------------------------------
+//
+void TPhCntNullServiceResult::ParseResult( 
+    CAiwGenericParamList& /*aResult*/ )
+    {
+    
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/tphcntnumber.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Phone number
+*
+*/
+
+
+#include "tphcntnumber.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+TPhCntNumber::TPhCntNumber( 
+    const TDesC& aNumber,
+    MPhCntMatch::TNumberType aNumberType,
+    TInt aSpeedDialPosition ) :
+    iNumber( aNumber ),
+    iNumberType( aNumberType ),
+    iSpeedDialPosition( aSpeedDialPosition )
+    {
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+TPhCntNumber::TPhCntNumber() : 
+    iNumber( KNullDesC() ),
+    iNumberType( MPhCntMatch::ENone ),
+    iSpeedDialPosition()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Getter
+// ---------------------------------------------------------------------------
+//
+const TDesC& TPhCntNumber::Number() const
+    {
+    return iNumber;
+    }
+
+// ---------------------------------------------------------------------------
+// Getter
+// ---------------------------------------------------------------------------
+//
+MPhCntMatch::TNumberType TPhCntNumber::Type() const
+    {
+    return iNumberType;
+    }
+
+// ---------------------------------------------------------------------------
+// Getter
+// ---------------------------------------------------------------------------
+//
+TInt TPhCntNumber::Position() const
+    {
+    return iSpeedDialPosition;
+    }
+
+// ---------------------------------------------------------------------------
+// Setter
+// ---------------------------------------------------------------------------
+//    
+void TPhCntNumber::Set( 
+    const TDesC& aNumber, 
+    MPhCntMatch::TNumberType aNumberType,
+    TInt aSpeedDialPosition )
+    {
+    iNumber.Set( aNumber );
+    iNumberType = aNumberType;
+    iSpeedDialPosition = aSpeedDialPosition; 
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/tphcntservicerequestfactory.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,43 @@
+/*
+* 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:  Factory to create AIW service requests.
+*
+*/
+
+
+#include <e32std.h>
+
+#include "TPhCntServiceRequestFactory.h"
+#include "CPhCntCreateNewContactRequest.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+TPhCntServiceRequestFactory::TPhCntServiceRequestFactory()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Creates request to create new contact.
+// ---------------------------------------------------------------------------
+//
+CPhCntCreateNewContactRequest* 
+    TPhCntServiceRequestFactory::CreateCreateNewContactRequestL()
+    {
+    return CPhCntCreateNewContactRequest::NewL();    
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/tphcntservicerequestparamfactory.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,192 @@
+/*
+* 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:  Factory for creating service request params.
+*
+*/
+
+
+#include <CVPbkContactLinkArray.h>
+#include "tphcntservicerequestparamfactory.h"
+#include "tphcntservicerequestparams.h"
+#include "MPhCntContactManager.h"
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntServiceRequestParamFactory::CPhCntServiceRequestParamFactory(
+    MPhCntContactManager* aContactManager ) : 
+    iContactManager( aContactManager )
+    {
+    }
+    
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPhCntServiceRequestParamFactory::~CPhCntServiceRequestParamFactory()
+    {
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntServiceRequestParamFactory* CPhCntServiceRequestParamFactory::NewL(
+    MPhCntContactManager& aContactManager )
+    {
+    CPhCntServiceRequestParamFactory* self = 
+        CPhCntServiceRequestParamFactory::NewLC( aContactManager );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntServiceRequestParamFactory* CPhCntServiceRequestParamFactory::NewLC(
+    MPhCntContactManager& aContactManager )
+    {
+    CPhCntServiceRequestParamFactory* self = 
+        new( ELeave )CPhCntServiceRequestParamFactory( &aContactManager );
+    CleanupStack::PushL( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntServiceRequestParamFactory
+// Creates new instance.
+// ---------------------------------------------------------------------------
+//
+MPhCntServiceRequestParam* 
+    CPhCntServiceRequestParamFactory::CreateCreateNewContactRequestParamLC( 
+        const TDesC& aPhoneNumber ) const
+    {
+    return CPhCntCreateNewContactParams::NewLC( aPhoneNumber );
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntServiceRequestParamFactory
+// Creates new instance.
+// ---------------------------------------------------------------------------
+//    
+MPhCntServiceRequestParam* 
+    CPhCntServiceRequestParamFactory::CreateUpdateContactRequestParamLC( 
+        const TDesC& aPhoneNumber ) const
+    {
+    return CPhCntUpdateExistingContact::NewLC( aPhoneNumber );
+    }
+    
+// ---------------------------------------------------------------------------
+// From MPhCntServiceRequestParamFactory
+// Creates new instance.
+// ---------------------------------------------------------------------------
+// 
+MPhCntServiceRequestParam* 
+    CPhCntServiceRequestParamFactory::
+        CreateGetUserSelectedPhoneNumberLinkParamLC() const
+    {
+    return CPhCntGetUserSelectedPhoneNumberLink::NewLC( ETrue, 
+                                                        *iContactManager );
+    }
+
+// ---------------------------------------------------------------------------
+// Creates new instance param instance
+// ---------------------------------------------------------------------------
+// 
+MPhCntServiceRequestParam* 
+    CPhCntServiceRequestParamFactory::
+        CreateGetUserSelectedPhoneNumberLC() const
+    {
+    return CPhCntGetUserSelectedPhoneNumberLink::NewLC( EFalse, 
+                                                        *iContactManager );
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntServiceRequestParamFactory
+// Creates new instance.
+// ---------------------------------------------------------------------------
+// 
+MPhCntServiceRequestParam* 
+    CPhCntServiceRequestParamFactory::
+        CreateGetUserSelectedVoIPAddressLinkParamLC(
+            MPhCntContactManager& aContactManager ) const
+    {
+    return CPhCntGetUserSelectedVoIPAddressLink::NewLC( aContactManager );
+    }
+
+// ---------------------------------------------------------------------------
+// Creates new instance param instance
+// ---------------------------------------------------------------------------
+// 
+MPhCntServiceRequestParam* 
+    CPhCntServiceRequestParamFactory::
+        CreateGetUserSelectedVoIPAddressLC(
+            MPhCntContactManager& aContactManager ) const
+    {
+    return CPhCntGetUserSelectedVoIPAddressLink::NewLC( aContactManager, EFalse );
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntServiceRequestParamFactory
+// Creates new instance.
+// ---------------------------------------------------------------------------
+//     
+MPhCntServiceRequestParam* 
+    CPhCntServiceRequestParamFactory::CreateGetUserSelectedDtmfNumberLinkLC( 
+        MPhCntContactManager& aContactManager ) const
+    {
+    return CPhCntGetUserSelectedDtmfNumberLink::NewLC( aContactManager );
+    }
+    
+// ---------------------------------------------------------------------------
+// From MPhCntServiceRequestParamFactory
+// Creates new instance.
+// ---------------------------------------------------------------------------
+//    
+MPhCntServiceRequestParam* 
+    CPhCntServiceRequestParamFactory::
+        CreateGetPhoneNumberFromContactParamLC( const TDesC8& aContactLink,
+            const CPhCntSingleItemFetch::TCallType aCallType ) const
+    {
+    CVPbkContactLinkArray* linkArray = CVPbkContactLinkArray::NewLC( 
+        aContactLink, iContactManager->ContactStoresL() );
+    CPhCntGetPhoneNumberReqParam* param = 
+        CPhCntGetPhoneNumberReqParam::NewL( *iContactManager, 
+            *linkArray, aCallType );
+    CleanupStack::PopAndDestroy( linkArray );
+    CleanupStack::PushL( param );
+    return param;   
+    }
+
+// ---------------------------------------------------------------------------
+// From MPhCntServiceRequestParamFactory
+// Creates new instance.
+// ---------------------------------------------------------------------------
+//    
+MPhCntServiceRequestParam* 
+    CPhCntServiceRequestParamFactory::CreateGetPhoneNumberFromContactParamL(
+    const TDesC8& aContactLink,
+    const CPhCntSingleItemFetch::TCallType aCallType ) const
+    {
+    CVPbkContactLinkArray* linkArray = CVPbkContactLinkArray::NewLC( 
+        aContactLink, iContactManager->ContactStoresL() );
+    CPhCntGetPhoneNumberReqParam* param = 
+        CPhCntGetPhoneNumberReqParam::NewL( *iContactManager, 
+            *linkArray, aCallType );
+    CleanupStack::PopAndDestroy( linkArray );
+    return param;        
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/tphcntservicerequestparams.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,562 @@
+/*
+* 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:  Classes for service requests made to CPhCntService
+*
+*/
+
+#include <coehelp.h>
+#include <AiwGenericParam.h>
+#include <AiwContactAssignDataTypes.h>
+#include <AiwGenericParam.hrh>
+#include <AiwContactSelectionDataTypes.h>
+#include <CVPbkFieldTypeSelector.h>
+#include <CVPbkContactStoreUriArray.h>
+#include <MVPbkContactLinkArray.h>
+#include <RVPbkContactFieldDefaultPriorities.h>
+#include <talogger.h>
+
+#include "tphcntservicerequestparams.h"
+#include "MPhCntContactManager.h"
+#include "cphcntcontactstoreuris.h"
+#include "CPhCntSingleItemFetch.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntServiceRequestParams::CPhCntServiceRequestParams(
+    TAiwServiceCommands aAiwCommand ) : 
+    iAiwCommand( aAiwCommand )
+    {
+    }
+    
+CPhCntServiceRequestParams::~CPhCntServiceRequestParams()
+    {
+    delete iGenericParamList;
+    iDefaultPriorities.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+void CPhCntServiceRequestParams::BaseConstructL()
+    {
+    iGenericParamList = CAiwGenericParamList::NewL();
+    }
+    
+// ---------------------------------------------------------------------------
+// Gives the command
+// ---------------------------------------------------------------------------
+//
+TAiwServiceCommands CPhCntServiceRequestParams::Command() const
+    {
+    return iAiwCommand;
+    }
+    
+// ---------------------------------------------------------------------------
+// Gives the in param list
+// ---------------------------------------------------------------------------
+//
+const CAiwGenericParamList& CPhCntServiceRequestParams::InParamList() const
+    {
+    return *iGenericParamList;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntCreateNewContactParams::CPhCntCreateNewContactParams(
+    const TDesC& aPhoneNumber ) : 
+    CPhCntServiceRequestParams( KAiwCmdAssign ),
+    iPhoneNumber( aPhoneNumber )
+    {        
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntCreateNewContactParams* CPhCntCreateNewContactParams::NewL(
+    const TDesC& aPhoneNumber )
+    {
+    CPhCntCreateNewContactParams* self = 
+        CPhCntCreateNewContactParams::NewLC( aPhoneNumber );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//    
+CPhCntCreateNewContactParams* CPhCntCreateNewContactParams::NewLC(
+    const TDesC& aPhoneNumber )
+    {
+    CPhCntCreateNewContactParams* self = 
+        new( ELeave )CPhCntCreateNewContactParams( aPhoneNumber );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+void CPhCntCreateNewContactParams::ConstructL()
+    {
+    BaseConstructL();
+    
+    AiwContactAssign::TAiwSingleContactAssignDataV1 data = 
+        AiwContactAssign::TAiwSingleContactAssignDataV1();
+        
+    // EHideEditorExit has to be set because otherwise AIW provider offers
+    // exit menu item which will also exit the phone application.
+    data.SetFlags( AiwContactAssign::ECreateNewContact | 
+                   AiwContactAssign::EHideEditorExit ); 
+
+    iGenericParamList->AppendL(
+        TAiwGenericParam(
+            EGenericParamPhoneNumber,
+            TAiwVariant( iPhoneNumber ) ) );
+            
+    iGenericParamList->AppendL( 
+        TAiwGenericParam(
+            EGenericParamContactAssignData,
+            TAiwVariant( 
+                AiwContactAssign::TAiwSingleContactAssignDataV1Pckg( data ) ) ) );
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntUpdateExistingContact::CPhCntUpdateExistingContact(
+    const TDesC& aPhoneNumber ) : 
+    CPhCntServiceRequestParams( KAiwCmdAssign ),
+    iPhoneNumber( aPhoneNumber )
+    {        
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntUpdateExistingContact* CPhCntUpdateExistingContact::NewL(
+    const TDesC& aPhoneNumber )
+    {
+    CPhCntUpdateExistingContact* self = 
+        CPhCntUpdateExistingContact::NewLC( aPhoneNumber );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//    
+CPhCntUpdateExistingContact* CPhCntUpdateExistingContact::NewLC(
+    const TDesC& aPhoneNumber )
+    {
+    CPhCntUpdateExistingContact* self = 
+        new( ELeave )CPhCntUpdateExistingContact( aPhoneNumber );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+void CPhCntUpdateExistingContact::ConstructL()
+    {
+    BaseConstructL();
+    
+    AiwContactAssign::TAiwSingleContactAssignDataV1 data = 
+        AiwContactAssign::TAiwSingleContactAssignDataV1();
+        
+    data.SetFlags( AiwContactAssign::EHideEditorExit );
+    
+    iGenericParamList->AppendL(
+        TAiwGenericParam(
+            EGenericParamPhoneNumber,
+            TAiwVariant( iPhoneNumber ) ) );
+            
+    iGenericParamList->AppendL( 
+        TAiwGenericParam(
+            EGenericParamContactAssignData,
+            TAiwVariant( 
+                AiwContactAssign::TAiwSingleContactAssignDataV1Pckg( data ) ) ) );
+    }
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntGetUserSelectedPhoneNumberLink*   
+    CPhCntGetUserSelectedPhoneNumberLink::NewLC(
+        TBool aCallUsedWithLSK, MPhCntContactManager& aContactManager )
+    {
+    CPhCntGetUserSelectedPhoneNumberLink* self = 
+        new( ELeave )CPhCntGetUserSelectedPhoneNumberLink();
+    CleanupStack::PushL( self );
+    self->ConstructL( aCallUsedWithLSK, aContactManager );
+    return self;
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntGetUserSelectedPhoneNumberLink::CPhCntGetUserSelectedPhoneNumberLink() : 
+    CPhCntServiceRequestParams( KAiwCmdSelect )
+    {
+    }
+    
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//  
+CPhCntGetUserSelectedPhoneNumberLink::~CPhCntGetUserSelectedPhoneNumberLink()
+    {
+    delete iContactViewFilter;
+    }
+    
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+// 
+void CPhCntGetUserSelectedPhoneNumberLink::ConstructL(
+    TBool aCallUsedWithLSK, MPhCntContactManager& aContactManager )
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPhCntGetUserSelectedPhoneNumberLink::ConstructL" );
+    BaseConstructL();
+    iContactViewFilter = aContactManager.CreateFieldTypeSelectorL();
+
+    aContactManager.AppendFilterToSelectorL( *iContactViewFilter,   
+        EVPbkContactViewFilterPhoneNumber );
+    
+	iDefaultPriorities.Append( EVPbkDefaultTypePhoneNumber );    
+	
+    TAiwSingleItemSelectionDataV3 data = TAiwSingleItemSelectionDataV3();
+	  
+    if( aCallUsedWithLSK )
+        {
+        data.SetAddressSelectType( EAiwCallItemSelect );	    
+        }
+    else
+        {
+        data.SetAddressSelectType( EAiwPhoneNumberSelect );
+        }
+	
+	data.SetDefaultPriorities( iDefaultPriorities ); 	
+    data.SetFetchFilter( iContactViewFilter );
+        
+    iGenericParamList->AppendL(
+        TAiwGenericParam(
+            EGenericParamContactSelectionData,
+            TAiwVariant( TAiwSingleItemSelectionDataV3Pckg( data ) ) ) );            
+
+	// Pass an array of currently active contact store uris
+    CPhCntContactStoreUris& storeUris = aContactManager.ContactStoreUrisL();
+	CVPbkContactStoreUriArray* uriArray = storeUris.ActiveContactStoresL(); 
+	CleanupStack::PushL( uriArray );
+	if ( uriArray->Count() > 0 ) 
+		{ 
+		HBufC8* packedUris = uriArray->PackLC(); 
+		iGenericParamList->AppendL( 
+	        TAiwGenericParam( 
+            	EGenericParamContactStoreUriArray, 
+            	TAiwVariant( *packedUris ) 
+            	) 
+           	); 
+		CleanupStack::PopAndDestroy( packedUris ); 
+		}
+	CleanupStack::PopAndDestroy( uriArray );
+    }
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntGetUserSelectedVoIPAddressLink*   
+    CPhCntGetUserSelectedVoIPAddressLink::NewLC(
+        MPhCntContactManager& aContactManager,
+        TBool aCallUsedWithLSK )
+    {
+    CPhCntGetUserSelectedVoIPAddressLink* self = 
+        new( ELeave )CPhCntGetUserSelectedVoIPAddressLink();
+    CleanupStack::PushL( self ); 
+    self->ConstructL( aContactManager, aCallUsedWithLSK );
+    return self;
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntGetUserSelectedVoIPAddressLink::CPhCntGetUserSelectedVoIPAddressLink() : 
+    CPhCntServiceRequestParams( KAiwCmdSelect )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+// 
+void CPhCntGetUserSelectedVoIPAddressLink::ConstructL(
+    MPhCntContactManager& aContactManager,
+    TBool aCallUsedWithLSK )
+    {
+    BaseConstructL();
+
+    // Construct empty filter
+    iContactViewFilter = aContactManager.CreateFieldTypeSelectorL();
+
+    // Append the filter object with suitable criteria
+    aContactManager.AppendFilterToSelectorL( *iContactViewFilter,
+        EVPbkContactViewFilterVoIP );
+    aContactManager.AppendFilterToSelectorL( *iContactViewFilter,   
+        EVPbkContactViewFilterPhoneNumber );
+    
+    iDefaultPriorities.Append( EVPbkDefaultTypeVoIP ); 
+                     
+    TAiwSingleItemSelectionDataV3 data = TAiwSingleItemSelectionDataV3();
+    
+    
+    if( aCallUsedWithLSK )
+        {
+        data.SetCommAddressSelectType( EAiwCommVOIPCall );
+        data.SetAddressSelectType( EAiwVoIPItemSelect );	    
+        }
+    else
+        {
+        data.SetCommAddressSelectType( EAiwCommVOIPCall );
+        }
+    
+    
+    data.SetFetchFilter( iContactViewFilter );
+	data.SetDefaultPriorities( iDefaultPriorities ); 	
+	
+    iGenericParamList->AppendL(
+        TAiwGenericParam(
+            EGenericParamContactSelectionData,
+            TAiwVariant(TAiwSingleItemSelectionDataV3Pckg( data ) ) ) );
+
+	// Pass an array of currently active contact store uris
+    CPhCntContactStoreUris* storeUris = CPhCntContactStoreUris::NewL();
+	CleanupStack::PushL( storeUris );
+	CVPbkContactStoreUriArray* uriArray = storeUris->ActiveContactStoresL();
+	CleanupStack::PushL( uriArray );
+	if ( uriArray->Count() > 0 ) 
+		{ 
+		HBufC8* packedUris = uriArray->PackLC(); 
+		iGenericParamList->AppendL( 
+	        TAiwGenericParam( 
+            	EGenericParamContactStoreUriArray, 
+            	TAiwVariant(*packedUris) 
+            	) 
+           	); 
+		CleanupStack::PopAndDestroy( packedUris ); 
+		}
+	CleanupStack::PopAndDestroy( uriArray );
+	CleanupStack::PopAndDestroy( storeUris );
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//    
+CPhCntGetUserSelectedDtmfNumberLink* 
+    CPhCntGetUserSelectedDtmfNumberLink::NewLC(
+        MPhCntContactManager& aContactManager )
+    {
+    CPhCntGetUserSelectedDtmfNumberLink* self = 
+        new( ELeave )CPhCntGetUserSelectedDtmfNumberLink();
+    CleanupStack::PushL( self );
+    self->ConstructL( aContactManager );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//  
+CPhCntGetUserSelectedDtmfNumberLink::~CPhCntGetUserSelectedDtmfNumberLink()
+    {
+    delete iContactViewFilter;
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntGetUserSelectedDtmfNumberLink::CPhCntGetUserSelectedDtmfNumberLink() : 
+    CPhCntServiceRequestParams( KAiwCmdSelect )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhCntGetUserSelectedDtmfNumberLink::ConstructL(
+    MPhCntContactManager& aContactManager )
+    {
+    BaseConstructL();
+
+    // Construct empty filter
+    iContactViewFilter = aContactManager.CreateFieldTypeSelectorL();
+
+    // Append the filter object with suitable criteria
+    aContactManager.AppendFilterToSelectorL( *iContactViewFilter,
+        EVPbkContactViewFilterDTMF );
+    aContactManager.AppendFilterToSelectorL( *iContactViewFilter,   
+        EVPbkContactViewFilterPhoneNumber );
+
+    iDefaultPriorities.Append( EVPbkDefaultTypePhoneNumber ); 
+                     
+    TAiwSingleItemSelectionDataV3 data;
+    data.SetAddressSelectType(EAiwDTMFPhoneNumberSelect);
+    data.SetFetchFilter( iContactViewFilter );
+	data.SetDefaultPriorities( iDefaultPriorities ); 	
+                 
+    iGenericParamList->AppendL(
+        TAiwGenericParam( 
+            EGenericParamContactSelectionData,
+            TAiwVariant( TAiwSingleItemSelectionDataV3Pckg( data ) ) ) );
+	// Pass an array of currently active contact store uris
+    CPhCntContactStoreUris* storeUris = CPhCntContactStoreUris::NewL();
+	CleanupStack::PushL( storeUris );				
+	CVPbkContactStoreUriArray* uriArray = storeUris->ActiveContactStoresL(); 
+	CleanupStack::PushL( uriArray );
+	if ( uriArray->Count() > 0 ) 
+		{ 
+		HBufC8* packedUris = uriArray->PackLC(); 
+		iGenericParamList->AppendL( 
+	        TAiwGenericParam( 
+            	EGenericParamContactStoreUriArray, 
+            	TAiwVariant(*packedUris) 
+            	) 
+           	); 
+		CleanupStack::PopAndDestroy( packedUris ); 
+		}
+	CleanupStack::PopAndDestroy( uriArray );
+	CleanupStack::PopAndDestroy( storeUris );
+    }
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//    
+CPhCntGetPhoneNumberReqParam* 
+    CPhCntGetPhoneNumberReqParam::NewL(
+    	MPhCntContactManager& aContactManager, 
+        MVPbkContactLinkArray& aLinkArray,
+        const CPhCntSingleItemFetch::TCallType aCallType )
+    {
+    CPhCntGetPhoneNumberReqParam* self = 
+        new( ELeave )CPhCntGetPhoneNumberReqParam();
+    CleanupStack::PushL( self );
+    self->ConstructL( aContactManager, aLinkArray, aCallType );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//  
+CPhCntGetPhoneNumberReqParam::~CPhCntGetPhoneNumberReqParam()
+    {    
+    delete iContactViewFilter;
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntGetPhoneNumberReqParam::CPhCntGetPhoneNumberReqParam() : 
+    CPhCntServiceRequestParams( KAiwCmdSelect )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhCntGetPhoneNumberReqParam::ConstructL(
+	MPhCntContactManager& aContactManager,
+    MVPbkContactLinkArray& aLinkArray,
+    const CPhCntSingleItemFetch::TCallType aCallType )
+    {
+    BaseConstructL();
+                
+	// Set filtering
+	TVPbkContactViewFilter filter = EVPbkContactViewFilterPhoneNumber;	    		                    		
+	TAiwSingleItemSelectionDataV3 data; 
+	data.SetAddressSelectType(  EAiwCallItemSelect );
+	switch( aCallType )
+		{				
+		case CPhCntSingleItemFetch::ECallPhoneNumber:			
+    		iDefaultPriorities.Append( EVPbkDefaultTypePhoneNumber );    		
+    		break;
+    	case CPhCntSingleItemFetch::ECallVoip:
+    		iDefaultPriorities.Append( EVPbkDefaultTypeVoIP );
+    		filter = EVPbkContactViewFilterVoIP;
+    		data.SetCommAddressSelectType( EAiwCommVOIPCall );
+    		data.SetAddressSelectType(  EAiwVOIPSelect ); 		
+    		break;
+    	case CPhCntSingleItemFetch::ECallVideoNumber:
+    		iDefaultPriorities.Append( EVPbkDefaultTypeVideoNumber );
+    		filter = EVPbkContactViewFilterVideoNumber;
+    		break;    	    		
+    	default:
+            break;
+		}
+		
+	// Construct empty filter
+    iContactViewFilter = aContactManager.CreateFieldTypeSelectorL();
+
+    // Append the filter object with suitable criteria
+    aContactManager.AppendFilterToSelectorL( *iContactViewFilter, filter );   			
+                                                 		
+	data.SetFetchFilter( iContactViewFilter ); 
+	data.SetDefaultPriorities( iDefaultPriorities ); 		
+	
+    iGenericParamList->AppendL(
+        TAiwGenericParam(
+            EGenericParamContactSelectionData,
+            TAiwVariant( TAiwSingleItemSelectionDataV3Pckg( data ) ) ) );
+            
+	// Contact link array		
+	HBufC8* packedLinks = aLinkArray.PackLC();
+	iGenericParamList->AppendL( 
+	    TAiwGenericParam( 
+	    	EGenericParamContactLinkArray, 
+	    	TAiwVariant( *packedLinks ) 
+	    	) 
+	   	); 
+   	CleanupStack::PopAndDestroy( packedLinks );
+   			
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/tphcntsipuri.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,145 @@
+/*
+* 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:  SIP URI descriptor
+*
+*/
+
+
+#include "tphcntsipuri.h"
+
+const TInt KSipPrefixLength = 4;
+_LIT( KPhCntSipUriAt, "@" );
+_LIT( KPhCntSipPrefix, "sip:" );
+_LIT( KPhCntSipUriSeparatorBegin, "<" );
+_LIT( KPhCntSipUriSeparatorEnd, ">" );
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+TPhCntSipURI::TPhCntSipURI( 
+    const TDesC& aSipURI,
+    TInt aDigitsForMatching ) : 
+    iSipURI( aSipURI ),
+    iDigitsForMatching( aDigitsForMatching )
+    {
+    RemoveUnusedChars();
+    const TInt sipUriAtPos( iSipURIStripped.Find( KPhCntSipUriAt ) );
+    if( sipUriAtPos > 0 ) 
+        {
+        iUserNamePart.Set( iSipURIStripped.Left( sipUriAtPos ) );
+    	}
+    else
+        {
+        iUserNamePart.Set( iSipURIStripped );
+        }
+
+    if ( iDigitsForMatching )
+        {
+        // Match is done with username part if iDigitsForMatching is given.
+        // E.g. If username part contains valid cs number (sip:0401234567@domain.com)
+        // and iDigitsForMatching is 7 match is done with string 1234567. 
+        TInt length( 0 );
+                                
+        if( sipUriAtPos > 0 )
+            {
+            length = iUserNamePart.Length() > aDigitsForMatching ? 
+                        aDigitsForMatching :
+                        iUserNamePart.Length();
+                                
+            iFixedUserNamePart.Set( iUserNamePart.Right( length ) );
+            }
+        else
+            {
+            length = iSipURIStripped.Length() > aDigitsForMatching ? 
+                        aDigitsForMatching :
+                        iSipURIStripped.Length();
+            
+            iFixedUserNamePart.Set( iSipURIStripped.Right( length ) );
+            }
+        }
+    
+    }
+    
+// ---------------------------------------------------------------------------
+// Gives the username part of sip uri.
+// ---------------------------------------------------------------------------
+//
+const TDesC& TPhCntSipURI::UserNamePart() const
+    {
+    return iUserNamePart;
+    }
+
+// ---------------------------------------------------------------------------
+// Gives the whole sip uri.
+// ---------------------------------------------------------------------------
+//    
+const TDesC& TPhCntSipURI::SipURI() const
+    {
+    return iSipURIStripped;
+    }
+    
+// ---------------------------------------------------------------------------
+// Gives the fixed username part of sip uri.
+// ---------------------------------------------------------------------------
+//    
+const TDesC& TPhCntSipURI::FixedUserNamePart() const
+    {
+    return iFixedUserNamePart;
+    }
+
+// ---------------------------------------------------------------------------
+// Removes possible < and > marks and sip: prefix from sip uri.
+// ---------------------------------------------------------------------------
+//    
+void TPhCntSipURI::RemoveUnusedChars()
+    {
+    TPtrC sipuri( iSipURI );
+    
+    // Remove begin mark
+    const TInt startMarkPos( sipuri.Find( KPhCntSipUriSeparatorBegin ) );
+    if( startMarkPos >= 0 ) 
+        {
+        // Extract the part after "<" mark ie take the part from end of 
+        // the sip uri to "<" mark.
+        sipuri.Set( sipuri.Right( iSipURI.Length() - ( startMarkPos + 1 ) ) );
+        }
+    
+    // Remove end mark
+    const TInt endMarkPos( sipuri.Find( KPhCntSipUriSeparatorEnd ) );
+    if( endMarkPos >= 0 )
+        {
+        sipuri.Set( sipuri.Left( endMarkPos ) );
+        }
+        
+    // "sip:" is not used when comparing addresses. 
+    if ( sipuri.Length() > KSipPrefixLength )
+        {
+        TBuf<KSipPrefixLength> possibleSipPrefix;
+        possibleSipPrefix.Copy( sipuri.Left( KSipPrefixLength ) );
+        possibleSipPrefix.LowerCase();
+               
+        if ( possibleSipPrefix.Compare( KPhCntSipPrefix ) == KErrNone )
+            {
+            sipuri.Set( sipuri.Right( sipuri.Length() - KSipPrefixLength ) );
+            }
+        }
+    
+    iSipURIStripped.Set( sipuri );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/tphcnttxttospeech.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,219 @@
+/*
+* 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:  Constructs text to speech descriptor.
+*
+*/
+
+
+#include "tphcnttxttospeech.h"
+#include "mphcntcontactfields.h"
+
+// Separator between lastname/firstname for TTS text.
+_LIT( KPhCntTtsNamesDelimeter, " " );
+
+// Number of languages that use lastname-firstname order
+const TInt KPhCntTtsNumberOfSwappedLanguages = 7;
+
+// Languages which use lastname-firstname order
+const TLanguage KPhCntTtsSwappedLanguages[KPhCntTtsNumberOfSwappedLanguages] = 
+    {
+    ELangHungarian,       // 17
+    ELangTaiwanChinese,   // 29
+    ELangHongKongChinese, // 30
+    ELangPrcChinese,      // 31
+    ELangJapanese,		  // 32
+    ELangKorean,          // 65
+    ELangVietnamese       // 96
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+TPhCntTxtToSpeech::TPhCntTxtToSpeech(
+    const TDesC& aFirstName,
+    const TDesC& aSecondName,
+    const TDesC& aLastName,
+    const TDesC& aCompanyName,
+    const TDesC& aFirstNamePronunciation,
+    const TDesC& aLastNamePronunciation,
+    const TDesC& aCompanyNamePronunciation,
+    TLanguage aCurrentLanguage ) :
+    iFirstName( aFirstName ),
+    iSecondName( aSecondName ),
+    iLastName( aLastName ),
+    iCompanyName( aCompanyName ),
+    iFirstNamePronunciation( aFirstNamePronunciation ),
+    iLastNamePronunciation( aLastNamePronunciation ),
+    iCompanyNamePronunciation( aCompanyNamePronunciation ),
+    iCurrentLanguage( aCurrentLanguage )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Constructs text to speech descriptor.
+// ---------------------------------------------------------------------------
+//
+void TPhCntTxtToSpeech::GetTextToSpeechL( HBufC*& aTxtToSpeech ) const
+    {
+    aTxtToSpeech = AllocAndTrimL( iSecondName );
+    
+    // Try contact name (first & last name).
+    if ( !aTxtToSpeech )
+        {
+        HBufC* trimmedFirstName = GetTrimmedNameLC( 
+            iFirstName, iFirstNamePronunciation );
+            
+        HBufC* trimmedLastName = GetTrimmedNameLC( 
+            iLastName, iLastNamePronunciation );
+
+        // Determine order.
+        const TBool swapNameOrder = SwapNameOrder();
+
+        HBufC* firstComponent = trimmedFirstName;
+        HBufC* lastComponent = trimmedLastName;
+        if ( swapNameOrder )
+            {
+            firstComponent = trimmedLastName;
+            lastComponent = trimmedFirstName;
+            }
+
+        // Calculate length.
+        const TInt totalLength( 
+            CalculateTxtToSpeechLength( firstComponent, lastComponent ) );
+        
+        // Compose.
+        if ( totalLength )
+            {
+            aTxtToSpeech = HBufC::NewL( totalLength );
+            TPtr ptr = aTxtToSpeech->Des();
+
+            if ( firstComponent )
+                {
+                ptr.Append( *firstComponent );
+                if ( lastComponent )
+                    {
+                    ptr.Append( KPhCntTtsNamesDelimeter );
+                    }
+                }
+            if ( lastComponent )
+                {
+                ptr.Append( *lastComponent );
+                }
+            }
+
+        CleanupStack::PopAndDestroy( trimmedLastName );
+        CleanupStack::PopAndDestroy( trimmedFirstName );
+        }
+
+    // Try company name.
+    if ( !aTxtToSpeech )
+        {
+        aTxtToSpeech = AllocAndTrimL( iCompanyNamePronunciation );
+        if( !aTxtToSpeech ) 
+            {
+            aTxtToSpeech = AllocAndTrimL( iCompanyName );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Copies the text and trims it.
+// ---------------------------------------------------------------------------
+//    
+HBufC* TPhCntTxtToSpeech::AllocAndTrimL( const TDesC& aText ) const
+    {
+    HBufC* result = NULL;
+
+    if( aText.Length() > 0 )
+        {
+        result = aText.AllocL();
+        TPtr ptr = result->Des();
+        ptr.Trim();
+        if ( !ptr.Length() )
+            {
+            delete result;
+            result = NULL;
+            }
+        }
+        
+    return result;
+    }
+    
+// -----------------------------------------------------------------------------
+// Swaps name order depending on current language.
+// -----------------------------------------------------------------------------
+//
+TBool TPhCntTxtToSpeech::SwapNameOrder() const
+    {
+    TBool result = EFalse;
+    for ( TInt index = 0; index < KPhCntTtsNumberOfSwappedLanguages; index++ )
+        {
+        if ( KPhCntTtsSwappedLanguages[ index ] == iCurrentLanguage )
+            {
+            result = ETrue;
+            index = KPhCntTtsNumberOfSwappedLanguages;
+            }
+        }
+
+    return result;
+    }
+    
+// -----------------------------------------------------------------------------
+// Takes suitable name, copies and trims it.
+// -----------------------------------------------------------------------------
+//  
+HBufC* TPhCntTxtToSpeech::GetTrimmedNameLC( 
+    const TDesC& aWritenName, 
+    const TDesC& aNamePronunciation ) const
+    {
+    HBufC* trimmedName = AllocAndTrimL( aNamePronunciation );
+    if ( !trimmedName )
+        {
+        trimmedName = AllocAndTrimL( aWritenName );
+        }
+    CleanupStack::PushL( trimmedName );
+    return trimmedName;
+    }
+
+// -----------------------------------------------------------------------------
+// Calculates the length of text to speech string.
+// -----------------------------------------------------------------------------
+//
+TInt TPhCntTxtToSpeech::CalculateTxtToSpeechLength( 
+    const HBufC* const aFirstComponent, 
+    const HBufC* const aLastComponent ) const
+    {
+    TInt totalLength = 0;
+    if( aFirstComponent && aLastComponent ) 
+        {
+        totalLength += KPhCntTtsNamesDelimeter().Length();
+        }
+    
+    if( aFirstComponent )
+        {
+        totalLength += aFirstComponent->Length();
+        }
+        
+    if( aLastComponent )
+        {
+        totalLength += aLastComponent->Length();
+        }
+        
+    return totalLength;
+    }
+
+//  End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/tphcntvoipmatchArray.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,238 @@
+/*
+* 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:  Array of voip matches.
+*
+*/
+
+
+#include "tphcntvoipmatchArray.h"
+#include "CPhCntContact.h"
+#include "tphcntsipuri.h"
+#include "tphcntcontactutil.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+TPhCntVoipMatchArray::TPhCntVoipMatchArray()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//    
+TPhCntVoipMatchArray::~TPhCntVoipMatchArray()
+    {
+    iMatches.Reset();
+    }
+
+// ---------------------------------------------------------------------------
+// Addes contact to array.
+// ---------------------------------------------------------------------------
+//
+void TPhCntVoipMatchArray::AppendL( 
+    CPhCntContact* aVoipMatch )
+    {
+    User::LeaveIfError( iMatches.Append( aVoipMatch ) );
+    }
+
+// ---------------------------------------------------------------------------
+// Finds first match that has voip number.
+// ---------------------------------------------------------------------------
+//
+CPhCntContact* TPhCntVoipMatchArray::FindFullMatch( 
+    const TPhCntSipURI& aSipURI )
+    {
+    CPhCntContact* foundContact = NULL;
+    CPhCntContact* contact = NULL;
+    
+    const TPhCntVoipMatchArray::TMatchType type = 
+        FindFullOrUsernameMatch( aSipURI, contact );
+        
+    if( type == TPhCntVoipMatchArray::EFullMatch ) 
+        {
+        foundContact = contact;
+        }
+    RemoveMatchFromArray( foundContact );
+    return foundContact;
+    }
+
+// ---------------------------------------------------------------------------
+// Finds full or username match.
+// ---------------------------------------------------------------------------
+//    
+CPhCntContact* TPhCntVoipMatchArray::FindFullOrUsernameMatch( 
+    const TPhCntSipURI& aSipUri,
+    const TInt aCharsForMatch )
+    {
+    CPhCntContact* contact = NULL;
+    FindFullOrUsernameMatch( aSipUri, contact, aCharsForMatch );
+    RemoveMatchFromArray( contact );
+    return contact;
+    }
+
+// ---------------------------------------------------------------------------
+// Destroys the items in array.
+// ---------------------------------------------------------------------------
+//   
+void TPhCntVoipMatchArray::ReleaseMatches()
+    {
+    const TInt matchesCount( iMatches.Count() );
+    for( TInt i = 0; i < matchesCount; i++ )
+        {
+        iMatches[i]->Release();
+        }
+    iMatches.Reset();
+    }
+ 
+// ---------------------------------------------------------------------------
+// Removes match from array.
+// ---------------------------------------------------------------------------
+//   
+void TPhCntVoipMatchArray::RemoveMatchFromArray( 
+    const CPhCntContact* const aMatch )
+    {
+    const TInt index( iMatches.Find( aMatch ) );
+    if( index >= 0 )
+        {
+        iMatches.Remove( index );    
+        }
+    iMatches.Compress();
+    }
+
+// ---------------------------------------------------------------------------
+// Determines if contact has aSipURI voip number.
+// ---------------------------------------------------------------------------
+//    
+TPhCntVoipMatchArray::TMatchType TPhCntVoipMatchArray::HasVoipNumber( 
+    CPhCntContact& aContact,
+    const TPhCntSipURI& aSipURI,
+    const TInt aCharsForMatch ) const
+    {
+    const RArray<TPhCntNumber>& allNumbers = aContact.AllNumbers();
+    const TInt numbers( allNumbers.Count() );
+    TMatchType matchType = TPhCntVoipMatchArray::ENone;
+    
+    for( TInt i = 0; i < numbers; i++ ) 
+        {
+        TPhCntNumber number = allNumbers[i];
+        if( number.Type() == CPhCntContact::EVoipNumber ||
+            number.Type() == CPhCntContact::EMobileNumber || 
+            number.Type() == CPhCntContact::EStandardNumber ||
+            number.Type() == CPhCntContact::EPagerNumber ||
+            number.Type() == CPhCntContact::EVideoNumber ||
+            number.Type() == CPhCntContact::EAssistantNumber ||
+            number.Type() == CPhCntContact::EFaxNumber ||
+            number.Type() == CPhCntContact::ECarNumber
+             ) 
+            {
+            // If uris are the same then we have a full match.
+            TPhCntSipURI matchURI( number.Number(), aCharsForMatch );
+			// full match if uris are the same (usernamepart requires
+			// case sensitive match, domain is not sensitive)
+            if ( matchURI.SipURI().CompareF( aSipURI.SipURI() ) 
+                == KErrNone &&
+                matchURI.UserNamePart().Compare( aSipURI.UserNamePart() )
+                == KErrNone )
+                {
+                matchType = TPhCntVoipMatchArray::EFullMatch;
+                aContact.SetMatchedVoipNumber( matchURI );
+                break;
+                }
+            else if( matchURI.UserNamePart().Compare( aSipURI.UserNamePart() ) 
+                == KErrNone ) 
+                {
+                matchType = TPhCntVoipMatchArray::EUserNameMatch;
+                aContact.SetMatchedVoipNumber( matchURI );
+                }
+            else if( 0 != aCharsForMatch && matchURI.FixedUserNamePart().Compare( 
+                     aSipURI.FixedUserNamePart() ) == KErrNone ) 
+                {
+                matchType = TPhCntVoipMatchArray::EUserNameMatch;
+                aContact.SetMatchedVoipNumber( matchURI );
+                }
+            }
+        }
+    return matchType;
+    }
+
+// ---------------------------------------------------------------------------
+// Finds contact that has aSipURI voip number
+// ---------------------------------------------------------------------------
+//    
+TPhCntVoipMatchArray::TMatchType 
+    TPhCntVoipMatchArray::FindFullOrUsernameMatch( 
+        const TPhCntSipURI& aSipUri,
+        CPhCntContact*& aFoundContact,
+        const TInt aCharsForMatch )
+    {
+    CPhCntContact* userNameMatch = NULL;
+    CPhCntContact* fullMatch = NULL;
+    TBool duplicateMatch( EFalse );
+    TMatchType matchType = TPhCntVoipMatchArray::ENone;
+    // Go through all voip matches.
+    const TInt matchesCount( iMatches.Count() );
+
+    for( TInt i = 0; i < matchesCount; i++ )
+        {
+       
+        CPhCntContact* possibleMatch = iMatches[i];
+
+        matchType = HasVoipNumber( *possibleMatch, aSipUri, aCharsForMatch ) ;
+        if( matchType == TPhCntVoipMatchArray::EFullMatch ) 
+            {
+            if ( fullMatch && 
+                 !TPhCntContactUtil::AreFirstAndLastAndCompanyNameSame( 
+                         *fullMatch, *possibleMatch ) )
+                {
+                // Duplicate match means no match found
+                fullMatch = NULL;
+                userNameMatch = NULL;
+                break;
+                }
+            fullMatch = possibleMatch;
+            }
+        // Once username match is found it 
+        // will be the match if fullmatch is not found.
+        else if( matchType == TPhCntVoipMatchArray::EUserNameMatch &&
+                 EFalse == duplicateMatch ) 
+            {
+            if ( userNameMatch )
+                {
+                // Duplicate username match.
+                duplicateMatch = ETrue;
+                }
+            userNameMatch = possibleMatch;
+            }
+        }
+    
+    if( fullMatch )
+        {
+        aFoundContact = fullMatch;
+        }
+    else if ( duplicateMatch )
+        {
+        aFoundContact = NULL;
+        }
+    else
+        {
+        aFoundContact = userNameMatch;
+        }
+    return matchType;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/Group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,49 @@
+/*
+* 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:  Bld.inf for PhoneCntFinder
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../inc/CPhoneCntFactory.h                   |../../../inc/cphonecntfactory.h
+../inc/CPhoneCntSaveAddToName.h             |../../../inc/cphonecntsaveaddtoname.h
+../inc/MPhCntMatch.h                        |../../../inc/mphcntmatch.h
+../inc/CPhCntMatcher.h                      |../../../inc/cphcntmatcher.h
+../inc/cphcntcontactid.h                    |../../../inc/cphcntcontactid.h
+
+../inc/Misc/CPhCntSingleItemFetch.h         |../../../inc/cphcntsingleitemfetch.h
+../inc/Misc/CPhCntThumbnailLoader.h         |../../../inc/cphcntthumbnailloader.h
+../inc/Misc/MPhCntThumbnailLoaderObserver.h |../../../inc/mphcntthumbnailloaderobserver.h
+../inc/Misc/CPhCntSpeedDialMonitor.h        |../../../inc/cphcntspeeddialmonitor.h
+../inc/Misc/CPhCntRfsHandler.h              |../../../inc/cphcntrfshandler.h
+../inc/Misc/CPhCntMmiSecurity.h             |../../../inc/cphcntmmisecurity.h
+../inc/Misc/CPhCntProfileEngine.h           |../../../inc/cphcntprofileengine.h
+../ContactService/inc/cphcntcontactdataselection.h |../../../inc/cphcntcontactdataselection.h 
+../ContactService/inc/mphcntstoreloader.h   |../../../inc/mphcntstoreloader.h
+../ContactService/inc/mphcntstoreloaderobserver.h  |../../../inc/mphcntstoreloaderobserver.h
+
+../Group/phonecntfinder_stub.SIS            /epoc32/data/z/system/install/phonecntfinder_stub.sis
+
+// IBY export
+../rom/PhoneCntFinder.iby                   CORE_APP_LAYER_IBY_EXPORT_PATH(PhoneCntFinder.iby)
+
+PRJ_MMPFILES
+../Group/phonecntfinder.mmp
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/Group/phonecntfinder.mmp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,110 @@
+/*
+* 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 project specification file for PhoneCntFinder.
+*
+*/
+
+#include <platform_paths.hrh>
+
+// Capability assignment.
+CAPABILITY CAP_GENERAL_DLL
+
+// Assign Vendor ID.
+VENDORID VID_DEFAULT
+
+TARGET          phonecntfinder.dll
+TARGETTYPE      dll
+UID             0x1000008d 0x10005998
+
+SOURCEPATH      ../src
+SOURCE          CPhoneCntFactoryImpl.cpp
+SOURCE          CPhoneRawMatchNumberExtractor.cpp
+SOURCE          CPhoneCntPbkOwner.cpp
+SOURCE          CPhoneCntSaveAddToName.cpp
+SOURCE          CPhoneCntNumberParser.cpp
+SOURCE          cphcntthumbnailloaderbase.cpp
+SOURCE          PhCntPanic.cpp
+
+SOURCEPATH      ../src/Misc
+SOURCE          CPhCntThumbnailLoaderImpl.cpp
+SOURCE          CPhCntRfsHandlerImpl.cpp
+SOURCE          CPhCntMmiSecurityImpl.cpp 
+SOURCE          CPhCntProfileEngineImpl.cpp
+
+SOURCEPATH      ../ContactService/src
+SOURCE          CPhCntSingleItemFetchService.cpp
+SOURCE          CPhCntContactStores.cpp
+SOURCE          CPhCntService.cpp
+SOURCE          CPhCntAIWService.cpp
+SOURCE          tphcntaiwserviceobserver.cpp
+SOURCE          CPhCntContactManager.cpp
+SOURCE          CPhCntMatcherImpl.cpp
+SOURCE          tphcntcontactutil.cpp
+SOURCE          cphcntmatchervoipimpl.cpp
+SOURCE          tphcntsipuri.cpp
+SOURCE          cphcntvoipcontactmatchstrategy.cpp
+SOURCE          tphcntvoipmatchArray.cpp
+SOURCE          CPhCntContact.cpp
+SOURCE          cphcntcontactfieldsresolver.cpp
+SOURCE          tphcntcontactfield.cpp
+SOURCE          cphcntmatchcontact.cpp
+SOURCE          cphcntcontactmatchstrategy.cpp
+SOURCE          cphcntfetchcontact.cpp
+SOURCE          cphcntasynctosync.cpp
+SOURCE          cphcntfoundcontacts.cpp
+SOURCE          cphcntspeeddialimpl.cpp
+SOURCE          cphcntcontactlinkarrayfetch.cpp
+SOURCE          cphcntspeeddialcontactlinkfetch.cpp
+SOURCE          cphcntvpbkthumbnailloader.cpp
+SOURCE          cphcntvpbkcontactid.cpp
+SOURCE          tphcntservicerequestparams.cpp
+SOURCE          tphcntservicerequestparamfactory.cpp
+SOURCE          tphcntcontactlinkresult.cpp
+SOURCE          tphcnttxttospeech.cpp
+SOURCE          tphcntnumber.cpp
+SOURCE          cphcntphonebookservices.cpp
+SOURCE          tphcntnullserviceresult.cpp
+SOURCE          cphcntcontactstoreuris.cpp
+SOURCE          tphcntcontactstorestate.cpp
+SOURCE          cphcntcontactdataselectionimpl.cpp
+SOURCE          cphcntstoreloaderimpl.cpp
+
+USERINCLUDE     ../ContactService/inc
+USERINCLUDE     ../inc
+USERINCLUDE     ../inc/Misc
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc               // talogger
+SYSTEMINCLUDE   ../../../inc
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+LIBRARY         euser.lib
+LIBRARY         pbkview.lib             // PhonebookUI.
+LIBRARY         pbk2presentation.lib    // Phonebook2.
+LIBRARY         vpbkeng.lib             // Virtula Phonebook.
+LIBRARY         spdctrl.lib             // Speeddial.
+LIBRARY         rfs.lib                 // Restore factory settings.
+LIBRARY         eikcoctl.lib            // CEikImage.
+LIBRARY         secui.lib               // Security.
+LIBRARY         fbscli.lib              // Speeddial bitmap/icon handling.
+LIBRARY         cone.lib                // CCoeEnv.
+LIBRARY         profileeng.lib          // Profile.
+LIBRARY         cenrepnotifhandler.lib  // CenRep notifyhandler.
+LIBRARY         centralrepository.lib   // CenRep.
+LIBRARY         ecom.lib                // ECOM plugin usage.
+LIBRARY         servicehandler.lib      // AIW framework.
+LIBRARY         bafl.lib                // Descriptor arrays
+
+LIBRARY         featmgr.lib             // Feature manager
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/Group/phonecntfinder.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,29 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing phone contact finder.
+;
+; 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"
Binary file phoneengine/PhoneCntFinder/Group/phonecntfinder_stub.SIS has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/Group/phonecntfinder_stub.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,29 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing phone contact finder stub.
+;
+; Languages
+&EN
+
+; Header
+#{"PhoneCntFinder"}, (0x10005998), 1, 0, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files
+""-"z:\sys\bin\phonecntfinder.dll"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/eabi/phonecntfinderu.def	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,18 @@
+EXPORTS
+	_Z17CreateCntFactoryLv @ 1 NONAME
+	_ZN22CPhoneCntSaveAddToName19HandlePbkOperationLERK4TBufILi100EEi @ 2 NONAME
+	_ZN22CPhoneCntSaveAddToName19HandlePbkOperationLERK4TBufILi100EEi14TCntNumberType @ 3 NONAME
+	_ZN22CPhoneCntSaveAddToNameD0Ev @ 4 NONAME
+	_ZN22CPhoneCntSaveAddToNameD1Ev @ 5 NONAME
+	_ZN22CPhoneCntSaveAddToNameD2Ev @ 6 NONAME
+	_ZN27CCntRawPhoneNumberExtractorC1Ev @ 7 NONAME
+	_ZN27CCntRawPhoneNumberExtractorC2Ev @ 8 NONAME
+	_ZTI22CPhoneCntSaveAddToName @ 9 NONAME
+	_ZTI27CCntRawPhoneNumberExtractor @ 10 NONAME
+	_ZTV22CPhoneCntSaveAddToName @ 11 NONAME
+	_ZTV27CCntRawPhoneNumberExtractor @ 12 NONAME
+	_ZThn4_N22CPhoneCntSaveAddToName19HandlePbkOperationLERK4TBufILi100EEi @ 13 NONAME
+	_ZThn4_N22CPhoneCntSaveAddToName19HandlePbkOperationLERK4TBufILi100EEi14TCntNumberType @ 14 NONAME
+	_ZThn4_N22CPhoneCntSaveAddToNameD0Ev @ 15 NONAME
+	_ZThn4_N22CPhoneCntSaveAddToNameD1Ev @ 16 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/CPhCntMatch.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,145 @@
+/*
+* 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:  Implementation for single match result.
+*
+*/
+
+
+#ifndef CPHCNTMATCH_H
+#define CPHCNTMATCH_H
+
+//  INCLUDES
+#include "MPhCntMatch.h"
+
+// FORWARD DECLARATIONS
+class CPhCntMatchItem;
+
+// CLASS DECLARATION
+
+/**
+*  Implementation for single match result.
+*  Passes all function calls to CPhCntMacthItem object.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+NONSHARABLE_CLASS( CPhCntMatch ) : public CBase, public MPhCntMatch
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        * @param aItem Match data to use
+        * @return New instance
+        */
+        static CPhCntMatch* NewL( CPhCntMatchItem& aItem );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhCntMatch();
+
+    protected: // Functions from base classes
+
+        /**
+        * From MPhCntMatch
+        */ 
+        void Release();
+
+        /**
+        * From MPhCntMatch
+        */ 
+        CPhCntContactId* ContactId() const;
+
+        /**
+        * From MPhCntMatch
+        */ 
+        TInt 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;
+
+    private:
+
+        /**
+        * C++ constructor.
+        */
+        CPhCntMatch( CPhCntMatchItem& aItem );
+
+    private:    // Data
+        // Match data
+        CPhCntMatchItem& iItem;
+
+    };
+
+#endif      // CPHCNTMATCH_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/CPhCntMatchItem.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,298 @@
+/*
+* 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:  Holds data for one match result.
+*
+*/
+
+
+#ifndef CPHCNTMATCHITEM_H
+#define CPHCNTMATCHITEM_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <CNTDEF.H>     // TContactItemId
+
+#include "CPhCntMatcher.h" // TFieldId
+#include "MPhCntMatch.h" // TPhCCliType
+
+// CONSTANTS
+
+// Panic literal for maching related panics.
+_LIT( KPhCntMatchPanic, "PhCntMatch" );
+
+/**
+* Enumerates panic reasons.
+*
+* EPhCntMatchReferenceCountPanic 
+*       - reference count is invalid  
+* EPhCntMatchNeededObjectNotPresentPanic 
+*       - instance is not present even if it is required to be.
+* EPhCntMatchPhonebookNotReleasedPanic 
+*       - phonebook has been released but still request of 
+*         phonebook to be released is given.
+*/
+enum TPhCntMatchPanicReason
+    {
+    EPhCntMatchReferenceCountPanic,
+    EPhCntMatchNeededObjectNotPresentPanic,
+    EPhCntMatchPhonebookNotReleasedPanic
+    };
+
+// FORWARD DECLARATIONS
+class CPbkContactItem;
+class MPhCntMatchItemOwner;
+class CContactIdArray;
+class CPhCntPbkContactId;
+
+// CLASS DECLARATION
+
+/**
+*  Holds data for one match result.
+*  Many CPhCntMatch objects may use this.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+NONSHARABLE_CLASS( CPhCntMatchItem ) :public CBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aTelNumber Original phone number
+        * @param aContact Matched contact item
+        * @param aFieldId Matched field from the contact item
+        * @param aOwner Own this i.e. handles delete
+        * @return New instance
+        */
+        static CPhCntMatchItem* NewL( 
+            const TDesC& aTelNumber,
+            CPbkContactItem& aContact,
+            const TFieldId aFieldId,
+            MPhCntMatchItemOwner& aOwner );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhCntMatchItem();
+
+    public: // New functions
+        
+        /**
+        * Get the compared phone number
+        * @return The original phonenumber
+        */
+        inline const TDesC& OriginalNumber() const;
+
+        /**
+        * Add reference to this match item.
+        */
+        inline void AddReference();
+
+        /**
+        * Removes reference to this match item. If reference count
+        * gets to zero the object is deleted.
+        */
+        void RemoveReference();
+
+        /**
+        * Returns reference count.
+        * @return The count.
+        */
+        inline TInt ReferenceCount() const;
+
+        /**
+        * Get contact ID.
+        * @return The ID.
+        */
+        inline CPhCntPbkContactId* ContactId() const;
+
+        /**
+        * Get number type
+        * @return Phonebook number type
+        */
+        inline TInt NumberType() const;
+
+        /**
+        * Get contact's CLI
+        * @param aCliText CLI is saved here. User deletes the object.
+        * @return CLI type
+        */
+        MPhCntMatch::TCliType Cli( HBufC*& aCliText ) const;
+
+        /**
+        * First name field content.
+        * @return The field. Empty if not specified.
+        */
+        TPtrC FirstName() const;
+
+        /**
+        * Last name field content.
+        * @return The field. Empty if not specified.
+        */
+        TPtrC LastName() const;
+
+        /**
+        * Company name field content.
+        * @return The field. Empty if not specified.
+        */
+        TPtrC CompanyName() const;
+
+        /**
+        * Number field content (matched field).
+        * @return The field. Empty if not specified.
+        */
+        TPtrC Number() const;
+
+        /**
+        * Ringing tone field content.
+        * @return The field. Empty if not specified.
+        */
+        TPtrC PersonalRingingTone() const;
+
+        /**
+        * Find if contact belongs to any contact groups given.
+        * @param aGroupArray Compared contact groups.
+        * @return ETrue is belongs at least one group from parameter.
+        */
+        TBool BelongsToGroups( const CArrayFix<TContactItemId>& aGroupArray ) const;
+
+        /**
+        * Returns text to speech text for this contact. Used in
+        * text to speech ringing tone.
+        * @since Series 60 3.0
+        * @return descriptor, ownership passed.
+        */
+        HBufC* TextToSpeechTextL() const;
+        
+        /**
+        * Call text field content.
+        * @since Series 60 3.1
+        * @return The field. Empty if not specified.
+        */
+        TPtrC CallText() const;
+
+        /**
+        * Call image field content.
+        * @since Series 60 3.1
+        * @return The field. Empty if not specified.
+        */
+        TPtrC CallImage() const;        
+        
+        /**
+        * Check if contact has a thumbnail image.
+        * @since Series 60 3.1
+        * @return ETrue if thumbnail exists, otherwise EFalse.
+        */
+        TBool HasThumbnailImage() const;        
+        
+    private:
+
+        /**
+        * C++ constructor.
+        */
+        CPhCntMatchItem( const TFieldId aFieldId, MPhCntMatchItemOwner& aOwner);
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL( const TDesC& aTelNumber, CPbkContactItem& aContact );
+
+        
+        /**
+        * Read all needed info from the contact.
+        * @param aContact Contact item from Phonebook
+        */
+        void GetContactInfoL( CPbkContactItem& aContact );
+        void ReadFirstNameL( CPbkContactItem& aContact );
+        void ReadLastNameL( CPbkContactItem& aContact );
+        void ReadCompanyNameL( CPbkContactItem& aContact );
+        void ReadNumberL( CPbkContactItem& aContact );
+        void ReadNumberType( CPbkContactItem& aContact );
+        void ReadCliAndTypeL( CPbkContactItem& aContact );
+        void ReadGroupsL( CPbkContactItem& aContact );
+        void ReadRingingToneL( CPbkContactItem& aContact );
+        void ReadTextToSpeechL( CPbkContactItem& aContact );
+        void ReadCallObjectL( CPbkContactItem& aContact );
+
+        /**
+        * Allocate string and trim the result.
+        * @since Series 60 3.0
+        * @param aText text to be allocated.
+        * @return trimmed version.
+        */
+        static HBufC* AllocAndTrimL( const TDesC* aText );
+
+        /**
+        * Returns ETrue if order of the names needs to be swapped.
+        * Default order is first name followed by last name.
+        *
+        * @since Series 60 3.0
+        * @return ETrue if order of the names needs to be swapped.
+        */
+        static TBool SwapNameOrder();
+
+    private:    // Data
+        // Original phone number buffer
+        HBufC* iOriginalTelNumber;
+        // Contact item id
+        CPhCntPbkContactId* iContactId;
+        // Field id of the contact
+        TFieldId iFieldId;
+        // Reference count to this match data
+        TInt iReferenceCount;
+        // Who can delete this (when reference count comes to 0)
+        MPhCntMatchItemOwner& iOwner;
+
+        // First name buffer
+        HBufC* iFirstName;
+        // Last name buffer
+        HBufC* iLastName;
+        // Company name buffer
+        HBufC* iCompanyName;
+        // Matched phone numer buffer
+        HBufC* iNumber;
+        // Number type
+        TInt iNumberType;
+        // CLI
+        HBufC* iCli;
+        // CLI type (name, number, company, ...)
+        MPhCntMatch::TCliType iCliType;
+        // Contact groups
+        CContactIdArray* iGroups;
+        // Path to ringing tone
+        HBufC* iRingingTone;
+
+        // Text to speech related variables:
+
+        // First name reading
+        HBufC* iFirstNameReading;
+        // Last name reading
+        HBufC* iLastNameReading;
+        // Nick name
+        HBufC* iSecondName;
+        // Call text
+        HBufC* iCallText;
+		// Call image
+        HBufC* iCallImage;
+        // Has thumbnail image
+        TBool iHasThumbnailImage;
+
+    };
+
+#include    "CPhCntMatchItem.inl"
+
+#endif      // CPHCNTMATCHITEM_H  
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/CPhCntMatchItem.inl	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Inline functions for Match Item
+*
+*/
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhCntMatchItem::OriginalNumber
+// 
+// ---------------------------------------------------------
+//
+inline const TDesC& CPhCntMatchItem::OriginalNumber() const
+    {
+    return *iOriginalTelNumber;
+    }
+
+// ---------------------------------------------------------
+// CPhCntMatchItem::AddReference
+// 
+// ---------------------------------------------------------
+//
+inline void CPhCntMatchItem::AddReference()
+    {
+    iReferenceCount++;
+    }
+
+// ---------------------------------------------------------
+// CPhCntMatchItem::ReferenceCount
+// 
+// ---------------------------------------------------------
+//
+inline TInt CPhCntMatchItem::ReferenceCount() const
+    {
+    return iReferenceCount;
+    }
+
+// ---------------------------------------------------------
+// CPhCntMatchItem::ContactId
+// 
+// ---------------------------------------------------------
+//
+inline CPhCntPbkContactId* CPhCntMatchItem::ContactId() const
+    {
+    return iContactId;
+    }
+
+// ---------------------------------------------------------
+// CPhCntMatchItem::NumberType
+// 
+// ---------------------------------------------------------
+//
+inline TInt CPhCntMatchItem::NumberType() const
+    {
+    return iNumberType;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/CPhCntMatcher.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,154 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Abstract class for making matches.
+*
+*/
+
+
+#ifndef CPHCNTMATCHER_H
+#define CPHCNTMATCHER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <cntdef.h>     // TContactItemId
+#include <badesca.h>
+#include <cphcntsingleitemfetch.h>
+// CONSTANTS
+const TInt KPhCntInvalidFieldId = KErrNotFound;
+
+// DATA TYPES
+typedef TInt TFieldId;
+
+// FORWARD DECLARATIONS
+class MPhCntMatch;
+class CGulIcon;
+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 aTelNumber Number to match against.
+        * @param aContactId Current contact.
+        * @param aFieldId Current field id (index from CnmModel);
+        * @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& aContactId,
+            MPhCntMatch::TNumberType aNumberType ) = 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 aContactStoreUris
+        *                      Pointer to array containing store uris
+        * @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,
+            MDesCArray* aContactStoreUris,
+            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;
+
+    };
+
+#endif      // CPHCNTMATCHER_H  
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/CPhoneCntFactory.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,175 @@
+/*
+* 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:  It's factory for creating components.
+*
+*/
+
+
+#ifndef CPHCNTFACTORY_H
+#define CPHCNTFACTORY_H
+
+//  INCLUDES
+#include    <e32base.h>
+#include    <cntdef.h>
+
+// FORWARD DECLARATIONS
+class MPhCntThumbnailLoaderObserver;
+class CEikStatusPane;
+class CPhCntSpeedDialMonitor;
+class CPhCntThumbnailLoader;
+class CPhCntSingleItemFetch;
+class CPhCntRfsHandler;
+class CPhCntMmiSecurity;
+class CPhoneCntSaveAddToName; 
+class CPhoneCntVoiceKeyImp;
+class CPhCntMatcher;
+class CPhCntProfileEngine;
+class MProfileChangeObserver;
+class CPhCntContactId;
+class CPhCntContactDataSelection;
+class MPhCntStoreLoader;
+
+// CLASS DECLARATION
+
+/**
+*  Factory class for creating phonebook related classes.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+class CPhCntFactory : public CBase
+    {
+    public:
+
+        /**
+        * Creates speed dial monitor.
+        *
+        * @param aStatusPane statuspane.
+        * @return speed dial monitor, ownership transferred.
+        */
+        virtual CPhCntSpeedDialMonitor* CreateSpeedDialMonitorL() = 0;
+
+        /**
+        * Creates thumbnail loader.
+        *
+        * @param aObserver observer.
+        * @return thumbnail loader, ownership transferred.
+        */
+        virtual CPhCntThumbnailLoader* CreateThumbnailLoaderL(
+            MPhCntThumbnailLoaderObserver& aObserver ) = 0;
+            
+        /**
+        * Creates single item fetcher.     
+        * 
+        * @return single item fetcher, ownership transferred.
+        */
+        virtual CPhCntSingleItemFetch* CreateSingleItemFetchL() = 0;
+
+        /**
+        * Creates rfs handler.
+        *
+        * @return rfs handler, ownership is transferred.
+        */
+        virtual CPhCntRfsHandler* CreateRfsHandlerL() = 0;
+
+        /**
+        * Creates mmi security.
+        *
+        * @return mmi security.
+        */
+        virtual CPhCntMmiSecurity* CreateMmiSecurityL() = 0;
+       
+        /**
+        * Creates save and add to name-object.
+        *
+        * @return pointer to class, ownership is transferred.
+        */
+        virtual CPhoneCntSaveAddToName* CreateSaveAddToNameL() = 0;
+
+        /** 
+        * Creates an instance of Contact Matcher
+        *
+        * @return Contact Matcher object. Ownership is transferred.
+        */
+        virtual CPhCntMatcher* CreateContactMatcherL() = 0;
+
+        /**
+        * Creates an instance of profile engine.
+        *
+        * @return profile engine instance. Ownership is transferred.
+        */
+        virtual CPhCntProfileEngine* CreateProfileEngineL() = 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 service to get user to select data from contact.
+         * 
+         * @since S60 v3.2
+         */
+        virtual CPhCntContactDataSelection* CreateContactDataSelectionL() = 0;
+
+        /**
+         * Creates a service to load contact stores.
+         * 
+         * @since S60 v9.1
+         */
+        virtual MPhCntStoreLoader* CreateContactStoreLoaderL() = 0;
+        
+        /**
+         * Creates a phonebook service and opens contact stores.
+         * 
+         * @since S60 v9.1
+         */
+        virtual void CreatePhonebookServicesL() = 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/PhoneCntFinder/inc/CPhoneCntFactoryImpl.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,195 @@
+/*
+* 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:  Factory class's implementation.
+*
+*/
+
+
+#ifndef CPHCNTFACTORYIMPL_H
+#define CPHCNTFACTORYIMPL_H
+
+//  INCLUDES
+#include    <e32base.h>
+#include    <cphonecntfactory.h>
+#include    <RPbkViewResourceFile.h>
+
+class CPhCntPhonebookServices;
+class CPhCntContactStores;
+class CPhCntContactDataSelection;
+
+
+// FORWARD DECLARATIONS
+class CPhoneCntPbkOwner;
+class MPhCntStoreLoader;
+
+// CLASS DECLARATION
+
+/**
+*  Factory class's implementation. Not for external use.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+NONSHARABLE_CLASS( CPhCntFactoryImpl ) : public CPhCntFactory
+    {
+    public: // Constructors and destructors.
+
+        /**
+        * Two-phased constructor.
+        *
+        * @return new instance of the class.
+        */
+        static CPhCntFactoryImpl* NewL();
+
+        /**
+        * Destructor.
+        */
+        ~CPhCntFactoryImpl();
+
+    public: // From base classes.
+
+        /**
+        * From CPhCntFactory
+        */
+        CPhCntSpeedDialMonitor* CreateSpeedDialMonitorL();
+
+        /**
+        * From CPhCntFactory
+        */
+        CPhCntThumbnailLoader* CreateThumbnailLoaderL(
+            MPhCntThumbnailLoaderObserver& aObserver );
+
+        /**
+        * From CPhCntFactory
+        */
+        CPhCntSingleItemFetch* CreateSingleItemFetchL();
+
+        /**
+        * From CPhCntFactory
+        */
+        CPhCntRfsHandler* CreateRfsHandlerL();
+
+        /**
+        * From CPhCntFactory
+        */
+        CPhCntMmiSecurity* CreateMmiSecurityL();
+      
+        /**
+        * From CPhCntFactory
+        */
+        CPhoneCntSaveAddToName* CreateSaveAddToNameL();
+
+        /**
+        * From CPhCntFactory
+        */
+        CPhCntMatcher* CreateContactMatcherL();
+
+        /**
+        * From CPhCntFactory
+        */
+        CPhCntProfileEngine* CreateProfileEngineL();
+
+        /**
+        * 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 );
+
+        /**
+         * From CPhCntFactory.
+         * @since S60 v3.2
+         * @see CPhCntFactory
+         */
+        CPhCntContactDataSelection* CreateContactDataSelectionL();
+
+        /**
+         * From CPhCntFactory.
+         * @since S60 v9.1
+         * @see CPhCntFactory
+         */
+        MPhCntStoreLoader* CreateContactStoreLoaderL();
+        
+        /**
+         * From CPhCntFactory.
+         * @since S60 v9.1
+         * @see CPhCntFactory
+         */
+        void CreatePhonebookServicesL();
+        
+    private:
+
+        /**
+        * C++ constructor.
+        */
+        CPhCntFactoryImpl();
+
+        /**
+        * Symbian OS constructor.
+        */
+        void ConstructL();
+        
+        void CreateContactStoreAndManagerL();
+
+    private:
+        // Phonebook view resources
+        RPbkViewResourceFile iPbkResource;
+
+        // Has the SecUi been initialized
+        TBool iSecUiInit;
+
+        // Phonebook owner
+        CPhoneCntPbkOwner* iPbkOwner;
+
+        /**
+         * Phonebook services.
+         * own.
+         */
+        CPhCntPhonebookServices* iPhonebookServices;
+        
+        /** 
+         * Contact stores.
+         * Own.
+         */
+        CPhCntContactStores* iContactStores;
+    };
+
+
+#endif      // CPHCNTFACTORYIMPL_H   
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/CPhoneCntNumberParser.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,109 @@
+/*
+* 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:  This class loads contact model phone number parser DLL.
+*
+*/
+
+
+#ifndef CCntNumberParser_H
+#define CCntNumberParser_H
+
+//  INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class CContactPhoneNumberParser;
+
+// CLASS DECLARATION
+
+/**
+ * Template classes to call ResetAndDestroy on array classes
+ * automatically, when ::PopAndDestroy'ing from the cleanup stack.
+ */
+template <class T>
+class CleanupResetAndDestroy
+    {
+public:
+    inline static void PushL(T& aRef);
+private:
+    static void ResetAndDestroy(TAny *aPtr);
+    };
+template <class T>
+inline void CleanupResetAndDestroyL(T& aRef);
+
+// Template class CleanupClose
+template <class T>
+inline void CleanupResetAndDestroy<T>::PushL(T& aRef)
+    {CleanupStack::PushL(TCleanupItem(&ResetAndDestroy, &aRef));}
+template <class T>
+void CleanupResetAndDestroy<T>::ResetAndDestroy(TAny *aPtr)
+    {static_cast<T*>(aPtr)->ResetAndDestroy();}
+template <class T>
+inline void CleanupResetAndDestroyPushL(T& aRef)
+    {CleanupResetAndDestroy<T>::PushL(aRef);}
+
+
+/**
+*  CCntNumberParser
+*
+*  This class loads contact model phone number parser DLL.
+*
+*  @lib PhoneCntFinder
+*  @since 2.8
+*/
+NONSHARABLE_CLASS( CCntNumberParser ) : public CBase
+    {
+    public: // Constructor
+
+        /**
+        * Two-phased constructor.
+        * @return New instance
+        */
+        static CCntNumberParser* NewL();
+
+        /**
+        * Destructor.
+        */
+        ~CCntNumberParser();
+
+        /**
+        * Gets a pointer of CContactPhoneNumberParser instance.
+        *
+        * @return the pointer of the instance.
+        */
+        CContactPhoneNumberParser* CntPhoneNumberParser() const;
+
+    private:
+
+        /**
+        * C++ constructor.
+        */
+        CCntNumberParser();
+
+        /**
+        * Symbian OS constructor.
+        */
+        void ConstructL();
+
+    private: // Data
+
+        // Parser itself
+        CContactPhoneNumberParser* iParser;
+    };
+
+
+#endif //CCntNumberParser_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/CPhoneCntPbkOwner.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,79 @@
+/*
+* 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:  It provides interface to retrieve phonebook instance in 
+*                the PhoneCntFinder subsystem.
+*
+*/
+
+
+#ifndef CPHONECNTPBKOWNER_H
+#define CPHONECNTPBKOWNER_H
+
+//  INCLUDES
+#include "MPhoneCntPbkOwner.h"
+
+class CPhCntContactManager;
+
+// CLASS DECLARATION
+
+/**
+*  It's the phonebook owner.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+NONSHARABLE_CLASS( CPhoneCntPbkOwner )
+    : public MPhoneCntPbkOwner
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        * @return New instance
+        */
+        static CPhoneCntPbkOwner* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneCntPbkOwner();
+
+    public: // Functions from base classes
+
+        /**
+        * From MPhoneCntPbkOwner
+        */
+        CPhCntContactManager* ContactManager() const;
+
+    private:
+
+        /**
+        * C++ constructor.
+        */
+        CPhoneCntPbkOwner();
+
+        /**
+        * Symbian OS constructor.
+        */
+        void ConstructL();
+
+    private:    // Data
+    
+        // Contact manager.
+        CPhCntContactManager* iContactManager;
+    };
+
+#endif      // CPHONECNTPBKOWNER_H  
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/CPhoneCntSaveAddToName.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,157 @@
+/*
+* 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:  Add number to existing name and save the number.
+*
+*/
+
+
+#ifndef CPHONECNTSAVEADDTONAME_H
+#define CPHONECNTSAVEADDTONAME_H
+
+// INCLUDES
+#include <e32base.h>
+
+// DATA TYPES
+enum TCntNumberType
+    {
+    /**
+    * If saved type is normal number.
+    */
+    ECntNormalNumber = 0,
+    /**
+    * If saved type is normal number it could be used in SIP Uri.
+    */
+    ECntVoiceInternetNumber,
+    /**
+    * If saved type is internet number.
+    */
+    ECntOnlyInternetNumber,
+    /**
+    * If saved type is internet number and could be used like
+    * email address.
+    */
+    ECntInternetEmailField    
+    };    
+
+// KCntPhoneNumberMaxLength must be same as MPhEngCallHandling::TPhEngPhoneNumber  
+const TInt KCntPhoneNumberMaxLength = 100;     
+typedef TBuf<KCntPhoneNumberMaxLength> TCntPhoneNumber;
+
+// FORWARD DECLARATIONS
+class CPbkDataSaveAppUi;
+class CPbkViewResourceLoader;
+class MPhoneCntPbkOwner;
+class MPhCntPhonebookServices;
+
+// CLASS DECLARATION
+
+/**
+*  MPhoneCntSaveAddToName
+*
+*  Abstact class for saving new entry and adding data to old phonebook entry.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+NONSHARABLE_CLASS( MPhoneCntSaveAddToName )
+    {
+    public: // New functions   
+    
+        virtual ~MPhoneCntSaveAddToName()  {};
+        
+        /**
+        * Handles phonebook operation
+        * @param aTelNumber Telephone number to save
+        * @param aCommand Given command (new, update existing)
+        */
+        virtual void HandlePbkOperationL( 
+            const TCntPhoneNumber& aTelNumber,                                            
+            TInt aCommand ) = 0;
+            
+        /**
+        * Handles phonebook operation.
+        * @since Series60 3.0
+        * @param aTelNumber Telephone number to save
+        * @param aCommand Given command (new, update existing)
+        * @param aNumberType Type of saved telnumber (E.g If not numeric
+        *                    could not save to the Phone number field)
+        */       
+        virtual void HandlePbkOperationL(
+            const TCntPhoneNumber& aTelNumber,
+            TInt aCommand,
+            TCntNumberType aNumberType ) = 0;    
+       };
+
+
+
+/**
+*  This class is used to add number to existing name and to save the number.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+class CPhoneCntSaveAddToName
+    : public CBase, 
+      public MPhoneCntSaveAddToName
+    {
+    public: // New functions       
+        /**
+        * Two-phased constructor.
+        * @param aPbkOwner Phonebook owner.
+        * @return new instance of the class.
+        */
+        static CPhoneCntSaveAddToName* NewL( MPhCntPhonebookServices& aServices );
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C ~CPhoneCntSaveAddToName();
+
+    public : // Functions from base classes
+
+        /**
+        * From MPhoneCntSaveAddToName
+        */
+        IMPORT_C void HandlePbkOperationL(
+            const TCntPhoneNumber& aTelNumber,
+            TInt aCommand );
+        
+        /**
+        * From MPhoneCntSaveAddToName
+        * @since 3.0
+        */
+        IMPORT_C void HandlePbkOperationL(
+            const TCntPhoneNumber& aTelNumber,
+            TInt aCommand,
+            TCntNumberType aNumberType );    
+    private:
+        
+        /**
+        * C++ constructor.
+        */
+        CPhoneCntSaveAddToName( MPhCntPhonebookServices& aServices  );
+        
+    private://data
+    
+        /**
+         * Service for creating and updating contacts.
+         * Not own.
+         */
+        MPhCntPhonebookServices& iServices;
+
+    };
+
+#endif      // CPHONECNTSAVEADDTONAME_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/CPhoneRawMatchNumberExtractor.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,157 @@
+/*
+* 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 class extracts phone number for comparison.
+*
+*/
+
+
+
+#ifndef CCNTRAWPHONENUMBEREXTRACTOR_H
+#define CCNTRAWPHONENUMBEREXTRACTOR_H
+
+//  INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class CContactPhoneNumberParser;
+class CCntNumberParser;
+
+// CONSTANTS
+const TInt KPhMatcherMaximumPhoneNumberLength = 150;
+const TInt KPhMatcherNumberCount = 7;
+
+
+// CLASS DECLARATION
+
+/**
+*  MRawPhoneNumberExtractor
+*
+*  Abstact class for extraction.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+class MRawPhoneNumberExtractor 
+    {
+    public: // New functions
+        /**
+        * This should be called when instance is not needed any more.
+        */
+        virtual void Release() = 0;
+        
+        /**
+        * DEPRECATED.
+        */
+        virtual TUint ExtractRawNumber(
+            const TDesC& aTextualNumber ) = 0;
+        
+        /**
+        * Extracts the given number for comparsion.
+        * @param aTextualNumber Number to match for. 7 digits count.
+        * @param aRawNumber Extracted number in descriptor.
+        * @return Extracted number in integer (extra char at beginning).
+        *         Equals extra char if given number is not taken to comparsion.
+        */
+        virtual TUint ExtractRawNumber(
+            const TDesC& aTextualNumber, 
+            TDes& aRawNumber ) = 0;
+        
+        /**
+        * DEPRECATED.
+        */
+        virtual TChar ExtraChar() const = 0;
+    };
+
+
+
+/**
+*  CCntRawPhoneNumberExtractor
+*
+*  Concrete extarctor class. 
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+class CCntRawPhoneNumberExtractor 
+    : public CBase, 
+      public MRawPhoneNumberExtractor 
+    {
+    public: // Constructor
+
+        /**
+        * Constructor.
+        */
+        IMPORT_C CCntRawPhoneNumberExtractor();
+
+        /**
+        * Symbian OS constructor.
+        */
+        void ConstructL();
+        
+    public: // Functions from base classes
+
+        /**
+        * From MRawPhoneNumberExtractor
+        */
+        void Release();
+        
+        /**
+        * From MRawPhoneNumberExtractor
+        * DEPRECTED - Do not use.
+        */
+        TUint ExtractRawNumber( 
+            const TDesC& aTextualNumber );
+        
+        /**
+        * From MRawPhoneNumberExtractor
+        */
+        TUint ExtractRawNumber( 
+            const TDesC& aTextualNumber, 
+            TDes& aRawNumber );
+        
+        /**
+        * From MRawPhoneNumberExtractor
+        * DEPRECTED - Do not use.
+        */
+        TChar ExtraChar() const;
+
+    private:
+
+        /**
+        * Destructor.
+        */
+        ~CCntRawPhoneNumberExtractor();
+        
+    private:    // Data
+        // Buffer for data
+        TBuf<KPhMatcherMaximumPhoneNumberLength> iMatchBuffer;
+
+        // DEPRECATED.
+        const TChar iKPhoneNumberExtraChar;
+
+        // Parser library
+        RLibrary iParserLibrary;
+
+        // Parser itself
+        CContactPhoneNumberParser* iParser;
+
+        // Pointer to CCntNumberParser
+        CCntNumberParser* iNumberParser;
+    };
+
+
+#endif //CCNTRAWPHONENUMBEREXTRACTOR_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/MPhCntMatch.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,176 @@
+/*
+* 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:  Abstact match result. 
+*
+*/
+
+
+#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/PhoneCntFinder/inc/MPhoneCntPbkOwner.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,48 @@
+/*
+* 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:  Interface for Phonebook Owner implementation
+*
+*/
+
+
+#ifndef MPHONECNTPBKOWNER_H
+#define MPHONECNTPBKOWNER_H
+
+//  INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class CPhCntContactManager;
+
+// CLASS DECLARATION
+
+/**
+*  Interface for Phonebook Owner implementation.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+class MPhoneCntPbkOwner
+    {
+    public:
+        /**
+        * Gives intance of contact manager.
+        */
+        virtual CPhCntContactManager* ContactManager() const = 0;
+    };
+
+#endif      // MPHONECNTPBKOWNER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/Misc/CPhCntMmiSecurity.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Provides interface to mmi initiated security operations.
+*
+*/
+
+
+#ifndef CPHCNTMMISECURITY_H
+#define CPHCNTMMISECURITY_H
+
+// INCLUDES
+#include    <e32base.h>
+
+// CLASS DECLARATION
+
+/**
+*  It provides interface to perform mmi initiated security operations.
+*
+*  The class shouldn't be destroyed during operation.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+class CPhCntMmiSecurity
+    : public CBase
+    {
+    public: // New functions       
+
+        /**
+        * Enumerates different pin related commands.
+        *
+        * ECmdChangePin - change pin.
+        * ECmdChangePin2 - change pin2.
+        * ECmdUnblockPin - unblock pin.
+        * ECmdUnblockPin2 - unblock pin2.
+        */
+        enum TPinCommand
+            {
+            ECmdChangePin,
+            ECmdChangePin2,
+            ECmdUnblockPin,
+            ECmdUnblockPin2
+            };
+
+        /**
+        * Change pin code.
+        *
+        * @param aCommand command. 
+        * @param aCode old code. 
+        *       if command is change, then old pin.
+        *       if command is unblock, then puk.
+        * @param aNewPin new pin. 
+        * @param aVerifyNew verification of pin.
+        */
+        virtual TBool ChangePinL(
+            TPinCommand aCommand,
+            const TDesC& aCode,
+            const TDesC& aNewPin,
+            const TDesC& aVerifyNew ) = 0;
+
+        /**
+        * Enumerates different sim commands.
+        *
+        * ECmdOpenLock - opens lock.
+        * ECmdCloseLock - closes lock.
+        */
+        enum TSimCommand
+            {
+            ECmdOpenLock,
+            ECmdCloseLock
+            };
+
+        /**
+        * Change sim lock status.
+        *
+        * @param aCommand command. 
+        * @param aCode password.
+        * @param aType type of lock.
+        */
+        virtual TBool ChangeSimLockL(
+            TSimCommand aCommand,
+            const TDesC& aCode,
+            const TDesC& aType ) = 0;
+
+        /**
+        * Cancels whatever it is doing.
+        *
+        * If not doing anything, then does nothing.
+        */
+        virtual void Cancel() = 0;
+        
+    };
+
+#endif      // CPHCNTMMISECURITY_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/Misc/CPhCntMmiSecurityImpl.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of mmi security.
+*
+*/
+
+
+#ifndef CPHCNTMMISECURITYIMPL_H
+#define CPHCNTMMISECURITYIMPL_H
+
+// INCLUDES
+#include    "CPhCntMmiSecurity.h"
+
+// FORWARD DECLARATIONS
+class CManualSecuritySettings;
+
+// CLASS DECLARATION
+
+/**
+*  It is implementation of mmi security.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+NONSHARABLE_CLASS( CPhCntMmiSecurityImpl )
+    : public CPhCntMmiSecurity
+    {
+    public:  // Constructors and destructor      
+                
+        /**
+        * Two-phased constructor.
+        * @return New instance
+        */
+        static CPhCntMmiSecurityImpl* NewL();
+        
+        /**
+        * Destructor.
+        */
+        ~CPhCntMmiSecurityImpl();
+
+    public: // From base classes
+
+        /**
+        * From CPhCntMmiSecurity
+        */
+        TBool ChangePinL(
+            TPinCommand aCommand,
+            const TDesC& aCode,
+            const TDesC& aNewPin,
+            const TDesC& aVerifyNew );
+
+        /**
+        * From CPhCntMmiSecurity
+        */
+        TBool ChangeSimLockL(
+            TSimCommand aCommand,
+            const TDesC& aCode,
+            const TDesC& aType );
+
+        /**
+        * From CPhCntMmiSecurity
+        */
+        void Cancel();
+
+    private:
+
+        /**
+        * Creates model.
+        *
+        * @return model.
+        */
+        CManualSecuritySettings& CreateModelL();
+
+        /**
+        * Destroyes model.
+        */
+        void DestroyModel();
+
+        /**
+        * Panics (in debug builds).
+        */
+        static void Panic();
+
+    private:    // Data
+        // Security model
+        CManualSecuritySettings* iModel;
+
+    };
+
+#endif      // CPHCNTMMISECURITYIMPL_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/Misc/CPhCntProfileEngine.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,82 @@
+/*
+* 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:  It provides Profile information.
+*
+*/
+
+
+#ifndef CPHCNTPROFILEENGINE_H
+#define CPHCNTPROFILEENGINE_H
+
+// INCLUDES
+#include    <e32base.h>
+#include    <MProfileEngine.h>
+
+// CLASS DECLARATION
+
+/**
+* Profile interface.
+*
+* @lib PhoneCntFinder
+* @since 2.0
+*/
+class CPhCntProfileEngine
+    : public CBase
+    {
+    public: // New functions
+
+        /**
+        * Refresh contents of profile.
+        */
+        virtual void RefreshL() = 0;
+
+        /**
+        * Checks if profile information has been
+        * retrieved.
+        *
+        * @return ETrue if it is allowed to call 
+        * the Profile method.
+        */
+        virtual TBool HasProfile() const = 0;
+
+        /**
+        * Returns active profile. It is valid
+        * after RefreshL has succeeded.
+        *
+        * @return active profile information.
+        */
+        virtual MProfile& Profile() = 0;
+
+        /**
+        * Sets active profile. It is valid
+        * after RefreshL has succeeded.
+        *
+        * @param aProfileId Id of the profile to be set.
+        */
+        virtual void SetActiveProfileL( 
+            const TInt aProfileId ) = 0;
+
+        /**
+         * Checks whether the given feature is supported by Profiles Engine.         
+         * @param aFeatureId the feature to be checked.
+         * @return ETrue if the given feature is supported, EFalse otherwise.
+         * @since Series60_2.8
+         */
+        virtual TBool IsFeatureSupported(
+            TProfileFeatureId aFeatureId ) const = 0;
+    };
+
+#endif      // CPHCNTPROFILEENGINE_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/Misc/CPhCntProfileEngineImpl.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Concrete implementation of CPhCntProfileEngine interface.
+*
+*/
+
+
+#ifndef CPHCNTPROFILEENGINEIMPL_H
+#define CPHCNTPROFILEENGINEIMPL_H
+
+// INCLUDES
+#include    "CPhCntProfileEngine.h"
+
+// FORWARD DECLARATIONS
+class MProfile;
+class MProfileEngine;
+
+// CLASS DECLARATION
+
+/**
+* Profile interface.
+*
+* @lib PhoneCntFinder
+* @since 2.0
+*/
+NONSHARABLE_CLASS( CPhCntProfileEngineImpl )
+    : public CPhCntProfileEngine
+    {
+    public: // Constructors and destructors
+
+        /**
+        * Two-phased constructor.
+        * @return New instance
+        */
+        static CPhCntProfileEngineImpl* NewL();
+
+        /**
+        * Destructor.
+        */
+        ~CPhCntProfileEngineImpl();
+
+    public: // From base classes
+
+        /**
+        * From CPhCntProfileEngine, refresh contents 
+        * of profile.
+        */
+        virtual void RefreshL();
+
+        /**
+        * From CPhCntProfileEngine, checks if profile 
+        * information has been retrieved.
+        *
+        * @return ETrue if it is allowed to call 
+        * the Profile method.
+        */
+        virtual TBool HasProfile() const;
+
+        /**
+        * From CPhCntProfileEngine, returns active 
+        * profile. It is valid after RefreshL has 
+        * succeeded.
+        *
+        * @return active profile information.
+        */
+        virtual MProfile& Profile();
+
+        /**
+        * Sets active profile. It is valid
+        * after RefreshL has succeeded.
+        *
+        * @param aProfileId Id of the profile to be set.
+        */
+        virtual void SetActiveProfileL( 
+            const TInt aProfileId );
+
+        /**
+         * Checks whether the given feature is supported by Profiles Engine.         
+         * @param aFeatureId the feature to be checked.
+         * @return ETrue if the given feature is supported, EFalse otherwise.
+         * @since Series60_2.8
+         */
+        virtual TBool IsFeatureSupported(
+            TProfileFeatureId aFeatureId ) const;
+
+    private:
+        // Profile engine
+        MProfileEngine* iEngine;
+        // Profile
+        MProfile* iProfile;
+
+    };
+
+#endif      // CPHCNTPROFILEENGINEIMPL_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/Misc/CPhCntRfsHandler.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Provides interface to restore factory settings.
+*
+*/
+
+
+#ifndef CPHCNTRFSHANDLER_H
+#define CPHCNTRFSHANDLER_H
+
+// INCLUDES
+#include    <e32base.h>
+
+// CLASS DECLARATION
+
+/**
+*  It provides interface to restore factory settings.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+class CPhCntRfsHandler
+    : public CBase
+    {
+    public: // New functions       
+
+        /**
+        * It enumerates different types of commands.
+        *
+        * ERfsCmdActivateNormal - normal rfs
+        * ERfsCmdActivateDeep - deep rfs
+        * ERfsCmdCancel - cancel whatever you are doing
+        */
+        enum TRfsCommand
+            {
+            ERfsCmdActivateNormal,
+            ERfsCmdActivateDeep,
+            ERfsCmdCancel
+            };
+        
+        /**
+        * Perform command.
+        *
+        * @param aCommand command to be performed.
+        */
+        virtual void ProcessCommandL( TRfsCommand aCommand ) = 0;
+
+    };
+
+#endif      // CPHCNTRFSHANDLER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/Misc/CPhCntRfsHandlerImpl.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of restore factory settings.
+*
+*/
+
+
+#ifndef CPHCNTRFSHANDLERIMPL_H
+#define CPHCNTRFSHANDLERIMPL_H
+
+// INCLUDES
+#include    "CPhCntRfsHandler.h"
+
+// FORWARD DECLARATIONS
+class CRfsHandler;
+
+// CLASS DECLARATION
+
+/**
+*  It is implementation of restore factory settings interface.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+NONSHARABLE_CLASS( CPhCntRfsHandlerImpl )
+    : public CPhCntRfsHandler
+    {
+    public:  // Constructors and destructor      
+                
+        /**
+        * Two-phased constructor.
+        * @return New instance
+        */
+        static CPhCntRfsHandlerImpl* NewL();
+        
+        /**
+        * Destructor.
+        */
+        ~CPhCntRfsHandlerImpl();
+
+    public: // From base classes
+
+        /**
+        * From CPhCntRfsHandlerImpl
+        */
+        void ProcessCommandL( TRfsCommand aCommand );
+
+    private:    // Data
+        // Restory factory settings component
+        CRfsHandler* iRfsHandler;
+    };
+
+#endif      // CPHCNTRFSHANDLERIMPL_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/Misc/CPhCntSingleItemFetch.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,183 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Interface to make single item fetches.
+*
+*/
+
+
+#ifndef CPHCNTSINGLEITEMFETCH_H
+#define CPHCNTSINGLEITEMFETCH_H
+
+// INCLUDES
+#include    <e32base.h>
+#include    <cntdef.h>
+#include <mphcntmatch.h>
+
+class MVPbkContactLink;
+class CPhCntContactId;
+
+class CPhCntSelection : public CBase
+    {
+public:
+        
+    /**
+     * @since s60 v3.2
+     * @return Number selected by user.
+     */
+    virtual const TDesC& Number() const = 0;
+    
+    /**
+     * @since s60 v3.2
+     * @return Contact identifier. Identifies the contact
+     * where user selected the number.
+     */
+    virtual const CPhCntContactId& ContactId() const = 0;
+    
+    };
+        
+// CLASS DECLARATION
+
+/**
+*  It provides interface to make phone app single item fetches.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+class CPhCntSingleItemFetch
+    : public CBase
+    {
+    public: // New functions       
+
+        /**
+        * It enumerates different types of fetches.
+        *
+        * EFetchDtmf          - fetch from dtmf
+        * EFetchNewCall       - fetch from new call query
+        * EFetchNewPSCall     - fetch from new PS call query
+        */
+        enum TFetchType
+            {
+            EFetchDtmf,
+            EFetchNewCall,
+            EFetchNewPSCall
+            };
+
+		/**
+		* Phone number filtering for the FetchPhoneNumberLD implementation
+		* 
+		* ECallPhoneNumber		- CS
+        * ECallVoip,          	- PS
+        * ECallVideoNumber,		- Video 
+		*/
+		enum TCallType
+            {
+            ECallPhoneNumber, 
+            ECallVoip, 
+            ECallVideoNumber 
+            };
+
+        /**
+        * It defines structure for result.
+        */
+        struct TFetchParams
+            {
+            public: // In
+
+                // Fetch type.
+                TFetchType iType;
+
+                // Resource for softkeys.
+                TInt iCbaResource;
+
+            public:
+
+                // Buffer for string.
+                TDes* iString;
+
+                MPhCntMatch::TNumberType iNumberType;
+                
+                CPhCntContactId* iContactId;
+            };
+
+        /**
+        * Perform fetch.
+        *
+        * Destroyes itself always after fetch. In successful case, target 
+        * descriptor will contain result. Otherwise it must be considered 
+        * undefined.
+        *
+        * You can also cancel request by destroying the instance.
+        *
+        * @param aParams it contains parameters.
+        * @return error code,
+        *       KErrNone iff fetch succeeded,
+        *       KErrCancel iff fetch was cancelled,
+        *       KErrGeneral iff result was invalid,
+        *       KErrOverflow iff result was too long
+        *
+        * If method returns error, then contents of aResult are undefined.
+        */
+        virtual TInt FetchLD( 
+            TFetchParams& aParams ) = 0;
+
+		/**
+		* Performs a fetch.
+		*
+		* A contact link is used for fetching and as a search result 
+		* a phone number is returned.
+		*
+		* Destroyes itself always after fetch. In successful case, target 
+        * descriptor will contain result. Otherwise it must be considered 
+        * undefined.
+        *
+        * You can also cancel request by destroying the instance.
+        *
+		* @param aContactLink Contact link.
+		* @param aCallType Number type.
+		* @param aNumber Found phone number. Needs to be NULL before the call.
+		* @param aFieldLink Field link to user selected number. Needs to be NULL, before the call.
+		* @return error code,
+        *       KErrNone iff fetch succeeded,
+        *       KErrCancel iff fetch was cancelled,
+        *       KErrGeneral iff result was invalid,
+        *       KErrOverflow iff result was too long        
+        *
+        * If method returns error, then contents of aResult are undefined.
+		*/
+		virtual TInt FetchPhoneNumberLD( 
+			const TDesC8& aContactLink,		    
+			const CPhCntSingleItemFetch::TCallType aCallType,
+		    HBufC*& aNumber,
+		    HBufC8*& aFieldLink ) = 0;
+ 
+        /**
+         * Shows dialog for user to select a phone number for other
+         * purposes than making a call. The left softkey is 'Select'.
+         *
+         * Request can be canceled by deleting instance of this class.         
+         *
+         * @leave System wide error code
+         *
+         * @since S60 3.2
+		 * @returns The selection made by user. Ownership is transferred to 
+		 * caller. Note that the selection may be NULL, if user canceled the 
+		 * the dialog.
+		 */
+        virtual CPhCntSelection* SelectPhoneNumberLD() = 0;
+         
+    };
+
+#endif      // CPHCNTSINGLEITEMFETCH_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/Misc/CPhCntSingleItemFetchImpl.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,144 @@
+/*
+* 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 single item fetch interface.
+*
+*/
+
+
+#ifndef CPHCNTSINGLEITEMFETCHIMPL_H
+#define CPHCNTSINGLEITEMFETCHIMPL_H
+
+// INCLUDES
+#include    "CPhCntSingleItemFetch.h"
+
+// FORWARD DECLARATIONS
+class CPbkSingleItemFetch;
+class CPbkSingleItemFetchDlg;
+class CPbkFieldIdArray;
+class MPhoneCntPbkOwner;
+class CPhCntSingleCallFetchDlg;
+class CPbkContactItem;
+class TPbkContactItemField;
+
+// CLASS DECLARATION
+
+/**
+*  It is implementation of single item fetch interface.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+NONSHARABLE_CLASS( CPhCntSingleItemFetchImpl )
+    : public CPhCntSingleItemFetch
+    {
+    public:  // Constructors and destructor      
+                
+        /**
+        * Two-phased constructor.
+        *
+        * @param aPbkOwner phonebook owner interface.
+        * @return new instance of the class.
+        */
+        static CPhCntSingleItemFetchImpl* NewL(
+            MPhoneCntPbkOwner& aPbkOwner );
+        
+        /**
+        * Destructor.
+        */
+        ~CPhCntSingleItemFetchImpl();
+
+    public: // Functions from base classes
+        
+        /**
+        * From CPhCntSingleItemFetch
+        */
+        TInt FetchLD( TFetchParams& aParams );
+        
+    private:
+
+        /**
+        * C++ constructor.
+        */
+        CPhCntSingleItemFetchImpl(
+            MPhoneCntPbkOwner& aPbkOwner );
+
+        /**
+        * Symbian OS constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Fetch DTMF via single item fetch.
+        *
+        * @param aParams it contains parameters.
+        */
+        TInt FetchDtmfLD( TFetchParams& aParams );
+
+        /**
+        * Fetch new phonenumber field via single item fetch.
+        *
+        * @param aParams it contains parameters.
+        */
+        TInt FetchNewCallLD( TFetchParams& aParams );
+
+        /**
+        * Generates array of field id for DTMF fetch.
+        */
+        CPbkFieldIdArray* GenerateFieldIdArrayLC();
+
+        /**
+        * Pushes cleanup item to stack that resets some pointers.
+        */
+        void CleanupResetPtrPushL();
+
+        /**
+        * Resets iFetch & iDestroyed pointers.
+        */
+        static void ResetPointers( TAny* aAny );
+
+        /**
+        * Extracts result.
+        *
+        * @param aParams result will be stored there.
+        * @param aItem contact item.
+        * @param aField selected field.
+        * @return error code.
+        */
+        static TInt ExtractResult( 
+            TFetchParams& aParams,
+            const CPbkContactItem* aItem,
+            const TPbkContactItemField* aField );
+
+    private:    // Data
+
+        // Ref to pbk owner.
+        MPhoneCntPbkOwner& iPbkOwner;
+        
+        // Pointer to boolean flag, will be updated to ETrue upon destruction.
+        TBool* iDestroyed;
+
+        // Owned: single item fetch
+        CPbkSingleItemFetchDlg* iFetch;        
+
+        // Owned: single entry fetch
+        CPhCntSingleCallFetchDlg* iEntryFetch;
+
+        // Type of fetch
+        CPhCntSingleItemFetch::TFetchType iType;
+
+    };
+
+#endif      // CPHCNTSINGLEITEMFETCHIMPL_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/Misc/CPhCntSpeedDialMonitor.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,128 @@
+/*
+* 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:  It defines interface for speed dial for phone app.
+*
+*/
+
+
+#ifndef CPHCNTSPEEDDIALMONITOR_H
+#define CPHCNTSPEEDDIALMONITOR_H
+
+//  INCLUDES
+#include    <e32base.h>
+#include <mphcntmatch.h>
+
+// CONSTANTS
+const TInt KPhCntContactItemNotFound = -1;
+const TInt KPhCntInvalidIndex = -1;
+
+// CLASS DECLARATION
+class CSpdiaControl;
+class CEikImage;
+class MVPbkContactLink;
+class CPhCntContactId;
+
+/**
+*  It defines interface for speed dial for phone app.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+NONSHARABLE_CLASS( CPhCntSpeedDialMonitor )
+    : public CBase
+    {
+    public: // New functions
+
+        /**
+        * Structure holding speed dial information.
+        */
+        struct TSpdDialFieldInfo
+            {
+            CPhCntContactId* iContactId;
+            
+            MPhCntMatch::TNumberType iNumberType;
+            
+            // Thumbnail index of a grid array.
+            TInt iThumbIndex;
+            };
+        
+        /**
+        * Gets the speed dial number.
+        *
+        * @param aSpeedDialPosition a speed dial position
+        * @return aPhoneNumber phone number
+        * @return error code, KErrNone if success
+        */
+        virtual TInt GetSpeedDialFieldL( 
+            TInt aSpeedDialPosition, 
+            TDes& aPhoneNumber ) = 0;
+
+        /**
+        * Gets the speed dial number.
+        *
+        * @param aSpeedDialPosition a speed dial position
+        * @return aPhoneNumber phone number
+        * @return aFieldInfo speed dial contact information
+        * @return error code, KErrNone if success
+        */
+        virtual TInt GetSpeedDialFieldL(
+            TInt aSpeedDialPosition, 
+            TDes& aPhoneNumber,
+            TSpdDialFieldInfo& aFieldInfo ) = 0;
+
+        /**
+        * Assigns phone number to speed dial location
+        *
+        * @param aSpeedDialPosition the speed dial position
+        * @return aPhoneNumber If the number is assigned successfully, phone
+        *         return the phone number
+        * @return KErrNone if successfully assigned, KErrNotFound if user
+        *         cancel the assignation
+        */
+        virtual TInt AssignSpeedDialFieldL(
+            TInt aSpeedDialPosition,
+            TDes& aPhoneNumber ) = 0;
+
+        /**
+        * Assigns phone number to speed dial location
+        *
+        * @param aSpeedDialPosition the speed dial position
+        * @return aPhoneNumber If the number is assigned successfully, phone
+        *         return the phone number
+        * @return aFieldInfo speed dial contact information
+        * @return KErrNone if successfully assigned, KErrNotFound if user
+        *         cancel the assignation
+        */
+        virtual TInt AssignSpeedDialFieldL(
+            TInt aSpeedDialPosition,
+            TDes& aPhoneNumber,
+            TSpdDialFieldInfo& aFieldInfo ) = 0;
+
+        /**
+        * Cancel speed dialing assignment process
+        */
+        virtual void Cancel() = 0;
+
+        /**
+        * Create number type icon from phone book view
+        * @param aNumberType the number type
+        * @return returns a object of CEikImage
+        */
+        virtual CEikImage* CreateNumberTypeIconLC( TInt aNumberType ) = 0;
+
+    };
+
+#endif      // CPHCNTSPEEDDIALMONITOR_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/Misc/CPhCntThumbnailLoader.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Abstract interface for loading thumbail images.
+*
+*/
+
+
+#ifndef CPHCNTTHUMBNAILLOADER_H
+#define CPHCNTTHUMBNAILLOADER_H
+
+// INCLUDES
+#include    <e32base.h>
+#include    <cntdef.h>
+
+class CPhCntContactId;
+
+// CONSTANTS
+// MACROS
+#define KPhCntThumbnailNullId 0
+
+// CLASS DECLARATION
+
+/**
+*  It is abstract interface for loading thumbail images.
+*
+*  Note that it is considered that loading of thumbnail images is not critical.
+*  Thus, if something fails during loading procedure, then we ignore the whole 
+*  thumbnail.
+*
+*  However, observer will be informed of both success and failure.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+NONSHARABLE_CLASS( CPhCntThumbnailLoader )
+    : public CBase
+    {
+    public: // New functions
+
+        /**
+        * It defines type for thumbnail ids.
+        */
+        typedef const TAny* TThumbnailId;
+
+        /**
+        * Loads thumbnail asynchronously.
+        *
+        * You can call this to load several images. Images are loaded in
+        * FIFO order.
+        *
+        * @param aId id. if id is already in use, it's canceled. It will
+        *            be zeroed if loading failed to the beginning.
+        * @param aContactId contact id. Copies the contact id.
+        * @return error code.
+        */
+        virtual TInt Load( TThumbnailId& aId, const CPhCntContactId& aContactId ) = 0;
+        
+        /**
+        * Cancels loading of thumbnail with given id.
+        *
+        * @param aId id to cancel.
+        */
+        virtual void Cancel( TThumbnailId aId ) = 0;  
+        
+    };
+
+#endif      // CPHCNTTHUMBNAILLOADER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/Misc/CPhCntThumbnailLoaderImpl.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,265 @@
+/*
+* 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 interface for loading thumbail images.
+*
+*/
+
+
+#ifndef CPHCNTTHUMBNAILLOADERIMPL_H
+#define CPHCNTTHUMBNAILLOADERIMPL_H
+
+// INCLUDES
+#include    "CPhCntThumbnailLoader.h"
+#include    "mphcntthumbnailloader.h"
+
+// FORWARD DECLARATIONS
+class MPhoneCntPbkOwner;
+class MPhCntThumbnailLoaderObserver;
+class CPbkContactItem;
+class CPbkThumbnailManager;
+class MPbkThumbnailOperation;
+class CPhCntContactId;
+
+// CLASS DECLARATION
+
+/**
+*  It loads thumbail images.
+*
+*  Note that it is considered that loading of thumbnail images is not critical.
+*  Thus, if something fails during loading procedure, then we ignore the whole 
+*  thumbnail.
+*
+*  However, observer will be informed of both success and failure.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+NONSHARABLE_CLASS( CPhCntThumbnailLoaderImpl )
+    : public CPhCntThumbnailLoader,
+      private MPhCntLoaderObserver
+    {
+    public:  // Constructors and destructor      
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CPhCntThumbnailLoaderImpl* NewL(
+            MPhCntThumbnailLoaderObserver& aObserver,
+            MPhoneCntPbkOwner& aPbkOwner,
+            MPhCntThumbnailLoader& aLoader );
+        
+        /**
+        * Destructor.
+        */
+        ~CPhCntThumbnailLoaderImpl();
+
+    public: // Functions from base classes
+
+        /**
+        * From CPhCntThumbnailLoader
+        */
+        TInt Load( TThumbnailId& aId, const CPhCntContactId& aContactId );
+        
+        /**
+        * From CPhCntThumbnailLoader
+        */
+        void Cancel( TThumbnailId aId );
+        
+        /**
+         * Indication that loading has been made.
+         * 
+         * @since S60 v3.0
+         * @param Pointer of bitmap loaded, ownership is given to caller.
+         * May be null if error occured during loading.
+         * @param aError Error code of loading.
+         */
+        void LoadingCompleted( CFbsBitmap* aBitmap, TInt aError );
+       
+    private:
+
+        /**
+        * It contains necessary information to load a thumbnail.
+        */
+        struct TThumbnailInfo
+            {
+            // It contains index.
+            TThumbnailId iId;
+
+            // Identifies the contact, which thumbnail is going to be loaded.
+            CPhCntContactId* iContactId;
+            };
+
+        /**
+        * It enumerates all states.
+        */
+        enum TState
+            {
+            ELoadFromContact,
+            EProcessResult
+            };
+
+        /**
+        * C++ constructor.
+        */
+        CPhCntThumbnailLoaderImpl(
+            MPhCntThumbnailLoaderObserver& aObserver,
+            MPhoneCntPbkOwner& aPbkOwner,
+            MPhCntThumbnailLoader& aLoader );
+
+        /**
+        * Symbian OS constructor.
+        */
+        void ConstructL( MPhoneCntPbkOwner& aPbkOwner );
+
+        /**
+        * Attempts to start loading of thumbnail.
+        */
+        void AttemptLoadL( 
+            TThumbnailId aId, 
+            const CPhCntContactId& aContactId );
+
+        /**
+        * Starts loading next thumbnail.
+        */
+        void StartLoadL();
+
+        /**
+        * Cancels loading.
+        */
+        void CancelLoad();
+
+        /**
+        * Processes the result.
+        */
+        void ProcessResultL();
+
+        /**
+        * Finds position in array by thumbnail id.
+        *
+        * @param aId id.
+        * @return position or KErrNotFound if not found.
+        */
+        TInt FindById( TThumbnailId aId );
+
+        /**
+        * Starts loading. If it failed, then simply inform
+        * observer about failure.
+        */
+        void DoStartLoad();
+
+        /**
+        * Handles start.
+        */
+        void HandleStartL();
+        
+        /**
+        * Handles start; calls HandleStartL in trap harnness.
+        */
+        void HandleStart();
+
+        /**
+        * Starts bridge.
+        */ 
+        void Start( TState aState );
+
+        /**
+        * Idle callback.
+        */
+        static TInt DoStart( TAny* aAny );
+        
+        /**
+        * It gives thumbnail to the observer.
+        *
+        * Ownership of the bitmap is transferred to the client.
+        *
+        * @param aResult error code.
+        * @param aBitmap bitmap or NULL if no bitmap loaded.
+        */
+        void Notify( 
+            TThumbnailId aId, 
+            TInt aResult, 
+            CFbsBitmap* aBitmap );
+
+        /**
+        * Clears all pbk stuff.
+        */
+        void ClearPbk( TBool aMore = ETrue );
+
+        /**
+        * Compares ids of two structure.
+        *
+        * @return ETrue iff aFirst.iId == aSecond.iId.
+        */
+        static TBool CompareIds( 
+            const TThumbnailInfo& aFirst,
+            const TThumbnailInfo& aSecond );
+
+        /**
+        * It is enumeration of all panic reasons.
+        */
+        enum TPanicReason
+            {
+            EPanicInvariant,
+            EPanicInvalidState
+            };
+
+        /**
+        * Panics.
+        *
+        * @param aReason reason for panic.
+        */
+        static void Panic( TPanicReason aReason );
+        
+        void ClearThumbnailArray();
+        
+        void RemoveThumbnailArrayEntry( TInt aIndex );
+        
+    private:    // Data
+        
+        /**
+        * It is type for array of thumbnail info.
+        */
+        typedef RArray< TThumbnailInfo > RThumbnailArray;
+
+        // Ref: Observer.
+        MPhCntThumbnailLoaderObserver& iObserver;       
+
+        // Owned: array of thumbnails to load.
+        RThumbnailArray iArray;
+
+        // Owned: active bridge
+        CIdle* iBridge;
+
+        // INFORMATION OF LOADING..
+        
+        // Current state.
+        TState iState;
+
+        // Currently loading. System is loading iff iCurrent != KNullId.
+        TThumbnailId iCurrent;                
+
+        // Current bitmap.
+        CFbsBitmap* iBitmap;
+        
+        /**
+         * Thumbnail loader.
+         * Own.
+         */
+        MPhCntThumbnailLoader* iLoader;
+
+    };
+
+#endif      // CPHCNTTHUMBNAILLOADERIMPL_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/Misc/MPhCntThumbnailLoaderObserver.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Defines interface for the observer of thumbnail loader.
+*
+*/
+
+
+#ifndef MPHCNTTHUMBNAILLOADEROBSERVER_H
+#define MPHCNTTHUMBNAILLOADEROBSERVER_H
+
+// INCLUDES
+#include    <e32base.h>
+#include    "CPhCntThumbnailLoader.h"
+
+// FORWARD DECLARATIONS
+class CFbsBitmap;
+
+// CLASS DECLARATION
+
+/**
+*  It defines interface for the observer of thumbnail loader.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+class MPhCntThumbnailLoaderObserver
+    {
+    public: // New functions
+
+        /**
+        * It is called when thumbnail loading has been completed.
+        *
+        * Ownership of the bitmap is transferred to the observer.
+        *
+        * @param aId id, never KNullId.
+        * @param aResult error code.
+        * @param aBitmap bitmap.
+        */
+        virtual void MpctloThumbnailLoaded(
+            CPhCntThumbnailLoader::TThumbnailId aId,
+            TInt aResult, 
+            CFbsBitmap* aBitmap ) = 0;
+       
+    };
+
+#endif      // MPHCNTTHUMBNAILLOADEROBSERVER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/PhCntPanic.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,38 @@
+/*
+* 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:  Panic method
+*
+*/
+
+
+#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/PhoneCntFinder/inc/PhCntTrace.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Traces
+*
+*/
+
+
+#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/PhoneCntFinder/inc/cphcntcontactid.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Abstract base class for contact identifier.
+*
+*/
+
+
+#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/PhoneCntFinder/inc/cphcntpbkcontactid.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Contact id used with contact engine.
+*
+*/
+
+
+#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/PhoneCntFinder/inc/cphcntpbksaveaddtoname.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Add number to existing name and save the number.
+*
+*/
+
+
+#ifndef CPHCNTVPBKSAVEADDTONAME_H
+#define CPHCNTVPBKSAVEADDTONAME_H
+
+#include <e32base.h>
+
+#include "CPhoneCntSaveAddToName.h"
+
+/**
+ *  Add number to existing name and save the number.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CPhCntPbkSaveAddToName )
+    : public CBase, 
+      public MPhoneCntSaveAddToName
+    {
+public: // New functions       
+    /**
+    * Two-phased constructor.
+    * @param aPbkOwner Phonebook owner.
+    * @return new instance of the class.
+    */
+    static CPhCntPbkSaveAddToName* NewL( MPhoneCntPbkOwner& aPbkOwner );
+
+    /**
+    * Destructor.
+    */
+    ~CPhCntPbkSaveAddToName();
+
+public : // Functions from base classes
+
+    /**
+    * From MPhoneCntSaveAddToName
+    */
+    void HandlePbkOperationL(
+        const TCntPhoneNumber& aTelNumber,
+        TInt aCommand );
+    
+    /**
+    * From MPhoneCntSaveAddToName
+    * @since 3.0
+    */
+    void HandlePbkOperationL(
+        const TCntPhoneNumber& aTelNumber,
+        TInt aCommand,
+        TCntNumberType aNumberType );
+        
+private:
+    
+    /**
+    * C++ constructor.
+    */
+    CPhCntPbkSaveAddToName( MPhoneCntPbkOwner& aPbkOwner );
+
+    /**
+    * Symbian OS constructor.
+    */
+    void ConstructL();
+    
+private://data
+    // Phoneboo owner
+    MPhoneCntPbkOwner& iPbkOwner;
+
+    // Phonebook saver
+    CPbkDataSaveAppUi* iPbkDataSaveAppUi;
+    };
+
+
+#endif // CPHCNTVPBKSAVEADDTONAME_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/cphcntpbkthumbnailloader.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,165 @@
+/*
+* 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:  Loads thumbnail from contact engine.
+*
+*/
+
+
+#ifndef CPHCNTPBKTHUMBNAILLOADER_H
+#define CPHCNTPBKTHUMBNAILLOADER_H
+
+#include <e32base.h>
+#include <MPbkThumbnailOperationObservers.h>
+
+#include "cphcntthumbnailloaderbase.h"
+
+class MPhoneCntPbkOwner;
+class CPhCntContactId;
+class MPbkThumbnailOperation;
+class CPbkContactItem;
+class CPbkThumbnailManager;
+class MPbkThumbnailGetObserver;
+
+
+/**
+ *  Loads thumbnail from contact engine.
+ *
+ *  @lib S60 PhoneCntFinder
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CPhCntPbkThumbnailLoader ) : 
+    public CPhCntThumbnailLoaderBase,
+    private MPbkThumbnailGetObserver
+    {
+public:
+    
+    /**
+     * Static constructor.
+     *
+     * @since S60 v3.1
+     * @param aOwner Owner of phone book.
+     */
+    static CPhCntPbkThumbnailLoader* NewL( MPhoneCntPbkOwner& aOwner );
+
+    /**
+     * Static constructor.
+     *
+     * @since S60 v3.1
+     * @param aOwner Owner of phone book.
+     */
+    static CPhCntPbkThumbnailLoader* NewLC( MPhoneCntPbkOwner& aOwner );
+
+    /**
+     * Destructor.
+     *
+     * @since S60 v3.1
+     */
+    virtual ~CPhCntPbkThumbnailLoader();
+
+// From base class CPhCntThumbnailLoaderBase
+    
+    /**
+     * Starts the loading of thumbnail from contact, which is 
+     * identified by contact id.
+     *
+     * @since S60 v3.1
+     * @param aContactId Contact id, which identifies the contact where thumbnail
+     * is loaded.
+     */
+     void DoLoadL( const CPhCntContactId& aContactId );
+     
+// From base class MPhCntThumbnailLoader
+        
+    /**
+     * From MPhCntThumbnailLoader
+     * 
+     * @since S60 v3.1
+     * @see MPhCntThumbnailLoader
+     */
+    void Release();
+    
+    /**
+     * From MPhCntThumbnailLoader
+     * 
+     * @since S60 v3.1
+     * @see MPhCntThumbnailLoader
+     */
+    void Cancel();
+     
+private:
+
+    /**
+     * From MPbkThumbnailGetObserver, called when 
+     * thumbnail loading is completed.
+     *
+     * @param aOperation the completed operation.
+     * @param aBitmap The loaded bitmap. Callee is responsible of 
+     *                the bitmap.
+     */
+    void PbkThumbnailGetComplete(
+        MPbkThumbnailOperation& aOperation, 
+        CFbsBitmap* aBitmap );
+
+    /**
+     * From MPbkThumbnailGetObserver, called if 
+     * the thumbnail loading fails.
+     *
+     * @param aOperation the failed operation.
+     * @param aError error code of the failure.
+     */
+    void PbkThumbnailGetFailed(
+        MPbkThumbnailOperation& aOperation, 
+        TInt aError );
+   
+private:
+
+    CPhCntPbkThumbnailLoader( 
+        MPhoneCntPbkOwner& aOwner );
+
+    void ConstructL();
+    
+    /**
+     * Clears all pbk stuff.
+     */
+    void ClearPbk( TBool aMore = ETrue );
+
+private: // data
+    
+    /**
+     * Owner of contact access.
+     * Not own.
+     */
+    MPhoneCntPbkOwner& iOwner;
+   
+    /**
+     * Thumnail loading operation.
+     * own.
+     */
+    MPbkThumbnailOperation* iPbkGetOp;
+    
+    /**
+     * Contact.
+     * Own.
+     */
+    CPbkContactItem* iPbkItem;
+    
+    /**
+     * Thumbnail manager.
+     * Own.
+     */
+    CPbkThumbnailManager* iPbkManager;
+    };
+
+
+#endif // CPHCNTPBKTHUMBNAILLOADER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/cphcntthumbnailloaderbase.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Base class for concrete thumbnailloaders.
+*
+*/
+
+
+#ifndef CPHCNTTHUMBNAILLOADERBASE_H
+#define CPHCNTTHUMBNAILLOADERBASE_H
+
+
+#include <e32base.h>
+#include "mphcntthumbnailloader.h"
+
+/**
+ *  Base class for thumbnail loaders.
+ *
+ *  Holds the loading observer and offers interface 
+ *  for notifying the observer.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CPhCntThumbnailLoaderBase ) : 
+    public CBase,
+    public MPhCntThumbnailLoader
+    {
+public:
+
+// from base class MPhCntThumbnailLoader
+
+     /**
+      * From MPhCntThumbnailLoader.
+      *
+      * @since S60 v3.1
+      * @see MPhCntThumbnailLoader
+      */
+    void LoadL( 
+        const CPhCntContactId& aContactId,
+        MPhCntLoaderObserver& aLoadingObserver );
+
+protected:
+
+    virtual ~CPhCntThumbnailLoaderBase();
+
+    CPhCntThumbnailLoaderBase();
+    
+    /**
+     * Notifies the observer.
+     */
+    void NotifyObserver( CFbsBitmap* aBitmap, TInt aError );
+    
+private:
+
+    /**
+     * Template method, for doing the actual loading in base class.
+     */
+    virtual void DoLoadL( const CPhCntContactId& aContactId ) = 0;
+    
+private: // Data
+
+    /** 
+     * Observer of loading thumbnail.
+     * Not own.
+     */
+    MPhCntLoaderObserver* iLoadingObserver;
+
+    };
+
+#endif // CPHCNTTHUMBNAILLOADERBASE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/inc/mphcntthumbnailloader.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,97 @@
+/*
+* 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 loading thumbnails from contacts.
+*
+*/
+
+
+#ifndef MPHCNTTHUMBNAILLOADER_H
+#define MPHCNTTHUMBNAILLOADER_H
+
+class CPhCntContactId;
+class MPhCntThumbnailLoaderObserver;
+class CFbsBitmap;
+
+/**
+ * Observer interface for observing thumbnail loading
+ * of MPhCntThumbnailLoader.
+ * 
+ * @lib PhoneCntFinder.
+ * @since S60 v3.1
+ */
+NONSHARABLE_CLASS( MPhCntLoaderObserver )
+    {
+public:
+
+    /**
+     * Indication that loading has been made.
+     * 
+     * @since S60 v3.0
+     * @param Pointer of bitmap loaded, ownership is given to caller.
+     * May be null if error occured during loading.
+     * @param aError Error code of loading.
+     */
+    virtual void LoadingCompleted( CFbsBitmap* aBitmap, TInt aError ) = 0;
+    };
+ 
+ 
+/**
+ *  Interface for thumbnail loader.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( MPhCntThumbnailLoader )
+    {
+
+public:
+    
+    /**
+     * Destructor.
+     *
+     * @since S60 v3.1
+     */
+    virtual ~MPhCntThumbnailLoader() {};
+    
+     /**
+      * Starts the loading of thumbnail from contact, which is 
+      * identified by contact id.
+      *
+      * @since S60 v3.1
+      * @param aContactId Contact id, which identifies the contact where thumbnail
+      * is loaded.
+      */
+    virtual void LoadL( 
+        const CPhCntContactId& aContactId,
+        MPhCntLoaderObserver& aLoadingObserver ) = 0;
+        
+    /**
+     * Indicats that loadings of thumbnails is done for now and 
+     * resources can be released.
+     *
+     * @since S60 v3.1
+     */
+    virtual void Release() = 0;
+    
+    /**
+     * Cancels the current loading.
+     *
+     * @since S60 v3.1
+     */
+    virtual void Cancel() = 0;
+
+    };
+
+
+#endif // MPHCNTTHUMBNAILLOADER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/rom/PhoneCntFinder.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -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/PhoneCntFinder/src/CPhoneCntFactoryImpl.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,350 @@
+/*
+* 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:  Factory class's implementation.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CPhoneCntFactoryImpl.h"
+#include    "CPhCntThumbnailLoaderImpl.h"
+#include    "CPhCntRfsHandlerImpl.h"
+#include    "CPhCntMmiSecurityImpl.h"
+#include    "CPhoneCntSaveAddToName.h"
+#include    "CPhoneCntPbkOwner.h"
+#include    "CPhCntMatcherImpl.h"
+#include    "CPhCntProfileEngineImpl.h"
+
+#include    <CProfileChangeNotifyHandler.h>
+#include    <MProfileChangeObserver.h>
+
+#include    "CPhCntSingleItemFetchService.h"
+#include    "cphcntspeeddialimpl.h"
+#include    "cphcntvpbkthumbnailloader.h"
+#include    "CPhCntContactStores.h"
+#include    "cphcntvpbkcontactid.h"
+#include    "CPhCntContactManager.h"
+#include    "cphcntphonebookservices.h"
+#include    "cphcntmatchervoipimpl.h"
+#include    "CPhCntMatcherImpl.h"
+#include    "CPhCntAIWService.h"
+#include    "tphcntservicerequestparamfactory.h"
+#include    "cphcntcontactdataselectionimpl.h"
+#include    "cphcntstoreloaderimpl.h"
+
+#include    <coemain.h>     // CONE
+#include    <SecUi.h>       // For TSecUi
+#include    <featmgr.h>     // Feature Manager
+#include    <talogger.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhCntFactoryImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPhCntFactoryImpl* CPhCntFactoryImpl::NewL()
+    {
+    CPhCntFactoryImpl* self = new (ELeave) CPhCntFactoryImpl;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl::~CPhCntFactoryImpl
+// ---------------------------------------------------------------------------
+//
+CPhCntFactoryImpl::~CPhCntFactoryImpl()
+    {
+    delete iPhonebookServices;
+    delete iContactStores;
+
+    if ( iSecUiInit )
+        {
+        TSecUi::UnInitializeLib();
+        }
+
+    iPbkResource.Close();
+    delete iPbkOwner;
+    FeatureManager::UnInitializeLib();
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl::CreateSpeedDialMonitorL
+// ---------------------------------------------------------------------------
+//
+CPhCntSpeedDialMonitor* CPhCntFactoryImpl::CreateSpeedDialMonitorL()
+    {
+    CreateContactStoreAndManagerL();
+    return CPhCntSpeedDialImpl::NewL( *iPbkOwner );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl::CreateThumbnailLoaderL
+// ---------------------------------------------------------------------------
+//
+CPhCntThumbnailLoader* CPhCntFactoryImpl::CreateThumbnailLoaderL(
+        MPhCntThumbnailLoaderObserver& aObserver )
+    {
+    CreateContactStoreAndManagerL();
+    
+    CPhCntContactStores* contactStores = 
+        CPhCntContactStores::NewL( *iPbkOwner->ContactManager() );
+    CleanupStack::PushL( contactStores );
+    
+    CPhCntVPbkThumbnailLoader* loader = 
+        CPhCntVPbkThumbnailLoader::NewL( *contactStores );
+    CleanupStack::Pop( contactStores );
+    CleanupStack::PushL( loader );
+    
+    CPhCntThumbnailLoaderImpl* impl =  
+        CPhCntThumbnailLoaderImpl::NewL( aObserver, *iPbkOwner, *loader );
+    CleanupStack::Pop( loader );
+    
+    return impl;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl::CreateSingleItemFetchL
+// ---------------------------------------------------------------------------
+//
+CPhCntSingleItemFetch* CPhCntFactoryImpl::CreateSingleItemFetchL()
+    {
+    CreatePhonebookServicesL();
+    return CPhCntSingleItemFetchService::NewL( 
+        *iContactStores, *iPbkOwner->ContactManager() );    
+    }
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl::CreateContactDataSelectionL
+// ---------------------------------------------------------------------------
+//       
+CPhCntContactDataSelection* CPhCntFactoryImpl::CreateContactDataSelectionL()
+    {
+    CreatePhonebookServicesL();
+    CPhCntAiwService* service = CPhCntAiwService::NewL();
+    CleanupStack::PushL( service );
+    CPhCntServiceRequestParamFactory* factory = 
+        CPhCntServiceRequestParamFactory::NewLC( *iPbkOwner->ContactManager() );
+    CPhCntContactStores* contactStores = 
+        CPhCntContactStores::NewL( *iPbkOwner->ContactManager() );
+    CleanupStack::PushL( contactStores );
+    
+        
+    CPhCntContactDataSelectionImpl* impl = 
+        CPhCntContactDataSelectionImpl::NewL(
+            service,
+            factory,
+            contactStores );
+    CleanupStack::Pop( 3, service );
+    return impl;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl::CreateSaveAddToNameL
+// ---------------------------------------------------------------------------
+//
+CPhoneCntSaveAddToName* CPhCntFactoryImpl::CreateSaveAddToNameL()
+    {
+    CreatePhonebookServicesL();
+    
+    CPhoneCntSaveAddToName* phoneSaveAddToName =  
+        CPhoneCntSaveAddToName::NewL( *iPhonebookServices );
+    return phoneSaveAddToName;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl::CreateRfsHandlerL
+// ---------------------------------------------------------------------------
+//
+CPhCntRfsHandler* CPhCntFactoryImpl::CreateRfsHandlerL()    
+    {
+    return CPhCntRfsHandlerImpl::NewL();
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl::CreateMmiSecurityL
+// ---------------------------------------------------------------------------
+//
+CPhCntMmiSecurity* CPhCntFactoryImpl::CreateMmiSecurityL()
+    {
+    if ( !iSecUiInit )
+        {
+        TSecUi::InitializeLibL();
+        iSecUiInit = ETrue;
+        }
+        
+    return CPhCntMmiSecurityImpl::NewL();
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl::CreateContactMatcherL
+// 
+//  Create contact matcher
+// ---------------------------------------------------------------------------
+//
+CPhCntMatcher* CPhCntFactoryImpl::CreateContactMatcherL()
+    {
+    CreateContactStoreAndManagerL();
+    CPhCntMatcherImpl* matcher = NULL;
+    if( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
+        {
+        matcher = CPhCntMatcherVoIPImpl::NewL( *iPbkOwner );
+        }
+    else 
+        {
+        matcher = CPhCntMatcherImpl::NewL( *iPbkOwner );
+        }
+
+    return matcher;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl::CreateProfileEngineL
+// ---------------------------------------------------------------------------
+//
+CPhCntProfileEngine* CPhCntFactoryImpl::CreateProfileEngineL()
+    {
+    return CPhCntProfileEngineImpl::NewL();
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl::CreateProfileEngineNotifyHandlerL
+// ---------------------------------------------------------------------------
+//
+CBase* CPhCntFactoryImpl::CreateProfileEngineNotifyHandlerL( 
+        MProfileChangeObserver* aObserver )
+    {
+    return CProfileChangeNotifyHandler::NewL( aObserver );
+    }
+    
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl::CreateContactIdL
+// ---------------------------------------------------------------------------
+//    
+CPhCntContactId* CPhCntFactoryImpl::CreateContactIdL()
+    {
+    CreateContactStoreAndManagerL();
+    MVPbkContactLink* nullLink = NULL;
+    return CPhCntVPbkContactId::NewL( nullLink, *iPbkOwner->ContactManager() );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl::CreateContactIdL
+// ---------------------------------------------------------------------------
+//    
+CPhCntContactId* CPhCntFactoryImpl::CreateContactIdL( 
+    TContactItemId aContactId )
+    {
+    CreateContactStoreAndManagerL();
+    return CPhCntVPbkContactId::NewL( aContactId, *iPbkOwner->ContactManager() );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl::CreateContactIdL
+// ---------------------------------------------------------------------------
+//    
+CPhCntContactId* CPhCntFactoryImpl::CreateContactIdL( 
+    const TDesC8& aContactId )
+    {
+    CreateContactStoreAndManagerL();
+    return CPhCntVPbkContactId::NewL( aContactId, *iPbkOwner->ContactManager() );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl::CreateContactStoreLoaderL
+// ---------------------------------------------------------------------------
+//
+MPhCntStoreLoader* CPhCntFactoryImpl::CreateContactStoreLoaderL()
+    {
+    CreateContactStoreAndManagerL();
+    
+    return CPhCntStoreLoaderImpl::NewL( *(iPbkOwner->ContactManager() ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntFactoryImpl::CPhCntFactoryImpl
+// C++ constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhCntFactoryImpl::CPhCntFactoryImpl()
+: iPbkResource( *CCoeEnv::Static() )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntFactoryImpl::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhCntFactoryImpl::ConstructL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPhCntFactoryImpl::ConstructL" );
+    FeatureManager::InitializeLibL();
+    }
+
+// -----------------------------------------------------------------------------
+// Creates phonebook services.
+// -----------------------------------------------------------------------------
+//    
+void CPhCntFactoryImpl::CreatePhonebookServicesL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPhCntFactoryImpl::CreatePhonebookServicesL" );
+    CreateContactStoreAndManagerL();
+        
+    if( !iPbkResource.IsOpen() )
+        {
+        iPbkResource.OpenL();  
+        iPhonebookServices = 
+            CPhCntPhonebookServices::NewL( 
+                *iContactStores, 
+                *iPbkOwner->ContactManager() );
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// Creates phonebook services.
+// -----------------------------------------------------------------------------
+//   
+void CPhCntFactoryImpl::CreateContactStoreAndManagerL()
+    {
+    if( !iPbkOwner )
+        {
+        iPbkOwner = CPhoneCntPbkOwner::NewL( );
+        CPhCntContactManager* contactManager = iPbkOwner->ContactManager();
+        iContactStores = CPhCntContactStores::NewL( *contactManager );
+        }
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+
+// ---------------------------------------------------------------------------
+// CreateCntFactoryL
+// 
+//  Creates instance of contact factory.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CPhCntFactory* CreateCntFactoryL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPhCntFactoryImpl::CreateCntFactoryL" );
+    return CPhCntFactoryImpl::NewL();
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/src/CPhoneCntNumberParser.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,93 @@
+/*
+* 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 class loads contact model phone number parser DLL.
+*
+*/
+
+
+//  INCLUDES
+#include "CPhoneCntNumberParser.h"
+#include <cntdb.h>
+#include <ecom.h>
+
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <cntphonenumparser.h>
+#endif
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CCntNumberParser::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CCntNumberParser* CCntNumberParser::NewL()
+    {
+    CCntNumberParser* self = new (ELeave) CCntNumberParser();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// Destructor
+CCntNumberParser::~CCntNumberParser()
+    {
+    delete iParser;
+    REComSession::FinalClose();
+    }
+
+// -----------------------------------------------------------------------------
+// CCntNumberParser::CCntNumberParser
+// C++ constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CContactPhoneNumberParser* 
+    CCntNumberParser::CntPhoneNumberParser() const
+    {
+    return iParser;
+    }
+
+// -----------------------------------------------------------------------------
+// CCntNumberParser::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CCntNumberParser::ConstructL()
+    {
+    RImplInfoPtrArray   implInfoArray;
+    CleanupResetAndDestroyPushL( implInfoArray );
+    REComSession::ListImplementationsL( KUidEcomCntPhoneNumberParserInterface, 
+                                        implInfoArray );
+    // Load the first implementation found for KUidEcomCntPhoneNumberParserInterface 
+    const TInt count = implInfoArray.Count();
+    __ASSERT_ALWAYS( count > 0, User::Leave( KErrNotFound ) );
+    const TUid firstImplementationFound = implInfoArray[0]->ImplementationUid();
+    iParser = reinterpret_cast<CContactPhoneNumberParser*> 
+        ( CContactEcomPhoneNumberParser::NewL( firstImplementationFound ) );
+    CleanupStack::PopAndDestroy( &implInfoArray );
+    }
+
+// -----------------------------------------------------------------------------
+// CCntNumberParser::CCntNumberParser
+// C++ constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CCntNumberParser::CCntNumberParser() 
+    {
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/src/CPhoneCntPbkOwner.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,95 @@
+/*
+* 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:  Implementation of phonebook management in PhoneCntFinder.
+*
+*/
+
+
+// INCLUDE FILES
+#include  "CPhoneCntPbkOwner.h"
+#include  "CPhCntContactManager.h"
+
+#include  <e32property.h>
+
+// MACROS
+#ifndef __WINS__
+#ifdef _DEBUG
+#define PHONECNTDEBUG_ON
+#endif // _DEBUG
+#endif // __WINS__
+
+#ifdef PHONECNTDEBUG_ON
+#include    <e32svr.h> // class RDebug
+#define PHONECNTDEBUGPRINT( x ) RDebug::Print( (x) );
+#else
+#define PHONECNTDEBUGPRINT( x )
+#endif // PHONECNTDEBUG_ON
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhoneCntPbkOwner::CPhoneCntPbkOwner
+// C++ constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneCntPbkOwner::CPhoneCntPbkOwner( ) 
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneCntPbkOwner::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneCntPbkOwner::ConstructL()
+    {
+    iContactManager = CPhCntContactManager::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneCntPbkOwner::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPhoneCntPbkOwner* CPhoneCntPbkOwner::NewL()
+    {
+    CPhoneCntPbkOwner* self = new (ELeave) CPhoneCntPbkOwner();
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneCntPbkOwner::~CPhoneCntPbkOwner
+// -----------------------------------------------------------------------------
+//
+CPhoneCntPbkOwner::~CPhoneCntPbkOwner()
+    {
+    delete iContactManager;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneCntPbkOwner::ContactManager
+// -----------------------------------------------------------------------------
+CPhCntContactManager* CPhoneCntPbkOwner::ContactManager() const
+    {
+    return iContactManager;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/src/CPhoneCntSaveAddToName.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Add number to existing name and save the number.
+*
+*/
+
+
+//  INCLUDES
+
+#include <e32base.h>
+#include <PbkDataSaveAppUi.hrh>
+
+#include "MPhCntPhonebookServices.h"
+#include "CPhoneCntSaveAddToName.h"
+#include "MPhoneCntPbkOwner.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// ----------------------------------------------------------------------------
+//  CPhoneCntSaveAddToName::NewL
+// ----------------------------------------------------------------------------
+//
+CPhoneCntSaveAddToName* CPhoneCntSaveAddToName::NewL( 
+       MPhCntPhonebookServices& aServices )
+    {
+    CPhoneCntSaveAddToName* self = 
+        new(ELeave) CPhoneCntSaveAddToName( aServices );
+    return self;
+    }
+
+// ----------------------------------------------------------------------------
+// CPhoneCntSaveAddToName::~CPhoneCntSaveAddToName
+// ----------------------------------------------------------------------------
+//
+EXPORT_C CPhoneCntSaveAddToName::~CPhoneCntSaveAddToName()
+    {
+    iServices.CancelRequest();
+    }
+
+// ----------------------------------------------------------------------------
+// CPhoneCntSaveAddToName::HandlePbkOperationL
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneCntSaveAddToName::HandlePbkOperationL( 
+        const TCntPhoneNumber& aTelNumber,
+        TInt aCommand )
+    {
+    TInt err = KErrNone;
+    switch( aCommand ) 
+        {
+        case EPbkCmdDataSaveCreateNew:
+            TRAP( err, iServices.CreateNewContactL( aTelNumber ) );
+            break;
+        
+        case EPbkCmdDataSaveAddToExisting:
+            TRAP( err,iServices.UpdateExistingContactL( aTelNumber ) ); 
+            break;
+        
+        default:
+            User::Leave( KErrArgument );
+            break;
+        }
+    // Dont leave with KErrCancel, because it is valid functionality to
+    // cancel service.
+    if( err != KErrCancel ) 
+        {
+        User::LeaveIfError( err );
+        }
+    }
+    
+// ----------------------------------------------------------------------------
+// CPhoneCntSaveAddToName::HandlePbkOperationL
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneCntSaveAddToName::HandlePbkOperationL( 
+        const TCntPhoneNumber& aTelNumber,
+        TInt aCommand,
+        TCntNumberType /*aNumberType*/ )
+    {
+    HandlePbkOperationL( aTelNumber, aCommand );
+    }
+
+// ----------------------------------------------------------------------------
+// CPhoneCntSaveAddToName::CPhoneCntSaveAddToName
+// ----------------------------------------------------------------------------
+//
+CPhoneCntSaveAddToName::CPhoneCntSaveAddToName( 
+        MPhCntPhonebookServices& aServices  )
+    : iServices( aServices )  
+    {
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/src/CPhoneRawMatchNumberExtractor.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This class extracts phone number for comparsion.
+*
+*/
+
+
+//  INCLUDES
+#include "CPhoneRawMatchNumberExtractor.h"
+#include "CPhoneCntNumberParser.h"
+#include <cntdb.h>
+
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <cntphonenumparser.h>
+#endif
+
+// CONSTANTS
+
+// DEPRECATED
+const TUint KPhCntExtractorExtraChar = '1'; // number makes no difference.
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CCntRawPhoneNumberExtractor::CCntRawPhoneNumberExtractor
+// C++ constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CCntRawPhoneNumberExtractor::CCntRawPhoneNumberExtractor() 
+: iKPhoneNumberExtraChar( KPhCntExtractorExtraChar ) 
+    {
+    }
+
+// Destructor
+CCntRawPhoneNumberExtractor::~CCntRawPhoneNumberExtractor()
+    {
+    delete iNumberParser;
+    }
+
+// -----------------------------------------------------------------------------
+// CCntRawPhoneNumberExtractor::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CCntRawPhoneNumberExtractor::ConstructL()
+    {
+    iNumberParser = CCntNumberParser::NewL();
+    iParser = iNumberParser->CntPhoneNumberParser();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CCntRawPhoneNumberExtractor::Release
+// 
+//  Releases used memory
+// -----------------------------------------------------------------------------
+//
+void CCntRawPhoneNumberExtractor::Release()
+    {
+    delete this;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CCntRawPhoneNumberExtractor::ExtractRawNumber
+// 
+//  DEPRECATED. 
+// -----------------------------------------------------------------------------
+//
+TUint CCntRawPhoneNumberExtractor::ExtractRawNumber(
+    const TDesC& /*aTextualNumber*/)
+    {
+    __ASSERT_DEBUG( EFalse , User::Invariant() );
+    return 0;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CCntRawPhoneNumberExtractor::ExtractRawNumber
+// 
+//  Does the actual extracting
+// -----------------------------------------------------------------------------
+//
+TUint CCntRawPhoneNumberExtractor::ExtractRawNumber(
+    const TDesC& aTextualNumber, 
+    TDes& aRawNumber)
+    {
+    aRawNumber.Zero();
+    iParser->ExtractRawNumber( aTextualNumber , iMatchBuffer );
+    if ( iMatchBuffer.Length() == 0 )
+        {
+        return 0;
+        }
+
+    if ( iMatchBuffer.Length() > aRawNumber.MaxLength() )
+        {
+        aRawNumber = iMatchBuffer.Right( aRawNumber.MaxLength() );
+        }
+    else
+        {
+        aRawNumber = iMatchBuffer;
+        }
+    return 0;
+    }
+
+// -----------------------------------------------------------------------------
+// CCntRawPhoneNumberExtractor::ExtraChar() const
+// 
+//  DEPRECATED.
+// -----------------------------------------------------------------------------
+//
+TChar CCntRawPhoneNumberExtractor::ExtraChar() const
+    {
+    __ASSERT_DEBUG( EFalse , User::Invariant() );
+    return iKPhoneNumberExtraChar;
+    }   
+    
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/src/Misc/CPhCntMmiSecurityImpl.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,198 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of security operations
+*
+*/
+
+
+// INCLUDE FILES
+#include    "CPhCntMmiSecurityImpl.h"
+#include    <secuimanualsecuritysettings.h>
+
+// CONSTANTS
+#ifdef _DEBUG
+_LIT( KPhCntMmiSecurity, "PhCntMmi" );
+#endif // _DEBUG
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhCntMmiSecurityImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPhCntMmiSecurityImpl* CPhCntMmiSecurityImpl::NewL()
+    {
+    CPhCntMmiSecurityImpl* self = 
+        new (ELeave) CPhCntMmiSecurityImpl;
+    
+    return self;
+    }
+   
+// Destructor
+CPhCntMmiSecurityImpl::~CPhCntMmiSecurityImpl()
+    {
+    DestroyModel();
+    }
+
+// ---------------------------------------------------------
+// CPhCntMmiSecurityImpl::ChangePinL
+// ---------------------------------------------------------
+//
+TBool CPhCntMmiSecurityImpl::ChangePinL(
+        TPinCommand aCommand,
+        const TDesC& aCode,
+        const TDesC& aNewPin,
+        const TDesC& aVerifyNew )
+    {
+    CManualSecuritySettings& model = CreateModelL();
+    
+    // Initially, setting is pin2.
+    CManualSecuritySettings::TPin pin = 
+        CManualSecuritySettings::EPin2;
+
+    TBool result = EFalse;
+
+    switch ( aCommand )
+        {
+        case ECmdChangePin:
+            
+            // Change setting.
+            //
+            pin = CManualSecuritySettings::EPin1;
+            
+            // Flow through..
+            //
+        case ECmdChangePin2:
+            
+            result = model.ChangePinL( 
+                pin,
+                aCode,
+                aNewPin,
+                aVerifyNew );
+            break;
+
+        case ECmdUnblockPin:
+            
+            // Change setting
+            //
+            pin = CManualSecuritySettings::EPin1;
+
+            // Flow through..
+            //
+        case ECmdUnblockPin2:
+            
+            result = model.UnblockPinL( 
+                pin,
+                aCode,
+                aNewPin,
+                aVerifyNew );
+            break;
+
+        default:
+            // Case not handled, panic.
+            Panic();
+            break;
+        }
+
+    return result;
+    }
+
+// ---------------------------------------------------------
+// CPhCntMmiSecurityImpl::ChangeSimLockL
+// ---------------------------------------------------------
+//
+TBool CPhCntMmiSecurityImpl::ChangeSimLockL(
+        TSimCommand aCommand,
+        const TDesC& aCode,
+        const TDesC& aType )
+    {   
+    CManualSecuritySettings& model = CreateModelL();
+    TBool result = EFalse;
+
+    switch ( aCommand )
+        {
+        case ECmdOpenLock:
+            result = 
+                model.UnlockSimL( aCode, aType );
+            break;
+        case ECmdCloseLock:
+            result =
+                model.LockSimL( aCode, aType );
+            break;
+        default:
+            // Case not handled, panic.
+            Panic();
+            break;
+        }
+
+    return result;
+    }
+
+// ---------------------------------------------------------
+// CPhCntMmiSecurityImpl::Cancel
+// ---------------------------------------------------------
+//
+void CPhCntMmiSecurityImpl::Cancel()
+    {
+    if ( iModel )
+        {
+        iModel->CancelChangePin();
+        iModel->CancelUnblockPin();
+        iModel->CancelLockSim();
+        iModel->CancelUnlockSim();
+
+        DestroyModel();
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhCntMmiSecurityImpl::CreateModelL
+// ---------------------------------------------------------
+//
+CManualSecuritySettings& 
+    CPhCntMmiSecurityImpl::CreateModelL()
+    {
+    if ( !iModel )
+        {
+        iModel = CManualSecuritySettings::NewL();
+        }
+
+    return *iModel;
+    }
+
+// ---------------------------------------------------------
+// CPhCntMmiSecurityImpl::DestroyModel
+// ---------------------------------------------------------
+//
+void CPhCntMmiSecurityImpl::DestroyModel()
+    {
+    delete iModel; 
+    iModel = NULL;
+    }
+
+// ---------------------------------------------------------
+// CPhCntMmiSecurityImpl::Panic
+// ---------------------------------------------------------
+//
+void CPhCntMmiSecurityImpl::Panic()
+    {
+    // We only panic with debug builds.
+    __ASSERT_DEBUG( 
+        EFalse, 
+        User::Panic( KPhCntMmiSecurity, 0 ) );
+    }
+
+//  End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/src/Misc/CPhCntProfileEngineImpl.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,125 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of Profile information retrieval.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "CPhCntProfileEngineImpl.h"
+#include    <MProfile.h>
+
+// CONSTANTS
+_LIT( KPhCntProfilePanic, "PhCntProfile" );
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhCntProfileEngineImpl::NewL
+// -----------------------------------------------------------------------------
+//
+CPhCntProfileEngineImpl* CPhCntProfileEngineImpl::NewL()
+    {
+    CPhCntProfileEngineImpl* self = 
+        new ( ELeave ) CPhCntProfileEngineImpl;
+    
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntProfileEngineImpl::~CPhCntProfileEngineImpl
+// -----------------------------------------------------------------------------
+//      
+CPhCntProfileEngineImpl::~CPhCntProfileEngineImpl()
+    {
+    if ( iProfile )
+        {
+        iProfile->Release();
+        iProfile = NULL;
+        }
+
+    if ( iEngine )
+        {
+        iEngine->Release();
+        iEngine = NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntProfileEngineImpl::RefreshL
+// -----------------------------------------------------------------------------
+//
+void CPhCntProfileEngineImpl::RefreshL()
+    {
+    if ( !iEngine )
+        {
+        iEngine = CreateProfileEngineL();
+        }
+
+    MProfile* profile = iEngine->ActiveProfileL();
+
+    if ( iProfile )
+        {
+        iProfile->Release();
+        iProfile = NULL;
+        }
+    iProfile = profile;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntProfileEngineImpl::HasProfile
+// -----------------------------------------------------------------------------
+//
+TBool CPhCntProfileEngineImpl::HasProfile() const
+    {
+    return iProfile != NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntProfileEngineImpl::Profile
+// -----------------------------------------------------------------------------
+//
+MProfile& CPhCntProfileEngineImpl::Profile()
+    {
+    __ASSERT_ALWAYS( iProfile, User::Panic( KPhCntProfilePanic, 0 ) );
+    return *iProfile;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntProfileEngineImpl::SetActiveProfileL
+// -----------------------------------------------------------------------------
+//
+void CPhCntProfileEngineImpl::SetActiveProfileL( const TInt aProfileId )
+    {
+    if ( !iEngine )
+        {
+        iEngine = CreateProfileEngineL();
+        }
+
+    iEngine->SetActiveProfileL( aProfileId );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntProfileEngineImpl::IsFeatureSupported
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CPhCntProfileEngineImpl::IsFeatureSupported(
+        TProfileFeatureId aFeatureId ) const
+    {
+    return iEngine->IsFeatureSupported( aFeatureId );
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/src/Misc/CPhCntRfsHandlerImpl.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of restore factory settings.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "CPhCntRfsHandlerImpl.h"
+#include    <rfsHandler.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhCntRfsHandlerImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPhCntRfsHandlerImpl* CPhCntRfsHandlerImpl::NewL()
+    {
+    CPhCntRfsHandlerImpl* self = 
+        new (ELeave) CPhCntRfsHandlerImpl;
+    
+    return self;
+    }
+   
+// -----------------------------------------------------------------------------
+// CPhCntRfsHandlerImpl::~CPhCntRfsHandlerImpl
+// -----------------------------------------------------------------------------
+//
+CPhCntRfsHandlerImpl::~CPhCntRfsHandlerImpl()
+    {
+    delete iRfsHandler;
+    }
+
+// ---------------------------------------------------------
+// CPhCntRfsHandlerImpl::ProcessCommandL
+// ---------------------------------------------------------
+//
+void CPhCntRfsHandlerImpl::ProcessCommandL( 
+        TRfsCommand aCommand )
+    {
+    TRfsType type = ERfsDeep; // By default, let's assume deep.
+
+    switch ( aCommand )
+        {
+        case ERfsCmdActivateNormal:
+            type = ERfsNormal;
+            // Fall through..
+
+        case ERfsCmdActivateDeep:
+            // Create instance of rfs handler
+            if ( !iRfsHandler )
+                {
+                iRfsHandler = new ( ELeave ) CRfsHandler;
+                }
+        
+            // Activate 
+            iRfsHandler->ActivateRfsL( type );
+            break;
+
+        case ERfsCmdCancel:
+            {
+            if ( iRfsHandler )
+                {
+                iRfsHandler->Cancel();
+                }
+            }
+            break;
+
+        default:
+            // Do nothing.
+            break;
+        }    
+    }
+
+//  End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/src/Misc/CPhCntThumbnailLoaderImpl.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,429 @@
+/*
+* 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:  Thumbnail loading implementation.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "CPhCntThumbnailLoaderImpl.h"
+#include    "MPhoneCntPbkOwner.h"
+#include    "MPhCntThumbnailLoaderObserver.h"
+#include    "cphcntcontactid.h"
+#include    "cphcntpbkcontactid.h"
+#include    "cphcntpbkthumbnailloader.h"
+
+#include    <CPbkContactItem.h>
+#include    <CPbkContactEngine.h>
+#include    <CPbkThumbnailManager.h>
+#include    <fbs.h>
+
+// CONSTANTS
+
+// Granularity of thumbnail array.
+const TInt KPhoneThumbnailArrayGranularity = 5;
+
+// Maximum amount of thumbnails.
+const TInt KPhoneThumbnailMax = 20;
+
+// Panic literal for thumbnail related panics.
+_LIT( KPhCntThumbnailLoaderPanic, "PhCntThumb" );
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPhCntThumbnailLoaderImpl* CPhCntThumbnailLoaderImpl::NewL(
+        MPhCntThumbnailLoaderObserver& aObserver,
+        MPhoneCntPbkOwner& aPbkOwner,
+        MPhCntThumbnailLoader& aLoader )
+    {
+    CPhCntThumbnailLoaderImpl* self = 
+        new ( ELeave ) CPhCntThumbnailLoaderImpl( 
+            aObserver,
+            aPbkOwner,
+            aLoader );
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aPbkOwner );
+    CleanupStack::Pop();
+
+    return self;
+    }
+        
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::~CPhCntThumbnailLoaderImpl
+// -----------------------------------------------------------------------------
+//
+CPhCntThumbnailLoaderImpl::~CPhCntThumbnailLoaderImpl()
+    {
+    delete iBitmap;
+    ClearThumbnailArray();
+    iArray.Close();
+    delete iLoader;
+    delete iBridge;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::Load
+// -----------------------------------------------------------------------------
+//
+TInt CPhCntThumbnailLoaderImpl::Load( 
+        TThumbnailId& aId, 
+        const CPhCntContactId& aContactId )
+    {
+    // If condition doesn't hold, then definitely something is badly
+    // wrong.
+    if ( iArray.Count() < KPhoneThumbnailMax )
+        {
+        TRAPD( err, AttemptLoadL( aId, aContactId ) );
+
+        if ( err != KErrNone )
+            {
+            aId = KPhCntThumbnailNullId;
+            }
+
+        return err;
+        }
+    else
+        {
+        aId = KPhCntThumbnailNullId;
+        return KErrNotFound;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::Cancel
+// -----------------------------------------------------------------------------
+//
+void CPhCntThumbnailLoaderImpl::Cancel( 
+        TThumbnailId aId )
+    {
+    TInt index = FindById( aId );
+
+    // If not found, then we can ignore the call.
+    if ( index == KErrNotFound )
+        {
+        return;
+        }
+
+    // Remove thumbnail loading information from array.
+    RemoveThumbnailArrayEntry( index );
+    
+    // If we are currently loading this, then cancel loading.
+    if ( iCurrent != KPhCntThumbnailNullId && aId == iCurrent )
+        {      
+        CancelLoad();
+        }
+    
+    if ( iCurrent == KPhCntThumbnailNullId && iArray.Count() )
+        {
+        Start( ELoadFromContact );
+        }
+    }
+    
+void CPhCntThumbnailLoaderImpl::LoadingCompleted(
+    CFbsBitmap* aBitmap,
+    TInt aResult )
+    {
+    if( aResult == KErrNone )
+        {
+        if ( iCurrent != KPhCntThumbnailNullId )
+            {
+
+            iBitmap = aBitmap;
+            Start( EProcessResult );       
+            }
+        else
+            {
+            delete aBitmap;
+            }
+        }
+    else
+        {
+        if ( iCurrent != KPhCntThumbnailNullId )
+            {
+            TThumbnailId old = iCurrent;
+
+            Cancel( old );
+            Notify( old, aResult, NULL );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::CPhCntThumbnailLoaderImpl
+// C++ constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhCntThumbnailLoaderImpl::CPhCntThumbnailLoaderImpl(
+        MPhCntThumbnailLoaderObserver& aObserver,
+        MPhoneCntPbkOwner& /*aPbkOwner*/,
+        MPhCntThumbnailLoader& aLoader )
+    : iObserver( aObserver ),
+      iArray( KPhoneThumbnailArrayGranularity ),
+      iCurrent( KPhCntThumbnailNullId ),
+      iLoader( &aLoader )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhCntThumbnailLoaderImpl::ConstructL(
+    MPhoneCntPbkOwner& /*aPbkOwner*/ )
+    {
+    iBridge = 
+        CIdle::NewL(
+            CActive::EPriorityStandard );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::AttemptLoadL
+// -----------------------------------------------------------------------------
+//
+void CPhCntThumbnailLoaderImpl::AttemptLoadL( 
+        TThumbnailId aId,
+        const CPhCntContactId& aContactId )
+    {
+    // Create new thumbnail information.
+    TThumbnailInfo info;
+    info.iId = aId;
+    info.iContactId = aContactId.CloneL();
+    User::LeaveIfError( iArray.Append( info ) );
+
+    // If there were no items, then we can start loading the first image.
+    if ( iCurrent == KPhCntThumbnailNullId )
+        {
+        Start( ELoadFromContact );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::StartLoadL
+// -----------------------------------------------------------------------------
+//
+void CPhCntThumbnailLoaderImpl::StartLoadL()
+    {
+    if ( !iArray.Count() )
+        {
+        return;
+        }
+
+    TThumbnailInfo& info = iArray[ 0 ]; // first
+    iCurrent = info.iId;
+
+    // Clear pbk
+    ClearPbk( ETrue ); 
+    
+    iLoader->LoadL( *info.iContactId, *this );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::CancelLoad
+// -----------------------------------------------------------------------------
+//
+void CPhCntThumbnailLoaderImpl::CancelLoad()
+    {
+    iCurrent = KPhCntThumbnailNullId; 
+    
+    delete iBitmap;
+    iBitmap = NULL;
+
+    ClearPbk( iArray.Count() );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::ProcessResultL
+// -----------------------------------------------------------------------------
+//
+void CPhCntThumbnailLoaderImpl::ProcessResultL()
+    {
+    if ( iCurrent == KPhCntThumbnailNullId )
+        {
+        return;
+        }
+
+    if ( !iBitmap )
+        {
+        User::Leave( KErrNotFound );
+        }
+    else
+        {
+        CFbsBitmap* bitmap = iBitmap;
+        iBitmap = NULL;
+        TThumbnailId old = iCurrent;
+        Cancel( iCurrent );
+        Notify( old, KErrNone, bitmap );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::HandleStartL
+// -----------------------------------------------------------------------------
+//
+void CPhCntThumbnailLoaderImpl::HandleStartL()
+    {
+    switch ( iState )
+        {
+        case ELoadFromContact:
+            StartLoadL();
+            break;
+
+        case EProcessResult:
+            ProcessResultL();
+            break;
+
+        default:
+            Panic( EPanicInvalidState );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::HandleStart
+// -----------------------------------------------------------------------------
+//
+void CPhCntThumbnailLoaderImpl::HandleStart()
+    {
+    TRAPD( err, HandleStartL() );
+
+    if ( err != KErrNone && iCurrent != KPhCntThumbnailNullId )
+        {
+        TThumbnailId old = iCurrent;
+        Cancel( iCurrent );
+        Notify( old, err, NULL );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::Start
+// -----------------------------------------------------------------------------
+//
+void CPhCntThumbnailLoaderImpl::Start( TState aState )
+    {
+    iState = aState;
+    iBridge->Cancel();
+    iBridge->Start( TCallBack( DoStart, this ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::DoStart
+// -----------------------------------------------------------------------------
+//
+TInt CPhCntThumbnailLoaderImpl::DoStart( TAny* aAny )
+    {
+    CPhCntThumbnailLoaderImpl* loader =
+        static_cast< CPhCntThumbnailLoaderImpl* >( aAny );
+
+    loader->HandleStart();
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::Notify
+// -----------------------------------------------------------------------------
+//
+void CPhCntThumbnailLoaderImpl::Notify( 
+        TThumbnailId aId,
+        TInt aResult, 
+        CFbsBitmap* aBitmap )
+    {
+    iObserver.MpctloThumbnailLoaded( aId, aResult, aBitmap );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::ClearPbk
+// -----------------------------------------------------------------------------
+//
+void CPhCntThumbnailLoaderImpl::ClearPbk( TBool aMore )
+    {
+   
+    iLoader->Cancel();
+
+    if ( !aMore )
+        {
+        iLoader->Release();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::FindById
+// -----------------------------------------------------------------------------
+//
+TInt CPhCntThumbnailLoaderImpl::FindById( TThumbnailId aId )
+    {
+    TThumbnailInfo info;
+    info.iId = aId;
+    // info.iContactId doesn't matter.
+
+    return 
+        iArray.Find( 
+            info,
+            TIdentityRelation<TThumbnailInfo>( CompareIds ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::CompareIds
+// -----------------------------------------------------------------------------
+//
+TBool CPhCntThumbnailLoaderImpl::CompareIds( 
+        const TThumbnailInfo& aFirst,
+        const TThumbnailInfo& aSecond )
+    {
+    return aFirst.iId == aSecond.iId;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::Panic
+// -----------------------------------------------------------------------------
+//
+void CPhCntThumbnailLoaderImpl::Panic( 
+        TPanicReason aReason )
+    {
+    User::Panic( KPhCntThumbnailLoaderPanic, aReason );
+    }
+ 
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::ClearThumbnailArray
+// -----------------------------------------------------------------------------
+//   
+void CPhCntThumbnailLoaderImpl::ClearThumbnailArray()
+    {
+    const TInt count( iArray.Count() );
+    for( TInt i = 0; i < count; i++ ) 
+        {
+        RemoveThumbnailArrayEntry( i );
+        }
+    }
+   
+// -----------------------------------------------------------------------------
+// CPhCntThumbnailLoaderImpl::ClearThumbnailArrayEntry
+// -----------------------------------------------------------------------------
+//        
+void CPhCntThumbnailLoaderImpl::RemoveThumbnailArrayEntry( TInt aIndex )
+    {
+    TThumbnailInfo info = iArray[aIndex];
+    delete info.iContactId;
+    iArray.Remove( aIndex );
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/PhoneCntFinder/src/PhCntPanic.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Panic 
+*
+*/
+
+
+#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/PhoneCntFinder/src/cphcntthumbnailloaderbase.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* 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:  Base class for concrete thumbnailloaders.
+*
+*/
+
+
+#include "cphcntthumbnailloaderbase.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntThumbnailLoaderBase::CPhCntThumbnailLoaderBase()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CPhCntThumbnailLoaderBase::~CPhCntThumbnailLoaderBase()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Notifies the observer.
+// ---------------------------------------------------------------------------
+//
+void CPhCntThumbnailLoaderBase::NotifyObserver( 
+    CFbsBitmap* aBitmap, 
+    TInt aError )
+    {
+    if( iLoadingObserver ) 
+        {
+        iLoadingObserver->LoadingCompleted( aBitmap, aError );
+        iLoadingObserver = NULL;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MPhCntThumbnailLoader
+// Takes hold of observer and calls template method for actual loading of 
+// thumbnail.
+// ---------------------------------------------------------------------------
+//
+void CPhCntThumbnailLoaderBase::LoadL( 
+    const CPhCntContactId& aContactId,
+    MPhCntLoaderObserver& aLoadingObserver )
+    {
+    iLoadingObserver = &aLoadingObserver;
+    DoLoadL( aContactId );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/bwins/audiohandlingu.def	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,26 @@
+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)
+	?SetDefaultVolume@CPEAudioData@@QAEXXZ @ 15 NONAME ; void CPEAudioData::SetDefaultVolume(void)
+	?HandleCallEnding@CPEAudioData@@UAEXXZ @ 16 NONAME ; void CPEAudioData::HandleCallEnding(void)
+	?NewLC@CPEAudioFactory@@SAPAV1@XZ @ 17 NONAME ; class CPEAudioFactory * CPEAudioFactory::NewLC(void)
+	?StartUp@CPEAudioData@@UAEXXZ @ 18 NONAME ; void CPEAudioData::StartUp(void)
+	?GetAudioMuteSync@CPEAudioData@@UBEXAAH@Z @ 19 NONAME ; void CPEAudioData::GetAudioMuteSync(int &) const
+	?NewL@CPEGsmAudioData@@SAPAV1@AAVMPEPhoneModelInternal@@AAVRFs@@@Z @ 20 NONAME ; class CPEGsmAudioData * CPEGsmAudioData::NewL(class MPEPhoneModelInternal &, class RFs &)
+	?StopDtmfTonePlay@CPEGsmAudioData@@UAEXXZ @ 21 NONAME ; void CPEGsmAudioData::StopDtmfTonePlay(void)
+	?NewL@CPEGsmAudioData@@SAPAV1@AAVMPEPhoneModelInternal@@AAVRFs@@AAVCPEAudioFactory@@@Z @ 22 NONAME ; class CPEGsmAudioData * CPEGsmAudioData::NewL(class MPEPhoneModelInternal &, class RFs &, class CPEAudioFactory &)
+	?SetAudioVolumeSync@CPEAudioData@@UAEXH@Z @ 23 NONAME ; void CPEAudioData::SetAudioVolumeSync(int)
+	?PlayInbandTone@CPEGsmAudioData@@QAEXXZ @ 24 NONAME ; void CPEGsmAudioData::PlayInbandTone(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/data/audiohandling_stub.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,55 @@
+EXPORTS
+	_ZN12CPEAudioData14SetAudioOutputE14TPEAudioOutputi @ 1 NONAME
+	_ZN12CPEAudioData16HandleCallEndingEv @ 2 NONAME
+	_ZN12CPEAudioData16SetAudioMuteSyncEi @ 3 NONAME
+	_ZN12CPEAudioData16SetDefaultVolumeEv @ 4 NONAME
+	_ZN12CPEAudioData18HandleCallStartingEi @ 5 NONAME
+	_ZN12CPEAudioData18SetAudioVolumeSyncEi @ 6 NONAME
+	_ZN12CPEAudioData27HandleEnergencyCallStartingEv @ 7 NONAME
+	_ZN12CPEAudioData31CallAudioRoutePreferenceChangedEv @ 8 NONAME
+	_ZN12CPEAudioData7StartUpEv @ 9 NONAME
+	_ZN12CPEAudioDataD0Ev @ 10 NONAME
+	_ZN12CPEAudioDataD1Ev @ 11 NONAME
+	_ZN12CPEAudioDataD2Ev @ 12 NONAME
+	_ZN15CPEAudioFactory23CreateAudioToneUtilityLER21MMdaAudioToneObserver @ 13 NONAME
+	_ZN15CPEAudioFactory28CreateTelephonyAudioRoutingLER30MTelephonyAudioRoutingObserver @ 14 NONAME
+	_ZN15CPEAudioFactory5NewLCEv @ 15 NONAME
+	_ZN15CPEAudioFactoryC1Ev @ 16 NONAME
+	_ZN15CPEAudioFactoryC2Ev @ 17 NONAME
+	_ZN15CPEGsmAudioData14PlayInbandToneEv @ 18 NONAME
+	_ZN15CPEGsmAudioData15HandleDTMFEventEN16MCCEDtmfObserver13TCCEDtmfEventEi5TChar @ 19 NONAME
+	_ZN15CPEGsmAudioData16StopDtmfTonePlayEv @ 20 NONAME
+	_ZN15CPEGsmAudioData18StopInbandTonePlayEv @ 21 NONAME
+	_ZN15CPEGsmAudioData4NewLER21MPEPhoneModelInternalR3RFs @ 22 NONAME
+	_ZN15CPEGsmAudioData4NewLER21MPEPhoneModelInternalR3RFsR15CPEAudioFactory @ 23 NONAME
+	_ZN15CPEGsmAudioDataD0Ev @ 24 NONAME
+	_ZN15CPEGsmAudioDataD1Ev @ 25 NONAME
+	_ZN15CPEGsmAudioDataD2Ev @ 26 NONAME
+	_ZNK12CPEAudioData16GetAudioMuteSyncERi @ 27 NONAME
+	_ZNK12CPEAudioData18GetAudioVolumeSyncERi @ 28 NONAME
+	_ZNK15CPEGsmAudioData12PlayDtmfToneERK5TChar @ 29 NONAME
+	_ZTI12CPEAudioData @ 30 NONAME ; #<TI>#
+	_ZTI15CPEGsmAudioData @ 31 NONAME ; #<TI>#
+	_ZTI22CPEAudioDtmfTonePlayer @ 32 NONAME ; #<TI>#
+	_ZTI22CPEAudioRoutingMonitor @ 33 NONAME ; #<TI>#
+	_ZTI24CPEAudioInbandTonePlayer @ 34 NONAME ; #<TI>#
+	_ZTI26CPECallAudioRoutingHandler @ 35 NONAME ; #<TI>#
+	_ZTV12CPEAudioData @ 36 NONAME ; #<VT>#
+	_ZTV15CPEGsmAudioData @ 37 NONAME ; #<VT>#
+	_ZTV22CPEAudioDtmfTonePlayer @ 38 NONAME ; #<VT>#
+	_ZTV22CPEAudioRoutingMonitor @ 39 NONAME ; #<VT>#
+	_ZTV24CPEAudioInbandTonePlayer @ 40 NONAME ; #<VT>#
+	_ZTV26CPECallAudioRoutingHandler @ 41 NONAME ; #<VT>#
+	_ZThn4_N12CPEAudioData14SetAudioOutputE14TPEAudioOutputi @ 42 NONAME ; #<thunk>#
+	_ZThn4_N12CPEAudioData16HandleCallEndingEv @ 43 NONAME ; #<thunk>#
+	_ZThn4_N12CPEAudioData16SetAudioMuteSyncEi @ 44 NONAME ; #<thunk>#
+	_ZThn4_N12CPEAudioData18HandleCallStartingEi @ 45 NONAME ; #<thunk>#
+	_ZThn4_N12CPEAudioData18SetAudioVolumeSyncEi @ 46 NONAME ; #<thunk>#
+	_ZThn4_N12CPEAudioData27HandleEnergencyCallStartingEv @ 47 NONAME ; #<thunk>#
+	_ZThn4_N12CPEAudioData31CallAudioRoutePreferenceChangedEv @ 48 NONAME ; #<thunk>#
+	_ZThn4_N12CPEAudioData7StartUpEv @ 49 NONAME ; #<thunk>#
+	_ZThn4_N15CPEGsmAudioData16StopDtmfTonePlayEv @ 50 NONAME ; #<thunk>#
+	_ZThn4_NK12CPEAudioData16GetAudioMuteSyncERi @ 51 NONAME ; #<thunk>#
+	_ZThn4_NK12CPEAudioData18GetAudioVolumeSyncERi @ 52 NONAME ; #<thunk>#
+	_ZThn72_N15CPEGsmAudioData15HandleDTMFEventEN16MCCEDtmfObserver13TCCEDtmfEventEi5TChar @ 53 NONAME ; #<thunk>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/group/audiohandling.mmp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* 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
+
+//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
+
+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
+
+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
+
+LANG            SC
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,299 @@
+/*
+* 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 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>
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class MPEPhoneModelInternal;
+class CPEAudioDtmfTonePlayer;
+class CPEAudioRoutingMonitor;
+class CPECallAudioRoutingHandler;
+class CPEAudioFactory;
+class CTelephonyAudioRouting;
+
+// 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:
+
+        /**
+        * 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();
+  
+        /**
+        * Sets default volume level if muted when call ended
+        */
+        IMPORT_C void SetDefaultVolume();
+ 
+        /**
+        * 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 );
+     
+
+    protected:
+
+        /**
+        * By default Symbian 2nd phase constructor is private, but we use 
+        * it at generalized class.
+        */
+        void ConstructL( CPEAudioFactory& aAudioFactory ); 
+
+    protected:  // New functions
+        
+        /**
+         * Protected function for derived classes to implement for
+         * extended volume handling. Default implementation is empty.
+         * @since S60 v5.0
+         * @param aVolume New volume value.
+         */
+        virtual void DoHandleVolumeChange( TInt aVolume );
+     
+    private:
+    
+        /**
+        * Gets all audio volume values from reporitory and update member variables
+        */
+        void InitializeAudioVolumes();
+        
+                       
+        /**
+        * 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 );
+        /**
+        * Return status of mic mute
+        */
+        TBool IsMuted() const;
+
+    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;
+        #ifdef __WINSCW__
+        // dummy implementation for WINSCW
+        TInt  iVolume;
+        TBool iMute; 
+        #endif        
+        // HeadSet Mode Audio volume
+        TInt iHeadSetVolume;
+        // Loudspeaker Mode Audio volume
+        TInt iLoudspeakerVolume;
+        // ETrue when audio output changed 
+        TBool iAudioOutputChanged; 
+     };
+
+#endif      // CPEAUDIODATA_H  
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/inc/cpeaudiodtmftoneplayer.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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/cpeaudiofactory.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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 );
+    
+    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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,836 @@
+/*
+* 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 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 "pepanic.pan"
+#include "cpeaudiodtmftoneplayer.h"
+#include "cpeaudioroutingmonitor.h"
+#include "cpecallaudioroutinghandler.h"
+#include "cpeaudiofactory.h"	
+#include <telinternalpskeys.h>
+// CONSTANTS
+//Mute Value for volume
+const TInt KPEDefaultVolume = 4;
+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;
+    iAudioOutputChanged = 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 );
+ 
+    //Gets audio volumes from repository
+    InitializeAudioVolumes();
+    
+    RProperty::TType type( RProperty::EInt );
+    TSecurityPolicy readPolicy( ECapability_None );
+    TSecurityPolicy writePolicy( ECapabilityWriteDeviceData );
+    	
+    RProperty::Define( KPSUidTelMicrophoneMuteStatus, 
+        KTelMicrophoneMuteState,
+        type,
+        readPolicy,
+        writePolicy );
+                
+    TEFLOGSTRING( KTAINT, "AUD CPEAudioData::ConstructL  complete" );               
+    }
+
+// Destructor
+EXPORT_C CPEAudioData::~CPEAudioData()
+    {
+    TEFLOGSTRING( KTAOBJECT, "AUD CPEAudioData::~CPEAudioData" );
+ 
+    delete iAudioRouting;
+    delete iAudioRoutingMonitor;
+    delete iAudioRoutingHandler;
+    
+    iPEavailableOutputs.Close();
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::InitializeAudioVolumes
+// Gets audio volume values from reporitory
+// -----------------------------------------------------------------------------
+//   
+void CPEAudioData::InitializeAudioVolumes()
+    {
+// Connect to CPEGsmExternalDataHandler missing from TEPhoneEngineTestUtils wrapper !!!
+    TInt volume;
+   
+    iPhoneModel.DataStoreExt()->Get( 
+        EPEIncallLoudspeakerVolumeSetting, volume ); 
+    iLoudspeakerVolume = volume;
+    TEFLOGSTRING2( KTAINT, 
+        "AUD CPEAudioData::CPEAudioData, DataStoreExt()->Get, iLoudspeakerVolume = %d",
+         iLoudspeakerVolume );
+         
+    iPhoneModel.DataStoreExt()->Get( 
+        EPEIncallEarVolumeSetting, volume ); 
+    iHeadSetVolume = volume;
+    TEFLOGSTRING2( KTAINT, 
+        "AUD CPEAudioData::CPEAudioData, DataStoreExt()->Get, iLoudspeakerVolume = %d",
+         iHeadSetVolume );
+
+    }
+
+// -----------------------------------------------------------------------------
+// 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 
+    {
+    TEFLOGSTRING( KTAINT, "AUD CPEAudioData::GetAudioMuteSync" );     
+    if ( IsMuted() ) 
+        {
+        //mute is on
+        aAudioMute = ETrue;
+        }
+    else
+        {
+        aAudioMute = EFalse;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::GetAudioVolumeSync
+// Creates synchronous request to get audio volume.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPEAudioData::GetAudioVolumeSync(
+        TInt& aAudioVolume ) const
+    {
+    TEFLOGSTRING( KTAINT, "AUD CPEAudioData::GetAudioVolumeSync" );
+
+    if ( iPhoneModel.DataStore()->AudioOutput() == EPELoudspeaker )
+        {
+        iPhoneModel.DataStoreExt()->Get( 
+            EPEIncallLoudspeakerVolumeSetting, aAudioVolume );
+        TEFLOGSTRING( KTAINT, 
+            "AUD CPEAudioData::GetAudioVolumeSync: EPEIncallLoudspeakerVolumeSetting");
+        }
+    else 
+        {
+        iPhoneModel.DataStoreExt()->Get( 
+            EPEIncallEarVolumeSetting, aAudioVolume );
+        TEFLOGSTRING( KTAINT, 
+            "AUD CPEAudioData::GetAudioVolumeSync: EPEIncallEarVolumeSetting");            
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 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
+	    if ( iPhoneModel.DataStore()->AudioOutput() == EPELoudspeaker )
+	        {
+	        iLoudspeakerVolume = iPhoneModel.DataStore()->AudioVolume();
+	        TEFLOGSTRING2( KTAINT, 
+	            "AUD CPEAudioData::SendMessage: iLoudspeakerVolume = %d", 
+	            iLoudspeakerVolume );
+	        }
+	    else 
+	        {
+	        iHeadSetVolume = iPhoneModel.DataStore()->AudioVolume();
+	        TEFLOGSTRING2( KTAINT, 
+	            "AUD CPEAudioData::SendMessage: iHeadSetVolume = %d", 
+	            iHeadSetVolume );
+	        }	
+    	   	
+       	if ( !iAudioOutputChanged )
+            {
+            // EPEMessageAudioVolumeChanged message must not be sent 
+            // while audio output change is being processed
+            iPhoneModel.SendMessage( aMessage );	
+            }
+	   }
+    else 
+        {
+        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
+        {
+        // store the old audio path volume
+        if ( iPhoneModel.DataStore()->AudioOutput() == EPELoudspeaker )
+            {
+            iLoudspeakerVolume = iPhoneModel.DataStore()->AudioVolume();
+            TEFLOGSTRING2( KTAINT, 
+                "AUD CPEAudioData::SendMessage: iLoudspeakerVolume = %d", 
+                iLoudspeakerVolume );
+            }
+        else 
+            {
+            iHeadSetVolume = iPhoneModel.DataStore()->AudioVolume();
+            TEFLOGSTRING2( KTAINT, 
+                "AUD CPEAudioData::SendMessage: iHeadSetVolume = %d", 
+                iHeadSetVolume );
+            }
+        
+        // update the audio values in engineinfo
+        TBool status;
+        iAudioRouting->GetShowNote( status );
+        iPhoneModel.DataStore()->SetAudioOutput( ConvertToPE( aOutput ), ConvertToPE( PreviousOutput() ), status );
+
+        // Set audio output change flag 
+        iAudioOutputChanged = ( MEngineMonitor::EPEMessageAudioOutputChanged == aMessage );
+          
+        // restore the stored volume for the new path
+        if ( aOutput == CTelephonyAudioRouting::ELoudspeaker )
+            {
+            // restore the stored volume for the new path
+            SetAudioVolumeSync( iLoudspeakerVolume );
+            iPhoneModel.DataStore()->SetAudioVolume( iLoudspeakerVolume );   
+            TEFLOGSTRING2( KTAINT, 
+                "AUD CPEAudioData::SendMessage: DataStoreExt()->Set, iLoudspeakerVolume = %d", 
+                iLoudspeakerVolume );
+            iPhoneModel.DataStoreExt()->Set( EPEIncallLoudspeakerVolumeSetting,
+                iLoudspeakerVolume );
+            }
+        else 
+            {
+            // restore the stored volume for the new path
+            SetAudioVolumeSync( iHeadSetVolume );
+            iPhoneModel.DataStore()->SetAudioVolume( iHeadSetVolume );   
+            TEFLOGSTRING2( KTAINT, 
+                "AUD CPEAudioData::SendMessage: DataStoreExt()->Set, iHeadSetVolume  = %d", 
+                iHeadSetVolume );
+            iPhoneModel.DataStoreExt()->Set( EPEIncallEarVolumeSetting,
+                iHeadSetVolume );
+            }
+        
+        // Reset audio output change flag 
+        iAudioOutputChanged = EFalse;                                                
+                     
+        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 );
+        // Inform VoIP/PE Videocallmanager mute state. Error code not handled.
+        TInt err = RProperty::Set( 
+            KPSUidTelMicrophoneMuteStatus, 
+            KTelMicrophoneMuteState,
+            EPSTelMicMuteOn );
+            TEFLOGSTRING2( 
+                KTAREQOUT, 
+                "AUD CPEAudioData::SetAudioMuteSync: EPSTelephonyMicMuteOn , error = %d", 
+                err );            
+        }
+    else
+        {
+        iPhoneModel.DataStore()->SetAudioMute( aAudioMute );
+        SendMessage( MEngineMonitor::EPEMessageAudioMuteChanged );
+        TInt err = RProperty::Set( 
+            KPSUidTelMicrophoneMuteStatus, 
+            KTelMicrophoneMuteState,
+            EPSTelMicMuteOff );
+        TEFLOGSTRING2( 
+            KTAREQOUT, 
+            "AUD CPEAudioData::SetAudioMuteSync: EPSTelephonyMicMuteOff, 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 );
+        
+        if ( iPhoneModel.DataStore()->AudioOutput() == EPELoudspeaker )
+            {
+            iPhoneModel.DataStoreExt()->Set( 
+                EPEIncallLoudspeakerVolumeSetting, 
+                aAudioVolume );
+            TEFLOGSTRING( KTAINT, 
+                "AUD CPEAudioData::SetAudioVolumeSync: EPEIncallLoudspeakerVolumeSetting");
+            }
+        else 
+            {
+            iPhoneModel.DataStoreExt()->Set( 
+                EPEIncallEarVolumeSetting, 
+                aAudioVolume );
+            TEFLOGSTRING( KTAINT, 
+                "AUD CPEAudioData::SetAudioVolumeSync: EPEIncallEarVolumeSetting");
+            }
+		}            
+ 
+    iPhoneModel.DataStore()->SetAudioVolume( aAudioVolume );
+
+    DoHandleVolumeChange( aAudioVolume );
+
+    SendMessage( MEngineMonitor::EPEMessageAudioVolumeChanged );
+    }
+
+// -----------------------------------------------------------------------------
+// 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::SetDefaultVolume
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPEAudioData::SetDefaultVolume()
+    {
+    TEFLOGSTRING( KTAREQIN, "AUD CPEAudioData::SetDefaultVolume" );
+    if ( !iLoudspeakerVolume )
+        {
+        TEFLOGSTRING( KTAREQIN, "AUD CPEAudioData->SetDefaultLoudspeakerVolume" );
+        iLoudspeakerVolume = KPEDefaultVolume;
+        iPhoneModel.DataStore()->SetAudioVolume( iLoudspeakerVolume );
+        iPhoneModel.DataStoreExt()->Set( EPEIncallLoudspeakerVolumeSetting,
+                iLoudspeakerVolume );
+        }
+    if ( !iHeadSetVolume )
+        {
+        TEFLOGSTRING( KTAREQIN, "AUD CPEAudioData->SetDefaultHeadSetVolume" );
+        iHeadSetVolume = KPEDefaultVolume;
+        iPhoneModel.DataStore()->SetAudioVolume( iHeadSetVolume );
+        iPhoneModel.DataStoreExt()->Set( EPEIncallEarVolumeSetting, 
+                iHeadSetVolume );            
+        }
+
+    DoHandleVolumeChange( KPEDefaultVolume );
+    }    
+  
+// -----------------------------------------------------------------------------
+// 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::IsMuted
+// -----------------------------------------------------------------------------
+//
+TBool CPEAudioData::IsMuted() const
+    {
+    TInt value;
+    TInt err = RProperty::Get( 
+        KPSUidTelMicrophoneMuteStatus, 
+        KTelMicrophoneMuteState,
+        value );
+ 
+    TEFLOGSTRING3( 
+         KTAREQIN, 
+        "AUD CPEAudioData::IsMuted: value = %d, error = %d", 
+        value, err );        
+    return ( value == EPSTelMicMuteOn ) ? ETrue : EFalse;
+    }   
+   
+
+// -----------------------------------------------------------------------------
+// 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*/ )
+    {
+    
+    }
+
+// End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/src/cpeaudiodtmftoneplayer.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,309 @@
+/*
+* 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 KDtmfSilent = 0;
+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/cpeaudiofactory.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,307 @@
+/*
+* 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 );
+    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 )
+
+    {
+    iInbandTonePlayer->SetVolume( aVolume );
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ===============================
+// None
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/src/peaudiohandlingpanic.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  GPRS termination active object definition.
+*
+*/
+
+
+
+#ifndef CPEGPRSTERMINATION_H
+#define CPEGPRSTERMINATION_H
+
+//  INCLUDES
+#include    <e32base.h>
+
+// FORWARD DECLARATIONS
+class CCoUtlInterface;
+
+// 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:
+
+        // Owned GPRS termination instance.
+        CCoUtlInterface* iInterface;
+
+    };
+
+#endif      // CPEGPRSTERMINATION_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/inc/cpesinglecall.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,2423 @@
+/*
+* 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(), 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 );
+        
+        // do not overwrite if it's client call, which CCE is not aware of 
+        if ( iModel.DataStore()->CallOrigin( aCallId ) == EPECallOriginPhone )
+            {                                                
+            if ( params.Origin() == CCCECallParameters::ECCECallOriginSAT )
+                {
+                iModel.DataStore()->SetCallOrigin( EPECallOriginSAT, aCallId );
+                }
+            }                    
+        }                
+    }
+
+
+//  End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/src/cpecceobserver.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,113 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GPRS termination active object implementation.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "cpegprstermination.h"
+#include <ccoutlinterface.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();
+    delete iInterface;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGprsTermination::StartL
+// -----------------------------------------------------------------------------
+//
+void CPEGprsTermination::StartL()
+    {
+    TEFLOGSTRING( KTAINT, "cpecall: CPEGprsTermination::StartL" );
+
+    Cancel();
+    delete iInterface;
+    iInterface = NULL;
+
+    iInterface = CCoUtlInterface::NewL();
+    TEFLOGSTRING( KTAREQOUT, "cpecall: CPEGprsTermination::StartL CCoUtlInterface::Terminate()" );
+    iInterface->Terminate( iStatus );
+    SetActive();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGprsTermination::IsTerminating
+// -----------------------------------------------------------------------------
+//
+TBool CPEGprsTermination::IsTerminating() const
+    {
+    TEFLOGSTRING( KTAINT, "cpecall: CPEGprsTermination::IsTerminating" );
+    if ( !iInterface )
+        {
+        return EFalse;
+        }
+    else
+        {
+        CCoUtlInterface::TState current = 
+            iInterface->CurrentState();
+            
+        return 
+            ( current != CCoUtlInterface::EIdle ) &&
+            ( current != CCoUtlInterface::EConfirm );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGprsTermination::RunL
+// -----------------------------------------------------------------------------
+//
+void CPEGprsTermination::RunL()
+    {
+    TEFLOGSTRING2( KTAREQEND, "cpecall: CPEGprsTermination::RunL status: %d", iStatus.Int() );
+    delete iInterface;
+    iInterface = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGprsTermination::DoCancel
+// -----------------------------------------------------------------------------
+//
+void CPEGprsTermination::DoCancel()
+    {
+    TEFLOGSTRING( KTAREQEND, "cpecall: CPEGprsTermination::DoCancel" );
+    if( iInterface )
+        {
+        iInterface->Cancel();
+        }
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/src/cpesinglecall.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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/contacthandling/bwins/contacthandlingu.def	Mon Jan 18 20:18:27 2010 +0200
@@ -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/contacthandling/data/contacthandling_stub.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -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/contacthandling/data/contacthandling_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/contacthandling/eabi/contacthandlingu.def	Mon Jan 18 20:18:27 2010 +0200
@@ -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/contacthandling/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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/contacthandling/group/contacthandling.mmp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,61 @@
+/*
+* 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
+
+SOURCEPATH      ../src
+
+SOURCE          cpecontacthandling.cpp
+SOURCE          cpecontacthandlingdummy.cpp
+SOURCE          cpecontacthandlingproxy.cpp
+SOURCE          cpecontactmatch.cpp
+SOURCE          pecontacthandlingpanic.cpp
+SOURCE          cpecontactextensionwrapper.cpp
+
+USERINCLUDE     ../inc
+
+APP_LAYER_SYSTEMINCLUDE         // Application layer domain APIs
+SYSTEMINCLUDE   ../../inc          // PhoneEngine private headers
+SYSTEMINCLUDE   ../../../inc    // Telephony internal headers
+SYSTEMINCLUDE   /epoc32/include/connect
+
+LIBRARY	        serviceprovidersettings.lib
+LIBRARY	        bafl.lib
+LIBRARY         ecom.lib	
+LIBRARY         efsrv.lib // For reading picture.	
+LIBRARY         engineinfo.lib	
+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/contacthandling/inc/cpecontactextensionwrapper.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,128 @@
+/*
+* 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 CPEContactExtensionWrapper class.
+*
+*/
+
+
+
+#ifndef C_CPECONTACTEXTENSIONWRAPPER_H
+#define C_CPECONTACTEXTENSIONWRAPPER_H
+
+#include <e32base.h>
+#include <telmatchingextension.h>
+
+/**
+ *  Provides container friendly interface for extension plugin handling.
+ *    
+ *  @lib loghandling.dll
+ *  @since S60 v5.1
+ */
+NONSHARABLE_CLASS( CPEContactExtensionWrapper ) : public CTelMatchingExtension
+    {
+
+public:
+
+    /**
+     * Two-phased constructor.
+     * @param   aImplementationUid  An Ecom plugin implementation identifier.
+     */
+    static CPEContactExtensionWrapper* NewL( TUid aImplementationUid );
+
+    /**
+     * Two-phased constructor.
+     * @param   aImplementationUid  An Ecom plugin implementation identifier.
+     */
+    static CPEContactExtensionWrapper* NewLC( TUid aImplementationUid );
+
+    /**
+    * Destructor.
+    */
+    virtual ~CPEContactExtensionWrapper();
+
+    /**
+     * Provides comparison algorithm for CPEContactExtensionWrapper 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 CPEContactExtensionWrapper& aWrapper );
+    
+    // from base class CTelMatchingExtension
+    /**
+    * From CTelMatchingExtension.
+    * @see CTelMatchingExtension.
+    */
+    void InitializeL( TUint aServiceId, const TDesC& aOrigAddress );
+    
+    /**
+    * From CTelMatchingExtension.
+    * @see CTelMatchingExtension.
+    */
+    TInt GetAddressForMatching( RBuf& aParsedAddress, TInt& aMeaningfulDigits );
+
+    /**
+    * From CTelMatchingExtension.
+    * @see CTelMatchingExtension.
+    */
+    TInt GetContactStoreUris( CDesCArray& aStoreUris );
+
+    /**
+    * From CTelMatchingExtension.
+    * @see CTelMatchingExtension.
+    */
+    TInt GetRemotePartyName( RBuf& aRemotePartyName );
+
+private:
+
+    CPEContactExtensionWrapper() {};
+    
+    CPEContactExtensionWrapper( TUid aImplementationUid );
+
+    void ConstructL();
+    
+    /**
+     * Creates contact extension plugin.
+     * @since   S60 v5.1
+     * @return A new contact extension plugin instance.
+     */
+    CTelMatchingExtension* CreateContactExtensionL() 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;
+
+    /**
+     * Contact matching extension plugin.
+     * Own.
+     */
+    CTelMatchingExtension* iPlugin;
+
+    };
+
+#endif // C_CPECONTACTEXTENSIONWRAPPER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/contacthandling/inc/cpecontacthandling.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,158 @@
+/*
+* 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/contacthandling/inc/cpecontacthandlingdummy.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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/contacthandling/inc/cpecontacthandlingproxy.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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/contacthandling/inc/cpecontactmatch.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,282 @@
+/*
+* 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:  Manager for contacts.
+*
+*/
+
+
+#ifndef CPECONTACTMATCH_H
+#define CPECONTACTMATCH_H
+
+// INCLUDES
+#include <cntdef.h>
+#include <e32base.h>
+#include <pevirtualengine.h>
+#include <mphcntthumbnailloaderobserver.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 CPhCntSingleItemFetch;
+class CPhCntSpeedDialMonitor;
+class CPhCntThumbnailLoader;
+class MPEDataStore;
+class MPhCntMatch;
+class CPhCntMatcher;
+class CPhCntThumbnailLoader;
+class MPESimContactMatch;
+class CTelMatchingExtension;
+class CPEContactExtensionWrapper;
+
+// CLASS DECLARATION
+
+/**
+*  Container for all Contact Handling owned instances of Phone Contact Finder
+*/
+class CPEContactMatch
+    : public CBase,
+      public MPhCntThumbnailLoaderObserver
+    {
+    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();
+
+        /**
+        * Create thumbnail loader.
+        */
+        void ConstructThumbnailLoaderL();
+
+        /**
+        * Create speed dial command
+        */
+        void ConstructSpeedDialCommandL();
+
+        /**
+        * 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 single item fetch.
+        *
+        * Ownership is passed to the client.
+        *
+        * @return instance of single item fetch.
+        */
+        CPhCntSingleItemFetch* CreateSingleItemFetchL();
+
+        /**
+         * 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 );
+
+        /**
+        * From MPhCntThumbnailLoaderObserver
+        *
+        * Called when thumbnail loading has been completed.
+        * Ownership of the bitmap is transferred to the observer.
+        *
+        * @param aId id, never KPhCntThumbnailNullId.
+        * @param aResult error code.
+        * @param aBitmap bitmap.
+        */
+        void MpctloThumbnailLoaded(
+            CPhCntThumbnailLoader::TThumbnailId aId,
+            TInt aResult, 
+            CFbsBitmap* aBitmap );
+
+        /**
+        * Resolves services implementation uid for matching (ECom plugin).
+        * @leave Leaves with KErrNotFound if UID not found.
+        * @param aServiceId Unique service id used in current call.
+        * @return Implementation UID
+        */       
+        TUid ResolveServicesImplementationUidL( TUint32 aServiceId );
+ 
+        /**
+        * Makes voip contact matching.
+        * @param aCallId Id of the currently used call
+        * @param aMatch Contact match
+        * @param aRemotePartyName Remote party name.
+        */  
+        void MatchWithVoipAdressL( 
+                const TInt aCallId, 
+                MPhCntMatch*& aMatch, 
+                RBuf& aRemotePartyName );
+        
+        /**
+        * Returns contact store uris that should be opened
+        * before contact match. Store uris are fetched by service id.
+        * @param aServiceId Service id of the ongoing call.
+        * @return Array of uri's. NULL if not found for current service.
+        */
+        CDesCArray* StoreUrisForServiceL( TUint aServiceId );
+        
+        /**
+        * Makes voip contact matching using extension plugin.
+        * @since    S60 v5.1
+        * @param    aCallId            Identifier of the currently used call.
+        * @param    aMatch             Contact match.
+        * @param    aRemotePartyName   Remote party name.
+        */  
+        void MatchWithVoipAddressUsingExtensionL( TInt aCallId, 
+            MPhCntMatch*& aMatch, RBuf& aRemotePartyName );
+        
+        /**
+         * Returns matching 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.
+         * @return  A matching extension instance.
+         */
+        CTelMatchingExtension& MatchingExtensionL( TUint aServiceId );
+        
+    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;
+
+        // Owned: thumbnail loader
+        CPhCntThumbnailLoader* iContactThumbnailLoader;
+
+        // Owned: speed dial monitor
+        CPhCntSpeedDialMonitor* iSpeedDialCommand;
+
+        // Owned: thumbnail image
+        // Ownership is passed to client when it calls ContactThumbnail()
+        CFbsBitmap* iThumbnailImage;
+
+        // Identifier of the currently loading thumbnail
+        // Used *exlusively* by this class to associate a thumbnail to a contact
+        // This class uses a call id (TInt) for this purpose
+        CPhCntThumbnailLoader::TThumbnailId iThumbnailId;
+        
+        /**
+         * Contact extension plugins.
+         * Own.
+         */
+        RPointerArray<CPEContactExtensionWrapper> iPlugins;
+    };
+
+#endif // CPECONTACTMATCH_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/contacthandling/inc/mpecontacthandling.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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/contacthandling/src/cpecontactextensionwrapper.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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: Implementation of CPEContactExtensionWrapper class.
+*
+*/
+
+
+#include "cpecontactextensionwrapper.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CPEContactExtensionWrapper::CPEContactExtensionWrapper
+// ---------------------------------------------------------------------------
+//
+CPEContactExtensionWrapper::CPEContactExtensionWrapper( 
+        TUid aImplementationUid )
+    : 
+    iPluginUid( aImplementationUid )
+    {
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPEContactExtensionWrapper::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CPEContactExtensionWrapper::ConstructL()
+    {
+    iPlugin = CreateContactExtensionL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPEContactExtensionWrapper::NewL
+// ---------------------------------------------------------------------------
+//
+CPEContactExtensionWrapper* CPEContactExtensionWrapper::NewL( 
+        TUid aImplementationUid )
+    {
+    CPEContactExtensionWrapper* self = 
+        CPEContactExtensionWrapper::NewLC( aImplementationUid );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPEContactExtensionWrapper::NewLC
+// ---------------------------------------------------------------------------
+//
+CPEContactExtensionWrapper* CPEContactExtensionWrapper::NewLC( 
+        TUid aImplementationUid )
+    {
+    CPEContactExtensionWrapper* self = 
+        new( ELeave ) CPEContactExtensionWrapper( aImplementationUid );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPEContactExtensionWrapper::~CPEContactExtensionWrapper
+// ---------------------------------------------------------------------------
+//
+CPEContactExtensionWrapper::~CPEContactExtensionWrapper()
+    {
+    delete iPlugin;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPEContactExtensionWrapper::MatchByUid
+// ---------------------------------------------------------------------------
+//
+TBool CPEContactExtensionWrapper::MatchByUid( 
+        const TUid* aKey, const CPEContactExtensionWrapper& aWrapper )
+    {
+    if ( aKey )
+        {
+        return ( aWrapper.Identifier() == *aKey );
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class CTelMatchingExtension.
+// ---------------------------------------------------------------------------
+//
+void CPEContactExtensionWrapper::InitializeL( 
+        TUint aServiceId, const TDesC& aOrigAddress )
+    {
+    iPlugin->InitializeL( aServiceId, aOrigAddress );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class CTelMatchingExtension.
+// ---------------------------------------------------------------------------
+//
+TInt CPEContactExtensionWrapper::GetAddressForMatching( 
+        RBuf& aParsedAddress, TInt& aMeaningfulDigits )
+    {
+    return iPlugin->GetAddressForMatching( aParsedAddress, aMeaningfulDigits );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class CTelMatchingExtension.
+// ---------------------------------------------------------------------------
+//
+TInt CPEContactExtensionWrapper::GetContactStoreUris( CDesCArray& aStoreUris )
+    {
+    return iPlugin->GetContactStoreUris( aStoreUris );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class CTelMatchingExtension.
+// ---------------------------------------------------------------------------
+//
+TInt CPEContactExtensionWrapper::GetRemotePartyName( RBuf& aRemotePartyName )
+    {
+    return iPlugin->GetRemotePartyName( aRemotePartyName );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPEContactExtensionWrapper::CreateContactExtensionL
+// Needed for testing with mock technique.
+// ---------------------------------------------------------------------------
+//
+CTelMatchingExtension* 
+    CPEContactExtensionWrapper::CreateContactExtensionL() const
+    {
+    return CTelMatchingExtension::NewL( iPluginUid );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPEContactExtensionWrapper::Identifier
+// ---------------------------------------------------------------------------
+//
+TUid CPEContactExtensionWrapper::Identifier() const
+    {
+    return iPluginUid;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/contacthandling/src/cpecontacthandling.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,231 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This 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/contacthandling/src/cpecontacthandlingdummy.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,92 @@
+/*
+* 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/contacthandling/src/cpecontacthandlingproxy.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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/contacthandling/src/cpecontactmatch.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,750 @@
+/*
+* 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 <cphcntspeeddialmonitor.h>
+#include <cphcntthumbnailloader.h>
+#include <mpeclientinformation.h>
+#include <mpedatastore.h>
+#include <mphcntmatch.h>
+#include <mphcntthumbnailloaderobserver.h>
+#include <pepanic.pan>
+#include <pevirtualengine.h>
+#include <talogger.h>
+#include <telmatchingextension.h>
+#include <spsettings.h>
+#include <spdefinitions.h>
+#include <spproperty.h>
+#include <spentry.h>
+#include "cpecontactextensionwrapper.h"
+
+// CONSTANTS
+
+// Space - used as a separator between concatenated first and last name
+_LIT( KPESpace," ");
+
+
+// Contact group array granularity
+const TInt KPEContactGroupArrayGranularity = 5;
+// Minimum value of meanigful digits
+const TInt KMinValueOfMeaningfulDigits = 4;
+// Maximum value of meanigful digits
+const TInt KMaxValueOfMeaningfulDigits = 20;
+
+
+// ================= 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 iSpeedDialCommand;
+    if ( iContactThumbnailLoader && iThumbnailId )
+        {
+      	iContactThumbnailLoader->Cancel( iThumbnailId );
+        }
+    delete iThumbnailImage;
+    delete iContactThumbnailLoader;
+    delete iContactMatcher;
+    delete iContactFactory;
+    
+    iPlugins.ResetAndDestroy();
+    REComSession::FinalClose();
+    iLibrary.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactMatch::CreateSingleItemFetchL
+// -----------------------------------------------------------------------------
+//
+CPhCntSingleItemFetch* CPEContactMatch::CreateSingleItemFetchL()
+    {
+    return iContactFactory->CreateSingleItemFetchL();
+    }
+
+// -----------------------------------------------------------------------------
+// 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();
+
+    //Secondary services that may be enabled on demand
+    ConstructThumbnailLoaderL();
+    ConstructSpeedDialCommandL();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactMatch::ConstructThumbnailLoaderL
+// -----------------------------------------------------------------------------
+//
+void CPEContactMatch::ConstructThumbnailLoaderL()
+    {
+    if ( !iContactThumbnailLoader )
+        {
+        TEFLOGSTRING( KTAOBJECT, "CNT CPEContactMatch::ConstructL > CPhCntFactory::CreateThumbnailLoaderL" );
+        iContactThumbnailLoader = iContactFactory->CreateThumbnailLoaderL( *this );
+        }
+    else
+        {
+        TEFLOGSTRING( KTAERROR,
+            "CNT CPECONTACTMATCH::CONSTRUCTTHUMBNAILLOADERL ! ALREADY EXISTS" );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactMatch::ConstructSpeedDialCommandL
+// -----------------------------------------------------------------------------
+//
+void CPEContactMatch::ConstructSpeedDialCommandL()
+    {
+    if ( !iSpeedDialCommand )
+        {
+        TEFLOGSTRING( KTAOBJECT, "CNT CPEContactMatch::ConstructL > CPhCntFactory::CreateSpeedDialMonitorL" );
+        iSpeedDialCommand = iContactFactory->CreateSpeedDialMonitorL();
+        }
+    else
+        {
+        TEFLOGSTRING( KTAERROR,
+            "CNT CPECONTACTMATCH::CONSTRUCTSPEEDDIALCOMMANDL ! ALREADY EXISTS" );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 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
+            iDataStore.SetHasCallerThumbnail( ETrue, aCallId );
+            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 );
+    RBuf remoteParty;
+    remoteParty.CleanupClosePushL();
+
+    if ( iDataStore.CallType( aCallId ) == EPECallTypeVoIP )
+        {
+        TEFLOGSTRING2( KTAINT, "CNT CPEContactMatch::MatchWithNumberL > CPhCntMatcher::MatchVoipNumber, call id: %d", aCallId );
+        MatchWithVoipAdressL( aCallId, match, remoteParty );
+        
+        }
+    else
+        {
+        TPEPhoneNumber remoteNumber = iDataStore.RemotePhoneNumber( aCallId );
+        
+        TEFLOGSTRING3( KTAINT, "CNT CPEContactMatch::MatchWithNumberL > CPhCntMatcher::MatchNumber, number: %S, call id: %d",
+            &remoteNumber, aCallId );
+        iContactMatcher->MatchNumber( match, remoteNumber );
+        }
+
+    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;
+        }
+    else if ( 0 < remoteParty.Length() )
+        {
+        TEFLOGSTRING( KTAINT, "CNT CPEContactMatch::MatchWithNumberL, Set plugins remote name" );
+        // Match not found, set plugins remote party name.
+        // Make sure that length of the remote name is not too long.
+        iDataStore.SetRemoteName( remoteParty.Left( 
+                                    Min( KCntMaxTextFieldLength, remoteParty.Length() ) ), 
+                                  aCallId );
+        }
+
+    CleanupStack::PopAndDestroy( &remoteParty );
+    }
+
+// ---------------------------------------------------------
+// CPEContactMatch::LoadThumbnail
+// ---------------------------------------------------------
+//
+TInt CPEContactMatch::LoadThumbnail(
+        const CPhCntContactId& aContactId,
+        const TInt aCallId )
+    {
+    // use call id for identifying which thumbnail is loaded
+    // Increment it because zero is invalid value for the id
+    TInt thumbnailId = aCallId + 1;
+    iThumbnailId =
+        reinterpret_cast< CPhCntThumbnailLoader::TThumbnailId > ( thumbnailId );
+
+    TEFLOGSTRING( KTAINT, "CNT CPEContactMatch::LoadThumbnail > CPhCntThumbnailLoader::Load" );
+    return iContactThumbnailLoader->Load( iThumbnailId, aContactId );
+    }
+
+// ---------------------------------------------------------
+// CPEContactMatch::MpctloThumbnailLoaded
+// ---------------------------------------------------------
+//
+void CPEContactMatch::MpctloThumbnailLoaded(
+        CPhCntThumbnailLoader::TThumbnailId aId,
+        TInt aResult, 
+        CFbsBitmap* aBitmap )
+    {
+    // Operation complete
+    // Reset id to indicate that no thumbnail loading is in progress
+    iThumbnailId = KPhCntThumbnailNullId;
+
+    if ( aResult == KErrNone )
+        {
+        iThumbnailImage = aBitmap;
+
+        // Decrement call id, see LoadThumbnail() for reason
+        TInt thumbnailId = ( reinterpret_cast< TInt >( aId ) ) - 1;
+
+        iOwner.SendMessage( MEngineMonitor::EPEMessageThumbnailLoadingCompleted, thumbnailId );
+        }
+    else
+        {
+        TEFLOGSTRING( KTAERROR,
+            "CNT CPECONTACTMATCH::MPCTLOTHUMBNAILLOADED ! ERROR LOADING THUMBNAIL" );
+        iOwner.SendErrorMessage( aResult );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPEContactMatch::ContactThumbnail
+// Returns contact thumbnail image, NULL if not found
+// ---------------------------------------------------------
+//
+CFbsBitmap* CPEContactMatch::ContactThumbnail()
+    {
+    if ( !iThumbnailImage )
+        {
+        return NULL;
+        }
+    CFbsBitmap* returnedThumbnailImage( iThumbnailImage );
+    iThumbnailImage = NULL; // Ownership is passed to caller
+
+    return returnedThumbnailImage;
+    }
+
+// -----------------------------------------------------------------------------
+// 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 )] = ' ';
+        }
+
+    iDataStore.SetRemoteName( finalName, aCallId );
+
+    iDataStore.SetRemoteTextToSpeechText( aMatch.TextToSpeechTextL(), aCallId );
+
+    if ( aMatch.Number().Length() > 0 )
+        {
+        iDataStore.SetRemotePhoneNumber( aMatch.Number(), 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 )
+    {
+    iSpeedDialCommand->GetSpeedDialFieldL( aLocationIndex, aNumber);
+    }
+
+// -----------------------------------------------------------
+// CPEContactMatch::ResolveImplementationUidL
+// -----------------------------------------------------------
+//
+TUid CPEContactMatch::ResolveServicesImplementationUidL( TUint32 aServiceId )
+    {
+    TEFLOGSTRING2( KTAINT, "CNT CPEContactMatch::ResolveService > aServiceId: %d", aServiceId );   
+    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, EPropertyCLIPluginId ) );
+    
+    if ( property ) 
+        {
+        TInt temp(0);
+        User::LeaveIfError( property->GetValue( temp ) );
+        implUid.iUid = temp;
+        }
+    else
+        {
+        User::Leave( KErrNotFound );
+        }
+
+    CleanupStack::PopAndDestroy( entry );
+    return implUid;
+    }
+
+// -----------------------------------------------------------
+// CPEContactMatch::MatchWithVoipAdressL
+// -----------------------------------------------------------
+//
+void CPEContactMatch::MatchWithVoipAdressL( 
+    const TInt aCallId, 
+    MPhCntMatch*& aMatch, 
+    RBuf& aRemotePartyName )
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "CNT CPEContactMatch::MatchWithVoipAdressL, CALL ID: %d", aCallId )
+    
+    aRemotePartyName.Close();
+    TRAPD( result, MatchWithVoipAddressUsingExtensionL( 
+        aCallId, aMatch, aRemotePartyName ) );
+    if ( KErrNone != result )
+        {
+        TEFLOGSTRING2( KTAINT, 
+            "CNT CPEContactMatch::MatchWithVoipAdressL > PLUGIN ERR: %d", result )
+            
+        // Some error happened while using extension plugin.
+        // -> Default matching is used.
+            
+        // Try to find store uris that should be opened before contact match.    
+        CDesCArray* storeUris = NULL; 
+        TRAP_IGNORE( storeUris = StoreUrisForServiceL( 
+                iDataStore.ServiceId( aCallId )) );
+        
+        TPEPhoneNumber remoteNumber = iDataStore.RemotePhoneNumber( aCallId );
+        iContactMatcher->MatchVoipNumber( 
+            aMatch, remoteNumber, ETrue, storeUris, remoteNumber.Length() );
+        
+        delete storeUris;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPEContactMatch::StoreUrisForServiceL
+// -----------------------------------------------------------
+//
+CDesCArray* CPEContactMatch::StoreUrisForServiceL( TUint aServiceId )
+    {	
+    CDesCArray* storeUris = new ( ELeave ) CDesC16ArrayFlat( 1 );
+    CleanupStack::PushL( storeUris );
+    
+    // Get contact store id from Service Table
+    // KSPMaxDesLength from spdefinitions.h
+    HBufC* cntStoreId = HBufC::NewLC( KSPMaxDesLength );
+    CSPSettings* spSettings = CSPSettings::NewLC(); 
+    CSPProperty* property = CSPProperty::NewLC();
+    User::LeaveIfError( spSettings->FindPropertyL( 
+            TServiceId( aServiceId ), 
+            EPropertyContactStoreId, 
+            *property ) );                        
+          
+    TPtr storeUri( cntStoreId->Des() );
+    User::LeaveIfError( property->GetValue( storeUri ) );   
+
+    storeUris->AppendL( storeUri );
+
+    CleanupStack::PopAndDestroy( property );
+    CleanupStack::PopAndDestroy( spSettings );     
+    CleanupStack::PopAndDestroy( cntStoreId );
+    CleanupStack::Pop( storeUris );
+
+    return storeUris;
+    }
+
+// -----------------------------------------------------------
+// CPEContactMatch::MatchWithVoipAddressUsingExtensionL
+// -----------------------------------------------------------
+//
+void CPEContactMatch::MatchWithVoipAddressUsingExtensionL( TInt aCallId, 
+        MPhCntMatch*& aMatch, RBuf& aRemotePartyName )
+    {
+    // Create and initialize extension plugin.
+    TUint32 serviceId = iDataStore.ServiceId( aCallId );
+    CTelMatchingExtension& plugin = MatchingExtensionL( serviceId );
+    TPEPhoneNumber remoteNumber = iDataStore.RemotePhoneNumber( aCallId );
+    plugin.InitializeL( serviceId, remoteNumber );
+    
+    // Get service specific parameters from the plugin.
+    User::LeaveIfError( plugin.GetRemotePartyName( aRemotePartyName ) );
+    
+    RBuf parsedAddress;
+    CleanupClosePushL( parsedAddress );
+    TInt digitsformatching( 0 );
+    User::LeaveIfError( plugin.GetAddressForMatching( parsedAddress, digitsformatching ) );
+
+    CDesCArray* array = new ( ELeave ) CDesC16ArrayFlat( 1 );
+    CleanupStack::PushL( array );
+    User::LeaveIfError( plugin.GetContactStoreUris( *array ) );
+    
+    TEFLOGSTRING2( KTAINT, "CNT Extension Plugin > remoteParty: %S", &aRemotePartyName )
+    TEFLOGSTRING3( KTAINT, "CNT Extension Plugin > parsedAddress: %S , digits: %d",
+        &parsedAddress, digitsformatching )
+    TEFLOGSTRING2( KTAINT, "CNT Extension Plugin > array count: %d", array->MdcaCount() )
+    
+    // Digits for matching. Supported range is between 4-20.
+    // If not valid value use whole address length for matching.
+    digitsformatching = ( digitsformatching < KMinValueOfMeaningfulDigits || 
+                          digitsformatching > KMaxValueOfMeaningfulDigits ) ? 
+                          parsedAddress.Length() : digitsformatching;
+    
+    // Use service specific parameters for matching.
+    TEFLOGSTRING3( KTAINT, "CNT MatchWithVoipAddressUsingExtensionL >\
+        CPhCntMatcher::MatchVoipNumber, NUMBER: %S, CALL ID: %d",
+        &remoteNumber, aCallId )
+    iContactMatcher->MatchVoipNumber( aMatch, 
+        parsedAddress.Left( Min( parsedAddress.Length(), KPEPhoneNumberMaxLength ) ), 
+        ETrue, array, digitsformatching );                                       
+    
+    CleanupStack::PopAndDestroy( array );
+    CleanupStack::PopAndDestroy( &parsedAddress );
+    }
+
+
+// -----------------------------------------------------------
+// CPEContactMatch::MatchingExtensionL
+// -----------------------------------------------------------
+//
+CTelMatchingExtension& CPEContactMatch::MatchingExtensionL( TUint aServiceId )
+    {
+    TUid pluginUid = ResolveServicesImplementationUidL( aServiceId );
+    
+    CPEContactExtensionWrapper* wrapper = NULL;
+    TInt pluginInd = 
+        iPlugins.Find( pluginUid, CPEContactExtensionWrapper::MatchByUid );
+    if ( KErrNotFound == pluginInd )
+        {
+        wrapper = CPEContactExtensionWrapper::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/phoneengine/contacthandling/src/pecontacthandlingpanic.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,72 @@
+/*
+* 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/engineinfo/bwins/engineinfou.def	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,1576 @@
+/*
+* 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 );
+                
+    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;
+
+    };
+
+
+#endif // CPEENGINEINFOIMPL_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/inc/cperemoteinfo.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,706 @@
+/*
+* 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>
+
+// 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:
+        /**
+        * 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;
+        
+    }; // MPEEngineInfo
+    
+#endif      //MPEENGINEINFO_H
+    
+// End of File
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/src/cpecallinfo.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,2619 @@
+/*
+* 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 )
+    {
+    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;
+    }
+
+// -----------------------------------------------------------------------------
+// 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;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/src/cperemoteinfo.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "../PhoneCntFinder/Group/bld.inf"
+#include "../audiohandling/group/bld.inf"
+#include "../callhandling/group/bld.inf"
+#include "../contacthandling/group/bld.inf"
+#include "../loghandling/group/bld.inf"
+#include "../engineinfo/group/bld.inf"
+#include "../phonemodel/group/bld.inf"
+#include "../servicehandling/group/bld.inf"
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/bwins/loghandlingu.def	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,693 @@
+/*
+* 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 <PbkFields.hrh>
+#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( EPbkFieldIdPhoneNumberMobile );
+            break;
+        case EPETelephoneNumber:
+            subject.AppendNum( EPbkFieldIdPhoneNumberGeneral );
+            break;
+        case EPEPager:
+            subject.AppendNum( EPbkFieldIdPagerNumber );
+            break;
+        case EPEFaxNumber:
+            subject.AppendNum( EPbkFieldIdFaxNumber );
+            break; 
+        case EPEAssistantNumber:
+            subject.AppendNum( EPbkFieldIdAssistantNumber);
+            break;
+        case EPECarNumber:
+            subject.AppendNum( EPbkFieldIdCarNumber);
+            break;
+        default:
+            subject.AppendNum( EPbkFieldIdNone );
+            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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This 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/phonemodel/bwins/phoneengineu.def	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	_ZN15CPEPhoneModelIF7CreateLER14MEngineMonitor @ 1 NONAME
+	_ZN15CPEPhoneModelIF7CreateLER14MEngineMonitorR15CPEAudioFactory @ 2 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/group/backup_registration.xml	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,6 @@
+<?xml version="1.0" standalone="yes"?>
+<!--  Backup registration file for Phone Engine cenrep keys  --> 
+<backup_registration version="1.0">
+    <proxy_data_manager sid = "0x10202BE9" />
+    <restore requires_reboot = "no"/>
+</backup_registration>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  PhoneModelGsm bld file
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+// Internal headers
+../inc/telephonyvariant.hrh           |../../../inc/telephonyvariant.hrh
+../inc/telinternalcrkeys.h            |../../../inc/telinternalcrkeys.h 
+../inc/telinternalpskeys.h            |../../../inc/telinternalpskeys.h 
+../inc/telinternalpstypes.h           |../../../inc/telinternalpstypes.h 
+../inc/pevirtualengine.h              |../../../inc/pevirtualengine.h
+../inc/mphonedevicemodeobserver.h     |../../../inc/mphonedevicemodeobserver.h
+../inc/cpephonemodelif.h              |../../../inc/cpephonemodelif.h
+
+// Phoneengine subsystem exports
+../inc/mpeactivestarter.h             |../../inc/mpeactivestarter.h
+../inc/mpeexternaldatahandler.h       |../../inc/mpeexternaldatahandler.h
+../inc/mpephonemodelinternal.h        |../../inc/mpephonemodelinternal.h
+../inc/pepanic.pan                    |../../inc/pepanic.pan
+../inc/talogger.h                     |../../inc/talogger.h
+
+// Backup registration files
+backup_registration.xml /epoc32/data/z/private/1000a86c/backup_registration.xml
+backup_registration.xml /epoc32/release/winscw/udeb/z/private/1000a86c/backup_registration.xml
+backup_registration.xml /epoc32/release/winscw/urel/z/private/1000a86c/backup_registration.xml
+
+// SIS stubs
+../data/phonemodel_stub.sis         /epoc32/data/z/system/install/phonemodel_stub.sis
+
+// IBY files
+../rom/phonengengine.iby                        CORE_APP_LAYER_IBY_EXPORT_PATH(phonengengine.iby)
+// Generic configuration interface for component cenrep settings  
+../conf/s60telephony.confml                 APP_LAYER_CONFML(s60telephony.confml)
+../conf/s60telephony_japan.confml           CONFML_EXPORT_PATH(s60telephony_japan.confml,japan)
+../conf/s60telephony_101F87E3.crml 	        APP_LAYER_CRML(s60telephony_101F87E3.crml)
+../conf/s60telephony_102828B1.crml 	        APP_LAYER_CRML(s60telephony_102828B1.crml)
+../conf/s60telephony_102828B2.crml 	        APP_LAYER_CRML(s60telephony_102828B2.crml)
+../conf/s60telephony_102828B8.crml 	        APP_LAYER_CRML(s60telephony_102828B8.crml)
+../conf/s60telephony_102828F8.crml 	        APP_LAYER_CRML(s60telephony_102828F8.crml)
+../conf/s60telephony_102830B6.crml 	        APP_LAYER_CRML(s60telephony_102830B6.crml)
+../conf/s60telephony_2001B2E6.crml 	        APP_LAYER_CRML(s60telephony_2001B2E6.crml)
+ 
+PRJ_MMPFILES
+phonemodel.mmp
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/group/phonemodel.mmp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,111 @@
+/*
+* 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 Phone Engine dll
+*
+*/
+
+#include <platform_paths.hrh>
+
+TARGET          phoneengine.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x1000A86C
+VENDORID		VID_DEFAULT
+
+CAPABILITY	CAP_GENERAL_DLL
+
+SOURCEPATH  ../src
+
+SOURCE      cpeaccessorymodemonitor.cpp
+SOURCE      cpeactivestarter.cpp
+SOURCE      cpeaudiooutputpreferencemonitor.cpp
+SOURCE      cpecalldurationdisplaysettingmonitor.cpp
+SOURCE      cpecenrepmonitor.cpp
+SOURCE      cpeclientcallrequestmonitor.cpp
+SOURCE      cpeclientcommandhandlermonitor.cpp
+SOURCE      cpeclientemergencycallmonitor.cpp
+SOURCE      cpeclientservices.cpp
+SOURCE      cpedevicemodehandler.cpp
+SOURCE      cpeexternaldatahandler.cpp
+SOURCE      cpeincallearvolumesettingmonitor.cpp
+SOURCE      cpeincallloudspeakervolumesettingmonitor.cpp
+SOURCE      cpemessagehandler.cpp
+SOURCE      cpenetworkregistrationstatusmonitor.cpp
+SOURCE      cpeprofilesettingmonitor.cpp
+SOURCE      cpepubsubmonitor.cpp
+SOURCE      cpetimer.cpp
+SOURCE      pepanic.cpp
+SOURCE      cpemanualcallcontrolhandler.cpp
+SOURCE      cpeidlestatusmonitor.cpp
+SOURCE      cpeparsermanufacturerhandler.cpp
+SOURCE      cpeparsermischandler.cpp
+SOURCE      cpeparserphonenumberhandler.cpp
+SOURCE      cpeparsersimcontrolhandler.cpp
+SOURCE      cpeparsersscallhandler.cpp
+SOURCE      cpeparsersshandler.cpp
+SOURCE      cpephonemodel.cpp
+SOURCE      cpephonemodelif.cpp
+SOURCE      cpesimstatemonitor.cpp
+SOURCE      cpepcnparserprocedurehandler.cpp
+SOURCE      cpeparseremergencynumberhandler.cpp
+SOURCE      cpeparservoipnumberhandler.cpp
+SOURCE      phoneengineproxy.cpp
+SOURCE      cperemotepartyinfomediator.cpp
+SOURCE      cperemotepartyinfoproxy.cpp
+SOURCE      tperemotepartyinfomediatorupdater.cpp
+
+USERINCLUDE     ../inc
+
+APP_LAYER_SYSTEMINCLUDE       // Application layer domain APIs
+SYSTEMINCLUDE   ../../inc     // Phone Engine private headers
+SYSTEMINCLUDE   ../../../inc  // Telephony internal headers
+SYSTEMINCLUDE   /epoc32/include/mmf/server
+SYSTEMINCLUDE   /epoc32/include/mmf/common
+
+LIBRARY     cce.lib
+LIBRARY     accclient.lib           // Accessory client
+LIBRARY     apgrfx.lib  
+LIBRARY     apparc.lib  
+LIBRARY     audiohandling.lib   
+LIBRARY     callhandling.lib
+LIBRARY     centralrepository.lib
+LIBRARY     commonengine.lib    
+LIBRARY     contacthandling.lib 
+LIBRARY     efsrv.lib
+LIBRARY     engineinfo.lib
+LIBRARY     etel.lib    
+LIBRARY     etelmm.lib  
+LIBRARY     euser.lib   
+LIBRARY     featmgr.lib 
+LIBRARY     flogger.lib 
+LIBRARY     loghandling.lib 
+LIBRARY     phoneparser.lib 
+LIBRARY     phonesettings.lib   
+LIBRARY     psui.lib    
+LIBRARY     secui.lib
+LIBRARY     sysutil.lib
+LIBRARY     ws32.lib
+LIBRARY     platformenv.lib // PathInfo
+LIBRARY     phoneclient.lib
+LIBRARY     profileeng.lib
+LIBRARY     bafl.lib                // Descriptor arrays
+LIBRARY     callprovider.lib
+LIBRARY     peservicehandling.lib
+LIBRARY     mediatorclient.lib
+LIBRARY     estor.lib
+
+LANG        SC
+
+START WINS
+BASEADDRESS 0x10030000
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpeaccessorymodemonitor.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This 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();
+protected: // From base class
+	virtual void UpdateL();
+protected:
+    CPECallDurationDisplaySettingMonitor();
+    void ConstructL();
+private:
+    TBool iDisplayCallDuration;
+};
+
+#endif // CPECALLDURATIONDISPLAYSETTINGMONITOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpecenrepmonitor.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "cpeincallearvolumesettingmonitor.h"
+#include "cpeincallloudspeakervolumesettingmonitor.h"
+#include "cpenetworkregistrationstatusmonitor.h"
+#include "cpeprofilesettingmonitor.h"
+#include "mpeexternaldatahandler.h"
+#include "cpeaccessorymodemonitor.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;
+        CPEIncallEarVolumeSettingMonitor* iEarVolumeSetting;
+        CPEIncallLoudspeakerVolumeSettingMonitor* iLoudspeakerVolumeSetting;
+        CPENetworkRegistrationStatusMonitor* iNetworkRegistrationStatus;
+        CPEProfileSettingMonitor* iProfileSettings;
+        CPEAccessoryModeMonitor* iAccessoryModeMonitor;
+
+        // 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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/cpeincallearvolumesettingmonitor.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,53 @@
+/*
+* 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 of the phone engine base 
+*                central repository monitor class
+*
+*/
+
+
+#ifndef CPEINCALLEARVOLUMESETTINGMONITOR_H
+#define CPEINCALLEARVOLUMESETTINGMONITOR_H
+
+// INCLUDE FILES
+#include "cpecenrepmonitor.h"
+
+// Forward declarations
+class MPEPhoneModelInternal;
+
+/**
+*   CPEIncallEarVolumeSettingMonitor
+*   For set/get of the phone ear volume setting (KTelIncallEarVolume) from 
+*   the central repository 
+*
+*  @lib PhoneEngine.lib
+*/
+NONSHARABLE_CLASS( CPEIncallEarVolumeSettingMonitor ) : public CPECenRepMonitor
+{
+public:
+    static CPEIncallEarVolumeSettingMonitor* NewL( MPEPhoneModelInternal& aModel );
+    ~CPEIncallEarVolumeSettingMonitor();
+public:
+    TInt Set( TInt aValue );
+protected: // From base class
+	virtual void UpdateL();
+protected:
+    CPEIncallEarVolumeSettingMonitor( MPEPhoneModelInternal& aModel );
+    void ConstructL();    
+private:
+    MPEPhoneModelInternal& iModel;
+    TBool iUpdateInProgress;
+};
+
+#endif // CPEINCALLEARVOLUMESETTINGMONITOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpeincallloudspeakervolumesettingmonitor.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* 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 of the phone engine base 
+*                central repository monitor class
+*
+*/
+
+
+#ifndef CPEINCALLLOUDSPEAKERVOLUMESETTINGMONITOR_H
+#define CPEINCALLLOUDSPEAKERVOLUMESETTINGMONITOR_H
+
+// INCLUDE FILES
+#include "cpecenrepmonitor.h"
+
+// Forward declarations
+class MPEPhoneModelInternal;
+
+/**
+*   CPEIncallLoudspeakerVolumeSettingMonitor
+*   For set/get of the phone ear volume setting (KTelIncallLoudspeakerVolume)
+*   from the central repository 
+*
+*  @lib PhoneEngine.lib
+*/
+NONSHARABLE_CLASS( CPEIncallLoudspeakerVolumeSettingMonitor ) : public CPECenRepMonitor
+{
+public:
+    static CPEIncallLoudspeakerVolumeSettingMonitor* NewL( 
+        MPEPhoneModelInternal& aModel );
+    ~CPEIncallLoudspeakerVolumeSettingMonitor();
+public:
+    TInt Set( TInt aValue );
+protected: // From base class
+	virtual void UpdateL();
+protected:
+    CPEIncallLoudspeakerVolumeSettingMonitor( MPEPhoneModelInternal& aModel );
+    void ConstructL();    
+private:
+    MPEPhoneModelInternal& iModel;
+    TBool iUpdateInProgress;
+};
+
+#endif // CPEINCALLLOUDSPEAKERVOLUMESETTINGMONITOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpemanualcallcontrolhandler.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,858 @@
+/*
+* 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"
+
+// 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:  // 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();
+   
+    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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,108 @@
+/*
+* 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.
+        * @since 5.0
+        * @param aPostfix postfix to modify.
+        * @return modified postfix.
+        */
+        TPtrC FilterPostfix( 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,329 @@
+/*
+* 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 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
+            };
+
+        /**
+        * 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;
+
+    };
+
+#endif // CPEPHONEMODEL_H  
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpephonemodelif.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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/mpeclientcallrequestmonitor.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This 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,
+    EPEIncallEarVolumeSetting,
+    EPEIncallLoudspeakerVolumeSetting,
+    EPENetworkRegistrationStatus,
+    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/mpemediator.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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/pepanic.pan	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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,
+
+        // 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/talogger.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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/rom/phonengengine.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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
+
+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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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()
+    {
+    // Resubmit notification request
+    // Retrieve current value for call duration display
+    User::LeaveIfError( Get( iDisplayCallDuration ) );
+    TEFLOGSTRING2( KTAINT, "CPECallDurationDisplaySettingMonitor::UpdateL %d", iDisplayCallDuration );
+    }
+    
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpecenrepmonitor.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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 );
+    // 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,315 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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>
+
+
+// CONSTANTS
+const TInt KPrefixLength = 10;
+
+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 iLoudspeakerVolumeSetting;
+    delete iEarVolumeSetting;
+    delete iCallDurationDisplay;
+    delete iAudioOutputPreferenceMonitor;
+    delete iAccessorySettingsRepository;
+    delete iAccessoryModeMonitor;
+    delete iCoreApplicationRepository;
+    }
+
+// -----------------------------------------------------------------------------
+// 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();
+    iEarVolumeSetting = CPEIncallEarVolumeSettingMonitor::NewL( aModel );
+    iLoudspeakerVolumeSetting = CPEIncallLoudspeakerVolumeSettingMonitor::NewL( aModel );
+    iNetworkRegistrationStatus = CPENetworkRegistrationStatusMonitor::NewL( aModel );
+    iProfileSettings = CPEProfileSettingMonitor::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 ); 
+    }
+
+// -----------------------------------------------------------------------------
+// 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 );
+
+    // Process Common id
+    switch ( aSetting )
+        {
+        case EPEAutomaticAnswerHeadsetSetting:
+            {
+            errorCode = GetAutomaticAnswer( KSettingsHeadsetAutomaticAnswer, aValue );
+            TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEAutomaticAnswerHeadsetSetting, error code: %d",errorCode );
+            break;
+            }        
+        case EPEAutomaticAnswerLoopsetSetting:
+            {
+            errorCode = GetAutomaticAnswer( KSettingsLoopsetAutomaticAnswer, aValue );
+            TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEAutomaticAnswerLoopsetSetting, error code: %d", errorCode );
+            break;
+            }        
+        case EPEAutomaticAnswerCarkitSetting:
+            {
+            errorCode = GetAutomaticAnswer( KSettingsCarKitAutomaticAnswer, aValue );
+            TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEAutomaticAnswerCarkitSetting, error code: %d", errorCode );
+            break;
+            }        
+        case EPEAutomaticAnswerMusicStandSetting:
+            {
+            errorCode = GetAutomaticAnswer( KSettingsMusicStandAutomaticAnswer, aValue );
+            TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEAutomaticAnswerMusicStandSetting, error code: %d", errorCode );
+            break;
+            }        
+        case EPEAutomaticAnswerWirelessCarkitSetting:
+            {
+            errorCode = GetAutomaticAnswer( KSettingsWirelessCarkitAutomaticAnswer, aValue );
+            TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEAutomaticAnswerWirelessCarkitSetting, error code: %d", errorCode );
+            break;
+            }
+        case EPEAudioOutputPreference:
+            {
+            errorCode = iAudioOutputPreferenceMonitor->Get( aValue );
+            TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEAudioOutputPreference, error code: %d", errorCode );
+            break;
+            }
+        case EPECallDurationDisplaySetting:
+            {
+            errorCode = iCallDurationDisplay->Get( aValue );
+            TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPECallDurationDisplaySetting, error code: %d", errorCode );
+            break;
+            }
+        case EPEDialPrefixChangeSetting:
+            {
+            errorCode = iTelephonySettingsRepository->Get( KSettingsDialPrefixChangeMode, aValue );
+            TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEDialPrefixChangeSetting, error code: %d", errorCode );
+            break;
+            }
+        case EPEIncallEarVolumeSetting:
+            {
+            errorCode = iEarVolumeSetting->Get( aValue );
+            TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEIncallEarVolumeSetting, error code: %d", errorCode );
+            break;
+            }
+        case EPEIncallLoudspeakerVolumeSetting:
+            {
+            errorCode = iLoudspeakerVolumeSetting->Get( aValue );
+            TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEIncallLoudspeakerVolumeSetting, error code: %d", errorCode );
+            break;
+            }
+        case EPENetworkRegistrationStatus:
+            {
+            errorCode = iNetworkRegistrationStatus->Get( aValue );
+            TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPENetworkRegistrationStatus, error code: %d", errorCode );
+            break;
+            }
+        case EPETelephonyVariationFlags:
+            {
+            errorCode = iTelephonyVariationRepository->Get( KTelVariationFlags, aValue );
+            TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPETelephonyVariationFlags, error code: %d", errorCode );
+            break;
+            }
+        case EPEAccessoryMode:            
+            {
+            errorCode = KErrNone;
+            aValue = iAccessoryModeMonitor->AccessoryMode();
+            TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEAccessoryMode, error code: %d", errorCode );
+            break;
+            }
+        case EPENetworkConnectionAllowedSetting:
+            {
+            // Fetches setting that indicates if network connection is allowed,
+            // i.e. is the phone in off-line mode. This method is used while
+            // attempting an emergency call, so no memory may be consumed.
+            errorCode = iCoreApplicationRepository
+                ->Get( KCoreAppUIsNetworkConnectionAllowed, aValue );
+            TEFLOGSTRING2( KTAINT, "CPEGsmExternalDataHandler::Get EPENetworkConnectionAllowedSetting, error code: %d",errorCode );
+            break;
+            }
+        default:
+            {
+            TEFLOGSTRING2( KTAERROR, 
+                "PE CPEEXTERNALDATAHANDLER::GET UNKNOWN SETTING ID ! %d", aSetting );
+            break;
+            }
+        }
+
+    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 );
+
+    // Process Common id
+    switch ( aSetting )
+        {
+        case EPEDialPrefixTextSetting:
+            {
+            TBuf<KPrefixLength> prefixTextSetting;
+            
+            errorCode = iTelephonySettingsRepository->Get( 
+                KSettingsDialPrefixText, 
+                prefixTextSetting );
+                
+            aValue = prefixTextSetting;
+            
+            TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::GetText EPEDialPrefixTextSetting, error code: %d", errorCode );
+            break;
+            }
+        default:
+            {
+            TEFLOGSTRING2( KTAERROR, 
+                "PE CPEEXTERNALDATAHANDLER::GETTEXT UNKNOWN SETTING ID ! %d", aSetting );
+            break;
+            }
+        }
+
+    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 = iAccessorySettingsRepository->Get( aSetting, aValue );
+     
+    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 EPEIncallEarVolumeSetting:
+            {
+            errorCode = iEarVolumeSetting->Set( aValue );
+            break;
+            }
+        case EPEIncallLoudspeakerVolumeSetting:
+            {
+            errorCode = iLoudspeakerVolumeSetting->Set( aValue );
+            break;
+            }
+        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	Mon Jan 18 20:18:27 2010 +0200
@@ -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/cpeincallearvolumesettingmonitor.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "cpeincallearvolumesettingmonitor.h"
+#include "mpephonemodelinternal.h"
+#include <centralrepository.h>
+#include <mpedatastore.h>
+#include <talogger.h>
+#include <telephonyvariant.hrh>
+#include <telincallvolcntrlcrkeys.h>
+
+
+// -----------------------------------------------------------------------------
+// CPEIncallEarVolumeSettingMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEIncallEarVolumeSettingMonitor* CPEIncallEarVolumeSettingMonitor::NewL(
+        MPEPhoneModelInternal& aModel )
+    {
+    CPEIncallEarVolumeSettingMonitor* self = new ( ELeave ) CPEIncallEarVolumeSettingMonitor( 
+        aModel );
+    CleanupStack::PushL( self );
+    self->ConstructL(); 
+    CleanupStack::Pop( self);
+    return ( self );
+    }
+
+// Destructor
+CPEIncallEarVolumeSettingMonitor::~CPEIncallEarVolumeSettingMonitor()
+    {
+    // Cancel() is called by base class destructor, which also deletes iRepository
+    }
+
+// -----------------------------------------------------------------------------
+// CPEIncallEarVolumeSettingMonitor::CPEIncallEarVolumeSettingMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEIncallEarVolumeSettingMonitor::CPEIncallEarVolumeSettingMonitor(
+        MPEPhoneModelInternal& aModel
+        ) : CPECenRepMonitor( KTelIncallEarVolume ),
+            iModel( aModel ),
+            iUpdateInProgress( EFalse )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEIncallEarVolumeSettingMonitor::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEIncallEarVolumeSettingMonitor::ConstructL()
+    {
+    BaseConstructL( KCRUidInCallVolume );
+
+    TInt volume = KPEDefaultAudioVolume; // Default setting
+    Get( volume );   
+    TEFLOGSTRING2( 
+        KTAREQOUT, 
+        "PE CPEIncallEarVolumeSettingMonitor::ConstructL, Incall ear volume = %d ",
+        volume );
+    // Write audio volume to EngineInfo.
+    iModel.DataStore()->SetAudioVolume( volume );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEIncallEarVolumeSettingMonitor::Set
+// -----------------------------------------------------------------------------
+//
+TInt CPEIncallEarVolumeSettingMonitor::Set(
+        TInt aValue )
+    {
+    TInt errorCode( KErrNone );
+
+    // Check whether this function call was initiated by a central repository
+    // change notification.
+    if( iUpdateInProgress == EFalse )
+        {
+        errorCode = iRepository->Set( iMonitorSetting, aValue );
+        TEFLOGSTRING3( KTAREQOUT, "PE CPEIncallEarVolumeSettingMonitor::Set \
+> CRepository::Set, Incall ear volume = %d, error code: %d", aValue, errorCode );
+        }
+
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEIncallEarVolumeSettingMonitor::UpdateL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEIncallEarVolumeSettingMonitor::UpdateL()
+    {
+    TInt volume;
+    // The headset volume has changed in repository.
+    // Retrieve the current volume from repository.
+    User::LeaveIfError( Get( volume ) );
+
+    TEFLOGSTRING2( 
+        KTAREQOUT,
+        "PE: CPEIncallEarVolumeSettingMonitor::UpdateL, Incall ear volume = %d ",
+        volume );
+
+    // Update headset volume using an audiohandling routine
+    // The routine will try to update the repository as well,
+    // ensure this is blocked using an internal flag.
+    iUpdateInProgress = ETrue;
+    iModel.DataStore()->SetAudioVolumeCommand( volume );
+    iModel.HandleInternalMessage( MPEPhoneModel::EPEMessageSetAudioVolume );
+
+    // Reset the flag when synchronization is complete
+    iUpdateInProgress = EFalse;
+
+    }
+    
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpeincallloudspeakervolumesettingmonitor.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,135 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "cpeincallloudspeakervolumesettingmonitor.h"
+#include "mpephonemodelinternal.h"
+#include <centralrepository.h>
+#include <mpedatastore.h>
+#include <talogger.h>
+#include <telephonyvariant.hrh>
+#include <telincallvolcntrlcrkeys.h>
+
+
+// -----------------------------------------------------------------------------
+// CPEIncallLoudspeakerVolumeSettingMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEIncallLoudspeakerVolumeSettingMonitor* CPEIncallLoudspeakerVolumeSettingMonitor::NewL(
+        MPEPhoneModelInternal& aModel
+        )
+    {
+    CPEIncallLoudspeakerVolumeSettingMonitor* me = 
+        new ( ELeave ) CPEIncallLoudspeakerVolumeSettingMonitor( aModel );
+    CleanupStack::PushL( me );
+    me->ConstructL(); 
+    CleanupStack::Pop( me );
+    return ( me );
+    }
+
+// Destructor
+CPEIncallLoudspeakerVolumeSettingMonitor::~CPEIncallLoudspeakerVolumeSettingMonitor()
+    {
+    // Cancel() is called by base class destructor, which also deletes iRepository
+    }
+
+// -----------------------------------------------------------------------------
+// CPEIncallLoudspeakerVolumeSettingMonitor::CPEIncallLoudspeakerVolumeSettingMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEIncallLoudspeakerVolumeSettingMonitor::CPEIncallLoudspeakerVolumeSettingMonitor(
+        MPEPhoneModelInternal& aModel
+        ) : CPECenRepMonitor( KTelIncallLoudspeakerVolume ),
+            iModel( aModel ),
+            iUpdateInProgress( EFalse )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEIncallLoudspeakerVolumeSettingMonitor::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEIncallLoudspeakerVolumeSettingMonitor::ConstructL()
+    {
+    BaseConstructL( KCRUidInCallVolume );
+
+    TInt volume = KPEDefaultAudioVolume; // Default setting
+    Get( volume );   
+    TEFLOGSTRING2( 
+        KTAREQOUT, 
+        "PE CPEIncallLoudspeakerVolumeSettingMonitor::ConstructL, Incall loudspeaker volume = %d ",
+        volume );
+    //In boot, cannot write volume value to datastore. It override HeadSet mode 
+    // volume ( default value ).
+    }
+
+// -----------------------------------------------------------------------------
+// CPEIncallLoudspeakerVolumeSettingMonitor::Set
+// -----------------------------------------------------------------------------
+//
+TInt CPEIncallLoudspeakerVolumeSettingMonitor::Set(
+        TInt aValue
+        )
+    {
+    TInt errorCode( KErrNone );
+
+    // Check whether this function call was initiated by a central repository
+    // change notification.
+    if( iUpdateInProgress == EFalse )
+        {
+        errorCode = iRepository->Set( iMonitorSetting, aValue );
+        TEFLOGSTRING3( KTAREQOUT, "PE CPEIncallLoudspeakerVolumeSettingMonitor::Set \
+> CRepository::Set, Incall loudspeaker volume = %d, error code: %d", aValue, errorCode );
+        }
+
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEIncallLoudspeakerVolumeSettingMonitor::UpdateL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEIncallLoudspeakerVolumeSettingMonitor::UpdateL()
+    {
+    TInt volume;
+    // The loudspeaker volume has changed in repository.
+    // Retrieve the current volume from repository.
+    User::LeaveIfError( Get( volume ) );
+
+    TEFLOGSTRING2( 
+        KTAREQOUT,
+        "PE CPEIncallLoudspeakerVolumeSettingMonitor::UpdateL, Incall loudspeaker volume = %d ",
+        volume );
+
+    // Update loudspeaker volume using an audiohandling routine
+    // The routine will try to update the repository as well,
+    // ensure this is blocked using an internal flag.
+    iUpdateInProgress = ETrue;
+    iModel.DataStore()->SetAudioVolumeCommand( volume );
+    iModel.HandleInternalMessage( MPEPhoneModel::EPEMessageSetAudioVolume );
+
+    // Reset the flag when synchronization is complete
+    iUpdateInProgress = EFalse;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpemanualcallcontrolhandler.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,2999 @@
+/*
+* 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 ( clientInformation.AllowMatch() && ( 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 );
+        }
+    else if ( clientInformation.Name().Length() )
+        {
+        iDataStore.SetRemoteName( clientInformation.Name(), aCallId );
+        }
+    
+    // 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();
+        }
+        
+    //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 <");
+    
+    if( iCallHandling.GetNumberOfCalls() == 1 )
+        {
+        // Check volume levels - zero level needs to be reset to default value
+        iGsmAudioData.SetDefaultVolume();
+        }
+    // 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;
+        }
+    else if( numberOfCalls == 1 )
+        {
+        // Check volume levels - zero level needs to be reset to default value
+        iGsmAudioData.SetDefaultVolume();
+        }
+    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();
+        }
+    }
+	
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpenetworkregistrationstatusmonitor.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,225 @@
+/*
+* 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 = FilterPostfix( 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::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;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,197 @@
+/*
+* 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,1471 @@
+/*
+* 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>
+
+// 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;
+        } 
+    }// ~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::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;
+
+        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 );
+        }
+    }// 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" );
+            // Start Idle State monitor to finalize ContactHandling contruction
+            iIdleStatusMonitor = CPEIdleStatusMonitor::NewL (*this );     
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 15.2" );
+
+            
+            break; 
+            }
+        case CPEPhoneModel::EPEMediatorCommandHandler:
+            {
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 16.1" );
+            // Start Mediator command listener
+            iMediatorCommunicationHandler = CPERemotePartyInfoMediator::NewL( *this );
+            
+            // This should be set after the last case
+            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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,179 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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/pepanic.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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/servicehandling/bwins/peservicehandlingu.def	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,9 @@
+EXPORTS
+	_ZN18CPEServiceHandling4NewLER21MPEPhoneModelInternal @ 1 NONAME
+	_ZN18CPEServiceHandling5NewLCER21MPEPhoneModelInternal @ 2 NONAME
+	_ZN18CPEServiceHandlingD0Ev @ 3 NONAME
+	_ZN18CPEServiceHandlingD1Ev @ 4 NONAME
+	_ZN18CPEServiceHandlingD2Ev @ 5 NONAME
+	_ZThn8_N18CPEServiceHandlingD0Ev @ 6 NONAME ; #<thunk>#
+	_ZThn8_N18CPEServiceHandlingD1Ev @ 7 NONAME ; #<thunk>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/servicehandling/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,42 @@
+/*
+* 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
+LIBRARY                 cch.lib	
+LIBRARY                 flogger.lib     // for logging
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/servicehandling/inc/cpeservicehandling.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,147 @@
+/*
+* 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 <cch.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 MCchServiceStatusObserver,
+                                         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;
+    
+    public: // from MCchServiceStatusObserver
+        
+        /**
+         * From MCchServiceStatusObserver.
+         * Signaled when service status or error changes.
+         *
+         * @param   aServiceId      Identifier of the service.
+         * @param   aType           Service type.
+         * @param   aServiceStatus  Service status.
+         */
+        void ServiceStatusChanged( TInt aServiceId, 
+                                   const TCCHSubserviceType aType,
+                                   const TCchServiceStatus& aServiceStatus );
+	private: // Constructors
+
+        /**
+         * C++ default constructor.
+         */
+        CPEServiceHandling( MPEPhoneModelInternal& aModel );
+        
+        /**
+         * By default Symbian 2nd phase constructor is private.
+         */
+        void ConstructL();
+	    
+    private: // functions
+    
+        /**
+         * Enable service, if not already enabled.
+         *
+         * @param  aState       Service state.
+         * @param  aService     Service.
+         * @return Error code.
+         */
+        TInt EnableServiceIfNeeded( const TCCHSubserviceState& aState, 
+                                    CCchService& aService );
+        /**
+        * Sends ServiceHandlingError message to PhoneEngine and saves 
+        * errorcode to member variable.
+        * 
+        * @param  aErrorCode, Cch errorcode.
+        */	    
+        void SendErrorMessage( TInt aErrorCode );
+       
+	private: // data
+	    
+	    /**
+	     * CCH client.
+	     * Own.
+	     */
+	    CCch* iCchClient;
+
+	    /**
+	     * 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,310 @@
+/*
+* 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" );
+    delete iCchClient;
+    }
+
+// ---------------------------------------------------------------------------
+// CPEServiceHandling::EnableService
+// ---------------------------------------------------------------------------
+//
+void CPEServiceHandling::EnableServiceL( TInt aServiceId )
+	{
+    TEFLOGSTRING( KTAREQIN, "PE CPEServiceHandling::EnableServiceL" );
+	
+    if ( !iCchClient )
+        {
+        iCchClient = CCch::NewL();
+        }
+
+	CCchService* service = iCchClient->GetService( aServiceId );
+	
+	TInt error( KErrNotFound );
+	if( service )
+		{
+		iCurrentServiceId = aServiceId;
+		
+		TCchServiceStatus serviceStatus;
+ 		error = service->GetStatus( ECCHVoIPSub, serviceStatus );
+		TCCHSubserviceState state = serviceStatus.State();
+	
+		if( error == KErrNone )
+		    {
+		    if ( serviceStatus.Error() == KErrNone )
+		        {
+		        error = EnableServiceIfNeeded( state, *service );
+		        }
+		    else
+		        {
+		        TEFLOGSTRING2( KTAERROR,
+		                "PE CPEServiceHandling::EnableServiceL, error: %d"
+		                , serviceStatus.Error() );
+		        SendErrorMessage( serviceStatus.Error());
+		        }
+    		}
+		}
+	
+	if ( error != KErrNone )
+	    {
+	    if ( error == KErrNotFound )
+	         {
+	         iModel.SendMessage( MEngineMonitor::EPEMessageNoService );
+	         }
+	     else
+	         {
+	         TEFLOGSTRING2( KTAERROR,
+	                  "PE CPEServiceHandling::EnableServiceL, Error: %d"
+	                  , error );
+	         SendErrorMessage( error );
+	         }
+	    }
+	
+	TEFLOGSTRING2( KTAINT, 
+            "PE CPEServiceHandling::EnableServiceL, error: %d", error );		
+	}
+
+// ---------------------------------------------------------------------------
+// CPEServiceHandling::EnableServiceIfNeeded
+// ---------------------------------------------------------------------------
+//
+TInt CPEServiceHandling::EnableServiceIfNeeded( 
+        const TCCHSubserviceState& aState, 
+        CCchService& aService )
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEServiceHandling::EnableServiceIfNeeded" );
+    TInt error = KErrNone;
+    
+    TEFLOGSTRING2( KTAINT, 
+            "PE CPEServiceHandling::EnableServiceIfNeeded, aState: %d", aState );
+    switch ( aState )
+        {
+        case ECCHEnabled:
+            {
+            iModel.SendMessage( MEngineMonitor::EPEMessageServiceEnabled );
+            }
+            break;
+        case ECCHUninitialized:
+        case ECCHDisabled:
+        case ECCHConnecting:
+            {
+            // Temporary solution, it will be fixed as soon as possible. 
+            // Message have to send before enable is called. Reason is so that progress bar 
+            //(global note) doesn't hide Networks's "Connection Needed" global note.
+            iModel.SendMessage( MEngineMonitor::EPEMessageServiceEnabling );
+            aService.AddObserver( *this );
+            error = aService.Enable( ECCHUnknown );  
+            }
+            break;
+        case ECCHDisconnecting:
+            {
+            error = KErrNotFound;
+            }
+            break;
+        default:
+            break;
+        }
+    TEFLOGSTRING2( KTAINT, 
+            "PE CPEServiceHandling::EnableServiceIfNeeded, error: %d", error );
+    return error;
+    }
+    
+// ---------------------------------------------------------------------------
+// CPEServiceHandling::ServiceStatusChanged
+// ---------------------------------------------------------------------------
+//
+void CPEServiceHandling::ServiceStatusChanged(
+    TInt aServiceId,
+	const TCCHSubserviceType aType,
+	const TCchServiceStatus& aServiceStatus )
+	{
+	TEFLOGSTRING( KTAINT, "PE CPEServiceHandling::ServiceStatusChanged <" );
+	
+	if( aServiceId == iCurrentServiceId && aType == ECCHVoIPSub )
+	    {
+    	TEFLOGSTRING3( KTAINT,
+    	        "PE CPEServiceHandling::ServiceStatusChanged, state: %d, error: %d"
+    	        , aServiceStatus.State()
+    	        , aServiceStatus.Error() );
+
+       	CCchService* service = iCchClient->GetService( aServiceId );
+       	if( service )
+       	    {
+    	    if( aServiceStatus.Error() != KErrNone )
+    	        {
+    	        TEFLOGSTRING( KTAERROR, 
+    	                "PE CPEServiceHandling::ServiceStatusChanged, error" );
+    	        SendErrorMessage( aServiceStatus.Error());
+    	        CancelServiceEnabling();
+    	        }
+    	    else 
+    	        {
+    	        if( aServiceStatus.State() == ECCHEnabled )
+    	            {
+                    TEFLOGSTRING( KTAINT, 
+                             "PE CPEServiceHandling::ServiceStatusChanged, enabled" );
+                    iModel.SendMessage( MEngineMonitor::EPEMessageServiceEnabled );
+    	            }
+
+
+    	        // Notify UI, that service is disabled.
+    	        else if( aServiceStatus.State() == ECCHDisabled ) 
+                     {
+                     TEFLOGSTRING( KTAERROR, 
+                              "PE CPEServiceHandling::ServiceStatusChanged, disabled" );
+                     iModel.SendMessage( MEngineMonitor::EPEMessageServiceDisabled );
+                     }
+    	        }
+    	    
+    	    // don't remove observer, if state are connecting or disconnecting
+    	    if ( aServiceStatus.State() != ECCHConnecting && 
+    	         aServiceStatus.State() != ECCHDisconnecting )
+    	        {
+    	        service->RemoveObserver( *this );
+    	        }
+       	    }//if( service )
+       	else
+       	    {
+            TEFLOGSTRING( KTAERROR, 
+                    "PE CPEServiceHandling::ServiceStatusChanged, no service" );
+       	    }
+	    }
+	TEFLOGSTRING( KTAINT, "PE CPEServiceHandling::ServiceStatusChanged >" );
+	}
+	
+// ---------------------------------------------------------------------------
+// CPEServiceHandling::CancelServiceEnabling
+// ---------------------------------------------------------------------------
+//
+void CPEServiceHandling::CancelServiceEnabling() const
+    {
+    TEFLOGSTRING( KTAREQIN, "PE CPEServiceHandling::CancelServiceEnabling" );
+    
+    if ( iCchClient )
+        {
+        CCchService* service = iCchClient->GetService( iCurrentServiceId );
+        
+        if ( service )
+            {
+            TCchServiceStatus serviceStatus;
+            TInt error = service->GetStatus( ECCHVoIPSub, serviceStatus );
+            TCCHSubserviceState state = serviceStatus.State();
+            
+            // Disable only, if service is connecting state
+            if ( error == KErrNone && state == ECCHConnecting )
+                {
+                TEFLOGSTRING( KTAREQOUT,
+                  "PE CPEServiceHandling::CancelServiceEnabling, CCchService->Disable" );
+                service->Disable( ECCHUnknown );
+                }
+            }
+        }
+    }
+		
+// -----------------------------------------------------------------------------
+// CPEServiceHandling::SendErrorMessage
+// -----------------------------------------------------------------------------
+//
+void CPEServiceHandling::SendErrorMessage(
+        TInt aErrorCode )
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEServiceHandling::SendErrorMessage, aErrorCode: %d", 
+        aErrorCode );
+
+    iModel.DataStore()->SetErrorCode( aErrorCode );
+    iModel.SendMessage( MEngineMonitor::EPEMessageServiceHandlingError );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEServiceHandling::DisableService
+// -----------------------------------------------------------------------------
+//
+void CPEServiceHandling::DisableService() const
+    {
+    TEFLOGSTRING( KTAREQIN, "PE CPEServiceHandling::DisableService" );
+
+    CCchService* service = iCchClient->GetService( iCurrentServiceId );
+    
+    if ( service )
+        {
+        TEFLOGSTRING( KTAREQOUT,
+          "PE CPEServiceHandling::DisableService, CCchService->Disable" );
+        service->Disable( ECCHUnknown );
+        }
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,22 @@
+/*
+* 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 "../telbranding/group/bld.inf"
+
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/telbranding/data/102078FA.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 1020 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 Branding plugin
+*
+*/
+
+
+#include "ecom/registryinfo.rh"
+#include "telbrandingconstants.hrh"
+// -----------------------------------------------------------------------------
+//   
+// Branding plug-in ecom resource file.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // telbranding.dll UID
+    dll_uid = KDllUid;
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // bubble extension interface UID
+            interface_uid = KInterfaceUid;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    // Branding plug-in implementation UID
+                    implementation_uid = KImplementationUid;
+                    version_no = 1;
+                    display_name = "Branding 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/telbranding/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Build information file for project branding plugin
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/telbranding.iby    CORE_APP_LAYER_IBY_EXPORT_PATH(telbranding.iby)
+
+PRJ_MMPFILES
+telbranding.mmp
+
+PRJ_TESTMMPFILES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/telbranding/group/telbranding.mmp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Project definition file for project branding plugin
+*
+*/
+
+
+#include <data_caging_paths.hrh>    
+#include <platform_paths.hrh>
+#include "telbrandingconstants.hrh"
+
+
+TARGET		  telbranding.dll
+TARGETTYPE	  PLUGIN
+UID			  0x10009d8d KDllUid
+CAPABILITY    CAP_ECOM_PLUGIN
+
+SOURCEPATH	  ../src
+SOURCE		  telbranding.cpp
+SOURCE        telbrandingsettingshandler.cpp
+SOURCE        telbrandingproxy.cpp
+SOURCE        telbrandingserverhandler.cpp
+SOURCE        telbrandingcallindicator.cpp
+SOURCE        telbrandingimage.cpp 
+SOURCE        telbrandingbubble.cpp
+
+USERINCLUDE	 . ../inc
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+SOURCEPATH              ../data
+START RESOURCE          102078FA.rss
+TARGET                  telbranding.rsc
+END
+
+LIBRARY                 ECom.lib
+LIBRARY                 serviceprovidersettings.lib
+LIBRARY	                euser.lib
+LIBRARY                 bmcustomization.lib
+LIBRARY                 bsclient.lib
+LIBRARY                 charconv.lib
+LIBRARY                 efsrv.lib
+LIBRARY                 eikcoctl.lib
+LIBRARY                 cone.lib
+LIBRARY                 AknSkins.lib
+LIBRARY                 aknicon.lib
+LIBRARY                 avkon.lib
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/telbranding/group/telbrandingconstants.hrh	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Allows to customize bubble with custom elements.
+*
+*/
+
+
+#ifndef TELBRANDINGCONSTANTS_H
+#define TELBRANDINGCONSTANTS_H
+
+// Dll uid
+#define KDllUid            0x102078FA
+
+// Ecom specific
+#define KImplementationUid 0x102078F9
+#define KInterfaceUid      0x102078F6
+
+#endif // TELBRANDINGCONSTANTS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/telbranding/inc/telbranding.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Sets brand according service id.
+*
+*/
+
+
+#ifndef __TELBRANDING_H__
+#define __TELBRANDING_H__
+
+//  Include Files
+#include <e32base.h>	// CBase
+#include <ecom.h>
+#include <telbubbleextension.h>
+
+//  Constants
+
+class CTelBrandingSettingsHandler;
+class CTelBrandingServerHandler;
+class CTelBrandingBubble;
+class CElement;
+
+//  Class Definitions
+class CTelBranding : public CTelBubbleExtension
+    {
+public:
+    static CTelBranding* NewL();
+
+    virtual ~CTelBranding();
+
+private: // new functions, example API
+// from CTelBubbleExtension
+
+    /** @see CTelBubbleExtension::InitializeL */
+    void InitializeL( MTelBubbleExtensionObserver& aBubbles );
+
+    /** @see CTelBubbleExtension::StartCustomizedBubble */
+    void StartCustomizedBubble(
+        MTelBubbleExtensionData& aCallData  );
+
+    /** @see CTelBubbleExtension::StopCustomizedBubble */
+    void StopCustomizedBubble(
+        MTelBubbleExtensionData& aCallData  );
+
+    /** @see CTelBubbleExtension::BubbleUpdating */
+    void BubbleUpdating();
+
+
+private: // new functions
+    void LoadBrandingL(
+        MTelBubbleExtensionData& aCallData );
+
+    CTelBranding();
+
+    void ConstructL();
+
+private: // data
+    MTelBubbleExtensionObserver* iObserver;
+
+    CTelBrandingSettingsHandler* iSettings;
+
+    RPointerArray<CTelBrandingBubble> iBubbleArray;
+    };
+
+#endif  // __TELBRANDING_H__
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/telbranding/inc/telbrandingbubble.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Wraps bubble into one class.
+*
+*/
+
+#ifndef C_CTELBRANDINGBUBBLE_H
+#define C_CTELBRANDINGBUBBLE_H
+
+#include <telbubblecustomelement.h>
+
+class MTelBubbleExtensionData;
+class CTelBrandingServerHandler;
+class CTelBubbleCustomElement;
+class MTelBubbleExtensionObserver;
+
+
+/**
+ *  Wraps bubble into one class.
+ *  Owns bubble images.
+ *
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CTelBrandingBubble ) : public CBase 
+    {
+public:
+    static CTelBrandingBubble* NewLC(
+        MTelBubbleExtensionData& aCallData, 
+        CTelBrandingServerHandler& aServer );
+
+    /**
+    * Destructor.
+    */
+    virtual ~CTelBrandingBubble();
+
+    
+public: // New functions
+    TInt BubbleId() const;
+
+    void AttachElements( MTelBubbleExtensionObserver& aObs ) const;
+
+    void DetechElements( MTelBubbleExtensionObserver& aObs ) const;
+    
+private:
+    /**
+     * Creates and adds elements into array
+     */
+    void CreateCallIndicationElementL( 
+            CTelBrandingServerHandler& aServer,
+            CTelBubbleCustomElement::TElementType aType );
+   
+    /**
+     * Creates and adds elements into array in priority order.
+     *  -Element with most highest priority last must be added last.
+     *  -Lowest priority first.
+     */
+    void AddBrandingImageWithPriorityL( 
+        const TDesC8& aImageType,
+        CTelBrandingServerHandler& aServer,
+        CTelBubbleCustomElement::TElementType aType );
+    
+    /**
+     * Helper, adds element to array
+     */
+    void AddElementToArrayL( CTelBubbleCustomElement* aElement );
+
+private:
+    CTelBrandingBubble( MTelBubbleExtensionData& aCallData );
+
+    void ConstructL( 
+        CTelBrandingServerHandler& aServer );
+
+private: // data
+    /**
+     * Bubble specific data
+     */
+    MTelBubbleExtensionData& iCallData;
+
+    /**
+     * Owned images
+     */
+    RPointerArray<CTelBubbleCustomElement> iElements;
+    };
+
+
+#endif // C_CTELBRANDINGBUBBLE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/telbranding/inc/telbrandingcallindicator.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Branding plug-in specific call indication.
+*
+*/
+
+#ifndef C_CTELBRANDINGCALLINDICATOR_H
+#define C_CTELBRANDINGCALLINDICATOR_H
+
+#include <telbubbleanim.h>
+
+class MTelBubbleExtensionData;
+class TAknsItemID;
+
+
+/**
+ *  Branding plug-in specific call indication.
+ *
+ *  @since S60 S60 v5.0
+ */
+NONSHARABLE_CLASS( CTelBrandingCallIndicator ) : 
+    public CTelBubbleAnim
+    {
+public:
+    /**
+    * Constructors.
+    */
+    static CTelBrandingCallIndicator* NewL( 
+        MTelBubbleExtensionData& aCallData, CEikImage* aBrand );
+    static CTelBrandingCallIndicator* NewLC( 
+        MTelBubbleExtensionData& aCallData, CEikImage* aBrand );
+
+    /**
+    * Destructor.
+    */
+    virtual ~CTelBrandingCallIndicator();
+
+public: // From CCoeControl
+    void MakeVisible( TBool aVisible );
+    void Draw(const TRect& aRect) const;
+    void SizeChanged();
+    
+private: // New functions
+    void DoVisibleL();
+    
+    void ShowAnimationL();
+    
+    void ShowImageL();
+    
+    void AddBrandedFrameToAnimationL(
+        TAknsItemID aSkinId, 
+        TInt aBitmap, 
+        TInt aMask );
+    
+    CEikImage* GetImageL(
+        TAknsItemID aSkinId, 
+        TInt aBitmap, 
+        TInt aMask );
+    
+    
+private:
+    CTelBrandingCallIndicator( 
+        MTelBubbleExtensionData& aCallData, CEikImage* aBrand );
+
+    void ConstructL();
+
+private: // data
+    // Call information
+    MTelBubbleExtensionData& iCallData;
+    
+    /**
+     * Brand image
+     * Own.
+     */
+    CEikImage* iBrand;
+    
+    /**
+     * Call indicator image
+     * Own.
+     */
+    CEikImage* iCallIndicator;
+    };
+
+#endif // C_CTELBRANDINGCALLINDICATOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/telbranding/inc/telbrandingimage.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Branding plug-in specific image.
+*
+*/
+
+#ifndef C_CTELBRANDINGIMAGE_H
+#define C_CTELBRANDINGIMAGE_H
+
+#include <telbubbleimage.h>
+
+/**
+ *  Used to handle CTelBrandingImage visibility.
+ *  Only one image is shown at one time according priority
+ *
+ *  @since S60 S60 v5.0
+ */
+NONSHARABLE_CLASS( MTelBrandingPriorityHandler )
+    {
+public:
+    virtual void SetVisibilityAllowed( TBool aAllowed ) = 0;
+    
+    };
+
+/**
+ *  Branding plug-in specific image.
+ *  Uses MTelBrandingPriorityHandler to handle visibility.
+ *  Only one image is shown at one time according priority
+ *
+ *  @since S60 S60 v5.0
+ */
+NONSHARABLE_CLASS( CTelBrandingImage ): 
+    public CTelBubbleImage,
+    public MTelBrandingPriorityHandler
+    {
+public:
+    /**
+    * Constructors.
+    */
+    static CTelBrandingImage* NewL();
+    static CTelBrandingImage* NewLC();
+
+    /**
+    * Destructor.
+    */
+    virtual ~CTelBrandingImage();
+
+public: // From CCoeControl
+    void MakeVisible( TBool aVisible );
+    
+public: // From MTelBrandingPriorityHandler
+    void SetVisibilityAllowed( TBool aAllowed );
+    
+public: // New functions
+    void SetLowerPriorityBranding( MTelBrandingPriorityHandler* aHandler );
+    
+private:
+    CTelBrandingImage();
+
+    void ConstructL();
+
+private: // data
+    // Specifies that is visiblity allowed
+    TBool iVisibilityAllowed;
+    
+    // Specifies lower priority image
+    MTelBrandingPriorityHandler* iLowerPriority;
+    };
+
+#endif // C_CTELBRANDINGIMAGE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/telbranding/inc/telbrandingserverhandler.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,73 @@
+/*
+* 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:  Sets brand according service id.
+*
+*/
+
+#ifndef __TELBRANDINGSERVERHANDLER_H__
+#define __TELBRANDINGSERVERHANDLER_H__
+
+//  Include Files
+#include <e32base.h>	// CBase
+
+//  Constants
+
+class CFbsBitmap;
+class MBSAccess;
+class CBSFactory;
+
+//  Class Definitions
+class CTelBrandingServerHandler : public CBase
+    {
+public:
+    /**
+     * Constructs branding server and creates access
+     * @param aBrandId Specifies brand which is used
+     */
+    static CTelBrandingServerHandler* NewLC( const TDesC8& aBrandId );
+    
+    virtual ~CTelBrandingServerHandler();
+
+    /**
+     * Gets brand bitmap and mask according parameters
+     * @param aImageId Specifies brand image which is wanted
+     * @param aBitmap On succesful return contains bitmap
+     * @param aBitmask On succesful return contains mask
+     * @leave If brand not found or other error situations
+     */
+    void GetBrandIconL( 
+        const TDesC8& aImageId,
+        CFbsBitmap*& aBitmap,
+        CFbsBitmap*& aBitmask ) const;
+    
+private: // new functions
+    CTelBrandingServerHandler();
+    void ConstructL( const TDesC8& aBrandId );
+
+private: // data
+    
+    /**
+     * Own.
+     */
+    MBSAccess* iAccess;
+    
+    /**
+     * Own.
+     */
+    CBSFactory* iFactory;
+    };
+
+#endif  // __TELBRANDINGSERVERHANDLER_H__
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/telbranding/inc/telbrandingsettingshandler.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* 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:  Sets brand according service id.
+*
+*/
+
+
+#ifndef __TELBRANDINGSETTINGSHANDLER_H__
+#define __TELBRANDINGSETTINGSHANDLER_H__
+
+//  Include Files
+#include <e32base.h>	// CBase
+
+//  Constants
+
+
+//  Class Definitions
+class CTelBrandingSettingsHandler : public CBase
+    {
+public:
+    static CTelBrandingSettingsHandler* NewL();
+    
+    virtual ~CTelBrandingSettingsHandler();
+
+    HBufC* BrandIdLC( TUint32 aServiceId ) const;
+private: // new functions
+    CTelBrandingSettingsHandler();
+    void ConstructL();
+
+private: // data
+    };
+
+#endif  // __TELBRANDINGSETTINGSHANDLER_H__
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/telbranding/rom/telbranding.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* 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:  IBY file for telbranding
+*
+*/
+
+
+#ifndef TELBRANDING_IBY
+#define TELBRANDING_IBY
+
+ECOM_PLUGIN( telbranding.dll, 102078F8.rsc )
+
+#endif // TELBRANDING_IBY
+
+//  End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/telbranding/sis/telbranding.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,36 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: Installation file for telbranding dll
+;
+; 
+;
+; This is an auto-generated PKG file by Carbide.
+; This file uses variables specific to Carbide builds that will not work
+; on command-line builds. If you want to use this generated PKG file from the
+; command-line tools you will need to modify the variables with the appropriate
+; values: $(EPOCROOT), $(PLATFORM), $(TARGET)
+
+;
+; UID is the dll's UID
+;
+#{"telbranding DLL"},(0x0AE7DF0B),1,0,0
+
+
+;Localised Vendor name
+%{"Vendor-EN"}
+
+;Unique Vendor name
+:"Vendor"
+
+"$(EPOCROOT)Epoc32\release\$(PLATFORM)\$(TARGET)\telbranding.dll"		  -"!:\sys\bin\telbranding.dll"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/telbranding/src/telbranding.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,147 @@
+/*
+* 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:  Sets brand according service id.
+*
+*/
+
+
+//  Include Files
+#include <telbubbleextensionobserver.h>
+#include <telbubbleextensiondata.h>
+#include <telbubblecustomelement.h>
+#include <utf.h>
+
+#include "telbranding.h"	// Ctelbranding
+#include "telbrandingsettingshandler.h"
+#include "telbrandingserverhandler.h"
+#include "telbrandingbubble.h"
+
+//  Member Functions
+
+// ---------------------------------------------------------
+// CTelBranding::NewL
+// ---------------------------------------------------------
+//
+CTelBranding* CTelBranding::NewL()
+    {
+    CTelBranding* self = new (ELeave) CTelBranding();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CTelBranding::CTelBranding
+// ---------------------------------------------------------
+//
+CTelBranding::CTelBranding()
+    {
+    }
+
+// ---------------------------------------------------------
+// CTelBranding::ConstructL
+// ---------------------------------------------------------
+//
+void CTelBranding::ConstructL()
+    {
+    iSettings = CTelBrandingSettingsHandler::NewL();
+    }
+
+// ---------------------------------------------------------
+// CTelBranding:::~CTelBranding
+// ---------------------------------------------------------
+//
+CTelBranding::~CTelBranding()
+    {
+    delete iSettings;
+    iBubbleArray.ResetAndDestroy();
+    iBubbleArray.Close();
+    }
+
+// ---------------------------------------------------------
+// CTelBranding::InitializeL
+// ---------------------------------------------------------
+//
+void CTelBranding::InitializeL( MTelBubbleExtensionObserver& aBubbles )
+    {
+    iObserver = &aBubbles;
+    }
+
+// ---------------------------------------------------------
+// CTelBranding::StartCustomizedBubble
+// ---------------------------------------------------------
+//
+void CTelBranding::StartCustomizedBubble(
+    MTelBubbleExtensionData& aCallData  )
+    {
+    TRAP_IGNORE( LoadBrandingL( aCallData ) );
+    }
+
+// ---------------------------------------------------------
+// CTelBranding::StopCustomizedBubble
+// ---------------------------------------------------------
+//
+void CTelBranding::StopCustomizedBubble(
+    MTelBubbleExtensionData& aCallData  )
+    {
+    for( TInt i = 0; i < iBubbleArray.Count(); i++ )
+        {
+        if( iBubbleArray[i]->BubbleId() == aCallData.BubbleId() )
+            {
+            iBubbleArray[i]->DetechElements( *iObserver );
+
+            delete iBubbleArray[i];
+            iBubbleArray.Remove(i);
+            i--;
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CTelBranding::BubbleUpdating
+// ---------------------------------------------------------
+//
+void CTelBranding::BubbleUpdating()
+    {
+    // Do nothing
+    }
+
+// ---------------------------------------------------------
+// CTelBranding::LoadBrandingL
+// ---------------------------------------------------------
+//
+void CTelBranding::LoadBrandingL( MTelBubbleExtensionData& aCallData )
+    {
+    HBufC* brandid = iSettings->BrandIdLC( aCallData.ServiceId() );
+    HBufC8* brandid8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( *brandid );
+    CleanupStack::PopAndDestroy( brandid );
+    CleanupStack::PushL( brandid8 );
+    
+    CTelBrandingServerHandler* bserver = 
+        CTelBrandingServerHandler::NewLC( *brandid8 );
+    
+    CTelBrandingBubble* bubble = 
+        CTelBrandingBubble::NewLC( aCallData, *bserver );
+        
+    iBubbleArray.AppendL( bubble );
+    
+    CleanupStack::Pop( bubble );
+    CleanupStack::PopAndDestroy( bserver );
+    CleanupStack::PopAndDestroy( brandid8 );
+    
+    bubble->AttachElements( *iObserver );
+    }
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/telbranding/src/telbrandingbubble.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,225 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 bubble into one class.
+*
+*/
+
+#include "telbrandingbubble.h"
+#include "telbrandingcallindicator.h"
+#include "telbrandingserverhandler.h"
+#include "telbrandingimage.h"
+
+#include <telbubbleextensionobserver.h>
+#include <telbubbleextensiondata.h>
+#include <telbubblecustomelement.h>
+#include <telbubbleimage.h>
+
+// ======== CONSTANTS ========
+_LIT8( KBrandImageId, "bubble_manager_brand_image" );
+_LIT8( KCallIndicatorImageId, "bubble_manager_call_indicator_image" );
+
+
+// ======== LOCAL FUNCTIONS ========
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CTelBrandingBubble::CTelBrandingBubble
+// ---------------------------------------------------------------------------
+//
+CTelBrandingBubble::CTelBrandingBubble( MTelBubbleExtensionData& aCallData ) :
+    iCallData( aCallData )
+    {
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CTelBrandingBubble::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CTelBrandingBubble::ConstructL(
+    CTelBrandingServerHandler& aServer )
+    {
+    // Branded call indication
+    TRAP_IGNORE( 
+        CreateCallIndicationElementL( 
+            aServer, 
+            CTelBubbleCustomElement::ESmallCallIndicator ); 
+        
+        CreateCallIndicationElementL( 
+            aServer, 
+            CTelBubbleCustomElement::EBigCallIndicator ); 
+        )
+    
+    if( !iElements.Count() )
+        {
+        // Basic brand image
+        TRAP_IGNORE( AddBrandingImageWithPriorityL( 
+                KBrandImageId, 
+                aServer, 
+                CTelBubbleCustomElement::EBrandImage ); 
+            )
+        }
+
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBrandingBubble::NewLC
+// ---------------------------------------------------------------------------
+//
+CTelBrandingBubble* CTelBrandingBubble::NewLC(
+    MTelBubbleExtensionData& aCallData, 
+    CTelBrandingServerHandler& aServer )
+    {
+    CTelBrandingBubble* self = new( ELeave ) CTelBrandingBubble( aCallData );
+    CleanupStack::PushL( self );
+    self->ConstructL( aServer );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CTelBrandingBubble::~CTelBrandingBubble
+// ---------------------------------------------------------------------------
+//
+CTelBrandingBubble::~CTelBrandingBubble()
+    {
+    iElements.ResetAndDestroy();
+    iElements.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBrandingBubble::CreateCallIndicationElementL
+// ---------------------------------------------------------------------------
+//
+void CTelBrandingBubble::CreateCallIndicationElementL( 
+    CTelBrandingServerHandler& aServer,
+    CTelBubbleCustomElement::TElementType aType )
+    {
+    CFbsBitmap* bitmap = NULL;
+    CFbsBitmap* mask = NULL;
+    
+    // Call indicator
+    aServer.GetBrandIconL( 
+        KCallIndicatorImageId,
+        bitmap,
+        mask );
+    
+    CEikImage* image = new(ELeave) CEikImage;
+    image->SetPicture( bitmap, mask );
+    CleanupStack::PushL( image );
+
+    CTelBrandingCallIndicator* indicator = 
+        CTelBrandingCallIndicator::NewL( iCallData, image );
+    
+    CleanupStack::Pop( image );
+    CleanupStack::PushL( indicator );
+    
+    CTelBubbleCustomElement* customElement =
+        CTelBubbleCustomElement::NewL( indicator, aType );
+    
+    CleanupStack::Pop( indicator );
+    
+    AddElementToArrayL( customElement );
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBrandingBubble::AddBrandingImageWithPriorityL
+// ---------------------------------------------------------------------------
+//
+void CTelBrandingBubble::AddBrandingImageWithPriorityL( 
+    const TDesC8& aImageType,
+    CTelBrandingServerHandler& aServer,
+    CTelBubbleCustomElement::TElementType aType )
+    {
+    CTelBrandingImage* image = 
+        CTelBrandingImage::NewLC();
+    
+    CFbsBitmap* bitmap = NULL;
+    CFbsBitmap* mask = NULL;
+    
+    aServer.GetBrandIconL( 
+        aImageType,
+        bitmap,
+        mask );
+    
+    image->SetPicture( bitmap, mask );
+    
+    CTelBubbleCustomElement* customElement =
+        CTelBubbleCustomElement::NewL( image, aType );
+    
+    CleanupStack::Pop( image );
+
+    TInt lowerIndex = iElements.Count()-1;
+    if( lowerIndex != KErrNotFound )
+        {
+        // Set previous element to lower priority
+        CTelBrandingImage* lowerImage = 
+            static_cast<CTelBrandingImage*>( iElements[lowerIndex]->Control() );
+        image->SetLowerPriorityBranding( lowerImage );
+        }
+    
+    AddElementToArrayL( customElement );
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBrandingBubble::AddElementToArrayL
+// ---------------------------------------------------------------------------
+//
+void CTelBrandingBubble::AddElementToArrayL( CTelBubbleCustomElement* aElement )
+    {
+    CleanupStack::PushL( aElement );
+
+    iElements.AppendL( aElement );
+
+    CleanupStack::Pop( aElement );
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBrandingBubble::BubbleId
+// ---------------------------------------------------------------------------
+//
+TInt CTelBrandingBubble::BubbleId() const
+    {
+    return iCallData.BubbleId();
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBrandingBubble::AttachElements
+// ---------------------------------------------------------------------------
+//
+void CTelBrandingBubble::AttachElements( MTelBubbleExtensionObserver& aObs ) const
+    {
+    for( TInt i = 0; i < iElements.Count(); i++ )
+        {
+        aObs.AttachElement(
+            BubbleId(), iElements[i] );
+        }
+    
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBrandingBubble::DetechElements
+// ---------------------------------------------------------------------------
+//
+void CTelBrandingBubble::DetechElements( MTelBubbleExtensionObserver& aObs ) const
+    {
+    for( TInt i = 0; i < iElements.Count(); i++ )
+        {
+        aObs.DetachElement(
+            BubbleId(), iElements[i] );
+        }
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/telbranding/src/telbrandingcallindicator.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Branding specific call indication.
+*
+*/
+
+#include <telbubbleextensiondata.h>
+#include <AknsUtils.h>
+#include <eikimage.h>
+#include <callstatus.mbg> // From bubblemanager
+#include <aknconsts.h>
+#include <AknBitmapAnimation.h>  // Animation definition
+#include <AknUtils.h>
+
+#include "telbrandingcallindicator.h"
+
+
+// ======== LOCAL FUNCTIONS ========
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CTelBrandingCallIndicator::CTelBrandingCallIndicator
+// ---------------------------------------------------------------------------
+//
+CTelBrandingCallIndicator::CTelBrandingCallIndicator( 
+    MTelBubbleExtensionData& aCallData, CEikImage* aBrand ) :
+    iCallData( aCallData ),
+    iBrand( aBrand ),
+    iCallIndicator( NULL )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CTelBrandingCallIndicator::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CTelBrandingCallIndicator::ConstructL()
+    {
+    CTelBubbleAnim::ConstructL( 500 );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CTelBrandingCallIndicator::NewL
+// ---------------------------------------------------------------------------
+//
+CTelBrandingCallIndicator* CTelBrandingCallIndicator::NewL(
+    MTelBubbleExtensionData& aCallData, CEikImage* aBrand )
+    {
+    CTelBrandingCallIndicator* self = 
+        CTelBrandingCallIndicator::NewLC( aCallData, aBrand );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CTelBrandingCallIndicator::NewLC
+// ---------------------------------------------------------------------------
+//
+CTelBrandingCallIndicator* CTelBrandingCallIndicator::NewLC(
+    MTelBubbleExtensionData& aCallData, CEikImage* aBrand )
+    {
+    CTelBrandingCallIndicator* self = 
+        new( ELeave ) CTelBrandingCallIndicator( aCallData, aBrand );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CTelBrandingCallIndicator::~CTelBrandingCallIndicator
+// ---------------------------------------------------------------------------
+//
+CTelBrandingCallIndicator::~CTelBrandingCallIndicator()
+    {
+    delete iBrand;
+    delete iCallIndicator;
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBrandingCallIndicator::MakeVisible
+// ---------------------------------------------------------------------------
+//
+void CTelBrandingCallIndicator::MakeVisible( TBool aVisible )
+    {
+    CTelBubbleAnim::MakeVisible( aVisible );
+
+    if( aVisible )
+        {
+        TRAP_IGNORE( DoVisibleL() );
+        }
+    else
+        {
+        StopAnimation();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBrandingCallIndicator::Draw
+// ---------------------------------------------------------------------------
+//
+void CTelBrandingCallIndicator::Draw( const TRect& /*aRect*/ ) const
+    {
+    CWindowGc& gc = SystemGc();
+    
+    // Position is botton right corner minus image size
+    TPoint brandPlace = Rect().iBr - iBrand->MinimumSize();
+    TPoint callIndPlace = Rect().iTl;
+
+    if( AknLayoutUtils::LayoutMirrored() )
+        {
+        // Fix position when arabic variant is in use
+        brandPlace.iX = Rect().iTl.iX;
+        
+        if( iCallIndicator )
+            {
+            callIndPlace.iX = Rect().iBr.iX - iCallIndicator->MinimumSize().iWidth;
+            }
+        
+        }
+    
+    gc.BitBltMasked( brandPlace,
+                     iBrand->Bitmap(),
+                     iBrand->MinimumSize(),
+                     iBrand->Mask(),
+                     ETrue );
+    
+    if( iCallIndicator )
+        {
+        gc.BitBltMasked( callIndPlace,
+            iCallIndicator->Bitmap(),
+            iCallIndicator->MinimumSize(),
+            iCallIndicator->Mask(),
+            ETrue );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBrandingCallIndicator::SizeChanged
+// ---------------------------------------------------------------------------
+//
+void CTelBrandingCallIndicator::SizeChanged()
+    {
+    CCoeControl::SizeChanged();
+    TPoint place = Rect().iTl;
+    
+    TSize imageSize = Rect().Size();
+    imageSize.iHeight /= 1.5;
+    imageSize.iWidth /= 1.5;
+
+    if( AknLayoutUtils::LayoutMirrored() )
+        {
+        // Fix position when arabic variant is in use
+        place.iX = Rect().iBr.iX - imageSize.iWidth;
+        }
+    
+    iAnimation->SetRect( TRect( place, imageSize ) );
+    
+    if ( iBrand->Bitmap() )
+        {
+        AknIconUtils::SetSize( 
+            const_cast<CFbsBitmap*> ( iBrand->Bitmap() ), 
+            imageSize );
+        }
+    
+    if ( iCallIndicator )
+        {
+        AknIconUtils::SetSize( 
+            const_cast<CFbsBitmap*> ( iCallIndicator->Bitmap() ), 
+            imageSize );
+        }
+    
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBrandingCallIndicator::DoVisibleL
+// ---------------------------------------------------------------------------
+//
+void CTelBrandingCallIndicator::DoVisibleL()
+    {
+    Reset();
+    delete iCallIndicator;
+    iCallIndicator = NULL;
+    
+    switch( iCallData.State() )
+        {
+        case MTelBubbleExtensionData::EOnHold:
+            // Show icon
+            iCallIndicator = GetImageL( 
+                KAknsIIDQgnIndiCallHeld,
+                EMbmCallstatusQgn_indi_call_held,
+                EMbmCallstatusQgn_indi_call_held_mask );
+            break;
+        case MTelBubbleExtensionData::EAlertToDisconnected:
+        case MTelBubbleExtensionData::EDisconnected:
+            // Show icon
+            iCallIndicator = GetImageL( 
+                KAknsIIDQgnIndiCallDisconn,
+                EMbmCallstatusQgn_indi_call_disconn,
+                EMbmCallstatusQgn_indi_call_disconn_mask );
+            break;
+        case MTelBubbleExtensionData::EOutgoing:
+        case MTelBubbleExtensionData::EActive:
+            // Show icon
+            iCallIndicator = GetImageL( 
+                KAknsIIDQgnIndiCallActive,
+                EMbmCallstatusQgn_indi_call_active,
+                EMbmCallstatusQgn_indi_call_active_mask );
+            break;
+        case MTelBubbleExtensionData::EIncoming:
+        case MTelBubbleExtensionData::EWaiting:
+        case MTelBubbleExtensionData::EAlerting:
+            // frame 1
+            AddBrandedFrameToAnimationL( 
+                KAknsIIDQgnIndiCallActive,
+                EMbmCallstatusQgn_indi_call_active,
+                EMbmCallstatusQgn_indi_call_active_mask );
+            
+            // frame 2
+            AddBrandedFrameToAnimationL( 
+                KAknsIIDQgnIndiCallActive2,
+                EMbmCallstatusQgn_indi_call_active_2,
+                EMbmCallstatusQgn_indi_call_active_2_mask );
+            break;
+            
+        case MTelBubbleExtensionData::ENone:
+        default:
+            // Do nothing
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBrandingCallIndicator::ShowAnimationL
+// ---------------------------------------------------------------------------
+//
+void CTelBrandingCallIndicator::ShowAnimationL()
+    {
+
+
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBrandingCallIndicator::ShowImageL
+// ---------------------------------------------------------------------------
+//
+void CTelBrandingCallIndicator::ShowImageL()
+    {
+
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBrandingCallIndicator::AddBrandedFrameToAnimationL
+// ---------------------------------------------------------------------------
+//
+void CTelBrandingCallIndicator::AddBrandedFrameToAnimationL( 
+    TAknsItemID aSkinId, TInt aBitmap, TInt aMask )
+    {
+    CEikImage* image = GetImageL( aSkinId, aBitmap, aMask );
+    AddFrameToAnimationLD( image );
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBrandingCallIndicator::GetImageL
+// ---------------------------------------------------------------------------
+//
+CEikImage* CTelBrandingCallIndicator::GetImageL(
+    TAknsItemID aSkinId, 
+    TInt aBitmap, 
+    TInt aMask )
+    {
+    CFbsBitmap* bitmap;
+    CFbsBitmap* mask;
+    
+    CEikImage* image = new(ELeave) CEikImage;
+    CleanupStack::PushL( image );
+        
+    AknsUtils::CreateIconL( 
+        AknsUtils::SkinInstance(),
+        aSkinId,
+        bitmap,
+        mask,
+        KCallStatusBitmapFile,
+        aBitmap,
+        aMask
+        );
+
+    image->SetPicture( bitmap, mask );
+    
+    CleanupStack::Pop( image );
+    return image;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/telbranding/src/telbrandingimage.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,144 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Branding specific image.
+*
+*/
+
+
+#include "telbrandingimage.h"
+
+
+// ======== LOCAL FUNCTIONS ========
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CTelBrandingImage::CTelBrandingImage
+// ---------------------------------------------------------------------------
+//
+CTelBrandingImage::CTelBrandingImage() :
+    iVisibilityAllowed( ETrue )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CTelBrandingImage::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CTelBrandingImage::ConstructL()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CTelBrandingImage::NewL
+// ---------------------------------------------------------------------------
+//
+CTelBrandingImage* CTelBrandingImage::NewL()
+    {
+    CTelBrandingImage* self = CTelBrandingImage::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CTelBrandingImage::NewLC
+// ---------------------------------------------------------------------------
+//
+CTelBrandingImage* CTelBrandingImage::NewLC()
+    {
+    CTelBrandingImage* self = new( ELeave ) CTelBrandingImage;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CTelBrandingImage::~CTelBrandingImage
+// ---------------------------------------------------------------------------
+//
+CTelBrandingImage::~CTelBrandingImage()
+    {
+
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBrandingImage::MakeVisible
+// ---------------------------------------------------------------------------
+//
+void CTelBrandingImage::MakeVisible( TBool aVisible )
+    {
+    if( iVisibilityAllowed && iLowerPriority )
+        {
+        // Inform lower priority element
+        //  - Allow to be shown when this is not shown
+        //  - Dont allow to show when this is shown
+        iLowerPriority->SetVisibilityAllowed( !aVisible );
+        }
+    
+    if( aVisible )
+        {
+        if( iVisibilityAllowed )
+            {
+            // Make visible since its allowed
+            CTelBubbleImage::MakeVisible( aVisible );
+            }
+        else
+            {
+            // Do nothing when visibilty not allowed
+            }
+        }
+    else
+        {
+        // Always make not visible
+        CTelBubbleImage::MakeVisible( aVisible );
+        }
+
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBrandingImage::SetVisibilityAllowed
+// ---------------------------------------------------------------------------
+//
+void CTelBrandingImage::SetVisibilityAllowed( TBool aAllowed )
+    {
+    iVisibilityAllowed = aAllowed;
+    
+    if( iLowerPriority )
+        {
+        // Inform lower priority elements
+        iLowerPriority->SetVisibilityAllowed( aAllowed );
+        }
+    
+    if( IsVisible() && !iVisibilityAllowed )
+        {
+        // If visible and visibility not allowed
+        CTelBubbleImage::MakeVisible( EFalse );
+        }
+    
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBrandingImage::SetLowerPriorityBranding
+// ---------------------------------------------------------------------------
+//
+void CTelBrandingImage::SetLowerPriorityBranding( 
+    MTelBrandingPriorityHandler* aHandler )
+    {
+    iLowerPriority = aHandler;
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/telbranding/src/telbrandingproxy.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  ecom proxyfile        
+*
+*/
+
+
+
+#include <e32base.h>
+#include <implementationproxy.h>
+#include "telbrandingconstants.hrh"
+
+#include "telbranding.h"
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// TImplementationProxy::ImplementationTable
+// ---------------------------------------------------------------------------
+//
+const TImplementationProxy ImplementationTable[] = 
+    {
+    IMPLEMENTATION_PROXY_ENTRY( KImplementationUid, CTelBranding::NewL )
+    };
+
+// ---------------------------------------------------------------------------
+// TImplementationProxy::ImplementationGroupProxy
+// ---------------------------------------------------------------------------
+//
+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/phoneplugins/telbranding/src/telbrandingserverhandler.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,105 @@
+/*
+* 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:  Sets brand according service id.
+*
+*/
+
+
+//  Include Files  
+#include "telbrandingserverhandler.h"	// CTelBrandingServerHandler
+#include <mbsaccess.h>
+#include <mbselement.h>
+#include <cbsfactory.h>
+#include <cbsbitmap.h>
+#include <barsread.h>
+
+_LIT8( KApplicationId, "xsp" );
+_LIT8( KDefaultBrandId, "xsp" );
+
+//  Member Functions
+
+// ---------------------------------------------------------
+// CTelBrandingServerHandler::NewL
+// ---------------------------------------------------------
+//
+CTelBrandingServerHandler* CTelBrandingServerHandler::NewLC( 
+    const TDesC8& aBrandId )
+    {
+    CTelBrandingServerHandler* self = 
+        new (ELeave) CTelBrandingServerHandler();
+    
+    CleanupStack::PushL( self );
+    self->ConstructL( aBrandId );
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CTelBrandingServerHandler::CTelBrandingServerHandler
+// ---------------------------------------------------------
+//
+CTelBrandingServerHandler::CTelBrandingServerHandler() :
+    iAccess( NULL ),
+    iFactory( NULL )
+    {
+    }
+
+// ---------------------------------------------------------
+// CTelBrandingServerHandler::ConstructL
+// ---------------------------------------------------------
+//
+void CTelBrandingServerHandler::ConstructL( const TDesC8& aBrandId )
+    {
+    TInt languageId( ELangInternationalEnglish );
+    
+    // connect to branding server
+    iFactory = CBSFactory::NewL( 
+        KDefaultBrandId,
+        KApplicationId );
+
+    
+    // Create access to Branding server
+    iAccess = iFactory->CreateAccessL( aBrandId, 
+        TLanguage( languageId ) );
+    }
+
+// ---------------------------------------------------------
+// CTelBrandingServerHandler::GetBrandIconL
+// ---------------------------------------------------------
+//
+void CTelBrandingServerHandler::GetBrandIconL( 
+    const TDesC8& aImageId,
+    CFbsBitmap*& aBitmap,
+    CFbsBitmap*& aBitmask ) const
+    {
+    // Fetch brand image
+    iAccess->GetBitmapL( aImageId, aBitmap, aBitmask );
+    }
+
+// ---------------------------------------------------------
+// CTelBrandingServerHandler:::~CTelBrandingServerHandler
+// ---------------------------------------------------------
+//
+CTelBrandingServerHandler::~CTelBrandingServerHandler()
+    {
+    if( iAccess )
+        {
+        iAccess->Close();
+        }
+
+    delete iFactory;
+    }
+
+
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/telbranding/src/telbrandingsettingshandler.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Sets brand according service id.
+*
+*/
+
+
+//  Include Files  
+#include "telbrandingsettingshandler.h"	// CTelBrandingSettingHandler
+#include <spsettings.h>
+#include <spproperty.h>
+
+//  Member Functions
+
+// ---------------------------------------------------------
+// CTelBrandingSettingsHandler::NewL
+// ---------------------------------------------------------
+//
+CTelBrandingSettingsHandler* CTelBrandingSettingsHandler::NewL()
+    {
+    CTelBrandingSettingsHandler* self = 
+        new (ELeave) CTelBrandingSettingsHandler();
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CTelBrandingSettingsHandler::CTelBrandingSettingsHandler
+// ---------------------------------------------------------
+//
+CTelBrandingSettingsHandler::CTelBrandingSettingsHandler()
+    {
+    }
+
+// ---------------------------------------------------------
+// CTelBrandingSettingsHandler::ConstructL
+// ---------------------------------------------------------
+//
+void CTelBrandingSettingsHandler::ConstructL()
+    {
+
+    }
+
+// ---------------------------------------------------------
+// CTelBrandingSettingsHandler::BrandId
+// ---------------------------------------------------------
+//
+HBufC* CTelBrandingSettingsHandler::BrandIdLC( TUint32 aServiceId ) const
+    {
+    HBufC* ret = HBufC::NewLC( KSPMaxDesLength );
+    TPtr ptr( ret->Des() );
+    CSPSettings* settings = CSPSettings::NewLC();
+    CSPProperty* property = CSPProperty::NewLC();
+    
+    User::LeaveIfError( settings->FindPropertyL( aServiceId, 
+        EPropertyBrandId, *property) );
+    
+    User::LeaveIfError( property->GetValue( ptr ) );
+    
+    CleanupStack::PopAndDestroy( property );
+    CleanupStack::PopAndDestroy( settings );
+    
+    return ret;
+    }
+
+// ---------------------------------------------------------
+// CTelBrandingSettingsHandler:::~CTelBrandingSettingsHandler
+// ---------------------------------------------------------
+//
+CTelBrandingSettingsHandler::~CTelBrandingSettingsHandler()
+    {
+
+    }
+
+
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/aiwcallimageplugin/data/102823d0.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* 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:  ECom resource file for aiwcallimageplugin.
+*
+*/
+
+
+
+//  INCLUDES
+#include    <registryinfov2.rh>
+#include    <AiwCommon.hrh>
+#include    "aiwcallimageplugin.hrh"
+
+
+//  RESOURCE DEFINITIONS 
+
+// -----------------------------------------------------------------------------
+//   
+// theInfo
+// ECOM registry information - defined as ROM only.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE REGISTRY_INFO theInfo
+    {
+    resource_format_version = RESOURCE_FORMAT_VERSION_2;
+
+    dll_uid = KAiwCallImagePluginImplementationUid;
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KAiwClassMenu;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = KAiwCallImagePluginImplementationUid;
+                    version_no = 1;
+                    display_name = "";
+                    default_data = "*";
+                    opaque_data = KAiwCmdAssignStr;
+                    rom_only = 1;
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/aiwcallimageplugin/data/aiwcallimageplugin.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,31 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing aiwcallimage plugin.
+;
+; Languages
+&EN
+
+; Header
+#{"aiwcallimageplugin"}, (0x102823D0), 10, 1, 0, TYPE=PU
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files
+"\epoc32\RELEASE\armv5\UREL\aiwcallimageplugin.dll"-"z:\sys\bin\aiwcallimageplugin.dll"
+"\epoc32\data\z\resource\aiwcallimageplugin.rsc"-"z:\resource\aiwcallimageplugin.rsc"
+"\epoc32\data\z\resource\plugins\aiwcallimageplugin.rsc"-"z:\resource\plugins\aiwcallimageplugin.rsc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/aiwcallimageplugin/data/aiwcallimageplugin.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,154 @@
+/*
+* Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 aiwcallimageplugin.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME     CIMP
+
+//  INCLUDES
+#include <eikon.rh>
+#include <avkon.rh>
+#include <avkon.hrh>
+#include <avkon.rsg>
+#include <avkon.loc>
+
+#include "aiwcallimageplugin.hrh"
+#include <aiwcallimageplugin.loc>
+#include <drmcommon.loc>
+#include <AiwCommon.hrh>
+
+//  RESOURCE DEFINITIONS 
+
+// -----------------------------------------------------------------------------
+//
+//    RSS_SIGNATURE
+//    
+//    Signature.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE {}
+    
+//----------------------------------------------------
+//   
+//    EIK_APP_INFO
+//    It contains application information.
+//
+//----------------------------------------------------
+//
+RESOURCE EIK_APP_INFO {}
+
+// -----------------------------------------------------------------------------
+//   
+//    r_call_image_menu
+//    
+//    Call menu (non-cascaded).
+//    
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_call_image_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            { 
+            command = ECallImage; 
+            txt = qtn_call_image_menu_item;
+            }
+        };
+    }
+    
+//----------------------------------------------------
+//
+//    r_call_image_error_note
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_call_image_error_note
+    {
+    buttons = R_AVKON_SOFTKEYS_EMPTY;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = ECallImageGeneralNote;
+            control = AVKON_NOTE 
+                { 
+                layout = EGeneralLayout;
+                singular_label = qtn_call_image_fail_note;
+                plural_label = "";               
+                animation = R_QGN_NOTE_ERROR_ANIM;
+                };
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_call_image_ok_note
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_call_image_ok_note
+    {
+    buttons = R_AVKON_SOFTKEYS_EMPTY;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = ECallImageGeneralNote;
+            control = AVKON_NOTE 
+                { 
+                layout = EGeneralLayout;
+                singular_label = qtn_call_image_conf_note;
+                plural_label = "";               
+                animation = R_QGN_NOTE_OK_ANIM;
+                };
+            }
+        };
+    } 
+
+//----------------------------------------------------
+//
+//    r_call_image_drm_note
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_call_image_drm_note
+    {
+    buttons = R_AVKON_SOFTKEYS_EMPTY;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = ECallImageGeneralNote;
+            control = AVKON_NOTE 
+                { 
+                layout = EGeneralLayout;
+                singular_label = qtn_drm_not_allowed;
+                plural_label = "";               
+                animation = R_QGN_NOTE_INFO_ANIM;
+                };
+            }
+        };
+    } 
+    
+// End of File
Binary file phonesettings/aiwcallimageplugin/data/aiwcallimageplugin_stub.SIS has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/aiwcallimageplugin/data/aiwcallimageplugin_stub.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,31 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing aiwcallimage plugin stub.
+;
+; Languages
+&EN
+
+; Header
+#{"aiwcallimageplugin"}, (0x102823D0), 1, 0, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files
+""-"z:\sys\bin\aiwcallimageplugin.dll"
+""-"z:\resource\aiwcallimageplugin.rsc"
+""-"z:\resource\plugins\aiwcallimageplugin.rsc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/aiwcallimageplugin/group/aiwcallimageplugin.mmp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* 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 for Aiw Call Image plugin.
+*
+*/
+
+#include  <platform_paths.hrh>
+#include  <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+
+// Capability assignment.
+CAPABILITY      CAP_ECOM_PLUGIN WriteDeviceData
+TARGET          aiwcallimageplugin.dll
+TARGETTYPE      PLUGIN
+UID             0x10009D8D 0x102823D0
+VENDORID        VID_DEFAULT
+
+SOURCEPATH      ../src
+SOURCE          aiwcallimageplugin.cpp
+SOURCE          aiwcallimagepluginmain.cpp
+
+SOURCEPATH      ../data
+
+START RESOURCE  102823d0.rss
+TARGET          aiwcallimageplugin.rsc
+END
+
+START RESOURCE  aiwcallimageplugin.rss
+DEPENDS avkon.rsg
+TARGETPATH      RESOURCE_FILES_DIR
+HEADER
+LANGUAGE_IDS
+END
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../data
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+LIBRARY         euser.lib
+LIBRARY         servicehandler.lib      // AIW Framework.
+LIBRARY         centralrepository.lib   // for CenRep usage.
+LIBRARY         avkon.lib               // Note showing.
+LIBRARY         cone.lib                // for CCoeEnv usage.
+LIBRARY         drmhelper.lib           // for DRM functionality.
+LIBRARY         bafl.lib                // For loading language specific resourse.
+LIBRARY         drmutility.lib
+LIBRARY         efsrv.lib
+LIBRARY   		aknskinsrv.lib		//skinServer
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/aiwcallimageplugin/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Build information specification for Aiw Call Image plugin.
+*
+*/
+
+
+#ifdef  __CALL_IMAGETEXT
+#include  <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../data/aiwcallimageplugin_stub.SIS\
+    /epoc32/data/z/system/install/aiwcallimageplugin_stub.SIS
+    
+../rom/aiwcallimageplugin.iby\
+    CORE_APP_LAYER_IBY_EXPORT_PATH(aiwcallimageplugin.iby)
+
+../rom/aiwcallimagepluginresources.iby\
+    LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(aiwcallimagepluginresources.iby)
+    
+../loc/aiwcallimageplugin.loc\
+    APP_LAYER_LOC_EXPORT_PATH(aiwcallimageplugin.loc)
+
+PRJ_MMPFILES
+aiwcallimageplugin.mmp
+
+PRJ_TESTMMPFILES
+#endif // __CALL_IMAGETEXT
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/aiwcallimageplugin/inc/aiwcallimageplugin.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,132 @@
+/*
+* 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 ECOM interface implementation for aiwcallimageplugin.
+*
+*/
+
+
+#ifndef AIWCALLIMAGEPLUGIN_H
+#define AIWCALLIMAGEPLUGIN_H
+
+
+//  INCLUDES
+#include    <AiwServiceIfMenu.h>
+#include    <AiwCommon.h>
+
+
+// FORWARD DECLARATIONS
+class MAiwNotifyCallback;
+
+
+// CLASS DECLARATION
+
+/**
+*  AiwCallImagePlugin implementation.
+*
+*  @since 3.2
+*/
+class CAiwCallImagePlugin : public CAiwServiceIfMenu
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * 
+        * @return An instance of CaUiPlugin.
+        */
+        static CAiwCallImagePlugin* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CAiwCallImagePlugin();
+
+    public: // Functions from base classes
+
+        /**
+        * @see CAiwServiceIfBase::InitialiseL.
+        */
+        void InitialiseL(
+            MAiwNotifyCallback& aFrameworkCallback,
+            const RCriteriaArray& aInterest );
+
+        /**
+        * @see CAiwServiceIfBase::HandleServiceCmdL.
+        */
+        void HandleServiceCmdL(
+            const TInt& aCmdId,
+            const CAiwGenericParamList& aInParamList,
+            CAiwGenericParamList& aOutParamList,
+            TUint aCmdOptions = 0,
+            const MAiwNotifyCallback* aCallback = NULL );
+
+        /**
+        * @see CAiwServiceIfMenu::InitializeMenuPaneL.
+        */
+        void InitializeMenuPaneL(
+        CAiwMenuPane& aMenuPane,
+            TInt aIndex,
+            TInt aCascadeId,
+            const CAiwGenericParamList& aInParamList );
+
+        /**
+        * @see CAiwServiceIfMenu::HandleMenuCmdL.
+        */
+        void HandleMenuCmdL(
+            TInt aMenuCmdId,
+            const CAiwGenericParamList& aInParamList,
+            CAiwGenericParamList& aOutParamList,
+            TUint aCmdOptions = 0,
+            const MAiwNotifyCallback* aCallback = NULL );
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CAiwCallImagePlugin();
+   
+    private:
+    
+        /**
+        * Shows confirmation note.
+        */
+        void ShowNoteL( TInt aError );
+        
+        /**
+        * Shows drm error note.
+        */
+        void ShowDRMErrorNoteL();
+        
+        /**
+        * Sets call image path to Central Repository.
+        */
+        TInt SetCallImagePathL( const TAiwGenericParam* aPathParam );
+        
+        /**
+        * Reads AIW parameters.
+        */
+        TPtrC GetAiwParamAsDescriptor( 
+            const CAiwGenericParamList& aParamList,
+		    TGenericParamId aParamType );
+	    
+	    /**
+        * Checks if call image plugin menu option is to be loaded.
+        */
+	    TBool IsMimeTypeSupportedL( const TDesC& aMimeTypeString );
+    };
+
+#endif  // AIWCALLIMAGEPLUGIN_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/aiwcallimageplugin/inc/aiwcallimageplugin.hrh	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 UIDs used in aiwcallimageplugin.
+*
+*/
+
+
+#ifndef AIWCALLIMAGEPLUGIN_HRH
+#define AIWCALLIMAGEPLUGIN_HRH
+
+
+// CONSTANTS
+
+// Connection utility implementation uid.
+#define KAiwCallImagePluginImplementationUid 0x102823D0
+
+// Values for different kinds of call commands.
+enum
+    {
+    ECallImage = 500
+    };
+
+// Enumerates resource identifiers
+enum 
+    { 
+    // General note id
+    ECallImageGeneralNote = 1
+    };
+
+#endif // AIWCALLIMAGEPLUGIN_HRH
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/aiwcallimageplugin/loc/aiwcallimageplugin.loc	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the localised strings for aiwcallimageplugin.
+*
+*/
+
+
+
+//  LOCALISATION STRINGS
+
+
+// d: It is text for set call iamge menu option. If it is selected, 
+// d: typical call image set is done.
+// l: list_single_popup_submenu_pane_t1
+//
+#define qtn_call_image_menu_item "Set as Call Image"
+
+// d: It is text shown in an error note when
+// d: call image set is failed.
+// l: popup_note_window
+//
+#define qtn_call_image_fail_note "Image set failed"
+
+// d: It is text shown in an note when
+// d: call image set is succesful.
+// l: popup_note_window
+//
+#define qtn_call_image_conf_note "Set as call image"
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/aiwcallimageplugin/rom/aiwcallimageplugin.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  aiwcallimageplugin's iby definitions.
+ *
+*/
+
+
+#ifndef __AIWCALLIMAGEPLUGIN_IBY__
+#define __AIWCALLIMAGEPLUGIN_IBY__
+
+#ifdef __CALL_IMAGETEXT
+
+REM AiwCallImagePlugin
+ECOM_PLUGIN(AiwCallImagePlugin.dll,102823D0.rsc)
+data=ZSYSTEM\install\aiwcallimageplugin_stub.SIS     System\Install\aiwcallimageplugin_stub.SIS
+#endif	// __CALL_IMAGETEXT
+
+#endif // __AIWCALLIMAGEPLUGIN_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/aiwcallimageplugin/rom/aiwcallimagepluginresources.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  aiwcallimagepluginresources's iby definitions.
+ *
+*/
+
+
+#ifndef __AIWCALLIMAGEPLUGIN_RESOURCES_IBY__
+#define __AIWCALLIMAGEPLUGIN_RESOURCES_IBY__
+
+#ifdef __CALL_IMAGETEXT
+
+data=DATAZ_\RESOURCE_FILES_DIR\aiwcallimageplugin.rsc  RESOURCE_FILES_DIR\aiwcallimageplugin.rsc
+
+
+#endif	// __CALL_IMAGETEXT
+
+#endif // __AIWCALLIMAGEPLUGIN_RESOURCES_IBY__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/aiwcallimageplugin/src/aiwcallimageplugin.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,408 @@
+/*
+* 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:  Implementation of Call Image plugin.
+*
+*/
+
+    
+
+// INCLUDE FILES
+#include <AiwCommon.h>              // AIW classes and definitions.
+#include <AiwCommon.hrh>            // AIW constants.
+#include <AiwMenu.h>                // AIW Menu pane.
+#include <aiwcallimageplugin.rsg>
+#include <pslninternalcrkeys.h>
+#include <centralrepository.h>
+#include <data_caging_path_literals.hrh>
+#include <aknnotedialog.h>
+#include <DRMHelper.h>
+#include <bautils.h>
+#include <drmutility.h>
+#include <AknsSrvClient.h>
+
+#include "aiwcallimageplugin.h"     // This class interface.
+#include "aiwcallimageplugin.hrh"   // AiwCallImagePlugin constants.
+
+
+
+// CONSTANTS
+
+// Drive letter.
+_LIT( KResourceDrive, "z:" );
+
+// Path to compiled resource file.
+_LIT( KCallImageResFile, "aiwcallimageplugin.rsc" );
+
+// Call Image mime types.
+_LIT( KCallImagePluginMimeTypeImage, "IMAGE" );
+_LIT( KCallImagePluginMimeTypeOTABitmap, "IMAGE/X-OTA-BITMAP" );
+_LIT( KCallImagePluginSeparator, "/" );
+// Extension for scalable vector graphics file.
+_LIT( KAknsSkinSrvSvgFileExt, ".svg" );
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CAiwCallImagePlugin::CAiwCallImagePlugin
+// 
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CAiwCallImagePlugin::CAiwCallImagePlugin()
+    {
+    }
+    
+// -----------------------------------------------------------------------------
+// CAiwCallImagePlugin::NewL
+// 
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CAiwCallImagePlugin* CAiwCallImagePlugin::NewL()
+    {
+    CAiwCallImagePlugin* self = new( ELeave ) CAiwCallImagePlugin;
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CAiwCallImagePlugin::~CAiwCallImagePlugin
+// 
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CAiwCallImagePlugin::~CAiwCallImagePlugin()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CAiwCallImagePlugin::InitialiseL
+// 
+// 
+// -----------------------------------------------------------------------------
+//
+void CAiwCallImagePlugin::InitialiseL(
+    MAiwNotifyCallback& /*aFrameworkCallback*/,
+    const RCriteriaArray& /*aInterest*/)
+    {
+    // Stub. Not used.
+    }
+
+// -----------------------------------------------------------------------------
+// CAiwCallImagePlugin::HandleServiceCmdL
+// 
+// 
+// -----------------------------------------------------------------------------
+//
+void CAiwCallImagePlugin::HandleServiceCmdL(
+    const TInt& aCmdId,
+    const CAiwGenericParamList& aInParamList,
+    CAiwGenericParamList& /*aOutParamList*/,
+    TUint aCmdOptions,
+    const MAiwNotifyCallback* /*aCallback*/ )
+    {
+    
+    // Cancel bit must always be checked. Support can be implemented if necessary.
+    if( aCmdOptions & KAiwOptCancel )
+        {
+        return;
+        }
+        
+    // Handle only call command.
+    if ( aCmdId == KAiwCmdAssign )
+        {
+        // Check if there is call image path parameter.
+        TInt index = 0;
+        const TAiwGenericParam* genericParam = NULL; 
+            
+        genericParam = aInParamList.FindFirst( 
+            index,
+            EGenericParamFile,
+            EVariantTypeDesC );
+            
+        if ( index >= 0 && genericParam )
+            {
+             User::LeaveIfError( SetCallImagePathL( genericParam ) );
+            }
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CAiwCallImagePlugin::SetCallImagePathL
+// 
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CAiwCallImagePlugin::SetCallImagePathL( const TAiwGenericParam* aPathParam )
+    {
+    TInt error( KErrNone );
+    TBool drm( EFalse );
+    TBool iDrmProtected( EFalse ); 
+    RFile fileHandle;
+    TUint fileMode = EFileShareReadersOrWriters | EFileStream | EFileRead;
+    RFs fs = CCoeEnv::Static()->FsSession();
+     
+    User::LeaveIfError(fileHandle.Open(fs, aPathParam->Value().AsDes(), fileMode));
+    CleanupClosePushL(fileHandle);
+     
+    DRM::CDrmUtility* drmUtil = DRM::CDrmUtility::NewLC();
+    iDrmProtected = drmUtil->IsProtectedL(fileHandle);
+     
+    CleanupStack::PopAndDestroy(2); // fileHandle, drmUtil
+    
+    if( !iDrmProtected )
+        {
+        CDRMHelper* drmHelper = CDRMHelper::NewL( *CCoeEnv::Static() );
+        drmHelper->CanSetAutomated( aPathParam->Value().AsDes(), drm );
+        delete drmHelper;
+        }
+
+	//Before setting image, check is the image corruputed
+	RAknsSrvSession skinsrv;
+	User::LeaveIfError( skinsrv.Connect() );
+	CleanupClosePushL( skinsrv );
+	CFbsBitmap* bmp = NULL;
+	CFbsBitmap* mask = NULL;
+     // no way currently of checking corrupted svg:s
+     if ( ( aPathParam->Value().AsDes().Right( 4 ) ).CompareF( KAknsSkinSrvSvgFileExt ) )
+    	{
+		 // (-1, -1) means that image is just decoded, not used    	
+   	 	TRAP( error, skinsrv.DecodeWallpaperImageL( aPathParam->Value().AsDes(), TSize(-1,-1), bmp, mask ) );
+   	 	if( error )
+   	 		{
+   	 		//File is corrupted
+   	 		ShowNoteL( error );
+    		CleanupStack::PopAndDestroy( &skinsrv );
+    		//Need to return KErrNone because there would happen a Leave upper in callstack. This how
+    		//AIW plugin can show more accurate error note.   	 		
+   	 		return KErrNone;
+	  	 	}
+    	}
+    CleanupStack::PopAndDestroy( &skinsrv );
+
+    CRepository* pathCen = CRepository::NewL ( KCRUidThemes ); 
+    CleanupStack::PushL( pathCen );
+    if ( drm )
+        {
+        error = pathCen->Set( KThemesCallImagePath, aPathParam->Value().AsDes() );
+        // If path setting fails do not set image support on.
+        if ( error == KErrNone )
+            {
+            error = pathCen->Set( KThemesCallImageSetting, ETrue );    
+            }
+        ShowNoteL( error );
+        }
+    else // drm check failed show error note
+        {
+        ShowDRMErrorNoteL();
+        }
+    
+    CleanupStack::PopAndDestroy(); // pathCen
+    
+    return error;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAiwCallImagePlugin::ShowDRMErrorNoteL
+// 
+// 
+// -----------------------------------------------------------------------------
+//
+void CAiwCallImagePlugin::ShowDRMErrorNoteL()
+    {
+    // Resource file definition.   
+    TFileName callImageRsc( KResourceDrive );
+    callImageRsc.Append( KDC_RESOURCE_FILES_DIR );
+    callImageRsc.Append( KCallImageResFile );
+
+    CCoeEnv* env = CCoeEnv::Static();
+    BaflUtils::NearestLanguageFile( env->FsSession(), callImageRsc );
+    TInt resourceOffSet = env->AddResourceFileL( callImageRsc );
+    
+    CAknNoteDialog* dlg = new(ELeave) CAknNoteDialog;
+    CAknNoteDialog::TTimeout timeout = CAknNoteDialog::ELongTimeout;
+    dlg->SetTone( CAknNoteDialog::EErrorTone );       
+    dlg->PrepareLC( R_CALL_IMAGE_DRM_NOTE );
+    dlg->SetTimeout( timeout );
+    dlg->RunDlgLD();
+    // Free resource.
+    env->DeleteResourceFile( resourceOffSet );
+    }
+    
+// -----------------------------------------------------------------------------
+// CAiwCallImagePlugin::ShowNoteL
+// 
+// 
+// -----------------------------------------------------------------------------
+//
+void CAiwCallImagePlugin::ShowNoteL( TInt aError )
+    {
+    TInt resourceId = R_CALL_IMAGE_OK_NOTE;
+    // Resource file definition.   
+    TFileName callImageRsc( KResourceDrive );
+    callImageRsc.Append( KDC_RESOURCE_FILES_DIR );
+    callImageRsc.Append( KCallImageResFile );
+
+    CCoeEnv* env = CCoeEnv::Static();
+    BaflUtils::NearestLanguageFile( env->FsSession(), callImageRsc );
+    TInt resourceOffSet = env->AddResourceFileL( callImageRsc );
+    
+    CAknNoteDialog* dlg = new(ELeave) CAknNoteDialog;
+    CAknNoteDialog::TTimeout timeout = CAknNoteDialog::ELongTimeout;
+    
+    if ( aError != KErrNone )
+        {
+        resourceId = R_CALL_IMAGE_ERROR_NOTE;
+        dlg->SetTone( CAknNoteDialog::EErrorTone );
+        }         
+    dlg->PrepareLC( resourceId );
+    dlg->SetTimeout( timeout );
+    dlg->RunDlgLD();
+    // Free resource.
+    env->DeleteResourceFile( resourceOffSet );
+    }
+
+// -----------------------------------------------------------------------------
+// CAiwCallImagePlugin::InitializeMenuPaneL
+// 
+// 
+// -----------------------------------------------------------------------------
+//
+void CAiwCallImagePlugin::InitializeMenuPaneL(
+    CAiwMenuPane& aMenuPane,
+    TInt aIndex,
+    TInt /* aCascadeId */,
+    const CAiwGenericParamList& aInParamList )
+    {
+    TPtrC mimeTypeString = GetAiwParamAsDescriptor(aInParamList, EGenericParamMIMEType);
+    
+    // Insert menu only if supported MIME type is given
+    if ( ( mimeTypeString != KNullDesC ) && 
+        (IsMimeTypeSupportedL(mimeTypeString) ) )   
+        {
+        // Resource file definition.   
+        TFileName resFile( KResourceDrive );
+        resFile.Append( KDC_RESOURCE_FILES_DIR );
+        resFile.Append( KCallImageResFile );
+                
+        aMenuPane.AddMenuItemsL( 
+            resFile, 
+            R_CALL_IMAGE_MENU, 
+            KAiwCmdAssign, 
+            aIndex);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CAiwCallImagePlugin::HandleMenuCmdL
+// 
+// 
+// -----------------------------------------------------------------------------
+//
+void CAiwCallImagePlugin::HandleMenuCmdL(
+    TInt aMenuCmdId, 
+    const CAiwGenericParamList& aInParamList,
+    CAiwGenericParamList& aOutParamList,
+    TUint aCmdOptions,
+    const MAiwNotifyCallback* aCallback )
+    {
+    // Cancel bit must always be checked. Support can be implemented if necessary.
+    if( aCmdOptions & KAiwOptCancel )
+        {
+        return;
+        }
+        
+    // Handle only call image command.
+    if ( aMenuCmdId == ECallImage )
+        {
+        // Menu commands are handled as service commands.
+        HandleServiceCmdL(
+            KAiwCmdAssign,
+            aInParamList,
+            aOutParamList,
+            aCmdOptions,
+            aCallback );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// Implements getting a AIW parameter as descriptor.
+// 
+// 
+// -----------------------------------------------------------------------------
+//    
+TPtrC CAiwCallImagePlugin::GetAiwParamAsDescriptor(
+		const CAiwGenericParamList& aParamList,
+		TGenericParamId aParamType)
+	{
+	TInt index(0);
+	const TAiwGenericParam* genericParam = NULL;
+    genericParam = aParamList.FindFirst( 
+        index,
+        aParamType,
+        EVariantTypeDesC );
+        
+    if ( index >= 0 && genericParam )
+        {
+        // Get the data
+        return genericParam->Value().AsDes();
+        }
+	else
+    	{
+		return KNullDesC();
+    	}
+	}  
+
+// -----------------------------------------------------------------------------
+// Implements checking if a given MIME type is supported or not.
+// 
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CAiwCallImagePlugin::IsMimeTypeSupportedL( const TDesC& aMimeTypeString )
+    {   
+    // Check for a type separator in the string
+    TInt pos = aMimeTypeString.Find( KCallImagePluginSeparator );
+
+    // Leave if no separator was found.. the MIME
+    // standard requires it   
+    if ( pos == KErrNotFound )
+        {
+        User::Leave( KErrArgument );
+        }
+    
+    // Copy the full Mime type string (needed for uppercase)
+    HBufC* fullBuf = aMimeTypeString.AllocLC();
+    TPtr fullString = fullBuf->Des();
+    fullString.UpperCase();
+
+	// Construct the compare string    
+    TPtrC compareString( aMimeTypeString.Left( pos ) );
+
+    TBool ret(EFalse);
+    
+    // Perform the comparison
+    // Mime type case:  IMAGE/* except IMAGE/X-OTA-BITMAP
+    if ( compareString.CompareF( KCallImagePluginMimeTypeImage ) == 0 &&
+        !( fullString.CompareF( KCallImagePluginMimeTypeOTABitmap ) == 0 ) )
+        {
+        ret = ETrue;
+        }
+        
+	CleanupStack::PopAndDestroy( fullBuf );
+    
+	return ret;    
+    }
+    
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/aiwcallimageplugin/src/aiwcallimagepluginmain.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,57 @@
+/*
+* 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:  Global functions for aiwcallimageplugin.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    <ecom.h>
+#include    <implementationproxy.h>
+
+#include    "aiwcallimageplugin.hrh"
+#include    "aiwcallimageplugin.h"
+
+
+// CONSTANTS
+
+// Holds implementation table.
+const TImplementationProxy KAiwCallImagePluginImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY( 
+        KAiwCallImagePluginImplementationUid, 
+        CAiwCallImagePlugin::NewL )
+    };
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// ImplementationGroupProxy
+// 
+// Returns implementation table and updates aTableCount parameter to hold
+// amount of elements in table.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
+    TInt& aTableCount )
+    {
+    aTableCount = 
+        sizeof( KAiwCallImagePluginImplementationTable ) / 
+        sizeof( TImplementationProxy );
+
+    return KAiwCallImagePluginImplementationTable;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,22 @@
+/*
+* 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 / phonesettings
+*
+*/
+
+
+#include "../aiwcallimageplugin/group/bld.inf"
+#include "../pslncallimageplugin/Group/bld.inf"
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/pslncallimageplugin/Data/102818EE.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,45 @@
+/*
+* 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:  ECOM plugin resource file for Call Image plugin.
+*
+*/
+
+#include <registryinfo.rh>
+
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid     = 0x102818EE;
+    interfaces  = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid   = 0x102750A9; 
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid  = 0x102818EF;
+                    version_no          = 1;
+                    display_name        = "Call Image Plugin";
+                    default_data        = "0";
+                    opaque_data         = "0";
+                    }
+                };
+            }
+        };
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/pslncallimageplugin/Data/PslnCallImagePluginRsc.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,191 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for PslnCallImagePlugin
+*
+*/
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    PCIP // 4 letter ID
+
+//  INCLUDES
+#include <avkon.loc> // Avkon localized strings
+#include <psln.hrh>
+#include <psln.loc>
+#include <PslnCommon.rsg>
+#include <avkon.mbg>
+#include <avkon.rsg>
+#include <EIKCORE.rsg>
+#include <uikon.rh>
+#include <avkon.rh>
+#include <eikon.rh>
+
+#include <pslncallimageplugin.loc>
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS 
+
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+RESOURCE TBUF
+    {
+    buf="PSLC";
+    }
+
+//----------------------------------------------------
+//   
+//    EIK_APP_INFO
+//    It contains application information.
+//
+//----------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_psln_call_image_view
+//    Call Image application specific view.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_psln_call_image_view 
+    {
+    menubar = r_psln_ci_view_menubar;
+    cba = R_AVKON_SOFTKEYS_OPTIONS_BACK;
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_psln_as_view_menubar
+//    Options menu with 'Apply', 'Help' and 'Exit' items.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_psln_ci_view_menubar
+    {
+    titles =
+        {
+        MENU_TITLE { menu_pane = r_psln_ci_basic_menupane; },
+        MENU_TITLE { menu_pane = R_PSLN_GEN_VIEW_MENUPANE; }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_psln_ci_basic_menupane
+//    Call Image menu pane for view.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_psln_ci_basic_menupane
+    {
+    items =
+        {
+        MENU_ITEM 
+            {
+            command = EPslnCmdAppActivate;
+            txt = qtn_skins_option_activate;
+            },
+        MENU_ITEM 
+            {
+            command = EPslnCmdAppDownload;
+            txt = qtn_options_change;
+            },
+#ifdef __SERIES60_HELP
+        MENU_ITEM 
+            {
+            command = EPslnCmdAppHelp;
+            txt = qtn_options_help;
+            },
+#endif // __SERIES60_HELP
+        MENU_ITEM 
+            {
+            command = EAknCmdExit;
+            txt = qtn_options_exit;
+            }
+        };
+    }
+    
+// -----------------------------------------------------------------------------
+//   
+//    r_psln_ci_list_view_title
+//    Call Image specific list view's title.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TITLE_PANE r_psln_ci_list_view_title
+    {
+    txt = qtn_skins_title_call_image;
+    }
+
+//----------------------------------------------------
+//  r_psln_ci_list_view_caption
+// 
+// Shortcuts view caption for plugin
+//----------------------------------------------------
+//
+RESOURCE TBUF r_psln_ci_list_view_caption
+    {
+    buf = qtn_skins_title_call_image;
+    }
+
+// -----------------------------------------------------------------------------
+//    
+//    r_psln_ci_tab_name
+//    Call Image specific skin tab title.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_psln_ci_tab_name
+    {
+    buf = qtn_skins_tabs_call_image;
+    }   
+
+// -----------------------------------------------------------------------------
+//    
+//    r_psln_ci_view_lbx
+//    Listbox of call image setting page.
+//    "0\tTextLabel\t1\t2"
+//    Note that icons need to be added in source code.
+// -----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_psln_ci_view_lbx
+    {
+    items =
+        {
+        LBUF { txt = qtn_skins_default_call_image"\t\t"; },
+        LBUF { txt = qtn_skins_settings_none"\t\t";      },
+        LBUF { txt = qtn_skins_settings_browse"\t\t";  }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_psln_title_pane_callimage
+//    Text for title pane text in menu view.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_psln_title_pane_callimage
+    {
+    buf = qtn_skins_title_pane_callimage;
+    }
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/pslncallimageplugin/Data/pslncallimageplugin.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -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 pslncallimage plugin.
+;
+; Languages
+&EN
+
+; Header
+#{"pslncallimageplugin"}, (0x102818EE), 10, 1, 0, TYPE=PU
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files
+"\epoc32\RELEASE\armv5\UREL\PslnCallImagePlugin.dll"-"z:\sys\bin\PslnCallImagePlugin.dll"
+"\epoc32\data\z\resource\apps\pslncallimageplugin.mif"-"z:\resource\apps\pslncallimageplugin.mif"
+"\epoc32\data\z\resource\PslnCallImagePluginRsc.rsc"-"z:\resource\PslnCallImagePluginRsc.rsc"
+"\epoc32\data\z\resource\plugins\PslnCallImagePlugin.rsc"-"z:\resource\plugins\PslnCallImagePlugin.rsc"
Binary file phonesettings/pslncallimageplugin/Data/pslncallimageplugin_stub.SIS has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/pslncallimageplugin/Data/pslncallimageplugin_stub.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -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 pslncallimage plugin stub.
+;
+; Languages
+&EN
+
+; Header
+#{"pslncallimageplugin"}, (0x102818EE), 1, 0, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files
+""-"z:\sys\bin\PslnCallImagePlugin.dll"
+""-"z:\resource\apps\pslncallimageplugin.mif"
+""-"z:\resource\PslnCallImagePluginRsc.rsc"
+""-"z:\resource\plugins\PslnCallImagePlugin.rsc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/pslncallimageplugin/Group/PslnCallImagePlugin.mmp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,76 @@
+/*
+* 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.
+*
+*/
+
+#include  <platform_paths.hrh>
+#include  <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+
+CAPABILITY          CAP_ECOM_PLUGIN DRM WriteDeviceData
+TARGET              pslncallimageplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x102818EE
+VENDORID            VID_DEFAULT
+
+
+SOURCEPATH  ../src
+SOURCE      PslnCallImagePluginImplementationTable.cpp
+SOURCE      PslnCallImagePluginContainer.cpp
+SOURCE      PslnCallImagePlugin.cpp
+SOURCE      PslnCallImagePluginDRM.cpp
+
+//User include paths
+USERINCLUDE     ../inc
+USERINCLUDE     ../Data
+USERINCLUDE     ../Logger
+
+//System include paths
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/cshelp
+
+SOURCEPATH      ../Data
+
+START RESOURCE  102818EE.rss
+TARGET          pslncallimageplugin.rsc
+END
+
+START RESOURCE  PslnCallImagePluginRsc.rss
+DEPENDS pslncommon.rsg
+TARGETPATH      RESOURCE_FILES_DIR
+HEADER
+LANGUAGE_IDS
+END
+
+LIBRARY   euser.lib
+LIBRARY   ecom.lib
+LIBRARY   efsrv.lib
+LIBRARY   avkon.lib
+LIBRARY   bafl.lib 
+LIBRARY   cone.lib 
+LIBRARY   eikcoctl.lib          // for CTextListBoxModel
+LIBRARY   eikcore.lib 
+LIBRARY   drmhelper.lib 		// for DRM functionality
+LIBRARY   mgfetch.lib			// for Media fetch
+LIBRARY   centralrepository.lib // for CenRep usage
+LIBRARY   commonengine.lib      // For RConeResourceLoader
+LIBRARY   aknskins.lib          // for icon creation.
+LIBRARY   featmgr.lib           // for feature manager
+LIBRARY   pslnframework.lib     // For base classes
+LIBRARY   flogger.lib      		// logging
+LIBRARY   drmutility.lib
+LIBRARY   aknskinsrv.lib		//skinServer
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/pslncallimageplugin/Group/PslnCallImagePluginIcons.mk	Mon Jan 18 20:18:27 2010 +0200
@@ -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: Make PslnCallImagePluginIcons.
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+HEADERDIR=\epoc32\include
+ICONTARGETFILENAME=$(TARGETDIR)\pslncallimageplugin.mif
+HEADERFILENAME=$(HEADERDIR)\pslncallimageplugin.mbg
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2, \s60\bitmaps.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+		/c8,8 qgn_prop_psln_cimage_sub.svg
+
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/pslncallimageplugin/Group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building 
+*                PslnCallImagePlugin.
+*
+*/
+
+#ifdef  __CALL_IMAGETEXT
+#include  <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../Data/pslncallimageplugin_stub.SIS\
+    /epoc32/data/z/system/install/pslncallimageplugin_stub.SIS
+
+../rom/PslnCallImagePlugin.iby\
+    CORE_APP_LAYER_IBY_EXPORT_PATH(PslnCallImagePlugin.iby)
+
+../rom/PslnCallImagePluginResources.iby\
+    LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(PslnCallImagePluginResources.iby)
+    
+../loc/pslncallimageplugin.loc\
+    APP_LAYER_LOC_EXPORT_PATH(pslncallimageplugin.loc)
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE pslncallimageplugin.mif
+  OPTION HEADERFILE pslncallimageplugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_psln_cimage_sub
+END
+
+PRJ_MMPFILES
+//gnumakefile PslnCallImagePluginIcons.mk
+PslnCallImagePlugin.mmp
+
+PRJ_TESTMMPFILES
+#endif // __CALL_IMAGETEXT
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/pslncallimageplugin/Logger/PslnCallImagePluginLogger.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*       Macro definition file for logging.
+*
+*
+*/
+
+
+
+#ifndef PSLNCALLIMAGEPLUGINLOGGER_H
+#define PSLNCALLIMAGEPLUGINLOGGER_H
+
+#include "PslnCallImagePluginLoggingConf.h"
+#include <e32std.h>
+#include <flogger.h>
+#include <e32svr.h>
+
+_LIT( KLogsDir,                  "CALLIMAGE");
+_LIT( KLogFileName,              "CALLIMAGE.log");
+
+/*
+ We have 3 possible logging methods:
+
+ set CALL_LOGGING_METHOD to 0 to get no logging at all
+ set CALL_LOGGING_METHOD to 1 to get logging via RDebug::Print
+ set CALL_LOGGING_METHOD to 2 to get logging to log file
+
+ Switching on/off is done in the Configuration file (PslnCallImagePluginLoggingConf.h)
+ */
+
+#if ( defined (_CALLLOGGING) )
+    #if ( defined (_CALL_LOGGING_TO_FILE))
+        #define CALL_LOGGING_METHOD 2 
+    #else
+        #define CALL_LOGGING_METHOD 1
+    #endif
+#else
+    #define CALL_LOGGING_METHOD 0
+#endif
+
+
+#if (CALL_LOGGING_METHOD==0)
+    #define __CALLLOGSTRING(C)
+    #define __CALLLOGSTRING1(C, X)
+    #define __CALLLOGSTRING2(C, X, Y)
+    #define __CALLLOGSTRING3(C, X, Y, Z)
+#endif
+#if (CALL_LOGGING_METHOD==1)
+    #define __CALLLOGSTRING(C)            RDebug::Print(_L(C));
+    #define __CALLLOGSTRING1(C, X)        RDebug::Print(_L(C),X);
+    #define __CALLLOGSTRING2(C, X, Y)     RDebug::Print(_L(C),X, Y);
+    #define __CALLLOGSTRING3(C, X, Y, Z)  RDebug::Print(_L(C),X, Y, Z);
+#endif
+#if (CALL_LOGGING_METHOD==2)
+    #define __CALLLOGSTRING(C)            {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, tempLogDes());}
+    #define __CALLLOGSTRING1(C, X)        {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(tempLogDes()),X);}
+    #define __CALLLOGSTRING2(C, X, Y)     {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(tempLogDes()),X,Y);}
+    #define __CALLLOGSTRING3(C, X, Y, Z)  {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(tempLogDes()),X,Y,Z);}
+#endif
+
+#endif // PSLNCALLIMAGEPLUGINLOGGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/pslncallimageplugin/Logger/PslnCallImagePluginLoggingConf.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*        Macro definition file for logging configuration.
+*       (Note:This file has to be separate from the logging header file 
+*             to be able to include it in mmp file. If not we will get warning about not used 
+*             flogger.lib in other logging cases where flogger.lib is not used.)
+*
+*/
+
+
+
+#ifndef CALLIMAGECONFIGURATION_H
+#define CALLIMAGECONFIGURATION_H
+
+
+#ifdef _DEBUG // logging to file in debug only
+
+/**
+* - Have this line active if you want to have logging for this component
+* - Comment this line out if you don't want any logging for this component
+*/
+#define _CALLLOGGING
+
+/**
+* - Have this line active if you want to have logging to file
+* - Comment this line out if you want to have logging via RDebug::Print 
+*/
+#define _CALL_LOGGING_TO_FILE
+
+#endif // _DEBUG
+
+#endif // CALLIMAGECONFIGURATION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/pslncallimageplugin/inc/PslnCallImagePlugin.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,187 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View for setting call image.
+*
+*/
+
+
+#ifndef PSLNCALLIMAGEPLUGIN_H
+#define PSLNCALLIMAGEPLUGIN_H
+
+// INCLUDES
+#include <aknsettingpage.h>
+#include <pslnfwbaseview.h>
+#include <ConeResLoader.h>
+#include <pslnfwplugininterface.h>
+#include <centralrepository.h> 
+#include <mpslnfwmsklabelobserver.h>
+
+//CONSTANTS
+const TUid KPslnCallImagePluginUid = { 0x102818EF };
+
+// FORWARD DECLARATIONS
+class CAknViewAppUi;
+class CPslnCallImagePluginContainer;
+class CPslnCallImagePluginDRM;
+
+// CLASS DEFINITION
+/**
+*  CPslnCallImagePlugin view class for call image settings
+*  @since Series 60_3.2
+* 
+*/
+class CPslnCallImagePlugin : public CPslnFWBaseView,
+                             public MPslnFWMSKObserver
+    {            
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return Psln AI skinning view.
+        */
+        static CPslnCallImagePlugin* NewL( TAny* aAppUi );
+        
+        /**
+        * Destructor
+        */
+        ~CPslnCallImagePlugin();
+        
+    public: // From CPslnFWnInterface
+
+        /**
+        * @see CPslnFWPluginInterface.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+        
+
+        /**
+        * @see CPslnFWPluginInterface.
+        */
+        void GetTabTextL( TDes& aCaption ) const;
+        
+        /**
+        * @see CPslnFWPluginInterface.
+        */
+        CGulIcon* CreateIconL();
+
+        /**
+        * @see CPslnFWPluginInterface.
+        */
+        void GetLocationTypeAndIndex( 
+            TPslnFWLocationType& aType, 
+            TInt& aIndex ) const;
+                
+    public: // from AknView
+        
+        /**
+        * Returns view id.
+        * @return TUid
+        */
+        TUid Id() const;
+
+        /**
+        * Handles commands.
+        * @param aCommand Command to be handled.
+        * 
+        */
+        void HandleCommandL( TInt aCommand );
+
+    public: // new
+        
+        /**
+        * Get CPslnCallImagePlugin's container.
+        * @return pointer to container.
+        */
+        CPslnCallImagePluginContainer* Container();
+        
+        /**
+        * From MPslnFWMSKObserver.
+        * Checks if the MSK label needs to be adjusted.
+        */    
+        void CheckMiddleSoftkeyLabelL();
+    
+    protected: // From CAknView 
+    
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+        void DoDeactivate();
+
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+    
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CPslnCallImagePlugin( CAknViewAppUi* aAppUi );
+
+        /**
+        * Symbian OS default constructor.
+        * 
+        */
+        void ConstructL();
+
+    private: // from CPslnFWBaseView
+        
+        /**
+        * @see CPslnFWBaseView.
+        */
+        void NewContainerL();
+
+        /**
+        * @see CPslnFWBaseView.
+        */
+        void HandleListBoxSelectionL();
+        
+        /**
+        * @see CPslnFWBaseView.
+        */
+        void SetTitlePaneL( TInt& aResourceId );
+        
+    private:
+    
+    	void HandleImageErrorsL( TInt aError );
+    
+    	void SetCallImageL();
+
+        TInt SetCallImagePath( const TDesC& aImagePath );
+        
+        void SetCallImageSettingL( const TInt aValue );
+        
+        TInt SetPathL( const TDesC& aPath );
+        
+        void RemoveCommandFromMSK();
+                
+    private:
+	    
+        // Resource loader.
+        RConeResourceLoader iResourceLoader;
+        
+        // Resource loader for common psln resources.
+	    RConeResourceLoader iResourceLoaderCommon;  
+        
+        // Resource loader for Psln app resources.
+        RConeResourceLoader iResourceLoaderPsln;
+                
+        // Application UI pointer (not owned)
+        CAknViewAppUi* iAppUi;
+        
+        // Call Image Plugin 
+        CPslnCallImagePluginDRM* iVerifier;
+    };
+
+#endif //PSLNCALLIMAGEPLUGIN_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/pslncallimageplugin/inc/PslnCallImagePluginContainer.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for Call Image settings view.
+*
+*/
+
+
+#ifndef PSLNCALLIMAGEPLUGINCONTAINER_H
+#define PSLNCALLIMAGEPLUGINCONTAINER_H
+
+// INCLUDES
+#include <pslnfwbasecontainer.h>
+#include <centralrepository.h> 
+
+// CONSTANTS
+// Central repository values for key KThemesCallImageSupport
+enum TPslnCRCallImageValues
+    {
+    EPlsnCRCallImageNone = 0,
+    EPlsnCRUserDefinedImage,
+    EPlsnCRThemeImage
+    };
+    
+// Setting values, order must be same than in R_PSLN_CI_VIEW_LBX
+enum TPslnCallImageSetting
+    {
+    EPlsnCallImageThemeImage,
+    EPlsnCallImageNone,
+    EPlsnCallImageUserDefinedImage
+    };
+
+// FORWARD DECLARATION
+// CLASS DECLARATION
+
+/**
+*  CPslnCallImagePluginContainer container class.
+*  @since Series 60_3.1
+* 
+*/
+class CPslnCallImagePluginContainer : 
+    public CPslnFWBaseContainer
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS constructor.
+        * @param aRect Listbox's rect.
+        * 
+        */
+        void ConstructL( const TRect& aRect );
+
+        /**
+        * Destructor.
+        */
+        ~CPslnCallImagePluginContainer();
+
+    public: //new
+
+        /**
+        * Updates listbox's item's value.
+        * @param aItemId specific item ID (ignored).
+        */
+        void UpdateListBoxL();
+                
+        /**
+        * Gets currently active index of given property.
+        * @return index of currently active property, or error code.
+        */
+        TInt CurrentSelectionIndexL();
+
+    protected:
+    
+        void ConstructListBoxL( TInt aResLbxId );
+
+    private: // new
+    
+        void CreateListBoxItemsL();
+        
+        /**
+        * From CCoeControl. Gets help context.
+        */
+        void GetHelpContext( TCoeHelpContext& aContext ) const;
+    
+    private: // data
+    
+        // Listbox array for items.
+        CDesCArray* iItemArray;
+        
+        // List of items from resources.
+        CDesCArrayFlat* iItems;
+        
+        // One setting item.
+        HBufC* iItemBuf; 
+    };
+
+#endif //PSLNCALLIMAGEPLUGINCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/pslncallimageplugin/inc/PslnCallImagePluginDRM.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,82 @@
+/*
+* 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 for DRM functionality.
+*
+*/
+
+
+#ifndef PSLNCALLIMAGEPLUGINDRM_H
+#define PSLNCALLIMAGEPLUGINDRM_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <MMGFetchVerifier.h>
+
+// FORWARD DECLARATIONS
+class CDRMHelper;
+
+// CLASS DECLARATION
+
+/**
+* Implementation for DRM functionality.
+*
+* @since 3.1
+*
+* @internal
+*/
+class CPslnCallImagePluginDRM : public CBase, public MMGFetchVerifier
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CPslnCallImagePluginDRM* NewL();
+        
+        /**
+        * Destructor.
+        */
+        ~CPslnCallImagePluginDRM();
+
+    public: // Functions from base classes
+
+        /**
+        * From MFLDFileObserver. Verifies that the selected image can be set.
+        */
+        TBool VerifySelectionL( const MDesCArray* aSelectedFiles );
+     
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CPslnCallImagePluginDRM();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        void CPslnCallImagePluginDRM::ShowErrorNoteL( TInt  aResourceId  ) const;
+
+    private:    // Data
+    
+        // Own: DRM helper
+        CDRMHelper* iDRMHelper;
+        
+    };
+
+#endif // PSLNCALLIMAGEPLUGINDRM_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/pslncallimageplugin/loc/pslncallimageplugin.loc	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for PslnCallImagePlugin
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+// d:Text of a list item in Main state's folder list.
+// d:Item opens Call Image folder.
+// l:list_single_large_graphic_pane_t1_cp2
+// w:
+// r:3.1
+//
+#define qtn_skins_title_call_image "Call image"
+
+
+// d:Text of a tab group item Call Image in Personalisation app's tab group.
+// d:Shown in tabgroup when a folder has been activated from Main state.
+// l:tabs_3_long_active_pane_t1
+// w:
+// r:3.1
+//
+#define qtn_skins_tabs_call_image "Call image"
+
+// d:Title pane text in Call image view.
+// l:title_pane_t2/opt9
+// w:
+// r:5.0
+//
+#define qtn_skins_title_pane_callimage "Call image"
+
+// d:List item in Call image view list. Shown as first item in the list.
+// d:Selects theme image used as call image. 
+// l:list_set_graphic_pane_t1
+// w:
+// r:3.2
+//
+#define qtn_skins_default_call_image "Theme image"
+
+// d:List item in Call image view list.
+// d:Selects user defined image used as call image. 
+// l:list_set_graphic_pane_t1
+// w:
+// r:3.2
+//
+#define qtn_skins_settings_browse "User defined"
+           
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/pslncallimageplugin/rom/PslnCallImagePlugin.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  PslnCallImagePlugin dll.
+*
+*/
+
+
+#ifndef PSLNCALLIMAGEPLUGIN_IBY
+#define PSLNCALLIMAGEPLUGIN_IBY
+
+#ifdef __CALL_IMAGETEXT
+
+data=DATAZ_\BITMAP_DIR\PslnCallImagePlugin.mif       BITMAP_DIR\PslnCallImagePlugin.mif
+data=ZSYSTEM\install\pslncallimageplugin_stub.SIS    System\Install\pslncallimageplugin_stub.SIS
+ECOM_PLUGIN( PslnCallImagePlugin.dll, 102818EE.rsc )
+
+#endif	// __CALL_IMAGETEXT
+
+#endif // PSLNCALLIMAGEPLUGIN_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/pslncallimageplugin/rom/PslnCallImagePluginResources.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  PslnCallImagePlugin ROM resources.
+*
+*/
+
+#ifndef PSLNCALLIMAGEPLUGINRESOURCES_IBY
+#define PSLNCALLIMAGEPLUGINRESOURCES_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+#ifdef __CALL_IMAGETEXT
+
+data=DATAZ_\RESOURCE_FILES_DIR\PslnCallImagePluginRsc.rsc   RESOURCE_FILES_DIR\PslnCallImagePluginRsc.rsc
+
+#endif	// __CALL_IMAGETEXT
+
+#endif // PSLNCALLIMAGEPLUGINRESOURCES_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/pslncallimageplugin/src/PslnCallImagePlugin.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,692 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View for Phone Application skinning.
+*
+*/
+
+
+// INCLUDE FILES
+
+// This plugin specific.
+#include <PslnCallImagePluginRsc.rsg>
+#include <pslncallimageplugin.mbg>
+#include "PslnCallImagePlugin.h"
+#include "PslnCallImagePluginContainer.h"
+#include "PslnCallImagePluginDRM.h"
+
+// General services.
+#include <gulicon.h>
+#include <bautils.h>
+#include <eikfrlbd.h>
+#include <StringLoader.h>
+#include <aknViewAppUi.h>
+#include <featmgr.h>
+#include <ConeResLoader.h>
+#include <pslninternalcrkeys.h>
+#include <AknsSrvClient.h>
+#include <aknnotewrappers.h>
+#include <AknsWallpaperUtils.h>
+
+// Psln Framework specific.
+#include <pslnfwviewuids.h>
+#include <psln.hrh>
+#include <pslncommon.rsg>
+
+// General services
+#include <MGFetch.h>
+
+// Resources
+#include <psln.rsg>
+
+// Logging
+#include "PslnCallImagePluginLogger.h"
+
+// CONSTANTS
+
+// Path to mbm file.
+_LIT( KPslnPhoneApplicationIconFileName, "z:PslnCallImagePlugin.mbm");
+
+// Path to compiled resource file.
+_LIT( KPslnCallImagePluginResourceFileName, "z:PslnCallImagePluginRsc.rsc" );
+
+// Path to common personalization resources. This resource file is meant for 
+// shared resources between application and plugins.
+_LIT( KPslnCommonResourceFileName, "z:pslncommon.rsc" );
+
+// Path to Psln application resource file. Plugin uses some localized texts from Psln's
+// resources,
+_LIT( KPslnApplicationResourceFileName, "z:Psln.rsc" );
+
+// Extension for scalable vector graphics file.
+_LIT( KAknsSkinSrvSvgFileExt, ".svg" );
+
+// Selected file.
+const TInt KPslnSelectedFile = 0;
+
+// Location of this plugin view within Psln's tab group.
+const TInt KPslnApplicationPhonePluginLocation = 5;
+
+const TInt KPslnFileArrayGranularity = 3;
+
+// Middle Softkey control ID.
+const TInt KPslnMSKControlId = 3;
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ----------------------------------------------------------------------------
+// CPslnCallImagePlugin::CPslnCallImagePlugin()
+// 
+// Constructor
+// ----------------------------------------------------------------------------
+//
+CPslnCallImagePlugin::CPslnCallImagePlugin( CAknViewAppUi* aAppUi )
+  : iResourceLoader( *iCoeEnv ), iResourceLoaderCommon( *iCoeEnv ), 
+    iResourceLoaderPsln( *iCoeEnv ), iAppUi ( aAppUi )
+    {
+    }    
+
+// ---------------------------------------------------------------------------
+// CPslnCallImagePlugin::NewL()
+// 
+// Symbian OS default constructor
+// ---------------------------------------------------------------------------
+CPslnCallImagePlugin* CPslnCallImagePlugin::NewL( TAny* aAppUi )
+    {
+    __CALLLOGSTRING("CPslnCallImagePlugin::NewL");
+    CAknViewAppUi* appUi = reinterpret_cast<CAknViewAppUi*>( aAppUi );
+    CPslnCallImagePlugin* self = new( ELeave ) CPslnCallImagePlugin ( appUi );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();    
+    CleanupStack::Pop();
+    
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CPslnCallImagePlugin::ConstructL()
+// 
+// Symbian OS two-phased constructor
+// ---------------------------------------------------------------------------
+void CPslnCallImagePlugin::ConstructL()
+    {
+    // Find the resource file:
+    TParse parse;
+    parse.Set( KPslnCommonResourceFileName, &KDC_APP_RESOURCE_DIR, NULL );      
+    TFileName* fileName = new (ELeave) TFileName( parse.FullName() );
+    CleanupStack::PushL( fileName );
+	
+    // Open resource file:
+    iResourceLoaderCommon.OpenL( *fileName );
+    
+    // Find the resource file:
+    parse.Set( KPslnApplicationResourceFileName, &KDC_APP_RESOURCE_DIR, NULL );
+    
+	OpenLocalizedResourceFileL( 
+        KPslnCallImagePluginResourceFileName, 
+        iResourceLoader );
+
+    CleanupStack::PopAndDestroy( fileName );
+
+    BaseConstructL( R_PSLN_CALL_IMAGE_VIEW );    
+    
+    __CALLLOGSTRING("CPslnCallImagePlugin::ConstructL -> METHOD COMPLETED");
+    }
+
+// ----------------------------------------------------------------------------
+// CPslnCallImagePlugin::~CPslnCallImagePlugin
+// 
+// Destructor
+// ----------------------------------------------------------------------------
+CPslnCallImagePlugin::~CPslnCallImagePlugin()
+    {
+    __CALLLOGSTRING("CPslnCallImagePlugin::~CPslnCallImagePlugin -> START");
+    iResourceLoaderCommon.Close();
+    iResourceLoaderPsln.Close();
+    iResourceLoader.Close();
+    __CALLLOGSTRING("CPslnCallImagePlugin::~CPslnCallImagePlugin -> METHOD COMPLETED");
+    }
+
+// ---------------------------------------------------------------------------
+// TUid CPslnCallImagePlugin::Id()
+// 
+// Returns view's ID.
+// ---------------------------------------------------------------------------
+TUid CPslnCallImagePlugin::Id() const
+    {
+    __CALLLOGSTRING("CPslnCallImagePlugin::Id");
+    return KPslnCallImagePluginUid;
+    }
+
+// ----------------------------------------------------------------------------
+// CPslnCallImagePlugin::GetCaption
+// 
+// Return application/view caption.
+// ----------------------------------------------------------------------------
+//
+void CPslnCallImagePlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    __CALLLOGSTRING("CPslnCallImagePlugin::GetCaptionL");
+    
+       // the resource file is already opened.
+    HBufC* result = StringLoader::LoadL( R_PSLN_CI_LIST_VIEW_CAPTION );
+    if ( aCaption.MaxLength() >= result->Length() )
+        {
+        aCaption.Copy( *result );
+        }
+    delete result;
+    }    
+
+// ----------------------------------------------------------------------------
+// CPslnCallImagePlugin::GetTabTextL
+// 
+// Return application/view caption.
+// ----------------------------------------------------------------------------
+//
+void CPslnCallImagePlugin::GetTabTextL( TDes& aCaption ) const
+    {
+    __CALLLOGSTRING("CPslnCallImagePlugin::GetTabTextL");
+    
+    // the resource file is already opened.
+    HBufC* result = StringLoader::LoadL( R_PSLN_CI_TAB_NAME );
+    if ( aCaption.MaxLength() >= result->Length() )
+        {
+        aCaption.Copy( *result );
+        }
+    delete result;
+    }
+
+// ----------------------------------------------------------------------------
+// CPslnCallImagePlugin::CreateIconL
+// 
+// Creates Main view icon.
+// ----------------------------------------------------------------------------
+//    
+CGulIcon* CPslnCallImagePlugin::CreateIconL()
+    {
+    __CALLLOGSTRING("CPslnCallImagePlugin::CreateIconL");
+
+    // Find the resource file:
+    TParse parse;
+    parse.Set( KPslnPhoneApplicationIconFileName, &KDC_APP_BITMAP_DIR, NULL );
+    TFileName fileName( parse.FullName() );
+    
+    CGulIcon* icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(), 
+        KAknsIIDQgnPropPslnCimageSub, 
+        fileName,
+        EMbmPslncallimagepluginQgn_prop_psln_cimage_sub,
+        EMbmPslncallimagepluginQgn_prop_psln_cimage_sub_mask
+        );
+
+    return icon;
+    }
+
+// -----------------------------------------------------------------------------
+// CPslnCallImagePlugin::GetLocationTypeAndIndex()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CPslnCallImagePlugin::GetLocationTypeAndIndex( 
+            TPslnFWLocationType& aType, 
+            TInt& aIndex ) const
+    {
+    __CALLLOGSTRING("CPslnCallImagePlugin::GetLocationTypeAndIndex");
+    aType = CPslnFWPluginInterface::EPslnFWSpecified;
+    aIndex = KPslnApplicationPhonePluginLocation;
+    }
+
+// ---------------------------------------------------------------------------
+// CPslnCallImagePlugin::HandleCommandL(TInt aCommand)
+// 
+// Handles commands directed to this class.
+// ---------------------------------------------------------------------------
+//
+void CPslnCallImagePlugin::HandleCommandL( TInt aCommand )
+    {
+    __CALLLOGSTRING("CPslnCallImagePlugin::HandleCommandL -> START");
+    switch ( aCommand )
+        {
+        case EPslnCmdAppDownload:
+        case EPslnCmdAppActivate:
+        case EAknSoftkeyOk:
+            if ( iContainer->iListBox->CurrentItemIndex() == 
+                 EPlsnCallImageThemeImage )
+                {
+                SetCallImageSettingL( EPlsnCRThemeImage );
+                }
+        	else if ( iContainer->iListBox->CurrentItemIndex() == 
+        	          EPlsnCallImageUserDefinedImage )
+            	{
+            	// Don't launch more than one image selection at time
+            	if ( !iVerifier )
+            	    {
+            	    __CALLLOGSTRING("CPslnCallImagePlugin::HandleCommandL -> SetCallImage");
+                    SetCallImageL();
+            	    }
+           		}
+           	else // EPlsnCallImageNone
+           		{
+           		TInt imageError = SetCallImagePath( KNullDesC );
+	            if ( imageError != KErrNone )
+	                {
+	                __CALLLOGSTRING1("CPslnCallImagePlugin::HandleCommandL -> SetCallImagePath error: %d", imageError);
+	        		HandleImageErrorsL( imageError );
+	                }
+	            SetCallImageSettingL( EPlsnCRCallImageNone );
+           		}           		 	
+           	// Update container.
+        	static_cast<CPslnCallImagePluginContainer*>
+        		(iContainer)->UpdateListBoxL();
+        	CheckMiddleSoftkeyLabelL();
+        	break;
+        case EAknSoftkeyBack:
+            if ( iAppUi->View( KPslnMainViewUid ) )
+                {
+                __CALLLOGSTRING("CPslnCallImagePlugin::HandleCommandL -> Activate PSLN");
+                iAppUi->ActivateLocalViewL( KPslnMainViewUid );
+                }
+            else
+                {
+                iAppUi->HandleCommandL( aCommand );
+                }
+            break;
+        case EPslnCmdAppHelp:
+        case EAknCmdHelp:
+            CPslnFWBaseView::HandleCommandL( aCommand );
+            break;
+        default:
+            // Help and Exit are handled by AppUi.
+            iAppUi->HandleCommandL( aCommand );
+            break;
+        }
+    __CALLLOGSTRING("CPslnCallImagePlugin::HandleCommandL -> METHOD COMPLETED");
+    }
+
+// ----------------------------------------------------------------------------
+// CPslnCallImagePlugin::DynInitMenuPaneL
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CPslnCallImagePlugin::DynInitMenuPaneL(  
+			TInt aResourceId, CEikMenuPane* aMenuPane  )
+    {
+    __CALLLOGSTRING("CPslnCallImagePlugin::DynInitMenuPaneL -> START");
+    if ( aResourceId == R_PSLN_GEN_VIEW_MENUPANE )
+    	{
+        // Since this is common resource it contains download - set it off.
+        aMenuPane->SetItemDimmed( EPslnCmdAppDownload, ETrue );
+        // Since this is common resource it contains activate - set it off.
+        aMenuPane->SetItemDimmed( EPslnCmdAppActivate, ETrue );      	         
+    	}
+   else if ( aResourceId == R_PSLN_CI_BASIC_MENUPANE )
+    	{
+    	TInt active = static_cast<CPslnCallImagePluginContainer*>
+                    (iContainer)->CurrentSelectionIndexL();
+        // Set menu item as Apply, if:
+        // a) 'None' is selected
+        // b) highlight is on inactive selection
+    	if ( active != iContainer->iListBox->CurrentItemIndex() && 
+    	    ( active == EPlsnCallImageNone || 
+    	      active ==  EPlsnCallImageThemeImage ) )
+        	{
+        	aMenuPane->SetItemDimmed( EPslnCmdAppActivate, EFalse );
+        	aMenuPane->SetItemDimmed( EPslnCmdAppDownload, ETrue );
+        	}
+        else if ( ( active == iContainer->iListBox->CurrentItemIndex() ) && 
+            ( active == EPlsnCallImageNone ||
+              active == EPlsnCallImageThemeImage ) )
+        	{
+        	aMenuPane->SetItemDimmed( EPslnCmdAppActivate, ETrue );
+        	aMenuPane->SetItemDimmed( EPslnCmdAppDownload, ETrue );
+        	}
+        else
+        	{
+        	aMenuPane->SetItemDimmed( EPslnCmdAppActivate, ETrue );
+        	aMenuPane->SetItemDimmed( EPslnCmdAppDownload, EFalse );
+        	}	
+	
+    	if( !FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+            {
+            // Disable help if not supported
+            aMenuPane->SetItemDimmed( EPslnCmdAppHelp, ETrue );
+            }
+    	}
+    __CALLLOGSTRING("CPslnCallImagePlugin::DynInitMenuPaneL <- END");
+    }
+
+// ---------------------------------------------------------------------------
+// CPslnCallImagePlugin::SetBoolL
+// 
+// Sets boolean to KCRUidThemes key.
+// ---------------------------------------------------------------------------
+//
+void CPslnCallImagePlugin::SetCallImageSettingL( const TInt aValue )
+	{
+	CRepository* setting = CRepository::NewL ( KCRUidThemes ); 
+	CleanupStack::PushL( setting );     
+	setting->Set( KThemesCallImageSetting, aValue );
+	CleanupStack::PopAndDestroy( setting );
+	}
+
+// ---------------------------------------------------------------------------
+// CPslnCallImagePlugin::SetPathL
+// 
+// Sets path to KCRUidThemes key.
+// ---------------------------------------------------------------------------
+//
+TInt CPslnCallImagePlugin::SetPathL( const TDesC& aPath )
+	{
+	CRepository* pathCen = CRepository::NewL ( KCRUidThemes ); 
+	CleanupStack::PushL( pathCen );    
+	TInt error = pathCen->Set( KThemesCallImagePath, aPath );
+	CleanupStack::PopAndDestroy( pathCen );
+	return error;
+	}
+	
+// ---------------------------------------------------------------------------
+// CPslnCallImagePlugin::SetCallImageL
+// 
+// Sets call image.
+// ---------------------------------------------------------------------------
+//
+void CPslnCallImagePlugin::SetCallImageL()
+	{
+	__CALLLOGSTRING("CPslnCallImagePlugin::SetCallImage -> START");
+	
+	TInt retVal( KErrNone );
+	CDesCArrayFlat* files = 
+    	new (ELeave) CDesCArrayFlat( KPslnFileArrayGranularity );
+	CleanupStack::PushL( files );
+	// Create DRM verifier
+	iVerifier = CPslnCallImagePluginDRM::NewL();
+	// Show images to user to select one	
+
+	TBool selectedItem = MGFetch::RunL( *files, EImageFile, EFalse, iVerifier );
+
+	if ( !iVerifier )
+		{
+        __CALLLOGSTRING("CPslnCallImagePlugin::SetCallImage DRM Error");
+		retVal = KErrCancel;
+	    }	    
+	else if( selectedItem && ( files->MdcaCount() > 0 ) )
+		{
+	    __CALLLOGSTRING("CPslnCallImagePlugin::SetCallImage Fetch successful");
+	    retVal = SetCallImagePath( files->MdcaPoint( KPslnSelectedFile ) );
+	    if ( retVal != KErrNone )
+	    	{
+	    	__CALLLOGSTRING1("CPslnCallImagePlugin::SetCallImage -> SetCallImagePath error: %d", retVal );
+	        HandleImageErrorsL( retVal );
+	        }
+	    }
+	else
+	   {
+       __CALLLOGSTRING("CPslnCallImagePlugin::SetCallImage Fetch cancelled");
+	   retVal = KErrCancel;
+	   }
+	   
+	if ( retVal == KErrNone )
+	    {
+	    // no way currently of checking corrupted svg:s
+	    if ( ( files->MdcaPoint( KPslnSelectedFile ).Right( 4 ) ).CompareF( KAknsSkinSrvSvgFileExt ) )
+	    	{
+	    	//Before setting image, check is the image corrputed
+	    	RAknsSrvSession skinsrv;
+	    	User::LeaveIfError( skinsrv.Connect() );
+	    	CleanupClosePushL( skinsrv );
+	    	CFbsBitmap* bmp = NULL;
+	    	CFbsBitmap* mask = NULL;
+			// (-1, -1) means that image is just decoded, not used    	
+	   	 	TRAP( retVal, skinsrv.DecodeWallpaperImageL( files->MdcaPoint( KPslnSelectedFile ), TSize(-1,-1), bmp, mask ) );
+	        CleanupStack::PopAndDestroy(); // skinsrv
+	    	}
+
+	    if( retVal == KErrNone )
+	        {
+	        // If image set without problems update setting.
+	        SetCallImageSettingL( EPlsnCRUserDefinedImage );
+	        }
+	   	else
+	   	     {
+             //File is corrupted
+             HandleImageErrorsL( retVal );
+	   	     }
+		}
+	
+	CleanupStack::PopAndDestroy( files );
+	
+	if ( iVerifier )
+	    {
+	    delete iVerifier;
+	    iVerifier = NULL;
+	    }
+	__CALLLOGSTRING("CPslnCallImagePlugin::SetCallImage -> METHOD COMPLETED");
+	}
+// ---------------------------------------------------------------------------
+// CPslnCallImagePlugin::HandleImageErrorsL
+// 
+// Handles image setting errors.
+// ---------------------------------------------------------------------------
+//
+void CPslnCallImagePlugin::HandleImageErrorsL( TInt aError )
+    {
+    __CALLLOGSTRING1("CPslnCallImagePlugin::HandleImageError aError: %d -> START", aError );    
+    TInt resourceId = KErrNone;
+    if ( aError == KErrNoMemory )
+        {
+        // Out of memory when handling the image,
+        User::Leave( aError );
+        }    
+    else
+        {
+        // Image is corrupted or in wrong format
+        resourceId = R_PSLN_IMAGE_CORRUPTED;        
+        }
+
+    // Show information note
+    HBufC* prompt = iCoeEnv->AllocReadResourceLC( resourceId );
+    CAknInformationNote* note = new (ELeave) CAknInformationNote( ETrue );
+    note->ExecuteLD( *prompt );
+    CleanupStack::PopAndDestroy( prompt );
+    __CALLLOGSTRING("CPslnCallImagePlugin::HandleImageError -> METHOD COMPLETED");
+    }
+
+// -----------------------------------------------------------------------------
+// CPslnCallImagePlugin::SetCallImagePath
+// Set call image path.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CPslnCallImagePlugin::SetCallImagePath( const TDesC& aImagePath )
+    {
+    __CALLLOGSTRING("CPslnCallImagePlugin::SetCallImagePath -> START");
+    TInt retVal(KErrNone);
+    // If CentralRepository set fails caller will handle the error code.
+    if( aImagePath.Length() >= 0 )
+        {
+        retVal = SetPathL( aImagePath );    
+        }
+    else
+    	{
+    	retVal = KErrPathNotFound;
+    	}
+    	
+	__CALLLOGSTRING("CPslnCallImagePlugin::SetCallImage -> METHOD COMPLETED");
+    return retVal;
+    }
+
+// ----------------------------------------------------------------------------
+// CPslnCallImagePlugin::Container
+// 
+// Return handle to container class.
+// ----------------------------------------------------------------------------
+//
+CPslnCallImagePluginContainer* CPslnCallImagePlugin::Container()
+    {
+    return static_cast<CPslnCallImagePluginContainer*>( iContainer );
+    }
+
+// ----------------------------------------------------------------------------
+// CPslnCallImagePlugin::DoActivateL
+// 
+// First method called by the Avkon framwork to invoke a view.
+// ----------------------------------------------------------------------------
+//
+void CPslnCallImagePlugin::DoActivateL( const TVwsViewId& aPrevViewId,
+                                     TUid aCustomMessageId,
+                                     const TDesC8& aCustomMessage )
+    {
+    __CALLLOGSTRING("CPslnCallImagePlugin::DoActivateL");
+    CPslnFWBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );    
+
+    // If called from Psln - set tab group location.
+    if ( iAppUi->View( KPslnMainViewUid ) )
+        {
+        // This tries to set the plugin to the given location in Tab.
+        CPslnFWBaseView::SetTabIndex( KPslnApplicationPhonePluginLocation );
+        // This is the location that PslnFW actually put the plugin into. 
+        TInt ciRealLocation = CPslnFWBaseView::GetTabIndex();
+        CPslnFWBaseView::SetNaviPaneL( ciRealLocation );
+        }
+    else
+        {
+        CPslnFWBaseView::SetNaviPaneL();
+        }
+        
+    if ( iContainer )
+        {
+        TInt currentItem = static_cast<CPslnCallImagePluginContainer*>
+                    (iContainer)->CurrentSelectionIndexL();
+        // Set highlight to selected item.
+        iContainer->iListBox->SetCurrentItemIndexAndDraw( currentItem );
+        }
+    // Check middle softkey.    
+    CheckMiddleSoftkeyLabelL();
+    }
+                                
+// ----------------------------------------------------------------------------
+// CPslnCallImagePlugin::DoDeactivate
+// 
+// Called by the Avkon view framework when closing.
+// ----------------------------------------------------------------------------
+//
+void CPslnCallImagePlugin::DoDeactivate()
+    {
+    __CALLLOGSTRING("CPslnCallImagePlugin::DoDeactivate");
+    CPslnFWBaseView::DoDeactivate();
+    }
+
+// ---------------------------------------------------------------------------
+// CPslnCallImagePlugin::NewContainerL()
+// 
+// Creates new iContainer.
+// ---------------------------------------------------------------------------
+//
+void CPslnCallImagePlugin::NewContainerL()
+    {
+    __CALLLOGSTRING("CPslnCallImagePlugin::NewContainerL");
+    iContainer = new( ELeave ) CPslnCallImagePluginContainer;
+    iContainer->SetMiddleSoftkeyObserver( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CPslnCallImagePlugin::HandleListBoxSelectionL()
+// 
+// Handles events raised through a rocker key.
+// ---------------------------------------------------------------------------
+//
+void CPslnCallImagePlugin::HandleListBoxSelectionL()
+    {
+    __CALLLOGSTRING("CPslnCallImagePlugin::HandleListBoxSelectionL");
+    HandleCommandL( EAknSoftkeyOk );
+    }
+
+// ---------------------------------------------------------------------------
+// CPslnCallImagePlugin::CheckMiddleSoftkeyLabelL()
+// 
+// 
+// ---------------------------------------------------------------------------
+//
+void CPslnCallImagePlugin::CheckMiddleSoftkeyLabelL()
+    {  
+    // First remove any prevous commands.
+    RemoveCommandFromMSK();
+
+    if ( iContainer )
+        {
+        TInt currentlyActive = static_cast<CPslnCallImagePluginContainer*>
+                    (iContainer)->CurrentSelectionIndexL();
+        TInt currentItem = iContainer->iListBox->CurrentItemIndex();
+        // Set MSK label.
+        if ( currentlyActive != currentItem && 
+             ( currentItem == EPlsnCallImageNone ||
+               currentItem == EPlsnCallImageThemeImage ) )  
+            {
+            // Set middle softkey as Apply, if:
+            // a) 'None' is selected
+            // b) highlight is on inactive selection
+            CPslnFWBaseView::SetMiddleSoftKeyLabelL( 
+                R_PSLN_MSK_ACTIVATE,
+                EPslnCmdAppActivate );
+            }
+        else if( ( currentlyActive == currentItem ) && 
+            ( currentlyActive == EPlsnCallImageNone ||
+                currentlyActive == EPlsnCallImageThemeImage ) )
+            {
+            CPslnFWBaseView::SetMiddleSoftKeyLabelL( 
+                R_TEXT_SOFTKEY_EMPTY, 
+                EPslnCmdEmptyCommand );
+            }
+        else
+            {
+            // Otherwise set middle softkey as Change. 
+            CPslnFWBaseView::SetMiddleSoftKeyLabelL( 
+                R_PSLN_MSK_CHANGE,
+                EPslnCmdAppDownload );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPslnCallImagePlugin::RemoveCommandFromMSK()
+// 
+// 
+// ---------------------------------------------------------------------------
+//
+void CPslnCallImagePlugin::RemoveCommandFromMSK()
+    {
+    CEikButtonGroupContainer* cbaGroup = Cba();
+    if ( cbaGroup )
+        {
+        cbaGroup->RemoveCommandFromStack( KPslnMSKControlId, EPslnCmdAppActivate );
+        cbaGroup->RemoveCommandFromStack( KPslnMSKControlId, EPslnCmdAppDownload );
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// CPslnCallImagePlugin::SetTitlePaneL()
+// 
+// Gives resource ID to be used as plugin view title.
+// ---------------------------------------------------------------------------
+//  
+void CPslnCallImagePlugin::SetTitlePaneL( TInt& aResourceId )
+    {
+#ifdef RD_CONTROL_PANEL
+    aResourceId = R_PSLN_TITLE_PANE_CALLIMAGE;
+#endif // RD_CONTROL_PANEL
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/pslncallimageplugin/src/PslnCallImagePluginContainer.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,235 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for the Data sub-folder
+*
+*/
+
+
+// INCLUDE FILES
+
+// From this plugin.
+#include "PslnCallImagePluginContainer.h"
+
+// From PSLN framework
+#include <pslnfwbaseview.h>
+#include <pslnfwiconhelper.h>
+#include <csxhelp/skins.hlp.hrh>
+
+// Resources
+#include <PslnCallImagePluginRsc.rsg>
+
+// General services
+#include <aknlists.h>
+#include <featmgr.h>
+#include <AknUtils.h>
+#include <pslninternalcrkeys.h>
+#include <bautils.h>
+
+// Logging
+#include "PslnCallImagePluginLogger.h"
+
+// CONSTANTS
+// Number of Call Image plugin items.
+const TInt KPslnCallImageItems = 3;
+
+// PSLN application UID.
+const TUid KUidPslnApp = { 0x10005A32 };
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CPslnCallImagePluginContainer::ConstructL()
+// 
+// Symbian OS two phased constructor
+// ---------------------------------------------------------------------------
+//
+void CPslnCallImagePluginContainer::ConstructL( const TRect& aRect )
+    {
+    __CALLLOGSTRING("CPslnCallImagePluginContainer::ConstructL -> START");
+    iListBox = new( ELeave ) CAknSingleGraphicStyleListBox;
+   					 
+    BaseConstructL( aRect, 0, R_PSLN_CI_VIEW_LBX );
+    __CALLLOGSTRING("CPslnCallImagePluginContainer::ConstructL -> COMPLETED");
+    }
+
+// ---------------------------------------------------------------------------
+// CPslnCallImagePluginContainer::~CPslnCallImagePluginContainer()
+// 
+// Destructor 
+// ---------------------------------------------------------------------------
+//
+CPslnCallImagePluginContainer::~CPslnCallImagePluginContainer()
+    {
+    __CALLLOGSTRING("CPslnCallImagePluginContainer::~CPslnCallImagePluginContainer -> START");
+    delete iItemBuf;
+    delete iItems;  
+    __CALLLOGSTRING("CPslnCallImagePluginContainer::~CPslnCallImagePluginContainer -> COMPLETED");
+    }
+
+// ---------------------------------------------------------------------------
+// CPslnCallImagePluginContainer::UpdateListBoxL()
+// 
+// Update listbox item.
+// ---------------------------------------------------------------------------
+//
+void CPslnCallImagePluginContainer::UpdateListBoxL()
+    {
+    __CALLLOGSTRING("CPslnCallImagePluginContainer::UpdateListBoxL -> START");
+    iItemArray->Reset();
+    CreateListBoxItemsL();
+    iListBox->HandleItemRemovalL();
+    iListBox->DrawDeferred();
+    __CALLLOGSTRING("CPslnCallImagePluginContainer::UpdateListBoxL -> COMPLETED");
+    }
+// ---------------------------------------------------------------------------
+// CPslnCallImagePluginContainer::CurrentSelectionIndex
+// 
+// Sets tap for the selection.
+// ---------------------------------------------------------------------------
+//
+TInt CPslnCallImagePluginContainer::CurrentSelectionIndexL()
+	{
+	__CALLLOGSTRING("CPslnCallImagePluginContainer::CurrentSelectionIndexL-> START");
+	TInt itemIndex(KErrNotFound);
+    TInt error(KErrNone);
+    TInt currentSetting(0);
+
+    CRepository* callImageSupp = CRepository::NewL ( KCRUidThemes ); 
+	CleanupStack::PushL( callImageSupp );     
+	error = callImageSupp->Get( KThemesCallImageSetting, currentSetting );
+       
+    // Verify that the image exists.
+    TFileName callImagePath;
+    error = callImageSupp->Get( KThemesCallImagePath, callImagePath );
+    TBool imageExists = ( callImagePath.Length() && 
+        BaflUtils::FileExists( CCoeEnv::Static()->FsSession(), 
+        callImagePath ) ); 
+    
+    if( error != KErrNone ) 
+    	{
+        return error;
+        }
+        
+    // Map CR value to list box index.
+    switch ( currentSetting )
+        {
+        case EPlsnCRCallImageNone:
+            itemIndex = EPlsnCallImageNone;
+            break;
+        case EPlsnCRUserDefinedImage:
+            if ( !imageExists )
+                {
+                itemIndex = EPlsnCallImageNone;
+                }
+            else
+                {
+                itemIndex = EPlsnCallImageUserDefinedImage;
+                }            
+            break;
+        case EPlsnCRThemeImage:
+        default:
+            itemIndex = EPlsnCallImageThemeImage;
+            break;
+        }
+    CleanupStack::PopAndDestroy( callImageSupp );
+    __CALLLOGSTRING("CPslnCallImagePluginContainer::CurrentSelectionIndexL -> COMPLETED");
+    return itemIndex;
+	}
+    
+// ---------------------------------------------------------------------------
+// CPslnCallImagePluginContainer::ConstructListBoxL()
+// 
+// Construct the listbox from resource array.
+// ---------------------------------------------------------------------------
+//
+void CPslnCallImagePluginContainer::ConstructListBoxL( TInt aResLbxId )
+    {
+    __CALLLOGSTRING("CPslnCallImagePluginContainer::ConstructListBoxL-> START");
+    iListBox->ConstructL( this, EAknListBoxSelectionList );
+
+    iItemArray = static_cast<CDesCArray*>
+        ( iListBox->Model()->ItemTextArray() );
+        
+    iItems = iCoeEnv->ReadDesC16ArrayResourceL( aResLbxId );
+    
+    CreateListBoxItemsL();  
+    __CALLLOGSTRING("CPslnCallImagePluginContainer::ConstructListBoxL -> COMPLETED");
+    }
+
+// ---------------------------------------------------------------------------
+// CPslnCallImagePluginContainer::CreateListBoxItemsL()
+// 
+// Create listbox items.
+// ---------------------------------------------------------------------------
+//
+void CPslnCallImagePluginContainer::CreateListBoxItemsL()
+    {
+    __CALLLOGSTRING("CPslnCallImagePluginContainer::CreateListBoxItemsL -> START");
+    TInt selectedItem = CurrentSelectionIndexL();
+    if ( selectedItem < 0 )
+        {
+        selectedItem = 0;
+        } 
+        
+        for( TInt i = 0; i < KPslnCallImageItems; i++ )
+        {
+        if ( i > iItems->Count() )
+            {
+            User::Leave( KErrOverflow );
+            }
+        iItemBuf = (*iItems)[i].AllocL();
+        if ( iItemBuf )
+            {            
+            iItemBuf = iItemBuf->ReAllocL( iItemBuf->Length() + 4 );
+            TPtr ptr = iItemBuf->Des();
+            if ( selectedItem == i )
+                {
+                ptr.Insert( 0, KPslnFWActiveListItemFormat );
+                }
+            else
+                {            
+                ptr.Insert( 0, KPslnFWNonActiveListItemFormat );
+                }
+            iItemArray->InsertL( i, ptr );
+            delete iItemBuf;
+            iItemBuf = NULL;
+            }
+        }        
+    // Create pre- and post-text icons.
+    CPslnFWIconHelper* iconHelper = CPslnFWIconHelper::NewL();
+    CleanupStack::PushL( iconHelper );   
+    iconHelper->AddIconsToSettingItemsL( 
+        ETrue, 
+        1,
+        iListBox );
+    CleanupStack::PopAndDestroy( iconHelper );
+    
+    iListBox->HandleItemAdditionL();
+    __CALLLOGSTRING("CCPslnCallImagePluginContainer::CreateListBoxItemsL -> COMPLETED");
+    }
+    
+// ---------------------------------------------------------------------------
+// CPslnCallImagePluginContainer::GetHelpContext()
+// 
+// Gets Help context.
+// ---------------------------------------------------------------------------
+//
+void CPslnCallImagePluginContainer::GetHelpContext(
+    TCoeHelpContext& aContext ) const
+    {
+    aContext.iMajor = KUidPslnApp;
+    aContext.iContext = KSKINS_HLP_CIMAGE_SETTINGS;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/pslncallimageplugin/src/PslnCallImagePluginDRM.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,152 @@
+/*
+* 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:  Implementation of CPslnCallImagePluginDRM class.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "PslnCallImagePluginDRM.h"
+
+#include    <DRMHelper.h>
+#include    <coemain.h>
+#include    <aknnotewrappers.h>
+#include    <psln.rsg>
+#include    <drmutility.h>
+
+// Logging
+#include    "PslnCallImagePluginLogger.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CCPslnCallImagePluginDRM::CPslnCallImagePluginDRM
+// C++ default constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CPslnCallImagePluginDRM::CPslnCallImagePluginDRM()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPslnCallImagePluginDRM::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPslnCallImagePluginDRM::ConstructL()
+    {
+    __CALLLOGSTRING("CPslnCallImagePluginDRM::ConstructL");
+    iDRMHelper = CDRMHelper::NewL( *CCoeEnv::Static() );
+    }
+
+// -----------------------------------------------------------------------------
+// CPslnCallImagePluginDRM::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPslnCallImagePluginDRM* CPslnCallImagePluginDRM::NewL()
+    {
+    CPslnCallImagePluginDRM* self = new( ELeave ) CPslnCallImagePluginDRM();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPslnCallImagePluginDRM::~CPslnCallImagePluginDRM
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CPslnCallImagePluginDRM::~CPslnCallImagePluginDRM()
+    {
+    __CALLLOGSTRING("CPslnCallImagePluginDRM::~CPslnCallImagePluginDRM");
+    delete iDRMHelper;
+    iDRMHelper = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CPslnCallImagePluginDRM::IsFileValidL
+// Empty implementation.
+// -----------------------------------------------------------------------------
+//
+TBool CPslnCallImagePluginDRM::VerifySelectionL(const MDesCArray* aSelectedFiles)
+    {
+    __CALLLOGSTRING("CPslnCallImagePluginDRM::VerifySelectionL START");
+
+    TBool canbeautomated( EFalse );
+    TBool iDrmProtected( EFalse );
+    TInt res( KErrNone );
+    RFile fileHandle;
+    TUint fileMode = EFileShareReadersOrWriters | EFileStream | EFileRead;
+    RFs fs = CCoeEnv::Static()->FsSession();
+    
+    if( aSelectedFiles->MdcaCount()<1 )
+        {
+        __CALLLOGSTRING("CPslnCallImagePluginDRM::VerifySelectionL zero items");
+        __CALLLOGSTRING("CPslnCallImagePluginDRM::VerifySelectionL RETURN TRUE");
+        // Download item
+        return ETrue;
+        }
+ 
+    User::LeaveIfError(fileHandle.Open(fs, aSelectedFiles->MdcaPoint(0), fileMode));
+    CleanupClosePushL(fileHandle);
+     
+    DRM::CDrmUtility* drmUtil = DRM::CDrmUtility::NewLC();
+    iDrmProtected = drmUtil->IsProtectedL(fileHandle);
+     
+    CleanupStack::PopAndDestroy(2); // fileHandle, drmUtil
+    
+    if( !iDrmProtected )
+        {
+        res = iDRMHelper->SetAutomatedType( CDRMHelper::EAutomatedTypeWallpaper );
+        __CALLLOGSTRING1("CPslnCallImagePluginDRM::VerifySelectionL SetAutomatedType called, result=%d", res );
+        if ( res == KErrNone )
+            {        
+            res = iDRMHelper->CanSetAutomated(
+                aSelectedFiles->MdcaPoint(0), 
+                canbeautomated );
+            }
+        }
+        
+    __CALLLOGSTRING1("CPslnCallImagePluginDRM::VerifySelectionL Automated called, value=%d", canbeautomated);
+    __CALLLOGSTRING1("CPslnCallImagePluginDRM::VerifySelectionL Automated called, result=%d", res);
+    if (!res && !canbeautomated)
+        {
+        ShowErrorNoteL( R_PSLN_QTN_DRM_PREV_RIGHTS_SET );
+        }
+    else if (res || !canbeautomated)
+        {
+        iDRMHelper->HandleErrorL(res, aSelectedFiles->MdcaPoint(0) );
+        }
+    
+    __CALLLOGSTRING("CPslnCallImagePluginDRM::VerifySelectionL RETURNING");
+    return canbeautomated;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPslnCallImagePluginDRM::ShowErrorNoteL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPslnCallImagePluginDRM::ShowErrorNoteL( TInt  aResourceId  ) const
+    {
+    HBufC* errorText = 
+        CCoeEnv::Static()->AllocReadResourceLC( aResourceId );
+    CAknInformationNote* note = new( ELeave ) CAknInformationNote( EFalse );
+    note->ExecuteLD( *errorText );
+    CleanupStack::PopAndDestroy( errorText );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/pslncallimageplugin/src/PslnCallImagePluginImplementationTable.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for PslnCallImagePlugin
+*
+*/
+
+
+// INCLUDES
+#include "PslnCallImagePlugin.h"
+
+#include <e32std.h>
+#include <implementationproxy.h>
+
+
+// CONSTANTS
+const TImplementationProxy PslnCallImagePluginImplementationTable[] = 
+    {
+    IMPLEMENTATION_PROXY_ENTRY( 0x102818EF,    CPslnCallImagePlugin::NewL )
+    };
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// 
+// Gate/factory function
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
+                                                  TInt& aTableCount )
+    {
+    aTableCount = sizeof( PslnCallImagePluginImplementationTable ) 
+        / sizeof( TImplementationProxy );
+    return PslnCallImagePluginImplementationTable;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/BMARM/BUBBLEMANAGERU.DEF	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,44 @@
+EXPORTS
+	"_._14CBubbleManager" @ 1 NONAME R3UNUSED ; CBubbleManager::~CBubbleManager(void)
+	ConferenceRowCount__C14CBubbleManager @ 2 NONAME R3UNUSED ; CBubbleManager::ConferenceRowCount(void) const
+	CreateCallHeader__14CBubbleManager @ 3 NONAME R3UNUSED ; CBubbleManager::CreateCallHeader(void)
+	CreateConference__14CBubbleManagerRCiT1 @ 4 NONAME R3UNUSED ; CBubbleManager::CreateConference(int const &, int const &)
+	CreateNumberEntry__14CBubbleManager @ 5 NONAME R3UNUSED ; CBubbleManager::CreateNumberEntry(void)
+	EndChanges__14CBubbleManager @ 6 NONAME R3UNUSED ; CBubbleManager::EndChanges(void)
+	GetNumberEntry__C14CBubbleManager @ 7 NONAME R3UNUSED ; CBubbleManager::GetNumberEntry(void) const
+	GetTextFromNumberEntry__14CBubbleManagerR6TDes16 @ 8 NONAME R3UNUSED ; CBubbleManager::GetTextFromNumberEntry(TDes16 &)
+	IsConferenceExpanded__C14CBubbleManager @ 9 NONAME R3UNUSED ; CBubbleManager::IsConferenceExpanded(void) const
+	IsNumberEntryUsed__C14CBubbleManager @ 10 NONAME R3UNUSED ; CBubbleManager::IsNumberEntryUsed(void) const
+	MoveHighlightOneDownInConference__14CBubbleManager @ 11 NONAME R3UNUSED ; CBubbleManager::MoveHighlightOneDownInConference(void)
+	MoveHighlightOneUpInConference__14CBubbleManager @ 12 NONAME R3UNUSED ; CBubbleManager::MoveHighlightOneUpInConference(void)
+	NewL__14CBubbleManagerRC11CCoeControlRC5TRect @ 13 NONAME R3UNUSED ; CBubbleManager::NewL(CCoeControl const &, TRect const &)
+	NewL__14CBubbleManagerRC11CCoeControlRC5TRecti @ 14 NONAME R3UNUSED ; CBubbleManager::NewL(CCoeControl const &, TRect const &, int)
+	RemoveCallHeader__14CBubbleManagerRCi @ 15 NONAME R3UNUSED ; CBubbleManager::RemoveCallHeader(int const &)
+	RemoveConference__14CBubbleManager @ 16 NONAME R3UNUSED ; CBubbleManager::RemoveConference(void)
+	RemoveNumberEntry__14CBubbleManager @ 17 NONAME R3UNUSED ; CBubbleManager::RemoveNumberEntry(void)
+	RemoveRowFromConference__14CBubbleManagerRCi @ 18 NONAME R3UNUSED ; CBubbleManager::RemoveRowFromConference(int const &)
+	SelectionIdInConference__C14CBubbleManager @ 19 NONAME R3UNUSED ; CBubbleManager::SelectionIdInConference(void) const
+	SelectionInConference__C14CBubbleManager @ 20 NONAME R3UNUSED ; CBubbleManager::SelectionInConference(void) const
+	SetCLI__14CBubbleManagerRCiRC7TDesC16RCQ214CBubbleManager23TPhoneClippingDirection @ 21 NONAME ; CBubbleManager::SetCLI(int const &, TDesC16 const &, CBubbleManager::TPhoneClippingDirection const &)
+	SetCNAP__14CBubbleManagerRCiRC7TDesC16RCQ214CBubbleManager23TPhoneClippingDirection @ 22 NONAME ; CBubbleManager::SetCNAP(int const &, TDesC16 const &, CBubbleManager::TPhoneClippingDirection const &)
+	SetCallFlag__14CBubbleManagerRCiRCQ214CBubbleManager19TPhoneCallTypeFlagsT1 @ 23 NONAME ; CBubbleManager::SetCallFlag(int const &, CBubbleManager::TPhoneCallTypeFlags const &, int const &)
+	SetCallFlags__14CBubbleManagerRCiRCUc @ 24 NONAME R3UNUSED ; CBubbleManager::SetCallFlags(int const &, unsigned char const &)
+	SetCallTime__14CBubbleManagerRCiRC7TDesC16 @ 25 NONAME R3UNUSED ; CBubbleManager::SetCallTime(int const &, TDesC16 const &)
+	SetExpandedConferenceCallHeader__14CBubbleManagerRCi @ 26 NONAME R3UNUSED ; CBubbleManager::SetExpandedConferenceCallHeader(int const &)
+	SetLabel__14CBubbleManagerRCiRC7TDesC16RCQ214CBubbleManager23TPhoneClippingDirection @ 27 NONAME ; CBubbleManager::SetLabel(int const &, TDesC16 const &, CBubbleManager::TPhoneClippingDirection const &)
+	SetLabel__14CBubbleManagerRCiRC7TDesC16T2RCQ214CBubbleManager23TPhoneClippingDirection @ 28 NONAME ; CBubbleManager::SetLabel(int const &, TDesC16 const &, TDesC16 const &, CBubbleManager::TPhoneClippingDirection const &)
+	SetNumberEntryVisible__14CBubbleManagerRCi @ 29 NONAME R3UNUSED ; CBubbleManager::SetNumberEntryVisible(int const &)
+	SetNumberType__14CBubbleManagerRCiRCQ214CBubbleManager16TPhoneNumberType @ 30 NONAME R3UNUSED ; CBubbleManager::SetNumberType(int const &, CBubbleManager::TPhoneNumberType const &)
+	SetPbkNumberType__14CBubbleManagerRCii @ 31 NONAME R3UNUSED ; CBubbleManager::SetPbkNumberType(int const &, int)
+	SetPhoneMuted__14CBubbleManagerRCi @ 32 NONAME R3UNUSED ; CBubbleManager::SetPhoneMuted(int const &)
+	SetSelectionIdInConference__14CBubbleManagerRCi @ 33 NONAME R3UNUSED ; CBubbleManager::SetSelectionIdInConference(int const &)
+	SetSelectionInConference__14CBubbleManagerRCUc @ 34 NONAME R3UNUSED ; CBubbleManager::SetSelectionInConference(unsigned char const &)
+	SetState__14CBubbleManagerRCiRCQ214CBubbleManager15TPhoneCallState @ 35 NONAME R3UNUSED ; CBubbleManager::SetState(int const &, CBubbleManager::TPhoneCallState const &)
+	SetTextToNumberEntry__14CBubbleManagerRC7TDesC16 @ 36 NONAME R3UNUSED ; CBubbleManager::SetTextToNumberEntry(TDesC16 const &)
+	SetThumbnail__14CBubbleManagerRCiP10CFbsBitmapT2 @ 37 NONAME ; CBubbleManager::SetThumbnail(int const &, CFbsBitmap *, CFbsBitmap *)
+	StartChanges__14CBubbleManager @ 38 NONAME R3UNUSED ; CBubbleManager::StartChanges(void)
+	UpdateCLI__14CBubbleManagerRCiRC7TDesC16RCQ214CBubbleManager23TPhoneClippingDirection @ 39 NONAME ; CBubbleManager::UpdateCLI(int const &, TDesC16 const &, CBubbleManager::TPhoneClippingDirection const &)
+	UpdateCallHeaderText__14CBubbleManagerRCiRC7TDesC16T2RCQ214CBubbleManager23TPhoneClippingDirection @ 40 NONAME ; CBubbleManager::UpdateCallHeaderText(int const &, TDesC16 const &, TDesC16 const &, CBubbleManager::TPhoneClippingDirection const &)
+	UpdateCallTime__14CBubbleManagerRCiRC7TDesC16 @ 41 NONAME R3UNUSED ; CBubbleManager::UpdateCallTime(int const &, TDesC16 const &)
+	AddRowToConference__14CBubbleManagerRCi @ 42 NONAME R3UNUSED ; CBubbleManager::AddRowToConference(int const &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/BWINS/BUBBLEMANAGERU.DEF	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,65 @@
+EXPORTS
+	??1CBubbleManager@@UAE@XZ @ 1 NONAME ; CBubbleManager::~CBubbleManager(void)
+	?AddRowToConference@CBubbleManager@@QAEXABH@Z @ 2 NONAME ; void CBubbleManager::AddRowToConference(int const &)
+	?CancelVideoRingTone@CBubbleManager@@QAEXXZ @ 3 NONAME ; void CBubbleManager::CancelVideoRingTone(void)
+	?ChangeEditorMode@CBubbleManager@@QAEHH@Z @ 4 NONAME ; int CBubbleManager::ChangeEditorMode(int)
+	?ConferenceRowCount@CBubbleManager@@QBEEXZ @ 5 NONAME ; unsigned char CBubbleManager::ConferenceRowCount(void) const
+	?CreateCallHeader@CBubbleManager@@QAEHXZ @ 6 NONAME ; int CBubbleManager::CreateCallHeader(void)
+	?CreateConference@CBubbleManager@@QAEHABH0@Z @ 7 NONAME ; int CBubbleManager::CreateConference(int const &, int const &)
+	?CreateNumberEntry@CBubbleManager@@QAEXXZ @ 8 NONAME ; void CBubbleManager::CreateNumberEntry(void)
+	?EndChanges@CBubbleManager@@QAEXXZ @ 9 NONAME ; void CBubbleManager::EndChanges(void)
+	?GetEditorMode@CBubbleManager@@QBEHXZ @ 10 NONAME ; int CBubbleManager::GetEditorMode(void) const
+	?GetNumberEntry@CBubbleManager@@QBEPAVCCoeControl@@XZ @ 11 NONAME ; class CCoeControl * CBubbleManager::GetNumberEntry(void) const
+	?GetTextFromNumberEntry@CBubbleManager@@QAEXAAVTDes16@@@Z @ 12 NONAME ; void CBubbleManager::GetTextFromNumberEntry(class TDes16 &)
+	?HandleBackgroundImageChange@CBubbleManager@@QAEXXZ @ 13 NONAME ; void CBubbleManager::HandleBackgroundImageChange(void)
+	?IsConferenceExpanded@CBubbleManager@@QBEHXZ @ 14 NONAME ; int CBubbleManager::IsConferenceExpanded(void) const
+	?IsNumberEntryUsed@CBubbleManager@@QBEHXZ @ 15 NONAME ; int CBubbleManager::IsNumberEntryUsed(void) const
+	?MoveHighlightOneDownInConference@CBubbleManager@@QAEXXZ @ 16 NONAME ; void CBubbleManager::MoveHighlightOneDownInConference(void)
+	?MoveHighlightOneUpInConference@CBubbleManager@@QAEXXZ @ 17 NONAME ; void CBubbleManager::MoveHighlightOneUpInConference(void)
+	?MuteVideoRingTone@CBubbleManager@@QAEXXZ @ 18 NONAME ; void CBubbleManager::MuteVideoRingTone(void)
+	?NewL@CBubbleManager@@SAPAV1@ABVCCoeControl@@ABVTRect@@@Z @ 19 NONAME ; class CBubbleManager * CBubbleManager::NewL(class CCoeControl const &, class TRect const &)
+	?NewL@CBubbleManager@@SAPAV1@ABVCCoeControl@@ABVTRect@@H@Z @ 20 NONAME ; class CBubbleManager * CBubbleManager::NewL(class CCoeControl const &, class TRect const &, int)
+	?PrepareIcons@CBubbleManager@@QAEXXZ @ 21 NONAME ; void CBubbleManager::PrepareIcons(void)
+	?RemoveCallHeader@CBubbleManager@@QAEXABH@Z @ 22 NONAME ; void CBubbleManager::RemoveCallHeader(int const &)
+	?RemoveConference@CBubbleManager@@QAEXXZ @ 23 NONAME ; void CBubbleManager::RemoveConference(void)
+	?RemoveNumberEntry@CBubbleManager@@QAEXXZ @ 24 NONAME ; void CBubbleManager::RemoveNumberEntry(void)
+	?RemoveRowFromConference@CBubbleManager@@QAEXABH@Z @ 25 NONAME ; void CBubbleManager::RemoveRowFromConference(int const &)
+	?ResetEditorToDefaultValues@CBubbleManager@@QAEXXZ @ 26 NONAME ; void CBubbleManager::ResetEditorToDefaultValues(void)
+	?SelectionIdInConference@CBubbleManager@@QBEHXZ @ 27 NONAME ; int CBubbleManager::SelectionIdInConference(void) const
+	?SelectionInConference@CBubbleManager@@QBEEXZ @ 28 NONAME ; unsigned char CBubbleManager::SelectionInConference(void) const
+	?SetCLI@CBubbleManager@@QAEXABHABVTDesC16@@ABW4TPhoneClippingDirection@1@@Z @ 29 NONAME ; void CBubbleManager::SetCLI(int const &, class TDesC16 const &, enum CBubbleManager::TPhoneClippingDirection const &)
+	?SetCNAP@CBubbleManager@@QAEXABHABVTDesC16@@ABW4TPhoneClippingDirection@1@@Z @ 30 NONAME ; void CBubbleManager::SetCNAP(int const &, class TDesC16 const &, enum CBubbleManager::TPhoneClippingDirection const &)
+	?SetCallFlag@CBubbleManager@@QAEXABHABW4TPhoneCallTypeFlags@1@0@Z @ 31 NONAME ; void CBubbleManager::SetCallFlag(int const &, enum CBubbleManager::TPhoneCallTypeFlags const &, int const &)
+	?SetCallFlags@CBubbleManager@@QAEXABHABK@Z @ 32 NONAME ; void CBubbleManager::SetCallFlags(int const &, unsigned long const &)
+	?SetCallObjectFromTheme@CBubbleManager@@QAEXABH@Z @ 33 NONAME ; void CBubbleManager::SetCallObjectFromTheme(int const &)
+	?SetCallObjectImage@CBubbleManager@@QAEXABHABVTDesC16@@@Z @ 34 NONAME ; void CBubbleManager::SetCallObjectImage(int const &, class TDesC16 const &)
+	?SetCallObjectImage@CBubbleManager@@QAEXABHPAVCFbsBitmap@@1H@Z @ 35 NONAME ; void CBubbleManager::SetCallObjectImage(int const &, class CFbsBitmap *, class CFbsBitmap *, int)
+	?SetCallObjectText@CBubbleManager@@QAEXABHABVTDesC16@@@Z @ 36 NONAME ; void CBubbleManager::SetCallObjectText(int const &, class TDesC16 const &)
+	?SetCallTime@CBubbleManager@@QAEXABHABVTDesC16@@@Z @ 37 NONAME ; void CBubbleManager::SetCallTime(int const &, class TDesC16 const &)
+	?SetExpandedConferenceCallHeader@CBubbleManager@@QAEXABH@Z @ 38 NONAME ; void CBubbleManager::SetExpandedConferenceCallHeader(int const &)
+	?SetLabel@CBubbleManager@@QAEXABHABVTDesC16@@1ABW4TPhoneClippingDirection@1@@Z @ 39 NONAME ; void CBubbleManager::SetLabel(int const &, class TDesC16 const &, class TDesC16 const &, enum CBubbleManager::TPhoneClippingDirection const &)
+	?SetLabel@CBubbleManager@@QAEXABHABVTDesC16@@ABW4TPhoneClippingDirection@1@@Z @ 40 NONAME ; void CBubbleManager::SetLabel(int const &, class TDesC16 const &, enum CBubbleManager::TPhoneClippingDirection const &)
+	?SetNumberEntryVisible@CBubbleManager@@QAEXABH@Z @ 41 NONAME ; void CBubbleManager::SetNumberEntryVisible(int const &)
+	?SetNumberType@CBubbleManager@@QAEXABHABW4TPhoneNumberType@1@@Z @ 42 NONAME ; void CBubbleManager::SetNumberType(int const &, enum CBubbleManager::TPhoneNumberType const &)
+	?SetParticipantListCLI@CBubbleManager@@QAEXABHW4TBubbleParticipantListCLI@1@@Z @ 43 NONAME ; void CBubbleManager::SetParticipantListCLI(int const &, enum CBubbleManager::TBubbleParticipantListCLI)
+	?SetPbkNumberType@CBubbleManager@@QAEXABHH@Z @ 44 NONAME ; void CBubbleManager::SetPbkNumberType(int const &, int)
+	?SetPhCntNumberType@CBubbleManager@@QAEXABHW4TNumberType@MPhCntMatch@@@Z @ 45 NONAME ; void CBubbleManager::SetPhCntNumberType(int const &, enum MPhCntMatch::TNumberType)
+	?SetPhoneMuted@CBubbleManager@@QAEXABH@Z @ 46 NONAME ; void CBubbleManager::SetPhoneMuted(int const &)
+	?SetSelectionIdInConference@CBubbleManager@@QAEXABH@Z @ 47 NONAME ; void CBubbleManager::SetSelectionIdInConference(int const &)
+	?SetSelectionInConference@CBubbleManager@@QAEXABE@Z @ 48 NONAME ; void CBubbleManager::SetSelectionInConference(unsigned char const &)
+	?SetState@CBubbleManager@@QAEXABHABW4TPhoneCallState@1@@Z @ 49 NONAME ; void CBubbleManager::SetState(int const &, enum CBubbleManager::TPhoneCallState const &)
+	?SetTextToNumberEntry@CBubbleManager@@QAEXABVTDesC16@@@Z @ 50 NONAME ; void CBubbleManager::SetTextToNumberEntry(class TDesC16 const &)
+	?SetThumbnail@CBubbleManager@@QAEXABHPAVCFbsBitmap@@1H@Z @ 51 NONAME ; void CBubbleManager::SetThumbnail(int const &, class CFbsBitmap *, class CFbsBitmap *, int)
+	?SetVideoRingTone@CBubbleManager@@QAEXABVTDesC16@@W4TBubbleVideoPlayMode@1@HHPAVMBubbleVideoPlaybackObserver@@@Z @ 52 NONAME ; void CBubbleManager::SetVideoRingTone(class TDesC16 const &, enum CBubbleManager::TBubbleVideoPlayMode, int, int, class MBubbleVideoPlaybackObserver *)
+	?ShownHeaderCount@CBubbleManager@@QBEEXZ @ 53 NONAME ; unsigned char CBubbleManager::ShownHeaderCount(void) const
+	?StartChanges@CBubbleManager@@QAEXXZ @ 54 NONAME ; void CBubbleManager::StartChanges(void)
+	?StopVideoRingTone@CBubbleManager@@QAEXXZ @ 55 NONAME ; void CBubbleManager::StopVideoRingTone(void)
+	?UpdateCLI@CBubbleManager@@QAEXABHABVTDesC16@@ABW4TPhoneClippingDirection@1@@Z @ 56 NONAME ; void CBubbleManager::UpdateCLI(int const &, class TDesC16 const &, enum CBubbleManager::TPhoneClippingDirection const &)
+	?UpdateCallHeaderText@CBubbleManager@@QAEXABHABVTDesC16@@1ABW4TPhoneClippingDirection@1@@Z @ 57 NONAME ; void CBubbleManager::UpdateCallHeaderText(int const &, class TDesC16 const &, class TDesC16 const &, enum CBubbleManager::TPhoneClippingDirection const &)
+	?UpdateCallTime@CBubbleManager@@QAEXABHABVTDesC16@@@Z @ 58 NONAME ; void CBubbleManager::UpdateCallTime(int const &, class TDesC16 const &)
+	?SetTouchPaneVisible@CBubbleManager@@QAEXH@Z @ 59 NONAME ; void CBubbleManager::SetTouchPaneVisible(int)
+	?TouchPane@CBubbleManager@@QAEPAVMBubbleTouchPaneInterface@@XZ @ 60 NONAME ; class MBubbleTouchPaneInterface * CBubbleManager::TouchPane(void)
+	?PreloadCallThemeImage@CBubbleManager@@QAEXH@Z @ 61 NONAME ; void CBubbleManager::PreloadCallThemeImage(int)
+	?RemoveCustomElement@CBubbleManager@@QAEXABHPAVCTelBubbleCustomElement@@@Z @ 62 NONAME ; void CBubbleManager::RemoveCustomElement(int const &, class CTelBubbleCustomElement *)
+	?AddCustomElement@CBubbleManager@@QAEXABHPAVCTelBubbleCustomElement@@H@Z @ 63 NONAME ; void CBubbleManager::AddCustomElement(int const &, class CTelBubbleCustomElement *, int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Data/BubbleManager.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,402 @@
+/*
+* 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 all the resources for the module.
+*
+*/
+
+
+// RESOURCE IDENTIFIER
+NAME BMAN // 4 letter ID
+
+// INCLUDES
+#include <eikon.rh>
+#include <bubblemanager.mbg>
+#include <callstatus.mbg>
+#include <avkon.rh>
+#include <data_caging_paths_strings.hrh>
+
+// CONSTANTS 
+#define KBMResBitmapFile            "z:"APP_BITMAP_DIR"\\bubblemanager.mbm"
+#define KBMResCallStatusBitmapFile  "z:"APP_BITMAP_DIR"\\callstatus.mbm"
+
+// RESOURCE DEFINITIONS 
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf="BubbleManager"; }
+
+
+// -----------------------------------------------------------------------------
+//   
+// r_bubblemanager_big_waiting_anim
+// Big animation data
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE BMPANIM_DATA r_bubblemanager_big_waiting_anim
+    {
+    frameinterval = 500;
+    playmode = EAknBitmapAnimationPlayModeCycle;
+    frames = r_bubblemanager_big_waiting_image_array;
+    bmpfile = KBMResBitmapFile;
+    }
+
+// -----------------------------------------------------------------------------
+//   
+// r_bubblemanager_big_waiting_image_array
+// Big animation images
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_bubblemanager_big_waiting_image_array
+    {
+    items=
+        {
+        BMPANIM_FRAME 
+            { 
+            bmpid=EMbmBubblemanagerQgn_indi_call_waiting_1; 
+            maskid=EMbmBubblemanagerQgn_indi_call_waiting_1_mask;
+            },
+        BMPANIM_FRAME 
+            { 
+            bmpid=EMbmBubblemanagerQgn_indi_call_waiting_2; 
+            maskid=EMbmBubblemanagerQgn_indi_call_waiting_2_mask;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+// r_bubblemanager_small_waiting_anim
+// Small animation data
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE BMPANIM_DATA r_bubblemanager_small_waiting_anim
+    {
+    frameinterval = 500;
+    playmode = EAknBitmapAnimationPlayModeCycle;
+    frames = r_bubblemanager_small_waiting_image_array;
+    bmpfile = KBMResCallStatusBitmapFile;
+    }
+
+// -----------------------------------------------------------------------------
+//   
+// r_bubblemanager_small_waiting_image_array
+// Small animation images
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_bubblemanager_small_waiting_image_array
+    {
+    items=
+        {
+        BMPANIM_FRAME 
+            { 
+            bmpid=EMbmCallstatusQgn_indi_call_active; 
+            maskid=EMbmCallstatusQgn_indi_call_active_mask;
+            },
+        BMPANIM_FRAME 
+            { 
+            bmpid=EMbmCallstatusQgn_indi_call_active_2; 
+            maskid=EMbmCallstatusQgn_indi_call_active_2_mask;
+            }
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+//   
+// r_bubblemanager_editor
+// Number entry definion
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE PHONE_NUMBER_EDITOR r_bubblemanager_editor
+    {
+    maxChars = 100;
+    maxLines = 2;
+    truncation = <0x2026>; // three dots: ...
+    formats =
+        {
+        PHONE_NUMBER_EDITOR_FORMAT // 1 line, full width
+            {
+            top=112;
+            left=11;
+            bottom=130;
+            right=165;
+            lines=1;
+            bottomBaselineOffset=3;
+            baselineSeparation=18;
+            font=ELatinBold17;
+            },
+        PHONE_NUMBER_EDITOR_FORMAT // 2 lines, full width
+            {
+            top=94;
+            left=11;
+            bottom=130;
+            right=165;
+            lines=2;
+            bottomBaselineOffset=3;
+            baselineSeparation=18;
+            font=ELatinBold13;
+            },
+        PHONE_NUMBER_EDITOR_FORMAT // 1 line, narrowed width
+            {
+            top=112;
+            left=21;
+            bottom=130;
+            right=165;
+            lines=1;
+            bottomBaselineOffset=3;
+            baselineSeparation=18;
+            font=ELatinBold17;
+            },
+        PHONE_NUMBER_EDITOR_FORMAT // 2 lines, narrowed width
+            {
+            top=94;
+            left=21;
+            bottom=130;
+            right=165;
+            lines=2;
+            bottomBaselineOffset=3;
+            baselineSeparation=18;
+            font=ELatinBold13;
+            },
+        PHONE_NUMBER_EDITOR_FORMAT // 2 lines, full width, large font
+            {
+            top=0; // layout values read from layout API
+            left=0;
+            bottom=0;
+            right=0;
+            lines=2;
+            bottomBaselineOffset=0;
+            baselineSeparation=0;
+            font=ELatinBold17;
+            },                     
+// without status pane
+        PHONE_NUMBER_EDITOR_FORMAT // 1 line, full width
+            {
+            top=112+44;
+            left=11;
+            bottom=130+44;
+            right=165;
+            lines=1;
+            bottomBaselineOffset=3;
+            baselineSeparation=18;
+            font=ELatinBold17;
+            },
+        PHONE_NUMBER_EDITOR_FORMAT // 2 lines, full width
+            {
+            top=94+44;
+            left=11;
+            bottom=130+44;
+            right=165;
+            lines=2;
+            bottomBaselineOffset=3;
+            baselineSeparation=18;
+            font=ELatinBold13;
+            },
+        PHONE_NUMBER_EDITOR_FORMAT // 1 line, narrowed width
+            {
+            top=112+44;
+            left=21;
+            bottom=130+44;
+            right=165;
+            lines=1;
+            bottomBaselineOffset=3;
+            baselineSeparation=18;
+            font=ELatinBold17;
+            },
+        PHONE_NUMBER_EDITOR_FORMAT // 2 lines, narrowed width
+            {
+            top=94+44;
+            left=21;
+            bottom=130+44;
+            right=165;
+            lines=2;
+            bottomBaselineOffset=3;
+            baselineSeparation=18;
+            font=ELatinBold13;
+            },
+        PHONE_NUMBER_EDITOR_FORMAT // 2 lines, full width, large font
+            {
+            top=0; // layout values read from layout API
+            left=0;
+            bottom=0;
+            right=0;
+            lines=2;
+            bottomBaselineOffset=0;
+            baselineSeparation=0;
+            font=ELatinBold17;
+            }            
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+// r_bubblemanager_big_video_waiting_anim
+// Big animation data for video call
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE BMPANIM_DATA r_bubblemanager_big_video_waiting_anim
+    {
+    frameinterval = 500;
+    playmode = EAknBitmapAnimationPlayModeCycle;
+    frames = r_bubblemanager_big_video_waiting_image_array;
+    bmpfile = KBMResCallStatusBitmapFile;
+    }
+
+// -----------------------------------------------------------------------------
+//   
+// r_bubblemanager_big_video_waiting_image_array
+// Big animation images for video call
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_bubblemanager_big_video_waiting_image_array
+    {
+    items=
+        {
+        BMPANIM_FRAME
+            {
+            bmpid = EMbmCallstatusQgn_indi_call_video_1;
+            maskid = EMbmCallstatusQgn_indi_call_video_1_mask;
+            },
+        BMPANIM_FRAME
+            {
+            bmpid = EMbmCallstatusQgn_indi_call_video_2;
+            maskid = EMbmCallstatusQgn_indi_call_video_2_mask;
+            }
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+//   
+// r_bubblemanager_small_video_waiting_anim
+// Small animation data for video call
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE BMPANIM_DATA r_bubblemanager_small_video_waiting_anim
+    {
+    frameinterval = 500;
+    playmode = EAknBitmapAnimationPlayModeCycle;
+    frames = r_bubblemanager_small_video_waiting_image_array;
+    bmpfile = KBMResCallStatusBitmapFile;
+    }
+
+// -----------------------------------------------------------------------------
+//   
+// r_bubblemanager_small_video_waiting_image_array
+// Small animation images
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_bubblemanager_small_video_waiting_image_array
+    {
+    items=
+        {
+        BMPANIM_FRAME
+            {
+            bmpid = EMbmCallstatusQgn_indi_call_video_callsta_1;
+            maskid = EMbmCallstatusQgn_indi_call_video_callsta_1_mask;
+            },
+        BMPANIM_FRAME 
+            {
+            bmpid = EMbmCallstatusQgn_indi_call_video_callsta_2;
+            maskid = EMbmCallstatusQgn_indi_call_video_callsta_2_mask;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+// r_bubblemanager_big_voip_waiting_anim
+// Big animation data
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE BMPANIM_DATA r_bubblemanager_big_voip_waiting_anim
+    {
+    frameinterval = 500;
+    playmode = EAknBitmapAnimationPlayModeCycle;
+    frames = r_bubblemanager_big_voip_waiting_image_array;
+    bmpfile = KBMResBitmapFile;
+    }
+
+// -----------------------------------------------------------------------------
+//   
+// r_bubblemanager_big_voip_waiting_image_array
+// Big animation images
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_bubblemanager_big_voip_waiting_image_array
+    {
+    items=
+        {
+	BMPANIM_FRAME 
+            { 
+            bmpid=EMbmBubblemanagerQgn_indi_call_voip_waiting_1; 
+            maskid=EMbmBubblemanagerQgn_indi_call_voip_waiting_1_mask;
+			},
+        BMPANIM_FRAME 
+            { 
+            bmpid=EMbmBubblemanagerQgn_indi_call_voip_waiting_2; 
+            maskid=EMbmBubblemanagerQgn_indi_call_voip_waiting_2_mask;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+// r_bubblemanager_small_voip_waiting_anim
+// Small animation data
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE BMPANIM_DATA r_bubblemanager_small_voip_waiting_anim
+    {
+    frameinterval = 500;
+    playmode = EAknBitmapAnimationPlayModeCycle;
+    frames = r_bubblemanager_small_voip_waiting_image_array;
+    bmpfile = KBMResCallStatusBitmapFile;
+    }
+
+// -----------------------------------------------------------------------------
+//   
+// r_bubblemanager_small_voip_waiting_image_array
+// Small animation images
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_bubblemanager_small_voip_waiting_image_array
+    {
+    items=
+        {
+        BMPANIM_FRAME 
+            { 
+            bmpid=EMbmCallstatusQgn_indi_call_voip_active; 
+            maskid=EMbmCallstatusQgn_indi_call_voip_active_mask;
+            },
+        BMPANIM_FRAME 
+            { 
+            bmpid=EMbmCallstatusQgn_indi_call_voip_active_2; 
+            maskid=EMbmCallstatusQgn_indi_call_voip_active_2_mask;
+            }
+        };
+    }    
Binary file phoneuis/BubbleManager/Data/bubblemanager_stub.SIS has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Group/Bubblemanager.mmp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,126 @@
+/*
+* 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 project specification file for the Bubblemanager. 
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+// Capability assignment.
+CAPABILITY CAP_GENERAL_DLL
+
+// Assign Vendor ID.
+VENDORID VID_DEFAULT
+
+TARGET      bubblemanager.dll
+TARGETTYPE  dll
+UID         0x1000008d 0x100058FF 
+
+START RESOURCE ../Data/BubbleManager.rss
+HEADER
+TARGETPATH   RESOURCE_FILES_DIR 
+LANGUAGE_IDS
+END  // RESOURCE
+
+sourcepath  ../Src
+source  BMBubbleManager.cpp
+source  BMCallHeader.cpp
+source  BMBubblePlace.cpp
+source  BMBubbleOutlookBottom.cpp
+source  BMBubbleImageManager.cpp
+source  BMConfHeader.cpp
+source  BMBubbleHeader.cpp
+source  BMBubbleOutlook.cpp
+source  BMConfPane.cpp
+source  BMBubbleOutlookBottomRight.cpp
+source  BMBubbleOutlookMiddle.cpp
+source  BMBubbleOutlookTopLeft.cpp
+source  BMBubbleOutlookTopRight.cpp
+source  BMBubbleOutlookConference.cpp
+source  BMBubbleOutlookNE.cpp
+source  BMBubbleOutlookHide.cpp
+source  BMUtils.cpp
+source  BMPanic.cpp
+source  BMResourceManager.cpp
+source  BMBubbleOutlookTwoLined.cpp
+source  BMBubbleOutlookOneLined.cpp
+source  BMBubbleOutlookThreeLined.cpp
+source  BMBubbleOutlookMiddleCnap.cpp
+source  BMBubbleOutlookBottomCnap.cpp
+source  BMBubbleImage.cpp
+source  BMBubbleSkinBitmap.cpp
+source  BMBubbleOutlookFiveLined.cpp
+source  BMBubbleOutlookBottomText.cpp
+source  BMBubbleOutlookBottomImage.cpp
+source  BMCallObjectManager.cpp
+source  BMCallObjectUtils.cpp
+source  BMMediaReaderFactory.cpp
+source  BMMediaReader.cpp
+source  BMImageReader.cpp
+source  BMBubbleOutlookVideo.cpp
+source  BMBubbleOutlookVideoCnap.cpp
+source  BMVideoController.cpp
+source  BMBubbleVideoContainer.cpp    
+source  BMVideoPlayer.cpp
+source  BMBubbleOutlookBottomRiCnap.cpp
+source  BMBubbleOutlookBottomImCnap.cpp
+source  BMTouchPane.cpp
+source  BMCustomManager.cpp
+source  BMDefaultManager.cpp
+source  BMCallStatusIndi.cpp
+source  BMCallStatusIndiBig.cpp
+source  BMCallStatusIndiSmall.cpp
+source  BMCallStatusAnim.cpp
+source  BMCallStatusAnimBig.cpp
+source  BMCallStatusAnimSmall.cpp
+source  BMNumberTypeIcon.cpp
+source  BMMainPaneControl.cpp
+source  BMTouchPaneButton.cpp
+
+sourcepath ../laf
+source  BMLayout.cpp
+source  BMLayout2.cpp
+source  BMLayout3.cpp
+source  BMLayout4.cpp 
+source  BMLayout6.cpp
+
+USERINCLUDE . ../Inc ../Data ../laf ../bmcustomization/inc
+
+SYSTEMINCLUDE ../../../inc  // s60/app/telephony/inc
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY euser.lib cone.lib ws32.lib bmpanim.lib eikcore.lib
+LIBRARY eikcoctl.lib fbscli.lib bafl.lib 
+LIBRARY commonengine.lib
+LIBRARY aknskins.lib aknicon.lib avkon.lib
+LIBRARY numbergrouping.lib
+LIBRARY featmgr.lib
+LIBRARY cdlengine.lib
+LIBRARY aknlayout2scalable.lib
+LIBRARY gdi.lib
+LIBRARY bitgdi.lib
+LIBRARY egul.lib
+LIBRARY ihl.lib
+LIBRARY mediaclientvideo.lib
+LIBRARY efsrv.lib
+LIBRARY centralrepository.lib
+#ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
+LIBRARY gfxtrans.lib
+LIBRARY akntransitionutils.lib
+#endif
+LIBRARY bmcustomization.lib
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build file
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+#include "../bmcustomization/group/bld.inf"
+
+PRJ_PLATFORMS
+DEFAULT
+
+
+PRJ_EXPORTS
+../Inc/BMBubbleManager.h |../../../inc/bmbubblemanager.h
+../Inc/BMBubblePlace.h |../../../inc/bmbubbleplace.h
+../Inc/BMVideoPlaybackObserver.h |../../../inc/bmvideoplaybackobserver.h
+../Inc/BMTouchPaneInterface.h |../../../inc/bmtouchpaneinterface.h
+../Inc/BMTouchPane.rh |../../../inc/bmtouchpane.rh
+../Data/bubblemanager_stub.SIS /epoc32/data/z/system/install/bubblemanager_stub.sis
+
+../rom/Bubblemanager.iby    CORE_APP_LAYER_IBY_EXPORT_PATH(bubblemanager.iby)
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE bubblemanager.mif
+  OPTION HEADERFILE bubblemanager.mbg
+  OPTION SOURCEFILE iconlist.txt		  
+END
+
+PRJ_MMPFILES
+Bubblemanager.mmp
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Group/iconlist.txt	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,60 @@
+-c8,8 qgn_graf_call_first_one_active
+-c8,8 qgn_graf_call_first_one_disconn
+-c8,8 qgn_graf_call_first_one_held
+-c8,8 qgn_graf_call_rec_big
+-c8,8 qgn_graf_call_rec_big_disconn
+-c8,8 qgn_graf_call_rec_big_right
+-c8,8 qgn_graf_call_rec_big_right_disconn
+-c8,8 qgn_indi_call_waiting_1
+-c8,8 qgn_indi_call_waiting_disconn
+-c8,1 qgn_indi_call_waiting_cyph_off_1
+-c8,1 qgn_indi_call_waiting_disconn_cyph_off
+-c8,8 qgn_graf_call_first_one_active_emergency
+-c8,8 qgn_graf_call_two_active_emergency
+-c8,8 qgn_graf_call_conf_five
+-c8,8 qgn_graf_call_conf_four
+-c8,8 qgn_graf_call_conf_three
+-c8,8 qgn_graf_call_conf_two
+-c8,8 qgn_graf_call_first_three_active
+-c8,8 qgn_graf_call_first_three_disconn
+-c8,8 qgn_graf_call_first_three_held
+-c8,8 qgn_graf_call_first_two_active
+-c8,8 qgn_graf_call_first_two_disconn
+-c8,8 qgn_graf_call_first_two_held
+-c8,8 qgn_graf_call_first_wait_active
+-c8,8 qgn_graf_call_first_wait_disconn
+-c8,8 qgn_graf_call_hidden_held
+-c8,8 qgn_graf_call_rec_big_left
+-c8,8 qgn_graf_call_rec_big_left_disconn
+-c8,8 qgn_graf_call_rec_small_left
+-c8,8 qgn_graf_call_rec_small_right
+-c8,8 qgn_graf_call_rec_small_right_disconn
+-c8,8 qgn_graf_call_rec_bigger
+-c8,8 qgn_graf_call_second_three_active
+-c8,8 qgn_graf_call_second_three_disconn
+-c8,8 qgn_graf_call_second_three_held
+-c8,8 qgn_graf_call_second_two_active
+-c8,8 qgn_graf_call_second_two_disconn
+-c8,8 qgn_graf_call_second_two_held
+-c8,8 qgn_indi_call_active_conf
+-c8,8 qgn_indi_call_disconn_conf
+-c8,1 qgn_indi_call_diverted
+-c8,8 qgn_indi_call_held_conf
+-c8,8 qgn_indi_call_muted
+-c8,8 qgn_indi_call_waiting_2
+-c8,1 qgn_prop_nrtyp_mobile_div
+-c8,1 qgn_prop_nrtyp_phone_div
+-c8,8 qgn_indi_call_video_callsta_disconn
+-c8,1 qgn_indi_call_active_conf_cyph_off
+-c8,1 qgn_indi_call_active_cyph_off_2
+-c8,1 qgn_indi_call_disconn_conf_cyph_off
+-c8,1 qgn_indi_call_held_conf_cyph_off
+-c8,1 qgn_indi_call_waiting_cyph_off_2
+-c8,1 qgn_prop_nrtyp_home_div
+-c8,1 qgn_prop_nrtyp_work_div
+-c8,8 qgn_indi_call_voip_waiting_1
+-c8,8 qgn_indi_call_voip_callsta_disconn
+-c8,8 qgn_indi_call_voip_waiting_2
+-c8,8 qgn_graf_call_image_1
+-8 qgn_indi_call4_image_mask_prt
+-8 qgn_indi_call4_image_mask_lsc
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleDebug.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,108 @@
+/*
+* 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:  Macro definitions for tracing and debugging purposes.
+*
+*/
+
+
+#ifndef BM_DEBUG_H
+#define BM_DEBUG_H
+
+//#ifdef _DEBUG 
+
+// INCLUDES
+#include <e32svr.h>
+
+// CONSTANTS
+_LIT( KComponent, "[BUBBLEMANAGER]" );
+_LIT( KThisFile,  "[BUBBLEMANAGER] - Trace this file: %s, line: %d, compiled: %s %s" );
+_LIT( KAssertion, "[BUBBLEMANAGER] - Assertion failed: File: %s, line: %d, compiled: %s %s" );
+_LIT( KPanic,     "[BUBBLEMANAGER] - Panic occurred: File: %s, line: %d, compiled: %s %s" );
+_LIT( KMystic,    "[BUBBLEMANAGER] - Mystic failure: File: %s, line: %d, compiled: %s %s" );
+_LIT8( KDATE, __DATE__ );
+_LIT8( KTIME, __TIME__ );
+
+const TInt KTraceMaxSize = 256;
+
+// DATA TYPES
+enum TTraceType
+    {
+    ETraceInit,
+    ETraceAssert,
+    ETracePanic
+    };
+
+// INLINE FUNCTIONS
+ 
+ 
+
+    #define BM_TRACE_( AAA ) do\
+        { _LIT( logStr, AAA ); RDebug::Print( logStr ); } while ( 0 )
+    
+    #define BM_TRACE_1( AAA, BBB ) do\
+         { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB ); } while ( 0 )
+    
+    #define BM_TRACE_2( AAA, BBB, CCC ) do\
+         { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC ); } while ( 0 )
+    
+    #define BM_TRACE_3( AAA, BBB, CCC, DDD ) do\
+         { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC, DDD ); } while ( 0 )
+    
+    #define BM_TRACE_4( AAA, BBB, CCC, DDD, EEE ) do\
+         { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC, DDD, EEE ); } while ( 0 )
+    
+    #define BM_TRACE_RAW_( AAA ) do\
+        { RDebug::RawPrint( AAA ); } while ( 0 )
+        
+    #define BM_TRACE_RAW_1( AAA, BBB ) do\
+         { _LIT( logStr, AAA ); TBuf<KTraceMaxSize> buffer; buffer.Append( logStr ); buffer.Append( BBB );\
+         RDebug::RawPrint( buffer ); } while ( 0 )
+       
+
+    
+
+    
+/*
+#else // _DEBUG
+
+    #define TRACE_ASSERT( a )
+    #define TRACE_ASSERT_RETURN( a ) a
+    #define TRACE_ASSERT_ALWAYS
+
+    #define BM_TRACE_( AAA )
+    #define BM_TRACE_1( AAA, BBB )
+    #define BM_TRACE_2( AAA, BBB, CCC )
+    #define BM_TRACE_3( AAA, BBB, CCC, DDD )
+    #define BM_TRACE_4( AAA, BBB, CCC, DDD, EEE )
+    #define BM_TRACE_RAW_( AAA )
+    #define BM_TRACE_RAW_1( AAA, BBB )
+
+    #define API_TRACE_( AAA )
+    #define API_TRACE_1( AAA, BBB )
+    #define API_TRACE_2( AAA, BBB, CCC )
+    #define API_TRACE_3( AAA, BBB, CCC, DDD )
+    #define API_TRACE_4( AAA, BBB, CCC, DDD, EEE )
+    #define API_TRACE_RAW_1( AAA, BBB )
+
+    #define COMPONENT_TRACE_THIS_FILE
+
+    #define PANIC_IF_FALSE( a )
+    #define PANIC_IF_TRUE( a )
+    #define PANIC_ALWAYS
+
+#endif // _DEBUG
+*/
+#endif // BM_DEBUG_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleHeader.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,448 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 base class for headers
+*
+*/
+
+
+#ifndef BUBBLEHEADER_H
+#define BUBBLEHEADER_H
+
+// INCLUDES
+#include  "BMBubbleManager.h"
+   
+// CLASS DECLARATION
+
+/**
+*  CBubbleHeader class
+*
+*  Abstract base class for headers.
+*
+*  @lib bubblemanager
+*  @since 1.0
+*/
+
+class CBubbleHeader : public CBase
+    {
+    public:
+        // Different call image types
+        enum TBMCallObjectImageType
+            {
+            ENotDefined,
+            EThemeImage,
+            EGalleryImage,
+            ETextBasedImage    
+            };
+
+    public: // Constructors and destructor    
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleHeader();
+
+    public: // Member functions
+
+        /**
+        * To put everything in initial state.
+        */
+        virtual void Reset( ) = 0;
+
+        /**
+        * Next functions are for CBubbleManager to set current state
+        */
+
+        /**
+        * Set header in use/unuse.
+        * @param aIsUsed ETrue if header is take into use.
+        */
+        virtual void SetIsUsed( const TBool& aIsUsed ) = 0;
+
+        /**
+        * Set header to conference.
+        * @param aIsInConference ETrue if set in conference call.
+        *                        Panics if this is a conf header.
+        */
+        void SetIsInConference( const TBool& aIsInConference );
+
+        /**
+        * Set thumbnail image. Ownership is not tranferred.
+        * @param aThumbnailBitmap The bitmap. NULL means no thumbnail.
+        */
+        void SetTnBitmap( CFbsBitmap* aThumbnailBitmap );
+
+        /**
+        * Set thumbnail mask. Ownership is not tranferred.
+        * @param aThumbnailBitmapMask The bitmap. NULL means no mask.
+        */
+        void SetTnBitmapMask( CFbsBitmap* aThumbnailBitmapMask );
+        
+        /**
+        * Set thumbnail ownership. By default thumbnail bitmaps (image and mask) 
+        * are owned externally.
+        * @param aOwnership ETrue if ownership is transferred to header.
+        */
+        void SetTnDataOwnership( TBool aOwnership );
+
+        /**
+        * Set call object image. Ownership is not tranferred.
+        * @param aCOImageBitmap Pointer to bitmap. NULL means no image.
+        */
+        void SetCallObjectImage( CFbsBitmap* aCOImageBitmap );
+        
+        /**
+        * Set call object image mask. Ownership is not tranferred.
+        * @param aCOImageBitmapMask Pointer to mask. NULL means no mask.
+        */
+        void SetCallObjectImageMask( CFbsBitmap* aCOImageBitmapMask );
+
+        /**
+        * Set call object file name. Ownership is tranferred.
+        * @param aCOImageFileName Pointer to buffer holding the file name.
+        */
+        void SetCallObjectFileName( const HBufC* aCOFileName );
+        
+        /**
+        * Set call object text. Ownership is  tranferred.
+        * @param aCOText Pointer to buffer holding the text.
+        */
+        void SetCallObjectText( const HBufC* aCOText );
+        
+        /**
+        * Set call object image data ownership. By default image
+        * data (image and mask) is owned externally.
+        * @param aOwnership ETrue if ownership is transferred to header.
+        */
+        void SetCallObjectImageDataOwnership( TBool aOwnership );
+        
+        
+        /**
+        * Set type of assigned call image.
+        * @param aType The type.
+        */
+        void SetCallObjectImageType( 
+            TBMCallObjectImageType aType );
+        
+        /**
+        * Switches call image to thumbnail version, if available. 
+        * Bigger version is released. 
+        */
+        void SwitchToThumbnailImage();
+
+        /**
+        * Set call state.
+        * @param aPhoneCallState The state.
+        */
+        void SetCallState( 
+            const CBubbleManager::TPhoneCallState& aPhoneCallState );
+
+        /**
+        * Set number type.
+        * @param aNumberType The number type enum (see CBubbleManaher.h).
+        */
+        void SetNumberType( 
+            const CBubbleManager::TPhoneNumberType& aNumberType );
+
+        /**
+        * Set call flags.
+        * @param aCallFlags Call flags (see CBubbleManaher.h).
+        */
+        void SetCallFlags( const TUint32& aCallFlags ); 
+
+        /**
+        * Set current flag on.
+        * @param aFlag The flag.
+        */
+        void SetCallFlag( const CBubbleManager::TPhoneCallTypeFlags& aFlag );
+
+        /**
+        * Remove flag
+        * @param aFlag The flag.
+        */
+        void RemoveCallFlag( const CBubbleManager::TPhoneCallTypeFlags& aFlag );
+
+        /**
+        * Set bubble id for header.
+        * @param aBubbleId The id.
+        */
+        void SetBubbleId( const CBubbleManager::TBubbleId& aBubbleId );
+
+        /**
+        * Set text label to header.
+        * @param aText The label text.
+        * @param aClipDirection Text clipping direction.
+        */
+        void SetText( 
+            const TDesC16& aText,
+            const CBubbleManager::TPhoneClippingDirection& aClipDirection );
+
+        /**
+        * Set caller line identification to header.
+        * @param aCLI The CLI.
+        * @param aClipDirection Text clipping direction.
+        */
+        void SetCLI( 
+            const CBubbleManager::TBubbleLabelString& aCLI, 
+            const CBubbleManager::TPhoneClippingDirection& aClipDirection );
+
+        /**
+        * Set timer/cost value to header.
+        * @param aTimerCost Timer or cost value.
+        */
+        void SetTimerCost( 
+            const CBubbleManager::TBubbleLabelString& aTimerCost );
+
+        /**
+        * Set caller name presentation to header.
+        * @param aCNAP The CNAP.
+        * @param aClipDirection Text clipping direction.
+        * @since Series60 2.6
+        */
+        void SetCNAP( 
+            const CBubbleManager::TBubbleLabelString& aCNAP, 
+            const CBubbleManager::TPhoneClippingDirection& aClipDirection );
+            
+        /**
+        * Set CLI used in conference call participant list.
+        * @since S60 5.0.
+        * @param aParticipantCLI Participant list CLI type.
+        */
+        void SetParticipantListCLI(
+            CBubbleManager::TBubbleParticipantListCLI aParticipantCLI );            
+
+        /**
+        * Next functions are for CBubbleOutlook:s to fetch information
+        */
+
+        /**
+        * Is header in use?
+        * @return ETrue if in use.
+        */
+        virtual TBool IsUsed( ) const = 0;
+
+        /**
+        * Is header in conference call?
+        * @return ETrue if header is in conf.
+        */
+        TBool IsInConference( ) const;
+
+        /**
+        * Is this header conference header?
+        * @return ETrue if this in conference header.
+        */
+        virtual TBool IsConference( ) const = 0;
+        
+        /**
+        * Get the thumbnail icon bitmap.
+        * @return The icon bitmap.
+        */
+        CFbsBitmap* TnIconBitmap( ) const;
+
+        /**
+        * Get bitmap.
+        * @return The bitmap.
+        */
+        CFbsBitmap* TnBitmap( ) const;
+
+        /**
+        * Get bitmap mask.
+        * @return The mask.
+        */
+        CFbsBitmap* TnBitmapMask( ) const;
+
+        /**
+        * Get call object image bitmap.
+        * @return The bitmap.
+        */
+        CFbsBitmap* CallObjectImage( ) const;
+
+        /**
+        * Get call object image mask.
+        * @return The mask.
+        */
+        CFbsBitmap* CallObjectImageMask( ) const;
+        
+        /**
+        * Get call object file name.
+        * @return The file name.
+        */
+        const TDesC& CallObjectFileName( ) const;
+
+        /**
+        * Get call object text.
+        * @return The text.
+        */
+        const TDesC& CallObjectText( ) const;
+        
+        /**
+        * Get call image type. This is valid only, if call image
+        * bitmap exists.
+        * @return The type.
+        */
+        TBMCallObjectImageType CallObjectImageType() const;
+
+        /**
+        * Get call state.
+        * @return The state.
+        */
+        CBubbleManager::TPhoneCallState CallState( ) const;
+        
+        /**
+        * Get previous call state.
+        * @return The previous state.
+        */
+        CBubbleManager::TPhoneCallState PreviousCallState( ) const;
+
+        /**
+        * Get number type.
+        * @return The number type.
+        */
+        CBubbleManager::TPhoneNumberType NumberType( ) const;
+
+        /**
+        * Get call flags.
+        * @return The flags.
+        */
+        TUint32 CallFlags( ) const;     
+
+        /**
+        * Get bubble id.
+        * @return The id.
+        */
+        CBubbleManager::TBubbleId BubbleId( ) const;
+
+        /**
+        * Get label text.
+        * @return The text.
+        */
+        const TDesC16& Text( ) const;
+
+        /**
+        * Get label's clipping direction.
+        * @return The clip dir.
+        */
+        CBubbleManager::TPhoneClippingDirection TextClipDirection( ) const;
+
+        /**
+        * Get caller line identificatoin.
+        * @return The CLI.
+        */
+        const CBubbleManager::TBubbleLabelString& CLI( ) const;
+
+        /**
+        * Get CLI's clip direction.
+        * @return The dir.
+        */
+        CBubbleManager::TPhoneClippingDirection CLIClipDirection( ) const;
+
+        /**
+        * Get timer/cost text.
+        * @return The text.
+        */
+        const CBubbleManager::TBubbleLabelString& TimerCost( ) const;
+
+        /**
+        * Get caller name presentation.
+        * @since Series60 2.6
+        * @return The CNAP.
+        */
+        const CBubbleManager::TBubbleLabelString& CNAP( ) const;
+
+        /**
+        * Get CNAP's clip direction.
+        * @since Series60 2.6
+        * @return The dir.
+        */
+        CBubbleManager::TPhoneClippingDirection CNAPClipDirection( ) const;
+        
+        /**
+        * Get CLI used in conference call participant list.
+        * @since S60 5.0.
+        * @return aParticipantCLI CLI type.
+        */
+        CBubbleManager::TBubbleParticipantListCLI ParticipantListCLI() const;
+
+    protected:
+
+        /**
+        * Base's 1st phase constructor.
+        */
+        CBubbleHeader();
+
+        /**
+        * Base's 2nd phase constructor.
+        */
+        void ConstructL(const CBubbleManager::TBubbleId& aBubbleId);
+        
+        /**
+        * For resetting the values.
+        */
+        void ResetParent();
+
+    private: //data
+        // Call state
+        CBubbleManager::TPhoneCallState iPhoneCallState;
+        // Previous call state
+        CBubbleManager::TPhoneCallState iPreviousCallState;
+        // Number tyoe
+        CBubbleManager::TPhoneNumberType iNumberType;
+        // Call flags
+        TUint32 iCallFlags; 
+        // Internal flags
+        TUint8 iInternalFlags;
+
+        // Thumbnail icon bitmap
+        CFbsBitmap* iThumbnailIconBitmap;
+
+        // Thumbnail image
+        CFbsBitmap* iThumbnailBitmap;
+        // TN mask
+        CFbsBitmap* iThumbnailBitmapMask;
+        // Identifier
+        CBubbleManager::TBubbleId iBubbleId;
+        // Label text
+        HBufC16* iText;
+        // CLI text
+        CBubbleManager::TBubbleLabelString iCLI;
+        // Timer/cost value
+        CBubbleManager::TBubbleLabelString iTimerCost;
+        // Cnap text
+        CBubbleManager::TBubbleLabelString iCNAP; 
+        // Call object image
+        CFbsBitmap* iCOImageBitmap;
+        // Call object image mask
+        CFbsBitmap* iCOImageBitmapMask;
+        // Call object file name
+        const HBufC* iCOFileName;
+        // Call object text
+        const HBufC* iCOText;
+        // Call object image data ownership
+        enum TBMCOImageDataOwnership
+            {
+            EBubbleCallImageOwned = 1,
+            EBubbleThumbnailImageOwned = 2    
+            };
+        TBool iCOImageDataOwnership;
+        // Call object image type
+        TBMCallObjectImageType iCOImageType;
+        // CLI for participant list.
+        CBubbleManager::TBubbleParticipantListCLI iParticipantCLI;
+    private:
+        friend class CT_CBubbleHeader;
+
+    };
+
+#endif //BUBBLEHEADER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleIconIndex.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,214 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Icon index table
+*
+*/
+
+#include    <e32base.h>
+#include    <bubblemanager.mbg>
+#include    <avkon.mbg>
+#include    <callstatus.mbg>
+
+struct BMIconIndex
+    {
+    TInt iconIndex;
+    TInt fileIndex;
+    };
+
+enum TBMIconsfile
+    {   
+    ECallstatusIconfile = 0,
+    EBubblemanagerIconfile,
+    EAvkonIconfile
+    };
+
+const BMIconIndex KBMIconIndex[] = 
+    {
+        { EMbmCallstatusQgn_indi_call_active, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_active_mask, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_active_2, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_active_2_mask, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_disconn, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_disconn_mask, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_held, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_held_mask, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_video_callsta_1, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_video_callsta_1_mask, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_video_callsta_2, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_video_callsta_2_mask, ECallstatusIconfile },
+        { EMbmBubblemanagerQgn_indi_call_video_callsta_disconn, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_video_callsta_disconn_mask, EBubblemanagerIconfile },
+        { EMbmCallstatusQgn_indi_call_voip_active, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_voip_active_mask, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_voip_active_2, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_voip_active_2_mask, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_voip_held, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_voip_held_mask, ECallstatusIconfile },
+        { EMbmBubblemanagerQgn_indi_call_voip_callsta_disconn, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_voip_callsta_disconn_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_waiting_1, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_waiting_1_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_waiting_2, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_waiting_2_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_waiting_disconn, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_waiting_disconn_mask, EBubblemanagerIconfile },
+        { EMbmCallstatusQgn_indi_call_video_1, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_video_1, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_video_2, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_video_2_mask, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_video_disconn, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_video_disconn_mask, ECallstatusIconfile },
+        { EMbmBubblemanagerQgn_indi_call_voip_waiting_1, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_voip_waiting_1_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_voip_waiting_2, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_voip_waiting_2_mask, EBubblemanagerIconfile },
+        { EMbmCallstatusQgn_indi_call_voip_disconn, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_voip_disconn_mask, ECallstatusIconfile },   
+        { EMbmBubblemanagerQgn_graf_call_rec_big, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_rec_big_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_rec_big_disconn, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_rec_big_disconn_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_one_active, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_one_active_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_one_disconn, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_one_disconn_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_one_held, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_one_held_mask, EBubblemanagerIconfile },
+        { EMbmCallstatusQgn_indi_call_active_cyph_off, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_active_cyph_off_mask, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_disconn_cyph_off, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_disconn_cyph_off_mask, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_held_cyph_off, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_held_cyph_off_mask, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_cyphering_off, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_cyphering_off, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_line2, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_line2, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_active_emergency, ECallstatusIconfile },
+        { EMbmCallstatusQgn_indi_call_active_emergency_mask, ECallstatusIconfile },
+        { EMbmBubblemanagerQgn_indi_call_waiting_cyph_off_1, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_waiting_cyph_off_1_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_waiting_disconn_cyph_off, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_waiting_disconn_cyph_off_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_one_active_emergency, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_one_active_emergency_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_two_active_emergency, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_two_active_emergency_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_rec_big_right, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_rec_big_right_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_rec_big_right_disconn, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_rec_big_right_disconn_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_conf_five, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_conf_five_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_conf_four, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_conf_four_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_conf_three, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_conf_three_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_conf_two, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_conf_two_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_three_active, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_three_active_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_three_disconn, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_three_disconn_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_three_held, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_three_held_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_two_active, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_two_active_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_two_disconn, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_two_disconn_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_two_held, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_two_held_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_wait_active, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_wait_active_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_wait_disconn, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_first_wait_disconn_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_hidden_held, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_hidden_held_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_rec_big_left, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_rec_big_left_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_rec_big_left_disconn, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_rec_big_left_disconn_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_rec_small_left, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_rec_small_left_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_rec_small_right, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_rec_small_right_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_rec_small_right_disconn, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_rec_small_right_disconn_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_rec_bigger, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_rec_bigger_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_second_three_active, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_second_three_active_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_second_three_disconn, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_second_three_disconn_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_second_three_held, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_second_three_held_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_second_two_active, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_second_two_active_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_second_two_disconn, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_second_two_disconn_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_second_two_held, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_second_two_held_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_active_conf, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_active_conf_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_disconn_conf, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_disconn_conf_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_diverted, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_diverted_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_held_conf, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_held_conf_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_muted, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_muted_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_prop_nrtyp_mobile_div, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_prop_nrtyp_mobile_div_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_prop_nrtyp_phone_div, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_prop_nrtyp_phone_div_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_active_conf_cyph_off, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_active_conf_cyph_off_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_active_cyph_off_2, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_active_cyph_off_2_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_disconn_conf_cyph_off, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_disconn_conf_cyph_off_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_held_conf_cyph_off, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_held_conf_cyph_off_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_waiting_cyph_off_2, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call_waiting_cyph_off_2_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_prop_nrtyp_home_div, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_prop_nrtyp_home_div_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_prop_nrtyp_work_div, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_prop_nrtyp_work_div_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_image_1, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_graf_call_image_1_mask, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call4_image_mask_prt, EBubblemanagerIconfile },
+        { EMbmBubblemanagerQgn_indi_call4_image_mask_lsc, EBubblemanagerIconfile },
+        { EMbmAvkonQgn_prop_nrtyp_fax, EAvkonIconfile },
+        { EMbmAvkonQgn_prop_nrtyp_fax_mask, EAvkonIconfile },
+        { EMbmAvkonQgn_prop_nrtyp_home, EAvkonIconfile },
+        { EMbmAvkonQgn_prop_nrtyp_home_mask, EAvkonIconfile },
+        { EMbmAvkonQgn_prop_nrtyp_mobile, EAvkonIconfile },
+        { EMbmAvkonQgn_prop_nrtyp_mobile_mask, EAvkonIconfile },
+        { EMbmAvkonQgn_prop_nrtyp_pager, EAvkonIconfile },
+        { EMbmAvkonQgn_prop_nrtyp_pager_mask, EAvkonIconfile },
+        { EMbmAvkonQgn_prop_nrtyp_phone, EAvkonIconfile },
+        { EMbmAvkonQgn_prop_nrtyp_phone_mask, EAvkonIconfile },
+        { EMbmAvkonQgn_prop_nrtyp_work, EAvkonIconfile },
+        { EMbmAvkonQgn_prop_nrtyp_work_mask, EAvkonIconfile },
+        { EMbmAvkonQgn_prop_nrtyp_voip, EAvkonIconfile },
+        { EMbmAvkonQgn_prop_nrtyp_voip_mask, EAvkonIconfile },
+        { EMbmAvkonQgn_prop_nrtyp_car, EAvkonIconfile },
+        { EMbmAvkonQgn_prop_nrtyp_car_mask, EAvkonIconfile },
+        { EMbmAvkonQgn_prop_nrtyp_assistant, EAvkonIconfile },
+        { EMbmAvkonQgn_prop_nrtyp_assistant_mask, EAvkonIconfile }
+    };
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleImage.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,72 @@
+/*
+* 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: 
+*       Thin wrapper over CEikImage to make sure that 
+*       AknsUtils::RegisterControlPosition is called.
+*
+*/
+
+
+#ifndef BMBUBBLEIMAGE_H
+#define BMBUBBLEIMAGE_H
+
+// INCLUDES  
+#include    <eikimage.h>
+
+// FORWARD DECLARATIONS
+// CLASS DECLARATION
+
+/**
+*  CBubbleImage control class
+*
+*  @lib bubblemanager
+*  @since 2.0
+*/
+class CBubbleImage : public CEikImage
+    {    
+    public: // Constructors and destructor
+        
+        /**
+        * Constructor.
+        */
+        CBubbleImage();
+
+        /**
+        * Destructor.
+        */
+        ~CBubbleImage();
+
+    public: // New functions
+        void SetAsBackgroundImage( TBool aIsBackground );
+        
+    private: // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        void SizeChanged();
+
+        /**
+        * From CCoeControl
+        */
+        void PositionChanged();
+
+    private: // Data
+        TBool iIsBackgroundImage;
+    
+    };
+
+#endif // BUBBLEPLACE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleImageManager.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,374 @@
+/*
+* 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 class handles all bitmaps
+*
+*/
+
+
+
+#ifndef BUBBLEIMAGEMANAGER_H
+#define BUBBLEIMAGEMANAGER_H
+
+// INCLUDES
+
+#include    <e32base.h>
+#include    <bldvariant.hrh>
+#include    <AknsItemID.h>
+#include    <AknsConstants.h>
+#include    <AknsItemData.h>
+
+// CONSTANTS
+const TInt KBMMaxFileNameLength = 100;
+
+// FORWARD DECLARATIONS
+class CBubbleSkinBitmap;
+class CEikImage;
+class CFbsBitmap;
+
+// DATA TYPES
+
+// Do NOT change order or numbering!!
+enum TBMIcons
+    {
+    ///////////////////////////////////////////////////////////////////////////
+    // Cached icons
+    ///////////////////////////////////////////////////////////////////////////
+    EQgn_indi_call_active = 0,
+    EQgn_indi_call_active_mask,
+    EQgn_indi_call_active_2,
+    EQgn_indi_call_active_2_mask,
+    EQgn_indi_call_disconn,
+    EQgn_indi_call_disconn_mask,
+    EQgn_indi_call_held,
+    EQgn_indi_call_held_mask,
+    EQgn_indi_call_video_callsta_1,
+    EQgn_indi_call_video_callsta_1_mask,
+    EQgn_indi_call_video_callsta_2,
+    EQgn_indi_call_video_callsta_2_mask,
+    EQgn_indi_call_video_callsta_disconn,
+    EQgn_indi_call_video_callsta_disconn_mask,
+    EQgn_indi_call_voip_active,
+    EQgn_indi_call_voip_active_mask,
+    EQgn_indi_call_voip_active_2,
+    EQgn_indi_call_voip_active_2_mask,
+    EQgn_indi_call_voip_held,
+    EQgn_indi_call_voip_held_mask,
+    EQgn_indi_call_voip_callsta_disconn,
+    EQgn_indi_call_voip_callsta_disconn_mask,
+    // Animated call icons
+    EQgn_indi_call_waiting_1,
+    EQgn_indi_call_waiting_1_mask,
+    EQgn_indi_call_waiting_2,
+    EQgn_indi_call_waiting_2_mask,
+    EQgn_indi_call_waiting_disconn,
+    EQgn_indi_call_waiting_disconn_mask,
+    EQgn_indi_call_video_1,
+    EQgn_indi_call_video_1_mask,
+    EQgn_indi_call_video_2,
+    EQgn_indi_call_video_2_mask,
+    EQgn_indi_call_video_disconn,
+    EQgn_indi_call_video_disconn_mask,
+    EQgn_indi_call_voip_waiting_1,
+    EQgn_indi_call_voip_waiting_1_mask,
+    EQgn_indi_call_voip_waiting_2,
+    EQgn_indi_call_voip_waiting_2_mask,
+    EQgn_indi_call_voip_disconn,
+    EQgn_indi_call_voip_disconn_mask,    
+    // Background for NE + single call (not cached, if frame icons in use)
+    EQgn_graf_call_rec_big,
+    EQgn_graf_call_rec_big_mask, 
+    EQgn_graf_call_rec_big_disconn,
+    EQgn_graf_call_rec_big_disconn_mask,
+    EQgn_graf_call_first_one_active,
+    EQgn_graf_call_first_one_active_mask,
+    EQgn_graf_call_first_one_disconn,
+    EQgn_graf_call_first_one_disconn_mask,
+    ///////////////////////////////////////////////////////////////////////////
+    // Non-cached icons
+    ///////////////////////////////////////////////////////////////////////////
+    EQgn_graf_call_first_one_held,
+    EQgn_graf_call_first_one_held_mask,
+    EQgn_indi_call_active_cyph_off,
+    EQgn_indi_call_active_cyph_off_mask,
+    EQgn_indi_call_disconn_cyph_off,
+    EQgn_indi_call_disconn_cyph_off_mask,
+    EQgn_indi_call_held_cyph_off,
+    EQgn_indi_call_held_cyph_off_mask,
+    EQgn_indi_call_cyphering_off,
+    EQgn_indi_call_cyphering_off_mask,
+    EQgn_indi_call_line2,
+    EQgn_indi_call_line2_mask,
+    EQgn_indi_call_active_emergency,
+    EQgn_indi_call_active_emergency_mask,
+    EQgn_indi_call_waiting_cyph_off_1,
+    EQgn_indi_call_waiting_cyph_off_1_mask,
+    EQgn_indi_call_waiting_disconn_cyph_off,
+    EQgn_indi_call_waiting_disconn_cyph_off_mask,
+    EQgn_graf_call_first_one_active_emergency,
+    EQgn_graf_call_first_one_active_emergency_mask,
+    EQgn_graf_call_two_active_emergency,
+    EQgn_graf_call_two_active_emergency_mask,
+    EQgn_graf_call_rec_big_right,
+    EQgn_graf_call_rec_big_right_mask,
+    EQgn_graf_call_rec_big_right_disconn,
+    EQgn_graf_call_rec_big_right_disconn_mask,
+    EQgn_graf_call_conf_five,
+    EQgn_graf_call_conf_five_mask,
+    EQgn_graf_call_conf_four,
+    EQgn_graf_call_conf_four_mask,
+    EQgn_graf_call_conf_three,
+    EQgn_graf_call_conf_three_mask,
+    EQgn_graf_call_conf_two,
+    EQgn_graf_call_conf_two_mask,
+    EQgn_graf_call_first_three_active,
+    EQgn_graf_call_first_three_active_mask,
+    EQgn_graf_call_first_three_disconn,
+    EQgn_graf_call_first_three_disconn_mask,
+    EQgn_graf_call_first_three_held,
+    EQgn_graf_call_first_three_held_mask,
+    EQgn_graf_call_first_two_active,
+    EQgn_graf_call_first_two_active_mask,
+    EQgn_graf_call_first_two_disconn,
+    EQgn_graf_call_first_two_disconn_mask,
+    EQgn_graf_call_first_two_held,
+    EQgn_graf_call_first_two_held_mask,
+    EQgn_graf_call_first_wait_active,
+    EQgn_graf_call_first_wait_active_mask,
+    EQgn_graf_call_first_wait_disconn,
+    EQgn_graf_call_first_wait_disconn_mask,
+    EQgn_graf_call_hidden_held,
+    EQgn_graf_call_hidden_held_mask,
+    EQgn_graf_call_rec_big_left,
+    EQgn_graf_call_rec_big_left_mask,
+    EQgn_graf_call_rec_big_left_disconn,
+    EQgn_graf_call_rec_big_left_disconn_mask,
+    EQgn_graf_call_rec_small_left,
+    EQgn_graf_call_rec_small_left_mask,
+    EQgn_graf_call_rec_small_right,
+    EQgn_graf_call_rec_small_right_mask,
+    EQgn_graf_call_rec_small_right_disconn,
+    EQgn_graf_call_rec_small_right_disconn_mask,
+    EQgn_graf_call_rec_bigger,
+    EQgn_graf_call_rec_bigger_mask,
+    EQgn_graf_call_second_three_active,
+    EQgn_graf_call_second_three_active_mask,
+    EQgn_graf_call_second_three_disconn,
+    EQgn_graf_call_second_three_disconn_mask,
+    EQgn_graf_call_second_three_held,
+    EQgn_graf_call_second_three_held_mask,
+    EQgn_graf_call_second_two_active,
+    EQgn_graf_call_second_two_active_mask,
+    EQgn_graf_call_second_two_disconn,
+    EQgn_graf_call_second_two_disconn_mask,
+    EQgn_graf_call_second_two_held,
+    EQgn_graf_call_second_two_held_mask,
+    EQgn_indi_call_active_conf,
+    EQgn_indi_call_active_conf_mask,
+    EQgn_indi_call_disconn_conf,
+    EQgn_indi_call_disconn_conf_mask,
+    EQgn_indi_call_diverted,
+    EQgn_indi_call_diverted_mask,
+    EQgn_indi_call_held_conf,
+    EQgn_indi_call_held_conf_mask,
+    EQgn_indi_call_muted,
+    EQgn_indi_call_muted_mask,
+    EQgn_prop_nrtyp_mobile_div,
+    EQgn_prop_nrtyp_mobile_div_mask,
+    EQgn_prop_nrtyp_phone_div,
+    EQgn_prop_nrtyp_phone_div_mask,
+    EQgn_indi_call_active_conf_cyph_off,
+    EQgn_indi_call_active_conf_cyph_off_mask,
+    EQgn_indi_call_active_cyph_off_2,
+    EQgn_indi_call_active_cyph_off_2_mask,
+    EQgn_indi_call_disconn_conf_cyph_off,
+    EQgn_indi_call_disconn_conf_cyph_off_mask,
+    EQgn_indi_call_held_conf_cyph_off,
+    EQgn_indi_call_held_conf_cyph_off_mask,
+    EQgn_indi_call_waiting_cyph_off_2,
+    EQgn_indi_call_waiting_cyph_off_2_mask,
+    EQgn_prop_nrtyp_home_div,
+    EQgn_prop_nrtyp_home_div_mask,
+    EQgn_prop_nrtyp_work_div,
+    EQgn_prop_nrtyp_work_div_mask,
+    EQgn_graf_call_image_1,
+    EQgn_graf_call_image_1_mask,
+    EQgn_indi_call4_image_mask_prt, 
+    EQgn_indi_call4_image_mask_lsc, 
+    // From avkon.mbm
+    EQgn_prop_nrtyp_fax,
+    EQgn_prop_nrtyp_fax_mask,
+    EQgn_prop_nrtyp_home,
+    EQgn_prop_nrtyp_home_mask,
+    EQgn_prop_nrtyp_mobile,
+    EQgn_prop_nrtyp_mobile_mask,
+    EQgn_prop_nrtyp_pager,
+    EQgn_prop_nrtyp_pager_mask,
+    EQgn_prop_nrtyp_phone,
+    EQgn_prop_nrtyp_phone_mask,
+    EQgn_prop_nrtyp_work,
+    EQgn_prop_nrtyp_work_mask,
+    EQgn_prop_nrtyp_voip,
+    EQgn_prop_nrtyp_voip_mask,
+    EQgn_prop_nrtyp_car,
+    EQgn_prop_nrtyp_car_mask,
+    EQgn_prop_nrtyp_assistant,
+    EQgn_prop_nrtyp_assistant_mask
+    };
+
+
+
+// CLASS DECLARATION
+
+/**
+*  CBubbleImageManager class
+*  This class handles all bitmaps
+*
+*  @lib bubblemanager
+*  @since Series60_1.0
+*/
+class CBubbleImageManager : public CBase
+    {
+
+    public: // Constructors and destructor
+
+        /**
+        * Two phase constructor
+        * @param aFrameIcons ETrue if 9-piece bubbles are used.
+        * @return New instance
+        */
+        static CBubbleImageManager* NewL( TBool aFrameIcons );
+
+        /**
+        * Destructor.
+        */
+        ~CBubbleImageManager();
+
+    public: // New functions
+
+        /**
+        * Set given bitmap to CEikImage object.
+        * @param aImage Image which the bitmap is set to.
+        * @param aPicture Bitmap enum.
+        */
+        void SetBitmapToImage( CEikImage*& aImage , 
+                               const TBMIcons& aPicture );
+
+        /**
+        * Set given bitmap to CEikImage object.
+        * @param aImage Image which the bitmap is set to.
+        * @param aPicture Bitmap enum.
+        * @param aPictureMask Bitmap mask enum.
+        */
+        void SetBitmapToImage( CEikImage*& aImage , 
+                               const TBMIcons& aPicture, 
+                               const TBMIcons& aPictureMask );
+
+        /**
+        * Clears skinned bitmaps. Call only between StartChanges() and
+        * EndChanges()!!!
+        * @since 2.0
+        */
+        void ClearSkinsCache();
+        
+        /**
+        * This method prepares cached bitmaps. SVG icons cannot be
+        * used before they are initialized. Using this method ensures 
+        * validity of most essentials icons in OOM situation.  
+        * @since 3.1
+        */
+        void PrepareCachedBitmaps();
+
+    protected:
+        /**
+        * Constructor.
+        */
+        CBubbleImageManager( TBool aFrameIcons );
+
+        // From CTimer
+        void RunL();
+
+        // Set bitmap+mask to given image
+        void SetBitmapToImage( CEikImage& aImage , 
+                               const TBMIcons& aPicture, 
+                               const TBMIcons& aPictureMask );
+
+        // Maps enumeration to mbm file
+        void MapEnumToMbmFile( const TBMIcons aBmIcon,
+                               TInt& aMbm,
+                               TDes& aFileName ) const;
+
+        // Maps emumeration to skin id
+        void MapEnumToSkin( const TBMIcons aBmIcon, 
+                            TAknsItemID& aItemId, 
+                            TInt& aColorGroupId ) const;
+
+        // Finds skin for given enumeration
+        TBool GetSkin( CEikImage&     aImage, 
+                       const TBMIcons aBmIcon, 
+                       const TBMIcons aBmIconMask );
+
+        // Loads new skin image into cache
+        void LoadAndAppendSkinL( const TBMIcons aBmIcon,
+                                 const TBMIcons aBmIconMask,
+                                 CFbsBitmap*&   aBitmap, 
+                                 CFbsBitmap*&   aMask );
+                                 
+        // Initialize bitmaps
+        TBool DoInitializeBitmaps();
+        
+        // Callback function for CIdle
+        static TInt InitializeBitmaps( TAny* aThis );
+        
+        // Load cached bitmaps
+        void LoadCachedBitmapsL();
+    
+    private:
+        // Returns id for last icon kept in cache
+        inline TInt LastCachedIcon();
+
+    private: // private functions
+        /**
+        * Symbian OS 2nd phase constructor.
+        */
+        void ConstructL();
+
+    private: //data
+
+        // MBM file name
+        TBuf<KBMMaxFileNameLength> iMbmFileBuffer;
+
+        // Cached skin bitmaps
+        RPointerArray<CBubbleSkinBitmap> iSkinnedBitmaps;
+        // Ordering function pointer.
+        TLinearOrder<CBubbleSkinBitmap> iOrder;
+
+        // Compares two different skin images
+        static TInt CompareSkinnedData(
+            const CBubbleSkinBitmap& aSkinnedBitmap1, 
+            const CBubbleSkinBitmap& aSkinnedBitmap2 );
+            
+        // Bitmap initialization
+        CIdle* iBitmapInitializer;
+        TInt   iBitmapInitIndex;
+        
+        // 9-piece background icons used 
+        TBool iFrameIcons;
+
+    private:
+        friend class CT_CBubbleImageManager;
+    };
+
+#endif //BUBBLEIMAGEMANAGER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleManager.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,1018 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CBubbleManager class provides API for phone to draw current calls
+*                on the screen. 
+*
+*/
+
+
+
+#ifndef BUBBLEMANAGER_H
+#define BUBBLEMANAGER_H
+
+//  INCLUDES
+#include    <coemain.h>
+#include    <bmbubbleplace.h>
+#include    <bldvariant.hrh>
+#include    <mphcntmatch.h>
+
+// CONSTANTS
+_LIT( KBubbleTextSeparator ,"\t");
+const TUint8 KBubbleShortLabelMaxLength = 25;
+const TUint8 KBubbleLongLabelMaxLength = 35;
+const TUint8 KBubbleLabelMaxLength = 
+    KBubbleShortLabelMaxLength + KBubbleLongLabelMaxLength;
+//const TUint8 KBubbleMaxCharsInNE = 48;
+const TUint8 KBubbleCallMaxAmount = 7;
+const TUint8 KBubblePlaceMaxAmount = 20;
+const TUint8 KBubblePlaceMaxAmountTouch = 23;
+const TUint8 KBubblePlaceMaxVisible = 4;
+const TUint8 KBubbleMaxCallsInConf = 5;
+const TInt KBubbleConferenceId = -1; // differs from 0-6 which 
+                                     //are reserved for calls.
+const TInt KBubbleInvalidId = -2;
+const TInt KBubbleNoHighlightRow = 0; // 1-5 are conference rows
+
+// FORWARD DECLARATIONS
+class CBubbleOutlook;
+class CBubbleImageManager;
+class CBubbleCallHeader;
+class CBubbleHeader;
+class CBubbleConfHeader;
+class CBubbleOutlookNumberEntry;
+class CBubbleOutlookTopRight;
+class CEikImage;
+class CBubbleResourceManager;
+class CPNGNumberGrouping;
+class CBubbleCallObjectManager;
+class CBubbleVideoController;
+class MBubbleVideoPlaybackObserver;
+class CBubbleTouchPane;
+class MBubbleTouchPaneInterface;
+class CTelBubbleCustomElement;
+class CBubbleCustomManager;
+class CBubbleMainPaneControl;
+
+// CLASS DECLARATION
+
+/**
+*  CBubbleManager container class
+*
+*  @lib bubblemanager.lib
+*  @since Series60_1.0
+*/
+NONSHARABLE_CLASS(CBubbleManager) : public CCoeControl
+    {
+    public:     // Data
+        typedef TInt TBubbleId;
+        typedef TBuf<KBubbleLabelMaxLength> TBubbleLabelString;
+        typedef TUint8 TRowNumber; // 1-5 allowed (for conf)
+        
+ 
+        // Different call states
+        enum TPhoneCallState // Set the order for drawing too
+            { 
+            ENone           = 0, // Default on creation
+            EOnHold,
+            EDisconnected,
+            EActive,
+            EIncoming,
+            EWaiting,
+            EAlertToDisconnected,
+            EOutgoing,
+            EAlerting,
+            };
+        
+        // Call Flags
+        enum TPhoneCallTypeFlags 
+            {
+            ENormal         = 0x00,     // Default
+            ENoCiphering    = 0x08,     // open lock icon
+            ELine2          = 0x10,     // is call on line 2 
+            EMuted          = 0x20,     // not implemented for a single call
+            EDiverted       = 0x40,     // is call diverted
+            EVideo          = 0x80,     // video call
+            EVoIPCall       = 0x100     // VoIP call.  
+            };
+        
+        // Number types
+        enum TPhoneNumberType
+            {
+            ENotSet    = 0, // Default
+            EHome,
+            EMobile,
+            EWork,
+            EPhone,
+            EFaxNumber,
+            EPager,
+            ECar,
+            EAssistant
+            };
+        
+        // Where the text is clipped.
+        enum TPhoneClippingDirection
+            {
+            ELeft,  // Default on numbers
+            ERight  // Default on texts/names
+            };
+
+        enum TPhoneCallAnimationTypes
+            {
+            EAnimVoiceCall = 0,
+            EAnimVideoCall,
+            EAnimVoIPCall
+            };
+            
+        // Popup bubble type
+        enum TPhonePopupBubbleType
+            {
+            EVideoRingingToneQCIF,
+            EVideoRingingToneSubQCIF    
+            };
+            
+        // Video play
+        enum TBubbleVideoPlayMode
+            {
+            EPlayInLoop,
+            EPlayOnce,
+            EPlayAscending    
+            };
+            
+        // Conference participant CLI
+        enum TBubbleParticipantListCLI
+            {
+            EParticipantListCLIText,
+            EParticipantListCNAP    
+            };                        
+
+    public:  // Constructors and destructor
+        
+        /**
+        * Two phase constructor
+        * @param aContainer Parent container
+        * @param aRect Area to use
+        * @return New instance
+        */
+        IMPORT_C static CBubbleManager* NewL( const CCoeControl& aContainer , 
+                                              const TRect& aRect );
+        
+        /**
+        * Two phase constructor
+        * @param aContainer Parent container
+        * @param aRect Area to use
+        * @param aBigNEInIdle Bigger number entry used in idle state.
+        * @return New instance
+        */
+        IMPORT_C static CBubbleManager* NewL( const CCoeControl& aContainer , 
+                                              const TRect& aRect,
+                                              TBool aBigNEInIdle );
+        
+        /**
+        * Destructor.
+        */
+        IMPORT_C ~CBubbleManager();
+
+    public: // New functions
+        
+        // ====================================================
+        // Must surround all the changes:
+        // ====================================================
+        //
+        
+        /**
+        * Before making any changes to bubble headers, call this function so
+        * manager can prapare for them properly.
+        */
+        IMPORT_C 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.
+        */
+        IMPORT_C void EndChanges();
+        
+        
+        // ====================================================
+        // For number entry:
+        // ====================================================
+        //
+        
+        /**
+        * Sets number entry active.
+        */
+        IMPORT_C void CreateNumberEntry();
+        
+        /**
+        * Return pointer to number entry
+        * @return The NE.
+        */
+        IMPORT_C CCoeControl* GetNumberEntry( ) const;
+        
+        /**
+        * Query, is number entry used.
+        * @return ETrue is NE is used.
+        */
+        IMPORT_C TBool IsNumberEntryUsed( ) const;
+        
+        /**
+        * This disables NE drawing but doesn't empty the component.
+        * @param aVisibility NE visible or not.
+        */
+        IMPORT_C void SetNumberEntryVisible( 
+            const TBool& aVisibility = ETrue );
+        
+        /**
+        * Set Number Entry text.
+        * @param aDesC The text.
+        */
+        IMPORT_C void SetTextToNumberEntry( const TDesC& aDesC );
+        
+        /**
+        * Get Number Entry Text.
+        * @param aDesC The text.
+        */
+        IMPORT_C void GetTextFromNumberEntry( TDes& aDesC );
+        
+        /**
+        * Removes NE and empties the buffer.
+        */
+        IMPORT_C void RemoveNumberEntry( );
+        
+        
+        // ====================================================
+        // For call headers and some for conference call
+        // ====================================================
+        //
+        
+        /**
+        * Takes a new call header in use.
+        * @return Bubble idenfication number
+        */
+        IMPORT_C TBubbleId CreateCallHeader();
+        
+        /**
+        * Removes call header from use
+        * @param aBubbleId Indentifies call header
+        */
+        IMPORT_C void RemoveCallHeader( const TBubbleId& aBubbleId );
+        
+        /**
+        * Sets call state to header.
+        * @param aBubbleId Identifies header
+        * @param aState Call state ( e.g. incoming,.. ), for conf also 
+        *               (active/on hold/ none)
+        */
+        IMPORT_C void SetState( const TBubbleId& aBubbleId, 
+            const TPhoneCallState& aState );
+        
+        /**
+        * Sets text label to header. For conf also.
+        * @param aBubbleId Identifies header
+        * @param aText Text to be seen in bubble ( e.g. 'on hold' )
+        * @param aClipDirection Text clipping end
+        */
+        IMPORT_C void SetLabel( 
+            const TBubbleId& aBubbleId, 
+            const TDesC& aText, 
+            const TPhoneClippingDirection& aClipDirection = ERight );
+        
+        /**
+        * Sets text label to header. For conf also.
+        * @param aBubbleId Identifies header
+        * @param aLongText Text to be seen in bubble ( e.g. 'disconnected' )
+        * @param aShortText Text to be seen in bubble ( e.g. 'disconn' )
+        * @param aClipDirection Text clipping end
+        */
+        IMPORT_C void SetLabel( 
+            const TBubbleId& aBubbleId, 
+            const TDesC& aLongText, 
+            const TDesC& aShortText, 
+            const TPhoneClippingDirection& aClipDirection = ERight );
+        
+        /**
+        * Sets caller's line identification ( name or number) to header. 
+        * For conf also.
+        * @param aBubbleId Identifies header
+        * @param aCLIText Caller's CLI ( e.g. 'Mother' )
+        * @param aClipDirection Text clipping end
+        */
+        IMPORT_C void SetCLI( const TBubbleId& aBubbleId, 
+                              const TDesC& aCLIText, 
+                              const TPhoneClippingDirection& aClipDirection );
+        
+        /**
+        * Updates caller's line identification ( name or number) to header. 
+        * For conf also.
+        * @param aBubbleId Identifies header
+        * @param aCLIText Caller's CLI ( e.g. 'Daddy' )
+        * @param aClipDirection Text clipping end
+        */
+        IMPORT_C void UpdateCLI( 
+            const TBubbleId& aBubbleId, 
+            const TDesC& aCLIText, 
+            const TPhoneClippingDirection& aClipDirection );
+        
+        
+        /**
+        * Sets call time or cost text to header. For conf also.
+        * @param aBubbleId Identifies header
+        * @param aCallTime Timer or cost text ( e.g. '00:12:34' or '£01.23' ). 
+        *                  If this parameter is too long 
+        *                  (> KBubbleLabelMaxLength) it discards the end.
+        */
+        IMPORT_C void SetCallTime( 
+            const TBubbleId& aBubbleId, 
+            const TDesC& aCallTime );
+        
+        /**
+        * Updates call time or cost text to header.  For conf also.
+        * @param aBubbleId Identifies header
+        * @param aCallTime Timer or cost text ( e.g. '00:12:34' or '£01.23' ). 
+        *                  If this parameter is too long 
+        *                  (> KBubbleLabelMaxLength) it discards the end.
+        */
+        IMPORT_C void UpdateCallTime( 
+            const TBubbleId& aBubbleId, 
+            const TDesC& aCallTime ); 
+        
+        /**
+        * Attach a thumbnail image to header. Bitmap parameters can be NULL.
+        * Ownership is not transferred.
+        * @param aBubbleId Identifies header
+        * @param aTnBitmap A Pointer to wanted thumbnail bitmap.
+        * @param aTnBitmapMask A Pointer to thumbnail bitmap mask.
+        * @param aDataOwnershipTransferred Set ETrue if ownership is transferred.
+        */
+        IMPORT_C void SetThumbnail( const TBubbleId& aBubbleId, 
+                                    CFbsBitmap* aTnBitmap, 
+                                    CFbsBitmap* aTnBitmapMask,
+                                    TBool aDataOwnershipTransferred 
+                                          = EFalse ); 
+
+        /**
+        * Attach a call object image to header.
+        * @param aBubbleId Identifies header
+        * @param aImageFile.
+        */
+        IMPORT_C void SetCallObjectImage( const TBubbleId& aBubbleId,
+                                          const TDesC& aImageFileName );            
+                                            
+        /**
+        * Attach a call object image to header.
+        * Ownership is not transferred.
+        * @param aBubbleId Identifies header
+        * @param aCOBitmap A Pointer to wanted call object image bitmap.
+        * @param aCOBitmapMask A Pointer to call object bitmap mask.
+        * @param aDataOwnershipTransferred Set ETrue if ownership is transferred.
+        */
+        IMPORT_C void SetCallObjectImage( const TBubbleId& aBubbleId, 
+                                          CFbsBitmap* aCOBitmap, 
+                                          CFbsBitmap* aCOBitmapMask = NULL,
+                                          TBool aDataOwnershipTransferred 
+                                                = EFalse  );
+
+        /**
+        * Attach a call object image to header. Image is taken from
+        * active theme.   
+        * @param aBubbleId Identifies header.
+        */
+        IMPORT_C void SetCallObjectFromTheme( const TBubbleId& aBubbleId );
+                                    
+        /**
+        * Attach a call object text to header.
+        * Ownership is not transferred.
+        * @param aBubbleId Identifies header
+        * @param aCOText Pointer to buffer holding the text. 
+        */
+        IMPORT_C void SetCallObjectText( const TBubbleId& aBubbleId, 
+                                         const TDesC& aCOText );                                                                        
+                                            
+        
+        /**
+        * Sets call flags to header.
+        * @param aBubbleId Identifies header
+        * @param aFlags Call flags
+        */
+        IMPORT_C void SetCallFlags( 
+            const TBubbleId& aBubbleId, 
+            const TUint32& aFlags ); 
+        
+        /**
+        * Sets call flags to header.
+        * @param aBubbleId Identifies header
+        * @param aFlag One call flag
+        * @param aSet ETrue sets flag and EFalse clears flag
+        */
+        IMPORT_C void SetCallFlag( const TBubbleId& aBubbleId, 
+                                   const TPhoneCallTypeFlags& aFlag, 
+                                   const TBool& aSet );
+        
+        /**
+        * Sets number type.
+        * @param aBubbleId Identifies header
+        * @param aNumType Number type enumeration ( e.g. mobile )
+        */
+        IMPORT_C void SetNumberType( const TBubbleId& aBubbleId, 
+                                     const TPhoneNumberType& aNumType );
+
+        /**
+        * Sets number type.
+        * @param aBubbleId Identifies header
+        * @param aNumType Number type id.
+        */
+        IMPORT_C void SetPbkNumberType( const TBubbleId& aBubbleId, 
+                                        const TInt aNumType );
+
+        IMPORT_C void SetPhCntNumberType( const TBubbleId& aBubbleId,
+                                     const MPhCntMatch::TNumberType aNumType );
+        
+        /**
+        * Updates video call header text for animation
+        * @param aBubbleId Identifies header
+        * @param aHeaderText video call header animation text 
+        */
+        IMPORT_C void UpdateCallHeaderText( 
+            const TBubbleId& aBubbleId, 
+            const TDesC& aLongText, 
+            const TDesC& aShortText, 
+            const TPhoneClippingDirection& aClipDirection );
+
+        // ====================================================
+        // For all bubbles
+        // ====================================================
+        //
+        
+        /**
+        * Sets phone muted/unmuted.
+        * @param aIsMuted ETrue if phone is muted.
+        */
+        IMPORT_C void SetPhoneMuted( const TBool& aIsMuted = ETrue );
+        
+        
+        // ====================================================
+        // For conference call
+        // ====================================================
+        //
+        
+        /**
+        * Creates a conference call based upon two calls. Bubbles must be 
+        * created first.
+        * @param aBubble1 Identifies first header to set in conference call.
+        * @param aBubble2 Identifies second header to set in conference call
+        * @return Conference bubble idenfication.
+        */
+        IMPORT_C TBubbleId CreateConference( const TBubbleId& aBubble1, 
+                                             const TBubbleId& aBubble2 );
+        
+        /**
+        * Splits conference call into invidual two calls. Call headers stays 
+        * in use. Headers' state will not be changed.
+        */
+        IMPORT_C void RemoveConference();
+        
+        /**
+        * Adds new call to conference call.
+        * @param aBubbleId Identifies header
+        */
+        IMPORT_C void AddRowToConference( const TBubbleId& aBubbleId );
+        
+        /**
+        * 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).
+        * @param aBubbleId Identifies header
+        */
+        IMPORT_C void RemoveRowFromConference( const TBubbleId& aBubbleId );
+        
+        /**
+        * Counts calls in conference call.
+        * @return Call amount in conference.
+        */
+        IMPORT_C TUint8 ConferenceRowCount( ) const;
+        
+        /**
+        * Sets highlight to specified line in conference.
+        * @param aRowNumber Line number in conference bubble. 
+        *                   0 means no highlight.
+        */
+        IMPORT_C void SetSelectionInConference( const TRowNumber& aRowNumber );
+        
+        /**
+        * Sets highlight to specified bubble id in conference.
+        * @param aBubbleId Id for wanted selection. 
+        *                  KBubbleInvalidId means no hihgtlight. 
+        */
+        IMPORT_C void SetSelectionIdInConference( const TBubbleId& aBubbleId );
+        
+        /**
+        * Gets highlighted item in conference.
+        * @return Row number of the call. 0 if no highlight
+        */
+        IMPORT_C TRowNumber SelectionInConference() const;
+        
+        /**
+        * Gets highlighted item in conference.
+        * @return Id of the call. Returns KBubbleInvalidId if no highlight
+        */
+        IMPORT_C TBubbleId SelectionIdInConference() const;
+        
+        /**
+        * Moves highligh one up if possible
+        */
+        IMPORT_C void MoveHighlightOneUpInConference();
+        
+        /**
+        * Moves highligh one down if possible
+        */
+        IMPORT_C void MoveHighlightOneDownInConference();
+        
+        /**
+        * Use this function to expand or shrink conference bubble.
+        * @param aIsExpanded ETrue=expanded, EFalse=shrink.
+        */
+        IMPORT_C void SetExpandedConferenceCallHeader( 
+            const TBool& aIsExpanded = ETrue );
+        
+        /**
+        * Query: is conference expanded?
+        * @return ETrue, if conference is expanded
+        */
+        IMPORT_C TBool IsConferenceExpanded( ) const;
+
+        // ====================================================
+        // Use only if __SERIES60_PHONE_CNAP if defined:
+        // ====================================================
+        //
+        /**
+        * Sets CNAP information to the call header. CLI is used for the CNAP 
+        * name got from the network. In addition, the phone number is stored 
+        * here to show it also.
+        * @since 1.2
+        * @param aBubbleId Identifies header
+        * @param aCNAPText Caller's CNAP information.
+        * @param aClipDirection Text clipping end
+        */
+        IMPORT_C void SetCNAP( 
+            const TBubbleId& aBubbleId, 
+            const TDesC& aCNAPText, 
+            const TPhoneClippingDirection& aClipDirection = ELeft );
+
+        
+        /**
+        * Set number entry's editor mode.
+        * @param aMode for number editor input mode.
+        * @return Input mode of the editor.
+        * @since 3.0
+        */
+        IMPORT_C TInt ChangeEditorMode( TBool aDefaultMode = EFalse );
+        
+        /**
+        * Get number entry's editor mode.
+        * @return Input mode of the editor.
+        * @since 3.0
+        */
+        IMPORT_C TInt GetEditorMode() const;
+
+        /**
+        * Resets number entry editor to default values.
+        * @since 3.0
+        */
+        IMPORT_C void ResetEditorToDefaultValues();
+
+        /**
+        * Starts initialization of most essential icons. This method can 
+        * be used to ensure correct LAF in OOM situation (to be called
+        * before OOM).
+        */
+        IMPORT_C void PrepareIcons();
+        
+        /**
+        * Preloads/Releases call theme image.  
+        * @param aPreload ETrue to preload the image.
+        *                 EFalse to release the image.
+        */
+        IMPORT_C void PreloadCallThemeImage( TBool aPreload );
+        
+        /**
+        * Number of headers shown on the screen.
+        * @return Shown header count.
+        */
+        IMPORT_C TUint8 ShownHeaderCount() const;
+        
+        /**
+        * Client should call this method when the background context
+        * changes after EndChanges() call. This method updates animation
+        * frames that are created by drawing part of application view 
+        * off-screen (updates here cannot be based on redraw events). 
+        */
+        IMPORT_C void HandleBackgroundImageChange();
+
+        /**
+        * Sets video ringing tone. Video is played when the next call 
+        * enters incoming state and stopped when the call exits the
+        * incoming call state.
+        * @param aFileName File name with path.
+        * @param aPlayMode Play mode.
+        * @param aVolumeLevel Volume level (0-10).
+        * @param aUseArbitraryScaling Set ETrue for arbitrary video scaling.
+        * @param aObserver Playback observer.
+        */
+        IMPORT_C void SetVideoRingTone(
+            const TDesC& aFileName,
+            TBubbleVideoPlayMode aPlayMode,
+            TInt aVolumeLevel,
+            TBool aUseArbitraryScaling,
+            MBubbleVideoPlaybackObserver* aObserver );
+        
+        /**
+        * Stops video playback. Call bubble for video ringtone stays
+        * active.   
+        */
+        IMPORT_C void StopVideoRingTone();
+        
+        /**
+        * Mutes video playback.
+        */
+        IMPORT_C void MuteVideoRingTone();
+        
+        /**
+        * Cancels video ringing tone. Video playback is stopped and call
+        * bubble layout is changed to normal. This is meant to be used in 
+        * error situations, where client needs to abort video state and
+        * play default ringtone instead.    
+        */
+        IMPORT_C void CancelVideoRingTone();
+        
+        /**
+        * Set CLI used in participant list (text or phonenumber).
+        * @param aBubbleId Bubble identifier.
+        * @param aParticipantCLI CLI type.
+        * @since S60 5.0   
+        */        
+        IMPORT_C void SetParticipantListCLI(
+            const TBubbleId& aBubbleId,
+            TBubbleParticipantListCLI aParticipantCLI );
+        
+        /**
+        * Returns touchpane interface.
+        * @return Pointer to touchpane interface.
+        */
+        IMPORT_C MBubbleTouchPaneInterface* TouchPane();
+        
+        /**
+        * Sets touchpane visibility.
+        * @param Set ETrue if touchpane is shown otherwise EFalse.
+        */
+        IMPORT_C void SetTouchPaneVisible( TBool aVisible );
+        
+        /**
+        * Adds custom ui element to call bubble. Onwership of the element
+        * is not transferred, caller shall remove the element before deleting
+        * the instance.
+        * @since S60 5.0
+        * @param aBubbleId Bubble identifier.
+        * @param aElement  Custom element.
+        * @param aPriority Priotity 0(high) - 255(low). 
+        *                  Used when multiple instances in same position.
+        */
+        IMPORT_C void AddCustomElement( const TBubbleId& aBubbleId,
+                                        CTelBubbleCustomElement* aElement,
+                                        TInt aPriority );
+        
+        /**
+        * Removes custom ui element from call bubble.
+        * @since S60 5.0
+        * @param aBubbleId Bubble identifier.
+        * @param aElement Custom element.
+        */
+        IMPORT_C void RemoveCustomElement( const TBubbleId& aBubbleId,
+                                           CTelBubbleCustomElement* aElement );
+
+    public: // non-imported functions
+
+        /**
+        * Focus changed
+        * @param aDrawNow Needs redraw?
+        */
+        void FocusChanged( TDrawNow aDrawNow );
+
+        /**
+        * For getting image manager
+        * @return Reference
+        */
+        CBubbleImageManager& ImageManager();
+
+        /**
+        * For getting resource manager
+        * @return Reference
+        */
+        CBubbleResourceManager& ResourceManager();
+        
+        /**
+        * For getting customization manager
+        * @return Reference
+        */
+        CBubbleCustomManager& CustomManager();
+
+        /**
+        * Uses number grouping to change the phone number
+        * @since 1.2
+        * @param aNumber original number
+        * @return grouped number
+        **/
+        const TDesC& NumberGroup( const TDesC& aNumber );
+        
+        /**
+        * To test if this call state is such that end key
+        * press terminates the call.
+        * end key is pressed.
+        * @return ETrue if call is dropped by end key. Otherwise EFalse.
+        */
+        TBool IsCallDroppedByEndKey( const TPhoneCallState& aState ) const;
+        
+        /**
+        * To get number of ongoing calls.
+        * @return Active call count.
+        */
+        TUint8 ActiveCallCount() const;
+        
+        /**
+        * For getting video controller.
+        * @return Video controller reference.
+        */
+        CBubbleVideoController& VideoController() const;
+        
+        /**
+        * To get call state of the bubble.
+        * @return Call state.
+        */
+        TPhoneCallState CallState( const TBubbleId& aBubbleId );
+        
+        /**
+        * Get size for call object image for incall situations. 
+        * @param aIncall Set ETrue for incall states.
+        * @param aBigBubble Set ETrue for big call bubble.
+        * @return The Size.
+        */
+        TSize CallObjectImageIncallSize( TBool aBigBubble = EFalse );
+        
+        /**
+        * Returns touch feature status.
+        * @return ETrue if touch call handling enabled, otherwise EFalse.
+        */
+        TBool IsTouchCallHandling() const;
+        
+        /**
+        * Returns main pane image rect
+        */
+        const TRect MainPaneImageRect( 
+            TBool aTinyImage = EFalse,
+            TBool aThreeLinesShown = EFalse ) const;
+        
+    private:  // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        void SizeChanged();
+        
+        /**
+        * From CCoeControl
+        */
+        void PositionChanged();
+
+        /**
+        * From CCoeControl
+        */
+        TInt CountComponentControls() const;
+        
+        /**
+        * From CCoeControl
+        */
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+        
+        /**
+        * From CCoeControl
+        */
+        void Draw( const TRect& aRect ) const;
+
+        /**
+        * From CCoeControl
+        */
+        void HandleResourceChange( TInt aType );
+        
+        /**
+        * From CCoeControl
+        */
+        void MakeVisible( TBool aVisible );
+
+    private:
+
+        /**
+        * 2nd phase constructor.
+        */
+        void ConstructL( const CCoeControl& aContainer, 
+            const TRect& aRect,
+            TBool aBigNEInIdle );
+
+        /**
+        * Activates current place. Place's outlook will read info from header.
+        */
+        void SetActivePlace( const CBubblePlace::TPhoneBubblePlace& aPlace , 
+                             CBubbleHeader& aHeader );
+        
+        /**
+        * Finds header from call headers array.
+        */
+        TBool FindHeader( 
+            const TBubbleId& aBubbleID, 
+            CBubbleHeader*& aHeader ) const;
+        
+        /*
+        * Find header from active headers array
+        */
+        TBool FindActiveHeader( 
+            const TBubbleId& aBubbleID, 
+            CBubbleHeader*& aHeader ) const;
+        
+        /**
+        * Builds up expanded conference call
+        */
+        void BuildExpandedConference();
+        
+        /**
+        * Buils bubbles without NE
+        */
+        void BuildBubbles();
+        
+        /**
+        * Builds bubbles with NE
+        */
+        void BuildBubblesWithNE();
+        
+        /**
+        * Builds bubbles for touch call handling.
+        */
+        void BuildBubblesForTouch();
+        
+        /**
+        * Uses index to navigate through active headers. 
+        */
+        void FindNextDrawableHeader( TUint8& aIndex );
+        
+        /*
+        * Draw lines in expanded conference again.
+        */
+        void UpdateConferenceRows( TRowNumber aRow1, TRowNumber aRow2 );
+
+        /**
+        * Finds header by call state.
+        */            
+        TBool FindHeader( const TPhoneCallState& aCallState,
+                          CBubbleHeader*& aHeader ) const;
+
+        /**
+        * Builds main pane image from call object data.
+        */
+        void BuildMainPaneImage();
+        
+        /**
+        * Reloads call object image.
+        */
+        void ReloadCallObjectImage();
+        
+        /**
+        * DoLayoutCall1 (legacy)
+        */
+        void DoLayoutCall1Bubbles();
+        
+        /**
+        * DoLayoutCall2 (call object bubbles)
+        */
+        void DoLayoutCall2Bubbles();
+        
+        /**
+        * DoLayoutCall4 (touch)
+        */
+        void DoLayoutCall4Bubbles( const TRect& aWindowPane );
+        
+        /**
+        * Start animations
+        */
+        void StartAnimations();
+        
+        /**
+        * Creates video player and starts video playback.
+        */
+        void CreateVideoPlayerAndPlay();
+        
+        /**
+        * Stops video playback and deletes video player.
+        */
+        void StopAndDeleteVideoPlayer();
+        
+        /**
+        * Checks if initializing call exist. Returns ETrue if
+        * initializing call exist otherwise EFalse.
+        */                             
+        TBool InitializingCall() const;                         
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        // Is phone muted?
+        TBool iIsMuted;
+        // Muted icon (component control).
+        CEikImage* iMutedImage;
+        
+        // Counter for Start-/EndChanges()
+        TUint8 iIsReadyToDraw;
+        
+        // Array for the call infos
+        CArrayPtrFlat<CBubbleCallHeader>* iCallHeaders;
+        // Array for currently used calls
+        CArrayPtrFlat<CBubbleHeader>* iActiveHeaders;
+        // Info object for conference call.
+        CBubbleConfHeader* iConfHeader;
+        
+        // Array for bubble places
+        CArrayPtrFlat<CBubblePlace>* iBubblePlaces;
+        // Shown bubbles (component control)
+        CArrayPtrFlat<CBubblePlace>* iActivePlaces;
+        
+        // Number Entry (component control)
+        CBubbleOutlookNumberEntry* iNumberEntry;
+        
+        // For getting the images.
+        CBubbleImageManager* iImageManager;
+        // For component pool
+        CBubbleResourceManager* iResourceManager;
+        // For customizable UI controls
+        CBubbleCustomManager* iCustomManager;
+
+        // Parent container
+        const CCoeControl* iParentControl;
+
+        // Pointer to the label buffer
+        HBufC* iLabelBuf;
+
+        // Handles number grouping
+        CPNGNumberGrouping* iNumberGrouping;
+
+        // Call object manager
+        CBubbleCallObjectManager* iCallObjectManager;
+        
+        // Main pane control
+        CBubbleMainPaneControl* iMainPaneControl;
+        
+        // Flag indicating change in call object
+        TBool iCallObjectChanged;
+        
+        // Video control.
+        CBubbleVideoController* iVideoController;
+        enum TVideoFlags
+            {
+            EBMVideoSetAsRingTone = 1,
+            EBMVideoBubbleActive = 2,
+            EBMVideoPlayingVideo = 4,
+            };
+        TInt iVideoFlags;
+        
+        // Configuration flags
+        enum TConfigurationFlags
+            {
+            EBMCallObjectDisplay = 1,
+            EBMBigNEInIdleState  = 2,
+            EBMTouchCallhandling = 4
+            };
+        TInt iConfigFlags;
+        
+        // Touchpane object.
+        CBubbleTouchPane* iTouchPane;        
+        
+        // Touchpane visibility.
+        TBool iTouchPaneSetVisible;
+        
+        // Layout variety that depend's on image size.
+        TInt iBottomImageVariety;
+        
+        TBool* iReserved2;
+    };
+
+#endif      // BUBBLEMANAGER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlook.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,176 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Abstract base class fror bubble outlooks
+*
+*/
+
+
+#ifndef BUBBLEOUTLOOK_H
+#define BUBBLEOUTLOOK_H
+
+// INCLUDES
+#include <coecntrl.h>
+#include <AknsUtils.h>
+
+// CONSTANT
+
+// FORWARD DECLARATIONS
+class CBubbleHeader;
+class CBubbleManager;
+
+// CLASS DECLARATION
+
+/**
+*  CBubbleOutlook container class
+*
+*  Abstract base class fror bubble outlooks
+*
+*  @lib bubblemanager
+*  @since 1.0
+*/
+class CBubbleOutlook : public CCoeControl 
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlook();
+        
+    protected:
+        
+        /**
+        * Symbian OS 2nd phase constructor.
+        */
+        void ConstructL( );
+        
+        /**
+        * Default constructor.
+        * @param aBubbleManager Reference to the main component.
+        */
+        CBubbleOutlook( CBubbleManager& aBubbleManager );
+        
+    public: //member functions
+        
+        /**
+        * To reset the outlook.
+        */
+        virtual void Reset( ) = 0;
+        
+        /**
+        * Give header from which the outlook should read it's info.
+        * @param aHeader The header.
+        */
+        virtual void ReadBubbleHeader( CBubbleHeader& aHeader ) = 0;
+        
+        /**
+        * Update timer/cost value and redraw it.
+        */
+        virtual void DrawTimerCostNow() = 0;
+        
+        /**
+        * Update CLI string and redraw it.
+        */
+        virtual void DrawCLINow() = 0;
+
+        /**
+        * Draw bitmaps to given context
+        * @param aGc Context to draw to.
+        */
+        virtual void DrawBitmaps( CBitmapContext& aGc ) const = 0;
+
+        /**
+        * Start animation.
+        */
+        virtual void HandleAnimationStartL() const = 0;
+
+        /**
+        * Release anim
+        * @since 2.0
+        */
+        virtual void ReleaseBitmaps();
+
+        /**
+        * Recreate the animation
+        * @since 2.0
+        */
+        virtual void RebuildBitmaps();
+
+        /**
+        * Update call header text and redraw it.
+        */
+        virtual void DrawCallHeaderText() = 0;
+        
+        /**
+        * Call object display on/off.
+        * @since 3.1
+        */
+        void SetCallObjectDisplay( TBool aActive );
+        
+    protected: // New functions
+
+        // Draws label
+        void DrawLabelNow( const CCoeControl& aLabel );
+        // Draws label if pointer is != NULL.
+        void DrawLabelNow( const CCoeControl* aLabel );
+        
+    private: // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        virtual void SizeChanged( ) = 0;
+        
+        /**
+        * From CCoeControl
+        */
+        virtual void PositionChanged();
+
+        /**
+        * From CCoeControl
+        */
+        virtual TInt CountComponentControls( ) const;
+        
+        /**
+        * From CCoeControl
+        */
+        virtual CCoeControl* ComponentControl( TInt aIndex ) const;
+        
+        /**
+        * From CCoeControl
+        */
+        virtual void Draw( const TRect& aRect ) const;
+            
+              
+    protected: //data
+
+        // Reference to the main control
+        CBubbleManager& iBubbleManager;
+        
+        // Feature settings
+        TBool iCallObjectDisplay;
+        
+        // Frame settings for Call2 layouts
+        TAknsItemID iFrameId;
+        TRect       iOuterRect;
+        TRect       iInnerRect;
+        
+    };
+
+
+
+#endif // BUBBLEOUTLOOK_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlookBottom.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Class draws the biggest bubble on the bottom of the screen
+*
+*/
+
+
+#ifndef BUBBLEOUTLOOKBOTTOM_H
+#define BUBBLEOUTLOOKBOTTOM_H
+
+// INCLUDES
+#include    "BMBubbleOutlookTwoLined.h"
+
+// CLASS DECLARATION
+
+/**
+*  CBubbleOutlookBottom container class
+*
+*  Class draws the biggest bubble on the bottom of the screen
+*
+*  @lib bubblemanager
+*  @since 1.0
+*/
+class CBubbleOutlookBottom : public CBubbleOutlookTwoLined
+    {
+    public: // Constructors and destructor       
+
+        /**
+        * Default constructor.
+        * @param aBubbleManager The main container.
+        */
+        CBubbleOutlookBottom( CBubbleManager& aBubbleManager );
+
+        /**
+        * Symbian OS 2nd phase constructor.
+        */
+        void ConstructL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlookBottom();
+        
+    public: // Functions from base classes
+          
+        /**
+        * From CBubbleOutlook
+        */
+        virtual void ReadBubbleHeader( CBubbleHeader& aHeader );   
+        
+    private: // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        void SizeChanged();
+
+        /**
+        * From CCoeControl
+        */
+        void PositionChanged();
+
+    private:
+    
+        /**
+        * DoCall1Layout
+        */
+        void DoCall1Layout();
+
+        /**
+        * DoCall2LayoutL
+        */            
+        void DoCall2LayoutL();
+        
+        /**
+        * GetCall1BubbleBitmaps
+        */
+        void GetCall1BubbleBitmaps();
+        
+    };
+
+#endif // BUBBLEOUTLOOKBOTTOM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlookBottomCnap.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,95 @@
+/*
+* 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: 
+*     Outlook class for Cnap bubble on bottom.
+*
+*/
+
+
+#ifndef CBUBBLEOUTLOOKBOTTOMCNAP_H
+#define CBUBBLEOUTLOOKBOTTOMCNAP_H
+
+//  INCLUDES
+#include "BMBubbleOutlookThreeLined.h"
+
+// CLASS DECLARATION
+
+/**
+*  Outlook class for Cnap bubble on bottom.
+*
+*  @lib bubblemanager
+*  @since 1.2
+*/
+class CBubbleOutlookBottomCnap :public CBubbleOutlookThreeLined
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        * @param aBubbleManager Main container.
+        */
+        CBubbleOutlookBottomCnap( CBubbleManager& aBubbleManager );
+
+        /**
+        * 2nd phase constructor
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlookBottomCnap();
+
+
+    public: // Functions from base classes
+          
+        /**
+        * From CBubbleOutlook
+        */
+        virtual void ReadBubbleHeader( CBubbleHeader& aHeader );   
+        
+    private: // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        void SizeChanged();
+
+        /**
+        * From CCoeControl
+        */
+        void PositionChanged();
+
+    private:
+    
+        /**
+        * DoCall1Layout
+        */
+        void DoCall1Layout();
+
+        /**
+        * DoCall2LayoutL
+        */            
+        void DoCall2LayoutL();
+        
+        /**
+        * GetCall1BubbleBitmaps
+        */
+        void GetCall1BubbleBitmaps();
+        
+    };
+
+#endif      // CBUBBLEOUTLOOKBOTTOMCNAP_H  
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlookBottomImCnap.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Bottom outlook with 3 lines and call image
+*
+*/
+
+
+#ifndef CBUBBLEOUTLOOKBOTTOMIMAGECNAP_H
+#define CBUBBLEOUTLOOKBOTTOMIMAGECNAP_H
+
+
+#include "BMBubbleOutlookThreeLined.h"
+
+/**
+ *  Bottom outlook with 3 lines and call image
+ *
+ *
+ *  @lib BubbleManager
+ *  @since S60 v5.0
+ */
+class CBubbleOutlookBottomImageCnap : public CBubbleOutlookThreeLined
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        * @param aBubbleManager Main container.
+        */
+        CBubbleOutlookBottomImageCnap( CBubbleManager& aBubbleManager );
+
+        /**
+        * 2nd phase constructor
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlookBottomImageCnap();
+
+
+    public: // Functions from base classes
+          
+        /**
+        * From CBubbleOutlook
+        */
+        virtual void ReadBubbleHeader( CBubbleHeader& aHeader );   
+        
+    private: // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        void SizeChanged();
+
+        /**
+        * From CCoeControl
+        */
+        void PositionChanged();
+
+    private:
+    
+        /**
+        * DoCall1Layout
+        */
+        void DoCall1Layout();
+
+        /**
+        * DoCall2LayoutL
+        */            
+        void DoCall2LayoutL();
+        
+        /**
+        * GetCall1BubbleBitmaps
+        */
+        void GetCall1BubbleBitmaps();
+    };
+        
+#endif // CBUBBLEOUTLOOKBOTTOMIMAGECNAP_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlookBottomImage.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,85 @@
+/*
+* 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 draws the large call image bubble on the bottom of the screen
+*
+*/
+
+
+#ifndef BUBBLEOUTLOOKBOTTOMIMAGE_H
+#define BUBBLEOUTLOOKBOTTOMIMAGE_H
+
+// INCLUDES
+#include    "BMBubbleOutlookTwoLined.h"
+
+// CLASS DECLARATION
+
+/**
+*  CBubbleOutlookBottomImage container class
+*
+*  Class draws the large call image bubble on the bottom of the screen
+*
+*  @lib bubblemanager
+*  @since 1.0
+*/
+class CBubbleOutlookBottomImage : public CBubbleOutlookTwoLined
+    {
+    public: // Constructors and destructor       
+
+        /**
+        * Default constructor.
+        * @param aBubbleManager The main container.
+        */
+        CBubbleOutlookBottomImage( CBubbleManager& aBubbleManager );
+
+        /**
+        * Symbian OS 2nd phase constructor.
+        */
+        void ConstructL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlookBottomImage();
+        
+    public: // Functions from base classes
+          
+        /**
+        * From CBubbleOutlook
+        */
+        virtual void ReadBubbleHeader( CBubbleHeader& aHeader );   
+        
+    private: // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        void SizeChanged();
+
+        /**
+        * From CCoeControl
+        */
+        void PositionChanged();
+    
+    private:
+        /**
+        * DoCall2LayoutL
+        */            
+        void DoCall2LayoutL();
+        
+    };
+
+#endif // BUBBLEOUTLOOKBOTTOMIMAGE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlookBottomRiCnap.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Bottom right outlook with 3 lines
+*
+*/
+
+
+#ifndef CBUBBLEOUTLOOKBOTTOMRIGHTCNAP_H
+#define CBUBBLEOUTLOOKBOTTOMRIGHTCNAP_H
+
+//  INCLUDES
+#include "BMBubbleOutlookThreeLined.h"
+
+// CLASS DECLARATION
+
+/**
+ *  Bottom right outlook with 3-lines.
+ *
+ *
+ *  @lib BubbleManager
+ *  @since S60 v5.0
+ */
+class CBubbleOutlookBottomRightCnap :public CBubbleOutlookThreeLined
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        * @param aBubbleManager Main container.
+        */
+        CBubbleOutlookBottomRightCnap( CBubbleManager& aBubbleManager );
+
+        /**
+        * 2nd phase constructor
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlookBottomRightCnap();
+
+
+    public: // Functions from base classes
+          
+        /**
+        * From CBubbleOutlook
+        */
+        virtual void ReadBubbleHeader( CBubbleHeader& aHeader );   
+        
+    private: // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        void SizeChanged();
+
+        /**
+        * From CCoeControl
+        */
+        void PositionChanged();
+
+    private:
+    
+        /**
+        * DoCall1Layout
+        */
+        void DoCall1Layout();
+
+        /**
+        * DoCall2LayoutL
+        */            
+        void DoCall2LayoutL();
+        
+        /**
+        * GetCall1BubbleBitmaps
+        */
+        void GetCall1BubbleBitmaps();
+        
+    };
+
+#endif // CBUBBLEOUTLOOKBOTTOMRIGHTCNAP_H  
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlookBottomRight.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,92 @@
+/*
+* 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: 
+*     Draws bubble at bottom right i.e. in two call situation the second call
+*
+*/
+
+
+#ifndef BUBBLEOUTLOOKBOTTOMRIGHT_H
+#define BUBBLEOUTLOOKBOTTOMRIGHT_H
+
+// INCLUDES
+#include    "BMBubbleOutlookTwoLined.h"
+
+// CLASS DECLARATION
+
+/**
+*  CBubbleOutlookBottomRight container class
+*
+*  Draws bubble at bottom right i.e. in two call situation the second call
+*
+*  @lib bubblemanager
+*  @since 1.0
+*/
+
+class CBubbleOutlookBottomRight : public CBubbleOutlookTwoLined
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Default constructor.
+        * @param aBubbleManager Main container
+        */
+        CBubbleOutlookBottomRight( CBubbleManager& aBubbleManager );
+        
+        /**
+        * Symbian OS 2nd phase constructor.
+        */
+        void ConstructL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlookBottomRight();
+
+    public: // Functions from base classes
+        
+        /**
+        * From CBubbleOutlook
+        */
+        void ReadBubbleHeader( CBubbleHeader& aHeader );
+        
+    private: // Functions from base classes
+          
+        /**
+        * From CCoeControl
+        */
+        void SizeChanged();
+        
+    private:
+    
+        /**
+        * DoCall1Layout
+        */
+        void DoCall1Layout();
+
+        /**
+        * DoCall2LayoutL
+        */            
+        void DoCall2LayoutL();
+        
+        /**
+        * GetCall1BubbleBitmaps
+        */
+        void GetCall1BubbleBitmaps();        
+        
+    };
+
+#endif // BUBBLEOUTLOOKBOTTOMRIGHT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlookBottomText.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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: 
+*     Class draws the textual CLI bubble on the bottom of the screen
+*
+*/
+
+
+#ifndef BUBBLEOUTLOOKBOTTOMTEXT_H
+#define BUBBLEOUTLOOKBOTTOMTEXT_H
+
+// INCLUDES
+#include    "BMBubbleOutlookFiveLined.h"
+
+// CLASS DECLARATION
+
+/**
+*  CBubbleOutlookBottomText container class
+*
+*  Class draws the textual CLI bubble on the bottom of the screen
+*
+*  @lib bubblemanager
+*  @since 1.0
+*/
+class CBubbleOutlookBottomText : public CBubbleOutlookFiveLined
+    {
+    public: // Constructors and destructor       
+
+        /**
+        * Default constructor.
+        * @param aBubbleManager The main container.
+        */
+        CBubbleOutlookBottomText( CBubbleManager& aBubbleManager );
+
+        /**
+        * Symbian OS 2nd phase constructor.
+        */
+        void ConstructL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlookBottomText();
+        
+    public: // Functions from base classes
+          
+        /**
+        * From CBubbleOutlook
+        */
+        virtual void ReadBubbleHeader( CBubbleHeader& aHeader );   
+        
+    private: // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        void SizeChanged();
+
+        /**
+        * From CCoeControl
+        */
+        void PositionChanged();
+    
+    private:
+        /**
+        * DoCall2LayoutL
+        */            
+        void DoCall2LayoutL();
+        
+        /**
+        * SetCallObjectTextToLabelsL
+        */
+        void SetCallObjectTextToLabelsL( const TDesC& aText,
+                                         TInt aLabelCount,
+                                         CEikLabel* aLabels[] );
+    };
+
+#endif // BUBBLEOUTLOOKBOTTOMTEXT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlookConference.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,191 @@
+/*
+* 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: 
+*     Draws expanded conference call
+*
+*/
+
+
+#ifndef BUBBLEOUTLOOKCONFERENCE_H
+#define BUBBLEOUTLOOKCONFERENCE_H
+
+// INCLUDES
+#include    <calslbs.h>
+   
+#include    "BMBubbleOutlook.h"
+#include    "BMCallHeader.h"
+#include    "BMConfPane.h"
+
+// FORWARD DECLARATIONS
+class CEikLabel;       
+class CEikImage;
+class CBubbleImageManager;
+class CConfHeader;
+
+
+// CLASS DECLARATION
+
+/**
+*  CBubbleOutlookConference container class
+*
+*  Object handles expanded conference call.
+*
+*  @lib bubblemanager 
+*  @since 1.0
+*/
+class CBubbleOutlookConference : public CBubbleOutlook
+{
+
+    public: // Constructors and destructor
+       
+        /**
+        * Symbian OS default constructor.
+        * @param aBubbleManager Main container
+        */
+        CBubbleOutlookConference( CBubbleManager& aBubbleManager );
+
+        /**
+        * Symbian OS 2nd phase constructor.
+        * @param aCallAmount Amount of panes allocated.
+        */
+        void ConstructL( const TUint8& aCallAmount );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlookConference();
+
+    public: // New functions
+    
+        /**
+        * Draws given row
+        * @param aRow Row number to be drawn.
+        */
+        void DrawRowNow( CBubbleManager::TRowNumber aRow );
+
+
+    public:// Functions from base classes
+
+        /**
+        * From CBubbleOutlook 
+        */
+        void Reset();
+
+        /**
+        * From CBubbleOutlook 
+        */
+        void ReadBubbleHeader( CBubbleHeader& aHeader );
+
+        /**
+        * From CBubbleOutlook 
+        */
+        virtual void DrawTimerCostNow();
+
+        /**
+        * From CBubbleOutlook
+        */
+        virtual void DrawCLINow();
+
+        /**
+        * From CBubbleOutlook
+        */
+        void DrawBitmaps( CBitmapContext& aGc ) const;
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void HandleAnimationStartL() const;
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void DrawCallHeaderText();
+
+    private: // Functions from base classes
+
+       /**
+        * From CCoeControl Called when rect changes
+        */
+        void SizeChanged();
+
+       /**
+        * From CCoeControl
+        */
+        TInt CountComponentControls() const;
+
+       /**
+        * From CCoeControl
+        */
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+
+       /**
+        * From CCoeControl
+        */
+        void Draw( const TRect& aRect ) const;
+
+       /**
+        * From CCoeControl
+        */ 
+        void CBubbleOutlookConference::HandlePointerEventL
+            ( const TPointerEvent& aPointerEvent );
+
+    private:
+    
+        /**
+        * DoCall1Layout
+        */
+        void DoCall1Layout();
+
+        /**
+        * DoCall2LayoutL
+        */            
+        void DoCall2LayoutL();
+        
+        /**
+        * DoCall4Layout
+        */            
+        void DoCall4LayoutL();
+        
+        /**
+        * GetCall1BubbleBitmaps
+        */
+        void GetCall1BubbleBitmaps();
+
+    private: //data
+
+        // call amount in conference
+        TUint8 iPaneAmount; 
+
+        // all the information
+        CBubbleConfHeader* iHeader; 
+
+        // speech bubble image
+        CEikImage* iBubble; 
+        // Timer control
+        CEikLabel* iTimerCost; 
+
+        // for drawing
+        CArrayPtrFlat<CBubbleConfPane>* iConfPanes; 
+        // for fetching info
+        CArrayPtrFlat<CBubbleCallHeader>* iCalls; 
+        
+    private:
+
+        friend class CT_CBubbleOutlookConference;
+    
+};
+
+#endif // BUBBLEOUTLOOKCONFERENCE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlookFiveLined.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,189 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Outlook base class for five lined bubbles
+*
+*/
+
+
+
+#ifndef CBUBBLEOUTLOOKFIVELINED_H
+#define CBUBBLEOUTLOOKFIVELINED_H
+
+//  INCLUDES
+#include <calslbs.h>
+#include "BMBubbleOutlook.h"
+#include "BMBubbleManager.h"
+#include "BMUtils.h"
+
+// FORWARD DECLARATIONS
+class CEikImage;
+class CEikLabel;
+class CBubbleImageManager;
+class CBubbleHeader;
+class CTelBubbleCustomElement;
+
+
+// CLASS DECLARATION
+
+/**
+*  Outlook base class for five lined bubbles
+*
+*  @lib bubblemanager
+*  @since Series60_1.2
+*/
+class CBubbleOutlookFiveLined :public CBubbleOutlook
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlookFiveLined();
+
+    public: // Functions from base classes
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void Reset();
+        
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void ReadBubbleHeader( CBubbleHeader& aHeader );
+        
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void DrawTimerCostNow();
+        
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void DrawCLINow();
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void DrawBitmaps( CBitmapContext& aGc ) const;
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void HandleAnimationStartL() const;
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void DrawCallHeaderText();
+
+    private:  // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        virtual void SizeChanged() = 0;
+        
+        /**
+        * From CCoeControl
+        */
+        virtual TInt CountComponentControls( ) const;
+        
+        /**
+        * From CCoeControl
+        */
+        virtual CCoeControl* ComponentControl( TInt aIndex ) const;
+        
+        /**
+        * From CCoeControl
+        */
+        virtual void Draw( const TRect& aRect ) const;
+        
+    protected:
+
+        /**
+        * C++ default constructor.
+        * @param aBubbleManager Main container
+        */
+        CBubbleOutlookFiveLined( CBubbleManager& aBubbleManager );
+
+        /**
+        * 2nd phase constructor
+        */
+        void ConstructL();
+        
+    protected:    // Data
+        // Current header
+        CBubbleHeader* iHeader;
+        // Text line number
+        TUint8 iTextLineNumber;
+        
+        // Bubble image
+        CEikImage* iBubble;
+        
+        // Big call indication / customized
+        CTelBubbleCustomElement* iBigCallIndicator;
+        // Small call indication
+        CTelBubbleCustomElement* iSmallCallIndication;
+        // Number type
+        CTelBubbleCustomElement* iNumberType;
+        // Call type indicator #1
+        CEikImage* iTypeIndication1;
+        // Call type indicator #2
+        CEikImage* iTypeIndication2;
+        // Cyph off
+        CEikImage* iCyphOffImage;
+                
+        // tn shadow
+        TBubbleLayoutRect iTnImageShadow;
+
+        // tn
+        CEikImage* iTnImage;
+        
+        // 1st line label
+        mutable CEikLabel* iTextLine1; // Text will be clipped and placed in 
+        // 2nd line label
+        mutable CEikLabel* iTextLine2; // Draw() const method.
+        // 3rd line label
+        mutable CEikLabel* iTextLine3;
+        // 3rd line label
+        mutable CEikLabel* iTextLine4;
+        // 3rd line label
+        mutable CEikLabel* iTextLine5;
+        // Original buffer
+        TPtrC iFullText1; 
+        // Original buffer
+        TPtrC iFullText2;
+        // Original buffer
+        TPtrC iFullText3;
+        // Original buffer
+        TPtrC iFullText4;
+        // Original buffer
+        TPtrC iFullText5;
+        // clip dir
+        CBubbleManager::TPhoneClippingDirection iText1ClipDirection;
+        // clip dir
+        CBubbleManager::TPhoneClippingDirection iText2ClipDirection;
+        // clip dir
+        CBubbleManager::TPhoneClippingDirection iText3ClipDirection;
+        // Timer/cost label
+        CEikLabel* iTimerCost;
+        // Three lines of call text layout
+        TBool iThreeLinedLayout;                                         
+    
+    };
+
+#endif      // CBUBBLEOUTLOOKFIVELINED_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlookHide.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Draws hiding bubble on top
+*
+*/
+
+
+#ifndef BUBBLEOUTLOOKTOPHIDE_H
+#define BUBBLEOUTLOOKTOPHIDE_H
+
+// INCLUDES
+#include    <calslbs.h>
+#include    "BMBubbleOutlook.h"
+
+// FORWARD DECLARATIONS
+class CEikLabel; 
+class CEikImage;
+class CBubbleImageManager;
+class CBubbleHeader;
+
+
+// CLASS DECLARATION
+
+/**
+*  CBubbleOutlookHide container class
+*
+*  Draws hiding bubble on top
+*
+*  @lib bubblemanager
+*  @since 1.0
+*/
+class CBubbleOutlookHide : public CBubbleOutlook  
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Default constructor.
+        * @param aBubbleManager Main container
+        */
+        CBubbleOutlookHide( CBubbleManager& aBubbleManager );
+        
+        /**
+        * Symbian OS 2nd phase constructor.
+        */
+        void ConstructL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlookHide();
+
+    public: // Functions from base classes
+        
+        /**
+        * From CBubbleOutlook
+        */
+        void Reset( );
+        
+        /**
+        * From CBubbleOutlook
+        */
+        void ReadBubbleHeader( CBubbleHeader& aHeader );
+        
+        /**
+        * From CBubbleOutlook
+        */
+        virtual void DrawTimerCostNow();
+        
+        /**
+        * From CBubbleOutlook
+        */
+        virtual void DrawCLINow();
+
+        /**
+        * From CBubbleOutlook
+        */
+        void DrawBitmaps( CBitmapContext& aGc ) const;
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void HandleAnimationStartL() const;
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void DrawCallHeaderText();
+        
+    private: // Functions from base classes
+             
+        /**
+        * From CCoeControl
+        */
+        void SizeChanged();
+        
+        
+    private: //data
+        
+        // Bubble image
+        CEikImage* iBubble;
+    };
+
+#endif // BUBBLEOUTLOOKTOPHIDE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlookMiddle.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Draws bubble in middle i.e. in two call situation the first call
+*
+*/
+
+
+#ifndef BUBBLEOUTLOOKMIDDLE_H
+#define BUBBLEOUTLOOKMIDDLE_H
+
+// INCLUDES
+#include    "BMBubbleOutlookTwoLined.h"
+
+// CLASS DECLARATION
+
+/**
+*  CBubbleOutlookMiddle container class
+*
+*  @lib bubblemanager
+*  @since 1.0
+*/
+class CBubbleOutlookMiddle : public CBubbleOutlookTwoLined
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Default constructor.
+        * @param aBubbleManager Main container
+        */
+        CBubbleOutlookMiddle( CBubbleManager& aBubbleManager );
+        
+        /**
+        * Symbian OS 2nd phase constructor.
+        */
+        void ConstructL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlookMiddle();
+
+    public: //member functions
+        
+        /**
+        * Set bubble go under. For example active bubble can be under or on top 
+        * of bottom right bubble. There is only one line shadow in 'under bubble'.
+        * @param aIsUnder ETrue puts bubble under the second call.
+        */
+        void SetIsUnder( const TBool& aIsUnder );
+
+    public: // Functions from base classes
+        
+        /**
+        * From CBubbleOutlook
+        */
+        void Reset( );
+        
+        /**
+        * From CBubbleOutlook
+        */
+        void ReadBubbleHeader( CBubbleHeader& aHeader );
+        
+        
+    private: // Functions from base classes
+                
+        /**
+        * From CCoeControl
+        */
+        void SizeChanged();
+        
+    private:
+    
+        /**
+        * DoCall1Layout
+        */
+        void DoCall1Layout();
+
+        /**
+        * DoCall2Layout (may leave!)
+        */            
+        void DoCall2LayoutL();
+        
+        /**
+        * GetCall1BubbleBitmaps
+        */
+        void GetCall1BubbleBitmaps();        
+        
+    private: //data
+        
+        // Is under or on top of bottom right bubble
+        TBool iIsUnder;
+
+    };
+
+#endif // BUBBLEOUTLOOKMIDDLE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlookMiddleCnap.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Outlook class for Cnap bubble on bottom.
+*
+*/
+
+
+#ifndef CBUBBLEOUTLOOKMIDDLECNAP_H
+#define CBUBBLEOUTLOOKMIDDLECNAP_H
+
+//  INCLUDES
+#include "BMBubbleOutlookThreeLined.h"
+
+// CLASS DECLARATION
+
+/**
+*  Outlook class for Cnap bubble on bottom.
+*
+*  @lib bubblemanager
+*  @since 1.2
+*/
+class CBubbleOutlookMiddleCnap :public CBubbleOutlookThreeLined
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        * @param aBubbleManager Main container.
+        */
+        CBubbleOutlookMiddleCnap( CBubbleManager& aBubbleManager );
+
+        /**
+        * 2nd phanse constructor
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlookMiddleCnap();
+
+
+    public: // Functions from base classes
+          
+        /**
+        * From CBubbleOutlook
+        */
+        virtual void ReadBubbleHeader( CBubbleHeader& aHeader );   
+        
+    private: // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        void SizeChanged();
+
+    private:
+    
+        /**
+        * DoCall1Layout
+        */
+        void DoCall1Layout();
+
+        /**
+        * DoCall2LayoutL
+        */            
+        void DoCall2LayoutL();
+        
+        /**
+        * GetCall1BubbleBitmaps
+        */
+        void GetCall1BubbleBitmaps();
+        
+    };
+
+#endif      // CBUBBLEOUTLOOKMIDDLECNAP_H  
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlookNE.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,329 @@
+/*
+* 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: 
+*     Handles number entry component
+*
+*/
+
+
+#ifndef BUBBLEOUTLOOKNE_H
+#define BUBBLEOUTLOOKNE_H
+
+// INCLUDES
+#include    <calslbs.h>
+#include    "BMBubbleOutlook.h"
+
+// FORWARD DECLARATIONS
+class CEikLabel; 
+class CEikImage;
+class CBubbleImageManager;
+class CBubbleHeader;
+class CAknPhoneNumberEditor;
+class CAknsBasicBackgroundControlContext;
+class CEikStatusPane;
+class CAknsFrameBackgroundControlContext;
+
+// CLASS DECLARATION
+
+/**
+*  CBubbleOutlookNumberEntry container class
+*
+*  Handles number entry component
+*
+*  @lib bubblemanager
+*  @since 1.0
+*/
+class CBubbleOutlookNumberEntry : public CBubbleOutlook, 
+                                  public MCoeControlObserver
+    {
+    public:
+        
+        // Place on the screen
+        enum TPhoneNumberEntryPlace
+            {
+            ENENone,
+            ENEBottom,         // NE + multiple calls
+            ENEBottomRight,    // NE + single call
+            ENEIdleState       // NE in idle state
+            };
+        
+    public: // Constructors and destructor
+        
+        /**
+        * Default constructor.
+        * @param aBubbleManager Main container
+        * @param aMutedImage Muted image pointer. This needs refresh when row
+        *                    amount is changed.
+        */
+        CBubbleOutlookNumberEntry( CBubbleManager& aBubbleManager,
+                                   const CCoeControl& aMutedImage );
+
+        /**
+        * Symbian OS 2nd phase constructor.
+        */
+        void ConstructL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlookNumberEntry();
+
+    public: // New functions
+
+        /**
+        * Set number entry in use.
+        * @param aIsUsed ETrue if put to use.
+        */
+        void SetIsUsed( const TBool& aIsUsed );
+
+        /**
+        * Is number entry in use.
+        * @return ETrue if in use.
+        */
+        TBool IsUsed() const;
+
+        /**
+        * Set number entry place.
+        * @param aPlace Palce enumeration.
+        */
+        void SetPlace( const TPhoneNumberEntryPlace& aPlace );
+
+        /**
+        * Get number entry place
+        * @return Place enumeration.
+        */
+        TPhoneNumberEntryPlace Place() const;
+
+        /**
+        * Get editor component.
+        * @return The editor.
+        */
+        CCoeControl* GetEditor( ) const;
+
+        /**
+        * Set text in number entry.
+        * @param aDesC Text to in.
+        */
+        void SetText( const TDesC& aDesC );
+        
+        /**
+        * Get number entry text string.
+        * @param aDesC Descriptor where the text is set to.
+        */
+        void GetText( TDes& aDesC ); 
+        
+        /**
+        * Set number entry's editor mode.
+        * @since 3.0
+        * @param aMode for number editor input mode.
+        * @return Input mode of the editor.
+        */
+        TInt ChangeEditorMode( TBool aDefaultMode = EFalse );
+        
+        /**
+        * Get number entry's editor mode.
+        * @since 3.0
+        * @return Input mode of the editor.
+        */
+        TInt GetEditorMode() const;
+        
+        /**
+        * Resets number entry editor to default values.
+        * @since 3.0
+        */
+        void ResetEditorToDefaultValues();
+        
+    public: // Functions from base classes
+        
+        /**
+        * From CBubbleOutlook
+        */
+        void Reset( );
+        
+        /**
+        * From CBubbleOutlook
+        */
+        void ReadBubbleHeader( CBubbleHeader& aHeader );
+        
+        /**
+        * From CBubbleOutlook
+        */
+        void DrawTimerCostNow();
+        
+        /**
+        * From CBubbleOutlook
+        */
+        void DrawCLINow();
+
+        /**
+        * From CBubbleOutlook
+        */
+        void DrawBitmaps( CBitmapContext& aGc ) const;
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void HandleAnimationStartL() const;
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void ReleaseBitmaps();
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void RebuildBitmaps();
+
+         /**
+        * Update call header text and redraw it.
+        */
+        virtual void DrawCallHeaderText();
+
+    private: // Functions from base classes
+          
+        /**
+        * From CCoeControl
+        */
+        void SizeChanged();
+        
+        /**
+        * From CCoeControl
+        */
+        TInt CountComponentControls() const;
+        
+        /**
+        * From CCoeControl
+        */
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+        
+        /**
+        * From MCoeControlObserver
+        */
+        void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType );
+       
+        /**
+        * From CCoeControl
+        */
+        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, 
+                                     TEventCode aType );
+          
+        /**
+        * From CCoeControl
+        */
+        void FocusChanged( TDrawNow aDrawNow );
+
+        /**
+        * From CCoeControl
+        */
+        TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
+
+        /**
+        * From CCoeControl
+        */
+        virtual void Draw( const TRect& aRect ) const;
+
+    private: // New functions
+
+        /**
+        * Construct and layout the editor.
+        * @param aReader a resource reader.
+        * @since Series60_2.8
+        * @return None.
+        */
+        void ConstructEditorFromResourceAndLayoutL( TResourceReader& aReader );
+
+        /**
+        * Get number entry rect.
+        * @param aIndex a layout index.
+        * @param aColor number entry text color value.
+        * @return the rect of the number entry.
+        * @since Series60_2.8
+        */
+        TRect NumberEntryRect( TInt aIndex, TRgb& aColor );
+
+        /**
+        * Update existing formats.
+        */
+        void UpdateEditorFormats( TPhoneNumberEntryPlace aPlace );
+
+        /**
+        * Update phone number editor skin color.
+        */
+        void UpdateEditorColor( const TRgb aColor );
+        
+        /**
+        * SetPlace for 1-piece graphics
+        */
+        void SetPlace1( const TPhoneNumberEntryPlace& aPlace );
+        
+        /**
+        * SetPlace for 9-piece graphics
+        */
+        void SetPlace2( const TPhoneNumberEntryPlace& aPlace );
+        
+        /**
+        * SizeChanged for 1-piece graphics
+        */
+        void SizeChanged1();
+        
+        /**
+        * SizeChanged for 9-piece graphics
+        */
+        void SizeChanged2();
+             
+        /**
+         * Updates editor
+         * 
+         */
+        void UpdateAndDrawEditor();
+        
+    private: //data
+        
+        // The editor component
+        CAknPhoneNumberEditor* iEditor;
+        
+        // Muted image
+        const CCoeControl& iMutedImage;
+
+        // Current place
+        TPhoneNumberEntryPlace iPlace;
+        // Is NE used
+        TBool iIsUsed;
+        
+        // Bubble graphics
+        CEikImage* iBubble;
+
+        // Last event
+        TInt iLastEvent;
+        // Was NE focused before
+        TInt iWasFocused;
+
+        // Skin control context for the editor (1-piece)
+        CAknsBasicBackgroundControlContext* iSkinContext;
+        
+        // Skin control context for the editor (9-piece)
+        CAknsFrameBackgroundControlContext* iFrameContext;
+
+        // Amount of formats for updating.
+        TInt iFormatCount;
+
+        // Pointer to status pane.
+        CEikStatusPane* iStatusPane; 
+        
+    };
+
+#endif // BUBBLEOUTLOOKNE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlookOneLined.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,175 @@
+/*
+* 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: 
+*     Base class for big bubbles (bottom, bottom right, middle).
+*
+*/
+
+
+#ifndef CBUBBLEOUTLOOKONELINED_H
+#define CBUBBLEOUTLOOKONELINED_H
+
+//  INCLUDES
+#include <calslbs.h>
+#include "BMBubbleOutlook.h"
+#include "BMBubbleManager.h"
+
+// FORWARD DECLARATIONS
+class CBubbleHeader;
+class CEikLabel; 
+class CEikImage;
+class CBubbleImageManager;
+class CBubbleAnimationControl;
+class CTelBubbleCustomElement;
+// CLASS DECLARATION
+
+/**
+*  Base class for big bubbles (bottom, bottom right, middle).
+*
+*  @lib bubblemanager
+*  @since 1.0
+*/
+class CBubbleOutlookOneLined : public CBubbleOutlook
+    {
+    public:  // Destructor
+
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlookOneLined();
+        
+    protected: // Constructors
+
+        /**
+        * C++ default constructor.
+        * @param aBubbleManager Main container
+        */
+        CBubbleOutlookOneLined( CBubbleManager& aBubbleManager );
+
+        /**
+        * 2nd phase constructor
+        */
+        void ConstructL();
+
+    public: // Functions from base classes
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void Reset();
+        
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void ReadBubbleHeader( CBubbleHeader& aHeader );
+        
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void DrawTimerCostNow();
+        
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void DrawCLINow();
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void DrawBitmaps( CBitmapContext& aGc ) const;
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void HandleAnimationStartL() const;
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void ReleaseBitmaps();
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void RebuildBitmaps();
+
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void DrawCallHeaderText();
+
+    private:  // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        virtual void SizeChanged( ) = 0;
+        
+        /**
+        * From CCoeControl
+        */
+        virtual TInt CountComponentControls( ) const;
+        
+        /**
+        * From CCoeControl
+        */
+        virtual CCoeControl* ComponentControl( TInt aIndex ) const;
+        
+        /**
+        * From CCoeControl
+        */
+        virtual void Draw( const TRect& aRect ) const;
+        
+    private: // New functions
+
+        /**
+        * Draw Call1 bitmaps
+        */
+        void DrawCall1Bitmaps( CBitmapContext& aGc ) const;
+
+        /**
+        * Draw Call2 bitmaps
+        */
+        void DrawCall2Bitmaps( CBitmapContext& aGc ) const;
+
+    protected:  // Data
+
+        // Current call header
+        CBubbleHeader* iHeader;
+        
+        // Bubble image
+        CEikImage* iBubble;
+
+        // Small call indication
+        CTelBubbleCustomElement* iSmallCallIndication;
+        
+        // Type indication #1
+        CEikImage* iTypeIndication1;
+        // Type indication #2
+        CEikImage* iTypeIndication2;
+        // Cyphering off indication
+        CEikImage* iCyphOffImage;
+        
+        // Text label
+        mutable CEikLabel* iTextLine1;
+        // Pointer to original text.
+        TPtrC iFullText1;
+        // Clipping direction
+        CBubbleManager::TPhoneClippingDirection iText1ClipDirection;
+    };
+
+#endif      // CBUBBLEOUTLOOKONELINED_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlookThreeLined.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,193 @@
+/*
+* 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:  Outlook base class for three lined bubbles
+*
+*/
+
+
+
+#ifndef CBUBBLEOUTLOOKTHREELINED_H
+#define CBUBBLEOUTLOOKTHREELINED_H
+
+//  INCLUDES
+#include <calslbs.h>
+#include "BMBubbleOutlook.h"
+#include "BMBubbleManager.h"
+#include "BMUtils.h"
+
+// FORWARD DECLARATIONS
+class CEikImage;
+class CEikLabel;
+class CBubbleImageManager;
+class CBubbleHeader;
+class CTelBubbleCustomElement;
+
+// CLASS DECLARATION
+
+/**
+*  Outlook base class for three lined bubbles
+*
+*  @lib bubblemanager
+*  @since Series60_1.2
+*/
+class CBubbleOutlookThreeLined :public CBubbleOutlook
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlookThreeLined();
+
+    public: // Functions from base classes
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void Reset();
+        
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void ReadBubbleHeader( CBubbleHeader& aHeader );
+        
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void DrawTimerCostNow();
+        
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void DrawCLINow();
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void DrawBitmaps( CBitmapContext& aGc ) const;
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void HandleAnimationStartL() const;
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void DrawCallHeaderText();
+
+    private:  // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        virtual void SizeChanged() = 0;
+        
+        /**
+        * From CCoeControl
+        */
+        virtual TInt CountComponentControls( ) const;
+        
+        /**
+        * From CCoeControl
+        */
+        virtual CCoeControl* ComponentControl( TInt aIndex ) const;
+        
+        /**
+        * From CCoeControl
+        */
+        virtual void Draw( const TRect& aRect ) const;
+        
+    protected:
+
+        /**
+        * C++ default constructor.
+        * @param aBubbleManager Main container
+        */
+        CBubbleOutlookThreeLined( CBubbleManager& aBubbleManager );
+
+        /**
+        * 2nd phase constructor
+        */
+        void ConstructL();
+        
+    private: // New functions
+
+        /**
+        * Draw Call1 bitmaps
+        */
+        void DrawCall1Bitmaps( CBitmapContext& aGc ) const;
+        
+        /**
+        * Draw Call2 bitmaps
+        */
+        void DrawCall2Bitmaps( CBitmapContext& aGc ) const;
+
+
+    protected:    // Data
+        // Current header
+        CBubbleHeader* iHeader;
+        // Text line number
+        TUint8 iTextLineNumber;
+        
+        // Bubble image
+        CEikImage* iBubble;
+        
+        // Big call indication / customized
+        CTelBubbleCustomElement* iBigCallIndicator;
+        // Small call indication
+        CTelBubbleCustomElement* iSmallCallIndication;
+        // Number type
+        CTelBubbleCustomElement* iNumberType;
+        // Call type indicator #1
+        CEikImage* iTypeIndication1;
+        // Call type indicator #2
+        CEikImage* iTypeIndication2;
+        // Cyph off
+        CEikImage* iCyphOffImage;
+                
+        // tn shadow
+        TBubbleLayoutRect iTnImageShadow;
+
+        // tn
+        CEikImage* iTnImage;
+        
+        // 1st line label
+        mutable CEikLabel* iTextLine1; // Text will be clipped and placed in 
+        // 2nd line label
+        mutable CEikLabel* iTextLine2; // Draw() const method.
+        // 3rd line label
+        mutable CEikLabel* iTextLine3;
+        // Original buffer
+        TPtrC iFullText1; 
+        // Original buffer
+        TPtrC iFullText2;
+        // Original buffer
+        TPtrC iFullText3;
+        // clip dir
+        CBubbleManager::TPhoneClippingDirection iText1ClipDirection;
+        // clip dir
+        CBubbleManager::TPhoneClippingDirection iText2ClipDirection;
+        // clip dir
+        CBubbleManager::TPhoneClippingDirection iText3ClipDirection;
+
+        // Timer/cost label
+        CEikLabel* iTimerCost;
+        // Brand image
+        CTelBubbleCustomElement* iBrandImage;
+    };
+
+#endif      // CBUBBLEOUTLOOKTHREELINED_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlookTopLeft.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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: 
+*     Draw bubble on top i.e. in three call situation the first call
+*
+*/
+
+
+#ifndef BUBBLEOUTLOOKTOPLEFT_H
+#define BUBBLEOUTLOOKTOPLEFT_H
+
+// INCLUDES
+#include    "BMBubbleOutlookOneLined.h"
+
+// CLASS DECLARATION
+
+/**
+*  CBubbleOutlookTopLeft container class
+*
+*  Draw bubble on top i.e. in three call situation the first call
+*
+*  @lib bubblemanager
+*  @since 1.0
+*/
+class CBubbleOutlookTopLeft : public CBubbleOutlookOneLined
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Default constructor.
+        * @param aBubbleManager Main container.
+        */
+        CBubbleOutlookTopLeft( CBubbleManager& aBubbleManager);
+        
+        /**
+        * Symbian OS 2nd phase constructor.
+        */
+        void ConstructL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlookTopLeft();
+
+    public: // Functions from base classes
+        
+        /**
+        * From CBubbleOutlook
+        */
+        void ReadBubbleHeader( CBubbleHeader& aHeader );
+        
+    private: // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        void SizeChanged();
+        
+    private:
+    
+        /**
+        * DoCall1Layout
+        */
+        void DoCall1Layout();
+
+        /**
+        * DoCall2LayoutL
+        */            
+        void DoCall2LayoutL();
+        
+        /**
+        * GetCall1BubbleBitmaps
+        */
+        void GetCall1BubbleBitmaps();        
+        
+    };
+
+#endif // BUBBLEOUTLOOKTOPLEFT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlookTopRight.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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: 
+*     Handle the bubble in top rigth i.e. in three call situation the second call
+*
+*/
+
+
+#ifndef BUBBLEOUTLOOKTIORIGHT_H
+#define BUBBLEOUTLOOKTIORIGHT_H
+
+// INCLUDES
+#include    "BMBubbleOutlookOneLined.h"
+
+// CLASS DECLARATION
+
+/**
+*  CBubbleOutlookTopRight container class
+*
+*  Handle the bubble in top rigth i.e. in three call situation the second call
+*
+*  @lib bubblemanager
+*  @since 1.0
+*/
+class CBubbleOutlookTopRight : public CBubbleOutlookOneLined
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Default constructor.
+        * @param aBubbleManager Main container
+        */
+        CBubbleOutlookTopRight( CBubbleManager& aBubbleManager );
+        
+        /**
+        * Symbian OS 2nd phase constructor.
+        */
+        void ConstructL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlookTopRight();
+
+    public: // Functions from base classes
+
+        /**
+        * From CBubbleOutlook
+        */
+        void ReadBubbleHeader( CBubbleHeader& aHeader );
+           
+    private: // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        void SizeChanged();
+        
+    private:
+    
+        /**
+        * DoCall1Layout
+        */
+        void DoCall1Layout();
+
+        /**
+        * DoCall2LayoutL
+        */            
+        void DoCall2LayoutL();
+        
+        /**
+        * GetCall1BubbleBitmaps
+        */
+        void GetCall1BubbleBitmaps();        
+        
+    };
+
+#endif // BUBBLEOUTLOOKTIORIGHT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlookTwoLined.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,188 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Base class for big bubbles (bottom, bottom right, middle).
+*
+*/
+
+
+#ifndef CBUBBLEOUTLOOKTWOLINED_H
+#define CBUBBLEOUTLOOKTWOLINED_H
+
+//  INCLUDES
+#include <calslbs.h>
+#include "BMBubbleOutlook.h"
+#include "BMBubbleManager.h"
+#include "BMUtils.h"
+
+// FORWARD DECLARATIONS
+class CBubbleHeader;
+class CEikLabel; 
+class CEikImage;
+class CBubbleImageManager;
+class CBubbleAnimationControl;
+class CTelBubbleCustomElement;
+
+// CLASS DECLARATION
+
+/**
+*  Base class for big bubbles (bottom, bottom right, middle).
+*
+*  @lib bubblemanager
+*  @since 1.0
+*/
+class CBubbleOutlookTwoLined : public CBubbleOutlook
+    {
+    public:  // Destructor
+
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlookTwoLined();
+        
+    protected: // Constructors
+
+        /**
+        * C++ default constructor.
+        * @param aBubbleManager Main container
+        */
+        CBubbleOutlookTwoLined( CBubbleManager& aBubbleManager );
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+        
+    public: // Functions from base classes
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void Reset( );
+        
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void ReadBubbleHeader( CBubbleHeader& aHeader );
+        
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void DrawTimerCostNow();
+        
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void DrawCLINow();
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void DrawBitmaps( CBitmapContext& aGc ) const;
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void HandleAnimationStartL() const;
+
+        /**
+        * From CBubbleOutlook.
+        */
+        virtual void DrawCallHeaderText();
+        
+    private:  // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        virtual void SizeChanged( ) = 0;
+        
+        /**
+        * From CCoeControl
+        */
+        virtual TInt CountComponentControls( ) const;
+        
+        /**
+        * From CCoeControl
+        */
+        virtual CCoeControl* ComponentControl( TInt aIndex ) const;
+        
+        /**
+        * From CCoeControl
+        */
+        virtual void Draw( const TRect& aRect ) const;
+        
+    private: // New functions
+
+        /**
+        * Draw Call1 bitmaps
+        */
+        void DrawCall1Bitmaps( CBitmapContext& aGc ) const;
+        
+        /**
+        * Draw Call2 bitmaps
+        */
+        void DrawCall2Bitmaps( CBitmapContext& aGc ) const;
+
+    protected:  // Data
+
+        // Current header
+        CBubbleHeader* iHeader;
+        // Line number where the label is set
+        TUint8 iTextLineNumber;
+        
+        // Bubble image
+        CEikImage* iBubble;
+        
+        // Big call indication / customized
+        CTelBubbleCustomElement* iBigCallIndicator;
+        // Small call indication
+        CTelBubbleCustomElement* iSmallCallIndication;
+        // Number type
+        CTelBubbleCustomElement* iNumberType;
+        // Call type indicator #1
+        CEikImage* iTypeIndication1;
+        // Call type indicator #2
+        CEikImage* iTypeIndication2;
+        // Cyphering off
+        CEikImage* iCyphOffImage;
+
+        // tn shadow
+        TBubbleLayoutRect iTnImageShadow;
+        
+        // Thumbnail image
+        CEikImage* iTnImage;
+
+        // 1st line label
+        mutable CEikLabel* iTextLine1; // Text will be clipped and placed in 
+        // 2nd line text
+        mutable CEikLabel* iTextLine2; // Draw() const method.
+        // Original buffer
+        TPtrC iFullText1; 
+        // Original buffer
+        TPtrC iFullText2;
+        // Clip dir
+        CBubbleManager::TPhoneClippingDirection iText1ClipDirection;
+        // Clip dir
+        CBubbleManager::TPhoneClippingDirection iText2ClipDirection;
+        
+        // Timer cost
+        CEikLabel* iTimerCost;
+        // Brand image.
+        CTelBubbleCustomElement* iBrandImage;
+    };
+
+#endif      // CBUBBLEOUTLOOKTWOLINED_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlookVideo.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Bubble outlook video ringtone.
+*
+*/
+
+
+#ifndef C_BUBBLEOUTLOOKVIDEO_H
+#define C_BUBBLEOUTLOOKVIDEO_H
+
+#include    "BMBubbleOutlookTwoLined.h"
+
+/**
+ *  Bubble outlook video ringtone.
+ *
+ *  @lib BubbleManager
+ *  @since S60 v3.2
+ */
+ class CBubbleOutlookVideo : public CBubbleOutlookTwoLined
+    {
+    public: // Constructors and destructor       
+        /**
+        * Default constructor.
+        * @param aBubbleManager The main container.
+        */
+        CBubbleOutlookVideo( CBubbleManager& aBubbleManager );
+
+        /**
+        * Symbian OS 2nd phase constructor.
+        */
+        void ConstructL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlookVideo();
+        
+    public: // Functions from base classes
+          
+        /**
+        * From CBubbleOutlook
+        */
+        virtual void ReadBubbleHeader( CBubbleHeader& aHeader );
+        
+        /**
+        * From CBubbleOutlook
+        */
+        virtual void DrawBitmaps( CBitmapContext& aGc ) const;
+        
+    private: // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        void SizeChanged();
+
+        /**
+        * From CCoeControl
+        */
+        void PositionChanged();
+
+    private:
+        void LayoutVideoPanes( const TRect& aParentRect );        
+        
+    private:
+        TRect iLineRect;
+    };
+ 
+#endif // C_BUBBLEOUTLOOKVIDEO_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleOutlookVideoCnap.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Bubble outlook video ringtone.
+*
+*/
+
+
+#ifndef C_BUBBLEOUTLOOKVIDEOCNAP_H
+#define C_BUBBLEOUTLOOKVIDEOCNAP_H
+
+// INCLUDES
+#include    "BMBubbleOutlookThreeLined.h"
+
+// CLASS DECLARATION
+
+/**
+*  CBubbleOutlookVideo container class
+*
+*  Class draws the video ringtone bubble.
+*
+*  @lib bubblemanager
+*  @since 3.2
+*/
+class CBubbleOutlookVideoCnap : public CBubbleOutlookThreeLined
+    {
+    public: // Constructors and destructor       
+        /**
+        * Default constructor.
+        * @param aBubbleManager The main container.
+        */
+        CBubbleOutlookVideoCnap( CBubbleManager& aBubbleManager );
+
+        /**
+        * Symbian OS 2nd phase constructor.
+        */
+        void ConstructL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleOutlookVideoCnap();
+        
+    public: // Functions from base classes
+          
+        /**
+        * From CBubbleOutlook
+        */
+        virtual void ReadBubbleHeader( CBubbleHeader& aHeader );
+        
+        /**
+        * From CBubbleOutlook
+        */
+        void DrawBitmaps( CBitmapContext& aGc ) const;
+        
+    private: // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        void SizeChanged();
+
+        /**
+        * From CCoeControl
+        */
+        void PositionChanged();
+        
+    private:
+        void LayoutVideoPanes( const TRect& aParentRect );        
+
+    private:
+        TRect iLineRect;
+    };
+
+#endif // C_BUBBLEOUTLOOKVIDEOCNAP_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubblePlace.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,157 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Handles single place on screen.
+*     One place may contain several popup windows from LAF
+*
+*/
+ 
+
+#ifndef BUBBLEPLACE_H
+#define BUBBLEPLACE_H
+
+// INCLUDES  
+#include <coecntrl.h>
+#include <bldvariant.hrh>
+
+// FORWARD DECLARATIONS
+class CBubbleManager;
+class CBubbleImageManager;
+class CBubbleOutlook;
+
+
+// CLASS DECLARATION
+
+/**
+*  CBubblePlace container class
+*
+*  Handles single place on screen.
+*
+*  @lib bubblemanager
+*  @since 1.0
+*/
+class CBubblePlace : public CCoeControl 
+    {
+    public:
+        
+        // Place enums
+        enum TPhoneBubblePlace
+            {
+            EBottom = 0,
+            EBottomRightActive, 
+            EBottomRightHeld,
+            EMiddleActive,
+            EMiddleHeld,
+            ETopLeft,
+            ETopRight,
+            EHide,
+            E2InConf,
+            E3InConf,
+            E4InConf,
+            E5InConf,
+            EBottomText, // Call object text
+            EBottomImage, // Call object image
+            EVideo,
+            EBottomCnap,
+            EMiddleCnap,
+            EVideoCnap,
+            EBottomRightCnap,
+            EBottomImageCnap, // 19
+            EBottomRightActiveTouch,
+            EBottomRightActiveCnapTouch,
+            EMiddleHeldTouch // 22
+            };
+        
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS 2nd phase constructor.
+        * @param aBubblePlace Current place
+        * @param aBubbleManager Main container
+        */
+        void ConstructL( const TPhoneBubblePlace& aBubblePlace,
+                          CBubbleManager& aBubbleManager );
+        
+        /**
+        * Destructor.
+        */
+        ~CBubblePlace();
+        
+    public: //member functions
+        
+        /**
+        * Set current place in use.
+        * @param aIsUsed ETrue if set in use.
+        */
+        void SetIsUsed( const TBool& aIsUsed );
+        
+        /**
+        * Query is used?
+        * @return is used.
+        */
+        TBool IsUsed( ) const;
+        
+        /**
+        * Get current place.
+        * @return The place enumeration.
+        */
+        TPhoneBubblePlace GetBubblePlace( ) const;
+        
+        /**
+        * Get current outlook component. Abstraction!
+        * @return BubbleOutlook, not always in use!
+        */
+        CBubbleOutlook& GetBubbleOutlook( ) const;
+        
+    private: // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        void SizeChanged();
+
+        /**
+        * From CCoeControl
+        */
+        void PositionChanged();
+
+        /**
+        * From CCoeControl
+        */
+        TInt CountComponentControls() const;
+        
+        /**
+        * From CCoeControl
+        */
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+        
+        
+    private: //data
+        
+        // Current place
+        TPhoneBubblePlace iBubblePlace;
+        // Current outlook
+        CBubbleOutlook* iBubbleOutlook;
+        // Is place in use?
+        TBool iIsUsed;
+
+    private:
+
+        friend class CT_CBubblePlace;
+        
+    };
+
+#endif // BUBBLEPLACE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleSkinBitmap.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,126 @@
+/*
+* 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 class handles skinned bitmaps
+*
+*/
+
+
+
+#ifndef BUBBLESKINBITMAP_H
+#define BUBBLESKINBITMAP_H
+
+// INCLUDES
+#include    <e32base.h>
+#include    <AknsItemID.h>
+#include    <AknsConstants.h>
+
+// FORWARD DECLARATIONS
+class CEikImage;   
+class CFbsBitmap;
+
+
+// CLASS DECLARATION
+
+/**
+*  CBubbleSkinBitmap class
+*  This class stores bitmap information.
+*
+*  @since Series60_2.8
+*/
+class CBubbleSkinBitmap : public CBase
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Constructor.
+        */
+        CBubbleSkinBitmap();
+
+        /**
+        * Destructor.
+        */
+        ~CBubbleSkinBitmap();
+
+    public: // New functions
+
+        /**
+        * Set skinned bitmap.
+        * @param aSkinnedBitmap Pointer to the skinned bitmap.
+        * @return None.
+        */
+        void SetSkinnedBitmap( CFbsBitmap* aSkinnedBitmap );
+
+        /**
+        * Get skinned bitmap.
+        * @return the pointer to the skinned bitmap.
+        */
+        CFbsBitmap* SkinnedBitmap() const;
+        
+        /**
+        * Set skinned bitmap mask.
+        * @param aSkinnedBitmapMask Pointer to the skinned bitmap mask.
+        * @return None.
+        */
+        void SetSkinnedMask( CFbsBitmap* aSkinnedMask );
+
+        /**
+        * Get skinned bitmap mask.
+        * @return the pointer to the skinned bitmap mask.
+        */
+        CFbsBitmap* SkinnedMask() const;
+
+        /**
+        * Set bitmap skin item ID.
+        * @param aItemID Bitmap skin item ID.
+        * @return None.
+        */
+        // void SetBitmapSkinItemID( const TAknsItemID& aItemID );
+
+        /**
+        * Get bitmap skin item ID.
+        * @return bitmap skin item ID.
+        */
+        // TAknsItemID BitmapSkinItemID() const;
+
+        /**
+        * Set bitmap index in the mbm file.
+        * @param aBitmapIndex Bitmap index.
+        * @return None.
+        */
+        void SetBitmapIndex( const TInt& aBitmapIndex );
+
+        /**
+        * Get bitmap index in the mbm file.        
+        * @return bitmap index.
+        */
+        TInt BitmapIndex() const;
+
+    private: // Data     
+
+        // Reference bitmap skin item ID.
+        // TAknsItemID iItemId;
+
+        // Reference bitmap index in mbm file.
+        TInt iBitmapIndex;
+
+        // Pointer to the skinned bitmap.
+        CFbsBitmap* iSkinnedBitmap;
+
+        // Pointer to the skinned bitmap mask.
+        CFbsBitmap* iSkinnedMask;               
+    };
+
+#endif // BUBBLESKINBITMAP_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMBubbleVideoContainer.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,129 @@
+/*
+* 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:  Video Ringing Tone / Video window (DSA)
+*
+*/
+
+
+
+#ifndef CBUBBLEVIDEOCONTAINER_H
+#define CBUBBLEVIDEOCONTAINER_H
+
+//  INCLUDES
+#include <coecntrl.h>
+#include <AknsDrawUtils.h>
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Video Ringing Tone / Video window (DSA)
+*
+*  @lib BubbleManager
+*  @since Series 60 3.1
+*/
+class CBubbleVideoContainer : public CCoeControl
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CBubbleVideoContainer* NewL( const CCoeControl* aParent );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleVideoContainer();
+
+    public: // New functions
+        
+        /**
+        * Get window handle.
+        * @since Series 60 3.1
+        * @return Window handle
+        */
+        RWindow& GetWindow() const;
+        
+        /**
+        * Set parameters needed to draw this control.
+        * @since Series 60 3.1
+        * @param aFrameId Skin id of the frame.
+        * @param aOuterRect Outer frame rectangle.
+        * @param aInnerRect Inner frame rectangle.
+        */
+        void SetBackgroundFrame( const TAknsItemID& aFrameId,
+                                 TRect& aOuterRect,
+                                 TRect& aInnerRect );
+                                 
+        /**
+        * Sets redraw disabled/enabled.
+        * Video player draws this area, when video is playing.
+        * @since Series 60 3.2
+        * @param aDisabled ETrue if redrawing is set disabled.
+        */
+        void SetRedrawDisabled( TBool aDisabled );
+
+    private: // From CCoeControl
+        /**
+        * Draw
+        */
+        void Draw( const TRect& aRect ) const;
+       
+        /**
+        * SizeChanged
+        */
+        void SizeChanged();
+        
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CBubbleVideoContainer();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+        
+        /**
+        * C++ constructor
+        */
+        CBubbleVideoContainer(  const CCoeControl* aParent );
+
+    private:    // Data
+        // Parent control
+        const CCoeControl* iParent;
+        // Background frame parameters.
+        TAknsItemID iFrameId;
+        TRect iFrameOuterRect;
+        TRect iFrameInnerRect; 
+        // Redrawing flag
+        TBool iRedrawDisabled;
+    };
+
+#endif      // CBUBBLEVIDEOCONTAINER_H   
+            
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMCallHeader.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,100 @@
+/*
+* 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 class which helds all the info about single call
+*
+*/
+
+
+#ifndef CALLHEADER_H
+#define CALLHEADER_H
+
+// INCLUDES
+#include  "BMBubbleHeader.h"
+
+// CLASS DECLARATION
+
+/**
+*  CBubbleCallHeader class
+*
+*  Concrete class which helds all the info about single call.
+*
+*  @lib bubblemanager
+*  @since 1.0
+*/
+
+class CBubbleCallHeader : public CBubbleHeader
+    {
+    
+    public: // Constructors and destructor
+        
+        /**
+        * two phase constructor
+        * @param aBubbleId Id of the call header.
+        * @return New instance.
+        */
+        static CBubbleCallHeader* NewL( 
+            const CBubbleManager::TBubbleId& aBubbleId );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleCallHeader();
+        
+    public: // Functions from base classes
+
+        /**
+        * From CBubbleHeader.
+        */
+        virtual TBool IsUsed() const;
+
+        /**
+        * From CBubbleHeader
+        */
+        virtual void SetIsUsed( const TBool& aIsUsed );
+
+        /**
+        * From CBubbleHeader
+        */
+        virtual TBool IsConference() const;
+
+        /**
+        * From CBubbleHeader
+        */
+        virtual void Reset();
+        
+    private: // private functions
+
+        /**
+        * Default constructor.
+        */
+        CBubbleCallHeader();
+
+        /**
+        * Symbian OS 2nd phase constructor.
+        */
+        void ConstructL( const CBubbleManager::TBubbleId& aBubbleId );
+        
+    private: //data
+        // Is header in use?
+        TBool iIsUsed;
+
+    private:
+        friend class CT_CBubbleCallHeader;
+               
+    };
+
+#endif //CALLHEADER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMCallObjectManager.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,212 @@
+/*
+* 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:  Controls call object loading.
+*
+*/
+
+
+
+#ifndef CBUBBLECALLOBJECTMANAGER_H
+#define CBUBBLECALLOBJECTMANAGER_H
+
+//  INCLUDES
+#include <gdi.h>
+#include <gulicon.h>
+#include <avkon.hrh>
+
+#include "BMBubbleManager.h"
+#include "BMMediaReaderObserver.h"
+
+// CONSTANTS
+
+// DATA TYPES
+
+// FORWARD DECLARATIONS
+class CIdle;
+class MBubbleMediaReader;
+class CImageManager;
+
+// CLASS DECLARATION
+
+/**
+*  Controls call object loading.
+*
+*  @lib BubbleManager.lib
+*  @since Series 60 3.0
+*/
+class CBubbleCallObjectManager : public CBase,
+                                 public MBubbleMediaReaderObserver
+    {
+    public:
+        class TImageLoadingParams
+            {
+            public:
+                // Source fills the main pane.
+                TSize iPreferredSize;
+                // Source image is smaller than main pane.
+                TSize iTinyImageSize;
+                // Size used in incall bubble clips.
+                TSize iThumbnailSize;
+                // Display mode
+                TDisplayMode iDisplayMode;
+            };
+
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor. 
+        * @param aBubbleManager Bubble manager reference.
+        * @return New instance
+        */
+        static CBubbleCallObjectManager* NewL( 
+            CBubbleManager& aBubbleManager );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleCallObjectManager();
+
+    public: // New functions
+
+        // Call object loading
+
+        /**
+        * Start loading image from given file. 
+        * @param aBubbleId Bubble id which image belongs.
+        * @param aFileName Image file name.
+        * @param aParams Image loading parameters.
+        */            
+        void LoadImageFromFile(
+            const CBubbleManager::TBubbleId& aBubbleId,
+            const TDesC& aFileName,
+            const TImageLoadingParams& aParams );
+            
+        /**
+        * Start loading image from given text. 
+        * @param aBubbleId Bubble id which image belongs.
+        * @param aText Text for image generation.
+        * @param aParams Image loading parameters.
+        */            
+        void LoadImageFromText(
+            const CBubbleManager::TBubbleId& aBubbleId,
+            const TDesC& aText,
+            const TImageLoadingParams& aParams );            
+            
+        /**
+        * Cancel call object loading.
+        * @param aBubbleId Bubble id.
+        */
+        void CancelCallObjectLoading( 
+                    const CBubbleManager::TBubbleId& aBubbleId );
+                    
+        /**
+        * Sets image loading to suspended state. Loading can
+        * be continued by calling Resume().
+        */
+        void Suspend();
+        
+        /**
+        * Resumes image loading that has been set to suspended
+        * state by calling Suspend(). 
+        */
+        TInt Resume();
+        
+        /**
+        * Load call theme image. 
+        * @param aImageManager Image manager.
+        * @param aSize Image size.
+        */            
+        void LoadCallThemeImage(
+            CBubbleImageManager& aImageManager,    
+            const TSize& aSize );
+        
+        /**
+        * Release call theme image. 
+        */
+        void ReleaseCallThemeImage();
+        
+        /**
+        * Resizes call theme image.  
+        * @param aSize New image size.
+        */
+        void ResizeCallThemeImage( const TSize& aSize );
+                
+        /**
+        * Returns call theme icon.
+        * @return Call theme image icon. 
+        */
+        CGulIcon* CallThemeImageIcon();
+        
+    private: // Constructors
+        
+        /**
+        * C++ default constructor.
+        */
+        CBubbleCallObjectManager( CBubbleManager& aBubbleManager );
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL( );
+        
+    private: // From MBubbleMediaReaderObserver        
+        void FrameBufferDataChanged();
+        void ReaderError( TInt aError );                            
+        
+    private:
+        void Reset();
+        void ReadFromFileL( const TDesC& aFileName,
+                            const TSize& aPreferredImageSize,
+                            const TSize& aTinyImageSize ); 
+        static TInt IdleProcessorCallback( TAny* aThis );
+        void DoLoadImageInIdleL();
+        void DoDeleteReaderInIdle();        
+        void DoHandleFrameBufferDataL();
+        void DoResumeL();
+        TBool LoadThumbnailVersion();
+        void AllocateCallThemeImageIconL( CBubbleImageManager& aImageManager );
+        void DoInitializeIcons();
+    
+    private: // Private type definition               
+        enum TLoadingState
+            {
+            EBMLoaderReady,
+            EBMLoadingImage,
+            EBMLoadingThumbnail,
+            EBMLoadingText,
+            EBMAnimating,
+            EBMDeleting,
+            EBMSuspended,
+            EBMInitializingIcon
+            };
+
+    private: // Data
+        // Bubble manager reference
+        CBubbleManager& iBubbleManager;
+        
+        // Loading state
+        TLoadingState iLoadingState;
+        TInt iBubbleId;
+        TImageLoadingParams iImageLoadParams;
+        MBubbleMediaReader* iMediaReader; // Owned
+        CIdle* iIdleProcessor; // Owned
+        HBufC* iCallText; // Owned
+        HBufC* iCallImage; // Owned
+        CGulIcon* iCallThemeImageIcon; // Owned
+        TSize     iCallThemeImageSize;
+    };
+
+#endif // CBUBBLECALLOBJECTMANAGER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMCallObjectUtils.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,169 @@
+/*
+* 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:  Utility methods for call object handling.
+*
+*/
+
+
+
+#ifndef BUBBLECALLOBJECTTUTILS_H
+#define BUBBLECALLOBJECTTUTILS_H
+
+//  INCLUDES
+#include <gdi.h>
+#include "BMBubbleManager.h"
+#include <avkon.hrh>
+
+// CONSTANTS
+
+// DATA TYPES
+
+// FORWARD DECLARATIONS
+class CBubbleCallObjectImage;
+class CBubbleImageReader;
+
+// CLASS DECLARATION
+
+/**
+*  Utility methods for call object handling.
+*
+*  @lib BubbleManager
+*  @since Series 60 3.1
+*/
+class BubbleCallObjectUtils
+    {
+    public:
+        // Tiling mode
+        enum TTileMode
+            {
+            ETileTopLeft,    // Tiling begin from top left corner
+            ETileTopRight,   // Tiling begin from top right corner
+            ETileCenterLeft, // Tiling begin from left, vertically centered
+            ETileCenterRight // Tiling begin from right, vertically centered   
+            };
+            
+        // Scale mode. Aspect ratio is always preserved.
+        enum TScaleMode
+            {
+            EFillTarget,
+            EMaximumFit    
+            };
+    
+    public: // New functions
+        ///////////////////////////////////////////////////////////////////////
+        //
+        // Construction and manipulation of CFbsBitmap objects.
+        //
+        ///////////////////////////////////////////////////////////////////////
+        
+        /**
+        * Creates a new bitmap from the given bitmap by scaling it to the
+        * given size. Proportions of the source bitmap are maintained so
+        * cropping may be applied. If the given bitmap is very small it
+        * is duplicated, not scaled, to fill the created bitmap.
+        * @param aBitmap Source bitmap
+        * @param aTargetSize Size of bitmap to be created.
+        * @param aDisplayMode Display mode for bitmap created.
+        * @param aTileMode Tiling mode.
+        * @return New bitmap instance.
+        */
+        static CFbsBitmap* CreateBitmapL( 
+            const CFbsBitmap* aBitmap, 
+            const TSize& aTargetSize,
+            TDisplayMode aDisplayMode,
+            TTileMode aTileMode = ETileTopLeft );
+            
+        /**
+        * Creates a new bitmap by cropping given bitmap to given size.
+        * @param aBitmap Bitmap to be cropped.
+        * @param aTargetSize Target size.
+        * @param aDisplayMode Display mode for bitmap created.
+        * @return New bitmap instance.
+        */
+        static CFbsBitmap* CreateCroppedBitmapL( 
+            const CFbsBitmap* aBitmap, 
+            const TSize& aTargetSize,
+            TDisplayMode aDisplayMode );
+
+        /**
+        * Creates a new bitmap by tiling given bitmap to given size.
+        * @param aBitmap Bitmap to be tiled.
+        * @param aTargetSize Target size.
+        * @param aDisplayMode Display mode for bitmap created.
+        * @param aTileMode Tiling mode.
+        * @return New bitmap instance.
+        */            
+        static CFbsBitmap* CreateTiledBitmapL( 
+            const CFbsBitmap* aBitmap, 
+            const TSize& aTargetSize,
+            TDisplayMode aDisplayMode,
+            TTileMode aTileMode );
+
+        /**
+        * Creates a new bitmap and renders given text given on it.
+        * Text is rendered according to call2_cli_visual_text_pane
+        * layout. Creates also mask bitmap. 
+        * @param aText Text to be rendered.
+        * @param aMainPaneRect Main pane rectangle.
+        * @param aSize Size for created bitmap.
+        * @param aTextColor Text color.
+        * @param aAlpha Transparency of text: 0-255.
+        * @param aDisplayMode Display mode for bitmap created.
+        * @param aBitmap Created bitmap on return.
+        * @param aMask Created mask on return.
+        */            
+        static void CreateImageBitmapsFromTextLC( 
+            const TDesC& aText, 
+            const TRect& aMainPaneRect,
+            const TSize& aSize,
+            const TRgb&  aTextColor,
+            TUint aAlpha,
+            TDisplayMode aDisplayMode,
+            CFbsBitmap*& aBitmap,
+            CFbsBitmap*& aMask );            
+            
+        /**
+        * Calculates scaling factor for source size to fill target size. 
+        * @param aSourceSize Source size.
+        * @param aTargetSize Target size.
+        * @param aScaleMode Scaling mode.
+        * @return Scaling factor.
+        */    
+        static TReal ScalingFactor( 
+            const TSize& aSourceSize,
+            const TSize& aTargetSize,
+            TScaleMode aScaleMode );
+            
+        /**
+        * Calculates scale factor and clipping rectangle based on
+        * source and target size. Clip rect is relative to source.
+        * @param aSourceSize Source size.
+        * @param aTargetSize Target size.
+        * @param aScaleMode Scaling mode.
+        * @param aScaleFactor Target size.
+        * @param aClipRect Target size.
+        * @return ETrue if source is tiny image i.e. not possible
+        *         to scale it to fill target. 
+        */    
+        static TBool GetScaleFactorAndClipRect( 
+            const TSize& aSourceSize,
+            const TSize& aTargetSize,
+            TScaleMode aScaleMode,
+            TReal& aScaleFactor,
+            TRect& aClipRect );
+    };
+
+#endif // BUBBLECALLOBJECTTUTILS_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMCallStatusAnim.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,78 @@
+/*
+* 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:  Call status animation
+*
+*/
+
+
+#ifndef C_BUBBLECALLSTATUSANIM_H
+#define C_BUBBLECALLSTATUSANIM_H
+
+#include "BMBubbleManager.h"
+#include "telbubbleanim.h"
+
+/**
+ *  Call status animation.
+ *
+ *
+ *  @lib BubbleManager.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CBubbleCallStatusAnim ) : public CTelBubbleAnim
+    {
+protected:
+    /**
+    * C`tor.
+    */
+    CBubbleCallStatusAnim( CBubbleImageManager& aImageManager );
+    
+    /**
+    * 2nd C`tor.
+    */
+    void ConstructL();
+
+public:
+    /**
+     * Read bubble header.
+     *
+     * @since S60 5.0
+     * @param aHeader Bubble header.
+     */
+    void ReadBubbleHeader( const CBubbleHeader& aHeader );
+
+    /**
+     * Set container window.
+     *
+     * @since S60 5.0
+     * @param aCallFlags Call flags.
+     */
+    void SetContainerWindowL( const CCoeControl& aControl );
+    
+private:
+    void MakeVisible(TBool aVisible);
+    
+private: // From CTelBubbleAnim
+    /**
+     * Includes animation logic when it is shown
+     */
+    virtual void SetAnimationContentL() = 0;
+
+protected: // data
+    CBubbleImageManager& iImageManager;
+    TUint32 iCallFlags;
+    };
+
+#endif // C_BUBBLECALLSTATUSANIM_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMCallStatusAnimBig.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Big call status animation
+*
+*/
+
+
+#ifndef C_BUBBLECALLSTATUSANIMBIG_H
+#define C_BUBBLECALLSTATUSANIMBIG_H
+
+#include "BMCallStatusAnim.h"
+#include "BMBubbleManager.h"
+#include "telbubbleanim.h"
+
+/**
+ *  Call status animation.
+ *
+ *
+ *  @lib BubbleManager.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CBubbleCallStatusAnimBig ) : public CBubbleCallStatusAnim
+    {
+public:
+    /**
+     * Two-phased constructor.
+     * @param aBubbleManager Bubble manager.
+     */
+    static CBubbleCallStatusAnimBig* NewL( CBubbleImageManager& aImageManager );
+    
+    /**
+    * Destructor.
+    */
+    virtual ~CBubbleCallStatusAnimBig();
+
+private:    
+    CBubbleCallStatusAnimBig( CBubbleImageManager& aImageManager );
+    
+private: // From CTelBubbleAnim
+    /**
+     * Includes animation logic when it is shown
+     */
+    void SetAnimationContentL();
+
+    };
+
+#endif // C_BUBBLECALLSTATUSANIMBIG_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMCallStatusAnimSmall.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Small call status animation
+*
+*/
+
+
+#ifndef C_BUBBLECALLSTATUSANIMSMALL_H
+#define C_BUBBLECALLSTATUSANIMSMALL_H
+
+#include "BMCallStatusAnim.h"
+#include "BMBubbleManager.h"
+#include "telbubbleanim.h"
+
+/**
+ *  Call status animation.
+ *
+ *
+ *  @lib BubbleManager.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CBubbleCallStatusAnimSmall ) : public CBubbleCallStatusAnim
+    {
+public:
+    /**
+     * Two-phased constructor.
+     * @param aBubbleManager Bubble manager.
+     */
+    static CBubbleCallStatusAnimSmall* NewL( CBubbleImageManager& aImageManager );
+    
+    /**
+    * Destructor.
+    */
+    virtual ~CBubbleCallStatusAnimSmall();
+ 
+private:    
+    CBubbleCallStatusAnimSmall( CBubbleImageManager& aImageManager );
+
+private: // From CTelBubbleAnim
+    /**
+     * Includes animation logic when it is shown
+     */
+    void SetAnimationContentL();
+
+    };
+
+#endif // C_BUBBLECALLSTATUSANIMSMALL_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMCallStatusIndi.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Call status indicator
+*
+*/
+
+
+#ifndef C_BUBBLECALLSTATUSINDI_H
+#define C_BUBBLECALLSTATUSINDI_H
+
+#include "BMBubbleManager.h"
+#include "telbubbleimage.h"
+
+/**
+ *  Call indicator
+ *
+ *
+ *  @lib BubbleManager.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CBubbleCallStatusIndi ) : public CTelBubbleImage
+    {
+public:
+    /**
+     * Read bubble header.
+     *
+     * @since S60 5.0
+     * @param aHeader Bubble header.
+     */
+    void ReadBubbleHeader( const CBubbleHeader& aHeader );
+    
+protected:
+    /**
+     * C´tor
+     */
+    CBubbleCallStatusIndi( CBubbleImageManager& aImageManager );
+    
+private: // From CCoeControl
+    virtual void MakeVisible( TBool aVisible );
+    
+    /**
+     * Includes logic for CallStatusIndicator image 
+     * when image is shown
+     */
+    virtual void SetImageAndMask() = 0;
+protected: // data
+    CBubbleImageManager& iImageManager;
+    CBubbleManager::TPhoneCallState iCallState;
+    TUint32 iCallFlags;
+    };
+
+#endif // C_BUBBLECALLSTATUSINDI_H
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMCallStatusIndiBig.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Big call status indicator
+*
+*/
+
+
+#ifndef C_BUBBLECALLSTATUSINDIBIG_H
+#define C_BUBBLECALLSTATUSINDIBIG_H
+
+#include "BMCallStatusIndi.h"
+#include "BMBubbleManager.h"
+#include "telbubbleimage.h"
+
+/**
+ *  Call indicator
+ *
+ *
+ *  @lib BubbleManager.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CBubbleCallStatusIndiBig ) : public CBubbleCallStatusIndi
+    {
+public:
+    /**
+     * Two-phased constructor.
+     * @param aBubbleManager Bubble manager.
+     */
+    static CBubbleCallStatusIndiBig* NewL( CBubbleImageManager& aImageManager );
+    
+    /**
+    * Destructor.
+    */
+    virtual ~CBubbleCallStatusIndiBig();
+    
+private:    
+    CBubbleCallStatusIndiBig( CBubbleImageManager& aImageManager );
+    
+private: // From CBubbleCallStatusIndi
+    /**
+     * Includes logic for CallStatusIndicator image 
+     * when image is shown
+     */
+    void SetImageAndMask();
+
+    };
+
+#endif // C_BUBBLECALLSTATUSINDIBIG_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMCallStatusIndiSmall.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Small call status indicator
+*
+*/
+
+#ifndef C_BUBBLECALLSTATUSINDISMALL_H
+#define C_BUBBLECALLSTATUSINDISMALL_H
+
+#include "BMCallStatusIndi.h"
+#include "BMBubbleManager.h"
+#include "telbubbleimage.h"
+
+/**
+ *  Call indicator
+ *
+ *
+ *  @lib BubbleManager.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CBubbleCallStatusIndiSmall ) : public CBubbleCallStatusIndi
+    {
+public:
+    /**
+     * Two-phased constructor.
+     * @param aBubbleManager Bubble manager.
+     */
+    static CBubbleCallStatusIndiSmall* NewL( CBubbleImageManager& aImageManager );
+    
+    /**
+    * Destructor.
+    */
+    virtual ~CBubbleCallStatusIndiSmall();
+
+    
+private:    
+    CBubbleCallStatusIndiSmall( CBubbleImageManager& aImageManager );
+    
+private: // From CBubbleCallStatusIndi
+    /**
+     * Includes logic for CallStatusIndicator image 
+     * when image is shown
+     */
+    void SetImageAndMask();
+    };
+
+#endif // C_BUBBLECALLSTATUSINDISMALL_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMConfHeader.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,181 @@
+/*
+* 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 class which holds info about conference call
+*
+*/
+
+
+#ifndef CONFHEADER_H
+#define CONFHEADER_H
+
+// INCLUDES
+#include  "BMBubbleHeader.h"
+
+// FORWARD DECLARATIONS
+class CBubbleCallHeader;
+
+// CLASS DECLARATION
+
+/**
+*  CBubbleConfHeader class
+*
+*  Concrete class which holds info about conference call
+*
+*  @lib bubblemanager
+*  @since 1.0
+*/
+
+class CBubbleConfHeader : public CBubbleHeader
+    {    
+    public: // Constructors and destructor
+        
+        /**
+        * two phase constructor
+        * @param aBubbleId Id of the call header
+        * @return New instance
+        */
+        static CBubbleConfHeader* NewL( 
+            const CBubbleManager::TBubbleId& aBubbleId);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleConfHeader();
+        
+    public: // Member functions
+              
+        /**
+        * Add call to conference call.
+        * @param aCall Added call.
+        */
+        void AddRow( CBubbleCallHeader& aCall );
+
+        /**
+        * Remove call from conferece.
+        * @param aCallId Bubble id of removed call.
+        */
+        void RemoveRow( const CBubbleManager::TBubbleId& aCallId );
+
+        /**
+        * Get headers in conference call.
+        * @param aCalls Reference where item are put to.
+        */
+        void GetRows( CArrayPtrFlat<CBubbleCallHeader>& aCalls ) const;
+
+        /**
+        * Get amount of calls in conference call.
+        * @return Amount of calls in conf.
+        */
+        TUint8 RowCount() const;
+
+        /**
+        * Set highlight row.
+        * @param aRow The row number 1-n. KBubbleNoHighlightRow no highlight.
+        */
+        void SetHighlight( const CBubbleManager::TRowNumber& aRow );
+
+        /**
+        * Set highlight header.
+        * @param aBubbleId Id of highlighted item.
+        */
+        void SetHighlightId( const CBubbleManager::TBubbleId& aBubbleId );
+
+        /**
+        * Get bubble id of highlighted item.
+        * @return Id of highlighted item. KBubbleInvalidId if no highlight.
+        */
+        CBubbleManager::TBubbleId HighlightId() const;
+
+        /**
+        * Move highlight one item upwards. If already at upmost, no change.
+        */
+        void MoveHighlightOneUp();
+
+        /**
+        * Move highlight one item downwards. If already at lowest, no change.
+        */
+        void MoveHighlightOneDown();
+
+        /**
+        * Get the highlight row number.
+        * @return The row number 1-n. KBubbleNoHighlightRow no highlight.
+        */
+        CBubbleManager::TRowNumber Highlight() const;
+
+        /**
+        * Set conference call expanded.
+        * @param aIsExpanded ETrue expands the conf call.
+        */
+        void SetIsExpanded( TBool aIsExpanded );
+
+        /**
+        * Is conference expanded.
+        * @return ETrue if expanded.
+        */
+        TBool IsExpanded( ) const;
+
+    public: // Functions form base classes
+
+        /**
+        * From CBubbleHeader.
+        */
+        virtual void Reset();
+
+        /**
+        * From CBubbleHeader.
+        */
+        virtual void SetIsUsed( const TBool& aIsUsed );
+
+        /**
+        * From CBubbleHeader.
+        */
+        virtual TBool IsUsed() const;
+
+        /**
+        * From CBubbleHeader. 
+        */
+        virtual TBool IsConference() const;
+        
+    protected:
+
+        /**
+        * Default constructor.
+        */
+        CBubbleConfHeader();
+        
+    private: // private functions
+
+        /**
+        * 2nd phase constructor.
+        */
+        void ConstructL( const CBubbleManager::TBubbleId& aBubbleId );
+        
+    private: //data
+        // Is header used?
+        TBool iIsUsed;
+        // Is conference expanded?
+        TBool iIsExpanded;
+        //1-5 , KBubbleNoHighlightRow no highlight
+        CBubbleManager::TRowNumber iSelection;
+        // Current calls in conference call
+        CArrayPtrFlat<CBubbleCallHeader>* iCalls;
+
+    private:
+        friend class CT_CBubbleConfHeader;
+    };
+
+#endif //CONFHEADER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMConfPane.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,161 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Container class for single line in expanded conference call
+*
+*/
+
+
+#ifndef CONFPANE_H
+#define CONFPANE_H
+
+// INCLUDES
+#include    <calslbs.h>
+#include    "BMBubbleManager.h"
+
+// FORWARD DECLARATIONS
+class CEikLabel;     
+class CEikImage;
+
+// CLASS DECLARATION
+
+/**
+*  CConfPane container class
+*
+*  Object represents single line in conference call.
+*
+*  @lib bubblemanager
+*  @since 1.0
+*/
+class CBubbleConfPane : public CCoeControl
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS 2nd phase constructor.
+        */
+        void ConstructL( TBool aTouchCallHandling );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleConfPane();
+
+    public: //member functions
+        
+        /**
+        * Sets data members to initial state.
+        */
+        void Reset( );
+          
+        /**
+        * Sets is pane highlighted.
+        * @param aIsHighlighted ETrue means highlight is on.
+        */
+        void SetHighlight( const TBool& aIsHighlighted );
+        
+        /**
+        * Returns pointer to Call indication image. Use to set the bitmap 
+        * to it.
+        * @return The image.
+        */
+        CEikImage*& CallIndicationHandle( );
+        
+        /**
+        * Set CLI
+        * @param aText The text
+        * @param aDir Clipping direction
+        */
+        void SetText( TPtrC aText , 
+                      const CBubbleManager::TPhoneClippingDirection& aDir );
+        
+    private: // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        void SizeChanged();
+
+        /**
+        * From CCoeControl
+        */
+        void PositionChanged();
+
+        /**
+        * From CCoeControl
+        */
+        TInt CountComponentControls() const;
+        
+        /**
+        * From CCoeControl 
+        */
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+        
+        /**
+        * From CCoeControl 
+        */
+        void Draw( const TRect& aRect ) const;
+        
+    private:
+    
+        /**
+        * DoCall1Layout
+        */
+        void DoCall1Layout();
+
+        /**
+        * DoCall2Layout
+        */            
+        void DoCall2Layout();
+        
+        /**
+        * DoCall4Layout
+        */            
+        void DoCall4Layout();
+      
+    private: //data
+        // Is this pane highlighted
+        TBool iIsHighlighted; 
+        
+        // Phone image.
+        CEikImage* iCallIndication; 
+        // Cyphering off
+        CEikImage* iCyphOffImage;
+        
+        // Text line; full text is clipped to fit
+        mutable CEikLabel* iTextLine; 
+        // Contains full text 
+        TPtrC iFullText; 
+        // Text's clip direction
+        CBubbleManager::TPhoneClippingDirection iTextClipDirection; 
+        
+        // Highlight's Shadow
+        TAknLayoutRect iShadow;
+        // Highlight
+        TAknLayoutRect iHighlight;
+        
+        // Call object setting
+        TBool iCallObjectDisplay;
+        
+        // Feature flag
+        TBool iTouchCallHandling;
+
+    private:
+        friend class CBubbleOutlookConference; // Handles texts
+        friend class CT_CBubbleConfPane;
+    };
+
+#endif // CONFPANE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMCustomManager.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Customization manager
+*
+*/
+
+
+#ifndef C_BUBBLECUSTOMMANAGER_H
+#define C_BUBBLECUSTOMMANAGER_H
+
+#include <e32base.h>
+#include "BMBubbleManager.h"
+#include "telbubblecustomelement.h"
+
+class CBubbleHeader;
+class CBubbleDefaultManager;
+class TArrayItem;
+
+/**
+ *  Customization manager.
+ *
+ *  @lib BubbleManager.lib
+ *  @since S60 5.0
+ */
+NONSHARABLE_CLASS( CBubbleCustomManager ) : public CBase
+    {
+public:
+    /**
+     * Two-phased constructor.
+     * @param aBubbleManager Bubble manager.
+     */
+    static CBubbleCustomManager* NewL( CBubbleManager& aBubbleManager );
+    
+    /**
+    * Destructor.
+    */
+    virtual ~CBubbleCustomManager();
+
+    /**
+     * Adds custom element to call bubble. Ownership is not transferred.
+     *
+     * @since S60 5.0
+     * @param aBubbleId Bubble identifier.
+     * @param aElement Custom element.
+     * @param aPriority Priority 0(high) - 255(low). 
+     */
+    void AddCustomElement( 
+        const CBubbleManager::TBubbleId& aBubbleId,
+        CTelBubbleCustomElement* aElement,
+        TInt aPriority );
+    
+    /**
+     * Removes custom element from call bubble.
+     *
+     * @since S60 5.0
+     * @param aBubbleId Bubble identifier.
+     * @param aElement Custom element.
+     */
+    void RemoveCustomElement(
+        const CBubbleManager::TBubbleId& aBubbleId,
+        CTelBubbleCustomElement* aElement );
+    
+    /**
+     * Removes all custom elements related to given bubble.
+     *
+     * @since S60 5.0
+     * @param aBubbleId Bubble identifier.
+     */
+    void RemoveCustomElements( const CBubbleManager::TBubbleId& aBubbleId );
+    
+    /**
+     * Reserves custom element. Default elements are
+     * shared between call bubbles.
+     *
+     * @since S60 5.0
+     * @param aBubbleId Bubble identifier.
+     * @param aElement Element type.
+     * return Element instance.
+     */
+    CTelBubbleCustomElement* ReserveCustomElement( 
+        const CBubbleHeader& aBubbleHeader,
+        CTelBubbleCustomElement::TElementType aElement );
+    
+    /**
+     * Reserves custom element. Default elements are
+     * shared between call bubbles.
+     *
+     * @since S60 5.0
+     * @param aBubbleId Bubble identifier.
+     * @param aElement Element type.
+     * @param aIsDefault Is ETrue, when default implementation is used.
+     * return Element instance.
+     */
+    CTelBubbleCustomElement* ReserveCustomElement( 
+        const CBubbleHeader& aBubbleHeader,
+        CTelBubbleCustomElement::TElementType aElement,
+        TBool& aIsDefault );
+    
+    /**
+     * Releases custom element.
+     *
+     * @since S60 5.0
+     * @param aElement Released custom element.
+     */
+    void ReleaseCustomElement( CTelBubbleCustomElement*& aCustomElement );
+    
+private:
+    CTelBubbleCustomElement* DefaultElement( 
+        const CBubbleHeader& aBubbleHeader,
+        CTelBubbleCustomElement::TElementType aElement );
+
+private:
+    CBubbleCustomManager( CBubbleManager& aBubbleManager );
+    void ConstructL();
+
+private: // data
+    CBubbleManager&       iBubbleManager;
+
+    TFixedArray< TFixedArray< RArray<TArrayItem>, 
+                              CTelBubbleCustomElement::ECustomElementCount >, 
+                 KBubbleCallMaxAmount > iCustomizations;
+    
+    CBubbleDefaultManager* iDefaultManager; // owned
+    };
+
+#endif // C_BUBBLECUSTOMMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMDefaultManager.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Manages default implementations for customizable elements. 
+*
+*/
+
+
+#ifndef C_BUBBLEDEFAULTMANAGER_H
+#define C_BUBBLEDEFAULTMANAGER_H
+
+#include <e32base.h>
+#include "BMBubbleManager.h"
+#include "telbubblecustomelement.h"
+
+class CBubbleHeader;
+
+/**
+ *  Customization manager.
+ *
+ *  @lib BubbleManager.lib
+ *  @since S60 5.0
+ */
+NONSHARABLE_CLASS( CBubbleDefaultManager ) : public CBase
+    {
+public:
+    /**
+     * Two-phased constructor.
+     * @param ?arg1 ?description
+     * @param ?arg2 ?description
+     */
+    static CBubbleDefaultManager* NewL( CBubbleManager& aBubbleManager );
+    
+    /**
+    * Destructor.
+    */
+    virtual ~CBubbleDefaultManager();
+
+    /**
+     * Reserves big call indicator element.
+     *
+     * @since S60 5.0
+     * @param aHeader Bubble header.
+     * @return Element instance.
+     */
+    CTelBubbleCustomElement* ReserveBigCallIndicatorElement(
+        const CBubbleHeader& aHeader );
+    
+    /**
+     * Reserves number type icon element.
+     *
+     * @since S60 5.0
+     * @param aHeader Bubble header.
+     * @return Element instance.
+     */
+    CTelBubbleCustomElement* ReserveNumberTypeIconElement(
+        const CBubbleHeader& aHeader );
+    
+    /**
+     * Reserves small call indicator element.
+     *
+     * @since S60 5.0
+     * @param aHeader Bubble header.
+     * @return Element instance.
+     */
+    CTelBubbleCustomElement* ReserveSmallCallIndicatorElement(
+        const CBubbleHeader& aHeader );
+    
+    /**
+     * Reserves call image element.
+     *
+     * @since S60 5.0
+     * @param aHeader Bubble header.
+     * @return Element instance.
+     */
+    CTelBubbleCustomElement* ReserveCallImageElement(
+         const CBubbleHeader& aHeader );
+    
+    /**
+     * Releases default element.
+     *
+     * @since S60 5.0
+     * @param aElement Released element.
+     */
+    void ReleaseElement( CTelBubbleCustomElement*& aElement );    
+
+private:
+    // Default implementations
+    enum TBubbleDefaultElements
+        {
+        EBMDefaultCallStatusIndiBig,
+        EBMDefaultCallStatusIndiSmall,
+        EBMDefaultCallStatusAnimBig,
+        EBMDefaultCallStatusAnimSmall,
+        EBMDefaultNumberTypeIcon,
+        EBMDefaultCallImageControl
+        };    
+
+private:
+    CBubbleDefaultManager( CBubbleManager& aBubbleManager );
+    void ConstructL();
+    CTelBubbleCustomElement* ReserveElement( TBubbleDefaultElements aType );
+    
+private: // data
+    CBubbleManager&       iBubbleManager;
+
+    // default elements
+    typedef CArrayPtrFlat<CTelBubbleCustomElement> CSingleElement;
+    // array of max elements
+    RArray<TUint> iMaxAmounts;       
+    // array of resource arrays
+    CArrayPtrFlat<CSingleElement>* iElements; 
+    // array of info about usage
+    RArray<TUint> iAvailabilities;
+    };
+
+#endif // C_BUBBLEDEFAULTMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMImageReader.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Reader for JPEG/GIF/BMP images (ImageHandlingLib wrapper)
+*
+*/
+
+
+#ifndef BMIMAGEREADER_H
+#define BMIMAGEREADER_H
+
+#include <MIHLViewerObserver.h>
+
+#include "BMMediaReader.h"
+
+class MIHLFileImage;
+class MIHLBitmap;
+class MIHLImageViewer;
+
+/**
+ *  Reader for JPEG/GIF/BMP images (ImageHandlingLib wrapper)
+ *
+ *  @lib BubbleManager
+ *  @since S60 v3.2
+ */
+class CBubbleImageReader : public CBubbleMediaReader,
+                           public MIHLViewerObserver
+    {
+public:    
+
+    static CBubbleImageReader* NewL( 
+        const TDesC& aFileName );
+	
+    virtual ~CBubbleImageReader();
+
+private: // from CBubbleMediaReader
+    
+    void  StartReadingL(
+        const TSize& aTargetSize,
+        const TReal& aScaleFactor,
+        const TRect& aClipRect, 
+        MBubbleMediaReaderObserver* aObserver );
+        
+    TInt SetScaleAndClip(
+        const TSize& aTargetSize,
+        const TReal& aScaleFactor,
+        const TRect& aClipRect );        
+    
+    void  CancelReading();
+    
+    const TSize SourceSize() const;
+    
+    TBool IsAnimation() const;
+    
+    void  Play();
+    
+    void  Stop();
+    
+private: // from MIHLViewerObserver
+    
+    void ViewerBitmapChangedL();
+    
+    void ViewerError( TInt aError );     
+    
+
+private:
+    
+    CBubbleImageReader();
+
+    void ConstructL( const TDesC& aFileName );
+
+private: // data
+    
+    // Owned
+    MIHLFileImage* iSourceImage;
+    // Owned
+    MIHLBitmap* iDestinationBitmap;
+    // Owned
+    MIHLImageViewer* iViewerEngine;
+    
+    };
+
+#endif // BMIMAGEREADER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMImageReaderObserver.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     ???
+*
+*/
+
+
+#ifndef MMBIMAGEREADEROBSERVER_H
+#define MMBIMAGEREADEROBSERVER_H
+
+//  INCLUDES
+#include <e32def.h>
+#include "BMImageReader.h"
+
+// FORWARD DECLARATIONS
+class CBubbleImageReader;
+
+// CLASS DECLARATION
+
+/**
+ * Observer interface for CBMThumbnailReader.
+ */
+class MBubbleImageReaderObserver
+  {
+    public:
+        /**
+         * Called by CBubbleImageReader when image read is complete.
+         *
+         * @param aReader   the completed reader.
+         * @param aBitmap   the read image.
+         */
+        virtual void ImageReadComplete
+            ( CBubbleImageReader& aReader, CFbsBitmap* aBitmap ) = 0;
+
+        /**
+         * Called by CBubbleImageReader if image reading fails.
+         *
+         * @param aReader   the failed reader.
+         * @param aError    error code of the failure.
+         */
+        virtual void ImageReadFailed( CBubbleImageReader& aReader, TInt aError ) = 0;
+
+        /**
+         * Called by CBubbleImageReader when image open is complete.
+         * After this event CBubbleImageReader functions FrameCount() and 
+         * FrameInfo() can be called.
+         * Default implementation is empty as most clients are interested of 
+         * ImageReadComplete/Failed events only.
+         *
+         * @param aReader   the completed reader.
+         */
+        virtual void ImageOpenComplete( CBubbleImageReader& aReader ) = 0;
+    };
+
+#endif // MMBIMAGEREADEROBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMMainPaneControl.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Call status indicator
+*
+*/
+
+
+#ifndef C_BUBBLEMAINPANECONTROL_H
+#define C_BUBBLEMAINPANECONTROL_H
+
+#include "BMBubbleManager.h"
+#include <coecntrl.h>
+
+class CBubbleCallObjectManager;
+class CTelBubbleCustomElement;
+class CBubbleCustomManager;
+class CFbsBitmap;
+
+/**
+ *  Displays caller image in main pane.
+ *
+ *
+ *  @lib BubbleManager.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CBubbleMainPaneControl ) : public CCoeControl
+    {
+public:
+    /**
+     * Two-phased constructor.
+     * @param aBubbleManager Bubble manager.
+     * @param aCallObjectManager Call object manager.
+     */
+    static CBubbleMainPaneControl* NewL(
+            CBubbleManager& aBubbleManager, 
+            CBubbleCallObjectManager& aCallObjectManager );
+    
+    /**
+    * Destructor.
+    */
+    virtual ~CBubbleMainPaneControl();
+    
+    /**
+     * Read bubble header.
+     * @param aHeader Bubble header.
+     */
+    void ReadBubbleHeader( const CBubbleHeader& aHeader );
+    
+    /**
+     * Reset.
+     */
+    void Reset();
+    
+    /**
+     * Draw bitmaps.
+     * @param aRect Rectangle to be redrawn.
+     */
+    void DrawBitmaps( const TRect& aRect ) const;
+    
+    /**
+     * Returns bubble id that image is related to.
+     */
+    CBubbleManager::TBubbleId BubbleId() const;
+    
+    /**
+     * Returns ETrue when image is being displayed.
+     */
+    TBool IsUsed() const;
+        
+private:    
+    CBubbleMainPaneControl( CBubbleManager& aCustomManager, 
+                            CBubbleCallObjectManager& aCallObjectManager );
+    void ConstructL();
+    void SizeChanged();
+    void PrepareBitmapsL( CFbsBitmap*& aBitmap,
+                          TBool& aBitmapOwnership, 
+                          CFbsBitmap*& aMask,
+                          TBool& aMaskOwnership,
+                          TBool aIsScalable ); 
+
+private: // data
+    CBubbleManager& iBubbleManager;
+    CBubbleCallObjectManager& iCallObjectManager;
+    CBubbleManager::TBubbleId iBubble;
+    TBool iThreeLinedBubble;
+    CTelBubbleCustomElement* iCallImage;
+    TBool iIsUsed;
+    CFbsBitmap* iBitmap; // not owned
+    CFbsBitmap* iMask; // not owned
+    };
+
+#endif // C_BUBBLEMAINPANECONTROL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMMediaReader.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Base class for media readers.
+*
+*/
+
+
+#ifndef BMMEDIAREADER_H
+#define BMMEDIAREADER_H
+
+#include <e32base.h>
+#include "BMMediaReaderInterface.h"
+
+class MBubbleMediaReaderObserver;
+
+/**
+ *  Base class for media readers.
+ *
+ *  @lib BubbleManager
+ *  @since S60 v3.2
+ */
+class CBubbleMediaReader : public CBase,
+                           public MBubbleMediaReader
+    {
+public:    
+    virtual ~CBubbleMediaReader();
+
+    /**
+     * Derived class should call this when image or new 
+     * animation frame has been read to frame buffer.
+     *
+     * @since S60 v3.2
+     */
+    void HandleReadingComplete();
+    
+    /**
+     * Derived class should call this in error situation.
+     *
+     * @since S60 v3.2
+     * @param aError System wide error code.
+     */
+    void HandleReadingError( TInt aError );
+    
+    
+protected: // from MBubbleMediaReader
+    
+    virtual void StartReadingL( 
+        const TSize& aTargetSize, 
+        const TReal& aScaleFactor,
+        const TRect& aClipRect, 
+        MBubbleMediaReaderObserver* aObserver ) = 0;
+
+    virtual TInt SetScaleAndClip(
+        const TSize& aTargetSize,
+        const TReal& aScaleFactor,
+        const TRect& aClipRect ) = 0;        
+    
+    virtual void CancelReading() = 0;
+    
+    virtual const TSize SourceSize() const = 0;
+    
+    virtual TBool IsAnimation() const = 0;
+    
+    virtual const CFbsBitmap* FrameBuffer() const;
+    
+    virtual const CFbsBitmap* Mask() const;
+    
+    virtual void Play() = 0;
+    
+    virtual void Stop() = 0;
+
+public:
+    CBubbleMediaReader();
+
+protected: // data
+    // Not owned
+    const CFbsBitmap* iFrameBuffer;
+    // Not owned
+    const CFbsBitmap* iMask;
+    // Not owned
+    MBubbleMediaReaderObserver* iObserver;
+    };
+
+
+#endif // BMMEDIAREADER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMMediaReaderFactory.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Creator of media readers.
+*
+*/
+
+
+#ifndef BUBBLEMEDIAREADERFACTORY_H
+#define BUBBLEMEDIAREADERFACTORY_H
+
+#include <e32base.h>
+
+class MBubbleMediaReader;
+
+/**
+ *  Creator of media readers.
+ *
+ *  ?more_complete_description
+ *
+ *  @lib BubbleManager
+ *  @since S60 3.2
+ */
+class BubbleMediaReaderFactory
+    {
+public:    	
+
+    /**
+     * Factory method to create a reader for given file.
+     *
+     * @since S60 v3.2
+     * @param aFileName File name with path.
+     * @return Media reader instance.
+     */
+    static MBubbleMediaReader* CreateReaderL( 
+        const TDesC& aFileName );
+    };
+
+
+#endif // BUBBLEMEDIAREADERFACTORY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMMediaReaderInterface.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,128 @@
+/*
+* 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:  Media reader interface.
+*
+*/
+
+
+#ifndef MBUBBLEMEDIAREADER_H
+#define MBUBBLEMEDIAREADER_H
+
+class CFbsBitmap;
+class MBubbleMediaReaderObserver;
+
+/**
+ *  Media reader interface.
+ *
+ *  @lib BubbleManager
+ *  @since S60 v3.2
+ */
+class MBubbleMediaReader
+    {
+
+public:
+    // === LOADING CONTROL ====================================================
+    
+    /**
+     * Factory method to create a reader for given file.
+     *
+     * @since S60 v3.2
+     * @param aTargetSize Image/frame is loaded to this size.
+     * @param aScaleFactor Scaling factor (normally the ratio 
+     *                     between target size and clip rect).
+     * @param aClipRect Clip rect, relative to source dimensions.
+     * @param aObserver Observer for reader events.
+     */
+    virtual void StartReadingL(
+        const TSize& aTargetSize,
+        const TReal& aScaleFactor,
+        const TRect& aClipRect, 
+        MBubbleMediaReaderObserver* aObserver  ) = 0;
+    
+    /**
+     * Update scale and clip parameters for currently viewed bitmap.
+     *
+     * @since S60 v3.2
+     * @param aTargetSize  Maximum size for destination bitmap.
+     * @param aScaleFactor Scaling factor (normally the ratio between target
+                           size and clip rect).
+     * @param aClipRect    Clip rect, relative to source dimensions.
+     * @return System wide error code.
+     */
+    virtual TInt SetScaleAndClip(
+        const TSize& aTargetSize,
+        const TReal& aScaleFactor,
+        const TRect& aClipRect ) = 0;
+    
+    /**
+     * Cancels reading in progress.
+     *
+     * @since S60 v3.2
+     */
+    virtual void CancelReading() = 0;
+    
+    // === DATA ACCESS ========================================================
+    /**
+     * Gets size of source image/frame.
+     *
+     * @since S60 v3.2
+     * @return Size of source image.
+     */
+    virtual const TSize SourceSize() const = 0;
+    
+    /**
+     * Checks if source is animation.
+     *
+     * @since S60 v3.2
+     * @return ETrue if source is animation.
+     */
+    virtual TBool IsAnimation() const = 0;
+    
+    /**
+     * Gets pointer to frame buffer.
+     *
+     * @since S60 v3.2
+     * @return Pointer to frame buffer.
+     */
+    virtual const CFbsBitmap* FrameBuffer() const = 0;
+    
+    /**
+     * Gets mask for the current frame in frame buffer.
+     *
+     * @since S60 v3.2
+     * @return Pointer to mask frame.
+     */
+    virtual const CFbsBitmap* Mask() const = 0;
+    
+    // === ANIMATION CONTROL ==================================================
+    /**
+     * Starts animation.
+     *
+     * @since S60 v3.2
+     */
+    virtual void Play() = 0;
+    
+    /**
+     * Stops animation.
+     *
+     * @since S60 v3.2
+     */
+    virtual void Stop() = 0;
+    
+    // Virtual destructor
+    virtual ~MBubbleMediaReader() {};
+    };
+
+
+#endif // MBUBBLEMEDIAREADER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMMediaReaderObserver.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CBubbleMediaReader observer interface.
+*
+*/
+
+
+#ifndef MBUBBLEMEDIAREADEROBSERVER_H
+#define MBUBBLEMEDIAREADEROBSERVER_H
+
+/**
+ *  CBubbleMediaReader observer interface
+ *
+ *  @lib BubbleManager
+ *  @since S60 v3.2
+ */
+class MBubbleMediaReaderObserver
+    {
+
+public:     
+    /**
+     * Image or animation frame has been read and is available 
+     * in the framebuffer. Client should update the screen. 
+     *
+     * @since S60 v3.2
+     */
+    virtual void FrameBufferDataChanged() = 0;
+    
+    /**
+     * Reports an error in reading procedure.  
+     *
+     * @since S60 v3.2
+     * @param aError System wide error code.
+     */
+    virtual void ReaderError( TInt aError ) = 0;
+    };
+
+#endif // MBUBBLEMEDIAREADEROBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMNumberTypeIcon.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Number type icon. 
+*
+*/
+
+#ifndef C_BUBBLENUMBERTYPEICON_H
+#define C_BUBBLENUMBERTYPEICON_H
+
+#include "BMBubbleManager.h"
+#include "telbubbleimage.h"
+
+/**
+ *  Number type icon
+ *
+ *
+ *  @lib BubbleManager.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CBubbleNumberTypeIcon ) : public CTelBubbleImage
+    {
+public:
+    /**
+     * Two-phased constructor.
+     * @param aBubbleManager Bubble manager.
+     */
+    static CBubbleNumberTypeIcon* NewL( CBubbleImageManager& aImageManager );
+    
+    /**
+    * Destructor.
+    */
+    virtual ~CBubbleNumberTypeIcon();
+    
+    /**
+     * Read bubble header.
+     *
+     * @since S60 5.0
+     * @param aHeader Bubble header.
+     */
+    void ReadBubbleHeader( const CBubbleHeader& aHeader );
+    
+private:    
+    CBubbleNumberTypeIcon( CBubbleImageManager& aImageManager );
+    void ConstructL();
+    void MakeVisible(TBool aVisible);
+
+private: // data
+    CBubbleImageManager& iImageManager;
+    CBubbleManager::TPhoneNumberType iNumberType;
+    TUint32 iCallFlags;
+    };
+
+#endif // C_BUBBLENUMBERTYPEICON_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMPanic.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Panic Function
+*
+*/
+
+
+#ifndef BMPANIC_H
+#define BMPANIC_H
+
+//  INCLUDES
+#include <e32std.h>
+
+// DATA TYPES
+enum TBMPanic // panics
+    {
+    EBMPanicConferenceIsUsed = 6000,
+    EBMPanicConferenceNotUsed,
+    EBMPanicReferredHeaderIsConferenceHeader,
+    EBMPanicReferredCallHeaderIsInConferenceCall,
+    EBMPanicTooManyCallsInConference,
+    EBMPanicConferenceCallEmpty,
+    EBMPanicInvalidConfRowNumber,
+
+    EBMPanicInvalidNumberOfHeaders,
+    EBMPanicErrorInStartAndEndChanges,
+    EBMPanicPlaceEnumerationDoesNotExist,
+
+    EBMPanicBubbleIdDoesNotExist,
+    EBMPanicBubbleIdIsNotInUse,
+
+    EBMPanicNumberEntryNotInUse,
+    EBMPanicNumberEntryInUse,
+    EBMPanicInvalidNumberEntry,
+
+    EBMPanicLAF,
+    EBMPanicImages,
+    EBMPanicUnhandledSwitchCase,
+    EBMPanicTooLongText,
+
+    EBMPanicFeatureNotSupported,
+
+    EBMPanicErrorInResourceManager,
+    
+    EBMPanicCallObjectManager,
+    
+    EBMPanicVideoPlayer,
+        
+    EBMPanicTouchPane,
+    
+    EBMPanicCustomization
+    };
+
+// FUNCTION PROTOTYPES
+
+/**
+* Panic function
+* @since 1.0
+* @param aPanic Panic enumeration
+*/
+GLREF_C void Panic( TBMPanic aPanic );
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMResourceManager.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,141 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Resource pool for CCoeControls.
+*
+*/
+
+
+#ifndef CBUBBLERESOURCEMANAGER_H
+#define CBUBBLERESOURCEMANAGER_H
+
+//  INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class CEikImage;
+class CEikLabel;
+class CBubbleAnimationControl;
+class CCoeControl;
+class CBubbleManager;
+
+// CLASS DECLARATION
+
+/**
+*  Resource pool for CCoeControls.
+*
+*  @lib bubblemanager
+*  @since 1.0
+*/
+class CBubbleResourceManager :public CBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        * @param aParentWindow Main container
+        * @return New instance
+        */
+        static CBubbleResourceManager* NewL( CBubbleManager& aParentWindow );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleResourceManager();
+
+    public: // New functions
+        
+        /**
+        * Reserves CEikLabel object. Object must be released after use.
+        * @return CEikLabel object.
+        */
+        CEikLabel* ReserveEikLabel();
+
+        /**
+        * Releases CEikLabel object. 
+        * @param aLabel Object to be release. Pointer will be set to NULL.
+        */
+        void ReleaseEikLabel( CEikLabel*& aLabel );
+
+        /**
+        * Reserves CEikImage object. Object must be released after use.
+        * @return CEikImage object.
+        */
+        CEikImage* ReserveEikImage( TBool aIsBackgroundImage = EFalse );
+
+        /**
+        * Releases CEikImage object. 
+        * @param aImage Object to be release. Pointer will be set to NULL.
+        */
+        void ReleaseEikImage( CEikImage*& aImage );
+
+        /**
+        * Activates all the controls.
+        * @since 2.0
+        */
+        void ActivateL();
+
+    private:
+
+        // Enumeration for different resources
+        enum TBubbleResource
+            {
+            EBMEikImage = 0,
+            EBMEikLabel
+            };
+
+        /**
+        * C++ default constructor.
+        */
+        CBubbleResourceManager( CBubbleManager& aParentWindow );
+
+        /**
+        * 2nd phase constructor
+        */
+        void ConstructL();
+
+        /**
+        * Reserves one resource object.
+        */
+        void ReserveResource( 
+            CCoeControl*& aResource , 
+            TBubbleResource aType );
+
+        /**
+        * Releases current resource.
+        */
+        void ReleaseResource( 
+            CCoeControl*& aResource , 
+            TBubbleResource aType );
+
+    private:    // Data
+
+        typedef CArrayPtrFlat<CCoeControl> CSingleResource;
+
+        // array of max elements
+        RArray<TUint> iMaxAmounts;       
+        // array of resource arrays
+        CArrayPtrFlat<CSingleResource>* iResources; 
+        // array of info about usage
+        RArray<TUint> iAvailabilities; 
+
+        // Parent window for controls
+        CBubbleManager& iParentWindow;     
+
+    };
+
+#endif      // CBUBBLERESOURCEMANAGER_H 
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMTouchPane.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,204 @@
+/*
+* 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:  Container control for touch controls.
+*
+*/
+
+
+#ifndef C_BUBBLECTOUCHPANE_H
+#define C_BUBBLECTOUCHPANE_H
+
+#include <coecntrl.h>
+#include "BMTouchPaneInterface.h"
+
+class CBubbleTouchPaneButton;
+class CAknButton;
+class TResourceReader;
+
+/**
+ *  Container control for touch buttons.
+ *
+ *
+ *  @lib bubblemanager.lib
+ *  @since S60 v5.0
+ */
+class CBubbleTouchPane : public CCoeControl,
+                         public MBubbleTouchPaneInterface,
+                         public MCoeControlObserver
+    {
+    public:
+    
+        /**
+        * Two phase constructor.
+        * @return New instance
+        */
+        static CBubbleTouchPane* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleTouchPane();
+        
+        /**
+        * To be called when skin is changed and icons
+        * should be reloaded from skin server.
+        */
+        void HandleResourceChange( TInt aType );
+        
+        /**
+        * To be called when BubbleManager is within start and end 
+        * changes block. TouchPane doesn't draw itself during
+        * update.
+        * @param aUpdating ETrue when ui update is in progress
+        *                  otherwise EFalse.
+        */
+        void SetUpdating( TBool aUpdating ); 
+
+    protected: // From MBubbleTouchPaneInterface.
+    
+        /**
+        * From MBubbleTouchPaneInterface.
+        */    
+        TInt SetButtonSet( TInt aResourceId );
+        
+        /**
+        * From MBubbleTouchPaneInterface.
+        */
+        void SetButtonState( TInt aCommand );
+        
+        /**
+        * From MBubbleTouchPaneInterface.
+        */
+        void SetButtonDimmed( TInt aCommand, TBool aDimmed );
+        
+        /**
+        * From MBubbleTouchPaneInterface.
+        */
+        TInt NumberOfButtonsInPane()  const;
+        
+        /**
+        * From MBubbleTouchPaneInterface.
+        */
+        TInt ButtonCommandId( TInt aButtonIndex ) const;
+        
+        /**
+        * From MBubbleTouchPaneInterface.
+        */
+        TInt ReplaceButton( TInt aButtonIndex, TInt aResourceId );
+        
+        /**
+        * From MBubbleTouchPaneInterface.
+        */
+        TBool ButtonHasState( TInt aButtonIndex, TInt aCommand ) const;
+        
+        /**
+        * From MBubbleTouchPaneInterface.
+        */
+        void SetIconProvider(
+            MBubbleTouchPaneIconProvider* aIconProvider );
+
+    protected: // From CCoeControl
+    
+        /**
+        * From CCoeControl.
+        */
+        void SizeChanged();
+        
+        /**
+        * From CCoeControl.
+        */
+        TInt CountComponentControls() const;
+        
+        /**
+        * From CCoeControl.
+        */
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+        
+        /**
+        * From CCoeControl.
+        */
+        void HandlePointerEventL( const TPointerEvent& aPointerEvent );
+
+    protected: // MCoeControlObserver
+    
+        /**
+        * From MCoeControlObserver.
+        */
+        void HandleControlEventL(CCoeControl *aControl, TCoeEvent aEventType);    
+
+    private:
+    
+        /**
+        * Handles callback.
+        */
+        static TInt IdleCallback( TAny* aThis );
+        
+        /**
+        * Resets and destroyes touch pane buttons.
+        */
+        void DoDeleteButtonsInIdle();
+        
+        /**
+        * Creates buttons.
+        */
+        void LoadButtonsFromResourceL( TResourceReader& aReader );
+        
+        /**
+        * Sets used button resource.
+        */
+        void SetButtonSetL( TInt aResourceId );
+        
+        /**
+        * Replaces button with other.
+        */
+        void ReplaceButtonL( TInt aButtonIndex, TInt aResourceId );
+        
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CBubbleTouchPane();
+        
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+        
+        
+    private: // data
+    
+        // Array of buttons.
+        RPointerArray<CBubbleTouchPaneButton> iButtons;
+        
+        // Owned.
+        CIdle* iIdleProcessor;
+        
+        // Async delete information.
+        TBool iDeleteButtonsAsync;
+        
+        // Button set id.
+        TInt iCurrentButtonSetId;
+        
+        // Array of buttons to be deleted.
+        RPointerArray<CBubbleTouchPaneButton> iButtonsToBeDeleted;
+        
+        // Icon provider.
+        MBubbleTouchPaneIconProvider* iIconProvider;
+        
+        // UI updating status flag.
+        TBool iUpdating;
+    };
+
+#endif // C_BUBBLECTOUCHPANE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMTouchPane.rh	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource headers for project BubbleManager
+*
+*/
+
+
+#ifndef BMTOUCHPANE_RH
+#define BMTOUCHPANE_RH
+
+// ---------------------------------------------------------------------------
+// Touch pane button
+// ---------------------------------------------------------------------------
+//    
+STRUCT BUBBLE_TOUCH_PANE_BUTTON
+    {
+    WORD   commands[]; // command per button state
+    STRUCT button[];   // AVKON_BUTTON
+    }
+    
+// ---------------------------------------------------------------------------
+// Touch pane
+// ---------------------------------------------------------------------------
+//
+STRUCT BUBBLE_TOUCH_PANE
+    {
+    WORD flags=0;
+    LLINK buttons[]; // BUBBLE_TOUCH_PANE_BUTTON
+    }
+
+#endif // BMTOUCHPANE_RH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMTouchPaneButton.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,208 @@
+/*
+* 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:  Button for touch pane.
+*
+*/
+
+
+#ifndef BMTOUCHPANEBUTTON_H_
+#define BMTOUCHPANEBUTTON_H_
+
+#include <aknbutton.h>
+
+class MBubbleTouchPaneIconProvider;
+
+/**
+ *  Contains touch button data.
+ *  
+ *  @code
+ *   CBubbleTouchPaneButton* button = CBubbleTouchPaneButton::NewL( 
+ *                                     iIconProvider);
+ *   CleanupStack::PushL( button );
+ *   button->ConstructFromResouceL( reader ); 
+ *       
+ *   CleanupStack::Pop( button );
+ *   CleanupStack::PopAndDestroy(); // reader
+ *       
+ *   button->SetContainerWindowL( *this );
+ *   button->SetObserver( this );    
+ *   button->ActivateL();
+ *  @endcode
+ *
+ *  @lib bubblemanager.lib
+ *  @since S60 S60 v5.0
+ */
+
+NONSHARABLE_CLASS( CBubbleTouchPaneButton ) : public CAknButton
+    {
+    public:
+        /**
+         * Two-phased constructor.
+         * @param aIconProvider the pointer to the icon provider
+         * @param aFlags The flags for the button
+         */
+        static CBubbleTouchPaneButton* NewL
+                    ( MBubbleTouchPaneIconProvider* aIconProvider,
+                      const TInt aFlags = 0 ); 
+        
+       
+
+        /**
+        * Destructor.
+        */
+        ~CBubbleTouchPaneButton();
+    
+    public:
+        /**
+         * Returns command id of the button
+         *
+         * @since S60 ?S60_version
+         * @param aPreviousState ?description
+         */
+        TInt CommandId( TBool aPreviousState = EFalse ) const;
+        
+        /**
+         * Checks does the button has the given command. 
+         *
+         * @since S60 v5.0
+         * @param aCommand the command 
+         * @return The ETrue if command can be found from iCommands array
+         */
+        TBool HasState( TInt aCommand ) const;
+        
+        /**
+         * Constructs controls from a resource file.
+         *
+         * @param aReader The resource reader, with which to access the 
+         *      control's resource values.
+         */      
+        void ConstructFromResouceL( TResourceReader& aReader );
+        
+        /**
+         * Sets the current state of the button.
+         *
+         * @since S60 v5.0
+         * @param aCommand the command
+         * @param aDrawNow ETrue to redraw the button.
+         */
+        void SetState( TInt aCommand, TBool aDrawNow );
+        
+        /**
+         * Sets button dimmed.
+         *
+         * @since S60 v5.0
+         * @param ?arg1 ?description
+         */
+        void SetDimmed( TBool aDimmed );
+        
+        /**
+         * Handles a change to the control's resources.
+         *
+         * @param aType is a message UID value.
+         */
+        void HandleResourceChange( TInt aType );
+        
+        /**
+         * Sets layout text and icon rectanble of the button. 
+         *
+         * @param aLayoutText the layout text
+         * @param aIconRect the rectangle of the button
+         */
+        void SetLayout( const TAknLayoutText aLayoutText,
+                        const TRect aIconRect);
+        
+        /**
+         * Sets correct graphics frame for button. 
+         *
+         * @param frameId the button which is pressed
+         */
+         TAknsItemID SelectPressedButton( TAknsItemID frameId )const; 
+    
+        /**
+         * Sets correct graphics frame for button. 
+         *
+         * @param frameId the button which is dimmed
+         */
+         TAknsItemID SelectDimmedButton( TAknsItemID frameId )const; 
+    protected:
+        
+        /**
+         * C++ constructor for the one state button.
+         *
+         * @param aIconProvider the pointer to the icon provider
+         * @param aFlags The flags for the button
+         */
+        CBubbleTouchPaneButton( 
+                   MBubbleTouchPaneIconProvider* aIconProvider,
+                   const TInt aFlags );
+        
+    protected: 
+        //from base class CCoeControl
+        /**
+         * From CCoeControl. 
+         * Draws the control. Called by window server.
+        */
+        void Draw(const TRect& aRect) const;
+        
+    private:
+        /**
+         * Symbian 2nd phase constructor.
+         */
+        void ConstructL();
+        
+        /**
+         * Loads icons using the given icon provider
+         * 
+         * @param aIconProvider the icon provider
+         */
+        void LoadCustomIcons( MBubbleTouchPaneIconProvider& aIconProvider );
+              
+        /**
+         * Draw text and icon according to the layout.
+         * 
+         * @param aGc the window graphics context
+         */ 
+        void LayoutIconAndText( CWindowGc& aGc ) const;
+        
+        /**
+         * Gets the correct text color.
+         * 
+         * @param aPenColor the RGB colour value
+         */
+        void GetTextColors( TRgb& aPenColor ) const; 
+        
+    private: // data
+        /**
+         * Array of the button commands.
+         */
+        RArray<TInt> iCommands;
+       
+        /**
+         * Touch pane icon provider.
+         * Not own.
+         */
+        MBubbleTouchPaneIconProvider* iIconProvider;
+        
+        /**
+         * Layout text
+         */
+        TAknLayoutText iLayoutText;
+        
+        /**
+         * Rectangle of the icon of the button.
+         */
+        TRect iIconRect;
+    };
+
+#endif /*BMTOUCHPANEBUTTON_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMTouchPaneInterface.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Interface to add bubble touch pane buttons.
+*
+*/
+
+
+#ifndef M_BUBBLETOUCHPANEINTERFACE_H
+#define M_BUBBLETOUCHPANEINTERFACE_H
+
+#include <e32std.h>
+
+class CGulIcon;
+class TAknsItemID;
+
+/**
+ *  Interface for obtaining icon from skin, the icon is shown in touch pane 
+ *  button. The client using MBubbleTouchPaneInterface must implement this
+ *  to support skinning.
+ */
+class MBubbleTouchPaneIconProvider
+    {
+public:        
+    /**
+     * Gets icon for command.
+     *
+     * @since S60 v5.0
+     * @param aCommandId The command id.
+     * @return Icon instance. NULL if icon doesn't exist for command.
+     */
+    virtual CGulIcon* GetIconForCommandL( TInt aCommandId ) = 0;
+
+    /**
+    * Gets button for command.
+    *
+    * @since TB 9.2
+    * @param aCommandId The command id.
+    * @return frameId. Normal if special button doesn't exist for command.
+    */
+    virtual TAknsItemID GetButtonForCommandL( TInt aCommandId ) = 0;
+
+    };
+
+/**
+ *  Interface to add bubble touch pane buttons.
+ *
+ *
+ *  @lib bubblemanager.lib
+ *  @since S60 v5.0
+ */
+class MBubbleTouchPaneInterface
+    {
+public:
+    /**
+     * Constructs touch pane buttons from resource.
+     *
+     * @since S60 v5.0
+     * @param aResourceId Resource id. 0 = empty set.
+     * @return Error code.
+     */
+    virtual TInt SetButtonSet( TInt aResourceId ) = 0;
+    
+    /**
+     * Sets toggling button to the state, which triggers
+     * the given command, when pressed.
+     *
+     * @since S60 v5.0
+     * @param aCommand Command id.
+     */
+    virtual void SetButtonState( TInt aCommand ) = 0;
+    
+    /**
+     * Sets button dimmed.
+     *
+     * Toggling buttons should be set to a state, where aCommand
+     * is the active command before applying this method.
+     *
+     * @since S60 v5.0
+     * @param aCommand Command id.
+     * @param aDimmed  ETrue to set dimmed, EFalse to undim.
+     */
+    virtual void SetButtonDimmed( TInt aCommand, TBool aDimmed ) = 0;
+    
+    /**
+     * Returns number of buttons in touch pane.
+     *
+     * @since S60 v5.0
+     * @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.0
+     * @param aButtonIndex Button index starting 0.
+     * @return Command id assigned to given position.
+     */
+    virtual TInt ButtonCommandId( TInt aButtonIndex )  const = 0;
+    
+    /**
+     * Checks if button has state that generates given command.
+     *
+     * @since S60 v5.0
+     * @param aButtonIndex Button index starting 0.
+     * @param aCommand Command id.
+     * @return ETrue if button has this state, otherwise EFalse.
+     */
+    virtual TBool ButtonHasState( TInt aButtonIndex, TInt aCommand )  const = 0;
+    
+    /**
+     * Replaces button in given position. 
+     *
+     * @since S60 v5.0
+     * @param aButtonIndex Button to be replaced.
+     * @param aResourceId Resource definiton of replacing button.
+     * @return Error code.
+     */
+    virtual TInt ReplaceButton( TInt aButtonIndex,
+                                TInt aResourceId ) = 0;
+                                
+    /**
+     * Set icon provider.
+     *
+     * @since S60 v5.0
+     * @param aIconProvider Provider interface.
+     */
+    virtual void SetIconProvider(
+        MBubbleTouchPaneIconProvider* aIconProvider ) = 0;                                
+    };
+
+#endif // M_BUBBLETOUCHPANEINTERFACE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMTrace.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Macros for tracing.
+*
+*/
+
+
+
+#ifndef BUBBLETRACE_H
+#define BUBBLETRACE_H
+
+#ifdef _DEBUG
+
+// INCLUDES
+#include <e32svr.h>
+
+// CONSTANTS
+
+const TInt KBubbleDebugBufferSize = 60;
+
+// MACROS
+
+typedef TBuf<KBubbleDebugBufferSize> TBubbleDebBuf;
+
+#define BUBBLE_PRINT(x) { _LIT( KBubbleDebugPrintPrefix, "BM: ");\
+    TBubbleDebBuf buf( KBubbleDebugPrintPrefix);\
+    if ((_L(x).Length()) + buf.Length() <= KBubbleDebugBufferSize )\
+        buf.Append(_L(x)); RDebug::Print(buf); }
+
+#define BUBBLE_PRINTF(x,y) { _LIT( KBubbleDebugPrintPrefix, "BM: ");\
+    TBubbleDebBuf buf( KBubbleDebugPrintPrefix);\
+    if ((_L(x).Length()) + buf.Length() <= KBubbleDebugBufferSize )\
+        buf.Append(_L(x)); RDebug::Print(buf,y);}
+
+#define BUBBLE_PRINTF2(x,y,z) { _LIT( KBubbleDebugPrintPrefix, "BM: ");\
+    TBubbleDebBuf buf( KBubbleDebugPrintPrefix);\
+    if ((_L(x).Length()) + buf.Length() <= KBubbleDebugBufferSize )\
+        buf.Append(_L(x)); RDebug::Print(buf,y,z); }
+
+#else // !_DEBUG
+
+#define BUBBLE_PRINT(x)
+#define BUBBLE_PRINTF(x,y)
+#define BUBBLE_PRINTF2(x,y,z)
+
+#endif      // _DEBUG
+
+#endif      // BUBBLETRACE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMUtils.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,523 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Some utility functions to other classes
+*
+*/
+
+
+#ifndef BUBBLEUTILS_H
+#define BUBBLEUTILS_H
+
+// INCLUDES
+#include "BMBubbleManager.h"
+#include <calslbs.h>
+
+// FORWARD DECLARATIONS
+class CBubbleHeader;
+class CEikImage;
+class CEikLabel;
+class CBubbleImageManager;
+class TAknLayoutRect;
+class CBubbleCallObjectImage;
+class CTelBubbleCustomElement;
+
+// CLASS DECLARATION
+
+class TBubbleLayoutRect
+    {    
+public:
+    TBubbleLayoutRect();
+    void SetRect( const TPoint& aPoint, const TSize& aSize );    
+    void SetColor( const TRgb aColor );
+    TRgb Color() const;
+    TRect Rect() const;
+private:
+    TRgb iColor;
+    TRect iRect;
+    };
+
+
+/**
+*  CBubbleUtils class
+*  Some utility functions to other classes
+*
+*  @lib bubblemanager.lib
+*  @since 1.0
+*/
+class BubbleUtils
+    {
+    public: // Data types
+
+        // Text place enumeration 
+        enum KBubbleUtilsHeaderTextPlace
+            {
+            EBubbleHeaderCLI,
+            EBubbleHeaderLabel,
+            EBubbleHeaderTimerCost,
+            EBubbleHeaderCNAP
+            };
+
+    public: // Member functions
+        
+        /**
+        * Sets call type indicators in type pane
+        * @param aHeader Header which contains the information
+        * @param aTypeImage1 The selected (left one) bitmap is attached to 
+        *                    this image
+        * @param aTypeImage2 The selected (right one) bitmap is attached to 
+        *                    this image
+        * @param aBubbleManager Reference to BubbleManager
+        * @return Is at least one image set?
+        */   
+        static TBool SetCallTypePane( const CBubbleHeader& aHeader, 
+                                      CEikImage*& aTypeImage1, 
+                                      CEikImage*& aTypeImage2, 
+                                      CBubbleManager& aBubbleManager );
+
+        /**
+        * Sets ciphering off icon to image
+        * @param aHeader Header which contains the information
+        * @param aCypfOffImage The selected bitmap is attached to this image
+        * @param aBubbleManager Reference to BubbleManager
+        * @return Is image set?
+        */
+        static TBool SetCyphOffImage( const CBubbleHeader& aHeader, 
+                                      CEikImage*& aCypfOffImage, 
+                                      CBubbleManager& aBubbleManager );
+
+        
+        /**
+        * Selects text to lines ( for bottom, bottom right and middle bubbles)
+        * @param aHeader Header which contains the information
+        * @param aFirstLineText Text which goes to line 1 in the bubble
+        * @param aSecondLineText Text which goes to line 2 in the bubble
+        * @param aTimerCost Text which goes to timer/cost in the bubble
+        * @param aTextLine1 Component for resource allocation.
+        * @param aTextLine2 Component for resource allocation.
+        * @param aBubbleManager Bubblemanager reference.
+        * @param aFirstLineDir First line text clipping direction
+        * @param aSecondLineDir Second line text clipping direction
+        * @param aTextLineNumber On return contains the text-part line number 
+        */
+        static void ChooseTextsToTwoLines( const CBubbleHeader& aHeader,
+            TPtrC& aFirstLineText,
+            TPtrC& aSecondLineText,
+            CEikLabel*& aTimerCost,
+            CEikLabel*& aTextLine1,
+            CEikLabel*& aTextLine2,
+            CBubbleManager& aBubbleManager,
+            CBubbleManager::TPhoneClippingDirection& aFirstLineDir,
+            CBubbleManager::TPhoneClippingDirection& aSecondLineDir,
+            TUint8& aTextLineNumber );
+        
+        /**
+        * Selects text to lines ( for bottom, bottom right and middle bubbles)
+        * @param aHeader Header which contains the information
+        * @param aFirstLineText Text which goes to line 1 in the bubble
+        * @param aSecondLineText Text which goes to line 2 in the bubble
+        * @param aThirdLineText Text which goes to line 2 in the bubble
+        * @param aTimerCost Text which goes to timer/cost in the bubble
+        * @param aTextLine1 Component for resource allocation.
+        * @param aTextLine2 Component for resource allocation.
+        * @param aTextLine3 Component for resource allocation.
+        * @param aBubbleManager Bubblemanager reference.
+        * @param aFirstLineDir First line text clipping direction
+        * @param aSecondLineDir Second line text clipping direction
+        * @param aThirdLineDir Third line text clipping direction
+        * @param aTextLineNumber On return contains the text-part line number 
+        * @since Series60 2.6
+        */
+        static void ChooseTextsToThreeLines( const CBubbleHeader& aHeader,
+            TPtrC& aFirstLineText,
+            TPtrC& aSecondLineText,
+            TPtrC& aThirdLineText,
+            CEikLabel*& aTimerCost,
+            CEikLabel*& aTextLine1,
+            CEikLabel*& aTextLine2,
+            CEikLabel*& aTextLine3,
+            CBubbleManager& aBubbleManager,
+            CBubbleManager::TPhoneClippingDirection& aFirstLineDir,
+            CBubbleManager::TPhoneClippingDirection& aSecondLineDir,
+            CBubbleManager::TPhoneClippingDirection& aThirdLineDir,
+            TUint8& aTextLineNumber );
+            
+        /**
+        * Selects text to lines
+        * @param aHeader Header which contains the information
+        * @param aFirstLineText Text which goes to line 1 in the bubble
+        * @param aSecondLineText Text which goes to line 2 in the bubble
+        * @param aThirdLineText Text which goes to line 2 in the bubble
+        * @param aTimerCost Text which goes to timer/cost in the bubble
+        * @param aTextLine1 Component for resource allocation.
+        * @param aTextLine2 Component for resource allocation.
+        * @param aTextLine3 Component for resource allocation.
+        * @param aTextLine4 Component for resource allocation.
+        * @param aTextLine5 Component for resource allocation.
+        * @param aBubbleManager Bubblemanager reference.
+        * @param aFirstLineDir First line text clipping direction
+        * @param aSecondLineDir Second line text clipping direction
+        * @param aThirdLineDir Third line text clipping direction
+        * @param aTextLineNumber On return contains the text-part line number 
+        * @param aThreeLinesOfText Three lines of call text.
+        * @since Series60 2.6
+        */
+        static void ChooseTextsToFiveLines( const CBubbleHeader& aHeader,
+            TPtrC& aFirstLineText,
+            TPtrC& aSecondLineText,
+            TPtrC& aThirdLineText,
+            CEikLabel*& aTextLine1,
+            CEikLabel*& aTextLine2,
+            CEikLabel*& aTextLine3,
+            CEikLabel*& aTextLine4,
+            CEikLabel*& aTextLine5,
+            CBubbleManager& aBubbleManager,
+            CBubbleManager::TPhoneClippingDirection& aFirstLineDir,
+            CBubbleManager::TPhoneClippingDirection& aSecondLineDir,
+            CBubbleManager::TPhoneClippingDirection& aThirdLineDir,
+            TUint8& aTextLineNumber,
+            TBool aThreeLinesOfText );            
+
+        /**
+        * Selects from longer text (format: "longone\tshort") which one to use
+        * @param aText String containing at least long version of the text
+        * @param aLabel Label which width has been set and the text will be 
+        *               clipped to.
+        * @param aClipDir Text's clipping direction
+        */
+        static void SetTextInLabel( 
+                     const TDesC16& aText, 
+                     CEikLabel*& aLabel ,
+                     const CBubbleManager::TPhoneClippingDirection& aClipDir );
+        
+        /**
+        * Sets given text to label - clips if needed.
+        * @param aText String containing the used text
+        * @param aLabel Label which width has been set and the text will be 
+        *               clipped to.
+        * @param aClipDir Text's clipping end
+        */    
+        static void ClipToLabel ( 
+                    const TDesC16& aText, 
+                    CEikLabel*& aLabel ,
+                    const CBubbleManager::TPhoneClippingDirection& aClipDir );
+        
+
+        /**
+        * Draws image to screen. Pointer check added to previos function.
+        * @param aGc Context to draw to
+        * @param aImage Drawable image - with mask!
+        * @return EFalse if image was not drawn.
+        */
+        static TBool DrawMaskedImage( CBitmapContext& aGc , CEikImage* aImage );
+        
+        /**
+        * Tries to set text to label.
+        * @param aLabel Label to set the text to
+        * @param aText The text.
+        */
+        static void AddTextToEikLabel( 
+            CEikLabel*& aLabel , 
+            const TDesC& aText);
+        
+        /**
+        * Adds text to call header. Cuts the text if not fit.
+        * @param aHeader The header
+        * @param aTextPlace Enum for text position
+        * @param aTextToSet Original text.
+        * @param aMaxLength Text max length
+        * @param aClipDirection If text is too long, then cnut it.
+        */
+        static void AddTextToHeader( CBubbleHeader& aHeader,
+            const KBubbleUtilsHeaderTextPlace aTextPlace,
+            const TDesC& aTextToSet,
+            const TInt aMaxLength,
+            const CBubbleManager::TPhoneClippingDirection aClipDirection );
+
+        
+        /**
+        * The next three calls AknLayoutUtils's functions after they have 
+        * checked the pointer.
+        */ 
+        static void LayoutControl( 
+            CCoeControl* aControl, 
+            const TRect& aControlParent, 
+            const TAknWindowLineLayout& aLayout );
+        
+        static void LayoutBackgroundImage( 
+            CEikImage* aImage, 
+            const TRect& aParent, 
+            const TAknWindowLineLayout& aLayout);
+
+        static void LayoutImage( 
+            CEikImage* aImage, 
+            const TRect& aParent, 
+            const TAknWindowLineLayout& aLayout);
+
+        static void LayoutLabel( 
+            CEikLabel* aLabel, 
+            const TRect& aLabelParent, 
+            const TAknTextLineLayout& aLayout );
+        
+        static void LayoutImage( 
+            CEikImage* aImage, 
+            const TRect& aParent, 
+            const AknLayoutUtils::SAknLayoutControl& aLayout );
+        
+        static void LayoutCustomElement(
+            CTelBubbleCustomElement* aElement, 
+            const TRect& aParent, 
+            const TAknWindowLineLayout& aLayout); 
+        
+        /**
+        * Converts western number string to Arabic-Indic if needed.
+        * @since 2.0
+        * @param aResult Result buffer. aResult.MaxLength() must be greater 
+                                        or equal to aSource.Length().
+        * @param aSource Original string.
+        */
+        static void ConvertToArabicIndic( 
+            TDes& aResult , 
+            const TDesC& aSource );
+
+        /**
+        * Converts western number string to Arabic-Indic if needed.
+        * @since 2.0
+        * @param aDes Source and destination
+        */
+        static void ConvertToArabicIndic( TDes& aDes );
+
+        /**
+        * Converts western number string to Arabic-Indic if needed.
+        * @since 2.0
+        * @param aResult Original string.
+        * @return Result buffer. NULL in OOM case. Ownership transferred.
+        */
+        static HBufC* ConvertToArabicIndic( const TDesC& aDes );
+
+
+        /**
+        * Set call type pane
+        * @since 2.0
+        * @param aBubblePlace Bubble place from CBubblePlace.
+        * @param aParent Parent control
+        * @param aTypeIndication1 Left indicator.
+        * @param aTypeIndication2 Rigth indicator.
+        */
+        static void SetLayoutForCellTypePane( 
+            const CBubblePlace::TPhoneBubblePlace& aBubblePlace,
+            const TRect& aParent,
+            CEikImage* aTypeIndication1,
+            CEikImage* aTypeIndication2 );
+
+        /**
+        * Set cyphering off icon place
+        * @since 2.0
+        * @param aHeader Call information.
+        * @param aBubblePlace Bubble place from CBubblePlace.
+        * @param aParent Parent control
+        * @param aCyphOffImage The image.
+        */
+        static void SetLayoutFofCypheringOffIcon(
+            const CBubbleHeader& aHeader,
+            const CBubblePlace::TPhoneBubblePlace& aBubblePlace,
+            const TRect& aParent,
+            CEikImage* aCyphOffImage );
+
+        /**
+        * Places thumbnail image
+        * @param aBubblePlace Bubble place from CBubblePlace
+        * @param aImage The thumbnail image
+        * @param aClippingRect Clipping rectangle.
+        * @param aShadow Thumbnail shadow
+        * @param aParentRect Parent control.
+        */
+        static void PlaceThumbnail(
+            const CBubblePlace::TPhoneBubblePlace& aBubblePlace,
+            CEikImage* aImage , 
+            TBubbleLayoutRect& aShadow,
+            const TRect& aParentRect,
+            CFbsBitmap* aThumbNailBitmap );
+
+
+        /**
+        * 
+        * @param aParent Parent control.
+        * @param aWidth Width of the thumbnail image.
+        * @return ETrue if customized image, else EFalse.
+        */
+        static TBool IsCustomizedImage( const TRect& aParent, const TInt aWidth );
+
+        /**
+        * 
+        * @param aParent Parent control.
+        * @param aWidth Width of the thumbnail image.
+        * @return TInt Internal type of the image used.
+        */
+        static TInt GetThumbnailImageType( const TRect& aParent, const TInt aWidth );
+        /**
+        * @param aLabel Label control to be resized.
+        * @param aParent Parent control.
+        * @param aWidth Width of the thumbnail image.
+        */
+        static void LabelExtent( CEikLabel* aLabel, 
+                                 const TRect& aParent, 
+                                 const TInt aWidth );
+        
+        /**
+        * @param aFileName Icon file name.
+        */
+        static void BubbleIconFileName( TDes& aFileName );
+
+        /**
+        * @param aFileName Resource file name.
+        */
+        static void BubbleResourceFileName( TDes& aFileName );
+
+        /**
+        * Selects from longer text (format: "longone\tshort") which one to use
+        * @param aText String containing at least long version of the text
+        * @param aLabel Label which width has been set and the text will be 
+        *               clipped to.
+        * @param aClipDir Text's clipping direction
+        */
+        static void SetTextInLabel( 
+                     const TDesC16& aText, 
+                     CEikLabel& aLabel ,
+                     const CBubbleManager::TPhoneClippingDirection& aClipDir );
+                     
+        /**
+        * Sets given text to label - clips if needed.
+        * @param aText String containing the used text
+        * @param aLabel Label which width has been set and the text will be 
+        *               clipped to.
+        * @param aClipDir Text's clipping end
+        */
+        static void ClipToLabel ( 
+                    const TDesC16& aText, 
+                    CEikLabel& aLabel ,
+                    const CBubbleManager::TPhoneClippingDirection& aClipDir );
+
+        /**
+        * Tries to set text to label.
+        * @param aLabel Label to set the text to
+        * @param aText The text.
+        */                    
+        static void AddTextToEikLabel( CEikLabel& aLabel , const TDesC& aText);
+        
+        /**
+        * Creates bubble image from 9-pieceframe.
+        * @since 3.1
+        * @param aFrameID Skin id for frame.
+        * @param aOuterRect Outer rectangle.
+        * @param aInnerRect Inner rectangle.
+        * @param aBubble Bubble image.
+        */
+        static void PrepareBubbleImageL(
+            const TAknsItemID& aFrameID,
+            const TRect& aOuterRect,
+            const TRect& aInnerRect,    
+            CEikImage*& aBubble );
+            
+        /**
+        * Makes bubble image transparent based on given 
+        * 9-piece mask frame.
+        * @since 3.1
+        * @param aFrameID Skin id for frame.
+        * @param aOuterRect Outer rectangle.
+        * @param aInnerRect Inner rectangle.
+        * @param aBubble Bubble image.
+        */
+        static void AddTransparencyToBubbleImageL(
+            const TAknsItemID& aFrameID,
+            const TRect& aOuterRect,
+            const TRect& aInnerRect,    
+            CEikImage*& aBubble );
+            
+        /**
+        * Adds call object image to bubble image.
+        * @since 3.1
+        * @param aCOImage Image.
+        * @param aCOImageMask Image mask.
+        * @param aCallObjectRect Call object location in bubble.
+        * @param aFrameID Mask frame for image fading.
+        * @param aOuterRect Frame outer rectangle.
+        * @param aInnerRect Frame inner rectangle.
+        * @param aBubble Bubble image.
+        * @param aDimmed ETrue if image is shown dimmed.
+        */
+        static void PrepareCallObjectToBubbleImageL(
+            const CFbsBitmap* aCOImage,
+            const CFbsBitmap* aCOImageMask,
+            const TRect& aCallObjectRect,
+            const TAknsItemID& aFrameID,
+            const TRect& aOuterRect,
+            const TRect& aInnerRect,
+            CEikImage*& aBubble,
+            TBool aDimmed = EFalse );                                    
+
+        /**
+        * Fallback background drawing. This method can be used to draw background,
+        * if skin/bitmap graphichs cannot be used (e.g. due to OOM).
+        * @param aRect Rectangle.
+        */                    
+        static void DrawBackgroundRect( CBitmapContext& aGc,
+                                        const TRect& aRect );
+
+        /**
+        * Layouts call type indicators in call type pane.
+        * @since S60 3.2
+        * @param aParent Parent rectangle.
+        * @param aCallTypePane Call type pane.
+        * @param aTypeIndication1 First indicator.
+        * @param aTypeIndication2 Second indicator.
+        */                                        
+        static void LayoutCallTypeIndicators(
+            const TRect& aParent,
+            const TAknWindowLineLayout& aCallTypePane,
+            CEikImage* aTypeIndication1,
+            CEikImage* aTypeIndication2 );                                         
+        
+        
+        /**
+        * Prepares call image attached to call header to be
+        * ready for drawing.
+        * @since S60 3.2
+        * @param aHeader Call header.
+        * @param aSize Displayable size for call image.
+        */
+        static void PrepareCallObjectImageL( 
+            CBubbleHeader& aHeader, 
+            const TSize& aSize );
+            
+        /**
+        * Combines given masks to new mask bitmap.
+        * @since S60 5.0
+        * @param aPrimaryMask Mask treated as primary mask.
+        * @param aSecondaryMask Mask treated as secondary mask.
+        * @return The combined mask.
+        */
+        static CFbsBitmap* CreateCombinedMaskL(
+           const CFbsBitmap* aPrimaryMask,
+           const CFbsBitmap* aSecondaryMask );            
+
+    private:
+        static void DrawMaskedImage( CBitmapContext& aGc , CEikImage& aImage );
+
+
+};
+
+#endif //BUBBLEUTILS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMVideoController.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,213 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 player controller.
+*
+*/
+
+
+#ifndef C_BUBBLEVIDEOCONTROLLER_H
+#define C_BUBBLEVIDEOCONTROLLER_H
+
+#include "BMVideoPlayerObserver.h"
+#include "BMVideoPlaybackObserver.h"
+#include "BMBubbleManager.h"
+#include <AknsItemID.h>
+
+// FORWARD DECLARATIONS
+class CBubbleVideoPlayer;
+class CBubbleVideoContainer;
+
+/**
+ *  Video player controller.
+ *
+ *
+ *  @lib BubbleManager
+ *  @since S60 3.2
+ */
+class CBubbleVideoController : public CActive,
+                               private MBubbleVideoPlayerObserver
+    {
+public:
+    // State
+    enum TVideoControllerState
+        {
+        EIdle,
+        EReportingError,
+        EReportingEvent    
+        };
+
+public:
+    /**
+     * Two phased constructor.
+     *
+     * @since S60 3.2
+     * @param aBubbleManager Bubble manager reference.
+     */
+    static CBubbleVideoController* NewL( 
+        CBubbleManager& aBubbleManager );
+        
+    // Destructor
+    virtual ~CBubbleVideoController();
+
+    /**
+     * Sets playing parameters.
+     *
+     * @since S60 3.2
+     * @param aFileName Video clip to be played.
+     * @param aPlayMode Play mode.
+     * @param aVolumeLevel Volume level.
+     * @param aArbitraryScaling Set ETrue if free video scaling.
+     * @param aObserver Observer for playback events.
+     */
+    void PrepareToPlayVideo( 
+        const TDesC& aFileName,
+        CBubbleManager::TBubbleVideoPlayMode aPlayMode,
+        TInt aVolumeLevel,
+        TBool aArbitraryScaling,
+        MBubbleVideoPlaybackObserver* aObserver );
+
+    /**
+     * Starts video playing.
+     *
+     * @since S60 3.2
+     */
+    void CreatePlayerAndPlay();
+    
+    /**
+     * Stops video playing deletes player.
+     *
+     * @since S60 3.2
+     */
+    void StopAndDeletePlayer();
+    
+    /**
+     * Stops video playing.
+     *
+     * @since S60 3.2
+     */
+    void StopPlaying();
+    
+    /**
+     * Mutes video playing.
+     *
+     * @since S60 3.2
+     */
+    void MutePlaying();
+    
+    /**
+     * To be called when screen orientation changes.
+     *
+     * @since S60 3.2
+     */
+    void HandleLayoutChange();
+    
+    /**
+     * Set panes for qcif sized video. 
+     *
+     * @since S60 3.2
+     */
+    void SetQcifVideoPaneRects( const TRect& aVideoPane,
+                                const TRect& aUncropPane );
+                            
+    /**
+     * Set panes for subqcif sized video. 
+     *
+     * @since S60 3.2
+     */
+    void SetSubQcifVideoPaneRects( const TRect& aVideoPane,
+                                   const TRect& aUncropPane );                            
+                              
+    /**
+     * Set parameters needed to draw video pane.
+     *
+     * @since Series 60 3.2
+     * @param aFrameId Skin id of the frame.
+     * @param aOuterRect Outer frame rectangle.
+     * @param aInnerRect Inner frame rectangle.
+     */
+    void SetVideoPaneBackgroundFrame( const TAknsItemID& aFrameId,
+                                      const TRect& aOuterRect,
+                                      const TRect& aInnerRect );                                                             
+
+private: // From MBubbleVideoPlayerObserver
+    void HandleVideoPlayerError( 
+        TBubbleVideoPlayerErrorEvent aEvent,
+        TInt aError );
+    
+    void HandleVideoPlayerInitComplete();
+
+    void HandleVideoPlayerPlayingComplete(); 
+    
+    void HandleVideoPlayerBlittingAreaDefined( const TRect& aBlitRect );
+    
+private: // From CActive
+    void RunL();
+        
+    void DoCancel();
+    
+private:
+    void DoPlayL();
+    void ReportErrorAsync( 
+        MBubbleVideoPlaybackObserver::TBubbleVideoPlaybackError aErrorType,
+        TInt aErrorCode );
+    void ReportEventAsync( 
+        MBubbleVideoPlaybackObserver::TBubbleVideoPlaybackEvent aEvent);
+    void LayoutContainer();
+    void UpdateContainerBackground();
+    void Reset();
+    inline void EnableRedraws();
+    inline void DisableRedraws();
+    
+private:
+    CBubbleVideoController( 
+        CBubbleManager& aBubbleManager );
+
+    void ConstructL();
+
+private: // data
+    CBubbleManager& iBubbleManager;
+    
+    // Playback parameters
+    HBufC* iFileName; // Owned
+    CBubbleManager::TBubbleVideoPlayMode iPlayMode;
+    TInt iVolumeLevel;
+    TBool iArbitraryScaling;
+    MBubbleVideoPlaybackObserver* iObserver;
+        
+    // Player and ui controls
+    CBubbleVideoPlayer*    iPlayer; // Owned
+    CBubbleVideoContainer* iContainer; // Owned
+    TRect                  iUncropPane; // Video cropping
+
+    // Active object state
+    TVideoControllerState iState;
+    MBubbleVideoPlaybackObserver::TBubbleVideoPlaybackError iErrorType;
+    TInt iErrorCode;
+    MBubbleVideoPlaybackObserver::TBubbleVideoPlaybackEvent iEventCode;
+    
+    // Video layouts, set from video outlooks
+    TRect iVideoPaneRectQcif;
+    TRect iUncropPaneRectQcif;
+    TRect iVideoPaneRectSubQcif;
+    TRect iUncropPaneRectSubQcif;
+    
+    // Data for container window.
+    TAknsItemID iBgFrameId;
+    TRect iBgFrameOuterRect;
+    TRect iBgFrameInnerRect;
+    };
+
+#endif // C_BUBBLEVIDEOCONTROLLER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMVideoPlaybackObserver.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 playback observer interface
+*
+*/
+
+
+#ifndef M_BUBBLEVIDEOPLAYBACKOBSERVER_H
+#define M_BUBBLEVIDEOPLAYBACKOBSERVER_H
+
+
+/**
+ *  Video playback observer interface
+ *
+ *
+ *  @lib BubbleManager
+ *  @since S60 v3.2
+ */
+class MBubbleVideoPlaybackObserver
+    {
+public:
+
+    /**  Playback events */
+    enum TBubbleVideoPlaybackEvent
+        {
+        EPlayerInitComplete,
+        EPlaying,
+        EPlayingComplete    
+        };
+
+    /**  Playback error types */        
+    enum TBubbleVideoPlaybackError
+        {
+        EPlayerInitFailure,
+        EPlaybackFailure    
+        };        
+
+    /**
+     * HandleBubbleVideoPlaybackEvent
+     *
+     * @since S60 v3.2
+     * @param aEvent Playback event.
+     */
+    virtual void HandleBubbleVideoPlaybackEvent( 
+        TBubbleVideoPlaybackEvent aEvent ) = 0;        
+
+    /**
+     * HandleBubbleVideoPlaybackError
+     *
+     * @since S60 v3.2
+     * @param aErrorType Playback error type.
+     * @param aErrorCode System wide error code.
+     */            
+    virtual void HandleBubbleVideoPlaybackError(
+        TBubbleVideoPlaybackError aErrorType, TInt aErrorCode ) = 0;
+    };
+
+#endif // M_BUBBLEVIDEOPLAYBACKOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMVideoPlayer.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,303 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 player implementaion.
+*
+*/
+
+
+#ifndef C_BUBBLEVIDEOPLAYER_H
+#define C_BUBBLEVIDEOPLAYER_H
+
+#include <videoplayer.h>
+
+// FORWARD DECLARATIONS
+class MBubbleVideoPlayerObserver;
+
+/**
+ *  Video ringing tone player
+ *
+ *  Uses CVideoPlayerUtility to play video clips.
+ *
+ *  @lib BubbleManager.lib
+ *  @since S60 v3.2
+ */
+class CBubbleVideoPlayer : public CBase,
+                           public MVideoPlayerUtilityObserver
+    {
+    public:
+        enum TVideoPlayerState // from MMF-VideoPlayer IF spec.
+            {
+            EVideoError = -1,
+            EVideoClosed,
+            EVideoOpening,
+            EVideoOpen,
+            EVideoPreparing,
+            EVideoReady, // player's stopped state
+            EVideoPlaying,
+            EVideoPaused
+            };
+
+        enum TRingingType
+            {
+            ETypeRinging,
+            ETypeRingingOnce,
+            ETypeAscending
+            };
+
+        enum TVideoResolution
+            {
+            EVideoOther = -1,
+            EVideoQCIF,
+            EVideoSubQCIF
+            };
+
+    public:  // Constructor and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aRingingTone The ringing tone
+        * @param aPriority The priority for the playing
+        * @param aPreference The preference value
+        * @param aObserver Video player observer
+        * @param aVideo Window for video
+        * @return The instance of the video player.
+        */
+        static CBubbleVideoPlayer* NewL( 
+            const TDesC& aRingingTone, 
+            TInt aPriority, 
+            TUint aPreference,
+            MBubbleVideoPlayerObserver& aObserver, 
+            RWindow& aVideoTarget );
+
+        /**
+        * Two-phased constructor (non leaving).
+        * @param aFileName The ringing tone
+        * @param aPriority The priority for the playing
+        * @param aPreference The preference value
+        * @param aObserver Video player observer
+        * @param aVideo Window for video
+        * @return The instance of the video player. NULL is
+        *         returned if creation failed.
+        */
+        static CBubbleVideoPlayer* New( 
+            const TDesC& aRingingTone, 
+            TInt aPriority, 
+            TUint aPreference,
+            MBubbleVideoPlayerObserver& aObserver, 
+            RWindow& aVideoTarget );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CBubbleVideoPlayer();
+
+    public:
+        /**
+        * Plays the loaded video.
+        * @since Series 60 v3.2
+        * @param aRingingType Ringing type.
+        * @param aVolume take value from 1 to 10
+        */
+        void Play( TRingingType aRingType, TInt aVolume );
+
+        /**
+        * Stops video playback.
+        * @since Series 60 v3.2
+        */
+        void StopPlaying();
+        
+        /**
+        * Pauses video playback.
+        * @since Series 60 v3.2
+        * @return KErrNone is successful.
+        */
+        TInt PausePlaying();
+        
+        /**
+        * Resumes video playback.
+        * @since Series 60 v3.2
+        */
+        void ResumePlaying();
+        
+        /**
+        * Make video to play silent.
+        * @since Series 60 v3.2
+        */
+        void MuteAudio();
+
+        /**
+        * Get the state of the phone video player.
+        * @since Series 60 v3.2
+        * @return The status of video player
+        */
+        TVideoPlayerState State() const;
+
+        /**
+        * Get the resolution of the loaded video.
+        * @since Series 60 v3.2
+        * @return The resolution.
+        */
+        TVideoResolution VideoResolution() const;
+
+        /**
+        * Scales and crops video to cover target window.
+        * @since Series 60 v3.2
+        * @param aDisplayWindow Window for video.
+        * @param aUncropPane Rectangle for cropping control.
+        * @param aArbitaryScalingSupported Scaling capability of the device.
+        */
+        void AdjustToWindow( RWindow& aDisplayWindow,
+                             const TRect& aUncropPane,
+                             TBool aArbitaryScalingSupported = EFalse );
+        
+        /**
+        * Scales and crops video to cover target window. This method
+        * doens't use uncrop pane and crops video only when needed.
+        * Allowed cropping can be set via KPhoneMaxVideoCrop.
+        * Cropped video is centered to video pane.
+        * This metdod should be used only when video player supports
+        * arbitrary scaling of video image.
+        * @since Series 60 v3.2
+        * @param aDisplayWindow Window for video playback.
+        */
+        void AdjustToWindow2( RWindow& aDisplayWindow );                             
+
+    private: // Functions from MVideoPlayerUtilityObserver
+        /** 
+        * MvpuoOpenComplete
+        */
+        void MvpuoOpenComplete( TInt aError );
+
+        /** 
+        * MvpuoPrepareComplete
+        */
+        void MvpuoPrepareComplete( TInt aError );
+
+        /** 
+        * MvpuoFrameReady
+        */
+        void MvpuoFrameReady( CFbsBitmap& aFrame ,TInt aError );
+
+        /** 
+        * MvpuoPlayComplete
+        */
+        void MvpuoPlayComplete( TInt aError );
+        
+        /** 
+        * MvpuoEvent
+        */
+        void MvpuoEvent( const TMMFEvent& aEvent );
+    
+    private: // Constructors
+
+        /**
+        * C++ default constructor.
+        */
+        CBubbleVideoPlayer();
+        
+        /**
+        * C++ constructor.
+        */
+        CBubbleVideoPlayer( MBubbleVideoPlayerObserver& aObserver );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL( const TDesC& aFileName, 
+                         TInt aPriority, 
+                         TUint aPreference,
+                         RWindow& aVideoTarget );
+
+    private:
+        /**
+        * SetRingingType
+        */
+        void SetRingingType( TRingingType aRingingType );
+
+        /**
+        * SetVolume
+        */
+        void SetVolume( TInt aVolume );
+
+        /**
+        * VolumeRampTimerCallback
+        */
+        static TInt VolumeRampTimerCallback( TAny* aObj );
+
+        /**
+        * DoVolumeRamp
+        */
+        TInt DoVolumeRamp();
+        
+        /**
+        * RepeatsTrailPauseTimerCallback
+        */
+        static TInt RepeatsTrailPauseTimerCallback( TAny* aObj );
+        
+        /**
+        * DoRingingRepeat
+        */
+        TInt DoRingingRepeat();
+        
+        /**
+        * Frame size
+        */
+        TSize VideoFrameSize() const;
+        
+        /**
+        * Calculates size for video player screen rectangle based on
+        * canvas and video dimensions.   
+        */
+        static TSize CalculateScreenRectSize( 
+            const TSize& aCanvasSize,
+            const TSize& aVideoFrameSize,
+            TBool aArbitraryScalingSupported );
+            
+        /**
+        * Calculates aClipSize and aScreenSize based on aWindowSize
+        * and aVideoFrameSize. aScreenSize is set to maximum without
+        * exceeding the crop limit (KPhoneMaxVideoCrop). aClipSize 
+        * is set match to scaled video image to prevent black stripes
+        * around video.   
+        */
+        static void CalculateClipAndScreenRectSize( 
+            const TSize& aWindowSize,
+            const TSize& aVideoFrameSize,
+            TSize& aClipSize,
+            TSize& aScreenSize );            
+
+    private: //Data
+
+        MBubbleVideoPlayerObserver&  iObserver;
+        CVideoPlayerUtility*         iVideoPlayer; // Owned
+        TVideoPlayerState            iPlayerState;
+        TBool                        iToBePlayed;
+
+        // Ringing properties
+        TInt                         iVolume;
+        TRingingType                 iRingingType;
+
+        // Ascending volume
+        TInt                         iRampedVolume;
+        CPeriodic*                   iVolumeRampTimer; // Owned
+        
+        // Pause between repeats
+        CPeriodic*                   iRepeatsTrailPauseTimer; // Owned
+        
+        // Ringing tone
+        RFile                        iFileHandle;
+        
+    };
+    
+#endif // C_BUBBLEVIDEOPLAYER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BMVideoPlayerObserver.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Video player observer interface.
+*
+*/
+
+
+#ifndef M_BUBBLEVIDEOPLAYEROBSERVER_H
+#define M_BUBBLEVIDEOPLAYEROBSERVER_H
+
+/**
+ *  Video player observer interface.
+ *
+ *
+ *  @lib BubbleManager
+ *  @since S60 v3.2
+ */
+class MBubbleVideoPlayerObserver  
+    {
+    public:
+        // Enumerates different failure events.
+        //
+        enum TBubbleVideoPlayerErrorEvent
+            {
+            EVideoPlayerInitializingFailure, // Failure during initialization
+            EVideoPlayerPlayingFailure // Failure during playback
+            };
+        
+        /**
+        * This method is called when playing error occurs.
+        *
+        * @since S60 v3.2
+        * @param aEvent Error event.
+        * @param aError Error code.
+        */
+        virtual void HandleVideoPlayerError( 
+            TBubbleVideoPlayerErrorEvent aEvent,
+            TInt aError ) = 0;
+
+        /**
+        * This method is called when player initialization is complete.
+        *
+        * @since S60 v3.2
+        */
+        virtual void HandleVideoPlayerInitComplete() = 0;
+
+        /**
+        * This method is called when video clip has played to end.
+        *
+        * @since S60 v3.2
+        */
+        virtual void HandleVideoPlayerPlayingComplete() = 0;
+        
+        /**
+        * This method is called when player knows exact blitting
+        * area, the screen area that will be covered by video image.
+        * Observer may relayout the container window accordingly.
+        *
+        * @since S60 v3.2
+        * @param aBlitRect Blit rectangle relative to screen.
+        */
+        virtual void HandleVideoPlayerBlittingAreaDefined( 
+            const TRect& aBlitRect ) = 0;
+    };
+
+#endif // M_BUBBLEVIDEOPLAYEROBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Inc/BubbleManagerPaths.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 path defines for BubbleManager.
+*
+*/
+
+
+#ifndef BUBBLEMANAGER_HRH
+#define BUBBLEMANAGER_HRH
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <data_caging_path_literals.hrh>
+
+
+// CONSTANTS 
+
+_LIT( KBMMbmZDrive, "z:" );
+_LIT( KBMMbmCDrive, "c:" );
+_LIT( KBMBitmapFile,            "bubblemanager.mbm" );
+_LIT( KBMCallStatusBitmapFile,  "callstatus.mbm" );
+_LIT( KBMResourcesFile,         "BubbleManager.rsc" );
+
+#endif  // BUBBLEMANAGER_HRH
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleHeader.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,760 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleHeader.h"
+#include    "BMPanic.h"
+
+#include    <AknsUtils.h>
+
+// CONSTANTS
+const TUint8 KBubbleHeaderIsInConf = 0x01;          // 1 if is in conf
+const TUint8 KBubbleHeaderCLIClipDirLeft = 0x02;    // 1 if clipped from left
+const TUint8 KBubbleHeaderLabelClipDirLeft = 0x04;
+const TUint8 KBubbleHeaderCNAPClipDirLeft = 0x08;    // 1 if clipped from left
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// Constructor
+CBubbleHeader::CBubbleHeader( )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::ConstructL
+// Symbian OS two phased constructor called by inherited classes
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleHeader::ConstructL( const CBubbleManager::TBubbleId& aBubbleId )
+    {
+    iBubbleId = aBubbleId;
+    }
+
+// Destructor
+CBubbleHeader::~CBubbleHeader()
+    {
+    delete iThumbnailIconBitmap;
+    if ( iCOImageDataOwnership & EBubbleThumbnailImageOwned )
+        {
+        delete iThumbnailBitmap;
+        delete iThumbnailBitmapMask;
+        }
+        
+    if ( iCOImageDataOwnership & EBubbleCallImageOwned )
+        {
+        delete iCOImageBitmap;
+        delete iCOImageBitmapMask;
+        }
+    delete iText;
+    delete iCOFileName;
+    delete iCOText;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SetIsInConference
+// ---------------------------------------------------------------------------
+//
+void CBubbleHeader::SetIsInConference( const TBool& aIsInConference )
+    {
+    // can't put conference in conference
+    if ( IsConference( ) )
+        {
+        __ASSERT_ALWAYS( !aIsInConference, 
+                         Panic( EBMPanicReferredHeaderIsConferenceHeader ) );
+        }
+    
+    if ( aIsInConference )
+        {
+        iInternalFlags |= iInternalFlags|KBubbleHeaderIsInConf;
+        return;
+        }
+
+    iInternalFlags &= iInternalFlags&~KBubbleHeaderIsInConf;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SetTnBitmap
+// ---------------------------------------------------------------------------
+//
+void CBubbleHeader::SetTnBitmap( CFbsBitmap* aThumbnailBitmap )
+    {
+    // can't set thumbnail for conference call
+    if ( IsConference( ) )
+        {
+        __ASSERT_DEBUG( aThumbnailBitmap == NULL, 
+                        Panic( EBMPanicReferredHeaderIsConferenceHeader ) );
+        }
+    
+    if ( iCOImageDataOwnership & EBubbleThumbnailImageOwned )
+        {
+        delete iThumbnailBitmap;
+            
+        }
+    iThumbnailBitmap = aThumbnailBitmap;
+    if ( aThumbnailBitmap != NULL &&
+         !(iCOImageDataOwnership & EBubbleThumbnailImageOwned ) )
+        {
+        CFbsBitmap* bitmap = new CFbsBitmap;
+        if ( bitmap != NULL )
+           {
+           bitmap->Duplicate( aThumbnailBitmap->Handle() );
+           delete iThumbnailIconBitmap;
+           iThumbnailIconBitmap = NULL;
+           TRAP_IGNORE( 
+               iThumbnailIconBitmap = AknIconUtils::CreateIconL( bitmap ));
+           }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SetTnBitmapMask
+// ---------------------------------------------------------------------------
+//
+void CBubbleHeader::SetTnBitmapMask( CFbsBitmap* aThumbnailBitmapMask )
+    {
+    // can't set thumbnail for conference call
+    if ( IsConference( ) )
+        {
+        __ASSERT_DEBUG( aThumbnailBitmapMask == NULL, 
+                        Panic( EBMPanicReferredHeaderIsConferenceHeader ) );
+        }
+    
+    if ( iCOImageDataOwnership & EBubbleThumbnailImageOwned )
+        {
+        delete iThumbnailBitmapMask;
+            
+        }
+    iThumbnailBitmapMask = aThumbnailBitmapMask;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SetTnDataOwnership
+// ---------------------------------------------------------------------------
+//    
+void CBubbleHeader::SetTnDataOwnership( TBool aOwnership )
+    {
+    if ( aOwnership )
+        {
+        iCOImageDataOwnership |= EBubbleThumbnailImageOwned; 
+        }
+    else
+        {
+        iCOImageDataOwnership &= ~EBubbleThumbnailImageOwned;     
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SetCallObjectImage
+// ---------------------------------------------------------------------------
+//    
+void CBubbleHeader::SetCallObjectImage( CFbsBitmap* aCOImageBitmap )
+    {
+    if ( iCOImageDataOwnership & EBubbleCallImageOwned )
+        {
+        delete iCOImageBitmap;    
+        }
+
+    iCOImageBitmap = aCOImageBitmap;
+    }
+    
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SetCallObjectImageMask
+// ---------------------------------------------------------------------------
+//    
+void CBubbleHeader::SetCallObjectImageMask( CFbsBitmap* aCOImageBitmapMask )
+    {
+    if ( iCOImageDataOwnership & EBubbleCallImageOwned )
+        {
+        delete iCOImageBitmapMask;    
+        }        
+        
+    iCOImageBitmapMask = aCOImageBitmapMask;            
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SetCallObjectFileName
+// ---------------------------------------------------------------------------
+//
+void CBubbleHeader::SetCallObjectFileName( const HBufC* aCOFileName )
+    {
+    delete iCOFileName;    
+    iCOFileName = aCOFileName;                
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SetCallObjectText
+// ---------------------------------------------------------------------------
+//    
+void CBubbleHeader::SetCallObjectText( const HBufC* aCOText )
+    {
+    // can't set text for conference call
+    if ( IsConference( ) )
+        {
+        __ASSERT_DEBUG( aCOText == NULL, 
+                        Panic( EBMPanicReferredHeaderIsConferenceHeader ) );
+        }
+    
+    delete iCOText;    
+    iCOText = aCOText;            
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SetCallObjectImageDataOwnership
+// ---------------------------------------------------------------------------
+//    
+void CBubbleHeader::SetCallObjectImageDataOwnership( TBool aOwnership )        
+    {
+    if ( aOwnership )
+        {
+        iCOImageDataOwnership |= EBubbleCallImageOwned;
+        }
+    else
+        {
+        iCOImageDataOwnership &= ~EBubbleCallImageOwned;     
+        }    
+    }
+    
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SetCallObjectImageType()
+// ---------------------------------------------------------------------------
+//
+void CBubbleHeader::SetCallObjectImageType( TBMCallObjectImageType aType ) 
+    {
+    iCOImageType = aType;    
+    }    
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SwitchToThumbnailImage
+// ---------------------------------------------------------------------------
+//    
+void CBubbleHeader::SwitchToThumbnailImage()
+    {
+    if ( iThumbnailBitmap )
+        {
+        // Release big image
+        if ( iCOImageDataOwnership & EBubbleCallImageOwned )
+            {
+            delete iCOImageBitmap;
+            delete iCOImageBitmapMask;        
+            }
+        
+        // Switch bitmaps
+        iCOImageBitmap = iThumbnailBitmap;
+        iThumbnailBitmap = NULL;
+        iCOImageBitmapMask = iThumbnailBitmapMask;
+        iThumbnailBitmapMask = NULL;
+        
+        // Update ownerships
+        if ( iCOImageDataOwnership & EBubbleThumbnailImageOwned )
+            {
+            iCOImageDataOwnership |= EBubbleCallImageOwned;    
+            }
+        else
+            {
+            iCOImageDataOwnership &= ~EBubbleCallImageOwned;    
+            }            
+        iCOImageDataOwnership &= ~EBubbleThumbnailImageOwned;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SetCallState
+// ---------------------------------------------------------------------------
+//
+void CBubbleHeader::SetCallState( 
+                      const CBubbleManager::TPhoneCallState& aPhoneCallState )
+    {
+    // can't set conference to incoming, outgoing or waiting state
+    if ( IsConference( ) )
+        {
+        __ASSERT_ALWAYS( aPhoneCallState!=CBubbleManager::EWaiting &&
+            aPhoneCallState!=CBubbleManager::EIncoming &&
+            aPhoneCallState!=CBubbleManager::EAlerting &&
+            aPhoneCallState!=CBubbleManager::EOutgoing,
+            Panic( EBMPanicReferredHeaderIsConferenceHeader ) );
+        }
+    
+    // if state is changed to disconnected, previous stage must be checked
+    // to get the correct disconnect mode.
+    if ( aPhoneCallState == CBubbleManager::EDisconnected )
+        {
+        if ( iPhoneCallState == CBubbleManager::EWaiting ||
+            iPhoneCallState == CBubbleManager::EIncoming ||
+            iPhoneCallState == CBubbleManager::EAlerting ||
+            iPhoneCallState == CBubbleManager::EOutgoing ||
+            iPhoneCallState == CBubbleManager::EAlertToDisconnected )
+            {
+            // changes the bubbles to be rectangles
+            if ( aPhoneCallState != iPhoneCallState )
+                {
+                iPreviousCallState = iPhoneCallState;
+                }
+            iPhoneCallState = CBubbleManager::EAlertToDisconnected;
+            return;
+            }
+        }
+    // else put normal disconnected or what ever the new state is
+    if ( aPhoneCallState != iPhoneCallState )
+        {
+        iPreviousCallState = iPhoneCallState;
+        }
+    iPhoneCallState = aPhoneCallState;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SetNumberType
+// ---------------------------------------------------------------------------
+//
+void CBubbleHeader::SetNumberType( 
+    const CBubbleManager::TPhoneNumberType& aNumberType )
+    {
+    // can't set the number type else than ENotSet for conference
+    if ( IsConference( ) )
+        {
+        __ASSERT_DEBUG( aNumberType==CBubbleManager::ENotSet, 
+                        Panic( EBMPanicReferredHeaderIsConferenceHeader ) );
+        }
+    
+    iNumberType = aNumberType;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SetCallFlags 
+// ---------------------------------------------------------------------------
+//
+void CBubbleHeader::SetCallFlags( const TUint32& aCallFlags ) 
+    {
+    iCallFlags = aCallFlags;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SetCallFlag
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleHeader::SetCallFlag( 
+    const CBubbleManager::TPhoneCallTypeFlags& aFlag )
+    {
+    if ( aFlag == CBubbleManager::ENormal )
+        {
+        iCallFlags = 0;
+        return;
+        }
+    
+    iCallFlags |= aFlag;    
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::RemoveCallFlag
+// ---------------------------------------------------------------------------
+//
+void CBubbleHeader::RemoveCallFlag( 
+    const CBubbleManager::TPhoneCallTypeFlags& aFlag )
+    {
+    if ( aFlag == CBubbleManager::ENormal )
+        {
+        return;
+        }
+    iCallFlags &= ~aFlag;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SetBubbleId
+// ---------------------------------------------------------------------------
+//
+void CBubbleHeader::SetBubbleId( const CBubbleManager::TBubbleId& aBubbleId )
+    {
+    iBubbleId = aBubbleId;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SetText
+// ---------------------------------------------------------------------------
+//
+void CBubbleHeader::SetText(
+    const TDesC16& aText,
+    const CBubbleManager::TPhoneClippingDirection& aClipDirection )
+    {
+    if ( iText )
+        {
+        delete iText;
+        iText = NULL;
+        }
+
+    iText = aText.Alloc();
+
+    if ( aClipDirection == CBubbleManager::ELeft )
+        {
+        iInternalFlags |= iInternalFlags|KBubbleHeaderLabelClipDirLeft;
+        return;
+        }
+    iInternalFlags &= iInternalFlags&~KBubbleHeaderLabelClipDirLeft;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SetCLI
+// ---------------------------------------------------------------------------
+//
+void CBubbleHeader::SetCLI( 
+    const CBubbleManager::TBubbleLabelString& aCLI, 
+    const CBubbleManager::TPhoneClippingDirection& aClipDirection )
+    {
+    iCLI = aCLI;
+
+    if ( aClipDirection == CBubbleManager::ELeft )
+        {
+        iInternalFlags |= iInternalFlags|KBubbleHeaderCLIClipDirLeft;
+        return;
+        }
+    iInternalFlags &= iInternalFlags&~KBubbleHeaderCLIClipDirLeft;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SetTimerCost
+// ---------------------------------------------------------------------------
+//
+void CBubbleHeader::SetTimerCost( 
+    const CBubbleManager::TBubbleLabelString& aTimerCost )
+    {
+    iTimerCost = aTimerCost;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SetCNAP
+// ---------------------------------------------------------------------------
+//
+void CBubbleHeader::SetCNAP( 
+    const CBubbleManager::TBubbleLabelString& aCNAP, 
+    const CBubbleManager::TPhoneClippingDirection& aClipDirection )
+    {
+    iCNAP = aCNAP;
+
+    if ( aClipDirection == CBubbleManager::ELeft )
+        {
+        iInternalFlags |= iInternalFlags|KBubbleHeaderCNAPClipDirLeft;
+        return;
+        }
+    iInternalFlags &= iInternalFlags&~KBubbleHeaderCNAPClipDirLeft;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::SetParticipantListCLI
+// ---------------------------------------------------------------------------
+//    
+void CBubbleHeader::SetParticipantListCLI( 
+    CBubbleManager::TBubbleParticipantListCLI aParticipantCLI )
+    {
+    iParticipantCLI = aParticipantCLI;    
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::IsInConference 
+// ---------------------------------------------------------------------------
+//
+TBool CBubbleHeader::IsInConference( ) const
+    {
+    if ( iInternalFlags&KBubbleHeaderIsInConf )
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::TnIconBitmap
+// ---------------------------------------------------------------------------
+//
+CFbsBitmap* CBubbleHeader::TnIconBitmap( ) const
+    {
+    return iThumbnailIconBitmap;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::TnBitmap
+// ---------------------------------------------------------------------------
+//
+CFbsBitmap* CBubbleHeader::TnBitmap( ) const
+    {
+    return iThumbnailBitmap;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::TnBitmapMask 
+// ---------------------------------------------------------------------------
+//
+CFbsBitmap* CBubbleHeader::TnBitmapMask( ) const
+    {
+    return iThumbnailBitmapMask;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::CallObjectImage
+// ---------------------------------------------------------------------------
+//
+CFbsBitmap* CBubbleHeader::CallObjectImage( ) const
+    {
+    return iCOImageBitmap;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::CallObjectImageMask 
+// ---------------------------------------------------------------------------
+//
+CFbsBitmap* CBubbleHeader::CallObjectImageMask( ) const
+    {
+    return iCOImageBitmapMask;
+    }
+    
+// ---------------------------------------------------------------------------
+// CBubbleHeader::CallObjectFileName 
+// ---------------------------------------------------------------------------
+//
+const TDesC& CBubbleHeader::CallObjectFileName( ) const
+    {
+    if ( iCOFileName && iCOFileName->Length() )
+        {
+        return *iCOFileName;    
+        }
+    else
+        {
+        return KNullDesC;    
+        }    
+    }    
+    
+// ---------------------------------------------------------------------------
+// CBubbleHeader::CallObjectText 
+// ---------------------------------------------------------------------------
+//
+const TDesC& CBubbleHeader::CallObjectText( ) const
+    {
+    if ( iCOText && iCOText->Length() )
+        {
+        return *iCOText;    
+        }
+    else
+        {
+        return KNullDesC;    
+        }
+    }    
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::CallObjectImageType()
+// ---------------------------------------------------------------------------
+//
+CBubbleHeader::TBMCallObjectImageType CBubbleHeader::CallObjectImageType()
+    const
+    {
+    return iCOImageType;    
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::CallState 
+// ---------------------------------------------------------------------------
+//
+CBubbleManager::TPhoneCallState CBubbleHeader::CallState( ) const
+    {
+    return iPhoneCallState;
+    }
+    
+// ---------------------------------------------------------------------------
+// CBubbleHeader::PreviousCallState 
+// ---------------------------------------------------------------------------
+//
+CBubbleManager::TPhoneCallState CBubbleHeader::PreviousCallState( ) const
+    {
+    return iPreviousCallState;
+    }    
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::NumberType 
+// ---------------------------------------------------------------------------
+//
+CBubbleManager::TPhoneNumberType CBubbleHeader::NumberType( ) const
+    {
+    return iNumberType;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::CallFlags
+// ---------------------------------------------------------------------------
+//
+TUint32 CBubbleHeader::CallFlags( ) const    
+    {
+    return iCallFlags;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::Text 
+// ---------------------------------------------------------------------------
+//
+const TDesC16& CBubbleHeader::Text() const
+    {
+    if ( iText )
+        {
+        return *iText;        
+        }
+    
+    return KNullDesC;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::TextClipDirection 
+// ---------------------------------------------------------------------------
+//
+CBubbleManager::TPhoneClippingDirection 
+    CBubbleHeader::TextClipDirection( ) const
+    {
+    if ( iInternalFlags&KBubbleHeaderLabelClipDirLeft )
+        {
+        return CBubbleManager::ELeft;
+        }
+    return CBubbleManager::ERight;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::CLI 
+// ---------------------------------------------------------------------------
+//
+const CBubbleManager::TBubbleLabelString& CBubbleHeader::CLI() const
+    {
+    return iCLI;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::CLIClipDirection  
+// ---------------------------------------------------------------------------
+//
+CBubbleManager::TPhoneClippingDirection 
+    CBubbleHeader::CLIClipDirection( ) const
+    {
+    if ( iInternalFlags&KBubbleHeaderCLIClipDirLeft )
+        {
+        return CBubbleManager::ELeft;
+        }
+    return CBubbleManager::ERight;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::TimerCost 
+// ---------------------------------------------------------------------------
+//
+const CBubbleManager::TBubbleLabelString& CBubbleHeader::TimerCost() const
+    {
+    return iTimerCost;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::CNAP 
+// ---------------------------------------------------------------------------
+//
+const CBubbleManager::TBubbleLabelString& CBubbleHeader::CNAP() const
+    {
+    return iCNAP;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::CNAPClipDirection  
+// ---------------------------------------------------------------------------
+//
+CBubbleManager::TPhoneClippingDirection 
+    CBubbleHeader::CNAPClipDirection( ) const
+    {
+    if ( iInternalFlags&KBubbleHeaderCNAPClipDirLeft )
+        {
+        return CBubbleManager::ELeft;
+        }
+    return CBubbleManager::ERight;
+    }
+// ---------------------------------------------------------------------------
+// CBubbleHeader::BubbleId 
+// ---------------------------------------------------------------------------
+//
+CBubbleManager::TBubbleId CBubbleHeader::BubbleId() const
+    {
+    return iBubbleId;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::ParticipantListCLI 
+// ---------------------------------------------------------------------------
+//    
+CBubbleManager::TBubbleParticipantListCLI 
+    CBubbleHeader::ParticipantListCLI() const
+    {
+    return iParticipantCLI;    
+    }    
+
+
+// ---------------------------------------------------------------------------
+// CBubbleHeader::ResetParent
+//
+//  Puts everything in initial state
+// ---------------------------------------------------------------------------
+//
+void CBubbleHeader::ResetParent()
+    {
+    iPhoneCallState = CBubbleManager::ENone;
+    iNumberType = CBubbleManager::ENotSet;
+    iCallFlags = 0; //normal
+    delete iThumbnailIconBitmap;
+    iThumbnailIconBitmap = NULL;
+    
+    if ( iCOImageDataOwnership & EBubbleThumbnailImageOwned )
+        {
+        delete iThumbnailBitmap;    
+        delete iThumbnailBitmapMask;
+        }
+    
+    iThumbnailBitmap = NULL;
+    iThumbnailBitmapMask = NULL;
+
+    if ( iCOImageDataOwnership & EBubbleCallImageOwned )
+        {
+        delete iCOImageBitmap;
+        delete iCOImageBitmapMask;            
+        }
+        
+    iCOImageBitmap = NULL;
+    iCOImageBitmapMask = NULL;
+    delete iCOText; 
+    iCOText = NULL;
+    delete iCOFileName;
+    iCOFileName = NULL;
+    
+    iCOImageDataOwnership = 0;
+    iCOImageType = ENotDefined;
+
+    if ( iText )
+        {
+        delete iText;
+        iText = NULL;
+        }
+    
+    iCLI.Zero();
+    iTimerCost.Zero();
+    iCNAP.Zero();
+    iInternalFlags = 0; //normal
+    iParticipantCLI = CBubbleManager::EParticipantListCLIText;
+    }
+
+// End of Fíle
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleImage.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,93 @@
+/*
+* 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:  CEikImage wrapper.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleImage.h"  //definition
+#include    <AknsUtils.h>
+#include    <AknIconUtils.h>
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CBubbleImage::CBubbleImage
+// ---------------------------------------------------------------------------
+//
+CBubbleImage::CBubbleImage()
+: iIsBackgroundImage ( EFalse )
+    {
+    }
+
+// Destructor
+CBubbleImage::~CBubbleImage()
+    {
+    AknsUtils::DeregisterControlPosition( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleImage::SetAsBackgroundImage
+// Set the image as background image
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleImage::SetAsBackgroundImage( TBool aIsBackground )
+    {
+    iIsBackgroundImage = aIsBackground;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleImage::SizeChanged
+// called by framework when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleImage::SizeChanged()
+    { 
+    AknsUtils::RegisterControlPosition( this );
+
+    if ( this->Bitmap() )
+        {
+        if ( iIsBackgroundImage )
+            {
+            // For background call bubble graphic, 
+            // aspect ratio can not be preserved.
+            AknIconUtils::SetSize( 
+                const_cast<CFbsBitmap*> ( this->Bitmap() ), 
+                Rect().Size(), EAspectRatioNotPreserved );
+            }
+        else
+            {
+            AknIconUtils::SetSize( 
+                const_cast<CFbsBitmap*> ( this->Bitmap() ), 
+                Rect().Size() );
+            }
+        }
+
+    CEikImage::SizeChanged();
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleImage::PositionChanged
+// ---------------------------------------------------------------------------
+//
+void CBubbleImage::PositionChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    CEikImage::PositionChanged();
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleImageManager.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,776 @@
+/*
+* 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:  Image Manager
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleImageManager.h"
+#include    "BMBubbleSkinBitmap.h"
+#include    "BubbleManagerPaths.h"
+#include    "BMPanic.h"
+#include    "BMUtils.h"
+#include    "BMLayout.h"
+#include    "BMBubbleIconIndex.h"
+
+#include    <eikimage.h> 
+#include    <AknsUtils.h>
+#include    <aknconsts.h>
+#include    <AknIconUtils.h>
+
+// CONSTANTS
+// 1-piece backgrounds
+const TInt KBMLastCachedBitmap1 = EQgn_graf_call_first_one_disconn_mask;
+// 9-piece backgrounds
+const TInt KBMLastCachedBitmap2 = EQgn_indi_call_voip_disconn_mask; 
+const TInt KBMLastAvkonBitmap = EQgn_prop_nrtyp_assistant_mask; 
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CBubbleImageManager::CBubbleImageManager()
+// Default constructor
+// 
+// ---------------------------------------------------------------------------
+//
+CBubbleImageManager::CBubbleImageManager( TBool aFrameIcons ) : 
+    iOrder( CompareSkinnedData ), iFrameIcons( aFrameIcons )
+    {    
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleImageManager::NewL
+// Symbian OS two phased constructor
+// 
+// ---------------------------------------------------------------------------
+//
+CBubbleImageManager* CBubbleImageManager::NewL( TBool aFrameIcons )
+    {
+    CBubbleImageManager* self = new( ELeave ) CBubbleImageManager( 
+        aFrameIcons );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();    // self
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleImageManager::ConstructL
+// Symbian OS two phased constructor
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleImageManager::ConstructL()
+    {
+    LoadCachedBitmapsL();
+    
+    iBitmapInitializer = CIdle::NewL( CActive::EPriorityIdle );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleImageManager::~CBubbleImageManager()
+// Destructor
+// 
+// ---------------------------------------------------------------------------
+//
+CBubbleImageManager::~CBubbleImageManager()
+    {
+    iSkinnedBitmaps.ResetAndDestroy();
+    
+    if ( iBitmapInitializer ) 
+        {
+        iBitmapInitializer->Cancel();                
+        }
+    delete iBitmapInitializer;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleImageManager::SetBitmapToImage
+// ---------------------------------------------------------------------------
+//
+void CBubbleImageManager::SetBitmapToImage( CEikImage*& aImage , 
+                                            const TBMIcons& aPicture )
+    {
+    // Check the paramater is valid.
+    if ( aImage == NULL )
+        {
+        return;
+        }
+    SetBitmapToImage( *aImage , aPicture, (TBMIcons) KErrNotFound );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleImageManager::SetBitmapToImage
+// ---------------------------------------------------------------------------
+//
+void CBubbleImageManager::SetBitmapToImage( CEikImage*& aImage , 
+                                            const TBMIcons& aPicture, 
+                                            const TBMIcons& aPictureMask 
+                                           )
+    {
+    // Check that paramaters are valid and bitmaps exist.
+    if ( aImage == NULL )
+        {
+        return;
+        }
+    SetBitmapToImage( *aImage , aPicture, aPictureMask );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleImageManager::SetBitmapToImage
+// ---------------------------------------------------------------------------
+//
+void CBubbleImageManager::SetBitmapToImage( CEikImage& aImage , 
+                                            const TBMIcons& aPicture, 
+                                            const TBMIcons& aPictureMask 
+                                           ) 
+    {
+    // Check parameter range and load the bitmaps.
+    if ( !GetSkin( aImage, aPicture, aPictureMask ) )
+        {
+        // Failed, make image not visible
+        aImage.SetPicture( NULL , NULL );
+        aImage.MakeVisible( EFalse );
+        return;
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleImageManager::MapEnumToMbmFile
+// ---------------------------------------------------------------------------
+//
+void CBubbleImageManager::MapEnumToMbmFile( const TBMIcons aBmIcon,
+                                            TInt& aMbm,
+                                            TDes& aFileName ) const
+    {   
+    aMbm = KBMIconIndex[aBmIcon].iconIndex;
+    switch ( KBMIconIndex[aBmIcon].fileIndex )
+        {
+        case ECallstatusIconfile:
+            aFileName = KBMMbmZDrive;
+            aFileName.Append( KDC_APP_BITMAP_DIR );
+            aFileName.Append( KBMCallStatusBitmapFile );
+            aFileName.ZeroTerminate();
+            break;
+        case EBubblemanagerIconfile:
+            BubbleUtils::BubbleIconFileName( aFileName );
+            break;
+        case EAvkonIconfile:
+            aFileName = AknIconUtils::AvkonIconFileName();
+            break;
+        default:
+            Panic( EBMPanicImages );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleImageManager::MapEnumToSkin
+// ---------------------------------------------------------------------------
+//
+void CBubbleImageManager::MapEnumToSkin( const TBMIcons aBmIcon, 
+                                         TAknsItemID& aItemId, 
+                                         TInt& aColorTableIndex ) const
+    {    
+    switch ( aBmIcon )
+        {
+        case EQgn_indi_call_active:
+            aItemId = KAknsIIDQgnIndiCallActive;
+            break;
+        case EQgn_indi_call_active_cyph_off:
+            aItemId = KAknsIIDQgnIndiCallActiveCyphOff;
+            break;
+        case EQgn_indi_call_disconn:
+            aItemId = KAknsIIDQgnIndiCallDisconn;
+            break;
+        case EQgn_indi_call_disconn_cyph_off:
+            aItemId = KAknsIIDQgnIndiCallDisconnCyphOff;
+            break;
+        case EQgn_indi_call_held:
+            aItemId = KAknsIIDQgnIndiCallHeld;
+            break;
+        case EQgn_indi_call_held_cyph_off:
+            aItemId = KAknsIIDQgnIndiCallHeldCyphOff;
+            break;
+        case EQgn_indi_call_active_2:
+            aItemId = KAknsIIDQgnIndiCallActive2;
+            break;    
+        case EQgn_indi_call_video_1:
+            aItemId = KAknsIIDQgnIndiCallVideo1;
+            break;
+        case EQgn_indi_call_video_callsta_1:
+            aItemId = KAknsIIDQgnIndiCallVideoCallsta1;
+            break;
+        case EQgn_indi_call_video_disconn:
+            aItemId = KAknsIIDQgnIndiCallVideoDisconn;
+            break;
+        case EQgn_indi_call_active_emergency:
+            aItemId = KAknsIIDQgnIndiCallActiveEmergency;
+            break;
+        case EQgn_graf_call_first_one_active:
+            aItemId = KAknsIIDQgnGrafCallFirstOneActive;
+            break;
+        case EQgn_graf_call_first_one_disconn:
+            aItemId = KAknsIIDQgnGrafCallFirstOneDisconn;
+            break;
+        case EQgn_graf_call_first_one_held:
+            aItemId = KAknsIIDQgnGrafCallFirstOneHeld;
+            break;
+        case EQgn_graf_call_rec_big:
+            aItemId = KAknsIIDQgnGrafCallRecBig;
+            break;
+        case EQgn_graf_call_rec_big_disconn:
+            aItemId = KAknsIIDQgnGrafCallRecBigDisconn;
+            break;
+        case EQgn_graf_call_rec_big_right:
+            aItemId = KAknsIIDQgnGrafCallRecBigRight;
+            break;
+        case EQgn_graf_call_rec_big_right_disconn:
+            aItemId = KAknsIIDQgnGrafCallRecBigRightDisconn;
+            break;
+        case EQgn_indi_call_waiting_1:
+            aItemId = KAknsIIDQgnIndiCallWaiting1;
+            break;
+        case EQgn_indi_call_waiting_cyph_off_1:
+            aItemId = KAknsIIDQgnIndiCallWaitingCyphOff;
+            break;
+        case EQgn_indi_call_waiting_disconn:
+            aItemId = KAknsIIDQgnIndiCallWaitingDisconn;
+            break;
+        case EQgn_indi_call_waiting_disconn_cyph_off:
+            aItemId = KAknsIIDQgnIndiCallWaitingDisconnCyphOff;
+            break;
+        case EQgn_graf_call_first_one_active_emergency:
+            aItemId = KAknsIIDQgnGrafCallFirstOneActiveEmergency;
+            break;  
+        case EQgn_graf_call_two_active_emergency:
+            aItemId = KAknsIIDQgnGrafCallTwoActiveEmergency;
+            break;
+        case EQgn_graf_call_conf_five:
+            aItemId = KAknsIIDQgnGrafCallConfFive;
+            break;
+        case EQgn_graf_call_conf_four:
+            aItemId = KAknsIIDQgnGrafCallConfFour;
+            break;
+        case EQgn_graf_call_conf_three:
+            aItemId = KAknsIIDQgnGrafCallConfThree;
+            break;
+        case EQgn_graf_call_conf_two:
+            aItemId = KAknsIIDQgnGrafCallConfTwo;
+            break;
+        case EQgn_graf_call_first_three_active:
+            aItemId = KAknsIIDQgnGrafCallFirstThreeActive;
+            break;
+        case EQgn_graf_call_first_three_disconn:
+            aItemId = KAknsIIDQgnGrafCallFirstThreeDisconn;
+            break;
+        case EQgn_graf_call_first_three_held:
+            aItemId = KAknsIIDQgnGrafCallFirstThreeHeld;
+            break;
+        case EQgn_graf_call_first_two_active:
+            aItemId = KAknsIIDQgnGrafCallFirstTwoActive;
+            break;
+        case EQgn_graf_call_first_two_disconn:
+            aItemId = KAknsIIDQgnGrafCallFirstTwoDisconn;
+            break;
+        case EQgn_graf_call_first_two_held:
+            aItemId = KAknsIIDQgnGrafCallFirstTwoHeld;
+            break;
+        case EQgn_graf_call_first_wait_active:
+            aItemId = KAknsIIDQgnGrafCallFirstWaitActive;
+            break;
+        case EQgn_graf_call_first_wait_disconn:
+            aItemId = KAknsIIDQgnGrafCallFirstWaitDisconn;
+            break;
+        case EQgn_graf_call_hidden_held:
+            aItemId = KAknsIIDQgnGrafCallHiddenHeld;
+            break;
+        case EQgn_graf_call_rec_big_left:
+            aItemId = KAknsIIDQgnGrafCallRecBigLeft;
+            break;
+        case EQgn_graf_call_rec_big_left_disconn:
+            aItemId = KAknsIIDQgnGrafCallRecBigLeftDisconn;
+            break;
+        case EQgn_graf_call_rec_small_left:
+            aItemId = KAknsIIDQgnGrafCallRecSmallLeft;
+            break;
+        case EQgn_graf_call_rec_small_right:
+            aItemId = KAknsIIDQgnGrafCallRecSmallRight;
+            break;
+        case EQgn_graf_call_rec_small_right_disconn:
+            aItemId = KAknsIIDQgnGrafCallRecSmallRightDisconn;
+            break;
+        case EQgn_graf_call_rec_bigger:
+            aItemId = KAknsIIDQgnGrafCallRecBigger;
+            break;
+        case EQgn_graf_call_second_three_active:
+            aItemId = KAknsIIDQgnGrafCallSecondThreeActive;
+            break;
+        case EQgn_graf_call_second_three_disconn:
+            aItemId = KAknsIIDQgnGrafCallSecondThreeDisconn;
+            break;
+        case EQgn_graf_call_second_three_held:
+            aItemId = KAknsIIDQgnGrafCallSecondThreeHeld;
+            break;
+        case EQgn_graf_call_second_two_active:
+            aItemId = KAknsIIDQgnGrafCallSecondTwoActive;
+            break;
+        case EQgn_graf_call_second_two_disconn:
+            aItemId = KAknsIIDQgnGrafCallSecondTwoDisconn;
+            break;
+        case EQgn_graf_call_second_two_held:
+            aItemId = KAknsIIDQgnGrafCallSecondTwoHeld;
+            break;
+        case EQgn_indi_call_active_conf:
+            aItemId = KAknsIIDQgnIndiCallActiveConf;
+            break;
+        case EQgn_indi_call_active_conf_cyph_off:
+            aItemId = KAknsIIDQgnIndiCallActiveConfCyphOff;
+            break;
+        case EQgn_indi_call_active_cyph_off_2:
+            aItemId = KAknsIIDQgnIndiCallActiveCyphOff2;
+            break;
+        case EQgn_indi_call_disconn_conf:
+            aItemId = KAknsIIDQgnIndiCallDisconnConf;
+            break;
+        case EQgn_indi_call_disconn_conf_cyph_off:
+            aItemId = KAknsIIDQgnIndiCallDisconnConfCyphOff;
+            break;
+        case EQgn_indi_call_held_conf:
+            aItemId = KAknsIIDQgnIndiCallHeldConf;
+            break;
+        case EQgn_indi_call_held_conf_cyph_off:
+            aItemId = KAknsIIDQgnIndiCallHeldConfCyphOff;
+            break;
+        case EQgn_indi_call_muted:
+            aItemId = KAknsIIDQgnIndiCallMuted;
+            break;
+        case EQgn_indi_call_waiting_2:
+            aItemId = KAknsIIDQgnIndiCallWaiting2;
+            break;
+        case EQgn_indi_call_waiting_cyph_off_2:
+            aItemId = KAknsIIDQgnIndiCallWaitingCyphOff2;
+            break;
+        case EQgn_indi_call_video_2:
+            aItemId = KAknsIIDQgnIndiCallVideo2;
+            break;
+        case EQgn_indi_call_video_callsta_2:
+            aItemId = KAknsIIDQgnIndiCallVideoCallsta2;
+            break;            
+        case EQgn_indi_call_video_callsta_disconn:
+            aItemId = KAknsIIDQgnIndiCallVideoCallstaDisconn; 
+            break;
+        case EQgn_indi_call_voip_active:
+            aItemId = KAknsIIDQgnIndiCallVoipActive;
+            break;
+        case EQgn_indi_call_voip_active_2:
+            aItemId = KAknsIIDQgnIndiCallVoipActive2;
+            break;    
+        case EQgn_indi_call_voip_disconn:
+            aItemId = KAknsIIDQgnIndiCallVoipDisconn;
+            break;
+        case EQgn_indi_call_voip_held:
+            aItemId = KAknsIIDQgnIndiCallVoipHeld;
+            break;
+        case EQgn_indi_call_voip_waiting_1:
+            aItemId = KAknsIIDQgnIndiCallVoipWaiting1;
+            break;
+        case EQgn_indi_call_voip_waiting_2:
+            aItemId = KAknsIIDQgnIndiCallVoipWaiting2;
+            break;
+        case EQgn_indi_call_voip_callsta_disconn:
+            aItemId = KAknsIIDQgnIndiCallVoipCallstaDisconn;
+            break; 
+        case EQgn_graf_call_image_1:
+            aItemId = KAknsIIDQgnGrafCallImage1;
+            break;
+        case EQgn_indi_call4_image_mask_prt:
+            aItemId = KAknsIIDNone;
+            break;
+        case EQgn_indi_call4_image_mask_lsc:
+            aItemId = KAknsIIDNone;
+            break;
+
+// Colour changes
+        case EQgn_indi_call_line2:
+            aItemId = KAknsIIDQgnIndiCallLine2;
+            aColorTableIndex = EAknsCIQsnIconColorsCG11;
+            break;
+        case EQgn_indi_call_cyphering_off:
+            aItemId = KAknsIIDQgnIndiCallCypheringOff;
+            aColorTableIndex = EAknsCIQsnIconColorsCG11;
+            break;
+        case EQgn_indi_call_diverted:
+            aItemId = KAknsIIDQgnIndiCallDiverted;
+            aColorTableIndex = EAknsCIQsnIconColorsCG11;
+            break;
+
+        // Not skinned
+        case EQgn_prop_nrtyp_home_div:
+            aItemId = KAknsIIDQgnPropNrtypHomeDiv;
+            break;
+        case EQgn_prop_nrtyp_mobile_div:
+            aItemId = KAknsIIDQgnPropNrtypMobileDiv;
+            break;
+        case EQgn_prop_nrtyp_phone_div:
+            aItemId = KAknsIIDQgnPropNrtypPhoneDiv;
+            break;
+        case EQgn_prop_nrtyp_work_div:
+            aItemId = KAknsIIDQgnPropNrtypWorkDiv;
+            break;
+
+            // From avkon.mbm
+        case EQgn_prop_nrtyp_fax:
+            aItemId = KAknsIIDQgnPropNrtypFax;
+            break;
+        case EQgn_prop_nrtyp_home:
+            aItemId = KAknsIIDQgnPropNrtypPhone;
+            break;
+        case EQgn_prop_nrtyp_mobile:
+            aItemId = KAknsIIDQgnPropNrtypMobile;
+            break;
+        case EQgn_prop_nrtyp_pager:
+            aItemId = KAknsIIDQgnPropNrtypPager;
+            break;
+        case EQgn_prop_nrtyp_phone:
+            aItemId = KAknsIIDQgnPropNrtypPhone;
+            break;
+        case EQgn_prop_nrtyp_work:
+            aItemId = KAknsIIDQgnPropNrtypPhone;
+            break;
+        case EQgn_prop_nrtyp_voip:
+            aItemId = KAknsIIDQgnPropNrtypVoip;
+            break;
+        case EQgn_prop_nrtyp_car:
+            aItemId = KAknsIIDQgnPropNrtypCar;
+            break;            
+        case EQgn_prop_nrtyp_assistant:
+            aItemId = KAknsIIDQgnPropNrtypAssistant;
+            break;            
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleImageManager::ClearSkinsCache
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleImageManager::ClearSkinsCache()
+    {
+    iSkinnedBitmaps.ResetAndDestroy();
+    
+    TRAP_IGNORE( LoadCachedBitmapsL() );
+    
+    PrepareCachedBitmaps();
+    }
+    
+
+// ---------------------------------------------------------------------------
+// CBubbleImageManager::CompareSkinnedData
+// ---------------------------------------------------------------------------
+//
+TInt CBubbleImageManager::CompareSkinnedData( 
+    const CBubbleSkinBitmap& aSkinnedBitmap1, 
+    const CBubbleSkinBitmap& aSkinnedBitmap2 )
+    {
+    if ( aSkinnedBitmap1.BitmapIndex() > aSkinnedBitmap2.BitmapIndex() )
+        {
+        return 1;
+        }
+    if ( aSkinnedBitmap1.BitmapIndex() < aSkinnedBitmap2.BitmapIndex() )
+        {
+        return -1;
+        }
+    return 0;    
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleImageManager::GetSkin
+// ---------------------------------------------------------------------------
+//
+TBool CBubbleImageManager::GetSkin( CEikImage&      aImage, 
+                                    const TBMIcons  aBmIcon, 
+                                    const TBMIcons  aBmIconMask )
+    {
+    if ( aBmIcon < 0 || aBmIcon > KBMLastAvkonBitmap )
+        {        
+        return EFalse;
+        }
+
+    CBubbleSkinBitmap skinnedBitmap;
+    skinnedBitmap.SetBitmapIndex( aBmIcon );
+    skinnedBitmap.SetSkinnedBitmap( NULL );
+    skinnedBitmap.SetSkinnedMask( NULL );
+    TInt index = iSkinnedBitmaps.FindInOrder( &skinnedBitmap, iOrder );
+    
+    CFbsBitmap* bitmap = NULL;
+    CFbsBitmap* mask = NULL;
+    if ( index != KErrNotFound )
+        {
+        bitmap = iSkinnedBitmaps[ index ]->SkinnedBitmap();
+        mask = iSkinnedBitmaps[ index ]->SkinnedMask();
+        }
+                                                     
+    if ( bitmap == NULL )
+        {
+        TRAP_IGNORE(
+            LoadAndAppendSkinL( aBmIcon, aBmIconMask, bitmap, mask ) );
+        }
+
+    if ( bitmap )
+        {
+        aImage.SetPicture( bitmap, mask ); // Mask might be NULL
+        aImage.SetPictureOwnedExternally( ( aBmIcon <= LastCachedIcon() ) ); // cached bitmaps are owned here
+        return ETrue;
+        }
+    
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleImageManager::LoadAndAppendSkinL
+// ---------------------------------------------------------------------------
+//
+void CBubbleImageManager::LoadAndAppendSkinL( const TBMIcons aBmIcon,
+                                              const TBMIcons aBmIconMask,
+                                              CFbsBitmap*&   aBitmap, 
+                                              CFbsBitmap*&   aMask )
+
+    {
+    TInt mbmBitmapIndex = 0;
+    TInt mbmMaskIndex = KErrNotFound;
+    TInt colorTableIndex( 0 );
+    TAknsItemID skinItemId( KAknsIIDNone );    
+    MapEnumToMbmFile( aBmIcon , mbmBitmapIndex , iMbmFileBuffer );    
+    
+    if ( mbmBitmapIndex == KErrNotFound )
+        {        
+        User::Leave( KErrNotFound );
+        }
+    
+    if ( aBmIconMask >= 0 && aBmIconMask <= KBMLastAvkonBitmap )
+        {        
+        MapEnumToMbmFile( aBmIconMask , mbmMaskIndex , iMbmFileBuffer );
+        }
+    MapEnumToSkin( aBmIcon, skinItemId, colorTableIndex );    
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+
+    if( colorTableIndex != 0 )
+        {
+        AknsUtils::CreateColorIconLC( skin, skinItemId, 
+                                      KAknsIIDQsnIconColors, 
+                                      colorTableIndex, 
+                                      aBitmap, aMask, 
+                                      iMbmFileBuffer, 
+                                      mbmBitmapIndex, mbmMaskIndex, 
+                                      KRgbBlack );
+        }
+    else
+        {
+        if ( mbmMaskIndex != KErrNotFound )
+            {
+            AknsUtils::CreateIconLC( skin, skinItemId, 
+                                 aBitmap, aMask, iMbmFileBuffer, 
+                                 mbmBitmapIndex, mbmMaskIndex );
+            }
+        else
+            {
+            AknsUtils::CreateIconLC( skin, skinItemId, 
+                                 aBitmap, iMbmFileBuffer, mbmBitmapIndex );
+            }
+        }
+
+    
+    if ( aBmIcon <= LastCachedIcon() )
+        {
+        CBubbleSkinBitmap* skinnedBitmap = new (ELeave) CBubbleSkinBitmap();
+        CleanupStack::PushL( skinnedBitmap );
+        skinnedBitmap->SetBitmapIndex( aBmIcon );
+        //skinnedBitmap->SetBitmapSkinItemID( skinItemId );
+        skinnedBitmap->SetSkinnedBitmap( aBitmap );
+        skinnedBitmap->SetSkinnedMask( aMask );
+        User::LeaveIfError( 
+            iSkinnedBitmaps.InsertInOrder( skinnedBitmap, iOrder ) );                
+        CleanupStack::Pop( skinnedBitmap ); // Ownership was given to iSkinnedBitmaps
+        }
+
+
+    if ( colorTableIndex != 0 )
+        {
+        CleanupStack::Pop( 2 ); // aBitmap, aMask
+        }
+    else
+        {        
+        if ( mbmMaskIndex != KErrNotFound )
+            {
+            CleanupStack::Pop(); // aMask
+            }
+        CleanupStack::Pop(); // aBitmap
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleImageManager::DoInitializeBitmaps
+// ---------------------------------------------------------------------------
+//    
+TBool CBubbleImageManager::DoInitializeBitmaps()
+    {
+    // Bubble rect for single call or number entry
+    TAknWindowLineLayout bottomBubble = 
+    BubbleLayout::popup_call_audio_in_window( 1 );
+    TAknLayoutRect bottomBubbleRect;
+    bottomBubbleRect.LayoutRect( BubbleLayout::MainPaneRect(), 
+                                 bottomBubble );
+    
+    TInt iconCount = iSkinnedBitmaps.Count();
+    if ( iBitmapInitIndex < iconCount )
+        {
+        CBubbleSkinBitmap* skinnedBitmap = iSkinnedBitmaps[ iBitmapInitIndex ];    
+        
+        switch ( skinnedBitmap->BitmapIndex() )
+            {
+            // Small call status icon
+            case EQgn_indi_call_active:
+            case EQgn_indi_call_active_2:
+            case EQgn_indi_call_disconn:
+            case EQgn_indi_call_held:
+            case EQgn_indi_call_video_callsta_1:
+            case EQgn_indi_call_video_callsta_2:
+            case EQgn_indi_call_video_callsta_disconn:
+            case EQgn_indi_call_voip_active:
+            case EQgn_indi_call_voip_active_2:
+            case EQgn_indi_call_voip_held:
+            case EQgn_indi_call_voip_callsta_disconn:
+                {
+                TAknWindowLineLayout smallCallStatusIcon = 
+                    BubbleLayout::popup_call_audio_first_window_1_elements_1();
+                TAknLayoutRect smallCallStatusIconRect;
+                smallCallStatusIconRect.LayoutRect( bottomBubbleRect.Rect(),
+                                                    smallCallStatusIcon );                                        
+                                             
+                AknIconUtils::SetSize( skinnedBitmap->SkinnedBitmap(), 
+                                       smallCallStatusIconRect.Rect().Size() );                                             
+                break;    
+                }
+            
+            // Big call status icon
+            case EQgn_indi_call_waiting_1:
+            case EQgn_indi_call_waiting_2:
+            case EQgn_indi_call_waiting_disconn:
+            case EQgn_indi_call_video_1:
+            case EQgn_indi_call_video_2:
+            case EQgn_indi_call_video_disconn:
+            case EQgn_indi_call_voip_waiting_1:
+            case EQgn_indi_call_voip_waiting_2:
+            case EQgn_indi_call_voip_disconn:
+                {
+                TAknWindowLineLayout bigCallStatusIcon = 
+                    BubbleLayout::popup_call_audio_in_window_1_elements_1();
+                TAknLayoutRect bigCallStatusIconRect;
+                bigCallStatusIconRect.LayoutRect( bottomBubbleRect.Rect(),
+                                                  bigCallStatusIcon );                                        
+                                             
+                AknIconUtils::SetSize( skinnedBitmap->SkinnedBitmap(), 
+                                       bigCallStatusIconRect.Rect().Size() ); 
+                break;    
+                }
+            
+            // Bubble graphics
+            case EQgn_graf_call_rec_big: 
+            case EQgn_graf_call_rec_big_disconn:
+            case EQgn_graf_call_first_one_active:
+            case EQgn_graf_call_first_one_disconn:
+            case EQgn_graf_call_first_one_held:
+                {
+                AknIconUtils::SetSize( skinnedBitmap->SkinnedBitmap(), 
+                                       bottomBubbleRect.Rect().Size(),
+                                       EAspectRatioNotPreserved );  
+                break;    
+                }
+            default:
+                // do nothing
+                break;
+            }
+        
+        iBitmapInitIndex++;
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;    
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleImageManager::InitializeBitmap
+// ---------------------------------------------------------------------------
+// 
+TInt CBubbleImageManager::InitializeBitmaps( TAny* aThis )
+    {
+    return static_cast<CBubbleImageManager*>( aThis )->DoInitializeBitmaps();
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleImageManager::PrepareCachedBitmaps
+// ---------------------------------------------------------------------------
+//    
+void CBubbleImageManager::PrepareCachedBitmaps()
+    {
+    iBitmapInitIndex = 0;
+    iBitmapInitializer->Cancel();
+    iBitmapInitializer->Start( TCallBack( InitializeBitmaps, this ) );            
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleImageManager::LoadCachedBitmapsL
+// ---------------------------------------------------------------------------
+//
+void CBubbleImageManager::LoadCachedBitmapsL()
+    {
+    // Load essential bitmaps right away
+    CFbsBitmap* newBitmap = NULL;
+    CFbsBitmap* newMask = NULL;
+    TInt lastIcon = LastCachedIcon();
+    for ( TInt i = 0 ; i < lastIcon ; i++ )
+        {
+        LoadAndAppendSkinL( (TBMIcons) i, // icon
+                            (TBMIcons) (i+1), // mask
+                            newBitmap, 
+                            newMask );
+        newBitmap = NULL;
+        newMask = NULL;
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleImageManager::LastCachedIcon
+// ---------------------------------------------------------------------------
+//    
+TInt CBubbleImageManager::LastCachedIcon()
+    {
+    if ( iFrameIcons )    
+        {
+        return KBMLastCachedBitmap2;    
+        }
+    else
+        {
+        return KBMLastCachedBitmap1;    
+        }        
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleManager.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,3842 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 for the whole subsystem
+*
+*/
+
+
+// INCLUDE FILES
+
+#include    "BMBubbleManager.h"
+#include    "BMBubbleImageManager.h"
+#include    "BMResourceManager.h"
+#include    "BMCustomManager.h"
+#include    "BMBubbleOutlook.h"
+#include    "BMBubbleOutlookMiddle.h"
+#include    "BMBubbleOutlookConference.h"
+#include    "BMBubbleOutlookNE.h"
+#include    "BMCallHeader.h"
+#include    "BMConfHeader.h"
+#include    "BMPanic.h"
+#include    "BMUtils.h"
+#include    "BMLayout.h"
+#include    "BMBubbleImage.h"
+#include    "BubbleManagerPaths.h"
+#include    "BMCallObjectManager.h"
+#include    "BMLayout2.h"
+#include    "BMLayout3.h"
+#include    "BMLayout4.h"
+#include    "BMLayout6.h"
+#include    "BMCallObjectUtils.h"
+#include    "BMVideoController.h"
+#include    "BMTouchPane.h"
+#include    "BMTouchPaneInterface.h"
+#include    "BMMainPaneControl.h"
+#include    <eikimage.h>    // for muted-image
+#include    <coemain.h>
+#include    <PbkFields.hrh> // for field id
+#include    <ConeResLoader.h> 
+#include    <AknsUtils.h>
+#include    <NumberGrouping.h>
+#include    <AknDef.h>
+#include    <layoutmetadata.cdl.h>
+
+#include    <featmgr.h> 
+#include    <telephonyvariant.hrh>
+
+#include <centralrepository.h>
+#include    <NumberGroupingCRKeys.h>
+#ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
+#include <gfxtranseffect/gfxtranseffect.h> 
+#include <akntransitionutils.h>
+#endif
+
+#include    "BMBubbleDebug.h"
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CBubbleManager::NewL
+// Symbian OS two phased constructor
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CBubbleManager* CBubbleManager::NewL( const CCoeControl& aContainer, 
+                                               const TRect& aRect )
+    {
+    CBubbleManager* self = new( ELeave )CBubbleManager;    
+    CleanupStack::PushL( self );
+    self->ConstructL( aContainer , aRect, EFalse );
+    CleanupStack::Pop();    // self
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleManager::NewL
+// Symbian OS two phased constructor
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CBubbleManager* CBubbleManager::NewL( const CCoeControl& aContainer, 
+                                               const TRect& aRect,
+                                               TBool aBigNEInIdle )
+    {
+    CBubbleManager* self = new( ELeave )CBubbleManager;    
+    CleanupStack::PushL( self );
+    self->ConstructL( aContainer , aRect, aBigNEInIdle );
+    CleanupStack::Pop();    // self
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleManager::ConstructL
+// Symbian OS two phased constructor
+// 
+// ---------------------------------------------------------------------------
+//
+
+void CBubbleManager::ConstructL( 
+    const CCoeControl& aContainer, 
+    const TRect& aRect,
+    TBool aBigNEInIdle )
+    {    
+    // Call object display
+    if ( FeatureManager::FeatureSupported( KFeatureIdCallImagetext ) )
+        {
+        iConfigFlags |= EBMCallObjectDisplay;    
+        }
+    
+    // Bigger number entry window in idle    
+    if ( aBigNEInIdle )
+        {
+        iConfigFlags |= EBMBigNEInIdleState;    
+        }
+   
+     // Touch CallHandling.
+    if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        {
+        iConfigFlags |= EBMTouchCallhandling;    
+        }
+               
+    // set window
+    SetContainerWindowL( aContainer );
+    SetParent( const_cast<CCoeControl*>(&aContainer) );
+    iParentControl = &aContainer;
+    
+    // load resource file for animation and number entry component.
+    RConeResourceLoader resourceLoader( *iCoeEnv ); 
+    TFileName fileName; 
+    BubbleUtils::BubbleResourceFileName( fileName ); 
+    resourceLoader.OpenL(fileName); 
+    CleanupClosePushL( resourceLoader );
+    
+    // create image manager
+    iImageManager = CBubbleImageManager::NewL(
+        iConfigFlags & EBMCallObjectDisplay );
+
+    // create resource pool
+    iResourceManager = CBubbleResourceManager::NewL( *this );
+    
+    // create custom manager
+    iCustomManager = CBubbleCustomManager::NewL(*this);
+    
+    // muted image
+    iIsMuted = EFalse;
+    iMutedImage = new( ELeave ) CBubbleImage;
+    iMutedImage->SetContainerWindowL( *this );
+    iMutedImage->SetParent( this );
+    iMutedImage->SetPictureOwnedExternally( ETrue );
+    iMutedImage->MakeVisible( iIsMuted );
+    
+    // create array of call headers
+    CBubbleCallHeader* header;
+    iCallHeaders = new( ELeave ) CArrayPtrFlat<CBubbleCallHeader>( 1 );
+    iCallHeaders->SetReserveL( KBubbleCallMaxAmount );
+    for ( TUint8 i = 0 ; i < KBubbleCallMaxAmount ; i++ )
+        {
+        header = CBubbleCallHeader::NewL( i );
+        iCallHeaders->InsertL( i , header );    // can't leave
+        }
+    
+    // set reserve for active headers
+    iActiveHeaders = new ( ELeave ) CArrayPtrFlat<CBubbleHeader>( 1 );
+    // 1 is for conference
+    iActiveHeaders->SetReserveL( KBubbleCallMaxAmount + 1 ); 
+        
+    // create conference header
+    iConfHeader = CBubbleConfHeader::NewL( KBubbleConferenceId );
+    
+    // create number entry
+    iNumberEntry = new ( ELeave ) CBubbleOutlookNumberEntry( *this, 
+                                                             *iMutedImage );
+    iNumberEntry->SetCallObjectDisplay( 
+        iConfigFlags & EBMCallObjectDisplay );
+    iNumberEntry->SetContainerWindowL( *this );
+    iNumberEntry->SetParent( this );
+    iNumberEntry->ConstructL();
+    iNumberEntry->MakeVisible( EFalse ); //add
+    
+    // create places and their contents ( outlooks )
+    TInt maxAmount = (iConfigFlags & EBMTouchCallhandling) ?
+        KBubblePlaceMaxAmountTouch : KBubblePlaceMaxAmount;
+    CBubblePlace* place;
+    iBubblePlaces = new ( ELeave ) CArrayPtrFlat<CBubblePlace>( 1 );
+    iBubblePlaces->SetReserveL( maxAmount );
+    for ( TUint8 e = 0 ; e < maxAmount ; e++  )
+        {
+        place = new ( ELeave ) CBubblePlace;
+        CleanupStack::PushL( place );
+        place->SetContainerWindowL( *this );
+        place->SetParent( this );
+        place->ConstructL( CBubblePlace::TPhoneBubblePlace ( e ) , *this );
+        place->GetBubbleOutlook().SetCallObjectDisplay( 
+            iConfigFlags & EBMCallObjectDisplay );
+        iBubblePlaces->InsertL( e , place );
+        CleanupStack::Pop(); //place
+        }
+    
+    // reserve space for active places
+    iActivePlaces = 
+        new (ELeave) CArrayPtrFlat<CBubblePlace>( KBubblePlaceMaxVisible );
+    iActivePlaces->SetReserveL( KBubblePlaceMaxVisible );
+    
+    // reserve space for label text
+    iLabelBuf = HBufC::NewMaxL ( KBubbleLabelMaxLength );
+
+    // call object manager
+    if ( iConfigFlags & EBMCallObjectDisplay )
+        {
+        iCallObjectManager = CBubbleCallObjectManager::NewL( *this );
+        
+        // Main pane control is not set as component control,
+        // it just controls the drawing of the call image to
+        // the main pane.
+        iMainPaneControl = CBubbleMainPaneControl::NewL(
+                *this,
+                *iCallObjectManager );
+        iMainPaneControl->ActivateL();
+        iMainPaneControl->SetContainerWindowL( *this );
+        iMainPaneControl->MakeVisible( EFalse );
+        }
+        
+    // Video ringtone
+    iVideoController = CBubbleVideoController::NewL( *this );
+    
+    // Touch pane
+    if ( iConfigFlags & EBMTouchCallhandling )
+        {
+        iTouchPane = CBubbleTouchPane::NewL();
+        iTouchPane->SetContainerWindowL( *this );
+        iTouchPane->SetParent( this );
+        iTouchPane->MakeVisible( EFalse );
+        iTouchPane->ActivateL();
+        }   
+    
+    SetRect( aRect );
+    ActivateL();
+    iResourceManager->ActivateL();
+    iIsReadyToDraw = 0;
+
+    // Resource file isn't needed anymore so it can be closed.
+    CleanupStack::PopAndDestroy(); // resourceLoader   
+    
+    TInt pngErr( KErrNone );
+    TInt pngSupported( 0 );
+    CRepository* repository = CRepository::NewL( KCRUidNumberGrouping );
+    pngErr = repository->Get( KNumberGrouping, pngSupported );
+    delete repository;
+
+    if ( KErrNone == pngErr && pngSupported != 0 )
+        {
+        iNumberGrouping = CPNGNumberGrouping::NewL(KBubbleLabelMaxLength);
+        }
+#ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
+    // Register the number entry popup in the transition server
+    GfxTransEffect::Register( iNumberEntry, KGfxNumberEntryPopupUid, EFalse );
+
+    CAknTransitionUtils::SetData( (TInt) this, 0 );
+#endif
+    }
+
+// Destructor
+EXPORT_C CBubbleManager::~CBubbleManager()
+    {
+#ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
+    CAknTransitionUtils::RemoveData( (TInt) this );
+    GfxTransEffect::Deregister( iNumberEntry );
+#endif
+    AknsUtils::DeregisterControlPosition( this );
+    
+    delete iMutedImage;
+    
+    if ( iActiveHeaders )
+        {
+        iActiveHeaders->Reset( );
+        delete iActiveHeaders;
+        }
+
+    delete iLabelBuf;
+    
+    if ( iActivePlaces )
+        {
+        iActivePlaces->Reset( );
+        delete iActivePlaces;
+        }
+    
+    if ( iBubblePlaces )
+        {
+        iBubblePlaces->ResetAndDestroy() ;
+        delete iBubblePlaces;
+        }
+    
+    delete iNumberEntry;
+    
+    delete iConfHeader;
+    
+    
+    if ( iCallHeaders )
+        {
+        iCallHeaders->ResetAndDestroy() ;
+        delete iCallHeaders;
+        }
+
+    delete iResourceManager;
+    
+    delete iImageManager;
+    
+    delete iCustomManager;
+    
+    delete iNumberGrouping;
+
+    delete iCallObjectManager;
+    
+    delete iMainPaneControl;
+
+    delete iVideoController;
+    
+    delete iTouchPane;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleManager::SizeChanged()
+// called by framework when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleManager::SizeChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    
+    if ( iConfigFlags & EBMTouchCallhandling )
+        {
+        MBubbleTouchPaneInterface* touchPaneIf =
+            static_cast<MBubbleTouchPaneInterface*> (iTouchPane);             
+        
+        if ( iTouchPane->IsVisible() )
+            {
+            TInt variety = 0;
+            // Popups
+            TAknLayoutRect windowsPane;        
+            windowsPane.LayoutRect( 
+                Rect(), 
+                BubbleLayout6::call6_windows_pane(variety));
+
+            iMainPaneControl->SetRect( windowsPane.Rect() );
+            
+            DoLayoutCall4Bubbles( windowsPane.Rect() );    
+            }
+        else
+            {
+            iMainPaneControl->SetRect( Rect() );
+            
+            DoLayoutCall4Bubbles( Rect() );    
+            }            
+            
+                    
+        // Muted icon
+        AknLayoutUtils::LayoutImage( 
+            iMutedImage, Rect(), 
+            BubbleLayout::main_pane_elements_muted( EFalse ) );    
+        
+        // Touch pane
+
+        TInt variety = 0;
+        AknLayoutUtils::LayoutControl( 
+            iTouchPane, 
+            Rect(), 
+            BubbleLayout6::call6_button_grp_pane(variety) );
+        
+        }
+    else if ( iConfigFlags & EBMCallObjectDisplay )
+        {
+        // call object layout
+        iMainPaneControl->SetRect( Rect() );
+        DoLayoutCall2Bubbles();    
+        }        
+    else
+        {
+        // old thumbnail layout
+        DoLayoutCall1Bubbles();    
+        }
+    
+    // Layout number entry
+    TInt neIndex;
+    switch ( iNumberEntry->Place() )
+        {
+        case CBubbleOutlookNumberEntry::ENEBottomRight:
+            neIndex = 1;
+            break;
+        case CBubbleOutlookNumberEntry::ENEIdleState:
+            neIndex = 4;
+            break;
+        default: // CBubbleOutlookNumberEntry::ENEBottom
+            neIndex = 0;
+            break;                        
+        }
+
+    AknLayoutUtils::LayoutControl( 
+        iNumberEntry, Rect( ), 
+        BubbleLayout::popup_number_entry_window( neIndex ) );        
+    
+    // Layout muted icon
+    if ( !(iConfigFlags & EBMTouchCallhandling) )
+        {
+        AknLayoutUtils::LayoutImage( 
+            iMutedImage, Rect(), 
+            BubbleLayout::main_pane_elements_muted( iNumberEntry->IsUsed() ) );        
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleManager::DoLayoutCall1Bubbles
+// ---------------------------------------------------------------------------
+//
+void CBubbleManager::DoLayoutCall1Bubbles()
+    {
+    CBubblePlace* tempBubblePlace = NULL;
+    TUint8 placeCount( TUint8( iBubblePlaces->Count( ) ) );
+    TAknWindowLineLayout placeLayout;
+    
+    for ( TUint8 index = 0 ; index < placeCount ; index++  ) 
+        {
+        tempBubblePlace = iBubblePlaces->At( index );
+        CBubblePlace::TPhoneBubblePlace place = 
+            tempBubblePlace->GetBubblePlace();
+                    
+        switch ( place )
+            {
+            case CBubblePlace::EBottom:
+                placeLayout = BubbleLayout::popup_call_audio_in_window(1);    
+                break;
+                
+            case CBubblePlace::EBottomRightActive:
+                placeLayout = BubbleLayout::popup_call_audio_second_window(1);
+                break;
+                
+            case CBubblePlace::EBottomRightHeld:
+                placeLayout = BubbleLayout::popup_call_audio_second_window(2);
+                break;
+                
+            case CBubblePlace::EMiddleActive:
+                placeLayout = BubbleLayout::popup_call_audio_first_window(3);
+                break;
+                
+            case CBubblePlace::EMiddleHeld:
+                if ( iBubblePlaces->At( CBubblePlace::EBottomCnap )->IsUsed() )
+                    {
+                    placeLayout = BubbleLayout::popup_call_audio_first_window(7);
+                    }
+                else
+                    {
+                    placeLayout = BubbleLayout::popup_call_audio_first_window(2);
+                    }
+                break;
+                
+            case CBubblePlace::ETopLeft:
+                placeLayout = BubbleLayout::popup_call_audio_first_window(4);
+                break;
+                
+            case CBubblePlace::ETopRight:
+                placeLayout = BubbleLayout::popup_call_audio_second_window(3);
+                break;
+                
+            case CBubblePlace::EHide:
+                {
+                TInt v = AknLayoutUtils::ScalableLayoutInterfaceAvailable() ?
+                         5 : 6;
+                placeLayout = BubbleLayout::popup_call_audio_first_window(v);
+                }
+                break;
+                
+            case CBubblePlace::E2InConf:
+                placeLayout = BubbleLayout::popup_call_audio_conf_window(1);
+                break;
+                
+            case CBubblePlace::E3InConf:
+                placeLayout = BubbleLayout::popup_call_audio_conf_window(2);
+                break;
+                
+            case CBubblePlace::E4InConf:
+                placeLayout = BubbleLayout::popup_call_audio_conf_window(3);
+                break;
+                
+            case CBubblePlace::E5InConf:
+                placeLayout = BubbleLayout::popup_call_audio_conf_window(4);
+                break;
+                
+            case CBubblePlace::EBottomCnap:
+                placeLayout = BubbleLayout::popup_call_audio_in_window(3);
+                break;
+                
+            case CBubblePlace::EMiddleCnap:
+                placeLayout = BubbleLayout::popup_call_audio_in_window(4);
+                break;
+                
+            case CBubblePlace::EVideo:
+                placeLayout = BubbleLayout3::popup_call3_audio_in_window(0);
+                break;
+
+            case CBubblePlace::EVideoCnap:
+                placeLayout = BubbleLayout3::popup_call3_audio_in_window(0);
+                break;                                                 
+
+            case CBubblePlace::EBottomText: // not active
+            case CBubblePlace::EBottomImage: // not active
+            case CBubblePlace::EBottomRightCnap: // not active
+            case CBubblePlace::EBottomImageCnap: // not active
+                placeLayout = BubbleLayout::popup_call_audio_in_window(1);
+                break;                 
+                
+            default:
+                Panic( EBMPanicPlaceEnumerationDoesNotExist );
+                break;
+            }
+        
+        AknLayoutUtils::LayoutControl( tempBubblePlace , Rect() , placeLayout );
+        }    
+    }
+    
+// ---------------------------------------------------------------------------
+// CBubbleManager::DoLayoutCall2Bubbles
+// ---------------------------------------------------------------------------
+//
+void CBubbleManager::DoLayoutCall2Bubbles()
+    {
+    CBubblePlace* tempBubblePlace = NULL;
+    TUint8 placeCount( TUint8( iBubblePlaces->Count( ) ) );
+    TAknWindowLineLayout placeLayout;
+    
+    for ( TUint8 index = 0 ; index < placeCount ; index++  ) 
+        {
+        tempBubblePlace = iBubblePlaces->At( index );
+        CBubblePlace::TPhoneBubblePlace place = 
+            tempBubblePlace->GetBubblePlace();
+        
+        switch ( place )
+            {
+            case CBubblePlace::EBottom:
+                placeLayout = BubbleLayout2::popup_call2_audio_in_window(0);
+                break;
+                
+            case CBubblePlace::EBottomRightActive:
+                placeLayout = BubbleLayout2::popup_call2_audio_second_window(0);
+                break;
+                
+            case CBubblePlace::EBottomRightHeld:
+                placeLayout = BubbleLayout2::popup_call2_audio_second_window(1);    
+                break;
+                
+            case CBubblePlace::EMiddleActive:
+                placeLayout = BubbleLayout2::popup_call2_audio_first_window(2);    
+                break;
+                
+            case CBubblePlace::EMiddleHeld:
+                if ( iBubblePlaces->At( CBubblePlace::EBottomRightCnap )->IsUsed() )
+                    {
+                    placeLayout = BubbleLayout2::popup_call2_audio_first_window(18);
+                    }
+                else
+                    {
+                    placeLayout = BubbleLayout2::popup_call2_audio_first_window(1);    
+                    }                    
+                break;
+                
+            case CBubblePlace::ETopLeft:
+                placeLayout = BubbleLayout2::popup_call2_audio_first_window(3);    
+                break;
+                
+            case CBubblePlace::ETopRight:
+                placeLayout = BubbleLayout2::popup_call2_audio_second_window(2);    
+                break;
+                
+            case CBubblePlace::EHide:
+                placeLayout = BubbleLayout2::popup_call2_audio_first_window(4);    
+                break;
+                
+            case CBubblePlace::E2InConf:
+                placeLayout = BubbleLayout2::popup_call2_audio_conf_window(0);    
+                break;
+                
+            case CBubblePlace::E3InConf:
+                placeLayout = BubbleLayout2::popup_call2_audio_conf_window(1);       
+                break;
+                
+            case CBubblePlace::E4InConf:
+                placeLayout = BubbleLayout2::popup_call2_audio_conf_window(2);        
+                break;
+                
+            case CBubblePlace::E5InConf:
+                placeLayout = BubbleLayout2::popup_call2_audio_conf_window(3);        
+                break;
+                
+            case CBubblePlace::EBottomCnap:
+                placeLayout = BubbleLayout2::popup_call2_audio_in_window(2);    
+                break;
+                
+            case CBubblePlace::EMiddleCnap:
+                placeLayout = BubbleLayout2::popup_call2_audio_in_window(3);    
+                break;
+                
+            case CBubblePlace::EBottomText:
+                placeLayout = BubbleLayout2::popup_call2_audio_in_window(8);
+                break;                
+
+            case CBubblePlace::EBottomImage:
+                placeLayout = BubbleLayout2::popup_call2_audio_first_window(0);
+                break;                
+                
+            case CBubblePlace::EVideo:
+                placeLayout = BubbleLayout3::popup_call3_audio_in_window(0);
+                break;
+
+            case CBubblePlace::EVideoCnap:
+                placeLayout = BubbleLayout3::popup_call3_audio_in_window(0);
+                break;
+
+            case CBubblePlace::EBottomRightCnap:
+                placeLayout = BubbleLayout2::popup_call2_audio_wait_window(9);    
+                break;
+                
+            case CBubblePlace::EBottomImageCnap:
+                placeLayout = BubbleLayout2::popup_call2_audio_first_window(0);    
+                break;                
+                
+            default:
+                Panic( EBMPanicPlaceEnumerationDoesNotExist );
+                break;
+            }
+       
+        AknLayoutUtils::LayoutControl( tempBubblePlace , Rect() , placeLayout );
+        }    
+    }    
+
+// ---------------------------------------------------------------------------
+// CBubbleManager::DoLayoutCall4Bubbles
+// ---------------------------------------------------------------------------
+//
+void CBubbleManager::DoLayoutCall4Bubbles( const TRect& aWindowPane )
+    {
+    CBubblePlace* tempBubblePlace = NULL;
+    TUint8 placeCount( TUint8( iBubblePlaces->Count( ) ) );
+    TAknWindowLineLayout placeLayout;
+    TBool initCall = InitializingCall();
+    
+    for ( TUint8 index = 0 ; index < placeCount ; index++  ) 
+        {
+        tempBubblePlace = iBubblePlaces->At( index );
+        CBubblePlace::TPhoneBubblePlace place = 
+            tempBubblePlace->GetBubblePlace();
+        
+        switch ( place )
+            {
+            case CBubblePlace::EBottom:
+            case CBubblePlace::EBottomCnap:
+                if ( initCall )
+                    {
+                    // in / out
+                    placeLayout = 
+                        BubbleLayout4::popup_call4_audio_in_window(4);
+                    }
+                else
+                    {
+                    // incall
+                    placeLayout =
+                        BubbleLayout6::popup_call6_audio_first_window(0);    
+                    }
+                
+                break;
+                
+            // in / out with text
+            case CBubblePlace::EBottomText:
+                placeLayout = BubbleLayout2::popup_call2_audio_in_window(8);
+                break;                
+
+            // in with video                
+            case CBubblePlace::EVideo:
+            case CBubblePlace::EVideoCnap:
+                placeLayout = BubbleLayout3::popup_call3_audio_in_window(0);
+                break;
+
+            // first
+            case CBubblePlace::EBottomImage:
+            case CBubblePlace::EBottomImageCnap:
+                placeLayout = BubbleLayout6::popup_call6_audio_first_window(0);
+                break;                
+
+            // two calls - active
+            case CBubblePlace::EBottomRightActiveTouch:
+            case CBubblePlace::EBottomRightActiveCnapTouch:                
+                placeLayout = BubbleLayout4::popup_call4_audio_second_window(0);
+                break;
+            // two calls - active                
+            case CBubblePlace::EMiddleHeldTouch:                
+                placeLayout = BubbleLayout4::popup_call4_audio_first_window(1);          
+                break;                
+            
+            // three calls - held
+            case CBubblePlace::ETopRight:
+                placeLayout = BubbleLayout4::popup_call4_audio_second_window(1);    
+                break;
+            // two or three calls - active
+            case CBubblePlace::ETopLeft:
+                placeLayout = BubbleLayout4::popup_call4_audio_first_window(2);    
+                break;
+            // two or three calls - waiting    
+            case CBubblePlace::EBottomRightActive:
+            case CBubblePlace::EBottomRightCnap:
+            case CBubblePlace::EBottomRightHeld:
+                placeLayout = BubbleLayout4::popup_call4_audio_wait_window(0);    
+                break;
+            
+            // conference
+            case CBubblePlace::E2InConf:
+                placeLayout = BubbleLayout4::popup_call4_audio_conference_window(3);    
+                break;
+                
+            case CBubblePlace::E3InConf:
+                placeLayout = BubbleLayout4::popup_call4_audio_conference_window(2);       
+                break;
+                
+            case CBubblePlace::E4InConf:
+                placeLayout = BubbleLayout4::popup_call4_audio_conference_window(1);        
+                break;
+                
+            case CBubblePlace::E5InConf:
+                placeLayout = BubbleLayout4::popup_call4_audio_conference_window(0);        
+                break;
+
+            // not used in touch
+            case CBubblePlace::EMiddleActive:
+            case CBubblePlace::EMiddleHeld:
+            case CBubblePlace::EMiddleCnap:
+            case CBubblePlace::EHide:
+                continue;
+                
+            default:
+                Panic( EBMPanicPlaceEnumerationDoesNotExist );
+                break;
+            }
+       
+        AknLayoutUtils::LayoutControl( tempBubblePlace , aWindowPane , placeLayout );
+        }    
+    }    
+
+
+// ---------------------------------------------------------------------------
+// CBubbleManager::PositionChanged
+// ---------------------------------------------------------------------------
+//
+void CBubbleManager::PositionChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleManager::CountComponentControls() const
+//
+//  Controls: NumberEntry, MutedImage and ActivePlaces
+// ---------------------------------------------------------------------------
+//
+TInt CBubbleManager::CountComponentControls() const
+    {
+    if ( ( iConfigFlags & EBMTouchCallhandling ) && 
+         ( iTouchPane->IsVisible() ) )
+        {
+        return 3 + iActivePlaces->Count(); // ne + muted + touchpane + places
+        }
+    else
+        {
+        return 2 + iActivePlaces->Count(); // ne + muted + places
+        }       
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleManager::ComponentControl(TInt aIndex) const
+//
+//  First give active places. Then possible NE, muted-image and AnimStarter
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CBubbleManager::ComponentControl( TInt aIndex ) const
+    {
+    TInt activePlacesCount = iActivePlaces->Count();
+
+    // If too high value, return NULL
+    if ( aIndex >= activePlacesCount + 3 )
+        {
+        return NULL;
+        }
+
+    if ( aIndex < activePlacesCount )
+        {
+        return iActivePlaces->At( aIndex  );
+        }
+
+    if ( aIndex == activePlacesCount )
+        {
+        return iNumberEntry;
+        }
+
+    if ( iConfigFlags & EBMTouchCallhandling )
+        {
+        if ( aIndex == ( activePlacesCount + 1 ) )
+            {
+            return iMutedImage;    
+            }
+
+        return iTouchPane;
+        }
+    else
+        {
+        return iMutedImage;    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleManager::Draw
+// ---------------------------------------------------------------------------
+//
+void CBubbleManager::Draw( const TRect& aRect ) const
+    {
+    // clear the backround area.
+    CWindowGc& gc = SystemGc();
+    gc.SetBrushColor( AKN_LAF_COLOR( BubbleLayout::LayoutColourWhite() ) );
+
+    // Draw just the bitmaps
+    if ( iMainPaneControl &&
+         iMainPaneControl->IsVisible() )
+        {
+        // main pane image
+        iMainPaneControl->DrawBitmaps( aRect );
+        }
+    
+    for ( TInt i = 0 ; i < iActivePlaces->Count() ; i++ )
+        {
+        iActivePlaces->At(i)->GetBubbleOutlook().DrawBitmaps( gc );
+        }
+    
+    if ( iNumberEntry->IsUsed() )
+        {
+        iNumberEntry->DrawBitmaps(  gc );
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+//  CBubbleManager::MakeVisible
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleManager::MakeVisible( TBool aVisible )
+    {
+    CCoeControl::MakeVisible( aVisible );
+    
+    if ( aVisible )    
+        {
+        StartAnimations();    
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleManager::StartChanges
+//  
+//  Reset all places so there won't be anything wrong left.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::StartChanges( )
+    {
+    BM_TRACE_( "[BUBBLEMANAGER] CBubbleManager::StartChanges" );
+    iIsReadyToDraw++;
+    if ( iIsReadyToDraw > 1 ) // is this called already?
+        {
+        return;
+        }
+    
+    // clear all used areas
+    CBubblePlace* tempBubblePlace = NULL;
+    TInt placeCount = iBubblePlaces->Count();
+    for ( TUint8 index = 0 ; index < placeCount ; index++  ) 
+        {
+        tempBubblePlace = iBubblePlaces->At( index );
+        if ( tempBubblePlace->IsUsed() )
+            {
+            Window().Invalidate( tempBubblePlace->Rect() );
+            tempBubblePlace->SetIsUsed( EFalse );
+            }
+        }
+    
+    iActivePlaces->Delete( 0 , iActivePlaces->Count() ); // do not compress!!
+
+    if ( iTouchPane )
+        {
+        iTouchPane->SetUpdating( ETrue );                
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleManager::EndChanges
+//  
+//  Check the situation and decide which outlook to take. 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::EndChanges( )
+    {
+    BM_TRACE_( "[BUBBLEMANAGER] CBubbleManager::EndChanges" );
+     
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0 , Panic( EBMPanicErrorInStartAndEndChanges ) );
+
+    iIsReadyToDraw--;
+    if ( iIsReadyToDraw != 0 )
+        {
+        return;
+        }
+
+    if ( iConfHeader->IsExpanded() )
+        {
+        BuildExpandedConference();
+        }
+    else if ( iNumberEntry->IsUsed() && iNumberEntry->IsVisible() )
+        {
+        BuildBubblesWithNE();
+        }
+    else if ( ( iConfigFlags & EBMTouchCallhandling ) )
+        {
+        BuildBubblesForTouch();    
+        }
+    else
+        {
+        BuildBubbles();
+        }
+
+    // Stop video if playing and video bubble is not active.
+    if ( ( iVideoFlags & EBMVideoPlayingVideo ) &&
+         !( iVideoFlags & EBMVideoBubbleActive ) )
+        {
+        StopAndDeleteVideoPlayer();
+        }                
+
+    // Touch pane        
+    if ( iConfigFlags & EBMTouchCallhandling )
+        {
+        if ( iTouchPaneSetVisible &&        // Client sets
+             iActiveHeaders->Count() > 0 && // Incall situation                   
+             !iNumberEntry->IsVisible() )   
+            {
+            iTouchPane->MakeVisible( ETrue );
+            }
+        else
+            {
+            iTouchPane->MakeVisible( EFalse );    
+            }    
+        }
+
+    if ( ( iConfigFlags & EBMCallObjectDisplay ) && 
+         iActiveHeaders->Count() > 0 &&
+         !( iVideoFlags & EBMVideoBubbleActive ) )
+        {
+        // Image is created only for incoming & outgoing
+        // calls, check is inside method.
+        BuildMainPaneImage();
+        }
+    
+    SizeChanged();
+    
+    // Invalidate the new areas.
+    for ( TInt i = 0 ; i < iActivePlaces->Count() ; i++ )
+        {
+        iActivePlaces->At(i)->GetBubbleOutlook().DrawDeferred();
+        }
+    if ( iNumberEntry->IsUsed() )
+        {
+        iNumberEntry->DrawDeferred();
+        iNumberEntry->GetEditor()->DrawDeferred();
+        }
+        
+    if ( iTouchPane )
+        {
+        iTouchPane->SetUpdating( EFalse );
+        }
+            
+#ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
+    TBool calledBegin = (TBool) CAknTransitionUtils::GetData( ( TInt ) this );
+    // Only draw parent control if no number entry exists, the number entry is
+    // used or if begin has not been called.
+    if ( !iNumberEntry || iNumberEntry->IsUsed() || !calledBegin )
+        {
+        // Do redraw. Do not use DrawDeferred() here!
+        iParentControl->DrawNow();
+        }
+#else
+    // Do redraw. Do not use DrawDeferred() here!
+    iParentControl->DrawNow();
+#endif
+    // Start animations. 
+    StartAnimations();
+    
+    // Start video if video bubble is active.
+    if ( ( iVideoFlags & EBMVideoBubbleActive ) &&
+         !( iVideoFlags & EBMVideoPlayingVideo ) )
+        {
+        CreateVideoPlayerAndPlay();
+        }
+#ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
+    if ( calledBegin )
+        {
+        // Initialize transition effect
+        CAknTransitionUtils::SetAllParents( iNumberEntry );
+        GfxTransEffect::SetDemarcation( iNumberEntry, iNumberEntry->Rect() );
+        GfxTransEffect::End( iNumberEntry );
+
+        // Reset begin call reminder
+        CAknTransitionUtils::SetData( (TInt) this, 0 );
+        }
+    // SetFocus here instead of in SetNumberEntryVisible
+    if ( iNumberEntry->IsVisible() )
+        {
+        iNumberEntry->SetFocus( ETrue );
+        }
+#endif
+    return;
+    }
+
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetActivePlace
+//  
+//  This helps the EndChanges() to make bubble places active.
+// ---------------------------------------------------------------------------
+//
+void CBubbleManager::SetActivePlace( 
+    const CBubblePlace::TPhoneBubblePlace& aPlace , 
+    CBubbleHeader& aHeader )
+    {
+    CBubblePlace* place = iBubblePlaces->At( aPlace );
+    place->SetIsUsed( ETrue );
+    CBubbleOutlook& bubbleOutlook = place->GetBubbleOutlook( );
+    bubbleOutlook.ReadBubbleHeader( aHeader );
+    iActivePlaces->InsertL( iActivePlaces->Count( ), place ); // Can't leave
+    }
+
+
+void CBubbleManager::BuildExpandedConference()
+    {
+    iNumberEntry->SetPlace( CBubbleOutlookNumberEntry::ENENone );
+    switch ( iConfHeader->RowCount() )
+        {
+        // Cases mean number of calls in conference.
+        case 2:
+            SetActivePlace( CBubblePlace::E2InConf , *iConfHeader );
+            break;
+        case 3:
+            SetActivePlace( CBubblePlace::E3InConf , *iConfHeader );
+            break;
+        case 4:
+            SetActivePlace( CBubblePlace::E4InConf , *iConfHeader );
+            break;
+        case 5:
+            SetActivePlace( CBubblePlace::E5InConf , *iConfHeader );
+            break;
+        default:
+            Panic( EBMPanicPlaceEnumerationDoesNotExist );
+            break;
+        }
+    return;
+    }
+
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::FindNextDrawableHeader
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleManager::FindNextDrawableHeader( TUint8& aIndex )
+    {
+    while( iActiveHeaders->At( aIndex )->IsInConference() ) 
+        {
+        aIndex++;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::ShownHeaderCount
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TUint8 CBubbleManager::ShownHeaderCount() const
+    {
+    // We have to find headers that are really shown. 
+    // That means headers which are 
+    // used and are NOT in conference. 
+    TUint8 bubbleAmount = 0;
+    TUint activeCount = iActiveHeaders->Count();
+    for (TUint8 i = 0 ; i < activeCount ; i++ )
+        {
+        if ( !iActiveHeaders->At(i)->IsInConference() )
+            {
+            bubbleAmount++;
+            }
+        }
+    return bubbleAmount;
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::BuildBubbles
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleManager::BuildBubbles()
+    { 
+    const TUint8 bubbleAmount = ShownHeaderCount();
+    iVideoFlags &= ~EBMVideoBubbleActive;
+    
+    // Without number entry.
+    switch ( bubbleAmount )
+        {
+        case 0:
+            break;
+        case 1:
+            {
+            TUint8 index = 0;
+            FindNextDrawableHeader( index );
+            CBubbleHeader* header = iActiveHeaders->At( index );
+            TPhoneCallState callState = header->CallState();
+            TBool callObjectText( 
+                  ( iConfigFlags & EBMCallObjectDisplay ) && 
+                  ( header->CallObjectText().Length() > 0) );
+            TBool callObjectImage( 
+                  ( iConfigFlags & EBMCallObjectDisplay ) && 
+                  header->CallObjectImage() );                  
+            
+            TInt cnapLength = header->CNAP().Length();
+
+            // Video
+            if ( callState == EIncoming && 
+                 iVideoFlags & EBMVideoSetAsRingTone )
+                {
+                if ( cnapLength ) // 3-lines
+                    {
+                    SetActivePlace( CBubblePlace::EVideoCnap, 
+                                    *header );
+                                    iVideoFlags |= EBMVideoBubbleActive;
+                    }
+                else
+                    {
+                    SetActivePlace( CBubblePlace::EVideo, 
+                                    *header );
+                                    iVideoFlags |= EBMVideoBubbleActive;    
+                    }                            
+                }
+            // Caller text                    
+            else if ( callObjectText && ( callState == EIncoming || 
+                                          callState == EOutgoing ||
+                                          callState == EAlerting ||
+                                          callState == EAlertToDisconnected ) )
+                {
+                SetActivePlace( CBubblePlace::EBottomText,
+                                *header );                            
+                }
+            // Caller image
+            else if ( callObjectImage && ( callState == EActive ||
+                                           callState == EOnHold ||
+                                           callState == EDisconnected ) )
+                {
+                CBubbleHeader::TBMCallObjectImageType imageType = 
+                    header->CallObjectImageType();
+
+                // Theme image -> use normal bubble                        
+                if ( imageType == CBubbleHeader::EThemeImage ||
+                     imageType == CBubbleHeader::ETextBasedImage )
+                    {
+                    if ( cnapLength ) // 3-lines
+                        {
+                        SetActivePlace( CBubblePlace::EBottomCnap,
+                                        *header );    
+                        }
+                    else
+                        {
+                        SetActivePlace( CBubblePlace::EBottom,
+                                        *header );    
+                        }                                
+                    }
+                // Caller image -> use bigger bubble                                                    
+                else
+                    {
+                    TSize imageSize = header->CallObjectImage()->SizeInPixels();
+                    TSize tinySize = CallObjectImageIncallSize( ETrue );
+                    TBool tiny = imageSize.iHeight < tinySize.iHeight;
+                    iBottomImageVariety = tiny ? 0 : 4;
+                    
+                    if ( cnapLength ) // 3-lines
+                        {
+                        CBubblePlace::TPhoneBubblePlace place = tiny ?
+                            CBubblePlace::EBottomCnap : CBubblePlace::EBottomImageCnap;
+                        
+                        SetActivePlace( place,
+                                        *header );                        
+                        }
+                    else 
+                        {
+                        CBubblePlace::TPhoneBubblePlace place = tiny ?
+                            CBubblePlace::EBottom : CBubblePlace::EBottomImage;
+                        
+                        SetActivePlace( place,
+                                        *header );                        
+                        }                           
+                    }
+                }
+            // Basic
+            else
+                {
+                if ( cnapLength ) // 3-lines
+                    {
+                    SetActivePlace( CBubblePlace::EBottomCnap,
+                                    *header );
+                    }
+                else
+                    {
+                    SetActivePlace( CBubblePlace::EBottom ,
+                                    *header );
+                    }    
+                }
+            break;
+            }
+        case 2:
+            {
+            // first call: middle held/active
+            TUint8 index = 0;
+            FindNextDrawableHeader( index );
+            TPhoneCallState callState = 
+                iActiveHeaders->At( index )->CallState();
+            TInt cnapLength = iActiveHeaders->At( index )->CNAP().Length();                
+
+            // second call: bottom held/active
+            TUint8 index2 = TUint8(index + 1);
+            FindNextDrawableHeader( index2 );
+            TInt cnapLength2 = iActiveHeaders->At( index2 )->CNAP().Length();
+            TPhoneCallState callState2 = 
+                iActiveHeaders->At( index2 )->CallState();
+
+            
+            CBubblePlace::TPhoneBubblePlace place;
+            
+            if ( callState == EOnHold  )
+                {
+                place = CBubblePlace::EMiddleHeld;
+                }
+            else if ( cnapLength  ) // and not held
+                {
+                place = CBubblePlace::EMiddleCnap;    
+                }
+            else
+                {
+                place = CBubblePlace::EMiddleActive;
+                }                
+            
+            CBubblePlace::TPhoneBubblePlace place2 = 
+                CBubblePlace::EBottomRightActive;
+            
+            if ( callState2 == EOnHold )
+                {
+                place2 = CBubblePlace::EBottomRightHeld;
+                }
+            else if ( cnapLength2 ) // and not held
+                {
+                if ( cnapLength == 0 ||
+                     callState2 == EOutgoing ||
+                     callState2 == EAlerting || 
+                     callState2 == EAlertToDisconnected ||
+                     callState2 == EWaiting ||
+                     callState2 == EActive )                
+                    {
+                    // bottom shows 3-lines
+                    place = CBubblePlace::EMiddleHeld;
+                    place2 = CBubblePlace::EBottomRightCnap;
+                    }
+                else
+                    {
+                    place2 = CBubblePlace::EBottomRightHeld;
+                    }                    
+                }
+            else
+                {
+                place2 = CBubblePlace::EBottomRightActive;    
+                }                
+            
+            // set drawing order
+            if ( callState2 > callState )
+                {
+                SetActivePlace( place , *iActiveHeaders->At( index ) );
+                SetActivePlace( place2 , *iActiveHeaders->At( index2 ) );
+                }
+            else
+                {
+                SetActivePlace( place2 , *iActiveHeaders->At( index2 ) );
+                SetActivePlace( place , *iActiveHeaders->At( index ) );
+                }                    
+            }
+            break;
+        case 3:
+            {
+            TUint8 index = 0;
+            FindNextDrawableHeader( index );
+            
+            TUint8 index2 = TUint8( index + 1 );
+            FindNextDrawableHeader( index2 );
+            
+            if ( iActiveHeaders->At( index2 )->CallState( ) 
+                > iActiveHeaders->At( index )->CallState( ) )
+                {
+                SetActivePlace( 
+                    CBubblePlace::ETopLeft , *iActiveHeaders->At( index ) );
+                SetActivePlace( 
+                    CBubblePlace::ETopRight , *iActiveHeaders->At( index2 ) );
+                }
+            else
+                {
+                SetActivePlace( 
+                    CBubblePlace::ETopRight , *iActiveHeaders->At( index2 ) );
+                SetActivePlace( 
+                    CBubblePlace::ETopLeft , *iActiveHeaders->At( index ) );
+                }
+            
+            
+            index = TUint8( index2 + 1 );
+            FindNextDrawableHeader( index );
+            SetActivePlace( 
+                CBubblePlace::EBottom , *iActiveHeaders->At( index ) );
+            break;
+            }
+        default:
+            Panic( EBMPanicInvalidNumberOfHeaders );
+            break;
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+//  CBubbleManager::BuildBubblesWithNE
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleManager::BuildBubblesWithNE()
+    { 
+    const TUint8 bubbleAmount = ShownHeaderCount();
+    iVideoFlags &= ~EBMVideoBubbleActive;
+    
+    switch ( bubbleAmount )
+        {
+        case 0:
+            if ( iConfigFlags & EBMBigNEInIdleState )
+                {
+                iNumberEntry->SetPlace(
+                    CBubbleOutlookNumberEntry::ENEIdleState );
+                }
+            else
+                {
+                iNumberEntry->SetPlace(
+                    CBubbleOutlookNumberEntry::ENEBottom );
+                }                
+            break;
+        case 1:
+            {
+            // NE is placed according to it's activation time compared 
+            // to call's activation.
+            TUint8 index = 0;
+            FindNextDrawableHeader( index );
+            TInt cnapLength = iActiveHeaders->At( index )->CNAP().Length();
+            TPhoneCallState callState = 
+                iActiveHeaders->At( index )->CallState();
+
+            CBubbleOutlook& bubbleOutlook = 
+                iBubblePlaces->
+                    At( CBubblePlace::EMiddleHeld )->GetBubbleOutlook( );
+            CBubbleOutlookMiddle& bubbleMiddle =  
+                static_cast< CBubbleOutlookMiddle& >( bubbleOutlook ) ;
+            bubbleMiddle.SetIsUnder( ETrue );
+
+            if ( cnapLength )
+                {
+                SetActivePlace( CBubblePlace::EMiddleCnap ,
+                                *iActiveHeaders->At( index ) );
+                }
+            else
+                {
+                SetActivePlace( CBubblePlace::EMiddleHeld ,
+                                *iActiveHeaders->At( index ) );
+                }
+            iNumberEntry->SetPlace( CBubbleOutlookNumberEntry::ENEBottomRight );
+            break;
+            }
+        case 2:
+            {
+            // NE goes top left. Calls go like second and waiting 
+            // call when there are three calls.
+            iNumberEntry->SetPlace( CBubbleOutlookNumberEntry::ENEBottom );
+                        
+            // first call: middle held/active
+            TUint8 index = 0;
+            FindNextDrawableHeader( index );
+            CBubblePlace::TPhoneBubblePlace place = CBubblePlace::ETopLeft;
+            
+            // second call: bottom held/active
+            TUint8 index2 = TUint8(index + 1);
+            FindNextDrawableHeader( index2 );
+            CBubblePlace::TPhoneBubblePlace place2 = CBubblePlace::ETopRight;
+                        
+            // set drawing order
+            if ( iActiveHeaders->At( index2 )->CallState( ) 
+                > iActiveHeaders->At( index )->CallState( ) )
+                {
+                SetActivePlace( place , *iActiveHeaders->At( index ) );
+                SetActivePlace( place2 , *iActiveHeaders->At( index2 ) );
+                }
+            else
+                {
+                SetActivePlace( place2 , *iActiveHeaders->At( index2 ) );
+                SetActivePlace( place , *iActiveHeaders->At( index ) );
+                }                    
+            
+            break;
+            }
+        case 3:
+            {
+            iNumberEntry->SetPlace( CBubbleOutlookNumberEntry::ENEBottom );
+            
+            TUint8 index = 0;
+            FindNextDrawableHeader( index );
+            
+            TUint8 index2 = TUint8( index + 1 );
+            FindNextDrawableHeader( index2 );
+                        
+            if ( iActiveHeaders->At( index2 )->CallState( ) 
+                > iActiveHeaders->At( index )->CallState( ) )
+                {
+                SetActivePlace( 
+                    CBubblePlace::EHide , *iActiveHeaders->At( index ) );
+                SetActivePlace( 
+                    CBubblePlace::ETopLeft , *iActiveHeaders->At( index2 ) );
+                }
+            else
+                {
+                SetActivePlace( 
+                    CBubblePlace::EHide , *iActiveHeaders->At( index2 ) );
+                SetActivePlace( 
+                    CBubblePlace::ETopLeft , *iActiveHeaders->At( index ) );
+                }
+            
+            index = TUint8( index2 + 1 );
+            FindNextDrawableHeader( index );
+            SetActivePlace( 
+                CBubblePlace::ETopRight , *iActiveHeaders->At( index ) );
+            break;
+            }
+        default:
+            Panic( EBMPanicInvalidNumberOfHeaders );
+            break;
+        }
+    return;           
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::BuildBubblesForTouch
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleManager::BuildBubblesForTouch()
+    {
+    const TUint8 bubbleAmount = ShownHeaderCount();
+    iVideoFlags &= ~EBMVideoBubbleActive;
+    
+    // Without number entry.
+    switch ( bubbleAmount )
+        {
+        case 0:
+            break;
+        case 1:
+            {
+            TUint8 index = 0;
+            FindNextDrawableHeader( index );
+            CBubbleHeader* header = iActiveHeaders->At( index );
+            TPhoneCallState callState = header->CallState();
+            TBool callObjectText( 
+                  ( iConfigFlags & EBMCallObjectDisplay ) && 
+                  ( header->CallObjectText().Length() > 0) );
+            TBool callObjectImage( 
+                  ( iConfigFlags & EBMCallObjectDisplay ) && 
+                  header->CallObjectImage() );                  
+            
+            TInt cnapLength = header->CNAP().Length();
+
+            // Video
+            if ( iVideoFlags & EBMVideoSetAsRingTone &&
+                 ( callState == EIncoming || callState == EAlertToDisconnected ) )
+                {
+                if ( cnapLength ) // 3-lines
+                    {
+                    SetActivePlace( CBubblePlace::EVideoCnap, 
+                                    *header );
+                                    iVideoFlags |= EBMVideoBubbleActive;
+                    }
+                else
+                    {
+                    SetActivePlace( CBubblePlace::EVideo, 
+                                    *header );
+                                    iVideoFlags |= EBMVideoBubbleActive;    
+                    }                            
+                }
+            // Caller text                    
+            else if ( callObjectText && ( callState == EIncoming || 
+                                          callState == EOutgoing ||
+                                          callState == EAlerting ||
+                                          callState == EAlertToDisconnected ) )
+                {
+                SetActivePlace( CBubblePlace::EBottomText,
+                                *header );                            
+                }
+            // Incall
+            else if ( ( callState == EActive ||
+                        callState == EOnHold ||
+                        callState == EDisconnected ) )                
+                {
+                CBubbleHeader::TBMCallObjectImageType imageType = 
+                    header->CallObjectImageType();
+                
+                if ( callObjectImage && 
+                     ( imageType == CBubbleHeader::EGalleryImage ) )
+                    {
+                    TSize imageSize = header->CallObjectImage()->SizeInPixels();
+                    TSize tinySize = CallObjectImageIncallSize( ETrue );
+                    TBool tiny = imageSize.iHeight < tinySize.iHeight;
+                    iBottomImageVariety = tiny ? 0 : 4;
+                    
+                    CBubblePlace::TPhoneBubblePlace place;
+                    place = cnapLength ? CBubblePlace::EBottomImageCnap :
+                                         CBubblePlace::EBottomImage;
+                    
+                    SetActivePlace( place,
+                                    *header );                        
+                    }
+                else
+                    {
+                    CBubblePlace::TPhoneBubblePlace place =
+                        cnapLength ? CBubblePlace::EBottomCnap :
+                                     CBubblePlace::EBottom;
+                    
+                    SetActivePlace( place,
+                                    *header );
+                    }
+                }
+            // Initializing call
+            else
+                {
+                if ( cnapLength ) // 3-lines
+                    {
+                    SetActivePlace( CBubblePlace::EBottomCnap,
+                                    *header );
+                    }
+                else
+                    {
+                    SetActivePlace( CBubblePlace::EBottom ,
+                                    *header );
+                    }    
+                }                
+            break;
+            }
+        case 2:
+            {
+            // first call: middle held/active
+            TUint8 index = 0;
+            FindNextDrawableHeader( index );
+            TPhoneCallState callState = 
+                iActiveHeaders->At( index )->CallState();
+            TInt cnapLength = iActiveHeaders->At( index )->CNAP().Length();                
+
+            // second call: bottom held/active
+            TUint8 index2 = TUint8(index + 1);
+            FindNextDrawableHeader( index2 );
+            TInt cnapLength2 = iActiveHeaders->At( index2 )->CNAP().Length();
+            TPhoneCallState callState2 = 
+                iActiveHeaders->At( index2 )->CallState();
+            TPhoneCallState previousState = 
+                iActiveHeaders->At( index )->PreviousCallState();                
+            TPhoneCallState previousState2 = 
+                iActiveHeaders->At( index2 )->PreviousCallState();                
+
+            CBubblePlace::TPhoneBubblePlace place;
+            CBubblePlace::TPhoneBubblePlace place2;
+            
+            if ( !InitializingCall() ) // Incall
+                {
+                if ( ( callState == EActive  ) ||
+                     ( callState == EDisconnected &&
+                       previousState == EActive ) )
+                    {
+                    // First call shown on bottom
+                    place = cnapLength ? 
+                            CBubblePlace::EBottomRightActiveCnapTouch :
+                            CBubblePlace::EBottomRightActiveTouch;
+                    place2 = CBubblePlace::EMiddleHeldTouch;    
+                    }
+                else if ( ( callState2 == EActive )  ||
+                          ( callState2 == EDisconnected &&
+                            previousState2 == EActive ) )
+                    {
+                    // Second call is shown on bottom
+                    place = CBubblePlace::EMiddleHeldTouch;
+                    place2 = cnapLength2 ? 
+                             CBubblePlace::EBottomRightActiveCnapTouch :
+                             CBubblePlace::EBottomRightActiveTouch;    
+                    }
+                else 
+                    {
+                    // The call that was shown in the held call position
+                    // keeps that position.
+                    if ( previousState == EOnHold )
+                        {
+                        place = CBubblePlace::EMiddleHeldTouch;
+                        place2 = cnapLength2 ? 
+                                 CBubblePlace::EBottomRightActiveCnapTouch :
+                                 CBubblePlace::EBottomRightActiveTouch;    
+                        }
+                    else
+                        {
+                        place = cnapLength ? 
+                                CBubblePlace::EBottomRightActiveCnapTouch :
+                                CBubblePlace::EBottomRightActiveTouch;
+                        place2 = CBubblePlace::EMiddleHeldTouch;    
+                        }
+                    }
+                }
+            else // Initializing call
+                {
+                // the call that is in initializing state is shown in
+                // primary position.
+                place = CBubblePlace::ETopLeft;
+                place2 =  cnapLength2 ? CBubblePlace::EBottomRightCnap :
+                                        CBubblePlace::EBottomRightActive;
+                }                
+            
+            // set drawing order
+            if ( callState2 > callState )
+                {
+                SetActivePlace( place , *iActiveHeaders->At( index ) );
+                SetActivePlace( place2 , *iActiveHeaders->At( index2 ) );
+                }
+            else
+                {
+                SetActivePlace( place2 , *iActiveHeaders->At( index2 ) );
+                SetActivePlace( place , *iActiveHeaders->At( index ) );
+                }                    
+            }
+            break;
+        case 3:
+            {
+            TUint8 index = 0;
+            FindNextDrawableHeader( index );
+            
+            TUint8 index2 = TUint8( index + 1 );
+            FindNextDrawableHeader( index2 );
+            
+            if ( iActiveHeaders->At( index2 )->CallState( ) 
+                > iActiveHeaders->At( index )->CallState( ) )
+                {
+                SetActivePlace( 
+                    CBubblePlace::ETopRight , *iActiveHeaders->At( index ) );
+                SetActivePlace( 
+                    CBubblePlace::ETopLeft , *iActiveHeaders->At( index2 ) );
+                }
+            else
+                {
+                SetActivePlace( 
+                    CBubblePlace::ETopRight , *iActiveHeaders->At( index2 ) );
+                SetActivePlace( 
+                    CBubblePlace::ETopLeft , *iActiveHeaders->At( index ) );
+                }
+            
+            
+            index = TUint8( index2 + 1 );
+            FindNextDrawableHeader( index );
+            SetActivePlace( 
+                CBubblePlace::EBottomRightActive , *iActiveHeaders->At( index ) );
+            break;
+            }
+        default:
+            Panic( EBMPanicInvalidNumberOfHeaders );
+            break;
+        }    
+    }
+    
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetPhoneMuted
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::SetPhoneMuted( const TBool& aIsMuted )
+    {
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+
+    if ( aIsMuted && iMutedImage->Bitmap() == NULL )
+        {
+        iImageManager->SetBitmapToImage( iMutedImage , 
+                                     EQgn_indi_call_muted , 
+                                     EQgn_indi_call_muted_mask );
+        }
+
+    iIsMuted = aIsMuted;
+    iMutedImage->MakeVisible( iIsMuted );
+    if ( !iIsMuted )
+        {
+        iMutedImage->DrawDeferred();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::CreateCallHeader
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CBubbleManager::TBubbleId CBubbleManager::CreateCallHeader( )
+    {
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+    
+    // find unused call header for use.
+    
+    TUint8 index = 0;
+    while ( iCallHeaders->At( index )->IsUsed( ) )
+        {
+        index++;
+        __ASSERT_ALWAYS( index < iCallHeaders->Count( ), 
+                         Panic( EBMPanicInvalidNumberOfHeaders ) );
+        }
+
+    CBubbleCallHeader* header = iCallHeaders->At( index );
+    
+    header->SetIsUsed( ETrue );
+    iActiveHeaders->InsertL( iActiveHeaders->Count( ), header );// Can't leave
+    
+    return header->BubbleId( );
+    }
+    
+// ---------------------------------------------------------------------------
+//  CBubbleManager::RemoveCallHeader
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::RemoveCallHeader( const TBubbleId& aBubbleId )
+    {
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+    
+    // find header
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,  
+                     Panic( EBMPanicBubbleIdIsNotInUse ) );
+    
+    if ( header->IsConference() )
+        {
+        __ASSERT_DEBUG( 
+            EFalse , Panic( EBMPanicReferredHeaderIsConferenceHeader ) );
+        return;
+        }
+    
+    if ( header->IsInConference() )
+        {
+        __ASSERT_DEBUG( 
+            EFalse , Panic( EBMPanicReferredCallHeaderIsInConferenceCall ) );
+        return;
+        }
+    
+    header->Reset();
+    
+    
+    // find the active header from array
+    TUint8 index = 0;
+    while ( iActiveHeaders->At( index )->BubbleId( ) != aBubbleId )
+        {
+        index++;
+        }
+        
+    iActiveHeaders->Delete( index );
+    
+    iCustomManager->RemoveCustomElements( aBubbleId );
+    
+    // remove main pane call object
+    if ( iMainPaneControl && 
+         iMainPaneControl->BubbleId() == aBubbleId )
+        {
+        iMainPaneControl->Reset();
+        }
+        
+    if ( ( iConfigFlags & EBMCallObjectDisplay ) && iCallObjectManager )
+        {
+        iCallObjectManager->CancelCallObjectLoading( aBubbleId );            
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetState
+//  
+//  for conf also (active/on hold/ none)
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::SetState( const TBubbleId& aBubbleId, 
+                                        const TPhoneCallState& aState )
+    {    
+    
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+    
+    // find header
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,  
+                     Panic( EBMPanicBubbleIdIsNotInUse ) );
+    
+    TPhoneCallState oldstate = header->CallState();
+    header->SetCallState( aState );
+
+    TUint activeCount = iActiveHeaders->Count();
+    
+    //check if we have to change the bubble order
+    if ( (oldstate == EAlerting || oldstate == EOutgoing 
+        || oldstate == EWaiting || oldstate == EIncoming ) 
+        && aState == EActive 
+        && iActiveHeaders->At( activeCount - 1 )->BubbleId() == aBubbleId)
+        {
+        //so we know that the connected call was the last
+        if ( activeCount > 1 )
+            {
+            //we know that there is another call
+            TPhoneCallState previouscallstate = 
+                iActiveHeaders->At( activeCount - 2 )->CallState();
+            
+            if ( previouscallstate == EAlerting 
+                || previouscallstate == EOutgoing 
+                || previouscallstate == EWaiting 
+                || previouscallstate == EIncoming 
+                || previouscallstate == EAlertToDisconnected )
+                {
+                //we know that it's too about to get connection
+                
+                // now we must change the bubble order so active bubble
+                // don't stay under rectangular bubble.
+                
+                CBubbleHeader* tempBubble = 
+                    iActiveHeaders->At( activeCount-2 );
+                iActiveHeaders->At( activeCount-2 ) = 
+                                    iActiveHeaders->At(activeCount-1 );
+                iActiveHeaders->At( activeCount-1 ) = tempBubble;
+                }
+            
+            }
+        
+        }
+
+    // Call collision exception cases:
+
+    // Case: AlertToDisconnected + Waiting
+    // We have change the drawing order:
+    if ( activeCount == 2 )
+        {
+        if ( iActiveHeaders->At(0)->CallState() == EAlertToDisconnected
+            && iActiveHeaders->At(1)->CallState() == EWaiting )
+            {
+            // now we must change the bubble order so waiting bubble
+            // don't stay under alerttodisconnected bubble.
+            CBubbleHeader* tempBubble = iActiveHeaders->At(0);
+            iActiveHeaders->At(0) = iActiveHeaders->At(1);
+            iActiveHeaders->At(1) = tempBubble;
+            }
+        }
+    
+    }
+
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetLabel
+//  
+//  for conf also 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::SetLabel( 
+    const TBubbleId& aBubbleId, 
+    const TDesC& aText, 
+    const TPhoneClippingDirection& aClipDirection)
+    {
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+    
+    // find header
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
+        Panic( EBMPanicBubbleIdIsNotInUse ) );
+    
+    BubbleUtils::AddTextToHeader( *header, 
+                                  BubbleUtils::EBubbleHeaderLabel , 
+                                  aText , 
+                                  KBubbleLabelMaxLength ,
+                                  aClipDirection ); 
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetLabel
+//  
+//  for conf also 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::SetLabel( 
+    const TBubbleId& aBubbleId, 
+    const TDesC& aLongText, 
+    const TDesC& aShortText, 
+    const TPhoneClippingDirection& aClipDirection)
+    {
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+    
+    // find header
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,  
+        Panic( EBMPanicBubbleIdIsNotInUse ) );
+    
+    // set both text to single buffer. text are cut from the end.
+    TInt shortLength = aShortText.Length();
+    TInt longLength = aLongText.Length();
+    TInt textLength = longLength + shortLength + 1;
+
+    TPtr16 textPtr = iLabelBuf->Des();
+    textPtr.Zero();
+    if ( textPtr.MaxLength() < textLength )
+        {        
+        TRAPD ( err, iLabelBuf = iLabelBuf->ReAllocL( textLength ) );
+        textPtr.Set( iLabelBuf->Des() );
+        textPtr.Zero();
+        if ( longLength > 0 )
+            {
+            if ( err != KErrNone )
+                {
+                longLength = textPtr.MaxLength() - shortLength - 1;
+                textPtr.Append( aLongText.Left( longLength ) );
+                }
+            else
+                {
+                textPtr.Append( aLongText );
+                }
+            }
+        else
+            {
+            textPtr.Append( KNullDesC );
+            }
+        }
+    else
+        {
+        if ( longLength > 0 )
+            {
+            textPtr.Append( aLongText );
+            }
+        else
+            {
+            textPtr.Append( KNullDesC );
+            }
+        }
+
+    textPtr.Append( KBubbleTextSeparator );
+
+    if ( shortLength > 0 )
+        {
+        textPtr.Append( aShortText );
+        }
+    else
+        {
+        textPtr.Append( KNullDesC );
+        }
+
+    header->SetText( textPtr , aClipDirection );
+    }
+
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetCLI
+//  
+//  for conf also 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::SetCLI( 
+    const TBubbleId& aBubbleId, 
+    const TDesC& aCLIText, 
+    const TPhoneClippingDirection& aClipDirection  )
+    {
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+    
+    // find header
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,  
+        Panic( EBMPanicBubbleIdIsNotInUse ) );
+    
+
+    // We have a number
+    if ( aClipDirection == ELeft )
+        {
+        BubbleUtils::AddTextToHeader( *header, 
+                                  BubbleUtils::EBubbleHeaderCLI , 
+                                  NumberGroup( aCLIText ), 
+                                  KBubbleLabelMaxLength ,
+                                  aClipDirection ); 
+        }
+    else
+        {
+        BubbleUtils::AddTextToHeader( *header, 
+                                  BubbleUtils::EBubbleHeaderCLI , 
+                                  aCLIText , 
+                                  KBubbleLabelMaxLength ,
+                                  aClipDirection ); 
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::UpdateCLI
+//  
+//  for conf also 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::UpdateCLI( 
+    const TBubbleId& aBubbleId, 
+    const TDesC& aCLIText, 
+    const TPhoneClippingDirection& aClipDirection )
+    {
+    // find header
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,  
+                     Panic( EBMPanicBubbleIdIsNotInUse ) );
+    
+    BubbleUtils::AddTextToHeader( *header, 
+                                  BubbleUtils::EBubbleHeaderCLI , 
+                                  aCLIText , 
+                                  KBubbleLabelMaxLength ,
+                                  aClipDirection );
+    
+    
+    // Tell active bubbles to update their CLI if it's visible.
+    CBubbleOutlook* outlook = NULL;
+    TInt placeCount = iActivePlaces->Count();
+    for ( TUint8 index = 0 ; index < placeCount ; index++ )
+        {
+        outlook = &iActivePlaces->At( index )->GetBubbleOutlook( );
+        outlook->DrawCLINow();
+        }
+    
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetCallTime
+//  
+//  for conf also 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::SetCallTime( const TBubbleId& aBubbleId, 
+                                           const TDesC& aCallTime )
+    {
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+    
+    // find header
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,  
+        Panic( EBMPanicBubbleIdIsNotInUse ) );
+    
+
+    BubbleUtils::AddTextToHeader( *header, 
+                                  BubbleUtils::EBubbleHeaderTimerCost , 
+                                  aCallTime , 
+                                  KBubbleLabelMaxLength ,
+                                  CBubbleManager::ERight );
+
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::UpdateCallTime
+//  
+//  for conf also 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::UpdateCallTime( const TBubbleId& aBubbleId, 
+                                              const TDesC& aCallTime )
+    {
+    // find header
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,  
+                     Panic( EBMPanicBubbleIdIsNotInUse ) );
+    
+    BubbleUtils::AddTextToHeader( *header, 
+                                  BubbleUtils::EBubbleHeaderTimerCost , 
+                                  aCallTime , 
+                                  KBubbleLabelMaxLength ,
+                                  CBubbleManager::ERight );
+    
+    // Tell active bubbles to update their timer/cost text if it's visible.
+    CBubbleOutlook* outlook = NULL;
+    TInt placeCount = iActivePlaces->Count();
+    for ( TUint8 index = 0 ; index < placeCount ; index++ )
+        {
+        outlook = &iActivePlaces->At( index )->GetBubbleOutlook( );
+        outlook->DrawTimerCostNow();
+        }
+    
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::UpdateCallHeaderText
+//  
+//  for conf also 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::UpdateCallHeaderText( const TBubbleId& aBubbleId, 
+                                            const TDesC& aLongText, 
+                                            const TDesC& aShortText, 
+                                            const TPhoneClippingDirection& aClipDirection )
+    {
+    // find header
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,  
+                     Panic( EBMPanicBubbleIdIsNotInUse ) );
+    
+    iIsReadyToDraw++;
+    SetLabel( aBubbleId, aLongText, aShortText, aClipDirection);
+    iIsReadyToDraw--;
+
+    // Tell active bubbles to update call header text if it's visible.
+    CBubbleOutlook* outlook = NULL;
+    TInt placeCount = iActivePlaces->Count();
+    for ( TUint8 index = 0 ; index < placeCount ; index++ )
+        {
+        outlook = &iActivePlaces->At( index )->GetBubbleOutlook( );        
+        outlook->DrawCallHeaderText();
+        }
+    
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetThumbnail
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::SetThumbnail( const TBubbleId& aBubbleId, 
+                                            CFbsBitmap* aTnBitmap, 
+                                            CFbsBitmap* aTnBitmapMask,
+                                            TBool aDataOwnershipTransferred )
+    {
+    if ( !(iConfigFlags & EBMCallObjectDisplay) )
+        {
+        __ASSERT_ALWAYS( 
+            iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+        }
+    
+    // find header
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,  
+                     Panic( EBMPanicBubbleIdIsNotInUse ) );
+    
+    header->SetTnBitmap( aTnBitmap );
+    header->SetTnBitmapMask( aTnBitmapMask );
+    header->SetTnDataOwnership( aDataOwnershipTransferred );
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetCallFlags
+//  
+//  for conf also 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::SetCallFlags( const TBubbleId& aBubbleId, 
+                                            const TUint32& aFlags ) 
+    {
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+    
+    // find header
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,  
+                     Panic( EBMPanicBubbleIdIsNotInUse ) );
+    
+    header->SetCallFlags( aFlags );
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetCallFlag
+//  
+//  for conf also 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::SetCallFlag( const TBubbleId& aBubbleId, 
+                                           const TPhoneCallTypeFlags& aFlag, 
+                                           const TBool& aSet )
+    {
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+    
+    // find header
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,  
+                                       Panic( EBMPanicBubbleIdIsNotInUse ) );
+    
+    if ( aSet )
+        {
+        header->SetCallFlag( aFlag );
+        }
+    else 
+        {
+        header->RemoveCallFlag( aFlag );
+        } 
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetNumberType
+//  
+//  
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::SetNumberType( const TBubbleId& aBubbleId, 
+                                             const TPhoneNumberType& aNumType )
+    {
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+    
+    // find header
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,  
+                     Panic( EBMPanicBubbleIdIsNotInUse ) );
+    
+    header->SetNumberType( aNumType );
+    }
+
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetPbkNumberType
+//  
+//  
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::SetPbkNumberType( const TBubbleId& aBubbleId, 
+                                                const TInt aNumType )
+    {
+    TPhoneNumberType numType = ENotSet;
+    switch ( aNumType )
+        {  
+        case EPbkFieldIdPhoneNumberMobile:
+            numType = EMobile;
+            break;
+        case EPbkFieldIdPhoneNumberStandard:
+        case EPbkFieldIdPhoneNumberHome:
+        case EPbkFieldIdPhoneNumberWork:
+            numType = EPhone;
+            break;
+        case EPbkFieldIdFaxNumber:
+            numType = EFaxNumber;
+            break;
+        case EPbkFieldIdPagerNumber:
+            numType = EPager;
+            break;
+        case EPbkFieldIdCarNumber:
+            numType = ECar;
+            break;            
+        case EPbkFieldIdAssistantNumber:
+            numType = EAssistant;
+            break;            
+        case EPbkFieldIdNone:       // flow through
+        default:
+            numType = ENotSet;
+            break;
+        }
+    SetNumberType( aBubbleId , numType );
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetPhCntNumberType
+//  
+//  
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::SetPhCntNumberType( 
+    const TBubbleId& aBubbleId,
+    const MPhCntMatch::TNumberType aNumberType )    
+    {
+#ifdef RD_VIRTUAL_PHONEBOOK
+    TPhoneNumberType numType = ENotSet;
+    switch( aNumberType ) 
+        {
+        case MPhCntMatch::EMobileNumber:
+            numType = EMobile;
+            break;
+
+        case MPhCntMatch::EVoipNumber:            
+        case MPhCntMatch::EStandardNumber:
+            numType = EPhone;
+            break;
+            
+        case MPhCntMatch::EFaxNumber:
+            numType = EFaxNumber;
+            break;
+            
+        case MPhCntMatch::EPagerNumber:
+            numType = EPager;
+            break;
+        case MPhCntMatch::EAssistantNumber:
+        	numType = EAssistant;
+        	break;
+        case MPhCntMatch::ECarNumber:
+        	numType = ECar;
+        	break;
+        default:
+            break;
+        }
+    SetNumberType( aBubbleId, numType );
+#else
+    (void) aBubbleId;
+    (void) aNumberType;	    
+#endif // RD_VIRTUAL_PHONEBOOK
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::CreateConference
+//  
+//  For conference calls only
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CBubbleManager::TBubbleId CBubbleManager::CreateConference( 
+                                                const TBubbleId& aBubble1, 
+                                                const TBubbleId& aBubble2 )
+    {
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+    __ASSERT_ALWAYS( iActiveHeaders->Count() < KBubblePlaceMaxVisible, 
+                     Panic( EBMPanicInvalidNumberOfHeaders ) );
+    __ASSERT_DEBUG( !iConfHeader->IsUsed() , Panic( EBMPanicConferenceIsUsed ) );
+    
+    iConfHeader->SetIsUsed( ETrue );
+    
+    AddRowToConference( aBubble1 );
+    AddRowToConference( aBubble2 );
+    
+    // Put conference header to first so it will be drawn always on top.
+    iActiveHeaders->InsertL( 0 , iConfHeader ); //Can't leave
+    
+    return iConfHeader->BubbleId( );    
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::RemoveConference
+//  
+//  For conference calls only
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::RemoveConference( )
+    {
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+    __ASSERT_ALWAYS( iConfHeader->IsUsed( ), Panic( EBMPanicConferenceNotUsed ) );
+    
+    iConfHeader->Reset();
+    
+    
+    // find the active element
+    TUint8 index = 0;
+    __ASSERT_ALWAYS( 
+        iActiveHeaders->Count( ) > 0, Panic( EBMPanicInvalidNumberOfHeaders ) );
+    while ( iActiveHeaders->At( index )->BubbleId( ) != KBubbleConferenceId )
+        {
+        index++;
+        __ASSERT_ALWAYS( index != iActiveHeaders->Count( ), 
+            Panic( EBMPanicInvalidNumberOfHeaders ) );
+        }
+    
+    iActiveHeaders->Delete( index );
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::AddRowToConference
+//  
+//  For conference calls only
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::AddRowToConference( const TBubbleId& aBubbleId )
+    {
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+    
+    // find header
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,  
+                     Panic( EBMPanicBubbleIdIsNotInUse ) );
+    
+    __ASSERT_ALWAYS( header->IsUsed(), Panic( EBMPanicBubbleIdIsNotInUse ) );
+    __ASSERT_ALWAYS( !header->IsConference(), 
+                     Panic( EBMPanicReferredHeaderIsConferenceHeader ) );
+    __ASSERT_ALWAYS( !header->IsInConference(), 
+                     Panic( EBMPanicReferredCallHeaderIsInConferenceCall ) );
+    
+    iConfHeader->AddRow( static_cast<CBubbleCallHeader&>( *header ) ); // type cast downwards
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::RemoveRowFromConference
+//  
+//  For conference calls only
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::RemoveRowFromConference( const TBubbleId& aBubbleId )
+    {
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+    
+    iConfHeader->RemoveRow( aBubbleId );
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::ConferenceRowCount
+//  
+//  For conference calls only
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TUint8 CBubbleManager::ConferenceRowCount( ) const
+    {
+    return iConfHeader->RowCount();
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetExpandedConferenceCallHeader
+//  
+//  For conference calls only
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::SetExpandedConferenceCallHeader( 
+    const TBool& aIsExpanded )
+    {
+    iConfHeader->SetIsExpanded( aIsExpanded );
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::IsConferenceExpanded
+//  
+//  For conference calls only
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CBubbleManager::IsConferenceExpanded( ) const
+    {
+    return iConfHeader->IsExpanded();
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetSelectionInConference
+//  
+//  For conference calls only
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::SetSelectionInConference( 
+    const TRowNumber& aRowNumber )
+    {
+    CBubbleManager::TRowNumber oldrow = iConfHeader->Highlight();
+    iConfHeader->SetHighlight( aRowNumber );
+    CBubbleManager::TRowNumber newrow = iConfHeader->Highlight();
+    
+    UpdateConferenceRows( oldrow , newrow );
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetSelectionIdInConference
+//  
+//  For conference calls only
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::SetSelectionIdInConference( 
+    const TBubbleId& aBubbleId )
+    {
+    CBubbleManager::TRowNumber oldrow = iConfHeader->Highlight();
+    iConfHeader->SetHighlightId( aBubbleId );
+    CBubbleManager::TRowNumber newrow = iConfHeader->Highlight();
+    
+    UpdateConferenceRows( oldrow , newrow );
+    }
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SelectionInConference
+//  
+//  For conference calls only
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CBubbleManager::TRowNumber 
+    CBubbleManager::SelectionInConference() const
+    {
+    return iConfHeader->Highlight();
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SelectionIdInConference
+//  
+//  For conference calls only
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CBubbleManager::TBubbleId 
+    CBubbleManager::SelectionIdInConference() const
+    {
+    return iConfHeader->HighlightId();
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::MoveHighlightOneUpInConference
+//  
+//  For conference calls only
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::MoveHighlightOneUpInConference()
+    {
+    CBubbleManager::TRowNumber oldrow = iConfHeader->Highlight();
+    iConfHeader->MoveHighlightOneUp();
+    CBubbleManager::TRowNumber newrow = iConfHeader->Highlight();
+    
+    UpdateConferenceRows( oldrow , newrow );
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::MoveHighlightOneDownInConference
+//  
+//  For conference calls only
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::MoveHighlightOneDownInConference()
+    {
+    CBubbleManager::TRowNumber oldrow = iConfHeader->Highlight();
+    iConfHeader->MoveHighlightOneDown();
+    CBubbleManager::TRowNumber newrow = iConfHeader->Highlight();
+    
+    UpdateConferenceRows( oldrow , newrow );
+    }
+
+
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::CreateNumberEntry
+//  
+//  For number entry
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::CreateNumberEntry()
+    {
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+    __ASSERT_ALWAYS( !iNumberEntry->IsUsed(), Panic( EBMPanicNumberEntryInUse ) );
+
+#ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
+    if ( !ShownHeaderCount() ) // Only effects in number entry
+        {
+        // Capture transition begin state
+        GfxTransEffect::Begin( iNumberEntry, KGfxControlAppearAction );
+        // Set reminder that Begin has been called.
+        CAknTransitionUtils::SetData( (TInt) this, (TAny*) 1 );
+        }
+#endif //NOT_RD_UI_TRANSITION_EFFECTS_PHASE2
+    
+    iNumberEntry->SetIsUsed( ETrue );
+    iNumberEntry->MakeVisible( ETrue );
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::GetNumberEntry
+//  
+//  For number entry
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CCoeControl* CBubbleManager::GetNumberEntry( ) const
+    {
+    return iNumberEntry->GetEditor();
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::IsNumberEntryUsed
+//  
+//  For number entry
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CBubbleManager::IsNumberEntryUsed( ) const
+    {
+    return iNumberEntry->IsUsed();
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetNumberEntryVisible
+//  
+//  For number entry
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::SetNumberEntryVisible( const TBool& aVisibility )
+    {
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+
+    iNumberEntry->SetPlace( CBubbleOutlookNumberEntry::ENENone );
+    iNumberEntry->MakeVisible( aVisibility );
+    CCoeControl* editor = iNumberEntry->GetEditor();
+    if ( !aVisibility )
+        {
+        editor->SetFocus( EFalse );
+        }
+    else
+        {
+// Don't set focus now ( wait until the screen is redirected )
+// We don't want the cursor to be shown until the transition is finished
+#ifndef RD_UI_TRANSITION_EFFECTS_PHASE2
+        editor->SetFocus( ETrue );
+#endif
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetTextToNumberEntry
+//  
+//  For number entry
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::SetTextToNumberEntry( const TDesC& aDesC )
+    {
+    iNumberEntry->SetText( aDesC );
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::GetTextFromNumberEntry
+//  
+//  For number entry
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::GetTextFromNumberEntry( TDes& aDesC )
+    {
+    iNumberEntry->GetText( aDesC );
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::RemoveNumberEntry
+//  
+//  For number entry
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::RemoveNumberEntry( )
+    {
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+    __ASSERT_ALWAYS( 
+        iNumberEntry->IsUsed(), Panic( EBMPanicNumberEntryNotInUse ) );
+    
+#ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
+    if ( !ShownHeaderCount() ) // Only effects in number entry
+        {
+        // Capture transition begin state
+        GfxTransEffect::Begin( iNumberEntry, KGfxControlDisappearAction );
+        // Set reminder that Begin has been called.
+        CAknTransitionUtils::SetData( (TInt) this, (TAny*) 1 );
+        }
+#endif
+
+    iNumberEntry->Reset();
+    iNumberEntry->MakeVisible( EFalse );
+    }
+
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::FindHeader
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CBubbleManager::FindHeader( 
+    const TBubbleId& aBubbleID, 
+    CBubbleHeader*& aHeader ) const
+    {
+    TUint count( TUint8( iCallHeaders->Count() ) );
+    CBubbleHeader* tempHeader = NULL;
+    for ( TUint8 i = 0 ; i < count ; i++ )
+        {
+        tempHeader = iCallHeaders->At( i );
+        if ( aBubbleID == tempHeader->BubbleId() )
+            {
+            aHeader = tempHeader;
+            return ETrue;
+            }
+        }
+    aHeader = NULL;
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::FindActiveHeader
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CBubbleManager::FindActiveHeader( 
+    const TBubbleId& aBubbleID, 
+    CBubbleHeader*& aHeader ) const
+    {
+    TUint count( TUint8( iActiveHeaders->Count() ) );
+    CBubbleHeader* tempHeader = NULL;
+    for ( TUint8 i = 0 ; i < count ; i++ )
+        {
+        tempHeader = iActiveHeaders->At( i );
+        if ( aBubbleID == tempHeader->BubbleId() )
+            {
+            aHeader = tempHeader;
+            return ETrue;
+            }
+        }
+    aHeader = NULL;
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::UpdateConferenceRows
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleManager::UpdateConferenceRows( CBubbleManager::TRowNumber aRow1, 
+                                          CBubbleManager::TRowNumber aRow2 )
+    {
+    // if the rows are the same or conf is not expanded - nothing to do.
+    if ( aRow1 == aRow2 || !iConfHeader->IsExpanded() )
+        {
+        return;
+        }
+    
+    // if we are surrounded by start-/endchanges, we don't have to
+    // worry about drawing.
+    if ( iIsReadyToDraw > 0 )
+        {
+        return;
+        }
+    
+    // find current control:
+    
+    // There should be only one active place: the expanded conference place
+    if ( iActivePlaces->Count() != 1 )
+        {
+        __ASSERT_DEBUG( EFalse, User::Invariant() );
+        return;
+        }
+    
+    CBubbleOutlookConference* control = 
+        static_cast< CBubbleOutlookConference* >
+            ( &iActivePlaces->At(0)->GetBubbleOutlook() );
+    
+    // make sure it's what we want
+    if ( control == NULL )
+        {
+        __ASSERT_DEBUG( EFalse, User::Invariant() );
+        return;
+        }
+    
+    
+    // Draw row1 first:
+    control->DrawRowNow( aRow1 );
+    
+    // Then second row:
+    control->DrawRowNow( aRow2 );
+    }
+
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::FocusChanged
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleManager::FocusChanged( TDrawNow aDrawNow )
+    {
+    if ( iNumberEntry->IsUsed() && iNumberEntry->IsVisible() )
+        {
+        iNumberEntry->SetFocus( IsFocused(), aDrawNow );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::ImageManager
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+CBubbleImageManager& CBubbleManager::ImageManager()
+    {
+    return *iImageManager;
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::ResourceManager
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+CBubbleResourceManager& CBubbleManager::ResourceManager()
+    {
+    return *iResourceManager;
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::CustomManager
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+CBubbleCustomManager& CBubbleManager::CustomManager()
+    {
+    return *iCustomManager;
+    }
+    
+// ---------------------------------------------------------------------------
+//  CBubbleManager::HandleResourceChange
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleManager::HandleResourceChange(TInt aType)
+    {
+    if ( aType ==  KEikMessageUnfadeWindows )
+        {
+        if ( iIsReadyToDraw == 0 )
+            {
+            if ( iActivePlaces->Count() > 0 )
+                {
+                iParentControl->DrawNow();
+                }
+            }
+        }
+
+    if ( aType == KAknsMessageSkinChange || 
+         aType == KEikDynamicLayoutVariantSwitch )
+        {
+        StartChanges();
+        
+        if ( aType == KAknsMessageSkinChange )
+            {
+            // Remove muted image. It will be reloaded when 
+            // needed for the next time.
+            iMutedImage->SetPicture( NULL , NULL );
+            iMutedImage->MakeVisible( EFalse );
+
+            // Release all bitmaps from the animations
+            for ( TInt i = 0; i < iBubblePlaces->Count() ; i++ )
+                {
+                iBubblePlaces->At( i )->GetBubbleOutlook().ReleaseBitmaps();
+                }
+
+            // Number entry
+            iNumberEntry->ReleaseBitmaps();
+
+            // Clear all the skinned images from own cache
+            iImageManager->ClearSkinsCache();
+
+            // Set the image back if it was there...
+            SetPhoneMuted( iIsMuted );
+
+            // Recreate all bitmaps from the animations
+            for ( TInt a = 0; a < iBubblePlaces->Count() ; a++ )
+                {
+                iBubblePlaces->At( a )->GetBubbleOutlook().RebuildBitmaps();
+                }
+            
+            // Number entry
+            iNumberEntry->RebuildBitmaps();
+            
+            // Touch pane
+            if ( iTouchPane )
+                {
+                iTouchPane->HandleResourceChange( aType );                    
+                }
+            
+            // Update preloaded theme image
+            if ( iCallObjectManager && 
+                 iCallObjectManager->CallThemeImageIcon() )
+                {
+                iMainPaneControl->Reset();
+                
+                iCallObjectManager->ReleaseCallThemeImage();
+                iCallObjectManager->LoadCallThemeImage( 
+                        *iImageManager, 
+                        MainPaneImageRect().Size() );
+                }
+            }
+        else if ( aType == KEikDynamicLayoutVariantSwitch )
+            {
+            iImageManager->PrepareCachedBitmaps();
+            }            
+        
+        // Call object
+        if ( aType == KEikDynamicLayoutVariantSwitch )
+            {
+            if ( iCallObjectManager && 
+                 iCallObjectManager->CallThemeImageIcon() )
+                {
+                iCallObjectManager->ResizeCallThemeImage( MainPaneImageRect().Size() );
+                }
+                        
+            if ( iMainPaneControl &&
+                 iMainPaneControl->IsUsed() )
+                {
+                ReloadCallObjectImage();
+                }
+            }
+        
+        EndChanges();
+
+        // Relayout video
+        if ( iVideoFlags & EBMVideoPlayingVideo )
+            {
+            iVideoController->HandleLayoutChange();    
+            }
+
+        return;
+        }
+
+    CCoeControl::HandleResourceChange(aType);
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetCNAP
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::SetCNAP( 
+    const TBubbleId& aBubbleId, 
+    const TDesC& aCNAPText, 
+    const TPhoneClippingDirection& aClipDirection )
+    {
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+
+    // find header
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,  
+                     Panic( EBMPanicBubbleIdIsNotInUse ) );
+
+    if ( aCNAPText.Length() == 0 )
+        {
+        return;
+        }
+
+    // We have a number        
+    if ( aClipDirection == ELeft )
+        {
+        BubbleUtils::AddTextToHeader( 
+            *header, 
+            BubbleUtils::EBubbleHeaderCNAP, 
+            NumberGroup( aCNAPText ), 
+            KBubbleLabelMaxLength ,
+            aClipDirection );
+        }
+    else
+        {
+        BubbleUtils::AddTextToHeader(
+            *header, 
+            BubbleUtils::EBubbleHeaderCNAP, 
+            aCNAPText, 
+            KBubbleLabelMaxLength ,
+            aClipDirection );    
+        }            
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::NumberGroup
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+const TDesC& CBubbleManager::NumberGroup( const TDesC& aNumber )
+    {
+    if ( iNumberGrouping )
+        {
+        iNumberGrouping->Set( aNumber );
+        return iNumberGrouping->FormattedNumber();
+        }
+    else
+        {
+        return aNumber;
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetCallObjectImage
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::SetCallObjectImage( 
+    const TBubbleId& aBubbleId,
+    const TDesC& aImageFileName )
+    {
+    __ASSERT_ALWAYS( iCallObjectManager, 
+                     Panic( EBMPanicFeatureNotSupported ) );
+        
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,  
+                     Panic( EBMPanicBubbleIdIsNotInUse ) );
+    
+    if ( !header->CallObjectImage() )
+        {
+        if ( !header->IsConference() )        
+            {
+            // load image from file
+            TBool threeLines( header->CNAP().Length() > 0 );
+            CBubbleCallObjectManager::TImageLoadingParams params;
+            params.iPreferredSize = MainPaneImageRect().Size();
+            params.iTinyImageSize = MainPaneImageRect( ETrue, 
+                                                       threeLines ).Size();
+            params.iDisplayMode = Window().DisplayMode();
+            params.iThumbnailSize = CallObjectImageIncallSize( ETrue );
+            iCallObjectManager->LoadImageFromFile( aBubbleId,
+                                                   aImageFileName,
+                                                   params );
+            }
+        else // conference
+            {
+            TAknLayoutRect bubbleRect;
+            bubbleRect.LayoutRect( Rect(),
+                BubbleLayout2::popup_call2_audio_conf_window(3) );
+            
+            TSize imageSize( 
+                CallObjectImageIncallSize().iWidth,
+                bubbleRect.Rect().Size().iHeight );
+            
+            // load image from file
+            CBubbleCallObjectManager::TImageLoadingParams params;
+            params.iPreferredSize = imageSize;
+            params.iDisplayMode = Window().DisplayMode();
+            params.iTinyImageSize = TSize(0,0);
+            params.iThumbnailSize = TSize(0,0);
+            iCallObjectManager->LoadImageFromFile( aBubbleId,
+                                                   aImageFileName,
+                                                   params );    
+            }            
+
+        header->SetCallObjectFileName( aImageFileName.Alloc() );
+        header->SetCallObjectImageType(
+           CBubbleHeader::EGalleryImage );
+        }
+    
+    return;            
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetCallObjectImage
+//  
+// 
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CBubbleManager::SetCallObjectImage( const TBubbleId& aBubbleId,
+                                                  CFbsBitmap* aCOBitmap, 
+                                                  CFbsBitmap* aCOBitmapMask,
+                                                  TBool aDataOwnershipTrasferred )
+    {
+    __ASSERT_ALWAYS( ( iConfigFlags & EBMCallObjectDisplay ), 
+                     Panic( EBMPanicFeatureNotSupported ) );
+        
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+    
+    // find header
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,  
+                     Panic( EBMPanicBubbleIdIsNotInUse ) );
+    
+    header->SetCallObjectImage( aCOBitmap );
+    header->SetCallObjectImageMask( aCOBitmapMask );
+    header->SetCallObjectImageDataOwnership( aDataOwnershipTrasferred );
+    iCallObjectChanged = ETrue;    
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetCallObjectTheme
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::SetCallObjectFromTheme( 
+    const TBubbleId& aBubbleId )
+    {
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,  
+                     Panic( EBMPanicBubbleIdIsNotInUse ) );
+    
+    if ( !header->CallObjectImage()  )
+        {
+        CEikImage* themeImage = new CEikImage;
+        if ( themeImage != NULL )
+            {
+            iImageManager->SetBitmapToImage( themeImage,
+                                             EQgn_graf_call_image_1,
+                                             EQgn_graf_call_image_1_mask );
+            SetCallObjectImage( 
+                aBubbleId,
+                const_cast<CFbsBitmap*> ( themeImage->Bitmap() ),
+                const_cast<CFbsBitmap*> ( themeImage->Mask() ),
+                ETrue );
+    
+            themeImage->SetPictureOwnedExternally( ETrue );
+            delete themeImage;
+            header->SetCallObjectImageType( CBubbleHeader::EThemeImage );                
+            }
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetCallObjectText
+//  
+// 
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CBubbleManager::SetCallObjectText( const TBubbleId& aBubbleId, 
+                                                 const TDesC& aCOText )
+    {
+    __ASSERT_ALWAYS( iCallObjectManager, 
+                     Panic( EBMPanicFeatureNotSupported ) );
+        
+    __ASSERT_ALWAYS( 
+        iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
+    
+    // find header
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,  
+                     Panic( EBMPanicBubbleIdIsNotInUse ) );
+    
+    if ( !header->CallObjectText().Length() &&
+         !header->IsConference() )
+        {
+        HBufC* text = aCOText.Alloc();    
+        header->SetCallObjectText( text ); // takes ownership
+        iCallObjectChanged = ETrue;
+    
+        CBubbleCallObjectManager::TImageLoadingParams params;
+        params.iPreferredSize = CallObjectImageIncallSize();
+        params.iTinyImageSize = TSize(0,0);
+        params.iThumbnailSize = TSize(0,0);
+        params.iDisplayMode = Window().DisplayMode();
+        iCallObjectManager->LoadImageFromText( aBubbleId,
+                                               aCOText,
+                                               params );
+        header->SetCallObjectImageType(
+           CBubbleHeader::ETextBasedImage );                                               
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::ChangeEditorMode
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CBubbleManager::ChangeEditorMode( TBool aDefaultMode )
+    {
+    return iNumberEntry->ChangeEditorMode( aDefaultMode );
+    }
+    
+// ---------------------------------------------------------------------------
+//  CBubbleManager::GetEditorMode
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CBubbleManager::GetEditorMode() const
+    {
+    return iNumberEntry->GetEditorMode();
+    }    
+    
+// ---------------------------------------------------------------------------
+//  CBubbleManager::ResetEditorToDefaultValues
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::ResetEditorToDefaultValues()
+    {
+    iNumberEntry->ResetEditorToDefaultValues();
+    }        
+                                                   
+// ---------------------------------------------------------------------------
+//  CBubbleManager::DeactivatepPopupDisplay
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CBubbleManager::FindHeader( const TPhoneCallState& aCallState,
+                                  CBubbleHeader*& aHeader ) const
+    {
+    // lookup outgoing and incoming call headers
+    TInt activeHeaderCount( iActiveHeaders->Count() );
+    for ( TInt i(0); i < activeHeaderCount; i++ )
+        {
+        CBubbleHeader* header = iActiveHeaders->At( i );
+        TPhoneCallState callState( header->CallState() );    
+        if ( callState == aCallState )
+            {
+            aHeader = header;
+            return ETrue;
+            }
+        }
+
+    return EFalse;
+    }
+
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::BuildMainPaneCallObjectL
+//  
+// 
+// ---------------------------------------------------------------------------
+//     
+void CBubbleManager::BuildMainPaneImage()
+    {
+    BM_TRACE_( "[BUBBLEMANAGER] CBubbleManager::BuildMainPaneImage" );
+    
+    CBubbleHeader* incomingHeader = NULL;
+    CBubbleHeader* outgoingHeader = NULL;
+    CBubbleHeader* activeHeader = NULL;
+    CBubbleHeader* holdHeader = NULL;
+    CBubbleHeader* activeConfHeader = NULL;
+    
+    // get incoming and outgoing call headers
+    TInt activeHeaderCount( iActiveHeaders->Count() );
+    for ( TInt i(0); i < activeHeaderCount; i++ )
+        {
+        CBubbleHeader* header = iActiveHeaders->At( i );
+        TPhoneCallState callState( header->CallState() );    
+        if ( callState == EIncoming || callState == EWaiting )
+            {
+            incomingHeader = header;
+            activeHeader = NULL;
+            holdHeader = NULL;
+            activeConfHeader = NULL;
+            break;
+            }
+        else if ( callState == EOutgoing || callState == EAlerting )
+            {
+            outgoingHeader = header;
+            activeHeader = NULL;
+            holdHeader = NULL;
+            activeConfHeader = NULL;
+            break;
+            }
+        else if ( callState == EActive )
+            {
+            holdHeader = NULL;
+            if( header->IsConference() )
+                {
+                // active conference founded, no image to show
+                activeConfHeader = header;
+                activeHeader = NULL;
+                }
+            else if ( !activeConfHeader )
+                {
+                // no conference, single active
+                activeHeader = header;
+                }
+            }
+        else if ( callState == EOnHold )
+            {
+            if( !activeHeader && !activeConfHeader )
+                {                
+                // none active headers, hold need to handle
+                holdHeader = header;
+                }
+            }
+        BM_TRACE_1( "[BUBBLEMANAGER] CBubbleManager::BuildMainPaneImage - callState = %d", callState );
+        }
+    
+   if ( holdHeader && iMainPaneControl->IsUsed() )
+        {
+        // Keep image in mainpane displayed
+        return;
+        }
+    else if ( activeConfHeader || ( !incomingHeader && !outgoingHeader && !activeHeader && !holdHeader ) )
+        {
+        // there are conference call or no incoming, outgoing, active, hold calls , no image
+        // in mainpane is displayed
+        iMainPaneControl->Reset();
+        return;
+        }
+    
+    CBubbleHeader* header = incomingHeader;
+    if ( outgoingHeader )
+        {
+        header = outgoingHeader;
+        }
+    else if ( activeHeader )
+        {
+        // single active
+        header = activeHeader;
+        iCallObjectChanged = ETrue;
+        }
+    else if ( holdHeader )
+        {
+        // single hold and no image yet
+        header = holdHeader;
+        iCallObjectChanged = ETrue;
+        }
+                
+    if ( header->IsInConference() || header->CallObjectText().Length() )
+        {
+        // Conference item or Text is not shown in mainpane.
+        return;            
+        }
+
+    if ( !iMainPaneControl->IsUsed() || iCallObjectChanged )
+        {
+        iMainPaneControl->Reset();
+        iMainPaneControl->ReadBubbleHeader( *header );
+        iCallObjectChanged = EFalse;    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::ReloadCallObjectImage
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleManager::ReloadCallObjectImage()
+    {
+    const TBubbleId bubble = iMainPaneControl->BubbleId();
+
+    iMainPaneControl->Reset();
+    
+    CBubbleHeader* header = NULL;
+    FindActiveHeader( bubble , header );
+
+    if ( header && header->CallObjectFileName().Length() )        
+        {
+        TBool threeLines( header->CNAP().Length() > 0 );
+        
+        CBubbleCallObjectManager::TImageLoadingParams params;
+        params.iPreferredSize = MainPaneImageRect().Size();
+        params.iTinyImageSize = MainPaneImageRect( ETrue, threeLines ).Size();
+        params.iThumbnailSize = CallObjectImageIncallSize( ETrue );
+        params.iDisplayMode = Window().DisplayMode();    
+
+        iCallObjectManager->CancelCallObjectLoading( bubble );
+        
+        iCallObjectManager->LoadImageFromFile( 
+            bubble,
+            header->CallObjectFileName(),
+            params );
+        
+        header->SetCallObjectImage( NULL );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::CallIsDroppedByEndKey
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CBubbleManager::IsCallDroppedByEndKey( 
+    const TPhoneCallState& aState ) const
+    {
+    TUint activeCallCount( iActiveHeaders->Count() );
+    
+    if ( activeCallCount == 1 )
+        {
+        // just one call, it is always dropped by end key
+        return ETrue;            
+        }
+        
+    // Dropping order in multicall state
+    // 1. Disconnected call
+    // 2. Initialising or alerting call
+    // 3. Active call
+    // 4. Held call
+    // 5. Waiting call
+    
+    if ( aState == EWaiting )
+        {
+        // never dropped by end key
+        return EFalse;                
+        }
+    
+    // go through ongoing calls and check if there is a call with
+    // higher dropping priority
+    TBool dropped( ETrue );
+    for ( TInt i(0); i < activeCallCount; i++ )
+        {
+        TPhoneCallState callState = iActiveHeaders->At( i )->CallState();
+        
+        if ( aState == EOnHold && ( callState == EDisconnected ||
+             callState == EOutgoing || callState == EAlerting ||
+             callState == EActive ) )
+            {
+            dropped = EFalse;
+            break;    
+            }
+        else if ( aState == EActive && ( callState == EDisconnected ||
+             callState == EOutgoing || callState == EAlerting ) )
+            {
+            dropped = EFalse;
+            break;        
+            }
+        else if ( ( aState == EOutgoing || aState == EAlerting ) &&
+            ( callState == EDisconnected ) )
+            {
+            dropped = EFalse;
+            break;            
+            }
+        else
+            {
+            // do nothing    
+            }
+        } // for
+    
+    return dropped;       
+    }    
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::ActiveCallCount
+//  
+// 
+// ---------------------------------------------------------------------------
+//    
+TUint8 CBubbleManager::ActiveCallCount() const
+    {
+    return iActiveHeaders->Count();    
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::MainPaneImageRect
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+const TRect CBubbleManager::MainPaneImageRect( 
+    TBool aTinyImage,
+    TBool aThreeLinesShown ) const
+    {
+    TRect imageRect; // whole main
+    
+    if ( aTinyImage )
+        {
+        TInt variety = aThreeLinesShown ? 1 : 0;
+        
+        if ( iConfigFlags & EBMTouchCallhandling )
+            {
+            // requires call2_image_placing_area to LAF data.
+            TAknLayoutRect callPane;
+            callPane.LayoutRect(
+                Rect(), 
+                BubbleLayout4::call4_windows_pane(2) );    
+            
+            TAknLayoutRect image;
+            image.LayoutRect(
+                callPane.Rect(), 
+                BubbleLayout2::call2_image_placing_area( variety ) );                
+            imageRect = image.Rect();                
+            }
+        else
+            {
+            TAknLayoutRect image;
+            image.LayoutRect(
+                Rect(), 
+                BubbleLayout2::call2_image_placing_area( variety ) );    
+            imageRect = image.Rect();    
+            }
+        }
+    else
+        {
+        if ( iConfigFlags & EBMTouchCallhandling )
+            {
+            TAknLayoutRect image;
+            image.LayoutRect(
+                Rect(), 
+                BubbleLayout4::call4_image_pane( 2 ) );    
+            imageRect = image.Rect();                
+            }
+        else
+            {
+            // mainpane
+            imageRect = Rect();    
+            }            
+        }        
+    
+    return imageRect;
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::PrepareIcons
+//  
+// 
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CBubbleManager::PrepareIcons()
+    {
+    iImageManager->PrepareCachedBitmaps();
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::PreloadCallThemeImage
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::PreloadCallThemeImage( TBool aPreload )
+    {
+    __ASSERT_ALWAYS( ( iConfigFlags & EBMCallObjectDisplay ), 
+                       Panic( EBMPanicFeatureNotSupported ) );
+    if ( aPreload )
+        {
+        iCallObjectManager->LoadCallThemeImage( 
+                *iImageManager,
+                MainPaneImageRect().Size() ); 
+        }
+    else
+        {
+        iCallObjectManager->ReleaseCallThemeImage();
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::StartAnimations
+//  
+// 
+// ---------------------------------------------------------------------------
+//    
+void CBubbleManager::StartAnimations()
+    {
+    if ( !IsVisible() )
+        {
+        // Animation will be started when this control becomes visible.
+        return;            
+        }
+    
+    for ( TInt i = 0 ; i < iActivePlaces->Count() ; i++ )
+        {
+        TRAP_IGNORE( 
+            iActivePlaces->At(i)->GetBubbleOutlook().HandleAnimationStartL() );
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::HandleBackgroundImageChange
+//  
+// 
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CBubbleManager::HandleBackgroundImageChange()
+    {
+    // Restart animations to update background frames.
+    StartAnimations();    
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetVideoRingTone
+//  
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CBubbleManager::SetVideoRingTone(
+    const TDesC& aFileName,
+    TBubbleVideoPlayMode aPlayMode,
+    TInt aVolumeLevel,
+    TBool aUseArbitraryScaling,
+    MBubbleVideoPlaybackObserver* aObserver )
+    {
+    iVideoController->StopAndDeletePlayer();
+    iVideoController->PrepareToPlayVideo( aFileName,
+                                          aPlayMode,
+                                          aVolumeLevel,
+                                          aUseArbitraryScaling,
+                                          aObserver );
+    
+    iVideoFlags |=  EBMVideoSetAsRingTone;
+    
+    if ( iCallObjectManager )
+        {
+        iCallObjectManager->Suspend();            
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::StopVideoRingTone
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::StopVideoRingTone()
+    {
+    iVideoController->StopPlaying();                
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::MuteVideoRingTone
+//  
+// 
+// ---------------------------------------------------------------------------
+//        
+EXPORT_C void CBubbleManager::MuteVideoRingTone()
+    {
+    iVideoController->MutePlaying();                
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::StopVideoRingTone
+//  
+// 
+// ---------------------------------------------------------------------------
+//        
+EXPORT_C void CBubbleManager::CancelVideoRingTone()
+    {
+    StopAndDeleteVideoPlayer();
+    }
+    
+// ---------------------------------------------------------------------------
+//  CBubbleManager::CreateVideoPlayerAndPlay
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleManager::CreateVideoPlayerAndPlay()
+    { 
+    iVideoController->CreatePlayerAndPlay();
+    iVideoFlags |= EBMVideoPlayingVideo;
+    }
+    
+// ---------------------------------------------------------------------------
+//  CBubbleManager::StopAndDeleteVideoPlayer
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleManager::StopAndDeleteVideoPlayer()
+    {
+    iVideoController->StopAndDeletePlayer();
+    iVideoFlags &= ~EBMVideoPlayingVideo;
+    iVideoFlags &= ~EBMVideoSetAsRingTone;
+    if ( iCallObjectManager )
+        {
+        iCallObjectManager->Resume();            
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+//  CBubbleManager::VideoController
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+CBubbleVideoController& CBubbleManager::VideoController() const
+    {
+    return *iVideoController;    
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::CallState
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+CBubbleManager::TPhoneCallState CBubbleManager::CallState( 
+    const TBubbleId& aBubbleId )
+    {
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,  
+                     Panic( EBMPanicBubbleIdIsNotInUse ) );
+    return header->CallState();                         
+    }
+    
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::CallObjectImageIncallSize
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+TSize CBubbleManager::CallObjectImageIncallSize( TBool aBigBubble )
+    {
+    TAknLayoutRect bubbleRect;
+
+    if ( iConfigFlags & EBMTouchCallhandling )
+        {
+        TInt variety = aBigBubble ? 4 : 0;
+        
+        bubbleRect.LayoutRect( Rect(),
+            BubbleLayout4::popup_call4_audio_first_window(variety) );
+        }
+    else
+        {
+        if ( aBigBubble )    
+            {
+            bubbleRect.LayoutRect( Rect(),
+                BubbleLayout2::popup_call2_audio_first_window(0) );
+            }
+        else
+            {
+            bubbleRect.LayoutRect( Rect(),
+               BubbleLayout2::popup_call2_audio_in_window(0) );    
+            }
+        }
+            
+    // image size is half from bubble size
+    TSize imageSize( bubbleRect.Rect().Size() );
+    // Opaque part in bubble approx. 45%.
+    imageSize.iWidth -= (45 * imageSize.iWidth) / 100;
+    return imageSize;  
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetParticipantListCLI
+//  
+// 
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CBubbleManager::SetParticipantListCLI(
+    const TBubbleId& aBubbleId,
+    TBubbleParticipantListCLI aParticipantCLI )
+    {
+    CBubbleHeader* header = NULL;
+    __ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,  
+                     Panic( EBMPanicBubbleIdIsNotInUse ) );
+    header->SetParticipantListCLI( aParticipantCLI );
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::TouchPane
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MBubbleTouchPaneInterface* CBubbleManager::TouchPane()
+    {
+    return iTouchPane;    
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::SetTouchPaneVisible
+//  
+// 
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CBubbleManager::SetTouchPaneVisible( TBool aVisible )
+    {
+    iTouchPaneSetVisible = aVisible;   
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::InitializingCall
+//  
+// 
+// ---------------------------------------------------------------------------
+//    
+TBool CBubbleManager::InitializingCall() const
+    {
+    TBool initializingCall = EFalse;
+    
+    TInt activeHeaderCount( iActiveHeaders->Count() );
+    for ( TInt i(0); i < activeHeaderCount; i++ )
+        {
+        CBubbleHeader* header = iActiveHeaders->At( i );
+        TPhoneCallState callState( header->CallState() );    
+        if ( callState == EIncoming || callState == EWaiting ||
+             callState == EAlerting || callState == EOutgoing ||
+             callState == EAlertToDisconnected )
+            {
+            initializingCall = ETrue;
+            break;
+            }
+        }
+        
+    return initializingCall;
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::IsTouchCallHandling
+//  
+// 
+// ---------------------------------------------------------------------------
+//    
+TBool CBubbleManager::IsTouchCallHandling() const
+    {
+    return (iConfigFlags & EBMTouchCallhandling);    
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleManager::AddCustomElement
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::AddCustomElement( 
+    const TBubbleId& aBubbleId,
+    CTelBubbleCustomElement* aElement,
+    TInt aPriority )
+    {
+    if ( aElement->ElementType() == CTelBubbleCustomElement::ECallImage &&
+         aBubbleId == iMainPaneControl->BubbleId() )
+        {
+        // reset control to get it replaced with this custom element
+        iMainPaneControl->Reset();
+        }
+    
+    iCustomManager->AddCustomElement( aBubbleId, aElement, aPriority );
+    }
+        
+// ---------------------------------------------------------------------------
+//  CBubbleManager::RemoveCustomElement
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBubbleManager::RemoveCustomElement( 
+    const TBubbleId& aBubbleId,
+    CTelBubbleCustomElement* aElement )
+    {
+    if ( aElement->ElementType() == CTelBubbleCustomElement::ECallImage &&
+         aBubbleId == iMainPaneControl->BubbleId() )
+        {
+        // aElement is being used; release it, before removing
+        // it from custom manager.
+        iMainPaneControl->Reset();
+        }
+    
+    iCustomManager->RemoveCustomElement( aBubbleId, aElement );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlook.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,152 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Outlook
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleOutlook.h"
+#include    "BMLayout.h"
+#include    <eiklabel.h> 
+#include    <eikenv.h>
+
+#include    <AknsBasicBackgroundControlContext.h>
+#include    <AknsDrawUtils.h>
+#include    <AknsUtils.h>
+
+// ========================= MEMBER FUNCTIONS ================================
+
+CBubbleOutlook::CBubbleOutlook( CBubbleManager& aBubbleManager )
+: iBubbleManager( aBubbleManager )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlook::ConstructL(const TRect& aRect)
+// Symbian OS two phased constructor
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlook::ConstructL( )
+    {
+    }
+
+// Destructor
+CBubbleOutlook::~CBubbleOutlook()
+    {
+    AknsUtils::DeregisterControlPosition( this );
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlook::PositionChanged
+//  
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlook::PositionChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlook::CountComponentControls
+//  
+//  
+// ---------------------------------------------------------------------------
+//
+TInt CBubbleOutlook::CountComponentControls( ) const
+    {
+    return 0; // Default. Child class may override.
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlook::ComponentControl
+//  
+//  
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CBubbleOutlook::ComponentControl( TInt /*aIndex*/ ) const
+    {
+    return NULL; // Default. Child class may override.
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlook::Draw
+//  
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlook::Draw( const TRect& /*aRect*/ ) const
+    {
+    // Empty. Child class may override.
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlook::DrawLabelNow
+//  
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlook::DrawLabelNow( const CCoeControl* aLabel )
+    {
+    if ( aLabel == NULL )
+        {
+        return;
+        }
+    DrawLabelNow( *aLabel );
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlook::DrawLabelNow
+//  
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlook::DrawLabelNow( const CCoeControl& aLabel )
+    {
+    // Clears also the label background. If CCoeControl::DrawNow() would
+    // be used then background drawing should be provided. However,
+    // CCoeControl::DrawDeferred() serves the purpose here.
+    aLabel.DrawDeferred();
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlook::ReleaseBitmaps
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlook::ReleaseBitmaps()
+    {
+    // default: do nothing. Derived class may override.
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlook::RebuildBitmaps
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlook::RebuildBitmaps()
+    {
+    // default: do nothing. Derived class may override.
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlook::SetCallObjectDisplay
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlook::SetCallObjectDisplay( TBool aActive )
+    {
+    iCallObjectDisplay = aActive;    
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookBottom.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,451 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Outlook Bottom
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleManager.h" //for enumerations
+#include    "BMBubbleOutlookBottom.h"
+#include    "BMBubbleImageManager.h"
+#include    "BMResourceManager.h"
+#include    "BMBubbleHeader.h"
+#include    "BMUtils.h"
+#include    "BMLayout.h"
+#include    "BMLayout2.h"
+#include    "telbubblecustomelement.h"
+
+#include    <eiklabel.h> 
+#include    <eikimage.h>
+#include    <eikenv.h>
+#include    <AknsUtils.h>
+#include    <AknsDrawUtils.h>
+
+
+// ========================= MEMBER FUNCTIONS ================================
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottom::CBubbleOutlookBottom
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookBottom::CBubbleOutlookBottom( CBubbleManager& aBubbleManager )
+: CBubbleOutlookTwoLined( aBubbleManager )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottom::ConstructL
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottom::ConstructL()
+    { 
+    CBubbleOutlookTwoLined::ConstructL();
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottom::~CBubbleOutlookBottom
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookBottom::~CBubbleOutlookBottom()
+    {
+    Reset();
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottom::ReadBubbleHeader
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottom::ReadBubbleHeader( CBubbleHeader& aHeader )
+    {
+    iHeader = &aHeader;
+    
+    iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );        
+    
+    if ( !iCallObjectDisplay )
+        {
+        GetCall1BubbleBitmaps();    
+        }
+    
+    CBubbleOutlookTwoLined::ReadBubbleHeader( aHeader );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottom::SizeChanged
+// called by framwork when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottom::SizeChanged()
+    {
+    if( !iHeader )
+        {
+        return;
+        }
+
+    AknsUtils::RegisterControlPosition( this );
+    
+    if ( !iCallObjectDisplay )
+        {
+        DoCall1Layout();    
+        }
+    else
+        {
+        TRAPD( err, DoCall2LayoutL() );
+        if ( err )    
+            {
+            iBubble->SetPicture( NULL, NULL );
+                
+            // Prepare frame for dynamic draw
+            MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+            AknsDrawUtils::PrepareFrame( skin,
+                                         iOuterRect,
+                                         iInnerRect,
+                                         iFrameId,
+                                         KAknsIIDDefault );
+            }  
+        }      
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottom::PositionChanged
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottom::PositionChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottom::DoCall1Layout
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookBottom::DoCall1Layout()
+    {
+    // Deprecated
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottom::DoCall2Layout
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottom::DoCall2LayoutL()
+    {
+    iBubble->SetPictureOwnedExternally( EFalse );
+    iBubble->SetPicture( NULL, NULL );
+        
+    const TRect rect = Rect();
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    switch ( callState )
+        {
+        case CBubbleManager::EWaiting:
+        case CBubbleManager::EIncoming:
+        case CBubbleManager::EOutgoing:
+        case CBubbleManager::EAlerting:
+        case CBubbleManager::EAlertToDisconnected:
+            {
+            ///////////////////////////////////////////////////////////////////
+            // Incoming call layout for single call
+            ///////////////////////////////////////////////////////////////////
+            
+            TAknLayoutRect bubbleRect;
+            bubbleRect.LayoutRect( 
+                rect, 
+                BubbleLayout2::popup_call2_audio_in_background(1) );
+            
+            TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+            TRect outerRect;
+            TRect innerRect;
+            BubbleLayout2::RectFrameInnerOuterRects( frameRect, 
+                                                     outerRect, 
+                                                     innerRect);
+            
+            iFrameId = ( callState == CBubbleManager::EAlertToDisconnected ) ?
+                                      KAknsIIDQsnFrCall2RectDisconn : 
+                                      KAknsIIDQsnFrCall2Rect;
+            
+            // for possible frame draw
+            iOuterRect = outerRect;
+            iOuterRect.Move( Rect().iTl );
+            iInnerRect = innerRect;
+            iInnerRect.Move( Rect().iTl );
+
+            // Call indicator
+            BubbleUtils::LayoutCustomElement(
+                iBigCallIndicator, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_in_call_waiting_icon(1) );
+            
+            // Ciphering off
+            BubbleUtils::LayoutControl( 
+                iCyphOffImage, 
+                rect,
+                BubbleLayout2::popup_call2_audio_in_ciphering_icon(1) );                
+            
+            // Number type icon
+            BubbleUtils::LayoutCustomElement(
+                iNumberType, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_in_call_number_type_icon(1) );
+
+            // Text line 1
+            BubbleUtils::LayoutLabel( 
+                iTextLine1, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_in_call_text_1(1) );
+            
+            // Smaller rect for text if brand image exists
+            if ( iBrandImage )
+                {
+                // Text line 2
+                BubbleUtils::LayoutLabel(
+                    iTextLine2,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_in_call_text_2(9) );
+
+                //Brand image
+                BubbleUtils::LayoutCustomElement(
+                    iBrandImage,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_in_brand_image(3) );
+                }
+            else
+                {
+                // Text line 2
+                BubbleUtils::LayoutLabel(
+                    iTextLine2,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_in_call_text_2(1) );
+                }
+            
+            // Build call object bubble
+            iBubble->SetRect( bubbleRect.Rect() );                
+
+            BubbleUtils::PrepareBubbleImageL( 
+                iFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+
+            if ( iHeader->CallObjectImage() &&
+                 !iHeader->CallObjectText().Length() )
+                {
+                // Add transparency
+                BubbleUtils::AddTransparencyToBubbleImageL( 
+                    KAknsIIDQsnFrCall2RectCoMask, // gradient tp mask
+                    outerRect,
+                    innerRect,
+                    iBubble );                    
+                }                    
+                
+            break;
+            }
+        case CBubbleManager::EDisconnected:
+        case CBubbleManager::EActive:
+        case CBubbleManager::EOnHold:
+            {
+            ///////////////////////////////////////////////////////////////////
+            // First call layout for single call
+            ///////////////////////////////////////////////////////////////////
+            
+            TAknLayoutRect bubbleRect;
+            bubbleRect.LayoutRect( 
+                rect, 
+                BubbleLayout2::popup_call2_audio_first_call_background(14) );
+            
+            TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+            TRect outerRect;
+            TRect innerRect;
+            BubbleLayout2::BubbleFrameInnerOuterRects( frameRect, 
+                                                       outerRect, 
+                                                       innerRect);
+        
+            TAknsItemID coMaskFrameId;
+            if ( callState == CBubbleManager::EOnHold )
+                {
+                iFrameId = KAknsIIDQsnFrCall2Bubble;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleCoMask;    
+                }
+            else if ( callState == CBubbleManager::EDisconnected )
+                {
+                iFrameId = KAknsIIDQsnFrCall2BubbleFirstDisconn;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleFirstCoMask;            
+                }
+            else
+                {
+                iFrameId = KAknsIIDQsnFrCall2BubbleFirst;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleFirstCoMask;                
+                }                
+            
+            // for possible frame draw
+            iOuterRect = outerRect;
+            iOuterRect.Move( Rect().iTl );
+            iInnerRect = innerRect;
+            iInnerRect.Move( Rect().iTl );
+
+            // Call icon
+            BubbleUtils::LayoutCustomElement( 
+                iSmallCallIndication, 
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_status_icon(13) );
+                
+            // Ciphering off
+            BubbleUtils::LayoutControl( 
+                iCyphOffImage, 
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_window_ciphering_icon(12) );
+            
+            // Call type pane
+            BubbleUtils::LayoutCallTypeIndicators(
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_type_icon(12),
+                iTypeIndication1,   // Data/Fax
+                iTypeIndication2 ); // ALS line 2               
+
+            // Text line 1
+            BubbleUtils::LayoutLabel( 
+                iTextLine1, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_first_call_cli_text(16) );
+            
+            // Smaller rect for text if bran image exists
+            if ( iBrandImage )
+                {
+                // Text line 2 - call state
+                BubbleUtils::LayoutLabel(
+                    iTextLine2,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_first_call_state_text(16) );
+
+                // Text line 2 - call timer
+                BubbleUtils::LayoutLabel(
+                    iTimerCost,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_first_call_state_text(17) );
+
+                //Brand image
+                BubbleUtils::LayoutCustomElement(
+                    iBrandImage,
+                    rect,
+            	    BubbleLayout2::popup_call2_audio_first_brand_image(1) );
+                }
+            else
+                {
+                // Text line 2 - call state
+                BubbleUtils::LayoutLabel(
+                    iTextLine2,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_first_call_state_text(12) );
+                // Text line 2 - call timer
+                BubbleUtils::LayoutLabel(
+                    iTimerCost,
+                   	rect,
+                    BubbleLayout2::popup_call2_audio_first_call_state_text(13) );
+                }
+                
+            // Build call object bubble
+            iBubble->SetRect( bubbleRect.Rect() );                                
+
+            BubbleUtils::PrepareBubbleImageL( 
+                iFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+            
+            // Add transparency
+            BubbleUtils::AddTransparencyToBubbleImageL( 
+                coMaskFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+                
+                
+            break;
+            }
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottom::GetCall1BubbleBitmaps
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookBottom::GetCall1BubbleBitmaps()
+    {
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    
+    TInt bubblePicture = KErrNotFound;
+    TInt bubblePictureMask = KErrNotFound;
+    
+    // set call indications and bubble
+    switch ( callState )
+        {
+        case CBubbleManager::EWaiting:
+        case CBubbleManager::EIncoming:
+        case CBubbleManager::EOutgoing:
+        case CBubbleManager::EAlerting:
+            bubblePicture = EQgn_graf_call_rec_big;
+            bubblePictureMask = EQgn_graf_call_rec_big_mask;
+            break;
+        case CBubbleManager::EAlertToDisconnected:
+            bubblePicture = EQgn_graf_call_rec_big_disconn;
+            bubblePictureMask = EQgn_graf_call_rec_big_disconn_mask;
+            break;
+        case CBubbleManager::EActive:
+            bubblePicture = EQgn_graf_call_first_one_active;
+            bubblePictureMask = EQgn_graf_call_first_one_active_mask;
+            break;
+        case CBubbleManager::EOnHold:
+            bubblePicture = EQgn_graf_call_first_one_held;
+            bubblePictureMask = EQgn_graf_call_first_one_held_mask;
+            break;
+        case CBubbleManager::EDisconnected:
+            bubblePicture = EQgn_graf_call_first_one_disconn;
+            bubblePictureMask = EQgn_graf_call_first_one_disconn_mask;
+            break;
+        case CBubbleManager::ENone:
+        default:
+            bubblePicture = KErrNotFound;
+            bubblePictureMask = KErrNotFound;
+            break;
+        }
+
+    if ( bubblePicture != KErrNotFound )
+        {
+        if ( bubblePictureMask == KErrNotFound )
+            {
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                iBubble, (TBMIcons) bubblePicture );
+            }
+        else
+            {
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                iBubble, 
+                (TBMIcons) bubblePicture , 
+                (TBMIcons) bubblePictureMask);
+            }
+        }
+        
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookBottomCnap.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,438 @@
+/*
+* 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: Implementation of CBubbleOutlookBottomCnap class.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleManager.h" //for enumerations
+#include    "BMBubbleOutlookBottomCnap.h"
+#include    "BMBubbleImageManager.h"
+#include    "BMResourceManager.h"
+#include    "BMBubbleHeader.h"
+#include    "BMLayout.h"
+#include    "BMUtils.h"
+#include    "BMLayout2.h"
+#include    "telbubblecustomelement.h"
+
+#include    <eiklabel.h> 
+#include    <eikimage.h>
+#include    <eikenv.h>
+#include    <AknsUtils.h>
+#include    <AknsDrawUtils.h>
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CBubbleOutlookBottomCnap::CBubbleOutlookBottomCnap
+    ( CBubbleManager& aBubbleManager )
+    : CBubbleOutlookThreeLined( aBubbleManager )
+    {
+    }
+
+// Symbian OS constructor can leave.
+void CBubbleOutlookBottomCnap::ConstructL()
+    {
+    CBubbleOutlookThreeLined::ConstructL();
+    }
+
+    
+// Destructor
+CBubbleOutlookBottomCnap::~CBubbleOutlookBottomCnap()
+    {
+    Reset();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomCnap::ReadBubbleHeader
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomCnap::ReadBubbleHeader( CBubbleHeader& aHeader )
+    {
+    iHeader = &aHeader;
+    
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    
+    iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );        
+    
+    if ( !iCallObjectDisplay )
+        {
+        GetCall1BubbleBitmaps();    
+        }
+    
+    CBubbleOutlookThreeLined::ReadBubbleHeader( aHeader );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomCnap::SizeChanged
+// called by framwork when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomCnap::SizeChanged()
+    {
+    if( !iHeader )
+        {
+        return;
+        }
+
+    AknsUtils::RegisterControlPosition( this );
+    
+    if ( !iCallObjectDisplay )
+        {
+        DoCall1Layout();    
+        }
+    else
+        {
+        TRAPD( err, DoCall2LayoutL() );
+        if ( err )    
+            {
+            iBubble->SetPicture( NULL, NULL );
+                
+            MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+            AknsDrawUtils::PrepareFrame( skin,
+                                         iOuterRect,
+                                         iInnerRect,
+                                         iFrameId,
+                                         KAknsIIDDefault );
+            }  
+        }      
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomCnap::PositionChanged
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomCnap::PositionChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomCnap::DoCall1Layout
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookBottomCnap::DoCall1Layout()
+    {
+    // Deprecated
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomCnap::DoCall2Layout
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomCnap::DoCall2LayoutL()
+    {
+    iBubble->SetPictureOwnedExternally( EFalse );
+    iBubble->SetPicture( NULL, NULL );
+    
+    const TRect rect = Rect();
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    switch ( callState )
+        {
+        case CBubbleManager::EWaiting:
+        case CBubbleManager::EIncoming:
+        case CBubbleManager::EOutgoing:
+        case CBubbleManager::EAlerting:
+        case CBubbleManager::EAlertToDisconnected:
+            {
+            ///////////////////////////////////////////////////////////////////
+            // Incoming call layout for single call. Three lines of text.
+            ///////////////////////////////////////////////////////////////////
+            
+            TAknLayoutRect bubbleRect;
+            bubbleRect.LayoutRect( 
+                rect, 
+                BubbleLayout2::popup_call2_audio_in_background(2) );
+            
+            TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+            TRect outerRect;
+            TRect innerRect;
+            BubbleLayout2::RectFrameInnerOuterRects( frameRect, 
+                                                     outerRect, 
+                                                     innerRect);
+            
+            iFrameId = ( callState == CBubbleManager::EAlertToDisconnected ) ?
+                                      KAknsIIDQsnFrCall2RectDisconn : 
+                                      KAknsIIDQsnFrCall2Rect;
+            
+            iOuterRect = outerRect;
+            iOuterRect.Move( Rect().iTl );
+            iInnerRect = innerRect;
+            iInnerRect.Move( Rect().iTl );
+            
+            // Call indicator
+            BubbleUtils::LayoutCustomElement(
+                iBigCallIndicator, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_in_call_waiting_icon(2) );
+            
+            // Ciphering off
+            BubbleUtils::LayoutControl( 
+                iCyphOffImage, 
+                rect,
+                BubbleLayout2::popup_call2_audio_in_ciphering_icon(2) );                
+            
+            // Number type icon
+            BubbleUtils::LayoutCustomElement(
+                iNumberType, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_in_call_number_type_icon(2) );
+
+            // Text line 1
+            BubbleUtils::LayoutLabel( 
+                iTextLine1, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_in_call_text_1(2) );
+            
+            // Text line 2
+            BubbleUtils::LayoutLabel( 
+                iTextLine2, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_in_call_text_2(2) );
+                
+            // Smaller rect for text if brand image exists
+            if ( iBrandImage )
+                {
+                // Text line 3
+                    BubbleUtils::LayoutLabel(
+                    iTextLine3,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_in_call_text_3(3) );
+
+                //Brand image
+                BubbleUtils::LayoutCustomElement(
+                    iBrandImage,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_in_brand_image(0) );
+                }
+            else
+                {
+                // Text line 3
+                BubbleUtils::LayoutLabel(
+                    iTextLine3,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_in_call_text_3(0) );
+                }
+                
+            // Create call object bitmaps    
+            iBubble->SetRect( bubbleRect.Rect() );                
+
+            BubbleUtils::PrepareBubbleImageL( 
+                iFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+                
+            if ( iHeader->CallObjectImage() &&
+                 !iHeader->CallObjectText().Length() )
+                {
+                // Add transparency
+                BubbleUtils::AddTransparencyToBubbleImageL( 
+                    KAknsIIDQsnFrCall2RectCoMask, // gradient tp mask
+                    outerRect,
+                    innerRect,
+                    iBubble );                    
+                }    
+                                
+            break;
+            }
+        
+        case CBubbleManager::EDisconnected:
+        case CBubbleManager::EActive:
+        case CBubbleManager::EOnHold:
+            {
+            ///////////////////////////////////////////////////////////////////
+            // First call layout for single call. Three lines of text.
+            ///////////////////////////////////////////////////////////////////
+            
+            TAknLayoutRect bubbleRect;
+            bubbleRect.LayoutRect( 
+                rect, 
+                BubbleLayout2::popup_call2_audio_first_call_background(20) );
+            
+            TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+            TRect outerRect;
+            TRect innerRect;
+            BubbleLayout2::BubbleFrameInnerOuterRects( frameRect, 
+                                                       outerRect, 
+                                                       innerRect);
+        
+            TAknsItemID coMaskFrameId;
+            if ( callState == CBubbleManager::EOnHold )
+                {
+                iFrameId = KAknsIIDQsnFrCall2Bubble;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleCoMask;    
+                }
+            else if ( callState == CBubbleManager::EDisconnected )
+                {
+                iFrameId = KAknsIIDQsnFrCall2BubbleFirstDisconn;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleFirstCoMask;            
+                }
+            else
+                {
+                iFrameId = KAknsIIDQsnFrCall2BubbleFirst;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleFirstCoMask;                
+                }                
+            
+            // for possible frame draw
+            iOuterRect = outerRect;
+            iOuterRect.Move( Rect().iTl );
+            iInnerRect = innerRect;
+            iInnerRect.Move( Rect().iTl );
+
+            // Call icon
+            BubbleUtils::LayoutCustomElement( 
+                iSmallCallIndication, 
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_status_icon(19) );
+                
+            // Ciphering off
+            BubbleUtils::LayoutControl( 
+                iCyphOffImage, 
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_window_ciphering_icon(16) );
+            
+            // Call type pane
+            BubbleUtils::LayoutCallTypeIndicators(
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_type_icon(16),
+                iTypeIndication1,   // Data/Fax
+                iTypeIndication2 ); // ALS line 2               
+
+            // Text line 1 - cli
+            BubbleUtils::LayoutLabel( 
+                iTextLine1, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_first_call_cli_text(22) );
+            
+            // Text line 2 - phone number
+            BubbleUtils::LayoutLabel( 
+                iTextLine2, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_first_call_number_text(18) );
+            
+            // Smaller rect for text if brand image exists
+            if ( iBrandImage )
+                {
+                // Text line 3
+                    BubbleUtils::LayoutLabel(
+                    iTextLine3,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_in_call_text_3(3) );
+
+                //Brand image
+                BubbleUtils::LayoutCustomElement(
+                    iBrandImage,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_in_brand_image(0) );
+                }
+            else
+                {
+                // Text line 3
+                BubbleUtils::LayoutLabel(
+                    iTextLine3,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_first_call_state_text(18) );
+                }
+            
+            // Line 3 - call timer
+            BubbleUtils::LayoutLabel( 
+                iTimerCost, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_first_call_state_text(20) );
+                
+            // Build call object bubble
+            iBubble->SetRect( bubbleRect.Rect() );                                
+
+            BubbleUtils::PrepareBubbleImageL( 
+                iFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+            
+            
+            // Add transparency
+            BubbleUtils::AddTransparencyToBubbleImageL( 
+                coMaskFrameId,
+                outerRect,
+                innerRect,
+                iBubble ); 
+            
+                
+            break;
+            }        
+                
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomCnap::GetCall1BubbleBitmaps
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookBottomCnap::GetCall1BubbleBitmaps()
+    {
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    
+    TInt bubblePicture = KErrNotFound;
+    TInt bubblePictureMask = KErrNotFound;
+    
+    switch ( callState )
+        {
+        case CBubbleManager::EWaiting:
+        case CBubbleManager::EIncoming:
+            bubblePicture = EQgn_graf_call_rec_bigger;
+            bubblePictureMask = EQgn_graf_call_rec_bigger_mask;
+            break;
+        case CBubbleManager::EActive:
+            bubblePicture = EQgn_graf_call_first_one_active_emergency;
+            bubblePictureMask = EQgn_graf_call_first_one_active_emergency_mask;
+            break;
+        case CBubbleManager::EAlertToDisconnected:
+        case CBubbleManager::EOnHold:
+        case CBubbleManager::EDisconnected:
+        case CBubbleManager::ENone:
+        default:        
+            bubblePicture = KErrNotFound;
+            bubblePictureMask = KErrNotFound;
+            break;
+        }
+
+    if ( bubblePicture != KErrNotFound )
+        {
+        if ( bubblePictureMask == KErrNotFound )
+            {
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                iBubble, (TBMIcons) bubblePicture );
+            }
+        else
+            {
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                iBubble, 
+                (TBMIcons) bubblePicture , 
+                (TBMIcons) bubblePictureMask);
+            }
+        }
+        
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookBottomImCnap.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,282 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Bottom outlook with 3-lines and call image.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleManager.h" //for enumerations
+#include    "BMBubbleOutlookBottomImCnap.h"
+#include    "BMBubbleImageManager.h"
+#include    "BMResourceManager.h"
+#include    "BMBubbleHeader.h"
+#include    "BMLayout.h"
+#include    "BMUtils.h"
+#include    "BMLayout2.h"
+#include    <telbubblecustomelement.h>
+
+#include    <eiklabel.h> 
+#include    <eikimage.h>
+#include    <eikenv.h>
+#include    <AknsUtils.h>
+#include    <AknsDrawUtils.h>
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CBubbleOutlookBottomImageCnap::CBubbleOutlookBottomImageCnap
+    ( CBubbleManager& aBubbleManager )
+    : CBubbleOutlookThreeLined( aBubbleManager )
+    {
+    }
+
+// Symbian OS constructor can leave.
+void CBubbleOutlookBottomImageCnap::ConstructL()
+    {
+    CBubbleOutlookThreeLined::ConstructL();
+    }
+
+    
+// Destructor
+CBubbleOutlookBottomImageCnap::~CBubbleOutlookBottomImageCnap()
+    {
+    Reset();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomImageCnap::ReadBubbleHeader
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomImageCnap::ReadBubbleHeader( CBubbleHeader& aHeader )
+    {
+    iHeader = &aHeader;
+    
+    iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );        
+    
+    CBubbleOutlookThreeLined::ReadBubbleHeader( aHeader );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomImageCnap::SizeChanged
+// called by framwork when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomImageCnap::SizeChanged()
+    {
+    if( !iHeader )
+        {
+        return;
+        }
+
+    AknsUtils::RegisterControlPosition( this );
+    
+    if ( !iCallObjectDisplay )
+        {
+        DoCall1Layout();    
+        }
+    else
+        {
+        TRAPD( err, DoCall2LayoutL() );
+        if ( err )    
+            {
+            iBubble->SetPicture( NULL, NULL );
+                
+            MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+            AknsDrawUtils::PrepareFrame( skin,
+                                         iOuterRect,
+                                         iInnerRect,
+                                         iFrameId,
+                                         KAknsIIDDefault );
+            }  
+        }      
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomImageCnap::PositionChanged
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomImageCnap::PositionChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomImageCnap::DoCall1Layout
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookBottomImageCnap::DoCall1Layout()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomImageCnap::DoCall2Layout
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomImageCnap::DoCall2LayoutL()
+    {
+    iBubble->SetPictureOwnedExternally( EFalse );
+    iBubble->SetPicture( NULL, NULL );
+    
+    const TRect rect = Rect();
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    switch ( callState )
+        {
+        case CBubbleManager::EDisconnected:
+        case CBubbleManager::EActive:
+        case CBubbleManager::EOnHold:
+            {
+            ///////////////////////////////////////////////////////////////////
+            // First incall layout for single call. Call object image.
+            ///////////////////////////////////////////////////////////////////
+            
+            TAknLayoutRect bubbleRect;
+            bubbleRect.LayoutRect( 
+                rect, 
+                BubbleLayout2::popup_call2_audio_first_call_background(20) );
+            
+            TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+            TRect outerRect;
+            TRect innerRect;
+            BubbleLayout2::BubbleFrameInnerOuterRects( frameRect, 
+                                                       outerRect, 
+                                                       innerRect);
+            
+            TAknsItemID coMaskFrameId;
+            if ( callState == CBubbleManager::EOnHold )
+                {
+                iFrameId = KAknsIIDQsnFrCall2Bubble;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleCoMask;    
+                }
+            else if ( callState == CBubbleManager::EDisconnected )
+                {
+                iFrameId = KAknsIIDQsnFrCall2BubbleFirstDisconn;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleFirstCoMask;            
+                }
+            else
+                {
+                iFrameId = KAknsIIDQsnFrCall2BubbleFirst;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleFirstCoMask;                
+                } 
+                
+            iOuterRect = outerRect;
+            iOuterRect.Move( Rect().iTl );
+            iInnerRect = innerRect;
+            iInnerRect.Move( Rect().iTl );                
+            
+            // Call icon
+            BubbleUtils::LayoutCustomElement( 
+                iSmallCallIndication, 
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_status_icon(19) );
+                
+            // Ciphering off
+            BubbleUtils::LayoutControl( 
+                iCyphOffImage, 
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_window_ciphering_icon(16) );
+            
+            // Call type pane    
+            BubbleUtils::LayoutCallTypeIndicators(
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_type_icon(16),
+                iTypeIndication1,   // Data/Fax
+                iTypeIndication2 ); // ALS line 2
+
+            // Text line 1 - cli
+            BubbleUtils::LayoutLabel( 
+                iTextLine1, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_first_call_cli_text(22) );
+            
+            // Text line 2 - phone number
+            BubbleUtils::LayoutLabel( 
+                iTextLine2, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_first_call_number_text(18) );
+
+            // Smaller rect for text if brand image exists
+            if ( iBrandImage )
+                {
+                // Text line 2 - call state
+                BubbleUtils::LayoutLabel(
+                    iTextLine3,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_first_call_state_text(18) );
+
+                // Text line 2 - call timer
+                BubbleUtils::LayoutLabel(
+                    iTimerCost,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_first_call_state_text(20) );
+
+                //Brand image
+                BubbleUtils::LayoutCustomElement(
+                    iBrandImage,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_first_brand_image2(22) );
+                }
+            else
+                {
+                // Text line 2 - call state
+                BubbleUtils::LayoutLabel(
+                    iTextLine3,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_first_call_state_text(18) );
+
+                // Text line 2 - call timer
+                BubbleUtils::LayoutLabel(
+                    iTimerCost,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_first_call_state_text(20) );
+                }
+                
+            // Create call object bitmaps
+            iBubble->SetRect( bubbleRect.Rect() );                                
+
+            BubbleUtils::PrepareBubbleImageL( 
+                iFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+            
+            // Add transparency
+            BubbleUtils::AddTransparencyToBubbleImageL( 
+                coMaskFrameId,
+                outerRect,
+                innerRect,
+                iBubble ); 
+                               
+            break;
+            }
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomImageCnap::GetCall1BubbleBitmaps
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookBottomImageCnap::GetCall1BubbleBitmaps()
+    {
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookBottomImage.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,266 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 to display gallery images.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleManager.h" //for enumerations
+#include    "BMBubbleOutlookBottomImage.h"
+#include    "BMBubbleImageManager.h"
+#include    "BMResourceManager.h"
+#include    "BMBubbleHeader.h"
+#include    "BMUtils.h"
+#include    "BMLayout.h"
+#include    "BMLayout2.h"
+#include    "telbubblecustomelement.h"
+
+#include    <eiklabel.h> 
+#include    <eikimage.h>
+#include    <eikenv.h>
+#include    <AknsUtils.h>
+#include    <AknUtils.h>
+#include    <AknsDrawUtils.h>
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomImage::CBubbleOutlookBottomImage
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookBottomImage::CBubbleOutlookBottomImage( 
+    CBubbleManager& aBubbleManager ) : CBubbleOutlookTwoLined( aBubbleManager )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomImage::ConstructL
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomImage::ConstructL()
+    { 
+    CBubbleOutlookTwoLined::ConstructL();
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomImage::~CBubbleOutlookBottomImage
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookBottomImage::~CBubbleOutlookBottomImage()
+    {
+    Reset();
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomImage::ReadBubbleHeader
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomImage::ReadBubbleHeader( CBubbleHeader& aHeader )
+    {
+    iHeader = &aHeader;
+    
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    
+    iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );        
+    
+    CBubbleOutlookTwoLined::ReadBubbleHeader( aHeader );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomImage::SizeChanged
+// called by framework when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomImage::SizeChanged()
+    {
+    if( !iHeader )
+        {
+        return;
+        }
+
+    AknsUtils::RegisterControlPosition( this );
+    
+    TRAPD( err, DoCall2LayoutL() );
+    if ( err )    
+        {
+        iBubble->SetPicture( NULL, NULL );
+                
+        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        AknsDrawUtils::PrepareFrame( skin,
+                                     iOuterRect,
+                                     iInnerRect,
+                                     iFrameId,
+                                     KAknsIIDDefault );    
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomImage::PositionChanged
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomImage::PositionChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomImage::DoCall2Layout
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomImage::DoCall2LayoutL()
+    {
+    iBubble->SetPictureOwnedExternally( EFalse );
+    iBubble->SetPicture( NULL, NULL );
+    
+    const TRect rect = Rect();
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    switch ( callState )
+        {
+        case CBubbleManager::EDisconnected:
+        case CBubbleManager::EActive:
+        case CBubbleManager::EOnHold:
+            {
+            ///////////////////////////////////////////////////////////////////
+            // First incall layout for single call. Call object image.
+            ///////////////////////////////////////////////////////////////////
+            
+            TAknLayoutRect bubbleRect;
+            bubbleRect.LayoutRect( 
+                rect, 
+                BubbleLayout2::popup_call2_audio_first_call_background(14) );
+            
+            TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+            TRect outerRect;
+            TRect innerRect;
+            BubbleLayout2::BubbleFrameInnerOuterRects( frameRect, 
+                                                       outerRect, 
+                                                       innerRect);
+            
+            TAknsItemID coMaskFrameId;
+            if ( callState == CBubbleManager::EOnHold )
+                {
+                iFrameId = KAknsIIDQsnFrCall2Bubble;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleCoMask;    
+                }
+            else if ( callState == CBubbleManager::EDisconnected )
+                {
+                iFrameId = KAknsIIDQsnFrCall2BubbleFirstDisconn;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleFirstCoMask;            
+                }
+            else
+                {
+                iFrameId = KAknsIIDQsnFrCall2BubbleFirst;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleFirstCoMask;                
+                } 
+                
+            iOuterRect = outerRect;
+            iOuterRect.Move( Rect().iTl );
+            iInnerRect = innerRect;
+            iInnerRect.Move( Rect().iTl );                
+            
+            // Call icon
+            BubbleUtils::LayoutCustomElement( 
+                iSmallCallIndication, 
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_status_icon(13) );
+                
+            // Ciphering off
+            BubbleUtils::LayoutControl( 
+                iCyphOffImage, 
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_window_ciphering_icon(12) );
+            
+            // Call type pane    
+            BubbleUtils::LayoutCallTypeIndicators(
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_type_icon(12),
+                iTypeIndication1,   // Data/Fax
+                iTypeIndication2 ); // ALS line 2
+
+            // Text line 1
+            BubbleUtils::LayoutLabel( 
+                iTextLine1, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_first_call_cli_text(16) );
+
+            // Smaller rect for text if brand image exists
+            if ( iBrandImage )
+                {
+                // Text line 2 - call state
+                BubbleUtils::LayoutLabel(
+                    iTextLine2,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_first_call_state_text(16) );
+
+                // Text line 2 - call timer
+                BubbleUtils::LayoutLabel(
+                    iTimerCost,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_first_call_state_text(17) );
+
+                //Brand image
+                BubbleUtils::LayoutCustomElement(
+                    iBrandImage,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_first_brand_image2(1) );
+                }
+            else
+                {
+                // Text line 2 - call state
+                BubbleUtils::LayoutLabel(
+                    iTextLine2,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_first_call_state_text(12) );
+
+                // Text line 2 - call timer
+                BubbleUtils::LayoutLabel(
+                    iTimerCost,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_first_call_state_text(13) );
+                }
+                
+            // Create call object bitmaps
+            iBubble->SetRect( bubbleRect.Rect() );                                
+
+            BubbleUtils::PrepareBubbleImageL( 
+                iFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+            
+            // Add transparency
+            BubbleUtils::AddTransparencyToBubbleImageL( 
+                coMaskFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+                               
+            break;
+            }
+        case CBubbleManager::ENone:
+        default:
+            break;
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookBottomRiCnap.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,397 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Bottom right outlook with 3-lines.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleManager.h" //for enumerations
+#include    "BMBubbleOutlookBottomRiCnap.h"
+#include    "BMBubbleImageManager.h"
+#include    "BMResourceManager.h"
+#include    "BMBubbleHeader.h"
+#include    "BMLayout.h"
+#include    "BMUtils.h"
+#include    "BMLayout2.h"
+#include    "telbubblecustomelement.h"
+
+#include    <eiklabel.h> 
+#include    <eikimage.h>
+#include    <eikenv.h>
+#include    <AknsUtils.h>
+#include    <AknsDrawUtils.h>
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CBubbleOutlookBottomRightCnap::CBubbleOutlookBottomRightCnap
+    ( CBubbleManager& aBubbleManager )
+    : CBubbleOutlookThreeLined( aBubbleManager )
+    {
+    }
+
+// Symbian OS constructor can leave.
+void CBubbleOutlookBottomRightCnap::ConstructL()
+    {
+    CBubbleOutlookThreeLined::ConstructL();
+    }
+
+    
+// Destructor
+CBubbleOutlookBottomRightCnap::~CBubbleOutlookBottomRightCnap()
+    {
+    Reset();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomRightCnap::ReadBubbleHeader
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomRightCnap::ReadBubbleHeader( CBubbleHeader& aHeader )
+    {
+    iHeader = &aHeader;
+    
+    iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );        
+    
+    if ( !iCallObjectDisplay )
+        {
+        GetCall1BubbleBitmaps();    
+        }
+    
+    CBubbleOutlookThreeLined::ReadBubbleHeader( aHeader );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomRightCnap::SizeChanged
+// called by framwork when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomRightCnap::SizeChanged()
+    {
+    if( !iHeader )
+        {
+        return;
+        }
+
+    AknsUtils::RegisterControlPosition( this );
+    
+    if ( !iCallObjectDisplay )
+        {
+        DoCall1Layout();    
+        }
+    else
+        {
+        TRAPD( err, DoCall2LayoutL() );
+        if ( err )    
+            {
+            iBubble->SetPicture( NULL, NULL );
+                
+            MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+            AknsDrawUtils::PrepareFrame( skin,
+                                         iOuterRect,
+                                         iInnerRect,
+                                         iFrameId,
+                                         KAknsIIDDefault );
+            }  
+        }      
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomRightCnap::PositionChanged
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomRightCnap::PositionChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomRightCnap::DoCall1Layout
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookBottomRightCnap::DoCall1Layout()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomRightCnap::DoCall2Layout
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomRightCnap::DoCall2LayoutL()
+    {
+    iBubble->SetPictureOwnedExternally( EFalse );
+    iBubble->SetPicture( NULL, NULL );
+    
+    const TRect rect = Rect();
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    switch ( callState )
+        {
+        case CBubbleManager::EWaiting:
+        case CBubbleManager::EIncoming:
+        case CBubbleManager::EOutgoing:
+        case CBubbleManager::EAlerting:
+        case CBubbleManager::EAlertToDisconnected:
+            {
+            ///////////////////////////////////////////////////////////////////
+            // Outgoing call layout. Three lines of text.
+            ///////////////////////////////////////////////////////////////////
+            TAknLayoutRect bubbleRect;
+            bubbleRect.LayoutRect( 
+                rect, 
+                BubbleLayout2::popup_call2_audio_out_background(5) );
+            
+            TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+            TRect outerRect;
+            TRect innerRect;
+            BubbleLayout2::RectFrameInnerOuterRects( frameRect, 
+                                                     outerRect, 
+                                                     innerRect);
+            
+            iFrameId = ( callState == CBubbleManager::EAlertToDisconnected ) ?
+                                      KAknsIIDQsnFrCall2RectDisconn : 
+                                      KAknsIIDQsnFrCall2Rect;
+            
+            iOuterRect = outerRect;
+            iOuterRect.Move( Rect().iTl );
+            iInnerRect = innerRect;
+            iInnerRect.Move( Rect().iTl );
+            
+            
+            // Call indicator
+            BubbleUtils::LayoutCustomElement(
+                iBigCallIndicator, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_out_call_waiting_icon(5) );
+
+            // Ciphering off
+            BubbleUtils::LayoutControl( 
+                iCyphOffImage, 
+                rect,
+                BubbleLayout2::popup_call2_audio_out_ciphering_icon(5) );                
+            
+            // Number type icon
+            BubbleUtils::LayoutCustomElement(
+                iNumberType, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_out_call_number_type_icon(4) );
+
+            // Text line 1
+            BubbleUtils::LayoutLabel( 
+                iTextLine1, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_out_call_text_1(5) );
+            
+            // Text line 2
+            BubbleUtils::LayoutLabel( 
+                iTextLine2, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_out_call_text_2(4) );            
+            
+            // Smaller rect for text if brand image exists
+            if ( iBrandImage )
+                {
+                // Text line 3
+                BubbleUtils::LayoutLabel( 
+                    iTextLine3, 
+                    rect, 
+                    BubbleLayout2::popup_call2_audio_out_call_text_3(5) );
+                
+                //Brand image
+                BubbleUtils::LayoutCustomElement(
+                    iBrandImage,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_out_brand_image(1) );
+                }
+            else
+                {
+                // Text line 3
+                BubbleUtils::LayoutLabel( 
+                    iTextLine3, 
+                    rect, 
+                    BubbleLayout2::popup_call2_audio_out_call_text_3(4) );
+                }
+                
+            // Create call object bitmaps    
+            iBubble->SetRect( bubbleRect.Rect() );                
+
+            BubbleUtils::PrepareBubbleImageL( 
+                iFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+                
+            if ( iHeader->CallObjectImage() &&
+                 !iHeader->CallObjectText().Length() )
+                {
+                // Add transparency
+                BubbleUtils::AddTransparencyToBubbleImageL( 
+                    KAknsIIDQsnFrCall2RectCoMask, // gradient tp mask
+                    outerRect,
+                    innerRect,
+                    iBubble );                    
+                }    
+                                
+            break;
+            }
+        
+        case CBubbleManager::EActive:
+        case CBubbleManager::EOnHold:
+        case CBubbleManager::EDisconnected:
+            {
+            ///////////////////////////////////////////////////////////////////
+            // Second call layout for single call. Three lines of text.
+            ///////////////////////////////////////////////////////////////////
+            
+            TAknLayoutRect bubbleRect;
+            bubbleRect.LayoutRect( 
+                rect, 
+                BubbleLayout2::popup_call2_audio_second_call_background(14) );
+            
+            TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+            TRect outerRect;
+            TRect innerRect;
+            BubbleLayout2::BubbleFrameInnerOuterRects( frameRect, 
+                                                       outerRect, 
+                                                       innerRect);
+        
+            TAknsItemID coMaskFrameId;
+            if ( callState == CBubbleManager::EOnHold )
+                {
+                iFrameId = KAknsIIDQsnFrCall2Bubble;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleCoMask;    
+                }
+            else if ( callState == CBubbleManager::EDisconnected )
+                {
+                iFrameId = KAknsIIDQsnFrCall2BubbleSecondDisconn;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleSecondCoMask;            
+                }
+            else
+                {
+                iFrameId = KAknsIIDQsnFrCall2BubbleSecond;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleSecondCoMask;                
+                }                
+            
+            // for possible frame draw
+            iOuterRect = outerRect;
+            iOuterRect.Move( Rect().iTl );
+            iInnerRect = innerRect;
+            iInnerRect.Move( Rect().iTl );
+
+            // Call icon
+            BubbleUtils::LayoutCustomElement( 
+                iSmallCallIndication, 
+                rect,
+                BubbleLayout2::popup_call2_audio_second_call_status_icon(14) );
+                
+            // Ciphering off
+            BubbleUtils::LayoutControl( 
+                iCyphOffImage, 
+                rect,
+                BubbleLayout2::popup_call2_audio_second_call_cyphering_icon(14) );
+            
+            // Call type pane
+            BubbleUtils::LayoutCallTypeIndicators(
+                rect,
+                BubbleLayout2::popup_call2_audio_second_call_type_icon(14),
+                iTypeIndication1,   // Data/Fax
+                iTypeIndication2 ); // ALS line 2               
+
+            // Text line 1
+            BubbleUtils::LayoutLabel( 
+                iTextLine1, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_second_call_cli_text(16) );
+            
+            // Text line 2 - phone number
+            BubbleUtils::LayoutLabel( 
+                iTextLine2, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_second_call_number_text(16) );
+            
+            // Smaller rect for text if brand image exists
+            if ( iBrandImage )
+                {
+                // Text line 3 - call state
+                BubbleUtils::LayoutLabel( 
+                    iTextLine3, 
+                    rect, 
+                    BubbleLayout2::popup_call2_audio_second_call_state_text(18) );
+                
+                // Text line 3 - call timer
+                BubbleUtils::LayoutLabel( 
+                    iTimerCost, 
+                    rect, 
+                    BubbleLayout2::popup_call2_audio_second_call_timer_text(7) );
+                
+                //Brand image
+                BubbleUtils::LayoutCustomElement(
+                    iBrandImage,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_second_brand_image(2) );
+                }
+            else
+                {
+                // Text line 3 - call state
+                BubbleUtils::LayoutLabel( 
+                    iTextLine3, 
+                    rect, 
+                    BubbleLayout2::popup_call2_audio_second_call_state_text(15) );
+                
+                // Text line 3 - call timer
+                BubbleUtils::LayoutLabel( 
+                    iTimerCost, 
+                    rect, 
+                    BubbleLayout2::popup_call2_audio_second_call_timer_text(6) );
+                }
+                
+            // Build call object bubble
+            iBubble->SetRect( bubbleRect.Rect() );                                
+
+            BubbleUtils::PrepareBubbleImageL( 
+                iFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+            
+            // Add transparency
+            BubbleUtils::AddTransparencyToBubbleImageL( 
+                coMaskFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+                
+            break;
+            }
+            
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomRightCnap::GetCall1BubbleBitmaps
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookBottomRightCnap::GetCall1BubbleBitmaps()
+    {
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookBottomRight.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,443 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Outlook Bottom Right
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleManager.h" //for enumerations
+#include    "BMBubbleOutlookBottomRight.h"
+#include    "BMBubbleImageManager.h"
+#include    "BMResourceManager.h"
+#include    "BMBubbleHeader.h"
+#include    "BMUtils.h"
+#include    "BMLayout.h"
+#include    "BMLayout2.h"
+#include    "telbubblecustomelement.h"
+
+#include    <eiklabel.h> 
+#include    <eikimage.h>
+#include    <eikenv.h>
+#include    <AknsUtils.h>
+#include    <AknsDrawUtils.h>
+
+// ========================= MEMBER FUNCTIONS ================================
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomRight::CBubbleOutlookBottomRight
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookBottomRight::CBubbleOutlookBottomRight( 
+    CBubbleManager& aBubbleManager ) 
+    : CBubbleOutlookTwoLined( aBubbleManager ) 
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomRight::ConstructL
+// 
+// ---------------------------------------------------------------------------
+//
+
+void CBubbleOutlookBottomRight::ConstructL()
+    {  
+    CBubbleOutlookTwoLined::ConstructL();
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomRight::~CBubbleOutlookBottomRight
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookBottomRight::~CBubbleOutlookBottomRight()
+    {
+    Reset();
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomRight::ReadBubbleHeader
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomRight::ReadBubbleHeader( CBubbleHeader& aHeader )
+    {
+    iHeader = &aHeader;
+    iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );        
+    
+    if ( !iCallObjectDisplay )
+        {
+        GetCall1BubbleBitmaps();    
+        }
+    
+    CBubbleOutlookTwoLined::ReadBubbleHeader( aHeader );
+    }
+    
+    
+    
+    
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomRight::SizeChanged
+// called by framwork when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomRight::SizeChanged()
+    {
+    if( !iHeader )
+        {
+        return;
+        }
+
+    AknsUtils::RegisterControlPosition( this );
+    
+    if ( !iCallObjectDisplay )
+        {
+        DoCall1Layout();    
+        }
+    else
+        {
+        TRAPD( err, DoCall2LayoutL() );
+        if ( err )    
+            {
+            iBubble->SetPicture( NULL, NULL );
+                
+            MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+            AknsDrawUtils::PrepareFrame( skin,
+                                         iOuterRect,
+                                         iInnerRect,
+                                         iFrameId,
+                                         KAknsIIDDefault );    
+            }
+        }     
+    }
+    
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomRight::DoCall1Layout
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookBottomRight::DoCall1Layout()
+    {
+    // Deprecated
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomRight::DoCall2Layout
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomRight::DoCall2LayoutL()
+    {
+    iBubble->SetPictureOwnedExternally( EFalse );
+    iBubble->SetPicture( NULL, NULL );
+    
+    const TRect rect = Rect();
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    switch ( callState )
+        {
+        case CBubbleManager::EWaiting:
+        case CBubbleManager::EIncoming:
+        case CBubbleManager::EOutgoing:
+        case CBubbleManager::EAlerting:
+        case CBubbleManager::EAlertToDisconnected:
+            {
+            ///////////////////////////////////////////////////////////////////
+            // Outgoing call layout for second call.
+            ///////////////////////////////////////////////////////////////////
+            
+            TAknLayoutRect bubbleRect;
+            bubbleRect.LayoutRect( 
+                rect, 
+                BubbleLayout2::popup_call2_audio_out_background(1) );
+            
+            TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+            TRect outerRect;
+            TRect innerRect;
+            BubbleLayout2::RectFrameInnerOuterRects( frameRect, 
+                                                     outerRect, 
+                                                     innerRect);
+            
+            iFrameId = ( callState == CBubbleManager::EAlertToDisconnected ) ?
+                                      KAknsIIDQsnFrCall2RectDisconn : 
+                                      KAknsIIDQsnFrCall2Rect;
+            
+            iOuterRect = outerRect;
+            iOuterRect.Move( Rect().iTl );
+            iInnerRect = innerRect;
+            iInnerRect.Move( Rect().iTl );
+            
+            
+            // Call indicator
+            BubbleUtils::LayoutCustomElement(
+                iBigCallIndicator, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_out_call_waiting_icon(1) );
+            
+            // Ciphering off
+            BubbleUtils::LayoutControl( 
+                iCyphOffImage, 
+                rect,
+                BubbleLayout2::popup_call2_audio_out_ciphering_icon(1) );                
+            
+            // Number type icon
+            BubbleUtils::LayoutCustomElement(
+                iNumberType, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_out_call_number_type_icon(1) );
+
+            // Text line 1
+            BubbleUtils::LayoutLabel( 
+                iTextLine1, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_out_call_text_1(1) );
+            
+            // Smaller rect for text if brand image exists
+            if ( iBrandImage )
+                {
+                // Text line 2
+                BubbleUtils::LayoutLabel(
+                    iTextLine2,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_out_call_text_2(3) );
+
+                //Brand image
+                BubbleUtils::LayoutCustomElement(
+                    iBrandImage,
+                   	rect,
+                    BubbleLayout2::popup_call2_audio_out_brand_image(0) );
+                }
+            else
+                {
+                // Text line 2
+                BubbleUtils::LayoutLabel(
+                    iTextLine2,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_out_call_text_2(1) );
+                }
+            
+            // Create call object bitmaps
+            iBubble->SetRect( bubbleRect.Rect() );                
+            
+            BubbleUtils::PrepareBubbleImageL( 
+                iFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+                
+            if ( iHeader->CallObjectImage()  &&
+                 !iHeader->CallObjectText().Length() )
+                {
+                // Add transparency
+                BubbleUtils::AddTransparencyToBubbleImageL( 
+                    KAknsIIDQsnFrCall2RectCoMask, // gradient tp mask
+                    outerRect,
+                    innerRect,
+                    iBubble );                    
+                }                
+            break;
+            }
+        case CBubbleManager::EDisconnected:
+        case CBubbleManager::EActive:
+        case CBubbleManager::EOnHold:
+            {
+            ///////////////////////////////////////////////////////////////////
+            // Second call layout.
+            ///////////////////////////////////////////////////////////////////
+            
+            // Create bubble image
+            TAknLayoutRect bubbleRect;
+            bubbleRect.LayoutRect( 
+                rect, 
+                BubbleLayout2::popup_call2_audio_second_call_background(9) );
+            
+            TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+            TRect outerRect;
+            TRect innerRect;
+            BubbleLayout2::BubbleFrameInnerOuterRects( frameRect, 
+                                                       outerRect, 
+                                                       innerRect);
+            
+            TAknsItemID coMaskFrameId;
+            if ( callState == CBubbleManager::EOnHold )
+                {
+                iFrameId = KAknsIIDQsnFrCall2Bubble;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleCoMask;
+                }
+            else if ( callState == CBubbleManager::EDisconnected )
+                {
+                iFrameId = KAknsIIDQsnFrCall2BubbleSecondDisconn;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleSecondCoMask;
+                }
+            else
+                {
+                iFrameId = KAknsIIDQsnFrCall2BubbleSecond;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleSecondCoMask;
+                }
+            
+            iOuterRect = outerRect;
+            iOuterRect.Move( Rect().iTl );
+            iInnerRect = innerRect;
+            iInnerRect.Move( Rect().iTl );
+
+            // Call icon
+            BubbleUtils::LayoutCustomElement( 
+                iSmallCallIndication, 
+                rect,
+                BubbleLayout2::popup_call2_audio_second_call_status_icon(9) );
+                
+            // Ciphering off
+            BubbleUtils::LayoutControl( 
+                iCyphOffImage, 
+                rect,
+                BubbleLayout2::popup_call2_audio_second_call_cyphering_icon(9) );
+            
+            // Call type pane    
+            BubbleUtils::LayoutCallTypeIndicators(
+                rect,
+                BubbleLayout2::popup_call2_audio_second_call_type_icon(9),
+                iTypeIndication1,   // Data/Fax
+                iTypeIndication2 ); // ALS line 2
+
+            // Text line 1
+            BubbleUtils::LayoutLabel( 
+                iTextLine1, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_second_call_cli_text(11) );
+            
+            // Smaller rect for text if brand image exists
+            if ( iBrandImage )
+                {
+                // Text line 2 - call state
+                BubbleUtils::LayoutLabel(
+                    iTextLine2,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_second_call_state_text(5) );
+
+                // Text line 2 - call timer
+                BubbleUtils::LayoutLabel(
+                    iTimerCost,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_second_call_timer_text(5) );
+
+                //Brand image
+                BubbleUtils::LayoutCustomElement(
+            	    iBrandImage,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_second_brand_image(0) );
+                }
+            else
+                {
+                // Text line 2 - call state
+                BubbleUtils::LayoutLabel(
+                    iTextLine2,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_second_call_state_text(4) );
+
+                // Text line 2 - call timer
+                BubbleUtils::LayoutLabel(
+                    iTimerCost,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_second_call_timer_text(4) );
+                }
+                
+            // Create call object bitmaps
+            iBubble->SetRect( bubbleRect.Rect() );                                
+
+            BubbleUtils::PrepareBubbleImageL( 
+                iFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+            
+            // Add transparency
+            BubbleUtils::AddTransparencyToBubbleImageL( 
+                coMaskFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+				              
+            break;
+            }
+        case CBubbleManager::ENone:
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomRight::GetCall1BubbleBitmaps
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookBottomRight::GetCall1BubbleBitmaps()
+    {
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    
+    TInt bubblePicture = KErrNotFound;
+    TInt bubblePictureMask = KErrNotFound;
+    
+    // set call indications and bubble
+    switch ( callState )
+        {
+        case CBubbleManager::EWaiting:
+        case CBubbleManager::EIncoming:
+        case CBubbleManager::EOutgoing:
+        case CBubbleManager::EAlerting:
+            bubblePicture = EQgn_graf_call_rec_big_right;
+            bubblePictureMask = EQgn_graf_call_rec_big_right_mask;
+            break;
+        case CBubbleManager::EAlertToDisconnected:
+            bubblePicture = EQgn_graf_call_rec_big_right_disconn;
+            bubblePictureMask = EQgn_graf_call_rec_big_right_disconn_mask;
+            break;
+        case CBubbleManager::EActive:
+            bubblePicture = EQgn_graf_call_second_two_active;
+            bubblePictureMask = EQgn_graf_call_second_two_active_mask;
+            break;
+        case CBubbleManager::EOnHold:
+            bubblePicture = EQgn_graf_call_second_two_held;
+            bubblePictureMask = EQgn_graf_call_second_two_held_mask;
+            break;
+        case CBubbleManager::EDisconnected:
+            bubblePicture = EQgn_graf_call_second_two_disconn;
+            bubblePictureMask = EQgn_graf_call_second_two_disconn_mask;
+            break;
+        case CBubbleManager::ENone:
+        default:
+            bubblePicture = KErrNotFound;
+            bubblePictureMask = KErrNotFound;
+            break;
+        }
+
+    if ( bubblePicture != KErrNotFound )
+        {
+        if ( bubblePictureMask == KErrNotFound )
+            {
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                iBubble, (TBMIcons) bubblePicture );
+            }
+        else
+            {
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                iBubble, 
+                (TBMIcons) bubblePicture , 
+                (TBMIcons) bubblePictureMask);
+            }
+        }
+        
+    }    
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookBottomText.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,336 @@
+/*
+* 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:  Bubble for call object text display.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleManager.h" //for enumerations
+#include    "BMBubbleOutlookBottomText.h"
+#include    "BMBubbleImageManager.h"
+#include    "BMResourceManager.h"
+#include    "BMBubbleHeader.h"
+#include    "BMUtils.h"
+#include    "BMLayout.h"
+#include    "BMLayout2.h"
+#include    "telbubblecustomelement.h"
+
+#include    <eiklabel.h> 
+#include    <eikimage.h>
+#include    <eikenv.h>
+#include    <AknsUtils.h>
+#include    <AknUtils.h>
+#include    <AknBidiTextUtils.h>
+#include    <AknsDrawUtils.h>
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomText::CBubbleOutlookBottomText
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookBottomText::CBubbleOutlookBottomText( 
+    CBubbleManager& aBubbleManager ) : CBubbleOutlookFiveLined( aBubbleManager )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomText::ConstructL
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomText::ConstructL()
+    { 
+    CBubbleOutlookFiveLined::ConstructL();
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomText::~CBubbleOutlookBottomText
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookBottomText::~CBubbleOutlookBottomText()
+    {
+    Reset();
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomText::ReadBubbleHeader
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomText::ReadBubbleHeader( CBubbleHeader& aHeader )
+    {
+    iHeader = &aHeader;
+    
+    iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );        
+    
+    iThreeLinedLayout = ( iHeader->CNAP().Length() > 0 );
+    
+    CBubbleOutlookFiveLined::ReadBubbleHeader( aHeader );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomText::SizeChanged
+// called by framework when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomText::SizeChanged()
+    {
+    if( !iHeader )
+        {
+        return;
+        }
+
+    AknsUtils::RegisterControlPosition( this );
+    
+    TRAPD( err, DoCall2LayoutL() );
+    if ( err )    
+        {
+        iBubble->SetPicture( NULL, NULL );
+                
+        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        AknsDrawUtils::PrepareFrame( skin,
+                                     iOuterRect,
+                                     iInnerRect,
+                                     iFrameId,
+                                     KAknsIIDDefault );    
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomText::PositionChanged
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomText::PositionChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomText::DoCall2Layout
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookBottomText::DoCall2LayoutL()
+    {
+    iBubble->SetPictureOwnedExternally( EFalse );
+    iBubble->SetPicture( NULL, NULL );
+    
+    const TRect rect = Rect();
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    switch ( callState )
+        {
+        case CBubbleManager::EIncoming:
+        case CBubbleManager::EOutgoing:
+        case CBubbleManager::EAlerting:
+        case CBubbleManager::EAlertToDisconnected:
+            {
+            ///////////////////////////////////////////////////////////////////
+            // Incoming call layout for single call. Call object text.
+            ///////////////////////////////////////////////////////////////////
+            
+            TInt variety = iThreeLinedLayout ? 4 : 3;
+            
+            TAknLayoutRect bubbleRect;
+            bubbleRect.LayoutRect( 
+                rect, 
+                BubbleLayout2::popup_call2_audio_in_background( variety ) );
+            
+            TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+            TRect outerRect;
+            TRect innerRect;
+            BubbleLayout2::RectFrameInnerOuterRects( frameRect, 
+                                                     outerRect, 
+                                                     innerRect);
+            
+            iFrameId = ( callState == 
+                         CBubbleManager::EAlertToDisconnected ) ?
+                         KAknsIIDQsnFrCall2RectDisconn : 
+                         KAknsIIDQsnFrCall2Rect;
+            
+            iOuterRect = outerRect;
+            iOuterRect.Move( Rect().iTl );
+            iInnerRect = innerRect;
+            iInnerRect.Move( Rect().iTl );                
+            
+            
+            // Call indicator
+            BubbleUtils::LayoutCustomElement(
+                iBigCallIndicator, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_out_call_waiting_icon(1) );
+                
+            BubbleUtils::LayoutControl( 
+                iCyphOffImage, 
+                rect,
+                BubbleLayout2::popup_call2_audio_in_ciphering_icon(variety) );                                
+            
+            BubbleUtils::LayoutCustomElement(
+                iNumberType, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_in_call_number_type_icon(variety) );
+
+            BubbleUtils::LayoutLabel( 
+                iTextLine1, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_in_call_text_1(variety));
+
+            BubbleUtils::LayoutLabel( 
+                iTextLine2, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_in_call_text_2(variety));
+            
+            
+            if ( iThreeLinedLayout )
+                {
+                // Textual cli 1
+                BubbleUtils::LayoutLabel( 
+                    iTextLine3, 
+                    rect, 
+                    BubbleLayout2::popup_call2_audio_in_call_text_3(2));
+            
+                // Textual cli 2
+                BubbleUtils::LayoutLabel( 
+                    iTextLine4, 
+                    rect, 
+                    BubbleLayout2::popup_call2_audio_in_cli_textual_2(1));
+
+                // Textual cli 3
+                BubbleUtils::LayoutLabel( 
+                    iTextLine5, 
+                    rect, 
+                    BubbleLayout2::popup_call2_audio_in_cli_textual_3(1));
+                
+            
+                CEikLabel* labels[] = { iTextLine4, iTextLine5 };
+                SetCallObjectTextToLabelsL( iHeader->CallObjectText(),
+                                            2, labels );                    
+                }
+            else
+                {
+                // Textual cli 1
+                BubbleUtils::LayoutLabel( 
+                    iTextLine3, 
+                    rect, 
+                    BubbleLayout2::popup_call2_audio_in_cli_textual_1(0));
+            
+                // Textual cli 2
+                BubbleUtils::LayoutLabel( 
+                    iTextLine4, 
+                    rect, 
+                    BubbleLayout2::popup_call2_audio_in_cli_textual_2(0));
+
+                // Textual cli 3
+                BubbleUtils::LayoutLabel( 
+                    iTextLine5, 
+                    rect, 
+                    BubbleLayout2::popup_call2_audio_in_cli_textual_3(0));
+                
+            
+                CEikLabel* labels[] = { iTextLine3, iTextLine4, iTextLine5 };
+                SetCallObjectTextToLabelsL( iHeader->CallObjectText(),
+                                            3, labels );                
+                }
+            
+            // Create call object bitmaps
+            iBubble->SetRect( bubbleRect.Rect() );                
+            
+            BubbleUtils::PrepareBubbleImageL( 
+                iFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+            
+            break;
+            }
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookBottomText::SetCliTextToLabelsL
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookBottomText::SetCallObjectTextToLabelsL(
+    const TDesC& aText,
+    TInt aLabelCount,
+    CEikLabel* aLabels[] )
+    {
+    if ( aLabelCount == 0 )
+        {
+        return;    
+        }
+    
+    CEikLabel* label1 = aLabels[0];
+    if ( !label1 )
+        {
+        return;            
+        }
+        
+    CArrayFix<TPtrC>* wrappedText = 
+        new(ELeave) CArrayFixFlat<TPtrC>(aLabelCount);
+    CleanupStack::PushL( wrappedText );
+    
+    CArrayFix<TInt>* lineWidths = 
+        new(ELeave) CArrayFixFlat<TInt>(aLabelCount);
+    CleanupStack::PushL( lineWidths );
+    
+    for ( TInt index(0); index < aLabelCount; index++ )
+        {
+        CEikLabel* label = aLabels[index];
+        if ( label )         
+            {
+            lineWidths->InsertL( index, label->Size().iWidth );
+            }
+        }
+    
+    HBufC* buffer = HBufC::NewL( aText.Length() + 
+        ( KAknBidiExtraSpacePerLine * aLabelCount ) );
+    CleanupStack::PushL( buffer );
+    *buffer = aText;
+    TPtr text( buffer->Des() );
+    
+    AknBidiTextUtils::ConvertToVisualAndWrapToArrayL( 
+        text,
+        *lineWidths,
+        *label1->Font(),
+        *wrappedText,
+        ETrue );
+    
+    // set wrapped text to labels
+    TInt lineCount = wrappedText->Count();
+    for ( TInt index(0); index < aLabelCount && index < lineCount ; index++ )
+        {
+        CEikLabel* label = aLabels[index];
+        TPtrC& line = wrappedText->At(index);
+         
+        if ( line.Length() && label )         
+            {
+            label->SetTextL( line );    
+            }
+        }
+
+    CleanupStack::PopAndDestroy( buffer );
+    CleanupStack::PopAndDestroy( lineWidths );
+    CleanupStack::PopAndDestroy( wrappedText );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookConference.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,736 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Outlook Conference
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleManager.h" //for enumerations
+#include    "BMBubbleOutlookConference.h"
+#include    "BMBubbleImageManager.h"
+#include    "BMResourceManager.h"
+#include    "BMConfHeader.h"
+#include    "BMLayout.h"
+#include    "BMUtils.h"
+#include    "BMPanic.h"
+#include    "BMLayout2.h"
+#include    "BMLayout4.h"
+
+#include    <eiklabel.h>  
+#include    <eikimage.h>
+#include    <eikenv.h>
+#include    <AknsUtils.h>
+#include    <AknsDrawUtils.h>
+
+// ========================= MEMBER FUNCTIONS ================================
+
+CBubbleOutlookConference::CBubbleOutlookConference( 
+    CBubbleManager& aBubbleManager ) 
+    : CBubbleOutlook( aBubbleManager )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookConference::ConstructL
+// ---------------------------------------------------------------------------
+//
+
+void CBubbleOutlookConference::ConstructL( const TUint8& aCallAmount )
+    {
+    iPaneAmount = aCallAmount;
+    iHeader = NULL;
+
+    // create panes for each call
+    CBubbleConfPane* pane;
+    iConfPanes = new ( ELeave ) CArrayPtrFlat<CBubbleConfPane>( iPaneAmount );    
+    iConfPanes->SetReserveL( iPaneAmount );
+
+    for ( TUint8 i = 0 ; i < iPaneAmount ; i++ )
+        {
+        pane = new( ELeave ) CBubbleConfPane;
+        CleanupStack::PushL( pane );
+        pane->SetContainerWindowL( *this );
+        pane->ConstructL( iBubbleManager.IsTouchCallHandling() );
+        iConfPanes->InsertL( i , pane );
+        CleanupStack::Pop( pane );
+        }
+
+    // Create space for headers 
+    iCalls = new( ELeave ) CArrayPtrFlat<CBubbleCallHeader>( iPaneAmount );
+    iCalls->SetReserveL( iPaneAmount );
+
+
+    CBubbleOutlook::ConstructL();
+    ActivateL();
+    }
+
+// Destructor
+CBubbleOutlookConference::~CBubbleOutlookConference()
+    {
+
+    if ( iCalls && iConfPanes )
+        {
+        Reset();
+        }
+
+    if ( iCalls )
+        {
+        iCalls->Reset( );
+        delete iCalls;
+        }
+ 
+    if ( iConfPanes )
+        {
+        iConfPanes->ResetAndDestroy() ;
+        delete iConfPanes;
+        }
+    
+    iHeader = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookConference::Reset
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookConference::Reset()
+    {
+    iBubbleManager.ResourceManager().ReleaseEikImage( iBubble );
+    iBubbleManager.ResourceManager().ReleaseEikLabel( iTimerCost );
+    for ( TUint8 i = 0 ; i < iPaneAmount ; i++ )
+        {
+        iBubbleManager.ResourceManager().ReleaseEikImage( 
+            iConfPanes->At( i )->iCallIndication );
+        iBubbleManager.ResourceManager().ReleaseEikImage( 
+            iConfPanes->At( i )->iCyphOffImage );
+        iBubbleManager.ResourceManager().ReleaseEikLabel( 
+            iConfPanes->At( i )->iTextLine );
+        iConfPanes->At( i )->Reset( );
+        }
+
+    iCalls->Delete( 0 , iCalls->Count() );
+    
+    iHeader = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookConference::ReadBubbleHeader
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookConference::ReadBubbleHeader( CBubbleHeader& aHeader )
+    {
+    if ( !aHeader.IsUsed() || !aHeader.IsConference() )
+        {
+        return;
+        }
+
+    iHeader = static_cast< CBubbleConfHeader* >( &aHeader ); 
+
+    // get call's info. Function returns calls in drawing order.
+    iHeader->GetRows( *iCalls );
+    __ASSERT_ALWAYS( iCalls->Count( ) == iPaneAmount, 
+                                    Panic( EBMPanicInvalidNumberOfHeaders ) );
+
+
+    iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );
+
+    if ( !iCallObjectDisplay )
+        {
+        // Get bubble graphics
+        GetCall1BubbleBitmaps();    
+        }
+
+    // Get call indicator for each pane.
+    TUint32 flags = 0;  
+    CBubbleManager::TPhoneCallState state;
+
+    TInt indicationPicture = KErrNotFound;
+    TInt indicationPictureMask =KErrNotFound;
+
+    for ( TUint8 i = 0 ; i < iPaneAmount ; i++ )
+        {
+        flags = iCalls->At( i )->CallFlags( );
+        state = iCalls->At( i )->CallState( );
+        CEikImage*& image = iConfPanes->At( i )->CallIndicationHandle( );
+
+        indicationPicture = KErrNotFound;
+        indicationPictureMask = KErrNotFound;
+
+        if ( state == CBubbleManager::EDisconnected )
+            {
+            indicationPicture = EQgn_indi_call_disconn_conf;
+            indicationPictureMask = EQgn_indi_call_disconn_conf_mask;
+            }
+        else if ( state == CBubbleManager::EActive ) 
+            {
+            indicationPicture = EQgn_indi_call_active_conf;
+            indicationPictureMask = EQgn_indi_call_active_conf_mask;
+            }
+        else 
+            {
+            indicationPicture = EQgn_indi_call_held_conf;
+            indicationPictureMask = EQgn_indi_call_held_conf_mask;
+            }
+
+        if ( indicationPicture != KErrNotFound )
+            {
+            image = iBubbleManager.ResourceManager().ReserveEikImage();
+            if ( indicationPictureMask == KErrNotFound )
+                {
+                iBubbleManager.ImageManager().SetBitmapToImage( 
+                    image, (TBMIcons) indicationPicture );
+                }
+            else
+                {
+                iBubbleManager.ImageManager().SetBitmapToImage( 
+                    image, 
+                    (TBMIcons) indicationPicture , 
+                    (TBMIcons) indicationPictureMask);
+                }
+            }
+
+        // Cyph off
+        if ( flags&CBubbleManager::ENoCiphering )
+            {
+            iConfPanes->At( i )->iCyphOffImage = 
+                iBubbleManager.ResourceManager().ReserveEikImage();
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                    iConfPanes->At( i )->iCyphOffImage, 
+                    EQgn_indi_call_cyphering_off,
+                    EQgn_indi_call_cyphering_off_mask );
+            }
+
+        // set CLI to pane
+        if ( ( iCalls->At( i )->ParticipantListCLI() == 
+              CBubbleManager::EParticipantListCNAP ) &&
+             iCalls->At( i )->CNAP().Length() )
+            {
+            // Phonenumber
+            iConfPanes->At( i )->iTextLine = 
+                iBubbleManager.ResourceManager().ReserveEikLabel();
+            iConfPanes->At( i )->SetText( iCalls->At( i )->CNAP(), 
+                                          iCalls->At( i )->CNAPClipDirection( ) );    
+            }
+        else            
+            {
+            // CLI text
+            iConfPanes->At( i )->iTextLine = 
+                iBubbleManager.ResourceManager().ReserveEikLabel();
+            iConfPanes->At( i )->SetText( iCalls->At( i )->CLI(), 
+                                          iCalls->At( i )->CLIClipDirection( ) );
+            }
+                                      
+        iConfPanes->At( i )->iCallObjectDisplay = iCallObjectDisplay;
+        }
+
+    // get highlight
+    for ( TUint8 t = 0 ; t < iConfPanes->Count() ; t++ )
+        {
+        iConfPanes->At( t )->SetHighlight( EFalse );
+        }
+
+    if ( iHeader->Highlight() != 0 )
+        {
+        iConfPanes->At( iHeader->Highlight() - 1 )->SetHighlight( ETrue );
+        }
+    
+    // place timer/cost text to label
+    if ( !iBubbleManager.IsTouchCallHandling() )
+        {
+        iTimerCost = iBubbleManager.ResourceManager().ReserveEikLabel();
+        BubbleUtils::ClipToLabel( 
+            iHeader->TimerCost( ) , iTimerCost , CBubbleManager::ERight );
+            
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookConference::SizeChanged
+// called by framwork when the view size is changed
+// Works with all the conference situations.
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookConference::SizeChanged()
+    {
+    if( !iHeader )
+        {
+        return;
+        }
+        
+    AknsUtils::RegisterControlPosition( this );
+
+    if ( iBubbleManager.IsTouchCallHandling() )
+        {
+        TRAPD( err, DoCall4LayoutL() );
+        if ( err )    
+            {
+            iBubble->SetPicture( NULL, NULL );
+            MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+            AknsDrawUtils::PrepareFrame( skin,
+                                         iOuterRect,
+                                         iInnerRect,
+                                         iFrameId,
+                                         KAknsIIDDefault );
+            }
+        }
+    else if ( !iCallObjectDisplay )
+        {
+        DoCall1Layout();    
+        }
+    else
+        {
+        TRAPD( err, DoCall2LayoutL() );
+        if ( err )    
+            {
+            iBubble->SetPicture( NULL, NULL );
+            MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+            AknsDrawUtils::PrepareFrame( skin,
+                                         iOuterRect,
+                                         iInnerRect,
+                                         iFrameId,
+                                         KAknsIIDDefault );
+            }  
+        }      
+
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookConference::CountComponentControls
+//
+//  
+// ---------------------------------------------------------------------------
+//
+TInt CBubbleOutlookConference::CountComponentControls() const
+    {
+    if ( iTimerCost )
+        {
+        return 1 + iConfPanes->Count( );
+        }
+    return iConfPanes->Count( );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookConference::ComponentControl
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CBubbleOutlookConference::ComponentControl(TInt aIndex) const
+    {
+    if ( iTimerCost )
+        {
+        if ( aIndex < iConfPanes->Count( ) ) 
+            {
+            return iConfPanes->At( aIndex );
+            }
+        else if ( aIndex == iConfPanes->Count( ) ) 
+            {
+            return iTimerCost;
+            }
+        else 
+            {
+            return NULL;
+            }
+        }
+    return iConfPanes->At( aIndex );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookConference::Draw
+// 
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookConference::Draw( const TRect& /*aRect*/ ) const
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookConference::DrawTimerCostNow
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookConference::DrawTimerCostNow()
+    {
+    if ( iHeader == NULL || iTimerCost == NULL )
+        {
+        return;
+        }
+
+    if ( iHeader->CallState() != CBubbleManager::EActive 
+        || iTimerCost->Text()->Compare( iHeader->TimerCost() ) == 0 )
+        {
+        return;
+        }
+    
+    BubbleUtils::ClipToLabel( 
+        iHeader->TimerCost() , iTimerCost , CBubbleManager::ERight );
+    DrawLabelNow( iTimerCost );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookConference::DrawCLINow
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookConference::DrawCLINow()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookConference::DrawRowNow
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookConference::DrawRowNow( CBubbleManager::TRowNumber aRow )
+    {
+    if ( iHeader == NULL || aRow == 0 )
+        {
+        return;
+        }
+
+    // get highlight
+    for ( TUint8 t = 0 ; t < iConfPanes->Count() ; t++ )
+        {
+        iConfPanes->At( t )->SetHighlight( EFalse );
+        }
+
+    if ( iHeader->Highlight() != 0 )
+        {
+        iConfPanes->At( iHeader->Highlight() - 1 )->SetHighlight( ETrue );
+        }
+
+    DrawLabelNow( iConfPanes->At( aRow - 1 ) );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookConference::DrawBitmaps
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookConference::DrawBitmaps( CBitmapContext& aGc ) const
+    {
+    // Check that proper conference header is set
+    if ( iHeader == NULL )
+        {
+        return;
+        }
+
+    if ( !iHeader->IsUsed() || !iHeader->IsConference( ) ) 
+        {
+        return;
+        }
+
+    aGc.SetBrushColor( AKN_LAF_COLOR( BubbleLayout::LayoutColourWhite() ) );
+    
+    if ( !iCallObjectDisplay )
+        {
+        BubbleUtils::DrawMaskedImage( aGc , iBubble );
+        }
+    else
+        {
+        if ( iBubble->Bitmap() )
+            {
+            BubbleUtils::DrawMaskedImage( aGc , iBubble );    
+            }
+        else
+            {
+            // Draw bubble frame
+            MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+            if ( !AknsDrawUtils::DrawFrame( skin,
+                                            (CWindowGc&) aGc,  
+                                            iOuterRect,
+                                            iInnerRect,
+                                            iFrameId,
+                                            KAknsIIDDefault ) )
+                {
+                BubbleUtils::DrawBackgroundRect( aGc, Rect() );
+                }        
+            }    
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookConference::HandleAnimationStartL
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookConference::HandleAnimationStartL() const
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlookConference::DrawCallHeaderText
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookConference::DrawCallHeaderText()
+    {    
+    }
+    
+// ---------------------------------------------------------------------------
+// CBubbleOutlookConference::DoCall1Layout
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookConference::DoCall1Layout()
+    {
+    // Deprecated
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookConference::DoCall2Layout
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookConference::DoCall2LayoutL()
+    {
+    iBubble->SetPictureOwnedExternally( EFalse );
+    iBubble->SetPicture( NULL, NULL );
+    
+    TAknLayoutRect bubbleRect;
+    bubbleRect.LayoutRect( 
+        Rect(), 
+        BubbleLayout2::popup_call2_conf_pane_background() );
+            
+    TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+    TRect outerRect;
+    TRect innerRect;
+    BubbleLayout2::BubbleFrameInnerOuterRects( frameRect, 
+                                               outerRect, 
+                                               innerRect );
+
+    iFrameId = KAknsIIDQsnFrCall2BubbleFirst;
+    TAknsItemID coMaskFrameId = KAknsIIDQsnFrCall2BubbleFirstCoMask;
+            
+    iOuterRect = outerRect;
+    iOuterRect.Move( Rect().iTl );
+    iInnerRect = innerRect;
+    iInnerRect.Move( Rect().iTl );
+            
+    // CLI list and panes
+    TAknLayoutRect cliList;
+    cliList.LayoutRect( Rect(), 
+        BubbleLayout2::popup_call2_conf_cli_list() );
+    TRect cliListRect = cliList.Rect();
+    
+    for ( TUint8 paneIndex = 0; paneIndex < iPaneAmount; paneIndex++ )
+        {
+        TAknLayoutRect singlePane;
+        singlePane.LayoutRect( cliListRect, 
+            BubbleLayout2::popup_call2_conf_single_list_graphic_pane( 
+            paneIndex ) );
+        TRect singlePaneRect = singlePane.Rect();
+        iConfPanes->At( paneIndex )->SetRect( singlePaneRect );
+        }   
+    
+    // Timer
+    BubbleUtils::LayoutLabel( 
+        iTimerCost, 
+        Rect(),
+        BubbleLayout2::popup_call2_conf_window_call_timer_text() );
+    
+    // Create call object bitmaps
+    iBubble->SetRect( bubbleRect.Rect() );                
+    
+    BubbleUtils::PrepareBubbleImageL( 
+        iFrameId,
+        outerRect,
+        innerRect,
+        iBubble );
+    
+    if ( iHeader->CallObjectImage() )
+        {
+        // Scale image according to bubble size
+        TSize imageSize( Rect().Size() );
+        imageSize.iWidth -= imageSize.iWidth / 2;
+        
+        BubbleUtils::PrepareCallObjectImageL(
+            *iHeader,
+            imageSize );
+        
+        TAknLayoutRect cliRect;
+        cliRect.LayoutRect( 
+            frameRect, 
+            BubbleLayout2::popup_call2_bubble_pane_graphics_cli() );
+                    
+        // Combine image to bubble image
+        BubbleUtils::PrepareCallObjectToBubbleImageL(
+            iHeader->CallObjectImage(),
+            iHeader->CallObjectImageMask(),
+            cliRect.Rect(),
+            coMaskFrameId, // gradient image mask
+            outerRect,
+            innerRect,
+            iBubble );                                        
+        }    
+    }
+    
+// ---------------------------------------------------------------------------
+// CBubbleOutlookConference::DoCall4LayoutL
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookConference::DoCall4LayoutL()
+    {
+    iBubble->SetPictureOwnedExternally( EFalse );
+    iBubble->SetPicture( NULL, NULL );
+    
+    TAknLayoutRect bubbleRect;
+    bubbleRect.LayoutRect( 
+        Rect(), 
+        BubbleLayout4::popup_call4_conf_pane_background() );
+            
+    TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+    TRect outerRect;
+    TRect innerRect;
+    BubbleLayout2::BubbleFrameInnerOuterRects( frameRect, 
+                                               outerRect, 
+                                               innerRect );
+
+    iFrameId = KAknsIIDQsnFrCall2BubbleFirst;
+    TAknsItemID coMaskFrameId = KAknsIIDQsnFrCall2BubbleFirstCoMask;
+            
+    iOuterRect = outerRect;
+    iOuterRect.Move( Rect().iTl );
+    iInnerRect = innerRect;
+    iInnerRect.Move( Rect().iTl );
+            
+    // CLI list and panes
+    TAknLayoutRect cliList;
+    cliList.LayoutRect( Rect(), 
+        BubbleLayout4::popup_call4_conf_cli_list() );
+    TRect cliListRect = cliList.Rect();
+    
+    for ( TUint8 paneIndex = 0; paneIndex < iPaneAmount; paneIndex++ )
+        {
+        TAknLayoutRect singlePane;
+        singlePane.LayoutRect( cliListRect, 
+            BubbleLayout4::popup_call4_conf_single_list_graphic_pane( 
+            paneIndex ) );
+        TRect singlePaneRect = singlePane.Rect();
+        iConfPanes->At( paneIndex )->SetRect( singlePaneRect );
+        }   
+    
+    // Create call object bitmaps
+    iBubble->SetRect( bubbleRect.Rect() );                
+    
+    BubbleUtils::PrepareBubbleImageL( 
+        iFrameId,
+        outerRect,
+        innerRect,
+        iBubble );
+    
+    if ( iHeader->CallObjectImage() )
+        {
+        // Scale image according to bubble size
+        TSize imageSize( Rect().Size() );
+        imageSize.iWidth -= imageSize.iWidth / 2;
+        
+        BubbleUtils::PrepareCallObjectImageL(
+            *iHeader,
+            imageSize );
+        
+        TAknLayoutRect cliRect;
+        cliRect.LayoutRect( 
+            frameRect, 
+            BubbleLayout2::popup_call2_bubble_pane_graphics_cli() );
+                    
+        // Combine image to bubble image
+        BubbleUtils::PrepareCallObjectToBubbleImageL(
+            iHeader->CallObjectImage(),
+            iHeader->CallObjectImageMask(),
+            cliRect.Rect(),
+            coMaskFrameId, // gradient image mask
+            outerRect,
+            innerRect,
+            iBubble );                                        
+        }
+    }    
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookConference::GetCall1BubbleBitmaps
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookConference::GetCall1BubbleBitmaps()
+    {
+    switch ( iPaneAmount )
+        {
+        case 2:
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                    iBubble , 
+                    EQgn_graf_call_conf_two , 
+                    EQgn_graf_call_conf_two_mask );
+            break;
+        case 3:
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                    iBubble , 
+                    EQgn_graf_call_conf_three , 
+                    EQgn_graf_call_conf_three_mask );
+            break;
+        case 4:
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                    iBubble , 
+                    EQgn_graf_call_conf_four , 
+                    EQgn_graf_call_conf_four_mask );
+            break;
+        case 5:
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                    iBubble , 
+                    EQgn_graf_call_conf_five , 
+                    EQgn_graf_call_conf_five_mask );
+            break;
+        default:
+            Panic( EBMPanicTooManyCallsInConference );
+            break;
+        }
+    }    
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookConference::HandlePointerEventL
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookConference::HandlePointerEventL
+    ( const TPointerEvent& aPointerEvent )           
+    {
+    if ( !iHeader->Highlight() || 
+         aPointerEvent.iType != TPointerEvent::EButton1Up )
+        return;
+    
+    for ( TInt i=0; i < iPaneAmount; i++ )
+        {
+        if ( iConfPanes->At( i )->Rect().Contains(
+                 aPointerEvent.iPosition ) )
+            {
+            TInt hightlight = i+1;
+            if ( iHeader->Highlight() != hightlight )
+                {
+                iConfPanes->At( iHeader->Highlight() - 1 )->SetHighlight( EFalse );
+                iConfPanes->At( iHeader->Highlight() - 1 )->DrawDeferred();
+                iHeader->SetHighlight( hightlight );
+                iConfPanes->At( i )->SetHighlight( ETrue );
+                iConfPanes->At( i )->DrawDeferred();    
+                }
+            }
+        }
+    }        
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookFiveLined.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,605 @@
+/*
+* 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:  Bubble for call object text display.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleOutlookFiveLined.h"
+#include    "BMResourceManager.h"
+#include    "BMBubbleHeader.h"
+#include    "BMUtils.h"
+#include    "BMLayout.h"
+#include    "BMLayout2.h"
+#include    "BMCustomManager.h"
+
+#include    <telbubblecustomelement.h>
+#include    <telbubbleanim.h>
+
+#include    <eiklabel.h>
+#include    <eikimage.h>
+#include    <featmgr.h>
+#include    <AknsDrawUtils.h>
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CBubbleOutlookFiveLined::CBubbleOutlookFiveLined( 
+    CBubbleManager& aBubbleManager ) : CBubbleOutlook( aBubbleManager )
+    {
+    }
+
+// Symbian OS default constructor can leave.
+void CBubbleOutlookFiveLined::ConstructL()
+    {
+    iHeader = NULL;
+    iTextLineNumber = 0;
+          
+    CBubbleOutlook::ConstructL( );
+    ActivateL();
+    }
+
+// Destructor
+CBubbleOutlookFiveLined::~CBubbleOutlookFiveLined()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookFiveLined::Reset
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookFiveLined::Reset( )
+    {
+    CBubbleResourceManager& res = iBubbleManager.ResourceManager();
+    res.ReleaseEikImage( iBubble );
+    iBubbleManager.CustomManager().ReleaseCustomElement( iSmallCallIndication );
+    iBubbleManager.CustomManager().ReleaseCustomElement( iNumberType );
+    res.ReleaseEikImage( iTypeIndication1 );
+    res.ReleaseEikImage( iTypeIndication2 );
+    res.ReleaseEikImage( iCyphOffImage );
+    res.ReleaseEikImage( iTnImage );
+    res.ReleaseEikLabel( iTextLine1 );
+    res.ReleaseEikLabel( iTextLine2 );
+    res.ReleaseEikLabel( iTextLine3 );
+    res.ReleaseEikLabel( iTextLine4 );
+    res.ReleaseEikLabel( iTextLine5 );
+    
+    iBubbleManager.CustomManager().ReleaseCustomElement( iBigCallIndicator );
+    
+    iFullText1.Set( NULL, 0 );
+    iFullText2.Set( NULL, 0 );
+    iFullText3.Set( NULL, 0 );
+    iFullText4.Set( NULL, 0 );
+    iFullText5.Set( NULL, 0 );
+    iTextLineNumber = 0;
+
+    iHeader = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookFiveLined::ReadBubbleHeader
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookFiveLined::ReadBubbleHeader( CBubbleHeader& aHeader )
+    {
+    iHeader = &aHeader;
+    
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState( );
+    
+    switch ( callState )
+        {
+        case CBubbleManager::EIncoming:
+        case CBubbleManager::EOutgoing:
+        case CBubbleManager::EAlerting:
+        case CBubbleManager::EAlertToDisconnected:
+            // Set big call indicator icon
+            TBool defaultCallIndicator;
+            iBigCallIndicator = 
+                iBubbleManager.CustomManager().ReserveCustomElement(
+                    aHeader, 
+                    CTelBubbleCustomElement::EBigCallIndicator,
+                    defaultCallIndicator );
+            
+            // Number type not shown with custom call indicator
+            if ( defaultCallIndicator )
+                {
+                // Set number type icon
+                iNumberType = 
+                    iBubbleManager.CustomManager().ReserveCustomElement(
+                        aHeader, 
+                        CTelBubbleCustomElement::ENumberTypeIcon,
+                        defaultCallIndicator );
+                }
+            break;
+            
+        default:
+            break;
+        }
+
+    BubbleUtils::SetCyphOffImage( *iHeader, iCyphOffImage, iBubbleManager );
+      
+    BubbleUtils::ChooseTextsToFiveLines( 
+        *iHeader, 
+        iFullText1, 
+        iFullText2,
+        iFullText3, 
+        iTextLine1,
+        iTextLine2,
+        iTextLine3,
+        iTextLine4,
+        iTextLine5,
+        iBubbleManager,
+        iText1ClipDirection, 
+        iText2ClipDirection,
+        iText3ClipDirection, 
+        iTextLineNumber,
+        iThreeLinedLayout );
+    
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookFiveLined::CountComponentControls
+//
+// All the controls are not used at all times. Athough we want to
+// keep the drawing order. 
+// ---------------------------------------------------------------------------
+//
+TInt CBubbleOutlookFiveLined::CountComponentControls() const
+    {
+    TInt amount = 0;
+
+    if ( iNumberType ) 
+        {
+        amount++;
+        }
+
+    if ( iSmallCallIndication ) 
+        {
+        amount++;
+        }
+
+    if ( iTypeIndication1 ) 
+        {
+        amount++;
+        }
+
+    if ( iTypeIndication2 ) 
+        {
+        amount++;
+        }
+
+    if ( iCyphOffImage ) 
+        {
+        amount++;
+        }
+
+    if ( iTextLine1 ) 
+        {
+        amount++;
+        }
+
+    if ( iTextLine2 ) 
+        {
+        amount++;
+        }
+
+    if ( iTextLine3 ) 
+        {
+        amount++;
+        }
+    
+    if ( iTextLine4 ) 
+        {
+        amount++;
+        }
+
+    if ( iTextLine5 ) 
+        {
+        amount++;
+        }
+        
+    if ( iTimerCost ) 
+        {
+        amount++;
+        }
+
+    if ( iBigCallIndicator )
+        {
+        amount++;
+        }
+
+    return amount;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookFiveLined::ComponentControl
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CBubbleOutlookFiveLined::ComponentControl(TInt aIndex) const
+    {
+  
+    TInt amount = -1;
+
+    if ( iNumberType )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iNumberType->Control();
+        }
+
+    if ( iCyphOffImage )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iCyphOffImage;
+        }
+        
+    if ( iTextLine1 )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iTextLine1;
+        }
+
+    if ( iTextLine2 )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iTextLine2;
+        }
+
+    if ( iTextLine3 )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iTextLine3;
+        }
+        
+    if ( iTextLine4 )
+        {
+        amount++;
+        }        
+        
+    if ( aIndex == amount )
+        {
+        return iTextLine4;
+        }
+    
+    if ( iTextLine5 )
+        {
+        amount++;
+        }        
+        
+    if ( aIndex == amount )
+        {
+        return iTextLine5;
+        }        
+
+    if ( iTimerCost )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iTimerCost;
+        }
+
+    if ( iSmallCallIndication )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iSmallCallIndication->Control();
+        }
+
+    if ( iTypeIndication1 )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iTypeIndication1;
+        }
+
+    if ( iTypeIndication2 )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iTypeIndication2;
+        }
+
+    if ( iBigCallIndicator )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iBigCallIndicator->Control();
+        }
+
+    return NULL;
+
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookFiveLined::Draw
+// 
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookFiveLined::Draw( const TRect& /*aRect*/ ) const
+    {
+    CGraphicsContext& gc = SystemGc();
+    
+    // Check that proper call header is set
+    if ( iHeader == NULL ) 
+        { 
+        return; 
+        }
+    
+    if ( !iHeader->IsUsed( ) ) 
+        { 
+        return; 
+        }
+    
+    TUint32 callFlag = iHeader->CallFlags( );
+	CBubbleManager::TPhoneCallState callState = iHeader->CallState( );		
+    
+    // Set texts to fit.
+    switch (iTextLineNumber)
+        {
+        case 0:
+            BubbleUtils::ClipToLabel( 
+                iFullText1 , iTextLine1 , iText1ClipDirection );
+            BubbleUtils::AddTextToEikLabel( iTextLine2 , KNullDesC );
+            break;
+        case 1:
+            BubbleUtils::SetTextInLabel( 
+                iFullText1 , iTextLine1 , iText1ClipDirection );
+            BubbleUtils::ClipToLabel( 
+                iFullText2 , iTextLine2 , iText2ClipDirection );
+            BubbleUtils::ClipToLabel( 
+                iFullText3 , iTextLine3 , iText2ClipDirection );                
+            break;
+        case 2:
+            BubbleUtils::ClipToLabel( 
+                iFullText1 , iTextLine1 , iText1ClipDirection );
+            BubbleUtils::SetTextInLabel( 
+                iFullText2 , iTextLine2 , iText2ClipDirection );
+            break;
+        case 3:
+            BubbleUtils::ClipToLabel( 
+                iFullText1 , iTextLine1 , iText1ClipDirection );
+            BubbleUtils::ClipToLabel( 
+                iFullText2 , iTextLine2 , iText2ClipDirection );
+            BubbleUtils::SetTextInLabel( 
+                iFullText3 , iTextLine3 , iText3ClipDirection );                
+            break;            
+        default:
+            BubbleUtils::AddTextToEikLabel( iTextLine1 , KNullDesC );
+            BubbleUtils::AddTextToEikLabel( iTextLine2 , KNullDesC );
+            BubbleUtils::AddTextToEikLabel( iTextLine3 , KNullDesC );
+            break;
+        }
+
+    }
+
+// ---------------------------------------------------------------------------
+//CBubbleOutlookFiveLined::DrawTimerCostNow
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookFiveLined::DrawTimerCostNow()
+    {
+    if ( iHeader == NULL || iTimerCost == NULL ) 
+        {
+        return;
+        }
+
+    if ( iHeader->CallState() != CBubbleManager::EActive  
+        || iTimerCost->Text()->Compare( iHeader->TimerCost() ) == 0 ) 
+        {
+        return;
+        }
+    
+    BubbleUtils::ClipToLabel( iHeader->TimerCost() , iTimerCost , 
+        CBubbleManager::ERight );
+    DrawLabelNow( iTimerCost);
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookFiveLined::DrawCLINow
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookFiveLined::DrawCLINow()
+    {
+    if ( iHeader == NULL ) 
+        {
+        return;
+        }
+    
+    CEikLabel* cli = NULL;
+    
+    if ( iTextLineNumber == 1 )
+        {
+        iFullText3.Set( iHeader->CLI() );
+        cli = iTextLine3;
+        }
+    else
+        {
+        iFullText1.Set( iHeader->CLI() );
+        cli = iTextLine1;
+        }
+    
+    CBubbleManager::TBubbleLabelString full = iHeader->CLI();
+    CBubbleManager::TPhoneClippingDirection clipDir 
+        = iHeader->CLIClipDirection();
+    
+    // Set texts to fit.
+    if ( full.Length() > 0 )
+        {
+        BubbleUtils::ClipToLabel( full , cli , clipDir );
+        BubbleUtils::AddTextToEikLabel( cli , full );
+        }
+    else
+        {
+        BubbleUtils::AddTextToEikLabel( cli , KNullDesC );
+        }
+    
+    // First clear the area and then draw the new text
+    DrawLabelNow( cli );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookFiveLined::DrawBitmaps
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookFiveLined::DrawBitmaps( CBitmapContext& aGc ) const
+    {
+    // Check that proper call header is set
+    if ( iHeader == NULL ) 
+        { 
+        return; 
+        }
+    
+    if ( !iHeader->IsUsed() ) 
+        { 
+        return; 
+        }
+    
+    // Now starts actual drawing.
+    aGc.SetBrushColor( AKN_LAF_COLOR( BubbleLayout::LayoutColourWhite() ) );
+
+    if ( iBubble->Bitmap() )
+        {
+        BubbleUtils::DrawMaskedImage( aGc , iBubble );    
+        }
+    else
+        {
+        // Draw bubble frame
+        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        if ( !AknsDrawUtils::DrawFrame( skin,
+                                        (CWindowGc&) aGc,  
+                                        iOuterRect,
+                                        iInnerRect,
+                                        iFrameId,
+                                        KAknsIIDDefault ) )
+            {
+            BubbleUtils::DrawBackgroundRect( aGc, Rect() );
+            }        
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookFiveLined::HandleAnimationStartL
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookFiveLined::HandleAnimationStartL() const
+    {
+    if ( iBigCallIndicator && iBigCallIndicator->ControlType() == 
+         CTelBubbleCustomElement::EBubbleAnimation )
+        {
+        CTelBubbleAnim* anim = 
+            static_cast<CTelBubbleAnim*> ( iBigCallIndicator->Control() );
+        anim->StartAnimationL();    
+        }
+    
+    if ( iSmallCallIndication && iSmallCallIndication->ControlType() == 
+         CTelBubbleCustomElement::EBubbleAnimation )
+        {
+        CTelBubbleAnim* anim = 
+            static_cast<CTelBubbleAnim*> ( iSmallCallIndication->Control() );
+        anim->StartAnimationL();    
+        }
+    
+    if( iNumberType && iNumberType->ControlType() == 
+         CTelBubbleCustomElement::EBubbleAnimation )
+        {
+        CTelBubbleAnim* anim = 
+            static_cast<CTelBubbleAnim*> ( iNumberType->Control() );
+        anim->StartAnimationL();    
+        }
+
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlookFiveLined::DrawCallHeaderText
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookFiveLined::DrawCallHeaderText()
+    {
+    if ( iHeader == NULL || iTextLine1 == NULL ) 
+        {
+        return;
+        }
+
+    if ( iHeader->CallState() != CBubbleManager::EOutgoing )
+        {
+        return;
+        }
+    
+    CEikLabel* label = NULL;
+    iFullText1.Set( iHeader->Text() );
+    label = iTextLine1;
+
+    CBubbleManager::TPhoneClippingDirection textDir = 
+        iHeader->TextClipDirection();
+
+    BubbleUtils::ClipToLabel( iHeader->Text(), label, textDir );
+    DrawLabelNow( label );    
+    }
+    
+    
+    
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookHide.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,168 @@
+/*
+* 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:  Outlook Hide
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleManager.h" //for enumerations
+#include    "BMBubbleOutlookHide.h"
+#include    "BMBubbleImageManager.h"
+#include    "BMResourceManager.h"
+#include    "BMBubbleHeader.h"
+#include    "BMLayout.h"
+#include    "BMUtils.h"
+
+#include    <eiklabel.h> 
+#include    <eikimage.h>
+#include    <AknsUtils.h>
+
+// ========================= MEMBER FUNCTIONS ================================
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookHide::CBubbleOutlookHide
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookHide::CBubbleOutlookHide( CBubbleManager& aBubbleManager) 
+: CBubbleOutlook( aBubbleManager )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookHide::ConstructL
+// 
+// ---------------------------------------------------------------------------
+//
+
+void CBubbleOutlookHide::ConstructL()
+    {     
+    CBubbleOutlook::ConstructL( );
+    ActivateL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookHide::~CBubbleOutlookHide
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookHide::~CBubbleOutlookHide()
+    {
+    Reset();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookHide::Reset
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookHide::Reset()
+    {
+    iBubbleManager.ResourceManager().ReleaseEikImage( iBubble );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookHide::ReadBubbleHeader
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookHide::ReadBubbleHeader( CBubbleHeader& /*aHeader*/ )
+    {
+    iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );
+    iBubbleManager.ImageManager().SetBitmapToImage( 
+        iBubble , 
+        EQgn_graf_call_hidden_held , 
+        EQgn_graf_call_hidden_held_mask );
+    SizeChanged();
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookHide::SizeChanged
+// called by framwork when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookHide::SizeChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    BubbleUtils::LayoutBackgroundImage( 
+        iBubble , 
+        Rect(), 
+        BubbleLayout::popup_call_audio_first_window_6_graphics_1() );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookHide::DrawTimerCostNow
+//
+//  Pure virtual in base class.
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookHide::DrawTimerCostNow()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookHide::DrawCLINow
+//
+//  Pure virtual in base class.
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookHide::DrawCLINow()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookHide::DrawBitmaps
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookHide::DrawBitmaps( CBitmapContext& aGc ) const
+    {
+    aGc.SetBrushColor( AKN_LAF_COLOR( BubbleLayout::LayoutColourWhite() ) );
+    BubbleUtils::DrawMaskedImage( aGc , iBubble );    
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookHide::HandleAnimationStartL
+//
+//  Pure virtual in base class.
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookHide::HandleAnimationStartL() const
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlookHide::DrawCallHeaderText
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookHide::DrawCallHeaderText()
+    {
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookMiddle.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,511 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Outlook Middle
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleManager.h" //for enumerations
+#include    "BMBubbleOutlookMiddle.h"
+#include    "BMBubbleImageManager.h"
+#include    "BMResourceManager.h"
+#include    "BMBubbleHeader.h"
+#include    "BMUtils.h"
+#include    "BMLayout.h"
+#include    "BMLayout2.h"
+#include    "telbubblecustomelement.h"
+
+#include    <eiklabel.h> 
+#include    <eikimage.h>
+#include    <eikenv.h>
+#include    <AknsUtils.h>
+#include    <AknsDrawUtils.h>
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookMiddle::CBubbleOutlookMiddle
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookMiddle::CBubbleOutlookMiddle( CBubbleManager& aBubbleManager ) 
+ : CBubbleOutlookTwoLined( aBubbleManager )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookMiddle::ConstructL
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookMiddle::ConstructL()
+    {  
+    iIsUnder = EFalse;
+    CBubbleOutlookTwoLined::ConstructL( );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookMiddle::~CBubbleOutlookMiddle
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookMiddle::~CBubbleOutlookMiddle()
+    {
+    Reset();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookMiddle::Reset( )
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookMiddle::Reset( )
+    {
+    iIsUnder = EFalse;
+    CBubbleOutlookTwoLined::Reset();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookMiddle::ReadBubbleHeader
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookMiddle::ReadBubbleHeader( CBubbleHeader& aHeader )
+    {
+    iHeader = &aHeader;
+    
+    iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );        
+    
+    if ( !iCallObjectDisplay )
+        {
+        GetCall1BubbleBitmaps();    
+        }
+
+    CBubbleOutlookTwoLined::ReadBubbleHeader( aHeader );
+    }
+    
+    
+    
+// ---------------------------------------------------------------------------
+// CBubbleOutlookMiddle::SizeChanged
+// called by framwork when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookMiddle::SizeChanged()
+    {
+    if( !iHeader )
+        {
+        return;
+        }
+
+    AknsUtils::RegisterControlPosition( this );
+    
+    if ( !iCallObjectDisplay )
+        {
+        DoCall1Layout();    
+        }
+    else
+        {
+        TRAPD( err, DoCall2LayoutL() );
+        if ( err )    
+            {
+            iBubble->SetPicture( NULL, NULL );
+                
+            MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+            AknsDrawUtils::PrepareFrame( skin,
+                                         iOuterRect,
+                                         iInnerRect,
+                                         iFrameId,
+                                         KAknsIIDDefault );    
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookMiddle::SetIsUnder
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookMiddle::SetIsUnder( const TBool& aIsUnder )
+    {
+    iIsUnder = aIsUnder;
+    }
+    
+// ---------------------------------------------------------------------------
+// CBubbleOutlookMiddle::DoCall1Layout
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookMiddle::DoCall1Layout()
+    {
+    // Deprecated
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookMiddle::DoCall2Layout
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookMiddle::DoCall2LayoutL()
+    {
+    iBubble->SetPictureOwnedExternally( EFalse );
+    iBubble->SetPicture( NULL, NULL );
+    
+    const TRect rect = Rect();
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    switch ( callState )
+        {
+        case CBubbleManager::EWaiting:
+        case CBubbleManager::EIncoming:
+        case CBubbleManager::EOutgoing:
+        case CBubbleManager::EAlerting:
+        case CBubbleManager::EAlertToDisconnected:
+            {
+            ///////////////////////////////////////////////////////////////////
+            // Incoming call layout. Number entry open.
+            ///////////////////////////////////////////////////////////////////
+            
+            TAknLayoutRect bubbleRect;
+            bubbleRect.LayoutRect( 
+                rect, 
+                BubbleLayout2::popup_call2_audio_in_background(5) );
+            
+            TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+            TRect outerRect;
+            TRect innerRect;
+            BubbleLayout2::RectFrameInnerOuterRects( frameRect, 
+                                                     outerRect, 
+                                                     innerRect);
+            
+            iFrameId = ( callState == CBubbleManager::EAlertToDisconnected ) ?
+                                      KAknsIIDQsnFrCall2RectDisconn : 
+                                      KAknsIIDQsnFrCall2Rect;
+            
+            iOuterRect = outerRect;
+            iOuterRect.Move( Rect().iTl );
+            iInnerRect = innerRect;
+            iInnerRect.Move( Rect().iTl );
+            
+            // Call indicator
+            BubbleUtils::LayoutCustomElement(
+                iBigCallIndicator, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_out_call_waiting_icon(1) );
+            
+            // Ciphering off
+            BubbleUtils::LayoutControl( 
+                iCyphOffImage, 
+                rect,
+                BubbleLayout2::popup_call2_audio_in_ciphering_icon(5) );                
+            
+            // Number type icon
+            BubbleUtils::LayoutCustomElement(
+                iNumberType, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_in_call_number_type_icon(5) );
+
+            // Text line 1
+            BubbleUtils::LayoutLabel( 
+                iTextLine1, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_in_call_text_1(5) );
+            
+            // Smaller rect for text if brand image exists
+            if ( iBrandImage )
+                {
+                // Text line 2
+                BubbleUtils::LayoutLabel(
+                    iTextLine2,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_in_call_text_2(9) );
+
+                //Brand image
+                BubbleUtils::LayoutCustomElement(
+                    iBrandImage,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_in_brand_image(4) );
+                }
+            else
+                {
+                // Text line 2
+                BubbleUtils::LayoutLabel(
+                    iTextLine2,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_in_call_text_2(5) );
+                }
+                
+            // Create call object bitmaps
+            iBubble->SetRect( bubbleRect.Rect() );                
+
+            BubbleUtils::PrepareBubbleImageL( 
+                iFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+                
+            if ( iHeader->CallObjectImage()  &&
+                 !iHeader->CallObjectText().Length() )
+                {
+                // Add transparency
+                BubbleUtils::AddTransparencyToBubbleImageL( 
+                    KAknsIIDQsnFrCall2RectCoMask, // gradient tp mask
+                    outerRect,
+                    innerRect,
+                    iBubble );                    
+                }                
+            break;
+            }
+        case CBubbleManager::EDisconnected:
+        case CBubbleManager::EActive:
+        case CBubbleManager::EOnHold:
+            {
+            ///////////////////////////////////////////////////////////////////
+            // First call layout. Two calls.
+            ///////////////////////////////////////////////////////////////////
+            
+            TAknLayoutRect bubbleRect;
+            bubbleRect.LayoutRect( 
+                rect, 
+                BubbleLayout2::popup_call2_audio_first_call_background(13) );
+            
+            TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+            TRect outerRect;
+            TRect innerRect;
+            BubbleLayout2::BubbleFrameInnerOuterRects( frameRect, 
+                                                       outerRect, 
+                                                       innerRect);
+            
+            TAknsItemID coMaskFrameId;
+            if ( callState == CBubbleManager::EOnHold )
+                {
+                iFrameId = KAknsIIDQsnFrCall2Bubble;    
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleCoMask;    
+                }
+            else if ( callState == CBubbleManager::EDisconnected )
+                {
+                iFrameId = KAknsIIDQsnFrCall2BubbleFirstDisconn; 
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleFirstCoMask;       
+                }
+            else
+                {
+                iFrameId = KAknsIIDQsnFrCall2BubbleFirst;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleFirstCoMask;    
+                }                
+            
+            iOuterRect = outerRect;
+            iOuterRect.Move( Rect().iTl );
+            iInnerRect = innerRect;
+            iInnerRect.Move( Rect().iTl );
+
+            // Call icon
+            BubbleUtils::LayoutCustomElement( 
+                iSmallCallIndication, 
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_status_icon(12) );
+                
+            // Ciphering off
+            BubbleUtils::LayoutControl( 
+                iCyphOffImage, 
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_window_ciphering_icon(11) );
+            
+            // Call type pane    
+            BubbleUtils::LayoutCallTypeIndicators(
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_type_icon(11),
+                iTypeIndication1,   // Data/Fax
+                iTypeIndication2 ); // ALS line 2                
+
+            // Text line 1
+            BubbleUtils::LayoutLabel( 
+                iTextLine1, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_first_call_cli_text(15) );
+            
+            // Smaller rect for text if brand image exists
+            if ( iBrandImage )
+                {
+                // Text line 2 - call state
+                BubbleUtils::LayoutLabel(
+                    iTextLine2,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_first_call_state_text(16) );
+
+                // Text line 2 - call timer
+                BubbleUtils::LayoutLabel(
+                    iTimerCost,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_first_call_state_text(17) );
+
+                //Brand image
+                BubbleUtils::LayoutCustomElement(
+                    iBrandImage,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_first_brand_image(2) );
+                }
+            else
+                {
+                // Text line 2 - call state
+                BubbleUtils::LayoutLabel(
+                    iTextLine2,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_first_call_state_text(12) );
+
+                // Text line 2 - call timer
+                BubbleUtils::LayoutLabel(
+                    iTimerCost,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_first_call_state_text(13) );
+                }
+                
+            // Create call object bitmaps
+            iBubble->SetRect( bubbleRect.Rect() );
+            
+            BubbleUtils::PrepareBubbleImageL( 
+                iFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+            
+            // Add transparency
+            BubbleUtils::AddTransparencyToBubbleImageL( 
+                coMaskFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+            
+            if ( iHeader->CallObjectImage() )
+                {
+                BubbleUtils::PrepareCallObjectImageL(
+                    *iHeader,
+                    iBubbleManager.CallObjectImageIncallSize() );
+                
+                TBool dimmed = !iBubbleManager.IsCallDroppedByEndKey( 
+                                   iHeader->CallState() );
+                                   
+                TAknLayoutRect cliRect;
+                cliRect.LayoutRect( 
+                    frameRect, 
+                    BubbleLayout2::popup_call2_bubble_pane_graphics_cli() );                                   
+                                   
+                // Combine image to bubble image
+                BubbleUtils::PrepareCallObjectToBubbleImageL(
+                    iHeader->CallObjectImage(),
+                    iHeader->CallObjectImageMask(),
+                    cliRect.Rect(),
+                    coMaskFrameId, // gradient image mask
+                    outerRect,
+                    innerRect,
+                    iBubble,
+                    dimmed );                                        
+                }                
+            break;
+            }
+        case CBubbleManager::ENone:
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookMiddle::GetCall1BubbleBitmaps
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookMiddle::GetCall1BubbleBitmaps()
+    {
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    
+    TInt bubblePicture = KErrNotFound;
+    TInt bubblePictureMask = KErrNotFound;
+    
+    // set call bubble
+    switch ( callState )
+        {
+        case CBubbleManager::EWaiting:
+        case CBubbleManager::EIncoming:
+        case CBubbleManager::EOutgoing:
+        case CBubbleManager::EAlerting:
+            {
+            bubblePicture = EQgn_graf_call_rec_big_left;
+            bubblePictureMask = EQgn_graf_call_rec_big_left_mask;
+            }
+            break;
+        case CBubbleManager::EAlertToDisconnected:
+            {
+            bubblePicture = EQgn_graf_call_rec_big_left_disconn;
+            bubblePictureMask = EQgn_graf_call_rec_big_left_disconn_mask;
+            }
+            break;
+        case CBubbleManager::EActive:
+            {
+            if ( iIsUnder )
+                {
+                bubblePicture = EQgn_graf_call_first_wait_active;
+                bubblePictureMask = EQgn_graf_call_first_wait_active_mask;
+                }
+            else 
+                {
+                bubblePicture = EQgn_graf_call_first_two_active;
+                bubblePictureMask = EQgn_graf_call_first_two_active_mask;
+                }
+            break;
+            }
+        case CBubbleManager::EOnHold:
+            bubblePicture = EQgn_graf_call_first_two_held;
+            bubblePictureMask = EQgn_graf_call_first_two_held_mask;
+            break;
+        case CBubbleManager::EDisconnected:
+            if ( iIsUnder )
+                {
+                bubblePicture = EQgn_graf_call_first_wait_disconn;
+                bubblePictureMask = EQgn_graf_call_first_wait_disconn_mask;
+                }
+            else 
+                {
+                bubblePicture = EQgn_graf_call_first_two_disconn;
+                bubblePictureMask = EQgn_graf_call_first_two_disconn_mask;
+                }
+            break;
+        case CBubbleManager::ENone:
+        default:        
+            bubblePicture = KErrNotFound;
+            bubblePictureMask = KErrNotFound;
+            break;
+        }
+    
+    if ( bubblePicture != KErrNotFound )
+        {
+        if ( bubblePictureMask == KErrNotFound )
+            {
+            iBubbleManager.ImageManager().SetBitmapToImage( iBubble, 
+                                            (TBMIcons) bubblePicture );
+            }
+        else
+            {
+            iBubbleManager.ImageManager().SetBitmapToImage( iBubble, 
+                                            (TBMIcons) bubblePicture , 
+                                            (TBMIcons) bubblePictureMask);
+            }
+        }    
+   }    
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookMiddleCnap.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,429 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 CBubbleOutMiddleCnap class.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleManager.h" //for enumerations
+#include    "BMBubbleOutlookMiddleCnap.h"
+#include    "BMBubbleImageManager.h"
+#include    "BMResourceManager.h"
+#include    "BMBubbleHeader.h"
+#include    "BMLayout.h"
+#include    "BMUtils.h"
+#include    "BMLayout2.h"
+#include    "telbubblecustomelement.h"
+
+#include    <eiklabel.h> 
+#include    <eikimage.h>
+#include    <eikenv.h>
+#include    <AknsUtils.h>
+#include    <AknsDrawUtils.h>
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CBubbleOutlookMiddleCnap::CBubbleOutlookMiddleCnap
+    ( CBubbleManager& aBubbleManager )
+    : CBubbleOutlookThreeLined( aBubbleManager )
+    {
+    }
+
+// Symbian OS default constructor can leave.
+void CBubbleOutlookMiddleCnap::ConstructL()
+    {
+    CBubbleOutlookThreeLined::ConstructL();
+    }
+
+    
+// Destructor
+CBubbleOutlookMiddleCnap::~CBubbleOutlookMiddleCnap()
+    {
+    Reset();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookMiddleCnap::ReadBubbleHeader
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookMiddleCnap::ReadBubbleHeader( CBubbleHeader& aHeader )
+    {
+    iHeader = &aHeader;
+    
+    iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );        
+    
+    if ( !iCallObjectDisplay )
+        {
+        GetCall1BubbleBitmaps();    
+        }
+    
+    CBubbleOutlookThreeLined::ReadBubbleHeader( aHeader );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookMiddleCnap::SizeChanged
+// called by framwork when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookMiddleCnap::SizeChanged()
+    {
+    if( !iHeader )
+        {
+        return;
+        }
+
+    AknsUtils::RegisterControlPosition( this );
+
+    if ( !iCallObjectDisplay )
+        {
+        DoCall1Layout();    
+        }
+    else
+        {
+        TRAPD( err, DoCall2LayoutL() );
+        if ( err )    
+            {
+            iBubble->SetPicture( NULL, NULL );
+                
+            MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+            AknsDrawUtils::PrepareFrame( skin,
+                                         iOuterRect,
+                                         iInnerRect,
+                                         iFrameId,
+                                         KAknsIIDDefault );
+            }  
+        }      
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookMiddleCnap::DoCall1Layout
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookMiddleCnap::DoCall1Layout()
+    {
+    // Deprecated
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookMiddleCnap::DoCall2Layout
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookMiddleCnap::DoCall2LayoutL()
+    {
+    iBubble->SetPictureOwnedExternally( EFalse );
+    iBubble->SetPicture( NULL, NULL );
+    
+    const TRect rect = Rect();
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    switch ( callState )
+        {
+        case CBubbleManager::EIncoming:
+        case CBubbleManager::EOutgoing:
+        case CBubbleManager::EAlerting:
+        case CBubbleManager::EWaiting:
+        case CBubbleManager::EAlertToDisconnected:
+            {
+            ///////////////////////////////////////////////////////////////////
+            // Incoming call layout. Three lines of text. Number entry open.
+            ///////////////////////////////////////////////////////////////////
+            
+            // Layout create bubble image
+            TAknLayoutRect bubbleRect;
+            bubbleRect.LayoutRect( 
+                rect, 
+                BubbleLayout2::popup_call2_audio_in_background(6) );
+            
+            TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+            TRect outerRect;
+            TRect innerRect;
+            BubbleLayout2::RectFrameInnerOuterRects( frameRect, 
+                                                     outerRect, 
+                                                     innerRect);
+            
+            iFrameId = ( callState == CBubbleManager::EAlertToDisconnected ) ?
+                                      KAknsIIDQsnFrCall2RectDisconn : 
+                                      KAknsIIDQsnFrCall2Rect;
+            
+            iOuterRect = outerRect;
+            iOuterRect.Move( Rect().iTl );
+            iInnerRect = innerRect;
+            iInnerRect.Move( Rect().iTl );
+
+            // Call indicator
+            BubbleUtils::LayoutCustomElement(
+                iBigCallIndicator, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_out_call_waiting_icon(1) );
+            
+            // Ciphering off
+            BubbleUtils::LayoutControl( 
+                iCyphOffImage, 
+                rect,
+                BubbleLayout2::popup_call2_audio_in_ciphering_icon(6) );                
+            
+            // Number type icon
+            BubbleUtils::LayoutCustomElement(
+                iNumberType, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_in_call_number_type_icon(6) );
+
+            // Text line 1
+            BubbleUtils::LayoutLabel( 
+                iTextLine1, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_in_call_text_1(6) );
+            
+            // Text line 2
+            BubbleUtils::LayoutLabel( 
+                iTextLine2, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_in_call_text_2(6) );
+
+            // Smaller rect for text if brand image exists
+            if ( iBrandImage )
+                {
+                // Text line 3
+                BubbleUtils::LayoutLabel(
+                    iTextLine3,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_in_call_text_3(4) );
+
+                //Brand image
+                BubbleUtils::LayoutCustomElement(
+            	    iBrandImage,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_in_brand_image(2) );
+                }
+            else
+                {
+                // Text line 3
+                BubbleUtils::LayoutLabel(
+                    iTextLine3,
+                    rect,
+                    BubbleLayout2::popup_call2_audio_in_call_text_3(2) );
+                }
+                
+            // Create call object bitmaps
+            iBubble->SetRect( bubbleRect.Rect() );                
+
+            BubbleUtils::PrepareBubbleImageL( 
+                iFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+                
+            if ( iHeader->CallObjectImage()  &&
+                 !iHeader->CallObjectText().Length() )
+                {
+                // Add transparency
+                BubbleUtils::AddTransparencyToBubbleImageL( 
+                    KAknsIIDQsnFrCall2RectCoMask, // gradient tp mask
+                    outerRect,
+                    innerRect,
+                    iBubble );                    
+                }                
+            break;
+            }
+            
+        case CBubbleManager::EActive:
+        case CBubbleManager::EOnHold:
+        case CBubbleManager::EDisconnected:
+            {
+            ///////////////////////////////////////////////////////////////////
+            // First call layout. Three lines of text. Two calls.  
+            ///////////////////////////////////////////////////////////////////
+
+            TAknLayoutRect bubbleRect;
+            bubbleRect.LayoutRect( 
+                rect, 
+                BubbleLayout2::popup_call2_audio_first_call_background(21) );
+            
+            TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+            TRect outerRect;
+            TRect innerRect;
+            BubbleLayout2::BubbleFrameInnerOuterRects( frameRect, 
+                                                       outerRect, 
+                                                       innerRect);
+        
+            TAknsItemID coMaskFrameId;
+            if ( callState == CBubbleManager::EOnHold )
+                {
+                iFrameId = KAknsIIDQsnFrCall2Bubble;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleCoMask;    
+                }
+            else if ( callState == CBubbleManager::EDisconnected )
+                {
+                iFrameId = KAknsIIDQsnFrCall2BubbleFirstDisconn;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleFirstCoMask;            
+                }
+            else
+                {
+                iFrameId = KAknsIIDQsnFrCall2BubbleFirst;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleFirstCoMask;                
+                }                
+            
+            // for possible frame draw
+            iOuterRect = outerRect;
+            iOuterRect.Move( Rect().iTl );
+            iInnerRect = innerRect;
+            iInnerRect.Move( Rect().iTl );
+
+            // Call icon
+            BubbleUtils::LayoutCustomElement( 
+                iSmallCallIndication, 
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_status_icon(20) );
+                
+            // Ciphering off
+            BubbleUtils::LayoutControl( 
+                iCyphOffImage, 
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_window_ciphering_icon(17) );
+            
+            // Call type pane
+            BubbleUtils::LayoutCallTypeIndicators(
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_type_icon(17),
+                iTypeIndication1,   // Data/Fax
+                iTypeIndication2 ); // ALS line 2               
+
+            // Text line 1
+            BubbleUtils::LayoutLabel( 
+                iTextLine1, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_first_call_cli_text(23) );
+            
+            // Text line 2 - phone number
+            BubbleUtils::LayoutLabel( 
+                iTextLine2, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_first_call_number_text(19) );
+            
+            // Text line 2 - call state
+            BubbleUtils::LayoutLabel( 
+                iTextLine3, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_first_call_state_text(19) );
+            
+            // Text line 2 - call timer
+            BubbleUtils::LayoutLabel( 
+                iTimerCost, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_first_call_state_text(21) );
+                
+            // Build call object bubble
+            iBubble->SetRect( bubbleRect.Rect() );                                
+
+            BubbleUtils::PrepareBubbleImageL( 
+                iFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+            
+            // Add transparency
+            BubbleUtils::AddTransparencyToBubbleImageL( 
+                coMaskFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+                
+            if ( iHeader->CallObjectImage() )
+                {
+                BubbleUtils::PrepareCallObjectImageL(
+                    *iHeader,
+                    iBubbleManager.CallObjectImageIncallSize() );
+                
+                TAknLayoutRect cliRect;
+                cliRect.LayoutRect( 
+                    frameRect, 
+                    BubbleLayout2::popup_call2_bubble_pane_graphics_cli() );
+                    
+                // Combine image to bubble image
+                BubbleUtils::PrepareCallObjectToBubbleImageL(
+                    iHeader->CallObjectImage(),
+                    iHeader->CallObjectImageMask(),
+                    cliRect.Rect(),
+                    coMaskFrameId, // gradient image mask
+                    outerRect,
+                    innerRect,
+                    iBubble );
+                }
+                
+            break;
+            }
+            
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookMiddleCnap::GetCall1BubbleBitmaps
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookMiddleCnap::GetCall1BubbleBitmaps()
+    {
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    
+    TInt bubblePicture = KErrNotFound;
+    TInt bubblePictureMask = KErrNotFound;
+    
+    switch ( callState )
+        {
+        case CBubbleManager::EWaiting:
+        case CBubbleManager::EIncoming:
+            bubblePicture = EQgn_graf_call_rec_big_left;
+            bubblePictureMask = EQgn_graf_call_rec_big_left_mask;
+            break;
+        case CBubbleManager::EActive:
+            bubblePicture = EQgn_graf_call_two_active_emergency;
+            bubblePictureMask = EQgn_graf_call_two_active_emergency_mask; 
+            break;
+        case CBubbleManager::EAlertToDisconnected:
+        case CBubbleManager::EOnHold:
+        case CBubbleManager::EDisconnected:
+        case CBubbleManager::ENone:
+        default:        
+            bubblePicture = KErrNotFound;
+            bubblePictureMask = KErrNotFound;
+            break;
+        }
+
+    if ( bubblePicture != KErrNotFound )
+        {
+        if ( bubblePictureMask == KErrNotFound )
+            {
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                iBubble, (TBMIcons) bubblePicture );
+            }
+        else
+            {
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                iBubble, 
+                (TBMIcons) bubblePicture , 
+                (TBMIcons) bubblePictureMask);
+            }
+        }
+        
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookNE.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,1188 @@
+/*
+* 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:  Outlook Number Entry
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleManager.h" 
+#include    "BMBubbleOutlookNE.h"
+#include    "BMBubbleImageManager.h"
+#include    "BMBubbleHeader.h"
+#include    "BMUtils.h"
+#include    "BMResourceManager.h"
+#include    "BMLayout.h"
+#include    "BMLayout2.h"
+
+#include    <eiklabel.h>
+#include    <eikimage.h>
+#include    <eikenv.h>
+#include    <AknPhoneNumberEditor.h>
+#include    <AknsBasicBackgroundControlContext.h>
+#include    <AknsFrameBackgroundControlContext.h>
+#include    <AknsDrawUtils.h>
+#include    <AknLayoutFont.h>
+#include    <applayout.cdl.h>
+#include    <aknappui.h>
+#include    <eikspane.h>
+#include    <AknStatuspaneUtils.h>
+
+//for resources
+#include    <barsread.h>
+#include    <Bubblemanager.rsg>
+
+// CONSTANTS
+const TUint8 KBubbleNE1LongLineFormat = 0;
+const TUint8 KBubbleNE2LongLineFormat = 1;
+const TUint8 KBubbleNE1ShortLineFormat = 2;
+const TUint8 KBubbleNE2ShortLineFormat = 3;
+const TUint8 KBubbleNEIdleStateFormat = 4;
+
+const TInt KBubbleNEFormatOffsetIfNoStatusPane = 5;
+
+
+
+// ========================= MEMBER FUNCTIONS ================================
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::CBubbleOutlookNumberEntry
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookNumberEntry::CBubbleOutlookNumberEntry( 
+                                    CBubbleManager& aBubbleManager,
+                                    const CCoeControl& aMutedImage )
+: CBubbleOutlook( aBubbleManager ) , iMutedImage( aMutedImage )
+
+    {
+
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::ConstructL
+// 
+// ---------------------------------------------------------------------------
+//
+
+void CBubbleOutlookNumberEntry::ConstructL()
+    {
+    iPlace = ENENone;
+    iIsUsed = EFalse;
+    iEditor = NULL;
+
+    // Create skin background control context,
+    // the actual image ID and rectangle will be set later
+    if ( iCallObjectDisplay )
+        {
+        iFrameContext = CAknsFrameBackgroundControlContext::NewL(
+            KAknsIIDNone, TRect(0,0,4,4), TRect(1,1,3,3), EFalse );
+        }
+    else
+        {
+        iSkinContext = CAknsBasicBackgroundControlContext::NewL(
+            KAknsIIDNone, TRect(0,0,1,1), EFalse );
+        }    
+    
+    // Create editor from resources:
+    iEditor = new( ELeave ) CAknPhoneNumberEditor;
+    iEditor->SetContainerWindowL( *this );
+    iEditor->SetParent( this );
+
+    TResourceReader reader;
+    iCoeEnv->CreateResourceReaderLC( reader, R_BUBBLEMANAGER_EDITOR );
+    ConstructEditorFromResourceAndLayoutL( reader );
+
+    CleanupStack::PopAndDestroy();    // reader
+
+    iEditor->SetObserver( this );
+    iEditor->SetFormat( KBubbleNEIdleStateFormat );
+    
+    iStatusPane = static_cast<CAknAppUi*>(iEikonEnv->
+        EikAppUi() )->StatusPane();
+
+    CBubbleOutlook::ConstructL( );
+
+    SetBlank();
+    ActivateL();
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::~CBubbleOutlookNumberEntry
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookNumberEntry::~CBubbleOutlookNumberEntry()
+    {
+    if ( iBubble )
+        {
+        iBubbleManager.ResourceManager().ReleaseEikImage( iBubble );
+        }
+    delete iEditor;
+    delete iSkinContext;
+    delete iFrameContext;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::Reset
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::Reset( )
+    {
+    if ( iBubble )
+        {
+        iBubbleManager.ResourceManager().ReleaseEikImage( iBubble );
+        }
+    iPlace = ENENone;
+    iIsUsed = EFalse;
+    iEditor->SetFocus( EFalse );
+    SetText( KNullDesC );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::ReadBubbleHeader
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::ReadBubbleHeader( CBubbleHeader& /*aHeader*/ )
+    {
+    // ignore
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::SetPlace
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::SetPlace( const TPhoneNumberEntryPlace& aPlace )
+    {
+    if ( iPlace == aPlace )
+        {
+        return;
+        }
+
+    iPlace = aPlace;
+
+    if ( iCallObjectDisplay )
+        {
+        SetPlace2( iPlace );
+        }
+    else
+        {
+        SetPlace1( iPlace );
+        }        
+
+    SizeChanged();
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::SetPlace1
+//
+//  
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookNumberEntry::SetPlace1( 
+    const TPhoneNumberEntryPlace& aPlace )
+    {
+    switch ( aPlace )
+        {
+        case ENEBottom:
+            {
+            if ( iBubble )
+                {
+                iBubbleManager.ResourceManager().ReleaseEikImage( iBubble );
+                }
+        
+            iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );
+                    
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                iBubble , 
+                EQgn_graf_call_rec_big , 
+                EQgn_graf_call_rec_big_mask );
+         
+            iSkinContext->SetBitmap( KAknsIIDQgnGrafCallRecBig );
+            break;
+            }
+        case ENEBottomRight:
+            {
+            if ( iBubble )
+                {
+                iBubbleManager.ResourceManager().ReleaseEikImage( iBubble );
+                }
+            
+            iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );
+            
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                iBubble , 
+                EQgn_graf_call_rec_big_right , 
+                EQgn_graf_call_rec_big_right_mask );
+         
+            iSkinContext->SetBitmap( KAknsIIDQgnGrafCallRecBigRight );
+            break;
+            }
+        case ENEIdleState:
+            {
+            if ( iBubble )
+                {
+                iBubbleManager.ResourceManager().ReleaseEikImage( iBubble );
+                }
+         
+            iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );
+         
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                iBubble , 
+                EQgn_graf_call_rec_bigger , 
+                EQgn_graf_call_rec_bigger_mask );
+         
+            iSkinContext->SetBitmap( KAknsIIDQgnGrafCallRecBigger );
+            break;            
+            }
+        case ENENone:
+        default:
+            break;
+        }
+    
+    iSkinContext->SetParentContext( 
+        AknsDrawUtils::ControlContextOfParent(this) );
+    }    
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::SetPlace2
+//  
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookNumberEntry::SetPlace2( 
+    const TPhoneNumberEntryPlace& aPlace )
+    {
+    switch ( aPlace )
+        {
+        case ENEBottom:
+            iFrameContext->SetFrame( KAknsIIDQsnFrCall2Rect );
+            break;
+        case ENEBottomRight:
+            iFrameContext->SetFrame( KAknsIIDQsnFrCall2Rect );
+            break;
+        case ENEIdleState:
+            iFrameContext->SetFrame( KAknsIIDQsnFrCall2Rect );
+            break;            
+        case ENENone:
+        default:
+            break;
+        }    
+
+    iFrameContext->SetParentContext( 
+        AknsDrawUtils::ControlContextOfParent(this) );        
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::Place
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookNumberEntry::TPhoneNumberEntryPlace 
+                                    CBubbleOutlookNumberEntry::Place() const
+    {
+    return iPlace;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::SizeChanged
+// called by framwork when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::SizeChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    
+    if ( iCallObjectDisplay )
+        {
+        SizeChanged2();
+        }
+    else
+        {
+        SizeChanged1();    
+        }        
+    
+    UpdateEditorFormats( iPlace );
+
+    // DOES NOT LEAVE! Own implementation. L comes from observer
+    // interface
+    UpdateAndDrawEditor();
+    }
+    
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::SizeChanged1
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::SizeChanged1()
+    {
+    switch ( iPlace )
+        {
+        case ENEBottom:
+            BubbleUtils::LayoutBackgroundImage( 
+                iBubble, 
+                Rect(), 
+                BubbleLayout::popup_number_entry_window_graphics_1( 0 ) );
+            
+            iSkinContext->SetRect( iBubble->Rect() );
+            break;
+            
+        case ENEBottomRight:
+            BubbleUtils::LayoutBackgroundImage( 
+                iBubble , 
+                Rect(), 
+                BubbleLayout::popup_number_entry_window_graphics_1( 0 ) );
+
+            iSkinContext->SetRect( iBubble->Rect() );
+            break;
+            
+        case ENEIdleState:
+            BubbleUtils::LayoutBackgroundImage( 
+                iBubble, 
+                Rect(), 
+                BubbleLayout::popup_number_entry_window_graphics_1( 3 ) );
+
+            iSkinContext->SetRect( iBubble->Rect() );
+            break;            
+
+        case ENENone:
+        default:
+            break;
+
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::SizeChanged2
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::SizeChanged2()
+    {
+    TAknLayoutRect frameRect;
+    TBool prepareFrame( EFalse );
+    
+    switch ( iPlace )
+        {
+        case ENEBottom:
+        case ENEBottomRight:
+           frameRect.LayoutRect( 
+               Rect(), 
+               BubbleLayout::popup_number_entry_window_graphics_1( 0 ) );
+           prepareFrame = ETrue;     
+           break;
+
+        case ENEIdleState:
+            frameRect.LayoutRect( 
+                Rect(), 
+                BubbleLayout::popup_number_entry_window_graphics_1( 3 ) );
+            prepareFrame = ETrue;                
+            break;            
+        case ENENone:
+        default:
+            break;
+        }
+        
+    if ( prepareFrame )        
+        {
+        BubbleLayout2::RectFrameInnerOuterRects(
+           frameRect.Rect(),
+           iOuterRect,
+           iInnerRect );
+
+        iFrameContext->SetFrameRects( iOuterRect, iInnerRect );
+                
+        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        AknsDrawUtils::PrepareFrame( skin,
+                                     iOuterRect,
+                                     iInnerRect,
+                                     KAknsIIDQsnFrCall2Rect,
+                                     KAknsIIDDefault );            
+        }        
+    }    
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::CountComponentControls
+//
+//  
+// ---------------------------------------------------------------------------
+//
+TInt CBubbleOutlookNumberEntry::CountComponentControls() const
+    {
+    return 1;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::ComponentControl
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CBubbleOutlookNumberEntry::ComponentControl(TInt aIndex) const
+    {
+    if ( aIndex == 0 )
+        {
+        return iEditor;
+        }
+    return NULL;
+    
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::DrawTimerCostNow
+//
+//  Pure virtual in base class.
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::DrawTimerCostNow()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::DrawCLINow
+//
+//  Pure virtual in base class.
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::DrawCLINow()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::HandleControlEventL
+//  
+//  This must be non leaving function, because others use it too.
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::HandleControlEventL( CCoeControl* aControl, 
+                                                     TCoeEvent aEventType)
+    {
+    if ( aControl != iEditor  
+        && aEventType != EEventStateChanged 
+        || iPlace == ENENone)
+        return;
+
+    UpdateAndDrawEditor();
+    
+	ReportEventL( EEventStateChanged );
+    
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::OfferKeyEventL
+//
+//  
+// ---------------------------------------------------------------------------
+//
+TKeyResponse CBubbleOutlookNumberEntry::OfferKeyEventL( 
+                                            const TKeyEvent& aKeyEvent, 
+                                            TEventCode aType )
+    {
+    return iEditor->OfferKeyEventL( aKeyEvent, aType );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::SetIsUsed
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::SetIsUsed( const TBool& aIsUsed )
+    {
+#ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
+    // Don't set in focus if transition effects are turned on
+    // We don't want blinking cursor during transitions
+    if ( !aIsUsed )
+        {
+        iEditor->SetFocus( aIsUsed );
+        }
+#else
+    iEditor->SetFocus( aIsUsed );
+#endif    
+    iIsUsed = aIsUsed;    
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::IsUsed
+//
+//  
+// ---------------------------------------------------------------------------
+//
+TBool CBubbleOutlookNumberEntry::IsUsed() const
+    {
+    return iIsUsed;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::GetEditor
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CBubbleOutlookNumberEntry::GetEditor( ) const
+    {
+    return iEditor; 
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::SetText
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::SetText( const TDesC& aDesC )
+    {
+    iEditor->DrawDeferred();
+    iEditor->SetText( aDesC );   
+    iEditor->DrawDeferred();
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::GetText
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::GetText( TDes& aDesC )
+    {
+    iEditor->GetText( aDesC );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::FocusChanged
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::FocusChanged( TDrawNow aDrawNow )
+    {
+    // Don't allow drawing
+    iEditor->SetFocus( IsFocused(), ENoDrawNow );
+    if ( aDrawNow == EDrawNow && iMutedImage.IsVisible() )
+        {
+        // muted image goes on top 
+        // so it must be redrawn too
+        DrawLabelNow( iMutedImage );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::DrawBitmaps
+//
+//  
+// ---------------------------------------------------------------------------
+//
+#ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
+void CBubbleOutlookNumberEntry::DrawBitmaps( CBitmapContext& ) const
+#else
+void CBubbleOutlookNumberEntry::DrawBitmaps( CBitmapContext& aGc ) const
+#endif
+    {
+    if ( iPlace == ENENone || !iIsUsed ) 
+        {
+        return;
+        }
+
+#ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
+    // Must use SystemGc instead of aGc when transition effects are turned on
+    CWindowGc& aGc = SystemGc();
+#endif
+
+    if ( iCallObjectDisplay )
+        {
+        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        if ( !AknsDrawUtils::DrawFrame( skin,
+                                        (CWindowGc&) aGc,  
+                                        iOuterRect,
+                                        iInnerRect,
+                                        KAknsIIDQsnFrCall2Rect,
+                                        KAknsIIDDefault ) )
+            {
+            BubbleUtils::DrawBackgroundRect( aGc, Rect() );
+            }       
+        }
+    else if ( !BubbleUtils::DrawMaskedImage( aGc , iBubble ) )
+        {
+        BubbleUtils::DrawBackgroundRect( aGc, Rect() );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::HandleAnimationStartL
+//
+//  Pure virtual in base class.
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::HandleAnimationStartL() const
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::ReleaseBitmaps
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::ReleaseBitmaps()
+    {
+    if ( iBubble )
+        {
+        iBubbleManager.ResourceManager().ReleaseEikImage( iBubble );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::RebuildBitmaps
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::RebuildBitmaps()
+    {
+    if ( iCallObjectDisplay )
+        {
+        return;            
+        }
+    
+    switch ( iPlace )
+        {
+        case ENEBottom:
+            iBubble = iBubbleManager.ResourceManager().ReserveEikImage(ETrue);
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                iBubble , 
+                EQgn_graf_call_rec_big , 
+                EQgn_graf_call_rec_big_mask );
+            break;
+        case ENEBottomRight:
+            iBubble = iBubbleManager.ResourceManager().ReserveEikImage(ETrue);
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                iBubble , 
+                EQgn_graf_call_rec_big_right , 
+                EQgn_graf_call_rec_big_right_mask );
+            break;
+        case ENEIdleState:
+            iBubble = iBubbleManager.ResourceManager().ReserveEikImage(ETrue);
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                iBubble , 
+                EQgn_graf_call_rec_bigger , 
+                EQgn_graf_call_rec_bigger_mask );
+            break;
+        case ENENone:
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::MopSupplyObject
+// ---------------------------------------------------------------------------
+//
+TTypeUid::Ptr CBubbleOutlookNumberEntry::MopSupplyObject( TTypeUid aId )
+    {
+    if( !iCallObjectDisplay && 
+        aId.iUid == MAknsControlContext::ETypeId && 
+        iSkinContext )
+        {
+        return MAknsControlContext::SupplyMopObject( aId, iSkinContext );
+        }
+    else if ( iCallObjectDisplay && 
+              aId.iUid == MAknsControlContext::ETypeId && 
+              iFrameContext )
+        {
+        return MAknsControlContext::SupplyMopObject( aId, iFrameContext );    
+        }
+    else
+        {
+        return CBubbleOutlook::MopSupplyObject( aId );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::DrawCallHeaderText
+//
+//  Pure virtual in base class.
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::DrawCallHeaderText()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::Draw
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::Draw( const TRect& /*aRect*/ ) const
+    {
+    if ( iPlace == ENENone || !iIsUsed ) 
+        {
+        return;
+        }
+
+    CWindowGc& gc = SystemGc( );
+    gc.SetBrushColor( AKN_LAF_COLOR( BubbleLayout::LayoutColourWhite() ) );
+    TRect rect = iEditor->Rect();
+
+    // Draw the skin background of the parent 
+    // (the bubble may be transparent)
+    AknsDrawUtils::DrawBackground( AknsUtils::SkinInstance(), 
+        AknsDrawUtils::ControlContextOfParent(this), this, gc, 
+        rect.iTl, rect, KAknsDrawParamDefault );
+    // Don't set clipping rect if transition effects are turned on
+#ifndef RD_UI_TRANSITION_EFFECTS_PHASE2
+    gc.SetClippingRect( rect );
+#endif
+    if ( iCallObjectDisplay )
+        {
+        // Draw bubble frame
+        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        if ( !AknsDrawUtils::DrawFrame( skin,
+                                        (CWindowGc&) gc,  
+                                        iOuterRect,
+                                        iInnerRect,
+                                        KAknsIIDQsnFrCall2Rect,
+                                        KAknsIIDDefault ) )
+            {
+            BubbleUtils::DrawBackgroundRect( gc, Rect() );
+            }                
+        }
+    else
+        {
+        if ( !BubbleUtils::DrawMaskedImage( gc , iBubble ) )
+            {
+            BubbleUtils::DrawBackgroundRect( gc, Rect() );
+            }            
+        }        
+    gc.CancelClippingRect();
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::ConstructEditorFromResourceAndLayoutL
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::ConstructEditorFromResourceAndLayoutL( 
+    TResourceReader& aReader )
+    {
+    TInt maxChars = aReader.ReadInt16();
+    TInt maxLines = aReader.ReadInt16();
+    HBufC* truncation = aReader.ReadHBufCL();
+    CleanupStack::PushL( truncation );
+    TInt formatCount = aReader.ReadInt16();
+    iEditor->ConstructL( maxChars, maxLines, formatCount, *truncation );
+    CleanupStack::PopAndDestroy();  // truncation
+
+    iFormatCount = formatCount;
+
+    // get supporting layouts
+    TRgb color;
+    TRect numberEntryRect = NumberEntryRect( 0 , color );
+
+    // get the relevant layouts
+    TAknLayoutText texts1LongText;
+    TAknLayoutText texts1ShortText;
+    TAknLayoutText texts2LongLine1Text;
+    TAknLayoutText texts2ShortLine1Text;
+    TAknLayoutText texts2LongLine2Text;
+    TAknLayoutText texts2ShortLine2Text;
+    TAknLayoutText textsIdleLine1Text;
+    TAknLayoutText textsIdleLine2Text;
+
+    texts1LongText.LayoutText( numberEntryRect, 
+        BubbleLayout::popup_number_entry_window_texts_1( 0 ) );
+    texts1ShortText.LayoutText( numberEntryRect, 
+        BubbleLayout::popup_number_entry_window_texts_1( 1 ) );
+    texts2LongLine1Text.LayoutText( numberEntryRect, 
+        BubbleLayout::popup_number_entry_window_texts_2( 0, 0 ) );
+    texts2ShortLine1Text.LayoutText( numberEntryRect, 
+        BubbleLayout::popup_number_entry_window_texts_2( 1, 0 ) );
+    texts2LongLine2Text.LayoutText( numberEntryRect, 
+        BubbleLayout::popup_number_entry_window_texts_2( 0, 1 ) );
+    texts2ShortLine2Text.LayoutText( numberEntryRect, 
+        BubbleLayout::popup_number_entry_window_texts_2( 1, 1 ) );
+    textsIdleLine1Text.LayoutText( numberEntryRect, 
+        BubbleLayout::popup_number_entry_window_texts_3( 1 ) );
+    textsIdleLine2Text.LayoutText( numberEntryRect, 
+        BubbleLayout::popup_number_entry_window_texts_3( 0 ) );        
+        
+
+    // although only specified for two line case, we need to have 
+    // some kind of value for the one line case but as there is 
+    // only one line, it isn't used.
+    TInt baselineSeparation = texts2LongLine2Text.TextRect().iBr.iY 
+        - texts2LongLine1Text.TextRect().iBr.iY;
+
+    for (TInt ii = 0; ii < formatCount; ii++)
+        {
+        CAknPhoneNumberEditor::TFormat format( aReader );
+
+        // override the format values using the layout data
+        TInt next = ii;
+        TBool noStatusPane = EFalse;
+        if( ii > KBubbleNEIdleStateFormat )
+            {
+            next -= KBubbleNEFormatOffsetIfNoStatusPane;
+            noStatusPane = ETrue;
+            }
+        
+        const CAknLayoutFont* layoutFont;
+
+        switch( next )
+            {
+            case KBubbleNE1LongLineFormat:
+                format.iFont = texts1LongText.Font();
+                layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( format.iFont);
+                format.iBottomBaselineOffset = layoutFont->BaselineToTextPaneBottom();
+                format.iOuterRect = texts1LongText.TextRect(); 
+                break;
+            case KBubbleNE2LongLineFormat:
+                format.iFont = texts2LongLine1Text.Font();
+                layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( format.iFont);
+                format.iBottomBaselineOffset = layoutFont->BaselineToTextPaneBottom();
+
+                format.iOuterRect = texts2LongLine2Text.TextRect();
+                format.iOuterRect.iTl.iY -= format.iBottomBaselineOffset; // have to add extra gap
+                format.iOuterRect.iTl.iY -= baselineSeparation; // have to add extra lines.
+                break;
+            case KBubbleNE1ShortLineFormat:
+                format.iFont = texts1ShortText.Font();
+                layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( format.iFont);
+                format.iBottomBaselineOffset = layoutFont->BaselineToTextPaneBottom();
+                format.iOuterRect = texts1ShortText.TextRect();
+                break;
+            case KBubbleNE2ShortLineFormat:
+                format.iFont = texts2ShortLine1Text.Font();
+                layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( format.iFont);
+                format.iBottomBaselineOffset = layoutFont->BaselineToTextPaneBottom();
+                format.iOuterRect = texts2ShortLine2Text.TextRect();
+                format.iOuterRect.iTl.iY -= format.iBottomBaselineOffset; // have to add extra gap
+                format.iOuterRect.iTl.iY -= baselineSeparation; // have to add extra lines.
+                break;
+            case KBubbleNEIdleStateFormat:
+                format.iFont = textsIdleLine1Text.Font();
+                layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( format.iFont);
+                format.iBottomBaselineOffset = layoutFont->BaselineToTextPaneBottom();
+
+                format.iOuterRect = textsIdleLine2Text.TextRect();
+                format.iOuterRect.iTl.iY -= format.iBottomBaselineOffset; // have to add extra gap
+                
+                baselineSeparation = textsIdleLine2Text.TextRect().iBr.iY 
+                    - textsIdleLine1Text.TextRect().iBr.iY;
+                
+                format.iOuterRect.iTl.iY -= baselineSeparation; // have to add extra lines.
+                break;
+            }
+
+        if(noStatusPane)
+            {
+            format.iOuterRect.iTl.iY += BubbleLayout::MainPaneRect().iTl.iY;
+            format.iOuterRect.iBr.iY += BubbleLayout::MainPaneRect().iTl.iY;
+            }
+        format.iBaselineSeparation = baselineSeparation;
+        iEditor->AddFormat( format );
+        }
+
+    iEditor->SetFormat( KBubbleNEIdleStateFormat );
+    UpdateEditorColor( color );
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::NumberEntryRect
+// -----------------------------------------------------------------------------
+//
+TRect CBubbleOutlookNumberEntry::NumberEntryRect( TInt aIndex, TRgb& aColor )
+    {
+    TRect mainRect = BubbleLayout::MainPaneRect();
+    TAknLayoutRect numberEntryLayoutRect;
+    numberEntryLayoutRect.LayoutRect( mainRect, 
+        BubbleLayout::popup_number_entry_window( aIndex ) );
+
+    aColor = numberEntryLayoutRect.Color();
+    TRect numberEntryRect = numberEntryLayoutRect.Rect();
+    // relative to mainpane
+    numberEntryRect.iTl.iY -= mainRect.iTl.iY;
+    numberEntryRect.iBr.iY -= mainRect.iTl.iY;
+    numberEntryRect.iTl.iX -= mainRect.iTl.iX;
+    numberEntryRect.iBr.iX -= mainRect.iTl.iX;
+
+    return numberEntryRect ;
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::UpdateEditorFormats
+// -----------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::UpdateEditorFormats( 
+    TPhoneNumberEntryPlace aPlace )
+    {
+    // get supporting layouts
+    TRect numberEntryRect;
+    TRgb color;
+    if ( aPlace == ENEBottom )
+        {
+        numberEntryRect = NumberEntryRect( 0, color );
+        }
+    else if ( aPlace == ENEBottomRight )
+        {
+        numberEntryRect = NumberEntryRect( 1, color );
+        }
+    else if ( aPlace == ENEIdleState )
+        {
+        numberEntryRect = NumberEntryRect( 4, color );
+        }        
+    else
+        {
+        return;
+        }
+
+    // get the relevant layouts
+    TAknLayoutText texts1LongText;
+    TAknLayoutText texts1ShortText;
+    TAknLayoutText texts2LongLine1Text;
+    TAknLayoutText texts2ShortLine1Text;
+    TAknLayoutText texts2LongLine2Text;
+    TAknLayoutText texts2ShortLine2Text;
+    TAknLayoutText textsIdleLine1Text;
+    TAknLayoutText textsIdleLine2Text;
+
+    texts1LongText.LayoutText( numberEntryRect, 
+        BubbleLayout::popup_number_entry_window_texts_1( 0 ) );
+    texts1ShortText.LayoutText( numberEntryRect, 
+        BubbleLayout::popup_number_entry_window_texts_1( 1 ) );
+    texts2LongLine1Text.LayoutText( numberEntryRect, 
+        BubbleLayout::popup_number_entry_window_texts_2(0, 0));
+    texts2ShortLine1Text.LayoutText( numberEntryRect, 
+        BubbleLayout::popup_number_entry_window_texts_2(1, 0));
+    texts2LongLine2Text.LayoutText( numberEntryRect, 
+        BubbleLayout::popup_number_entry_window_texts_2(0, 1));
+    texts2ShortLine2Text.LayoutText( numberEntryRect, 
+        BubbleLayout::popup_number_entry_window_texts_2(1, 1));
+    textsIdleLine1Text.LayoutText( numberEntryRect, 
+        BubbleLayout::popup_number_entry_window_texts_3( 1 ) );
+    textsIdleLine2Text.LayoutText( numberEntryRect, 
+        BubbleLayout::popup_number_entry_window_texts_3( 0 ) );               
+
+    // although only specified for two line case, we need to have 
+    // some kind of value for the one line case but as there is 
+    // only one line, it isn't used.
+    TInt baselineSeparation = texts2LongLine2Text.TextRect().iBr.iY 
+                            - texts2LongLine1Text.TextRect().iBr.iY;
+    TInt currentFormat = iEditor->CurrentFormatIndex();
+
+    for (TInt ii = 0; ii < iFormatCount; ii++)
+        {
+        CAknPhoneNumberEditor::TFormat format( iEditor->Format( ii ) );
+
+        // override the format values using the layout data
+        TInt next = ii;
+        TBool noStatusPane = EFalse;
+        if( ii > KBubbleNEIdleStateFormat )
+            {
+            next -= KBubbleNEFormatOffsetIfNoStatusPane;
+            noStatusPane = ETrue;
+            }
+
+        const CAknLayoutFont* layoutFont;
+        switch( next )
+            {
+            case KBubbleNE1LongLineFormat:
+                format.iFont = texts1LongText.Font();
+                layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( format.iFont);
+                format.iBottomBaselineOffset = layoutFont->BaselineToTextPaneBottom();
+                format.iOuterRect = texts1LongText.TextRect(); 
+                break;
+            case KBubbleNE2LongLineFormat:
+                format.iFont = texts2LongLine1Text.Font();
+                layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( format.iFont);
+                format.iBottomBaselineOffset = layoutFont->BaselineToTextPaneBottom();
+                format.iOuterRect = texts2LongLine2Text.TextRect();
+                format.iOuterRect.iTl.iY -= format.iBottomBaselineOffset; // have to add extra gap
+                format.iOuterRect.iTl.iY -= baselineSeparation; // have to add extra lines.
+                break;
+            case KBubbleNE1ShortLineFormat:
+                format.iFont = texts1ShortText.Font();
+                layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( format.iFont);
+                format.iBottomBaselineOffset = layoutFont->BaselineToTextPaneBottom();
+                format.iOuterRect = texts1ShortText.TextRect();
+                break;
+            case KBubbleNE2ShortLineFormat:
+                format.iFont = texts2ShortLine1Text.Font();
+                layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( format.iFont);
+                format.iBottomBaselineOffset = layoutFont->BaselineToTextPaneBottom();
+                format.iOuterRect = texts2ShortLine2Text.TextRect();
+                format.iOuterRect.iTl.iY -= format.iBottomBaselineOffset; // have to add extra gap
+                format.iOuterRect.iTl.iY -= baselineSeparation; // have to add extra lines.
+                break;
+            case KBubbleNEIdleStateFormat:
+                format.iFont = textsIdleLine1Text.Font();
+                layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( format.iFont);
+                format.iBottomBaselineOffset = layoutFont->BaselineToTextPaneBottom();
+
+                format.iOuterRect = textsIdleLine2Text.TextRect();
+                format.iOuterRect.iTl.iY -= format.iBottomBaselineOffset; // have to add extra gap
+                
+                baselineSeparation = textsIdleLine2Text.TextRect().iBr.iY 
+                    - textsIdleLine1Text.TextRect().iBr.iY;
+                
+                format.iOuterRect.iTl.iY -= baselineSeparation; // have to add extra lines.
+                break;                
+            };
+
+        if(noStatusPane)
+            {
+            format.iOuterRect.iTl.iY += BubbleLayout::MainPaneRect().iTl.iY;
+            format.iOuterRect.iBr.iY += BubbleLayout::MainPaneRect().iTl.iY;
+            }
+        format.iBaselineSeparation = baselineSeparation;
+
+        iEditor->Format( ii ) = format;
+        }
+
+    iEditor->SetFormat( currentFormat );
+    UpdateEditorColor( color );
+    }
+
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlookNumberEntry::ChangeEditorMode
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CBubbleOutlookNumberEntry::ChangeEditorMode( TBool aDefaultMode )
+    {
+    return iEditor->ChangeEditorMode( aDefaultMode );
+    }
+    
+// ---------------------------------------------------------------------------
+//  CBubbleOutlookNumberEntry::GetEditorMode
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CBubbleOutlookNumberEntry::GetEditorMode() const
+    {
+    return iEditor->GetEditorMode();
+    }
+    
+// ---------------------------------------------------------------------------
+//  CBubbleOutlookNumberEntry::ResetEditorToDefaultValues
+//  
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::ResetEditorToDefaultValues()
+    {
+    iEditor->ResetEditorToDefaultValues();
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::UpdateEditorColor
+// -----------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::UpdateEditorColor( const TRgb aColor )
+    {
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    TRgb skinColor = aColor;
+
+    AknsUtils::GetCachedColor( 
+        skin, 
+        skinColor, 
+        KAknsIIDQsnTextColors,
+        EAknsCIQsnTextColorsCG51 );
+
+    // Ignore error
+    TRAP_IGNORE( iEditor->OverrideColorL( EColorControlText, skinColor ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleOutlookNumberEntry::UpdateAndDrawEditor
+// -----------------------------------------------------------------------------
+//
+void CBubbleOutlookNumberEntry::UpdateAndDrawEditor()
+    {
+    TInt format = 0;
+      
+      if ( iPlace == ENEBottom )
+          {
+          if ( iEditor->CountFormats() < 2 )
+              {
+              return;
+              }
+          format = KBubbleNE1LongLineFormat;
+          if ( !iEditor->WouldTextFitInFormat( format ) )
+              {
+              format = KBubbleNE2LongLineFormat;
+              }
+          }
+      else if ( iPlace == ENEBottomRight )
+          {
+          if ( iEditor->CountFormats() < 4 )
+              {
+              return;
+              }
+          format = KBubbleNE1ShortLineFormat;
+          if ( !iEditor->WouldTextFitInFormat( KBubbleNE1ShortLineFormat ) )
+              {
+              format = KBubbleNE2ShortLineFormat;
+              }
+          }
+      else if ( iPlace == ENEIdleState )
+          {
+          if ( iEditor->CountFormats() < 9 )
+              {
+              return;
+              }
+          format = KBubbleNEIdleStateFormat;
+          }
+
+      // If there is no status pane the relative coordinates editor must be
+      // moved 44 pixels downwards, because editor's coordinates are absolute - 
+      // NOT relative to parent rect.
+      if ( iStatusPane && !iStatusPane->IsVisible() &&
+           !AknStatuspaneUtils::StaconPaneActive() )
+          {
+          format += KBubbleNEFormatOffsetIfNoStatusPane;
+          }
+
+      if (iEditor->CurrentFormatIndex() != format)
+          {
+          iEditor->SetFormat(format);
+          if ( iBubble )
+              {
+              iEditor->DrawNow();
+              if ( iMutedImage.IsVisible() )
+                  {
+                  iMutedImage.DrawNow();
+                  }
+              }
+          }
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookOneLined.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,440 @@
+/*
+* 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:  Implementation of CBubbleOutlookOneLined class.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleOutlookOneLined.h"
+#include    "BMResourceManager.h"
+#include    "BMBubbleHeader.h"
+#include    "BMUtils.h"
+#include    "BMCustomManager.h"
+#include    "telbubbleanim.h"
+#include    "BMLayout.h"
+
+#include    <eiklabel.h>
+#include    <eikimage.h>
+#include    <featmgr.h>     
+#include    <AknsDrawUtils.h>
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookOneLined::CBubbleOutlookOneLined( )
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookOneLined::CBubbleOutlookOneLined( 
+                                   CBubbleManager& aBubbleManager ) 
+: CBubbleOutlook( aBubbleManager )                               
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookOneLined::ConstructL
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookOneLined::ConstructL()
+    {
+    
+    iHeader = NULL;
+    CBubbleOutlook::ConstructL( );
+    ActivateL();
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookOneLined::~CBubbleOutlookOneLined()
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookOneLined::~CBubbleOutlookOneLined()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookOneLined::Reset
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookOneLined::Reset( )
+    {
+
+    iBubbleManager.ResourceManager().ReleaseEikImage( iBubble );
+    iBubbleManager.CustomManager().ReleaseCustomElement( iSmallCallIndication );
+    iBubbleManager.ResourceManager().ReleaseEikImage( iTypeIndication1 );
+    iBubbleManager.ResourceManager().ReleaseEikImage( iTypeIndication2 );
+    iBubbleManager.ResourceManager().ReleaseEikImage( iCyphOffImage );
+    iBubbleManager.ResourceManager().ReleaseEikLabel( iTextLine1 );
+
+    iFullText1.Set( NULL , 0 );
+    iHeader = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookOneLined::ReadBubbleHeader
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookOneLined::ReadBubbleHeader( CBubbleHeader& aHeader )
+    {
+    iHeader = &aHeader;
+    
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState( );
+
+    // Set small call indication icon
+    TInt defaultCallIndicator;
+    iSmallCallIndication = 
+        iBubbleManager.CustomManager().ReserveCustomElement(
+            aHeader, 
+            CTelBubbleCustomElement::ESmallCallIndicator,
+            defaultCallIndicator );
+    
+    // Number type not shown with custom call indicator
+    if ( defaultCallIndicator )
+        {
+        // Set the additional icons
+        BubbleUtils::SetCallTypePane( 
+            *iHeader , 
+            iTypeIndication1, 
+            iTypeIndication2, 
+            iBubbleManager );
+        }
+
+    // Set Cyph off image
+    BubbleUtils::SetCyphOffImage( *iHeader, iCyphOffImage, iBubbleManager );
+    
+    
+    
+    // Get texts and possible timer/cost string.
+    // Reserved text buffer is KBubbleLabelMaxLength. If new text 
+    // is longer it panics.
+    // It is enough if text is cropped to fit (eg. '...1234567890') 
+   
+    switch ( callState )
+        {
+        
+        case CBubbleManager::EOnHold:
+        case CBubbleManager::EDisconnected:
+        case CBubbleManager::EActive:
+        case CBubbleManager::EWaiting:
+        case CBubbleManager::EOutgoing:
+        case CBubbleManager::EAlertToDisconnected:
+        case CBubbleManager::EAlerting:
+            iTextLine1 = iBubbleManager.ResourceManager().ReserveEikLabel();
+            iFullText1.Set( iHeader->CLI() );
+            iText1ClipDirection = iHeader->CLIClipDirection( );
+            break;
+        case CBubbleManager::EIncoming:
+        case CBubbleManager::ENone:
+        default:
+            iFullText1.Set( NULL , 0 );
+            break;
+        }
+    }
+    
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookOneLined::CountComponentControls() const
+//
+//  
+// ---------------------------------------------------------------------------
+//
+TInt CBubbleOutlookOneLined::CountComponentControls() const
+    {
+    TInt amount = 0;
+    if ( iSmallCallIndication )
+        {
+        amount++;
+        }
+
+    if ( iTypeIndication1 ) 
+        {
+        amount++;
+        }
+
+    if ( iTypeIndication2 ) 
+        {
+        amount++;
+        }
+
+    if ( iCyphOffImage ) 
+        {
+        amount++;
+        }
+
+    if ( iTextLine1 ) 
+        {
+        amount++;
+        }
+    return amount;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookOneLined::ComponentControl
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CBubbleOutlookOneLined::ComponentControl( TInt aIndex ) const
+    {
+    TInt amount = -1;
+    if ( iSmallCallIndication )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iSmallCallIndication->Control();
+        }
+
+    if ( iTypeIndication1 )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iTypeIndication1;
+        }
+
+    if ( iTypeIndication2 )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iTypeIndication2;
+        }
+
+    if ( iCyphOffImage )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iCyphOffImage;
+        }
+
+    if ( iTextLine1 ) 
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iTextLine1;
+        }
+
+    return NULL;
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookOneLined::Draw
+// 
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookOneLined::Draw( const TRect& /*aRect*/ ) const
+    {
+    
+    // Check that proper call header is set
+    if ( iHeader == NULL ) 
+        { 
+        return; 
+        }
+    
+    if ( !iHeader->IsUsed( ) || iHeader->IsInConference( ) ) 
+        { 
+        return; 
+        }
+    
+    
+    // Set texts to fit.
+    BubbleUtils::ClipToLabel( iFullText1 , iTextLine1 , iText1ClipDirection );  
+
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookOneLined::DrawTimerCostNow
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookOneLined::DrawTimerCostNow()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookOneLined::DrawCLINow
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookOneLined::DrawCLINow()
+    {
+    if ( iHeader == NULL ) 
+        {
+        return;
+        }
+    
+    iFullText1.Set( iHeader->CLI() );
+    
+    CBubbleManager::TBubbleLabelString full = iHeader->CLI();
+    CBubbleManager::TPhoneClippingDirection clipDir = 
+        iHeader->CLIClipDirection();
+    
+    // Set texts to fit.
+    if ( full.Length() > 0 )
+        {
+        BubbleUtils::ClipToLabel( full , iTextLine1 , clipDir );
+        BubbleUtils::AddTextToEikLabel( iTextLine1 , full );
+        }
+    else
+        {
+        BubbleUtils::AddTextToEikLabel( iTextLine1 , KNullDesC );
+        }
+    
+    
+    // First clear the area and then draw the new text
+    DrawLabelNow( iTextLine1 );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookOneLined::DrawBitmaps
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookOneLined::DrawBitmaps( CBitmapContext& aGc ) const
+    {
+    // Check that proper call header is set
+    if ( iHeader == NULL ) 
+        { 
+        return; 
+        }
+    
+    if ( !iHeader->IsUsed( ) || iHeader->IsInConference( ) ) 
+        { 
+        return; 
+        }
+
+    if ( !iCallObjectDisplay )
+        {
+        DrawCall1Bitmaps( aGc );    
+        }
+    else
+        {
+        DrawCall2Bitmaps( aGc );    
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookOneLined::HandleAnimationStartL
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookOneLined::HandleAnimationStartL() const
+    {
+    if( iSmallCallIndication && 
+        iSmallCallIndication->ControlType() == CTelBubbleCustomElement::EBubbleAnimation )
+        {
+        CTelBubbleAnim* anim = 
+            static_cast<CTelBubbleAnim*> ( iSmallCallIndication->Control() );
+        anim->StartAnimationL(); 
+        }
+
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlookOneLined::ReleaseBitmaps
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookOneLined::ReleaseBitmaps()
+    {
+
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlookOneLined::RebuildBitmaps
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookOneLined::RebuildBitmaps()
+    {
+
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlookOneLined::DrawCallHeaderText
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookOneLined::DrawCallHeaderText()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlookTwoLined::DrawCall1Bitmaps
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookOneLined::DrawCall1Bitmaps( CBitmapContext& aGc ) const
+    {
+
+    aGc.SetBrushColor( AKN_LAF_COLOR( BubbleLayout::LayoutColourWhite() ) );
+    if ( !BubbleUtils::DrawMaskedImage( aGc , iBubble ) )
+        {
+        BubbleUtils::DrawBackgroundRect( aGc, Rect() );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlookTwoLined::DrawCall2Bitmaps
+// ---------------------------------------------------------------------------
+//        
+void CBubbleOutlookOneLined::DrawCall2Bitmaps( CBitmapContext& aGc ) const
+    {
+    if ( iBubble->Bitmap() )
+        {
+        BubbleUtils::DrawMaskedImage( aGc , iBubble );    
+        }
+    else
+        {
+        // Draw bubble frame
+        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        if ( !AknsDrawUtils::DrawFrame( skin,
+                                        (CWindowGc&) aGc,  
+                                        iOuterRect,
+                                        iInnerRect,
+                                        iFrameId,
+                                        KAknsIIDDefault ) )
+            {
+            BubbleUtils::DrawBackgroundRect( aGc, Rect() );
+            }        
+        }            
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookThreeLined.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,705 @@
+/*
+* 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: Implementation of CBubbleOutlookThreeLined class.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleOutlookThreeLined.h"
+#include    "BMResourceManager.h"
+#include    "BMCustomManager.h"
+#include    "BMBubbleHeader.h"
+#include    "BMUtils.h"
+#include    "BMLayout.h"
+
+#include    <telbubblecustomelement.h>
+#include    <telbubbleanim.h>
+
+#include    <eiklabel.h>
+#include    <eikimage.h>
+
+#include    <featmgr.h>
+#include    <AknsDrawUtils.h>
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CBubbleOutlookThreeLined::CBubbleOutlookThreeLined( 
+    CBubbleManager& aBubbleManager )
+: CBubbleOutlook( aBubbleManager )
+    {
+    }
+
+// Symbian OS default constructor can leave.
+void CBubbleOutlookThreeLined::ConstructL()
+    {
+    iHeader = NULL;
+    iTextLineNumber = 0;
+          
+    CBubbleOutlook::ConstructL( );
+    ActivateL();
+    }
+
+// Destructor
+CBubbleOutlookThreeLined::~CBubbleOutlookThreeLined()
+    {
+    
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookThreeLined::Reset
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookThreeLined::Reset( )
+    {
+    CBubbleResourceManager& res = iBubbleManager.ResourceManager();
+    res.ReleaseEikImage( iBubble );
+    iBubbleManager.CustomManager().ReleaseCustomElement( iSmallCallIndication );
+    iBubbleManager.CustomManager().ReleaseCustomElement( iNumberType );
+    res.ReleaseEikImage( iTypeIndication1 );
+    res.ReleaseEikImage( iTypeIndication2 );
+    res.ReleaseEikImage( iCyphOffImage );
+    res.ReleaseEikImage( iTnImage );
+    res.ReleaseEikLabel( iTextLine1 );
+    res.ReleaseEikLabel( iTextLine2 );
+    res.ReleaseEikLabel( iTextLine3 );
+    res.ReleaseEikLabel( iTimerCost );
+
+    iBubbleManager.CustomManager().ReleaseCustomElement( iBigCallIndicator );
+    iBubbleManager.CustomManager().ReleaseCustomElement( iBrandImage );
+    
+    iFullText1.Set( NULL, 0 );
+    iFullText2.Set( NULL, 0 );
+    iFullText3.Set( NULL, 0 );
+    iTextLineNumber = 0;
+
+    iHeader = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookThreeLined::ReadBubbleHeader
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookThreeLined::ReadBubbleHeader( CBubbleHeader& aHeader )
+    {
+    iHeader = &aHeader;
+    
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState( );
+    
+    // set all icons. divided to rectangle and bubble shaped
+    switch ( callState )
+        {
+        case CBubbleManager::EWaiting: 
+        case CBubbleManager::EIncoming:
+        case CBubbleManager::EOutgoing:
+        case CBubbleManager::EAlerting:
+        case CBubbleManager::EAlertToDisconnected:
+            {
+            // Set big call indicator icon
+            TBool defaultCallIndicator;
+            iBigCallIndicator = 
+                iBubbleManager.CustomManager().ReserveCustomElement(
+                    aHeader, 
+                    CTelBubbleCustomElement::EBigCallIndicator,
+                    defaultCallIndicator );
+            
+            // Number type not shown with custom call indicator
+            if ( defaultCallIndicator )
+                {
+                // Set number type icon
+                iNumberType = 
+                    iBubbleManager.CustomManager().ReserveCustomElement(
+                        aHeader, 
+                        CTelBubbleCustomElement::ENumberTypeIcon,
+                        defaultCallIndicator );
+                }
+            }
+            break;
+        case CBubbleManager::EDisconnected:
+        case CBubbleManager::EActive:
+        case CBubbleManager::EOnHold:
+            {
+            // Set small call indication icon
+            TInt defaultCallIndicator;
+            iSmallCallIndication = 
+                iBubbleManager.CustomManager().ReserveCustomElement(
+                    aHeader, 
+                    CTelBubbleCustomElement::ESmallCallIndicator,
+                    defaultCallIndicator );
+            
+            // Number type not shown with custom call indicator
+            if ( defaultCallIndicator )
+                {
+                // Set the additional icons
+                BubbleUtils::SetCallTypePane( 
+                    *iHeader , 
+                    iTypeIndication1, 
+                    iTypeIndication2, 
+                    iBubbleManager );
+                }
+            }
+            break;
+        case CBubbleManager::ENone:
+        default:
+            break;
+        }
+
+    // Set Cyph off image
+    BubbleUtils::SetCyphOffImage( *iHeader, iCyphOffImage, iBubbleManager );
+      
+    // Get texts and possible timer/cost string.
+    // Reserved text buffer is KBubbleLabelMaxLength. If new text is longer it
+    // panics. It is enough if text is cropped to fit (eg. '...1234567890') 
+    BubbleUtils::ChooseTextsToThreeLines( 
+        *iHeader , 
+        iFullText1 , 
+        iFullText2 , 
+        iFullText3 , 
+        iTimerCost ,
+        iTextLine1,
+        iTextLine2,
+        iTextLine3,
+        iBubbleManager,
+        iText1ClipDirection , 
+        iText2ClipDirection , 
+        iText3ClipDirection , 
+        iTextLineNumber );
+    
+    // Get thumbnail
+    if ( !iCallObjectDisplay && iHeader->TnBitmap() != NULL )
+        {
+        iTnImage = iBubbleManager.ResourceManager().ReserveEikImage();
+        if ( iTnImage && iHeader->TnBitmapMask() != NULL )
+            {
+            iTnImage->SetPicture( iHeader->TnBitmap() , 
+                iHeader->TnBitmapMask() );
+            }
+        else if ( iTnImage )
+            {
+            iTnImage->SetPicture( iHeader->TnBitmap() );
+            }
+        
+        }
+
+    // Brand image
+    iBrandImage = iBubbleManager.CustomManager().ReserveCustomElement(
+            aHeader, 
+            CTelBubbleCustomElement::EBrandImage );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookThreeLined::CountComponentControls
+//
+// All the controls are not used at all times. Athough we want to
+// keep the drawing order. 
+// ---------------------------------------------------------------------------
+//
+TInt CBubbleOutlookThreeLined::CountComponentControls() const
+    {
+    TInt amount = 0;
+    
+    if ( iNumberType ) 
+        {
+        amount++;
+        }
+
+    if ( iSmallCallIndication ) 
+        {
+        amount++;
+        }
+
+    if ( iTypeIndication1 ) 
+        {
+        amount++;
+        }
+
+    if ( iTypeIndication2 ) 
+        {
+        amount++;
+        }
+
+    if ( iCyphOffImage ) 
+        {
+        amount++;
+        }
+
+    if ( iTextLine1 ) 
+        {
+        amount++;
+        }
+
+    if ( iTextLine2 ) 
+        {
+        amount++;
+        }
+
+    if ( iTextLine3 ) 
+        {
+        amount++;
+        }
+
+    if ( iTimerCost ) 
+        {
+        amount++;
+        }
+
+    if ( iBrandImage )
+        {
+        amount++;
+        }
+
+    if ( iBigCallIndicator )
+        {
+        amount++;
+        }
+    
+    return amount;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookThreeLined::ComponentControl
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CBubbleOutlookThreeLined::ComponentControl(TInt aIndex) const
+    {
+  
+    TInt amount = -1;
+    
+    if ( iNumberType )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iNumberType->Control();
+        }
+
+    if ( iCyphOffImage )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iCyphOffImage;
+        }
+        
+    if ( iTextLine1 )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iTextLine1;
+        }
+
+    if ( iTextLine2 )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iTextLine2;
+        }
+
+    if ( iTextLine3 )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iTextLine3;
+        }
+
+    if ( iTimerCost )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iTimerCost;
+        }
+
+    if ( iSmallCallIndication )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iSmallCallIndication->Control();
+        }
+
+    if ( iTypeIndication1 )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iTypeIndication1;
+        }
+
+    if ( iTypeIndication2 )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iTypeIndication2;
+        }
+        
+    if ( iBrandImage )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iBrandImage->Control();
+        }
+    
+    if ( iBigCallIndicator )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iBigCallIndicator->Control();
+        }
+
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookThreeLined::Draw
+// 
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookThreeLined::Draw( const TRect& /*aRect*/ ) const
+    {
+    
+    // Check that proper call header is set
+    
+    if ( iHeader == NULL ) 
+        { 
+        return; 
+        }
+    
+    if ( !iHeader->IsUsed( ) ) 
+        { 
+        return; 
+        }
+    
+    if ( iHeader->IsInConference( ) ) 
+        { 
+        return; 
+        }
+    
+    TUint32 callFlag = iHeader->CallFlags( );
+	CBubbleManager::TPhoneCallState callState = iHeader->CallState( );		
+    
+    // Set texts to fit.
+    switch (iTextLineNumber)
+        {
+        case 0:
+            BubbleUtils::ClipToLabel( iFullText1 , iTextLine1 , 
+                iText1ClipDirection );
+            BubbleUtils::ClipToLabel( iFullText2 , iTextLine2 , 
+                iText2ClipDirection );
+            BubbleUtils::AddTextToEikLabel( iTextLine3 , KNullDesC );
+            break;
+        case 1:
+            BubbleUtils::SetTextInLabel( iFullText1 , iTextLine1 , 
+                iText1ClipDirection );
+            BubbleUtils::ClipToLabel( iFullText2 , iTextLine2 , 
+                iText2ClipDirection );
+            BubbleUtils::ClipToLabel( iFullText3 , iTextLine3 , 
+                iText3ClipDirection );
+            break;
+        case 3:
+            BubbleUtils::ClipToLabel( iFullText1 , iTextLine1 , 
+                iText1ClipDirection );
+            BubbleUtils::ClipToLabel( iFullText2 , iTextLine2 , 
+                iText2ClipDirection );
+            BubbleUtils::SetTextInLabel( iFullText3 , iTextLine3 , 
+                iText3ClipDirection );
+            break;
+        default:
+            BubbleUtils::AddTextToEikLabel( iTextLine1 , KNullDesC );
+            BubbleUtils::AddTextToEikLabel( iTextLine2 , KNullDesC );
+            BubbleUtils::AddTextToEikLabel( iTextLine3 , KNullDesC );
+            break;
+        }
+
+
+    }
+
+// ---------------------------------------------------------------------------
+//CBubbleOutlookThreeLined::DrawTimerCostNow
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookThreeLined::DrawTimerCostNow()
+    {
+    if ( iHeader == NULL || iTimerCost == NULL ) 
+        {
+        return;
+        }
+
+    if ( iHeader->CallState() != CBubbleManager::EActive  
+        || iTimerCost->Text()->Compare( iHeader->TimerCost() ) == 0 ) 
+        {
+        return;
+        }
+    
+    BubbleUtils::ClipToLabel( iHeader->TimerCost() , iTimerCost , 
+        CBubbleManager::ERight );
+    DrawLabelNow( iTimerCost);
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookThreeLined::DrawCLINow
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookThreeLined::DrawCLINow()
+    {
+    if ( iHeader == NULL ) 
+        {
+        return;
+        }
+    
+    CEikLabel* cli = NULL;
+    
+    if ( iTextLineNumber == 1 )
+        {
+        iFullText3.Set( iHeader->CLI() );
+        cli = iTextLine3;
+        }
+    else
+        {
+        iFullText1.Set( iHeader->CLI() );
+        cli = iTextLine1;
+        }
+    
+    CBubbleManager::TBubbleLabelString full = iHeader->CLI();
+    CBubbleManager::TPhoneClippingDirection clipDir 
+        = iHeader->CLIClipDirection();
+    
+    // Set texts to fit.
+    if ( full.Length() > 0 )
+        {
+        BubbleUtils::ClipToLabel( full , cli , clipDir );
+        BubbleUtils::AddTextToEikLabel( cli , full );
+        }
+    else
+        {
+        BubbleUtils::AddTextToEikLabel( cli , KNullDesC );
+        }
+    
+    // First clear the area and then draw the new text
+    DrawLabelNow( cli );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookThreeLined::DrawBitmaps
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookThreeLined::DrawBitmaps( CBitmapContext& aGc ) const
+    {
+    // Check that proper call header is set
+    if ( iHeader == NULL ) 
+        { 
+        return; 
+        }
+    
+    if ( !iHeader->IsUsed() ) 
+        { 
+        return; 
+        }
+    
+    if ( iHeader->IsInConference() ) 
+        { 
+        return; 
+        }
+
+    if ( !iCallObjectDisplay )
+        {
+        DrawCall1Bitmaps( aGc );    
+        }
+    else
+        {
+        DrawCall2Bitmaps( aGc );    
+        }        
+    
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookThreeLined::HandleAnimationStartL
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookThreeLined::HandleAnimationStartL() const
+    {
+    if ( iBigCallIndicator && iBigCallIndicator->ControlType() == 
+         CTelBubbleCustomElement::EBubbleAnimation )
+        {
+        CTelBubbleAnim* anim = 
+            static_cast<CTelBubbleAnim*> ( iBigCallIndicator->Control() );
+        anim->StartAnimationL();    
+        }
+    
+    if ( iBrandImage && iBrandImage->ControlType() == 
+         CTelBubbleCustomElement::EBubbleAnimation )
+        {
+        CTelBubbleAnim* anim = 
+            static_cast<CTelBubbleAnim*> ( iBrandImage->Control() );
+        anim->StartAnimationL();    
+        }
+    
+    if ( iSmallCallIndication && iSmallCallIndication->ControlType() == 
+         CTelBubbleCustomElement::EBubbleAnimation )
+        {
+        CTelBubbleAnim* anim = 
+            static_cast<CTelBubbleAnim*> ( iSmallCallIndication->Control() );
+        anim->StartAnimationL();    
+        }
+    
+    if( iNumberType && iNumberType->ControlType() == 
+         CTelBubbleCustomElement::EBubbleAnimation )
+        {
+        CTelBubbleAnim* anim = 
+            static_cast<CTelBubbleAnim*> ( iNumberType->Control() );
+        anim->StartAnimationL();    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlookThreeLined::DrawCallHeaderText
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookThreeLined::DrawCallHeaderText()
+    {
+    if ( iHeader == NULL || iTextLine1 == NULL ) 
+        {
+        return;
+        }
+
+    if ( iHeader->CallState() != CBubbleManager::EOutgoing )
+        {
+        return;
+        }
+    
+    CEikLabel* label = NULL;
+    iFullText1.Set( iHeader->Text() );
+    label = iTextLine1;
+
+    CBubbleManager::TPhoneClippingDirection textDir = 
+        iHeader->TextClipDirection();
+
+    BubbleUtils::ClipToLabel( iHeader->Text(), label, textDir );
+    DrawLabelNow( label );    
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlookThreeLined::DrawCall1Bitmaps
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookThreeLined::DrawCall1Bitmaps( CBitmapContext& aGc ) const
+    {
+    // Now starts actual drawing.
+    aGc.SetBrushColor( AKN_LAF_COLOR( BubbleLayout::LayoutColourWhite() ) );
+
+    if ( !BubbleUtils::DrawMaskedImage( aGc , iBubble ) )
+        {
+        BubbleUtils::DrawBackgroundRect( aGc, Rect() );
+        }
+    
+    // If it's a conference bubble, don't draw a thumbnail
+    if ( iHeader->IsConference( ) ) 
+        {
+        return;
+        }
+    
+    // if it's a arriving call on line 2 -> don't show TN
+    if ( !iTnImage || !( iTnImage->Bitmap( ) !=NULL 
+            && ( !( ( iHeader->CallState() == CBubbleManager::EIncoming
+                      || iHeader->CallState() == CBubbleManager::EWaiting )
+                    && iHeader->CallFlags()&CBubbleManager::ELine2 ) ) ) )
+        {
+        return;
+        }
+    
+    // checks if image needs clipping and draws possible thumbnail image.
+    if ( iTnImage->Bitmap() != NULL )
+        {
+        // Draw shadow
+        aGc.SetPenColor( iTnImageShadow.Color() );
+        aGc.DrawRect ( iTnImageShadow.Rect() );
+        aGc.BitBlt( iTnImage->Rect().iTl , iHeader->TnIconBitmap() );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlookThreeLined::DrawCall2Bitmaps
+// ---------------------------------------------------------------------------
+//        
+void CBubbleOutlookThreeLined::DrawCall2Bitmaps( CBitmapContext& aGc ) const
+    {
+    if ( iBubble->Bitmap() )
+        {
+        BubbleUtils::DrawMaskedImage( aGc , iBubble );    
+        }
+    else
+        {
+        // Draw bubble frame
+        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        if ( !AknsDrawUtils::DrawFrame( skin,
+                                        (CWindowGc&) aGc,  
+                                        iOuterRect,
+                                        iInnerRect,
+                                        iFrameId,
+                                        KAknsIIDDefault ) )
+            {
+            BubbleUtils::DrawBackgroundRect( aGc, Rect() );
+            }        
+        }            
+    }
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookTopLeft.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,377 @@
+/*
+* 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:  Implementation of CBubbleOutlookTopLeft class.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleManager.h" //for enumerations
+#include    "BMBubbleOutlookTopLeft.h"
+#include    "BMBubbleImageManager.h"
+#include    "BMResourceManager.h"
+#include    "BMBubbleHeader.h"
+#include    "BMUtils.h"
+#include    "BMLayout.h"
+#include    "BMLayout2.h"
+
+#include    <eiklabel.h> 
+#include    <eikimage.h>
+#include    <eikenv.h>
+#include    <AknsUtils.h>
+#include    <AknsDrawUtils.h>
+
+// ========================= MEMBER FUNCTIONS ================================
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTopLeft::CBubbleOutlookTopLeft
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookTopLeft::CBubbleOutlookTopLeft( 
+                                   CBubbleManager& aBubbleManager ) 
+: CBubbleOutlookOneLined( aBubbleManager )                               
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTopLeft::ConstructL
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookTopLeft::ConstructL()
+    {
+    CBubbleOutlookOneLined::ConstructL( );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTopLeft::~CBubbleOutlookTopLeft
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookTopLeft::~CBubbleOutlookTopLeft()
+    {
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTopLeft::ReadBubbleHeader
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookTopLeft::ReadBubbleHeader( CBubbleHeader& aHeader )
+    {
+    iHeader = &aHeader;
+
+    iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );        
+    
+    if ( !iCallObjectDisplay )
+        {
+        GetCall1BubbleBitmaps();    
+        }
+    
+    CBubbleOutlookOneLined::ReadBubbleHeader( aHeader );
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTopLeft::SizeChanged
+// called by framwork when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookTopLeft::SizeChanged()
+    {
+    if( !iHeader )
+        {
+        return;
+        }
+
+    AknsUtils::RegisterControlPosition( this );
+    
+    if ( !iCallObjectDisplay )
+        {
+        DoCall1Layout();    
+        }
+    else
+        {
+        TRAPD( err, DoCall2LayoutL() );
+        if ( err )    
+            {
+            iBubble->SetPicture( NULL, NULL );
+                
+            MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+            AknsDrawUtils::PrepareFrame( skin,
+                                         iOuterRect,
+                                         iInnerRect,
+                                         iFrameId,
+                                         KAknsIIDDefault );    
+            }
+        }     
+    }
+
+    
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTopLeft::DoCall1Layout
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookTopLeft::DoCall1Layout()
+    {
+    // Deprecated
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTopLeft::DoCall2Layout
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookTopLeft::DoCall2LayoutL()
+    {
+    iBubble->SetPictureOwnedExternally( EFalse );
+    iBubble->SetPicture( NULL, NULL );
+    
+    const TRect rect = Rect();
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    switch ( callState )
+        {
+        case CBubbleManager::EWaiting:
+            {
+            ///////////////////////////////////////////////////////////////////
+            // Waiting call layout
+            ///////////////////////////////////////////////////////////////////
+            
+            TAknLayoutRect bubbleRect;
+            bubbleRect.LayoutRect( 
+                rect, 
+                BubbleLayout2::popup_call2_audio_wait_call_background() );
+            
+            TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+            TRect outerRect;
+            TRect innerRect;
+            BubbleLayout2::RectFrameInnerOuterRects( frameRect, 
+                                                     outerRect, 
+                                                     innerRect );
+            
+            iFrameId = ( callState == CBubbleManager::EAlertToDisconnected ) ?
+                                      KAknsIIDQsnFrCall2RectDisconn : 
+                                      KAknsIIDQsnFrCall2Rect;
+            
+            iOuterRect = outerRect;
+            iOuterRect.Move( Rect().iTl );
+            iInnerRect = innerRect;
+            iInnerRect.Move( Rect().iTl );
+            
+            // Call icon
+            BubbleUtils::LayoutCustomElement(
+                iSmallCallIndication, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_wait_call_status_icon() );
+                
+            // Ciphering off
+            BubbleUtils::LayoutControl( 
+                iCyphOffImage, 
+                rect,
+                BubbleLayout2::popup_call2_audio_wait_call_cyphering_icon() );
+                
+            
+            // Call type pane    
+            BubbleUtils::LayoutCallTypeIndicators(
+                rect,
+                BubbleLayout2::popup_call2_audio_wait_call_type_icon(),
+                iTypeIndication1,   // Data/Fax
+                iTypeIndication2 ); // ALS line 2
+            
+            // Text
+            BubbleUtils::LayoutLabel( 
+                iTextLine1, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_wait_call_cli_text() );
+                
+            // Create call object bitmaps
+            iBubble->SetRect( bubbleRect.Rect() );                
+            
+            BubbleUtils::PrepareBubbleImageL( 
+                iFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+                
+            if ( iHeader->CallObjectImage() &&
+                 !iHeader->CallObjectText().Length() )
+                {
+                // Add transparency
+                BubbleUtils::AddTransparencyToBubbleImageL( 
+                    KAknsIIDQsnFrCall2RectCoMask, // gradient tp mask
+                    outerRect,
+                    innerRect,
+                    iBubble );                    
+                }                
+            break;
+            }
+        case CBubbleManager::EDisconnected:
+        case CBubbleManager::EActive:
+        case CBubbleManager::EOnHold:
+            {
+            ///////////////////////////////////////////////////////////////////
+            // First call layout. Two calls and number entry.
+            ///////////////////////////////////////////////////////////////////
+            
+            // Create bubble image
+            TAknLayoutRect bubbleRect;
+            bubbleRect.LayoutRect( 
+                rect, 
+                BubbleLayout2::popup_call2_audio_first_call_background(15) );
+            
+            TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+            TRect outerRect;
+            TRect innerRect;
+            BubbleLayout2::BubbleFrameInnerOuterRects( frameRect, 
+                                                       outerRect, 
+                                                       innerRect);
+            TAknsItemID coMaskFrameId;
+            if ( callState == CBubbleManager::EOnHold )
+                {
+                iFrameId = KAknsIIDQsnFrCall2Bubble;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleCoMask;
+                }
+            else if ( callState == CBubbleManager::EDisconnected )
+                {
+                iFrameId = KAknsIIDQsnFrCall2BubbleFirstDisconn;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleFirstCoMask;
+                }
+            else
+                {
+                iFrameId = KAknsIIDQsnFrCall2BubbleFirst;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleFirstCoMask;
+                }                
+            
+            iOuterRect = outerRect;
+            iOuterRect.Move( Rect().iTl );
+            iInnerRect = innerRect;
+            iInnerRect.Move( Rect().iTl );
+
+            // Call icon
+            BubbleUtils::LayoutCustomElement( 
+                iSmallCallIndication, 
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_status_icon(14) );
+                
+            // Ciphering off
+            BubbleUtils::LayoutControl( 
+                iCyphOffImage, 
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_window_ciphering_icon(13) );
+            
+            // Call type pane
+            BubbleUtils::LayoutCallTypeIndicators(
+                rect,
+                BubbleLayout2::popup_call2_audio_first_call_type_icon(13),
+                iTypeIndication1,   // Data/Fax
+                iTypeIndication2 ); // ALS line 2
+                
+            // Text line 1
+            BubbleUtils::LayoutLabel( 
+                iTextLine1, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_first_call_cli_text(17) );
+                
+            // Create call bubble
+            iBubble->SetRect( bubbleRect.Rect() );                                
+            
+            BubbleUtils::PrepareBubbleImageL( 
+                iFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+            
+            // Add transparency
+            BubbleUtils::AddTransparencyToBubbleImageL( 
+                coMaskFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+                
+            break;
+            }
+        case CBubbleManager::ENone:
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTopLeft::GetCall1BubbleBitmaps
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookTopLeft::GetCall1BubbleBitmaps()
+    {
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    
+    TInt bubblePicture = KErrNotFound;
+    TInt bubblePictureMask = KErrNotFound;
+    
+    // set call indications and bubble
+        // set call indications and bubble
+    switch ( callState )
+        {
+        case CBubbleManager::EWaiting:
+            bubblePicture = EQgn_graf_call_rec_small_left;
+            bubblePictureMask = EQgn_graf_call_rec_small_left_mask;
+            break;
+        case CBubbleManager::EActive:
+            bubblePicture = EQgn_graf_call_first_three_active;
+            bubblePictureMask = EQgn_graf_call_first_three_active_mask;
+            break;
+        case CBubbleManager::EOnHold:
+            bubblePicture = EQgn_graf_call_first_three_held;
+            bubblePictureMask = EQgn_graf_call_first_three_held_mask;
+            break;
+        case CBubbleManager::EDisconnected:
+            bubblePicture = EQgn_graf_call_first_three_disconn;
+            bubblePictureMask = EQgn_graf_call_first_three_disconn_mask; 
+            break;
+        case CBubbleManager::EIncoming:
+        case CBubbleManager::EOutgoing:
+        case CBubbleManager::EAlertToDisconnected:
+        case CBubbleManager::EAlerting:
+        case CBubbleManager::ENone:
+        default:
+            bubblePicture = KErrNotFound;
+            bubblePictureMask = KErrNotFound;
+            break;
+        }
+
+    if ( bubblePicture != KErrNotFound )
+        {
+        if ( bubblePictureMask == KErrNotFound )
+            {
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                iBubble, (TBMIcons) bubblePicture );
+            }
+        else
+            {
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                iBubble, 
+                (TBMIcons) bubblePicture , 
+                (TBMIcons) bubblePictureMask);
+            }
+        }
+        
+    }    
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookTopRight.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,375 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Outlook Top Right
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleManager.h" //for enumerations
+#include    "BMBubbleOutlookTopRight.h"
+#include    "BMBubbleImageManager.h"
+#include    "BMResourceManager.h"
+#include    "BMBubbleHeader.h"
+#include    "BMUtils.h"
+#include    "BMLayout.h"
+#include    "BMLayout2.h"
+
+#include    <eiklabel.h> 
+#include    <eikimage.h>
+#include    <eikenv.h>
+#include    <AknsUtils.h>
+#include    <AknsDrawUtils.h>
+
+// ========================= MEMBER FUNCTIONS ================================
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTopRight::CBubbleOutlookTopRight
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookTopRight::CBubbleOutlookTopRight( CBubbleManager& aBubbleManager ) 
+: CBubbleOutlookOneLined( aBubbleManager )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTopRight::ConstructL
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookTopRight::ConstructL()
+    {
+    CBubbleOutlookOneLined::ConstructL( );
+    }
+
+// Destructor
+CBubbleOutlookTopRight::~CBubbleOutlookTopRight()
+    {
+
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTopRight::ReadBubbleHeader
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookTopRight::ReadBubbleHeader( CBubbleHeader& aHeader )
+    {
+    iHeader = &aHeader;
+
+    iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );        
+    
+    if ( !iCallObjectDisplay )
+        {
+        GetCall1BubbleBitmaps();    
+        }
+    
+    CBubbleOutlookOneLined::ReadBubbleHeader( aHeader );
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTopRight::SizeChanged
+// called by framwork when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookTopRight::SizeChanged()
+    {
+    if( !iHeader )
+        {
+        return;
+        }
+
+    AknsUtils::RegisterControlPosition( this );
+    
+    if ( !iCallObjectDisplay )
+        {
+        DoCall1Layout();    
+        }
+    else
+        {
+        TRAPD( err, DoCall2LayoutL() );
+        if ( err )    
+            {
+            iBubble->SetPicture( NULL, NULL );
+                
+            MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+            AknsDrawUtils::PrepareFrame( skin,
+                                         iOuterRect,
+                                         iInnerRect,
+                                         iFrameId,
+                                         KAknsIIDDefault );    
+            }
+        }     
+    }
+    
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTopRight::DoCall1Layout
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookTopRight::DoCall1Layout()
+    {
+    // Deprecated
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTopRight::DoCall2Layout
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookTopRight::DoCall2LayoutL()
+    {
+    iBubble->SetPictureOwnedExternally( EFalse );
+    iBubble->SetPicture( NULL, NULL );
+    
+    const TRect rect = Rect();
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    switch ( callState )
+        {
+        case CBubbleManager::EWaiting:
+        case CBubbleManager::EIncoming:
+        case CBubbleManager::EOutgoing:
+        case CBubbleManager::EAlerting:
+        case CBubbleManager::EAlertToDisconnected:
+            {
+            ///////////////////////////////////////////////////////////////////
+            // Outgoing call layout. Two calls and number entry.
+            ///////////////////////////////////////////////////////////////////
+            
+            TAknLayoutRect bubbleRect;
+            bubbleRect.LayoutRect( 
+                rect, 
+                BubbleLayout2::popup_call2_audio_out_background(1) );
+            
+            TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+            TRect outerRect;
+            TRect innerRect;
+            BubbleLayout2::RectFrameInnerOuterRects( frameRect, 
+                                                     outerRect, 
+                                                     innerRect);
+            
+            iFrameId = ( callState == CBubbleManager::EAlertToDisconnected ) ?
+                                      KAknsIIDQsnFrCall2RectDisconn : 
+                                      KAknsIIDQsnFrCall2Rect;
+            
+            iOuterRect = outerRect;
+            iOuterRect.Move( Rect().iTl );
+            iInnerRect = innerRect;
+            iInnerRect.Move( Rect().iTl );
+            
+            // Call icon
+            BubbleUtils::LayoutCustomElement(
+                iSmallCallIndication, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_out_call_waiting_icon(2) );
+            
+            // Ciphering off
+            BubbleUtils::LayoutControl( 
+                iCyphOffImage, 
+                rect,
+                BubbleLayout2::popup_call2_audio_out_ciphering_icon(2) );
+            
+            // Call type pane
+            BubbleUtils::LayoutCallTypeIndicators(
+                rect,
+                BubbleLayout2::popup_call2_audio_second_call_type_icon(0),
+                iTypeIndication1,   // Data/Fax
+                iTypeIndication2 ); // ALS line 2
+                
+            // Text
+            BubbleUtils::LayoutLabel( 
+                iTextLine1, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_out_call_text_1(2) );
+            
+            // Create call object bitmaps
+            iBubble->SetRect( bubbleRect.Rect() );                
+
+            BubbleUtils::PrepareBubbleImageL( 
+                iFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+                
+            if ( iHeader->CallObjectImage() &&
+                 !iHeader->CallObjectText().Length() )
+                {
+                // Add transparency
+                BubbleUtils::AddTransparencyToBubbleImageL( 
+                    KAknsIIDQsnFrCall2RectCoMask, // gradient tp mask
+                    outerRect,
+                    innerRect,
+                    iBubble );                    
+                }
+            break;
+            }
+        case CBubbleManager::EDisconnected:
+        case CBubbleManager::EActive:
+        case CBubbleManager::EOnHold:
+            {
+            ///////////////////////////////////////////////////////////////////
+            // Second call layout. Two calls and number entry.
+            ///////////////////////////////////////////////////////////////////
+            
+            // Create bubble image
+            TAknLayoutRect bubbleRect;
+            bubbleRect.LayoutRect( 
+                rect, 
+                BubbleLayout2::popup_call2_audio_second_call_background(0) );
+            
+            TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
+            TRect outerRect;
+            TRect innerRect;
+            BubbleLayout2::BubbleFrameInnerOuterRects( frameRect, 
+                                                       outerRect, 
+                                                       innerRect);
+            TAknsItemID coMaskFrameId;
+            if ( callState == CBubbleManager::EOnHold )
+                {
+                iFrameId = KAknsIIDQsnFrCall2Bubble;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleCoMask;
+                }
+            else if ( callState == CBubbleManager::EDisconnected )
+                {
+                iFrameId = KAknsIIDQsnFrCall2BubbleSecondDisconn;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleSecondCoMask;
+                }
+            else
+                {
+                iFrameId = KAknsIIDQsnFrCall2BubbleSecond;
+                coMaskFrameId = KAknsIIDQsnFrCall2BubbleSecondCoMask;
+                }                
+            
+            iOuterRect = outerRect;
+            iOuterRect.Move( Rect().iTl );
+            iInnerRect = innerRect;
+            iInnerRect.Move( Rect().iTl );
+
+            // Call icon
+            BubbleUtils::LayoutCustomElement( 
+                iSmallCallIndication, 
+                rect,
+                BubbleLayout2::popup_call2_audio_second_call_status_icon(11) );
+                
+            // Ciphering off
+            BubbleUtils::LayoutControl( 
+                iCyphOffImage, 
+                rect,
+                BubbleLayout2::popup_call2_audio_second_call_cyphering_icon(11) );
+            
+            
+            // Call type pane
+            BubbleUtils::LayoutCallTypeIndicators(
+                rect,
+                BubbleLayout2::popup_call2_audio_second_call_type_icon(11),
+                iTypeIndication1,   // Data/Fax
+                iTypeIndication2 ); // ALS line 2
+                
+            // Text line 1
+            BubbleUtils::LayoutLabel( 
+                iTextLine1, 
+                rect, 
+                BubbleLayout2::popup_call2_audio_second_call_cli_text(13) );
+                
+            // Create bubble
+            iBubble->SetRect( bubbleRect.Rect() );    
+            
+            BubbleUtils::PrepareBubbleImageL( 
+                iFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+            
+            // Add transparency
+            BubbleUtils::AddTransparencyToBubbleImageL( 
+                coMaskFrameId,
+                outerRect,
+                innerRect,
+                iBubble );
+                
+            break;
+            }
+        case CBubbleManager::ENone:
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTopRight::GetCall1BubbleBitmaps
+// ---------------------------------------------------------------------------
+//    
+void CBubbleOutlookTopRight::GetCall1BubbleBitmaps()
+    {
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    
+    TInt bubblePicture = KErrNotFound;
+    TInt bubblePictureMask = KErrNotFound;
+    
+    // set call indications and bubble
+    switch ( callState )
+        {
+        case CBubbleManager::EAlertToDisconnected:
+            bubblePicture = EQgn_graf_call_rec_small_right_disconn;
+            bubblePictureMask = EQgn_graf_call_rec_small_right_disconn_mask;
+            break;
+        case CBubbleManager::EOutgoing:
+        case CBubbleManager::EWaiting:
+        case CBubbleManager::EAlerting:
+            bubblePicture = EQgn_graf_call_rec_small_right;
+            bubblePictureMask = EQgn_graf_call_rec_small_right_mask;
+            break;
+        case CBubbleManager::EActive:
+            bubblePicture = EQgn_graf_call_second_three_active;
+            bubblePictureMask = EQgn_graf_call_second_three_active_mask;
+            break;
+        case CBubbleManager::EOnHold:
+            bubblePicture = EQgn_graf_call_second_three_held;
+            bubblePictureMask = EQgn_graf_call_second_three_held_mask;
+            break;
+        case CBubbleManager::EDisconnected:
+            bubblePicture = EQgn_graf_call_second_three_disconn;
+            bubblePictureMask = EQgn_graf_call_second_three_disconn_mask;
+            break;
+        default:
+            bubblePicture = KErrNotFound;
+            bubblePictureMask = KErrNotFound;
+            break;
+        }
+
+    if ( bubblePicture != KErrNotFound )
+        {
+        if ( bubblePictureMask == KErrNotFound )
+            {
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                iBubble, (TBMIcons) bubblePicture );
+            }
+        else
+            {
+            iBubbleManager.ImageManager().SetBitmapToImage( 
+                iBubble, 
+                (TBMIcons) bubblePicture , 
+                (TBMIcons) bubblePictureMask);
+            }
+        }
+        
+    }    
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookTwoLined.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,673 @@
+/*
+* 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:  Outlook Two Lined
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleOutlookTwoLined.h"
+#include    "BMResourceManager.h"
+#include    "BMBubbleHeader.h"
+#include    "BMUtils.h"
+#include    "BMLayout.h"
+#include    "BMCustomManager.h"
+
+#include    <telbubblecustomelement.h>
+#include    <telbubbleanim.h>
+
+#include    <eiklabel.h>
+#include    <eikimage.h>
+#include    <featmgr.h>
+#include    <AknsDrawUtils.h>
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CBubbleOutlookTwoLined::CBubbleOutlookTwoLined
+    ( CBubbleManager& aBubbleManager )
+    : CBubbleOutlook( aBubbleManager )
+    {
+    }
+
+// Symbian OS constructor can leave.
+void CBubbleOutlookTwoLined::ConstructL()
+    {
+    iHeader = NULL;
+    iTextLineNumber = 0;
+          
+    CBubbleOutlook::ConstructL( );
+    ActivateL();
+    }
+    
+// Destructor
+CBubbleOutlookTwoLined::~CBubbleOutlookTwoLined()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTwoLined::Reset
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookTwoLined::Reset( )
+    {
+    CBubbleResourceManager& res = iBubbleManager.ResourceManager();
+    res.ReleaseEikImage( iBubble );
+    iBubbleManager.CustomManager().ReleaseCustomElement( iSmallCallIndication );
+    iBubbleManager.CustomManager().ReleaseCustomElement( iNumberType );
+    res.ReleaseEikImage( iTypeIndication1 );
+    res.ReleaseEikImage( iTypeIndication2 );
+    res.ReleaseEikImage( iCyphOffImage );
+    res.ReleaseEikImage( iTnImage );
+    res.ReleaseEikLabel( iTextLine1 );
+    res.ReleaseEikLabel( iTextLine2 );
+    res.ReleaseEikLabel( iTimerCost );
+    
+    iBubbleManager.CustomManager().ReleaseCustomElement( iBigCallIndicator );
+    iBubbleManager.CustomManager().ReleaseCustomElement( iBrandImage );
+
+    iFullText1.Set( NULL, 0 );
+    iFullText2.Set( NULL, 0 );
+    iTextLineNumber = 0;
+
+    iHeader = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTwoLined::ReadBubbleHeader
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookTwoLined::ReadBubbleHeader( CBubbleHeader& aHeader )
+    {
+    iHeader = &aHeader;
+
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState( );
+
+    // set all icons. divided to rectangle and bubble shaped
+    switch ( callState )
+        {
+        case CBubbleManager::EAlertToDisconnected:
+        case CBubbleManager::EWaiting:
+        case CBubbleManager::EIncoming:
+        case CBubbleManager::EOutgoing:
+        case CBubbleManager::EAlerting:
+            {
+            // Set big call indicator icon
+            TBool defaultCallIndicator;
+            iBigCallIndicator = 
+                iBubbleManager.CustomManager().ReserveCustomElement(
+                    aHeader, 
+                    CTelBubbleCustomElement::EBigCallIndicator,
+                    defaultCallIndicator );
+            
+            // Number type not shown with custom call indicator
+            if ( defaultCallIndicator )
+                {
+                // Set number type icon
+                iNumberType = 
+                    iBubbleManager.CustomManager().ReserveCustomElement(
+                        aHeader, 
+                        CTelBubbleCustomElement::ENumberTypeIcon,
+                        defaultCallIndicator );
+                }
+            }
+            break;
+        case CBubbleManager::EDisconnected:
+        case CBubbleManager::EActive:
+        case CBubbleManager::EOnHold:
+            {
+            // Set small call indication icon
+            TInt defaultCallIndicator;
+            iSmallCallIndication = 
+                iBubbleManager.CustomManager().ReserveCustomElement(
+                    aHeader, 
+                    CTelBubbleCustomElement::ESmallCallIndicator,
+                    defaultCallIndicator );
+            
+            // Number type not shown with custom call indicator
+            if ( defaultCallIndicator )
+                {
+                // Set the additional icons
+                BubbleUtils::SetCallTypePane( 
+                    *iHeader , 
+                    iTypeIndication1, 
+                    iTypeIndication2, 
+                    iBubbleManager );
+                }
+            }
+
+            break;
+        case CBubbleManager::ENone:
+        default:
+            break;
+        }
+
+    // Set Cyph off image
+    BubbleUtils::SetCyphOffImage( *iHeader, iCyphOffImage, iBubbleManager );
+
+    // Get texts and possible timer/cost string.
+    // Reserved text buffer is KBubbleLabelMaxLength. 
+    // If new text is longer it panics.
+    // It is enough if text is cropped to fit (eg. '...1234567890') 
+    BubbleUtils::ChooseTextsToTwoLines( 
+        *iHeader , 
+        iFullText1 , 
+        iFullText2 , 
+        iTimerCost , 
+        iTextLine1,
+        iTextLine2,
+        iBubbleManager,
+        iText1ClipDirection , 
+        iText2ClipDirection , 
+        iTextLineNumber );
+
+    // Get thumbnail
+    if ( !iCallObjectDisplay && iHeader->TnBitmap() != NULL )
+        {
+        iTnImage = iBubbleManager.ResourceManager().ReserveEikImage();
+        if ( iTnImage && iHeader->TnBitmapMask() != NULL )
+            {
+            iTnImage->SetPicture( 
+                iHeader->TnBitmap() , iHeader->TnBitmapMask() );
+            }
+        else if ( iTnImage )
+            {
+            iTnImage->SetPicture( iHeader->TnBitmap() );
+            }
+
+        }
+    
+    // Brand image
+    iBrandImage = iBubbleManager.CustomManager().ReserveCustomElement(
+        aHeader, 
+        CTelBubbleCustomElement::EBrandImage );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTwoLined::CountComponentControls() const
+//
+// All the controls are not used at all times. Athough we want to
+// keep the drawing order. 
+// ---------------------------------------------------------------------------
+//
+TInt CBubbleOutlookTwoLined::CountComponentControls() const
+    {
+    TInt amount = 0;
+
+    if ( iNumberType ) 
+        {
+        amount++;
+        }
+
+    if ( iSmallCallIndication ) 
+        {
+        amount++;
+        }
+
+    if ( iTypeIndication1 ) 
+        {
+        amount++;
+        }
+
+    if ( iTypeIndication2 ) 
+        {
+        amount++;
+        }
+
+    if ( iCyphOffImage ) 
+        {
+        amount++;
+        }
+
+    if ( iTextLine1 ) 
+        {
+        amount++;
+        }
+
+    if ( iTextLine2 ) 
+        {
+        amount++;
+        }
+
+    if ( iTimerCost ) 
+        {
+        amount++;
+        }
+
+    if ( iBrandImage )
+        {
+        amount++;
+        }
+    
+    if ( iBigCallIndicator )
+        {
+        amount++;
+        }
+
+    return amount;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTwoLined::ComponentControl
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CBubbleOutlookTwoLined::ComponentControl(TInt aIndex) const
+    {
+  
+    TInt amount = -1;
+    
+    if ( iNumberType )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iNumberType->Control();
+        }
+
+    if ( iSmallCallIndication )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iSmallCallIndication->Control();
+        }
+
+    if ( iTypeIndication1 )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iTypeIndication1;
+        }
+
+    if ( iTypeIndication2 )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iTypeIndication2;
+        }
+
+    if ( iCyphOffImage )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iCyphOffImage;
+        }
+
+    if ( iTextLine1 )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iTextLine1;
+        }
+
+    if ( iTextLine2 )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iTextLine2;
+        }
+
+    if ( iTimerCost )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iTimerCost;
+        }
+
+    if ( iBrandImage )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iBrandImage->Control();
+        }
+
+    if ( iBigCallIndicator )
+        {
+        amount++;
+        }
+
+    if ( aIndex == amount )
+        {
+        return iBigCallIndicator->Control();
+        }
+    
+    return NULL;
+
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTwoLined::Draw
+// 
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookTwoLined::Draw( const TRect& /*aRect*/ ) const
+    {
+    // Check that proper call header is set
+    
+    if ( iHeader == NULL ) 
+        { 
+        return; 
+        }
+    
+    if ( !iHeader->IsUsed( ) ) 
+        { 
+        return; 
+        }
+    
+    if ( iHeader->IsInConference( ) ) 
+        { 
+        return; 
+        }
+    
+    // Set texts to fit.
+    switch (iTextLineNumber)
+        {
+        case 0:
+            BubbleUtils::ClipToLabel( 
+                iFullText1 , iTextLine1 , iText1ClipDirection );
+            BubbleUtils::AddTextToEikLabel( iTextLine2 , KNullDesC );
+            break;
+        case 1:
+            BubbleUtils::SetTextInLabel( 
+                iFullText1 , iTextLine1 , iText1ClipDirection );
+            BubbleUtils::ClipToLabel( 
+                iFullText2 , iTextLine2 , iText2ClipDirection );
+            break;
+        case 2:
+            BubbleUtils::ClipToLabel( 
+                iFullText1 , iTextLine1 , iText1ClipDirection );
+            BubbleUtils::SetTextInLabel( 
+                iFullText2 , iTextLine2 , iText2ClipDirection );
+            break;
+        default:
+            BubbleUtils::AddTextToEikLabel( iTextLine1 , KNullDesC );
+            BubbleUtils::AddTextToEikLabel( iTextLine2 , KNullDesC );
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//CBubbleOutlookTwoLined::DrawTimerCostNow
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookTwoLined::DrawTimerCostNow()
+    {
+    if ( iHeader == NULL || iTimerCost == NULL ) 
+        {
+        return;
+        }
+
+    if ( iHeader->CallState() != CBubbleManager::EActive  
+        || iTimerCost->Text()->Compare( iHeader->TimerCost() ) == 0 ) 
+        {
+        return;
+        }
+
+    BubbleUtils::ClipToLabel( 
+        iHeader->TimerCost() , iTimerCost , CBubbleManager::ERight );
+    DrawLabelNow( iTimerCost);
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTwoLined::DrawCLINow
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookTwoLined::DrawCLINow()
+    {
+    if ( iHeader == NULL ) 
+        {
+        return;
+        }
+
+    CEikLabel* cli = NULL;
+
+    if ( iTextLineNumber == 1 )
+        {
+        iFullText2.Set( iHeader->CLI() );
+        cli = iTextLine2;
+        }
+    else
+        {
+        iFullText1.Set( iHeader->CLI() );
+        cli = iTextLine1;
+        }
+
+    CBubbleManager::TBubbleLabelString full = iHeader->CLI();
+    CBubbleManager::TPhoneClippingDirection clipDir = 
+        iHeader->CLIClipDirection();
+
+    // Set texts to fit.
+    if ( full.Length() > 0 )
+        {
+        BubbleUtils::ClipToLabel( full , cli , clipDir );
+        BubbleUtils::AddTextToEikLabel( cli , full );
+        }
+    else
+        {
+        BubbleUtils::AddTextToEikLabel( cli , KNullDesC );
+        }
+
+    // First clear the area and then draw the new text
+    DrawLabelNow( cli );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTwoLined::DrawBitmaps
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookTwoLined::DrawBitmaps( CBitmapContext& aGc ) const
+    {
+    // Check that proper call header is set
+    if ( iHeader == NULL ) 
+        { 
+        return; 
+        }
+
+    if ( !iHeader->IsUsed() ) 
+        { 
+        return; 
+        }
+
+    if ( iHeader->IsInConference() ) 
+        { 
+        return; 
+        }
+
+    if ( !iCallObjectDisplay )
+        {
+        DrawCall1Bitmaps( aGc );    
+        }
+    else
+        {
+        DrawCall2Bitmaps( aGc );    
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookTwoLined::HandleAnimationStartL
+//
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookTwoLined::HandleAnimationStartL() const
+    {
+    if ( iBigCallIndicator && iBigCallIndicator->ControlType() == 
+         CTelBubbleCustomElement::EBubbleAnimation )
+        {
+        CTelBubbleAnim* anim = 
+            static_cast<CTelBubbleAnim*> ( iBigCallIndicator->Control() );
+        anim->StartAnimationL();    
+        }
+    
+    if ( iBrandImage && iBrandImage->ControlType() == 
+         CTelBubbleCustomElement::EBubbleAnimation )
+        {
+        CTelBubbleAnim* anim = 
+            static_cast<CTelBubbleAnim*> ( iBrandImage->Control() );
+        anim->StartAnimationL();    
+        }
+    
+    if ( iSmallCallIndication && iSmallCallIndication->ControlType() == 
+         CTelBubbleCustomElement::EBubbleAnimation )
+        {
+        CTelBubbleAnim* anim = 
+            static_cast<CTelBubbleAnim*> ( iSmallCallIndication->Control() );
+        anim->StartAnimationL();    
+        }
+    
+    if( iNumberType && iNumberType->ControlType() == 
+         CTelBubbleCustomElement::EBubbleAnimation )
+        {
+        CTelBubbleAnim* anim = 
+            static_cast<CTelBubbleAnim*> ( iNumberType->Control() );
+        anim->StartAnimationL();    
+        }
+
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlookTwoLined::DrawCallHeaderText
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookTwoLined::DrawCallHeaderText()
+    {
+    if ( iHeader == NULL || iTextLine1 == NULL ) 
+        {
+        return;
+        }
+
+    if ( iHeader->CallState() != CBubbleManager::EOutgoing )
+        {
+        return;
+        }
+    
+    CEikLabel* label = NULL;
+    iFullText1.Set( iHeader->Text() );
+    label = iTextLine1;
+
+    CBubbleManager::TPhoneClippingDirection textDir = 
+        iHeader->TextClipDirection();
+
+    BubbleUtils::ClipToLabel( iHeader->Text(), label, textDir );
+    DrawLabelNow( label );
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlookTwoLined::DrawCall1Bitmaps
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookTwoLined::DrawCall1Bitmaps( CBitmapContext& aGc ) const
+    {
+    // Now starts actual drawing. 
+    aGc.SetBrushColor( AKN_LAF_COLOR( BubbleLayout::LayoutColourWhite() ) );
+
+    if ( !BubbleUtils::DrawMaskedImage( aGc , iBubble ) )
+        {
+        BubbleUtils::DrawBackgroundRect( aGc, Rect() );
+        }
+    
+
+    // If it's a conference bubble, don't draw a thumbnail
+    if ( iHeader->IsConference( ) ) 
+        {
+        return;
+        }
+
+    // if it's a arriving call on line 2 -> don't show TN
+    if ( iCallObjectDisplay || !iTnImage || !( iTnImage->Bitmap( ) != NULL 
+         && ( !( ( iHeader->CallState() == CBubbleManager::EIncoming
+                || iHeader->CallState() == CBubbleManager::EWaiting )
+         && iHeader->CallFlags()&CBubbleManager::ELine2 ) ) ) )
+        {
+        return;
+        }
+
+    // checks if image needs clipping and draws possible thumbnail image.
+    if ( iTnImage->Bitmap() != NULL )
+        {
+        // Draw shadow
+        aGc.SetPenColor( iTnImageShadow.Color() );
+        aGc.DrawRect ( iTnImageShadow.Rect() );
+        aGc.BitBlt( iTnImage->Rect().iTl , iHeader->TnIconBitmap() );
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+//  CBubbleOutlookTwoLined::DrawCall2Bitmaps
+// ---------------------------------------------------------------------------
+//        
+void CBubbleOutlookTwoLined::DrawCall2Bitmaps( CBitmapContext& aGc ) const
+    {
+    if ( iBubble->Bitmap() )
+        {
+        BubbleUtils::DrawMaskedImage( aGc , iBubble );    
+        }
+    else
+        {
+        // Draw bubble frame
+        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        if ( !AknsDrawUtils::DrawFrame( skin,
+                                        (CWindowGc&) aGc,  
+                                        iOuterRect,
+                                        iInnerRect,
+                                        iFrameId,
+                                        KAknsIIDDefault ) )
+            {
+            BubbleUtils::DrawBackgroundRect( aGc, Rect() );
+            }        
+        }            
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookVideo.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,307 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 outlook video ringtone.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleManager.h" //for enumerations
+#include    "BMBubbleOutlookVideo.h"
+#include    "BMBubbleImageManager.h"
+#include    "BMResourceManager.h"
+#include    "BMBubbleHeader.h"
+#include    "BMUtils.h"
+#include    "BMLayout3.h"
+#include    "BMVideoController.h"
+#include    "telbubblecustomelement.h"
+
+#include    <eiklabel.h> 
+#include    <eikimage.h>
+#include    <eikenv.h>
+#include    <AknsUtils.h>
+#include    <AknsDrawUtils.h>
+#include    <AknLayout2ScalableDef.h>
+#include    <layoutmetadata.cdl.h>
+
+
+// ========================= MEMBER FUNCTIONS ================================
+
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookVideo
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookVideo::CBubbleOutlookVideo( CBubbleManager& aBubbleManager )
+: CBubbleOutlookTwoLined( aBubbleManager )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookVideo::ConstructL()
+    { 
+    CBubbleOutlookTwoLined::ConstructL();
+    }
+
+// ---------------------------------------------------------------------------
+// ~CBubbleOutlookVideo
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookVideo::~CBubbleOutlookVideo()
+    {
+    Reset();
+    }
+
+// ---------------------------------------------------------------------------
+// ReadBubbleHeader
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookVideo::ReadBubbleHeader( CBubbleHeader& aHeader )
+    {
+    iHeader = &aHeader;
+    
+    iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );        
+    
+    CBubbleOutlookTwoLined::ReadBubbleHeader( aHeader );
+    }
+
+// ---------------------------------------------------------------------------
+// SizeChanged
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookVideo::SizeChanged()
+    {
+    if( !iHeader )
+        {
+        return;
+        }
+        
+    const TRect rect( Rect() );
+    
+    // Layout labels
+    BubbleUtils::LayoutLabel( 
+        iTextLine1, 
+        rect, 
+        BubbleLayout3::popup_call3_audio_in_window_text_line_1(1));    
+            
+    BubbleUtils::LayoutLabel( 
+        iTextLine2,
+        rect, 
+        BubbleLayout3::popup_call3_audio_in_window_text_line_2(1));
+
+    // Call indicator
+    BubbleUtils::LayoutCustomElement(
+        iBigCallIndicator, 
+        rect, 
+        BubbleLayout3::popup_call3_audio_in_window_call_indication(1) );
+
+    // Layout number type icon
+    BubbleUtils::LayoutCustomElement( 
+        iNumberType, 
+        rect, 
+        BubbleLayout3::popup_call3_audio_in_window_numbertype_indication(1));   
+
+    // Layout cyphering indicator
+    BubbleUtils::LayoutControl(
+        iCyphOffImage, 
+        rect, 
+        BubbleLayout3::popup_call3_audio_in_window_cipheringoff_indication(1));
+        
+    // Layout and prepare frame
+    TAknLayoutRect bubbleRect;
+    bubbleRect.LayoutRect( 
+        rect, 
+        BubbleLayout3::popup_call3_audio_in_pane(1));
+    
+    if ( Layout_Meta_Data::IsMirrored() )
+        {
+        TAknLayoutRect bubbleTopRight;        
+        bubbleTopRight.LayoutRect( 
+            bubbleRect.Rect(), 
+            BubbleLayout3::popup_call3_audio_in_window_fr_corner_topright());
+            
+        TAknLayoutRect bubbleBottomLeft;        
+        bubbleBottomLeft.LayoutRect( 
+            bubbleRect.Rect(), 
+            BubbleLayout3::popup_call3_audio_in_window_fr_corner_bottomleft());        
+        
+        iOuterRect = TRect( bubbleTopRight.Rect().iTl, 
+                                 bubbleBottomLeft.Rect().iBr );
+        iInnerRect = TRect( bubbleTopRight.Rect().iBr, 
+                                 bubbleBottomLeft.Rect().iTl );        
+        }
+    else
+        {
+        TAknLayoutRect bubbleTopLeft;        
+        bubbleTopLeft.LayoutRect( 
+            bubbleRect.Rect(), 
+            BubbleLayout3::popup_call3_audio_in_window_fr_corner_topleft());
+            
+        TAknLayoutRect bubbleBottomRight;        
+        bubbleBottomRight.LayoutRect( 
+            bubbleRect.Rect(), 
+            BubbleLayout3::popup_call3_audio_in_window_fr_corner_bottomright());        
+        
+        iOuterRect = TRect( bubbleTopLeft.Rect().iTl, 
+                                 bubbleBottomRight.Rect().iBr );
+        iInnerRect = TRect( bubbleTopLeft.Rect().iBr, 
+                                 bubbleBottomRight.Rect().iTl );        
+        }        
+                    
+
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    iFrameId = ( callState == CBubbleManager::EAlertToDisconnected ) ?
+                                      KAknsIIDQsnFrCall3RectDisconn : 
+                                      KAknsIIDQsnFrCall3Rect;
+    AknsDrawUtils::PrepareFrame( skin,
+                                 iOuterRect,
+                                 iInnerRect,
+                                 iFrameId,
+                                 KAknsIIDDefault );
+                                 
+    // Pass video layouts to video controller.
+    LayoutVideoPanes( rect );
+    iBubbleManager.VideoController().SetVideoPaneBackgroundFrame(
+        iFrameId, iOuterRect, iInnerRect );                                   
+                                 
+    // Layout rectangle for separator line
+    TAknLayoutRect lineRect;
+    lineRect.LayoutRect( rect, 
+        BubbleLayout3::popup_call3_audio_in_window_separator_line( 0 )); 
+    iLineRect = lineRect.Rect();        
+    }
+
+// ---------------------------------------------------------------------------
+// PositionChanged
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookVideo::PositionChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// DrawBitmaps
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookVideo::DrawBitmaps( CBitmapContext& aGc ) const
+    {
+    // Check that proper call header is set
+    if ( iHeader == NULL ) 
+        { 
+        return; 
+        }
+
+    if ( !iHeader->IsUsed() ) 
+        { 
+        return; 
+        }
+
+    if ( iHeader->IsInConference() ) 
+        { 
+        return; 
+        }
+
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    if ( iBubble->Bitmap() )
+        {
+        BubbleUtils::DrawMaskedImage( aGc , iBubble );    
+        }
+    else
+        {
+        // Draw bubble frame
+        if ( !AknsDrawUtils::DrawFrame( skin,
+                                        (CWindowGc&) aGc,  
+                                        iOuterRect,
+                                        iInnerRect,
+                                        iFrameId,
+                                        KAknsIIDDefault ) )
+            {
+            BubbleUtils::DrawBackgroundRect( aGc, Rect() );
+            }        
+        }
+        
+    CFbsBitmap* lineBmp = NULL;
+    CFbsBitmap* lineBmpMask = NULL;
+    AknsUtils::GetCachedMaskedBitmap( skin,
+                                      KAknsIIDQgnGrafLineSecondaryHorizontal, 
+                                      lineBmp, 
+                                      lineBmpMask);
+    if ( lineBmp )
+        {
+        AknIconUtils::SetSize( lineBmp, 
+                               iLineRect.Size(), 
+                               EAspectRatioNotPreserved);
+        if ( lineBmpMask )
+            {
+            AknIconUtils::SetSize( lineBmpMask, iLineRect.Size(), 
+                                   EAspectRatioNotPreserved);
+            
+            aGc.BitBltMasked( iLineRect.iTl, lineBmp, TRect( TPoint(0,0), 
+                             lineBmp->SizeInPixels() ),
+                             lineBmpMask, EFalse);
+            }
+        else
+            {
+            aGc.BitBlt( iLineRect.iTl, lineBmp );
+            }
+        }                 
+    }    
+
+// ---------------------------------------------------------------------------
+// LayoutVideoPanes
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookVideo::LayoutVideoPanes( const TRect& aParentRect )
+    {
+     // Qcif video pane         
+    TAknLayoutRect qcifVideoPane;
+    qcifVideoPane.LayoutRect( 
+        aParentRect, 
+        BubbleLayout3::call3_video_qcif_pane(0) );
+
+    // Qcif uncrop pane         
+    TAknLayoutRect qcifUncropPane;
+    qcifUncropPane.LayoutRect( 
+        aParentRect, 
+        BubbleLayout3::call3_video_qcif_uncrop_pane(0) );
+        
+    // Subqcif video pane         
+    TAknLayoutRect subQcifVideoPane;
+    subQcifVideoPane.LayoutRect( 
+        aParentRect, 
+        BubbleLayout3::call3_video_subqcif_pane(0) );
+
+    // Subqcif uncrop pane         
+    TAknLayoutRect subQcifUncropPane;
+    subQcifUncropPane.LayoutRect( 
+        aParentRect, 
+        BubbleLayout3::call3_video_subqcif_uncrop_pane(0) );
+        
+    // Update video rects to video controller
+    iBubbleManager.VideoController().SetQcifVideoPaneRects(
+         qcifVideoPane.Rect(),
+         qcifUncropPane.Rect() );
+         
+    iBubbleManager.VideoController().SetSubQcifVideoPaneRects(
+         subQcifVideoPane.Rect(),
+         subQcifUncropPane.Rect() );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookVideoCnap.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,311 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 outlook video ringtone.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleManager.h" //for enumerations
+#include    "BMBubbleOutlookVideoCnap.h"
+#include    "BMBubbleImageManager.h"
+#include    "BMResourceManager.h"
+#include    "BMBubbleHeader.h"
+#include    "BMUtils.h"
+#include    "BMLayout3.h"
+#include    "BMVideoController.h"
+#include    "telbubblecustomelement.h"
+
+#include    <eiklabel.h> 
+#include    <eikimage.h>
+#include    <eikenv.h>
+#include    <AknsUtils.h>
+#include    <AknsDrawUtils.h>
+#include    <AknLayout2ScalableDef.h>
+#include    <layoutmetadata.cdl.h>
+
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CBubbleOutlookVideoCnap
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookVideoCnap::CBubbleOutlookVideoCnap( 
+    CBubbleManager& aBubbleManager ) : 
+    CBubbleOutlookThreeLined( aBubbleManager )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookVideoCnap::ConstructL()
+    { 
+    CBubbleOutlookThreeLined::ConstructL();
+    }
+
+// ---------------------------------------------------------------------------
+// ~CBubbleOutlookVideoCnap
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlookVideoCnap::~CBubbleOutlookVideoCnap()
+    {
+    Reset();
+    }
+
+// ---------------------------------------------------------------------------
+// ReadBubbleHeader
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookVideoCnap::ReadBubbleHeader( CBubbleHeader& aHeader )
+    {
+    iHeader = &aHeader;
+    
+    iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );        
+    
+    CBubbleOutlookThreeLined::ReadBubbleHeader( aHeader );
+    }
+
+// ---------------------------------------------------------------------------
+// SizeChanged
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookVideoCnap::SizeChanged()
+    {
+    if( !iHeader )
+        {
+        return;
+        }
+        
+    const TRect rect( Rect() );
+    
+    // Layout labels
+    BubbleUtils::LayoutLabel( 
+        iTextLine1, 
+        rect, 
+        BubbleLayout3::popup_call3_audio_in_window_text_line_1(2));    
+            
+    BubbleUtils::LayoutLabel( 
+        iTextLine2,
+        rect, 
+        BubbleLayout3::popup_call3_audio_in_window_text_line_2(2));
+
+    BubbleUtils::LayoutLabel( 
+        iTextLine3,
+        rect, 
+        BubbleLayout3::popup_call3_audio_in_window_text_line_3(0));                
+
+    // Call indicator
+    BubbleUtils::LayoutCustomElement(
+        iBigCallIndicator, 
+        rect, 
+        BubbleLayout3::popup_call3_audio_in_window_call_indication(2) );
+    
+    // Layout number type icon
+    BubbleUtils::LayoutCustomElement( 
+        iNumberType, 
+        rect, 
+        BubbleLayout3::popup_call3_audio_in_window_numbertype_indication(2));   
+
+    // Layout cyphering indicator
+    BubbleUtils::LayoutControl(
+        iCyphOffImage, 
+        rect, 
+        BubbleLayout3::popup_call3_audio_in_window_cipheringoff_indication(2));      
+        
+    // Layout and prepare frame
+    TAknLayoutRect bubbleRect;
+    bubbleRect.LayoutRect( 
+        rect, 
+        BubbleLayout3::popup_call3_audio_in_pane(1));
+    
+    if ( Layout_Meta_Data::IsMirrored() )
+        {
+        TAknLayoutRect bubbleTopRight;        
+        bubbleTopRight.LayoutRect( 
+            bubbleRect.Rect(), 
+            BubbleLayout3::popup_call3_audio_in_window_fr_corner_topright());
+            
+        TAknLayoutRect bubbleBottomLeft;        
+        bubbleBottomLeft.LayoutRect( 
+            bubbleRect.Rect(), 
+            BubbleLayout3::popup_call3_audio_in_window_fr_corner_bottomleft());        
+        
+        iOuterRect = TRect( bubbleTopRight.Rect().iTl, 
+                                 bubbleBottomLeft.Rect().iBr );
+        iInnerRect = TRect( bubbleTopRight.Rect().iBr, 
+                                 bubbleBottomLeft.Rect().iTl );        
+        }
+    else
+        {
+        TAknLayoutRect bubbleTopLeft;        
+        bubbleTopLeft.LayoutRect( 
+            bubbleRect.Rect(), 
+            BubbleLayout3::popup_call3_audio_in_window_fr_corner_topleft());
+            
+        TAknLayoutRect bubbleBottomRight;        
+        bubbleBottomRight.LayoutRect( 
+            bubbleRect.Rect(), 
+            BubbleLayout3::popup_call3_audio_in_window_fr_corner_bottomright());        
+        
+        iOuterRect = TRect( bubbleTopLeft.Rect().iTl, 
+                                 bubbleBottomRight.Rect().iBr );
+        iInnerRect = TRect( bubbleTopLeft.Rect().iBr, 
+                                 bubbleBottomRight.Rect().iTl );        
+        }        
+                    
+
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    CBubbleManager::TPhoneCallState callState = iHeader->CallState();
+    iFrameId = ( callState == CBubbleManager::EAlertToDisconnected ) ?
+                                      KAknsIIDQsnFrCall3RectDisconn : 
+                                      KAknsIIDQsnFrCall3Rect;
+    AknsDrawUtils::PrepareFrame( skin,
+                                 iOuterRect,
+                                 iInnerRect,
+                                 iFrameId,
+                                 KAknsIIDDefault );
+
+    // Pass video layouts to video controller.
+    LayoutVideoPanes( rect );
+    iBubbleManager.VideoController().SetVideoPaneBackgroundFrame(
+        iFrameId, iOuterRect, iInnerRect );
+                                 
+    // Layout rectangle for separator line
+    TAknLayoutRect lineRect;
+    lineRect.LayoutRect( rect, 
+        BubbleLayout3::popup_call3_audio_in_window_separator_line( 2 )); 
+    iLineRect = lineRect.Rect();        
+    }
+
+// ---------------------------------------------------------------------------
+// PositionChanged
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookVideoCnap::PositionChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    }
+    
+// ---------------------------------------------------------------------------
+// DrawBitmaps
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookVideoCnap::DrawBitmaps( CBitmapContext& aGc ) const
+    {
+    // Check that proper call header is set
+    if ( iHeader == NULL ) 
+        { 
+        return; 
+        }
+
+    if ( !iHeader->IsUsed() ) 
+        { 
+        return; 
+        }
+
+    if ( iHeader->IsInConference() ) 
+        { 
+        return; 
+        }
+
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    if ( iBubble->Bitmap() )
+        {
+        BubbleUtils::DrawMaskedImage( aGc , iBubble );    
+        }
+    else
+        {
+        // Draw bubble frame
+        if ( !AknsDrawUtils::DrawFrame( skin,
+                                        (CWindowGc&) aGc,  
+                                        iOuterRect,
+                                        iInnerRect,
+                                        iFrameId,
+                                        KAknsIIDDefault ) )
+            {
+            BubbleUtils::DrawBackgroundRect( aGc, Rect() );
+            }        
+        }
+        
+    CFbsBitmap* lineBmp = NULL;
+    CFbsBitmap* lineBmpMask = NULL;
+    AknsUtils::GetCachedMaskedBitmap( skin,
+                                      KAknsIIDQgnGrafLineSecondaryHorizontal, 
+                                      lineBmp, 
+                                      lineBmpMask);
+    if ( lineBmp )
+        {
+        AknIconUtils::SetSize( lineBmp, 
+                               iLineRect.Size(), 
+                               EAspectRatioNotPreserved);
+        if ( lineBmpMask )
+            {
+            AknIconUtils::SetSize( lineBmpMask, iLineRect.Size(), 
+                                   EAspectRatioNotPreserved);
+            
+            aGc.BitBltMasked( iLineRect.iTl, lineBmp, TRect( TPoint(0,0), 
+                             lineBmp->SizeInPixels() ),
+                             lineBmpMask, EFalse);
+            }
+        else
+            {
+            aGc.BitBlt( iLineRect.iTl, lineBmp );
+            }
+        }                 
+    }
+    
+// ---------------------------------------------------------------------------
+// LayoutVideoPanes
+// ---------------------------------------------------------------------------
+//
+void CBubbleOutlookVideoCnap::LayoutVideoPanes( const TRect& aParentRect )
+    {
+     // Qcif video pane         
+    TAknLayoutRect qcifVideoPane;
+    qcifVideoPane.LayoutRect( 
+        aParentRect, 
+        BubbleLayout3::call3_video_qcif_pane(2) );
+
+    // Qcif uncrop pane         
+    TAknLayoutRect qcifUncropPane;
+    qcifUncropPane.LayoutRect( 
+        aParentRect, 
+        BubbleLayout3::call3_video_qcif_uncrop_pane(2) );
+        
+    // Subqcif video pane         
+    TAknLayoutRect subQcifVideoPane;
+    subQcifVideoPane.LayoutRect( 
+        aParentRect, 
+        BubbleLayout3::call3_video_subqcif_pane(2) );
+
+    // Subqcif uncrop pane         
+    TAknLayoutRect subQcifUncropPane;
+    subQcifUncropPane.LayoutRect( 
+        aParentRect, 
+        BubbleLayout3::call3_video_subqcif_uncrop_pane(2) );
+        
+    // Update video rects to video controller
+    iBubbleManager.VideoController().SetQcifVideoPaneRects(
+         qcifVideoPane.Rect(),
+         qcifUncropPane.Rect() );
+         
+    iBubbleManager.VideoController().SetSubQcifVideoPaneRects(
+         subQcifVideoPane.Rect(),
+         subQcifUncropPane.Rect() );    
+    }            
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubblePlace.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,431 @@
+/*
+* 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:  Header place on the screen.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleManager.h"  
+#include    "BMBubblePlace.h"
+#include    "BMBubbleOutlookBottom.h"
+#include    "BMBubbleOutlookMiddle.h"
+#include    "BMBubbleOutlookBottomRight.h"
+#include    "BMBubbleOutlook.h"
+#include    "BMBubbleOutlookTopLeft.h"
+#include    "BMBubbleOutlookTopRight.h"
+#include    "BMBubbleOutlookHide.h"
+#include    "BMBubbleOutlookConference.h"
+#include    "BMPanic.h"
+
+#include    "BMBubbleOutlookBottomCnap.h"
+#include    "BMBubbleOutlookMiddleCnap.h"
+#include    "BMBubbleOutlookBottomText.h"
+#include    "BMBubbleOutlookBottomImage.h"
+#include    "BMBubbleOutlookVideo.h"
+#include    "BMBubbleOutlookVideoCnap.h"
+#include    "BMBubbleOutlookBottomRiCnap.h"
+#include    "BMBubbleOutlookBottomImCnap.h"
+
+#include    <AknsUtils.h>
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CBubblePlace::ConstructL
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubblePlace::ConstructL( 
+                              const TPhoneBubblePlace& aBubblePlace,
+                              CBubbleManager& aBubbleManager )
+    {
+    
+    iBubblePlace = aBubblePlace;
+    iBubbleOutlook = NULL;
+    iIsUsed  = EFalse; // By default.
+    
+    // Create corresponding BubbleOutlook:
+    switch( iBubblePlace )
+        {
+        case EBottom:
+            {
+            CBubbleOutlookBottom* BOBottom = 
+                new( ELeave ) CBubbleOutlookBottom( aBubbleManager );
+            CleanupStack::PushL( BOBottom );
+            BOBottom->SetContainerWindowL( *this );
+            BOBottom->ConstructL();
+            CleanupStack::Pop();
+            iBubbleOutlook = BOBottom;
+            }
+            break;
+        case EBottomRightActive:
+        case EBottomRightHeld:
+            {
+            CBubbleOutlookBottomRight* BOBottomR = 
+                new( ELeave ) CBubbleOutlookBottomRight( aBubbleManager );
+            CleanupStack::PushL( BOBottomR );
+            BOBottomR->SetContainerWindowL( *this );
+            BOBottomR->ConstructL();
+            CleanupStack::Pop();
+            iBubbleOutlook = BOBottomR;
+            }
+            break;
+        case EMiddleActive:
+        case EMiddleHeld:
+            {
+            CBubbleOutlookMiddle* BOMiddle = 
+                new( ELeave ) CBubbleOutlookMiddle( aBubbleManager );
+            CleanupStack::PushL( BOMiddle );
+            BOMiddle->SetContainerWindowL( *this );
+            BOMiddle->ConstructL();
+            CleanupStack::Pop();
+            iBubbleOutlook = BOMiddle;
+            }
+            break;
+        case ETopLeft:
+            {
+            CBubbleOutlookTopLeft* BOTL = 
+                new( ELeave ) CBubbleOutlookTopLeft( aBubbleManager );
+            CleanupStack::PushL( BOTL );
+            BOTL->SetContainerWindowL( *this );
+            BOTL->ConstructL();
+            CleanupStack::Pop();
+            iBubbleOutlook = BOTL;
+            }
+            break;
+        case ETopRight:
+            {
+            CBubbleOutlookTopRight* BOTR = 
+                new( ELeave ) CBubbleOutlookTopRight( aBubbleManager );
+            CleanupStack::PushL( BOTR );
+            BOTR->SetContainerWindowL( *this );
+            BOTR->ConstructL();
+            CleanupStack::Pop();
+            iBubbleOutlook = BOTR;
+            }
+            break;
+        case EHide:
+            {
+            CBubbleOutlookHide* BOH = 
+                new( ELeave ) CBubbleOutlookHide( aBubbleManager );
+            CleanupStack::PushL( BOH );
+            BOH->SetContainerWindowL( *this );
+            BOH->ConstructL();
+            CleanupStack::Pop();
+            iBubbleOutlook = BOH;
+            }
+            break;
+        case E2InConf:
+            {
+            CBubbleOutlookConference* BOConf = 
+                new( ELeave ) CBubbleOutlookConference( aBubbleManager );
+            CleanupStack::PushL( BOConf );
+            BOConf->SetContainerWindowL( *this );
+            BOConf->ConstructL( 2 );
+            CleanupStack::Pop();
+            iBubbleOutlook = BOConf;
+            }
+            break;
+        case E3InConf:
+            {
+            CBubbleOutlookConference* BOConf = 
+                new( ELeave ) CBubbleOutlookConference( aBubbleManager );
+            CleanupStack::PushL( BOConf );
+            BOConf->SetContainerWindowL( *this );
+            BOConf->ConstructL( 3 );
+            CleanupStack::Pop();
+            iBubbleOutlook = BOConf;
+            }
+            break;
+        case E4InConf:
+            {
+            CBubbleOutlookConference* BOConf = 
+                new( ELeave ) CBubbleOutlookConference( aBubbleManager );
+            CleanupStack::PushL( BOConf );
+            BOConf->SetContainerWindowL( *this );
+            BOConf->ConstructL( 4 );
+            CleanupStack::Pop();
+            iBubbleOutlook = BOConf;
+            }
+            break;
+        case E5InConf:
+            {
+            CBubbleOutlookConference* BOConf = 
+                new( ELeave ) CBubbleOutlookConference( aBubbleManager );
+            CleanupStack::PushL( BOConf );
+            BOConf->SetContainerWindowL( *this );
+            BOConf->ConstructL(  5 );
+            CleanupStack::Pop();
+            iBubbleOutlook = BOConf;
+            }
+            break;
+        case EBottomText:
+            {
+            CBubbleOutlookBottomText* BOBottomText = 
+                new( ELeave ) CBubbleOutlookBottomText( aBubbleManager );
+            CleanupStack::PushL( BOBottomText );
+            BOBottomText->SetContainerWindowL( *this );
+            BOBottomText->ConstructL();
+            CleanupStack::Pop();
+            iBubbleOutlook = BOBottomText;
+            }
+            break;
+        case EBottomImage:
+            {
+            CBubbleOutlookBottomImage* BOBottomImage = 
+                new( ELeave ) CBubbleOutlookBottomImage( aBubbleManager );
+            CleanupStack::PushL( BOBottomImage );
+            BOBottomImage->SetContainerWindowL( *this );
+            BOBottomImage->ConstructL();
+            CleanupStack::Pop();
+            iBubbleOutlook = BOBottomImage;
+            }
+            break;                        
+        case EVideo:
+            {
+            CBubbleOutlookVideo* BOVideo = 
+                new( ELeave ) CBubbleOutlookVideo( aBubbleManager );
+            CleanupStack::PushL( BOVideo );
+            BOVideo->SetContainerWindowL( *this );
+            BOVideo->ConstructL();
+            CleanupStack::Pop();
+            iBubbleOutlook = BOVideo;
+            }
+            break;                                    
+        case EBottomCnap:
+            {
+            CBubbleOutlookBottomCnap* BOBottomCnap = 
+                new( ELeave ) CBubbleOutlookBottomCnap( aBubbleManager );
+            CleanupStack::PushL( BOBottomCnap );
+            BOBottomCnap->SetContainerWindowL( *this );
+            BOBottomCnap->ConstructL();
+            CleanupStack::Pop();
+            iBubbleOutlook = BOBottomCnap;
+            }
+            break;
+        case EMiddleCnap:
+            {
+            CBubbleOutlookMiddleCnap* BOMiddleCnap = 
+                new( ELeave ) CBubbleOutlookMiddleCnap( aBubbleManager );
+            CleanupStack::PushL( BOMiddleCnap );
+            BOMiddleCnap->SetContainerWindowL( *this );
+            BOMiddleCnap->ConstructL();
+            CleanupStack::Pop();
+            iBubbleOutlook = BOMiddleCnap;
+            }
+            break;
+        case EVideoCnap:
+            {
+            CBubbleOutlookVideoCnap* BOVideoCnap = 
+                new( ELeave ) CBubbleOutlookVideoCnap( aBubbleManager );
+            CleanupStack::PushL( BOVideoCnap );
+            BOVideoCnap->SetContainerWindowL( *this );
+            BOVideoCnap->ConstructL();
+            CleanupStack::Pop();
+            iBubbleOutlook = BOVideoCnap;
+            }
+            break;
+        case EBottomRightCnap:
+            {
+            CBubbleOutlookBottomRightCnap* BOBottomRightCnap = 
+                new( ELeave ) CBubbleOutlookBottomRightCnap( aBubbleManager );
+            CleanupStack::PushL( BOBottomRightCnap );
+            BOBottomRightCnap->SetContainerWindowL( *this );
+            BOBottomRightCnap->ConstructL();
+            CleanupStack::Pop();
+            iBubbleOutlook = BOBottomRightCnap;
+            }
+            break;
+        case EBottomImageCnap:
+            {
+            CBubbleOutlookBottomImageCnap* BOBottomImageCnap = 
+                new( ELeave ) CBubbleOutlookBottomImageCnap( aBubbleManager );
+            CleanupStack::PushL( BOBottomImageCnap );
+            BOBottomImageCnap->SetContainerWindowL( *this );
+            BOBottomImageCnap->ConstructL();
+            CleanupStack::Pop();
+            iBubbleOutlook = BOBottomImageCnap;
+            }
+            break;
+        case EBottomRightActiveTouch:
+            {
+            CBubbleOutlookBottomRight* BOBottomR = 
+                new( ELeave ) CBubbleOutlookBottomRight( aBubbleManager );
+            CleanupStack::PushL( BOBottomR );
+            BOBottomR->SetContainerWindowL( *this );
+            BOBottomR->ConstructL();
+            CleanupStack::Pop();
+            iBubbleOutlook = BOBottomR;    
+            }
+            break;
+        case EBottomRightActiveCnapTouch:
+            {
+            CBubbleOutlookBottomRightCnap* BOBottomRightCnap = 
+                new( ELeave ) CBubbleOutlookBottomRightCnap( aBubbleManager );
+            CleanupStack::PushL( BOBottomRightCnap );
+            BOBottomRightCnap->SetContainerWindowL( *this );
+            BOBottomRightCnap->ConstructL();
+            CleanupStack::Pop();
+            iBubbleOutlook = BOBottomRightCnap;    
+            }
+            break;
+        case EMiddleHeldTouch:
+            {
+            CBubbleOutlookTopLeft* BOTL = 
+                new( ELeave ) CBubbleOutlookTopLeft( aBubbleManager );
+            CleanupStack::PushL( BOTL );
+            BOTL->SetContainerWindowL( *this );
+            BOTL->ConstructL();
+            CleanupStack::Pop();
+            iBubbleOutlook = BOTL;    
+            }
+            break;
+        default:
+            Panic( EBMPanicUnhandledSwitchCase );
+            break;
+        } 
+
+
+    iBubbleOutlook->SetParent( this );
+        
+    ActivateL();
+    }
+    
+// ---------------------------------------------------------------------------
+// CBubblePlace::~CBubblePlace
+// Destructor.
+//  
+// ---------------------------------------------------------------------------
+//
+CBubblePlace::~CBubblePlace()
+    {
+    AknsUtils::DeregisterControlPosition( this );
+    delete iBubbleOutlook;   
+    }
+
+// ---------------------------------------------------------------------------
+// CBubblePlace::SizeChanged
+// called by framwork when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubblePlace::SizeChanged()
+    {  
+    AknsUtils::RegisterControlPosition( this );
+    iBubbleOutlook->SetRect ( Rect() );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubblePlace::PositionChanged
+// ---------------------------------------------------------------------------
+//
+void CBubblePlace::PositionChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubblePlace::CountComponentControls
+//
+//  
+// ---------------------------------------------------------------------------
+//
+TInt CBubblePlace::CountComponentControls() const
+    { 
+    if ( iIsUsed )
+        {
+        return 1; // bubble outlook
+        }
+    return 0;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubblePlace::ComponentControl
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CBubblePlace::ComponentControl( TInt aIndex ) const
+    {
+    if ( !iIsUsed ) 
+        {
+        return NULL;
+        }
+    
+    switch ( aIndex )
+        {
+        case 0:
+            return iBubbleOutlook;
+        default:
+            return NULL;
+        }
+    }
+
+
+
+
+
+// ---------------------------------------------------------------------------
+// CBubblePlace::SetIsUsed
+//  
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubblePlace::SetIsUsed( const TBool& aIsUsed )
+    {
+    iIsUsed = aIsUsed;
+    if ( !iIsUsed )
+        {
+        iBubbleOutlook->Reset( );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubblePlace::IsUsed
+//  
+//  
+// ---------------------------------------------------------------------------
+//
+TBool CBubblePlace::IsUsed( ) const
+    {
+    return iIsUsed;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubblePlace::GetBubblePlace
+//  
+//  
+// ---------------------------------------------------------------------------
+//
+CBubblePlace::TPhoneBubblePlace CBubblePlace::GetBubblePlace( ) const
+    {
+    return iBubblePlace;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubblePlace::GetBubbleOutlook
+//  
+//  
+// ---------------------------------------------------------------------------
+//
+CBubbleOutlook& CBubblePlace::GetBubbleOutlook( ) const
+    {
+    return *iBubbleOutlook;
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleSkinBitmap.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,123 @@
+/*
+* 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:  Bubble skinned bitmap.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMBubbleSkinBitmap.h"
+#include    <fbs.h>
+
+// CONSTANTS
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CBubbleSkinBitmap::CBubbleSkinBitmap()
+// Default constructor
+// 
+// ---------------------------------------------------------------------------
+//
+CBubbleSkinBitmap::CBubbleSkinBitmap() /* : iItemId( KAknsIIDNone ) */
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleSkinBitmap::~CBubbleSkinBitmap()
+// Destructor
+// 
+// ---------------------------------------------------------------------------
+//
+CBubbleSkinBitmap::~CBubbleSkinBitmap()
+    {
+    delete iSkinnedBitmap;
+    delete iSkinnedMask;
+    }
+
+/*
+// ---------------------------------------------------------------------------
+// CBubbleSkinBitmap::SetSkinnedBitmap
+// ---------------------------------------------------------------------------
+//
+void CBubbleSkinBitmap::SetBitmapSkinItemID( const TAknsItemID& aItemID )
+    {
+    iItemId = aItemID;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleSkinBitmap::SetSkinnedBitmap
+// ---------------------------------------------------------------------------
+//
+TAknsItemID CBubbleSkinBitmap::BitmapSkinItemID() const
+    {
+    return iItemId;
+    }
+*/
+
+// ---------------------------------------------------------------------------
+// CBubbleSkinBitmap::SetSkinnedBitmap
+// ---------------------------------------------------------------------------
+//
+void CBubbleSkinBitmap::SetSkinnedBitmap( CFbsBitmap* aSkinnedBitmap )
+    {
+    iSkinnedBitmap = aSkinnedBitmap;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleSkinBitmap::SkinnedBitmap
+// ---------------------------------------------------------------------------
+//
+CFbsBitmap* CBubbleSkinBitmap::SkinnedBitmap() const
+    {
+    return iSkinnedBitmap;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleSkinBitmap::SetSkinnedMask
+// ---------------------------------------------------------------------------
+//
+void CBubbleSkinBitmap::SetSkinnedMask( CFbsBitmap* aSkinnedMask )
+    {
+    iSkinnedMask = aSkinnedMask;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleSkinBitmap::SkinnedBitmapMask
+// ---------------------------------------------------------------------------
+//
+CFbsBitmap* CBubbleSkinBitmap::SkinnedMask() const
+    {
+    return iSkinnedMask;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleSkinBitmap::SetBitmapIndex
+// ---------------------------------------------------------------------------
+//
+void CBubbleSkinBitmap::SetBitmapIndex( const TInt& aBitmapIndex )
+    {
+    iBitmapIndex = aBitmapIndex;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleSkinBitmap::BitmapIndex
+// ---------------------------------------------------------------------------
+//
+TInt CBubbleSkinBitmap::BitmapIndex() const
+    {
+    return iBitmapIndex;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleVideoContainer.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,166 @@
+/*
+* 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:  Video Ringing Tone / Video window (DSA)
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "BMBubbleVideoContainer.h"
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES  
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoContainer::CBubbleVideoContainer
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CBubbleVideoContainer::CBubbleVideoContainer( 
+    const CCoeControl* aParent )
+    : iParent( aParent )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoContainer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CBubbleVideoContainer::ConstructL( )
+    {
+    CreateWindowL( iParent );
+    Window().SetNonFading( ETrue );
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoContainer::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CBubbleVideoContainer* CBubbleVideoContainer::NewL(
+    const CCoeControl* aParent )
+    {
+    CBubbleVideoContainer* self = new( ELeave ) 
+        CBubbleVideoContainer( aParent );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    
+    return self;
+    }
+
+    
+// Destructor
+CBubbleVideoContainer::~CBubbleVideoContainer()
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoContainer::Draw
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CBubbleVideoContainer::Draw( const TRect& aRect ) const
+    {
+    if ( Window().DisplayMode() == EColor16MA )
+        {
+        CWindowGc& gc = SystemGc();
+        gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+  	    gc.SetBrushColor( TRgb::Color16MA( 0 ) ); // alpha 0x00 shows video
+  	    gc.Clear( aRect );
+        }
+    else if ( !iRedrawDisabled )
+        {
+        CWindowGc& gc = SystemGc();
+        // Draw background frame graphics
+        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        AknsDrawUtils::DrawFrame( skin,
+                                  gc,  
+                                  iFrameOuterRect,
+                                  iFrameInnerRect,
+                                  iFrameId,
+                                  KAknsIIDDefault );
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CBubbleVideoContainer::SizeChanged
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CBubbleVideoContainer::SizeChanged()
+    {
+    // NOP
+    } 
+    
+// -----------------------------------------------------------------------------
+// CBubbleVideoContainer::GetWindow
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+RWindow& CBubbleVideoContainer::GetWindow() const
+    {
+    return Window();
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoContainer::SetBackgroundFrame
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//    
+void CBubbleVideoContainer::SetBackgroundFrame( const TAknsItemID& aFrameId,
+                                                TRect& aOuterRect,
+                                                TRect& aInnerRect )
+    {
+    iFrameId = aFrameId;
+    iFrameOuterRect = aOuterRect;
+    iFrameInnerRect = aInnerRect;    
+    }
+    
+// -----------------------------------------------------------------------------
+// CBubbleVideoContainer::SetRedrawDisabled
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CBubbleVideoContainer::SetRedrawDisabled( TBool aDisabled )
+    {
+    iRedrawDisabled = aDisabled;    
+    }
+        
+    
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMCallHeader.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,124 @@
+/*
+* 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:  Call Header
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMCallHeader.h"
+
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CBubbleCallHeader::CBubbleCallHeader
+// Default constructor
+// 
+// ---------------------------------------------------------------------------
+//
+CBubbleCallHeader::CBubbleCallHeader()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleCallHeader::NewL
+// Symbian OS two phased constructor
+// 
+// ---------------------------------------------------------------------------
+//
+CBubbleCallHeader* CBubbleCallHeader::NewL( 
+                                 const CBubbleManager::TBubbleId& aBubbleId )
+    {
+    CBubbleCallHeader* self = new( ELeave )CBubbleCallHeader( );    
+    CleanupStack::PushL( self );
+    self->ConstructL( aBubbleId );
+    CleanupStack::Pop( );    // self
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleCallHeader::ConstructL
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallHeader::ConstructL( 
+    const CBubbleManager::TBubbleId& aBubbleId )
+    {
+    CBubbleHeader::ConstructL( aBubbleId ); // call to parent's ConstructL
+    Reset( );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallHeader::~CBubbleCallHeader
+// Destructor
+// 
+// ---------------------------------------------------------------------------
+//
+CBubbleCallHeader::~CBubbleCallHeader()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallHeader::IsUsed
+// 
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CBubbleCallHeader::IsUsed( ) const
+    {
+    return iIsUsed;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallHeader::SetIsUsed
+// 
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallHeader::SetIsUsed( const TBool& aIsUsed )
+    {
+    iIsUsed = aIsUsed;
+    if ( !iIsUsed )
+        {
+        Reset( );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallHeader::IsConference
+// 
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CBubbleCallHeader::IsConference() const
+    {
+    return EFalse; // This is for normal call header.
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallHeader::Reset
+//
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallHeader::Reset()
+    {
+    iIsUsed = EFalse;
+    ResetParent( ); // call to parent's reset
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMCallObjectManager.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,648 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Call object loading.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include	<akniconconfig.h>
+#include    <AknsUtils.h>
+#include    "BMCallObjectManager.h"
+#include    "BMUtils.h"
+#include    "BMCallObjectUtils.h"
+#include    "BMPanic.h"
+#include    "BMMediaReaderFactory.h"
+#include    "BMMediaReaderInterface.h"
+#include    "BMBubbleImageManager.h"
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+const TInt KBMBubbleIdNone = -2;
+const TInt KBMCallTextAlphaValue = 128;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CBubbleCallObjectManager::CBubbleCallObjectManager
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CBubbleCallObjectManager::CBubbleCallObjectManager( 
+    CBubbleManager& aBubbleManager ) : iBubbleManager( aBubbleManager )
+    {
+    }
+    
+// -----------------------------------------------------------------------------
+// CBubbleCallObjectManager::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CBubbleCallObjectManager::ConstructL()
+    {
+    iIdleProcessor = CIdle::NewL( CActive::EPriorityIdle );
+    iLoadingState = EBMLoaderReady;
+    iBubbleId = KBMBubbleIdNone; 
+    } 
+
+// -----------------------------------------------------------------------------
+// CBubbleCallObjectManager::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//    
+CBubbleCallObjectManager* CBubbleCallObjectManager::NewL( 
+    CBubbleManager& aBubbleManager )
+    {
+    CBubbleCallObjectManager* self = 
+        new( ELeave ) CBubbleCallObjectManager( aBubbleManager );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL( );
+    CleanupStack::Pop( self );
+
+    return self;    
+    }
+    
+// Destructor
+CBubbleCallObjectManager::~CBubbleCallObjectManager()
+    {
+    Reset();
+
+    if ( iIdleProcessor )
+        {
+        iIdleProcessor->Cancel();            
+        delete iIdleProcessor;
+        }
+    
+    delete iCallThemeImageIcon;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::Reset
+//
+// ---------------------------------------------------------------------------
+//    
+void CBubbleCallObjectManager::Reset()
+    {
+    iLoadingState = EBMLoaderReady;        
+    iBubbleId = KBMBubbleIdNone;
+    delete iMediaReader;
+    iMediaReader = NULL;
+    delete iCallText;
+    iCallText = NULL;
+    delete iCallImage;
+    iCallImage = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::LoadImageFromFile
+//
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallObjectManager::LoadImageFromFile(
+    const CBubbleManager::TBubbleId& aBubbleId,
+    const TDesC& aFileName,
+    const TImageLoadingParams& aParams )
+    {
+    if ( !aFileName.Length() )
+        {
+        return;            
+        }
+    
+    if ( iLoadingState == EBMSuspended )
+        {
+        delete iCallImage;
+        iCallImage = aFileName.Alloc();
+        iImageLoadParams = aParams;
+        iBubbleId = aBubbleId;
+        return; // wait for resume
+        }
+    
+    // queueing not supported, keep the existing
+    if ( iLoadingState == EBMLoaderReady )
+        {
+        TRAPD( err, ReadFromFileL( aFileName, 
+                                   aParams.iPreferredSize,
+                                   aParams.iTinyImageSize ) );
+        if ( err == KErrNone )
+            {
+            iLoadingState = EBMLoadingImage;
+            delete iCallImage;
+            iCallImage = aFileName.Alloc();
+            iImageLoadParams = aParams;
+            iBubbleId = aBubbleId;                                
+            }    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::ReadFromFileL
+//
+// ---------------------------------------------------------------------------
+//    
+void CBubbleCallObjectManager::ReadFromFileL(
+    const TDesC& aFileName,
+    const TSize& aPreferredImageSize,
+    const TSize& aTinyImageSize )
+    {
+    delete iMediaReader;
+    iMediaReader = NULL;
+    iMediaReader = BubbleMediaReaderFactory::CreateReaderL( aFileName );
+    
+    TSize sourceSize( iMediaReader->SourceSize() );
+    
+    TReal scaleFactor;
+    TRect clipRect;
+    TSize targetSize;
+    if ( BubbleCallObjectUtils::GetScaleFactorAndClipRect(
+             sourceSize,
+             aPreferredImageSize,
+             BubbleCallObjectUtils::EFillTarget,
+             scaleFactor,
+             clipRect ) &&
+         aTinyImageSize != TSize(0,0) )
+        {
+        // Tiny image
+        BubbleCallObjectUtils::GetScaleFactorAndClipRect(
+             sourceSize,
+             aTinyImageSize,
+             BubbleCallObjectUtils::EMaximumFit,
+             scaleFactor,
+             clipRect );
+        
+        targetSize = aTinyImageSize;           
+        }
+    else
+        {
+        targetSize = aPreferredImageSize;    
+        }        
+    
+    iMediaReader->StartReadingL( targetSize, 
+                                 scaleFactor, 
+                                 clipRect, 
+                                 this );    
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::LoadImageFromText
+//
+// ---------------------------------------------------------------------------
+//    
+void CBubbleCallObjectManager::LoadImageFromText(
+    const CBubbleManager::TBubbleId& aBubbleId,
+    const TDesC& aText,
+    const TImageLoadingParams& aParams )
+    {
+    if ( !aText.Length() )
+        {
+        return;            
+        }
+        
+    if ( iLoadingState == EBMSuspended )
+        {
+        delete iCallText;
+        iCallText = aText.Alloc();    
+        iImageLoadParams = aParams;
+        iBubbleId = aBubbleId;
+        return; // wait for resume
+        }
+    
+    // queueing not supported, keep the existing
+    if ( iLoadingState == EBMLoaderReady )    
+        {
+        delete iCallText;
+        iCallText = aText.Alloc();        
+        iBubbleId = aBubbleId;
+        iImageLoadParams = aParams;
+        TCallBack idleCallback( IdleProcessorCallback, this );
+        iIdleProcessor->Cancel();
+        iIdleProcessor->Start( idleCallback );
+        iLoadingState = EBMLoadingText;    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::CancelCallObjectLoading
+//
+// ---------------------------------------------------------------------------
+//    
+void CBubbleCallObjectManager::CancelCallObjectLoading( 
+    const CBubbleManager::TBubbleId& aBubbleId )
+    {
+    if ( iLoadingState != EBMLoaderReady &&
+         iBubbleId == aBubbleId )    
+        {
+        Reset();
+        iIdleProcessor->Cancel();
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::Suspend
+//
+// ---------------------------------------------------------------------------
+//    
+void CBubbleCallObjectManager::Suspend()
+    {
+    if ( iLoadingState != EBMLoaderReady )
+        {
+        // Cancel image/text reading
+        delete iMediaReader;
+        iMediaReader = NULL;
+        iIdleProcessor->Cancel();
+        }
+
+    // Set suspended state
+    iLoadingState = EBMSuspended;
+    }
+    
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::Resume
+//
+// ---------------------------------------------------------------------------
+//    
+TInt CBubbleCallObjectManager::Resume()
+    {
+    TInt err = KErrNone;
+    
+    if ( iLoadingState == EBMSuspended )
+        {
+        TRAP( err, DoResumeL() );            
+        }
+        
+    return err;        
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::DoResumeL
+//
+// ---------------------------------------------------------------------------
+//    
+void CBubbleCallObjectManager::DoResumeL()
+    {
+    if ( iCallImage )    
+        {
+        CBubbleManager::TPhoneCallState callState =
+                iBubbleManager.CallState( iBubbleId );
+        
+        if ( callState < CBubbleManager::EIncoming &&
+             iImageLoadParams.iThumbnailSize != TSize(0,0) )
+            {
+            // switch to incall image size
+            iImageLoadParams.iPreferredSize = 
+                iImageLoadParams.iThumbnailSize;
+            iImageLoadParams.iThumbnailSize = TSize(0,0);
+            iImageLoadParams.iTinyImageSize = TSize(0,0);                   
+            }
+        
+        ReadFromFileL( *iCallImage, 
+                       iImageLoadParams.iPreferredSize,
+                       iImageLoadParams.iTinyImageSize );
+        
+        iLoadingState = EBMLoadingImage;
+        delete iCallImage;
+        iCallImage = NULL;    
+        }
+    else if ( iCallText )        
+        {
+        TCallBack idleCallback( IdleProcessorCallback, this );
+        iIdleProcessor->Cancel();
+        iIdleProcessor->Start( idleCallback );
+        iLoadingState = EBMLoadingText;    
+        }
+    else
+        {
+        Reset();    
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::LoadCallThemeImage
+//
+// ---------------------------------------------------------------------------
+//            
+void CBubbleCallObjectManager::LoadCallThemeImage(
+    CBubbleImageManager& aImageManager,    
+    const TSize& aSize )
+    {
+    delete iCallThemeImageIcon;
+    iCallThemeImageIcon = NULL;
+    
+    TRAPD( err, AllocateCallThemeImageIconL( aImageManager ) );
+    if ( !err )
+        {
+        iCallThemeImageSize = aSize;
+        
+        if ( iLoadingState == EBMLoaderReady )    
+            {
+            TCallBack idleCallback( IdleProcessorCallback, this );
+            iIdleProcessor->Cancel();
+            iIdleProcessor->Start( idleCallback );
+            iLoadingState = EBMInitializingIcon;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::AllocateCallThemeImageIconL
+//
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallObjectManager::AllocateCallThemeImageIconL( 
+        CBubbleImageManager& aImageManager )
+    {
+    CEikImage* themeImage = new( ELeave ) CEikImage;
+    CleanupStack::PushL( themeImage );
+    aImageManager.SetBitmapToImage( themeImage,
+                                    EQgn_graf_call_image_1,
+                                    EQgn_graf_call_image_1_mask );
+
+    if ( themeImage->Bitmap() )
+        {
+        iCallThemeImageIcon = CGulIcon::NewL( 
+                    const_cast<CFbsBitmap*> (themeImage->Bitmap()), 
+                    const_cast<CFbsBitmap*> (themeImage->Mask()));
+        }
+    themeImage->SetPictureOwnedExternally( ETrue );
+    CleanupStack::PopAndDestroy( themeImage );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::ReleaseCallThemeImage
+//
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallObjectManager::ReleaseCallThemeImage()
+    {
+    delete iCallThemeImageIcon;
+    iCallThemeImageIcon = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::ResizeCallThemeImage
+//
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallObjectManager::ResizeCallThemeImage( const TSize& aSize )
+    {
+    iCallThemeImageSize = aSize;
+    AknIconUtils::SetSize( iCallThemeImageIcon->Bitmap(),
+                           iCallThemeImageSize,
+                           EAspectRatioPreservedSlice );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::CallThemeImageIcon
+//
+// ---------------------------------------------------------------------------
+//
+CGulIcon* CBubbleCallObjectManager::CallThemeImageIcon()
+    {
+    return iCallThemeImageIcon;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::IdleProcessorCallback
+//
+// ---------------------------------------------------------------------------
+//     
+TInt CBubbleCallObjectManager::IdleProcessorCallback( TAny* aThis )
+    {
+    __ASSERT_ALWAYS( aThis, 
+                     Panic( EBMPanicCallObjectManager ) );
+                     
+    CBubbleCallObjectManager* self = 
+            static_cast<CBubbleCallObjectManager*>( aThis );
+    
+    TLoadingState state = self->iLoadingState;
+    
+    if ( state == EBMLoadingText )
+        {
+        TRAP_IGNORE( self->DoLoadImageInIdleL() );    
+        }
+    else if ( state == EBMInitializingIcon )
+        {
+        self->DoInitializeIcons();
+        }
+    else if ( state == EBMDeleting )        
+        {
+        self->DoDeleteReaderInIdle();
+        }
+    
+    return KErrNone;        
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::DoLoadImageInIdleL
+//
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallObjectManager::DoLoadImageInIdleL()
+    {
+    if ( iLoadingState == EBMLoadingText && iCallText )
+        {
+        AknIconConfig::TPreferredDisplayMode mode;
+        AknIconConfig::PreferredDisplayMode( mode, 
+                                             AknIconConfig::EImageTypeIcon);
+        
+        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        TRgb skinColor;
+        User::LeaveIfError( AknsUtils::GetCachedColor( 
+                            skin, 
+                            skinColor, 
+                            KAknsIIDQsnTextColors,
+                            EAknsCIQsnTextColorsCG51 ) );            
+        
+        CFbsBitmap* bitmap = NULL;
+        CFbsBitmap* mask = NULL;
+        
+        BubbleCallObjectUtils::CreateImageBitmapsFromTextLC( 
+            *iCallText, 
+            iBubbleManager.Rect(),
+            iImageLoadParams.iPreferredSize,
+            skinColor,  // text color
+            KBMCallTextAlphaValue, // semitransparent
+            mode.iBitmapMode,
+            bitmap,
+            mask );
+        CleanupStack::Pop(2); // bitmap, mask
+                
+        iBubbleManager.StartChanges();
+        iBubbleManager.SetCallObjectImage( iBubbleId,
+                                           bitmap,
+                                           mask,
+                                           ETrue );
+        iBubbleManager.EndChanges();
+            
+        delete iCallText;
+        iCallText = NULL;                
+        }
+    
+    iLoadingState = EBMLoaderReady;        
+    iBubbleId = KBMBubbleIdNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::DoDeleteReaderInIdle
+//
+// ---------------------------------------------------------------------------
+//    
+void CBubbleCallObjectManager::DoDeleteReaderInIdle()
+    {
+    Reset();
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::DoInitializeIcons
+//
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallObjectManager::DoInitializeIcons()
+    {
+    AknIconUtils::ExcludeFromCache( iCallThemeImageIcon->Bitmap() );
+    AknIconUtils::SetSize( iCallThemeImageIcon->Bitmap(),
+                           iCallThemeImageSize,
+                           EAspectRatioPreservedSlice );
+    iLoadingState = EBMLoaderReady;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::FrameBufferDataChanged
+//
+// ---------------------------------------------------------------------------
+//    
+void CBubbleCallObjectManager::FrameBufferDataChanged()
+    {
+    TRAPD( err, DoHandleFrameBufferDataL() );
+    
+    if ( err != KErrNone )
+        {
+        TCallBack idleCallback( IdleProcessorCallback, this );
+        iIdleProcessor->Cancel();
+        iIdleProcessor->Start( idleCallback );
+        iLoadingState = EBMDeleting;    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::SetCallObjectImageL
+//
+// ---------------------------------------------------------------------------
+//     
+void CBubbleCallObjectManager::DoHandleFrameBufferDataL()
+    {
+    const CFbsBitmap* bitmap = iMediaReader->FrameBuffer();
+    const CFbsBitmap* mask = iMediaReader->Mask();
+    
+    if ( bitmap )
+        {
+        CBubbleManager::TPhoneCallState callState =
+            iBubbleManager.CallState( iBubbleId );
+
+        // copy the current frame
+        CFbsBitmap* d_bitmap = new( ELeave ) CFbsBitmap;
+        CleanupStack::PushL( d_bitmap );
+        User::LeaveIfError( d_bitmap->Duplicate( bitmap->Handle() ) );
+            
+        CFbsBitmap* d_mask = NULL;
+        if ( mask )
+            {
+            d_mask = new( ELeave ) CFbsBitmap;
+            CleanupStack::PushL( d_mask );
+            User::LeaveIfError( d_mask->Duplicate( mask->Handle() ) );    
+            CleanupStack::Pop( d_mask );
+            }
+        CleanupStack::Pop( d_bitmap );
+            
+        // assign the copy to call header.
+        if ( ( iLoadingState == EBMLoadingThumbnail ) &&
+             ( callState > CBubbleManager::EActive ) )
+            {
+            // displaying fullscreen image, set as thumbnail
+            iBubbleManager.SetThumbnail( iBubbleId,
+                                         d_bitmap,
+                                         d_mask,
+                                         ETrue ); // Ownership transfer
+            }
+        else
+            {
+            iBubbleManager.StartChanges();
+            iBubbleManager.SetCallObjectImage( iBubbleId,
+                                               d_bitmap,
+                                               d_mask,
+                                               ETrue ); // Ownership transfer
+            iBubbleManager.EndChanges();
+            }            
+   
+        }
+    
+    // Delete media reader
+    iBubbleId = KBMBubbleIdNone;
+    TCallBack idleCallback( IdleProcessorCallback, this );
+    iIdleProcessor->Cancel();
+    iIdleProcessor->Start( idleCallback );
+    iLoadingState = EBMDeleting;         
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::LoadThumbnailVersion
+//
+// ---------------------------------------------------------------------------
+//
+TBool CBubbleCallObjectManager::LoadThumbnailVersion()
+    {
+    TSize sourceSize( iMediaReader->SourceSize() );
+    TReal scaleFactor;
+    TRect clipRect;
+    TBool isTiny = BubbleCallObjectUtils::GetScaleFactorAndClipRect(
+        sourceSize,
+        iImageLoadParams.iThumbnailSize,
+        BubbleCallObjectUtils::EFillTarget,
+        scaleFactor,
+        clipRect );
+            
+    if ( !isTiny )
+        {
+        // scale image to thumbnail version
+        iMediaReader->SetScaleAndClip( iImageLoadParams.iThumbnailSize, 
+                                       scaleFactor,
+                                       clipRect );
+        return ETrue;            
+        }
+    else
+        {
+        // image is smaller than thumnail size
+        return EFalse;            
+        }                    
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleCallObjectManager::ReaderError
+//
+// ---------------------------------------------------------------------------
+// 
+void CBubbleCallObjectManager::ReaderError( TInt /*aError*/ )
+    {
+    TCallBack idleCallback( IdleProcessorCallback, this );
+    iIdleProcessor->Cancel();
+    iIdleProcessor->Start( idleCallback );
+    iLoadingState = EBMDeleting;
+    }    
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMCallObjectUtils.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,532 @@
+/*
+* 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:  Utility methods for call object handling.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "BMCallObjectUtils.h"
+#include    "BMLayout2.h"
+#include    "BMUtils.h"
+#include    "BMPanic.h"
+#include    <AknUtils.h>
+#include    <AknBidiTextUtils.h>
+#include    <AknLayoutFont.h>
+
+// CONSTANTS
+const TReal KBMCallObjectScaleFactorMax = 1.0;
+_LIT( KSpaceChar, " " );
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// ---------------------------------------------------------------------------
+// BubbleCallObjectUtils::CreateBitmapL
+//
+// ---------------------------------------------------------------------------
+//    
+CFbsBitmap* BubbleCallObjectUtils::CreateBitmapL( 
+    const CFbsBitmap* aBitmap, 
+    const TSize& aTargetSize,
+    TDisplayMode aDisplayMode,
+    TTileMode aTileMode )
+    {
+    __ASSERT_ALWAYS( aBitmap, User::Leave( KErrArgument ) );
+    
+    // get scaling factor
+    TReal scalingFactor = ScalingFactor( aBitmap->SizeInPixels(),
+                                         aTargetSize,
+                                         EFillTarget );
+                                                  
+    if ( scalingFactor > 1.0 ) // bitmap scaling not supported
+        {
+        // image smaller than target area is tiled
+        return CreateTiledBitmapL( aBitmap, 
+                                   aTargetSize, 
+                                   aDisplayMode, 
+                                   aTileMode );
+        }
+    else        
+        {
+        // image bigger than target area is clipped
+        return CreateCroppedBitmapL( aBitmap,
+                                     aTargetSize,
+                                     aDisplayMode );    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleCallObjectUtils::CreateCroppedBitmapL
+//
+// ---------------------------------------------------------------------------
+//    
+CFbsBitmap* BubbleCallObjectUtils::CreateCroppedBitmapL( 
+    const CFbsBitmap* aBitmap, 
+    const TSize& aTargetSize,
+    TDisplayMode aDisplayMode )
+    {
+    __ASSERT_ALWAYS( aBitmap, User::Leave( KErrArgument ) );
+    
+    // create bitmap
+    CFbsBitmap* bitmap = new(ELeave) CFbsBitmap;
+    CleanupStack::PushL( bitmap );
+    
+    // calculate cropping rectangle   
+    TSize sourceBitmapSize( aBitmap->SizeInPixels() );
+    TRect croppingRect( TPoint(0,0), sourceBitmapSize );
+    
+    TInt xDelta( sourceBitmapSize.iWidth - aTargetSize.iWidth );
+    if ( xDelta < 0 )
+        {
+        // do not crop horizontally
+        xDelta = 0;    
+        }
+    
+    TInt yDelta( sourceBitmapSize.iHeight - aTargetSize.iHeight );
+    if ( yDelta < 0 )
+        {
+        // do not crop vertically
+        yDelta = 0;    
+        }
+        
+    if ( xDelta == 0 && yDelta == 0 )
+        {
+        // cropping not required -> just duplicate
+        User::LeaveIfError( bitmap->Duplicate( aBitmap->Handle() ) );
+        CleanupStack::Pop( bitmap );
+        return bitmap;                            
+        }
+    else
+        {
+        // shrink to cropping area
+        croppingRect.Shrink( xDelta/2, yDelta/2 );        
+        }
+    
+    
+    // create bitmap to target size
+    User::LeaveIfError( bitmap->Create( aTargetSize, 
+                                        aDisplayMode ) );
+    // crop
+    CFbsBitmapDevice* bitmapDev = 
+        CFbsBitmapDevice::NewL( bitmap );
+    CleanupStack::PushL( bitmapDev );
+    CFbsBitGc* bitmapCtx;
+    User::LeaveIfError( bitmapDev->CreateContext( bitmapCtx ) );
+    CleanupStack::PushL( bitmapCtx );                                               
+    TRect targetRect( TPoint(0,0), aTargetSize );
+    bitmapCtx->DrawBitmap( targetRect, aBitmap, croppingRect );    
+    
+    CleanupStack::PopAndDestroy( 2, bitmapDev );
+    CleanupStack::Pop( bitmap );
+    
+    return bitmap;            
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleCallObjectUtils::CreateTiledBitmapL
+//
+// ---------------------------------------------------------------------------
+//    
+CFbsBitmap* BubbleCallObjectUtils::CreateTiledBitmapL( 
+    const CFbsBitmap* aBitmap, 
+    const TSize& aTargetSize,
+    TDisplayMode aDisplayMode,
+    TTileMode aTileMode )
+    {
+    __ASSERT_ALWAYS( aBitmap, User::Leave( KErrArgument ) );
+    
+    TSize sourceSize = aBitmap->SizeInPixels();
+    TPoint offset(0,0);
+    
+    // calculate offset for brush origin
+    
+    // horizontal offset
+    if ( aTargetSize.iWidth <= sourceSize.iWidth )
+        {
+        // wide image -> center horizontally
+        offset.iX = ( sourceSize.iWidth - aTargetSize.iWidth ) / 2;    
+        }
+    else if ( ( aTileMode == ETileCenterRight ) ||
+              ( aTileMode == ETileTopRight ) )
+        {
+        // begin tiling from right
+        offset.iX = sourceSize.iWidth - ( aTargetSize.iWidth % 
+                                          sourceSize.iWidth );    
+        }
+    
+    // vertical offset
+    if ( aTargetSize.iHeight <= sourceSize.iHeight )
+        {
+        // tall image -> center vertically 
+        offset.iY = ( sourceSize.iHeight - aTargetSize.iHeight ) / 2;    
+        }
+    else if ( ( aTileMode == ETileCenterRight ) ||
+              ( aTileMode == ETileCenterLeft ) )
+        {
+        // middle most tile is centered vertically
+        TInt topMargin = ( aTargetSize.iHeight - sourceSize.iHeight ) / 2;
+        if ( topMargin <= sourceSize.iHeight )
+            {
+            offset.iY = ( sourceSize.iHeight - topMargin );    
+            }
+        else
+            {
+            offset.iY = sourceSize.iHeight - ( topMargin % 
+                                               sourceSize.iHeight );    
+            }            
+        }
+
+    // create bitmap to target size
+    CFbsBitmap* bitmap = new(ELeave) CFbsBitmap;
+    CleanupStack::PushL( bitmap );
+    User::LeaveIfError( bitmap->Create( aTargetSize, 
+                                        aDisplayMode ) );            
+    
+    // create device and graphics context
+    CFbsBitmapDevice* bitmapDev = CFbsBitmapDevice::NewL( bitmap );
+    CleanupStack::PushL( bitmapDev );
+    CFbsBitGc* bitmapCtx;
+    User::LeaveIfError( bitmapDev->CreateContext( bitmapCtx ) );
+    CleanupStack::PushL( bitmapCtx );         
+    
+    // do tiling by using patterned brush
+    CFbsBitmap* pattern = new(ELeave) CFbsBitmap;
+    CleanupStack::PushL( pattern );
+    User::LeaveIfError( pattern->Duplicate( aBitmap->Handle() ) );
+    
+    TRect bitmapRect( TPoint(0,0), aTargetSize );
+    bitmapCtx->SetPenStyle( CGraphicsContext::ENullPen ); 
+    bitmapCtx->SetBrushStyle( CGraphicsContext::EPatternedBrush ); 
+    bitmapCtx->UseBrushPattern( pattern );
+    bitmapCtx->SetBrushOrigin( -offset );
+    bitmapCtx->DrawRect( bitmapRect );
+    bitmapCtx->DiscardBrushPattern();
+    
+    CleanupStack::PopAndDestroy( 3, bitmapDev );
+    CleanupStack::Pop( bitmap ); 
+    
+    return bitmap;       
+    }    
+
+// ---------------------------------------------------------------------------
+// BubbleCallObjectUtils::CreateImageBitmapsFromTextLC
+//
+// ---------------------------------------------------------------------------
+//    
+void BubbleCallObjectUtils::CreateImageBitmapsFromTextLC(
+    const TDesC& aText,
+    const TRect& aMainPaneRect, 
+    const TSize& aSize,
+    const TRgb&  aTextColor,
+    TUint aAlpha,
+    TDisplayMode aDisplayMode,
+    CFbsBitmap*& aBitmap,
+    CFbsBitmap*& aMask )
+    {
+    // create bitmap
+    aBitmap= new(ELeave) CFbsBitmap;
+    CleanupStack::PushL( aBitmap );
+    User::LeaveIfError( aBitmap->Create( aSize, aDisplayMode ) );
+    
+    // create mask
+    aMask = new(ELeave) CFbsBitmap;
+    CleanupStack::PushL( aMask );
+    User::LeaveIfError( aMask->Create( aSize, EGray256 ) );
+
+    // create bitmap context
+    CFbsBitmapDevice* bitmapDev = CFbsBitmapDevice::NewL( aBitmap );
+    CleanupStack::PushL( bitmapDev );
+    CFbsBitGc* bitmapGc;
+    User::LeaveIfError( bitmapDev->CreateContext( bitmapGc ) ); 
+    CleanupStack::PushL( bitmapGc );    
+    
+    // create mask context
+    CFbsBitmapDevice* maskDev = CFbsBitmapDevice::NewL( aMask );
+    CleanupStack::PushL( maskDev );
+    CFbsBitGc* maskGc;
+    User::LeaveIfError( maskDev->CreateContext( maskGc ) ); 
+    CleanupStack::PushL( maskGc );
+    
+    // initialize bitmap
+    bitmapGc->SetBrushStyle( CGraphicsContext::ESolidBrush );
+    bitmapGc->SetPenStyle( CGraphicsContext::ENullPen );
+    bitmapGc->SetBrushColor( KRgbWhite );
+    bitmapGc->DrawRect( TRect( aSize ) );
+    bitmapGc->SetPenStyle( CGraphicsContext::ESolidPen );
+    bitmapGc->SetBrushStyle( CGraphicsContext::ENullBrush );
+    // initialize mask
+    maskGc->SetBrushStyle( CGraphicsContext::ESolidBrush );
+    maskGc->SetPenStyle( CGraphicsContext::ENullPen );
+    maskGc->SetBrushColor( KRgbBlack );
+    maskGc->DrawRect( TRect( aSize ) );
+    maskGc->SetPenStyle( CGraphicsContext::ESolidPen );
+    maskGc->SetBrushStyle( CGraphicsContext::ENullBrush );
+    
+    // reserve text buffers
+    TAknLayoutRect textPaneLayout;
+    textPaneLayout.LayoutRect( aMainPaneRect,
+                             BubbleLayout2::call2_cli_visual_text_pane() );
+    TRect textPaneRect = textPaneLayout.Rect();                             
+    
+    TAknLayoutText textLayout;
+    textLayout.LayoutText( textPaneRect, 
+                           BubbleLayout2::call2_main_pane_text( 0 ) );
+    const CFont* font = textLayout.Font();
+    TInt lineWidth = textLayout.TextRect().Size().iWidth;
+    TInt averageFontWidth( font->WidthZeroInPixels() );
+    
+    TInt maxCharsPerLine( lineWidth / averageFontWidth );
+    maxCharsPerLine = maxCharsPerLine * 4; // to secure
+    HBufC* logicalLineBuf = HBufC::NewL( maxCharsPerLine );
+    CleanupStack::PushL( logicalLineBuf );
+    HBufC* visualLineBuf = HBufC::NewL( maxCharsPerLine + 
+                                        KAknBidiExtraSpacePerLine );
+    CleanupStack::PushL( visualLineBuf );
+    TPtr logicalLine( logicalLineBuf->Des() );
+    TPtr visualLine( visualLineBuf->Des() );
+    
+    TRgb alphaColor( aAlpha, aAlpha, aAlpha );
+    TInt currentRow = 0;
+    TInt i = 0;
+    TInt textLength = aText.Length();    
+    const TInt numberOfRows = 
+        BubbleLayout2::call2_cli_visual_text_number_of_rows();
+    
+    // shift gc origin
+    TPoint offset( (aMainPaneRect.Size().iWidth - aSize.iWidth) / 2,
+                   (aMainPaneRect.Size().iHeight - aSize.iHeight) / 2 );
+    bitmapGc->SetOrigin( -offset );
+    maskGc->SetOrigin( -offset );
+    
+    // render text
+    while ( currentRow <= numberOfRows )
+        {
+        TAknLayoutText textLayout;
+        textLayout.LayoutText( textPaneRect,
+            BubbleLayout2::call2_main_pane_text( currentRow ) );
+        
+        TRect textRect = textLayout.TextRect();            
+        if ( ( textRect.iBr.iY < offset.iY ) || 
+             ( textRect.iTl.iY > ( offset.iY + aSize.iHeight ) ) )
+            {
+            // this line is outside the bitmap.
+            currentRow++;
+            continue;                
+            }
+        
+        logicalLine.Zero();
+        TBool clipped( EFalse );
+        do // Find the clipping point
+            {
+            TChar c( aText[i] );
+            if( logicalLine.Length() == maxCharsPerLine )
+                {
+                User::Leave( KErrOverflow );
+                }
+            logicalLine.Append( c );
+            i++;
+            if ( i == textLength )
+                {
+                if( logicalLine.Length() == maxCharsPerLine )
+                    {
+                    User::Leave( KErrOverflow );
+                    }
+                // start over to fill whole pane
+                i = 0;
+                logicalLine.Append( KSpaceChar );
+                }
+            
+            visualLine.Zero();
+            clipped = AknBidiTextUtils::ConvertToVisualAndClip(
+                logicalLine,
+                visualLine,
+                *font,
+                lineWidth,
+                lineWidth,
+                AknBidiTextUtils::EImplicit,
+                0xFFFF );
+                
+            } while ( !clipped );
+        
+        // Remove the last character that caused clipping
+        if ( logicalLine.Length() )
+            {
+            logicalLine.SetLength( logicalLine.Length() - 1 );                
+            }
+        
+        AknBidiTextUtils::ConvertToVisualAndClip(
+            logicalLine,
+            visualLine,
+            *font,
+            lineWidth,
+            lineWidth,
+            AknBidiTextUtils::EImplicit,
+            0xFFFF );
+        
+        textLayout.DrawText( *bitmapGc, visualLine, EFalse, aTextColor );
+        textLayout.DrawText( *maskGc, visualLine, EFalse, alphaColor );
+        
+        // clipped -> go back by one        
+        i = i > 0 ? (i - 1) : (textLength-1);                    
+        
+        currentRow++;
+        }
+
+    CleanupStack::PopAndDestroy(6, bitmapDev);
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleCallObjectUtils::ScalingFactor
+//
+// ---------------------------------------------------------------------------
+//
+TReal BubbleCallObjectUtils::ScalingFactor( 
+    const TSize& aSourceSize,
+    const TSize& aTargetSize,
+    TScaleMode aScaleMode )
+    {
+    if ( aTargetSize == TSize(0,0) || aSourceSize == TSize(0,0) )
+        {
+        return 0;    
+        }
+    
+    // check aspect ratios
+    TReal targetAspectRatio = (TReal) aTargetSize.iWidth / 
+                              (TReal) aTargetSize.iHeight;
+    TReal sourceAspectRatio = (TReal) aSourceSize.iWidth  / 
+                              (TReal) aSourceSize.iHeight;
+    TReal scaleFactor = 1.0; 
+    
+    
+    if ( sourceAspectRatio == targetAspectRatio )
+        {
+        // aspect ratios are same.
+        return (TReal) aTargetSize.iWidth / (TReal) aSourceSize.iWidth;
+        }
+    else if ( targetAspectRatio > sourceAspectRatio )
+        {
+        // target wide more screen than source.
+        if ( aScaleMode == EFillTarget )
+            {
+            // width defines the scale
+            scaleFactor = (TReal) aTargetSize.iWidth / 
+                          (TReal) aSourceSize.iWidth;    
+            }
+        else // EMaximumFit
+            {
+            // height defines the scale
+            scaleFactor = (TReal) aTargetSize.iHeight / 
+                          (TReal) aSourceSize.iHeight;    
+            }            
+        }
+    else
+        {
+        // video is more wide screen than window.
+        if ( aScaleMode == EFillTarget )
+            {
+            // height defines the scale
+            scaleFactor = (TReal) aTargetSize.iHeight / 
+                          (TReal) aSourceSize.iHeight;    
+            }
+        else // EMaximumFit
+            {
+            // width defines the scale
+            scaleFactor = (TReal) aTargetSize.iWidth / 
+                          (TReal) aSourceSize.iWidth;    
+            }            
+        }
+    
+    return scaleFactor;        
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleCallObjectUtils::GetScaleFactorAndClipRect
+//
+// ---------------------------------------------------------------------------
+//    
+TBool BubbleCallObjectUtils::GetScaleFactorAndClipRect( 
+    const TSize& aSourceSize,
+    const TSize& aTargetSize,
+    TScaleMode aScaleMode,
+    TReal& aScaleFactor,
+    TRect& aClipRect )
+    {
+    TBool isTinyImage( EFalse );
+    
+    // scaling to fit main pane
+    TReal scaleFactor = BubbleCallObjectUtils::ScalingFactor(
+        aSourceSize,
+        aTargetSize,
+        aScaleMode );
+    
+    // set clipping rect
+    TRect clipRect;
+    
+    if ( aScaleMode == EMaximumFit )
+        {
+        aScaleFactor = scaleFactor > KBMCallObjectScaleFactorMax ?
+                       KBMCallObjectScaleFactorMax : scaleFactor; 
+        aClipRect = TRect( aSourceSize ); // no clip   
+        }
+    else if ( scaleFactor == 0 )
+        {
+        aScaleFactor = scaleFactor;
+        aClipRect = TRect( aSourceSize );    
+        }
+    else if ( scaleFactor > KBMCallObjectScaleFactorMax )
+        {
+        isTinyImage = ETrue;
+        aScaleFactor = KBMCallObjectScaleFactorMax;
+        TInt x_offset = 0;
+        if ( aSourceSize.iWidth > aTargetSize.iWidth )
+            {
+            // center horizontally
+            x_offset =
+                ( aSourceSize.iWidth - aTargetSize.iWidth ) / 4;
+            }
+        TInt y_offset = 0;
+        if ( aSourceSize.iHeight > aTargetSize.iHeight )
+            {
+            // center vertically
+            y_offset =
+                ( aSourceSize.iHeight - aTargetSize.iHeight ) / 4;    
+            }
+        
+        aClipRect = TRect( aSourceSize );
+        aClipRect.Shrink( x_offset, y_offset );    
+        }
+    else // 0 < scaleFactor < KBMCallObjectScaleFactorMax
+        {
+        aScaleFactor = scaleFactor;
+        TSize relativeTargetSize;
+        relativeTargetSize.iWidth = aTargetSize.iWidth / scaleFactor;
+        relativeTargetSize.iHeight = aTargetSize.iHeight / scaleFactor;
+        TInt x_offset = ( aSourceSize.iWidth - 
+                          relativeTargetSize.iWidth ) / 2;
+        TInt y_offset = ( aSourceSize.iHeight - 
+                          relativeTargetSize.iHeight ) / 2;
+        aClipRect = TRect( relativeTargetSize );
+        if ( x_offset >= 0 && y_offset >= 0 )
+            {
+            // clip from center of the source image
+            aClipRect.Move( x_offset, y_offset );    
+            }
+        }
+    
+    return isTinyImage;            
+    }
+    
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMCallStatusAnim.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,89 @@
+/*
+* 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:  Call status animation
+*
+*/
+
+#include "BMCallStatusAnim.h"
+#include "BMBubbleImageManager.h"
+#include "BMBubbleHeader.h"
+
+#include <eikimage.h>
+
+// ---------------------------------------------------------------------------
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+CBubbleCallStatusAnim::CBubbleCallStatusAnim( 
+    CBubbleImageManager& aImageManager ) :
+    iImageManager( aImageManager )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallStatusAnim::ConstructL()
+    {
+    CTelBubbleAnim::ConstructL( 500 );
+    }
+
+// ---------------------------------------------------------------------------
+// ReadBubbleHeader
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallStatusAnim::ReadBubbleHeader( const CBubbleHeader& aHeader )
+    {
+    iCallFlags = aHeader.CallFlags();
+    }
+
+// ---------------------------------------------------------------------------
+// SetCallFlags
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallStatusAnim::SetContainerWindowL( const CCoeControl& aControl )
+    {
+    CTelBubbleAnim::SetContainerWindowL( aControl );
+    }
+
+// ---------------------------------------------------------------------------
+// MakeVisible
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallStatusAnim::MakeVisible(TBool aVisible)
+    {
+    CTelBubbleAnim::MakeVisible( aVisible );
+    
+    if ( aVisible )
+        {
+        TRAP_IGNORE( SetAnimationContentL() );
+        }
+    else
+        {
+        StopAnimation();
+        Reset();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// SetAnimationContentL
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallStatusAnim::SetAnimationContentL()
+    {
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMCallStatusAnimBig.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Big call status animation
+*
+*/
+
+#include "BMCallStatusAnimBig.h"
+#include "BMBubbleImageManager.h"
+#include "BMBubbleHeader.h"
+
+#include <eikimage.h>
+
+// ---------------------------------------------------------------------------
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+CBubbleCallStatusAnimBig::CBubbleCallStatusAnimBig( 
+    CBubbleImageManager& aImageManager ) :
+    CBubbleCallStatusAnim( aImageManager )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CBubbleCallStatusAnimBig* CBubbleCallStatusAnimBig::NewL(
+        CBubbleImageManager& aImageManager )
+    {
+    CBubbleCallStatusAnimBig* self = 
+        new( ELeave ) CBubbleCallStatusAnimBig( aImageManager );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBubbleCallStatusAnimBig::~CBubbleCallStatusAnimBig()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// SetAnimationContentL
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallStatusAnimBig::SetAnimationContentL()
+    {
+    TInt bitmap;  
+    TInt mask;
+    
+    CEikImage* image = new(ELeave) CEikImage;
+    CleanupStack::PushL( image );
+    
+    // frame 1
+    if ( iCallFlags & CBubbleManager::EVideo )
+        {
+        bitmap = EQgn_indi_call_video_1;
+        mask  = EQgn_indi_call_video_1_mask;
+        }
+    else if ( iCallFlags & CBubbleManager::EVoIPCall )
+        {
+        bitmap = EQgn_indi_call_voip_waiting_1;
+        mask  = EQgn_indi_call_voip_waiting_1_mask;
+        }
+    else
+        {
+        bitmap = EQgn_indi_call_waiting_1;
+        mask  = EQgn_indi_call_waiting_1_mask;
+        }
+    
+    iImageManager.SetBitmapToImage(
+        image,
+        (TBMIcons)bitmap,
+        (TBMIcons)mask );
+    
+    AddFrameToAnimationL( *image );
+    
+    // frame 2
+    if ( iCallFlags & CBubbleManager::EVideo )
+        {
+        bitmap = EQgn_indi_call_video_2;
+        mask  = EQgn_indi_call_video_2_mask;
+        }
+    else if ( iCallFlags & CBubbleManager::EVoIPCall )
+        {
+        bitmap = EQgn_indi_call_voip_waiting_2;
+        mask  = EQgn_indi_call_voip_waiting_2_mask;
+        }
+    else
+        {
+        bitmap = EQgn_indi_call_waiting_2;
+        mask  = EQgn_indi_call_waiting_2_mask;
+        }
+    
+    iImageManager.SetBitmapToImage(
+        image,
+        (TBMIcons)bitmap,
+        (TBMIcons)mask );
+    
+    AddFrameToAnimationL( *image );
+    
+    CleanupStack::PopAndDestroy( image );
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMCallStatusAnimSmall.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Small call status animation
+*
+*/
+
+#include "BMCallStatusAnimSmall.h"
+#include "BMBubbleImageManager.h"
+#include "BMBubbleHeader.h"
+
+#include <eikimage.h>
+
+// ---------------------------------------------------------------------------
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+CBubbleCallStatusAnimSmall::CBubbleCallStatusAnimSmall( 
+    CBubbleImageManager& aImageManager ) :
+    CBubbleCallStatusAnim( aImageManager )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CBubbleCallStatusAnimSmall* CBubbleCallStatusAnimSmall::NewL(
+        CBubbleImageManager& aImageManager )
+    {
+    CBubbleCallStatusAnimSmall* self = 
+        new( ELeave ) CBubbleCallStatusAnimSmall( aImageManager );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBubbleCallStatusAnimSmall::~CBubbleCallStatusAnimSmall()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// SetAnimationContentL
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallStatusAnimSmall::SetAnimationContentL()
+    {
+    TInt bitmap;  
+    TInt mask;
+    
+    CEikImage* image = new(ELeave) CEikImage;
+    CleanupStack::PushL( image );
+    
+    // frame 1
+    if ( iCallFlags & CBubbleManager::EVideo )
+        {
+        bitmap = EQgn_indi_call_video_callsta_1;
+        mask  = EQgn_indi_call_video_callsta_1_mask;
+        }
+    else if ( iCallFlags & CBubbleManager::EVoIPCall )
+        {
+        bitmap = EQgn_indi_call_voip_active;
+        mask  = EQgn_indi_call_voip_active_mask;
+        }
+    else
+        {
+        bitmap = EQgn_indi_call_active;
+        mask  = EQgn_indi_call_active_mask;
+        }
+    
+    iImageManager.SetBitmapToImage(
+        image,
+        (TBMIcons)bitmap,
+        (TBMIcons)mask );
+    
+    AddFrameToAnimationL( *image );
+    
+    // frame 2
+    if ( iCallFlags & CBubbleManager::EVideo )
+        {
+        bitmap = EQgn_indi_call_video_callsta_2;
+        mask  = EQgn_indi_call_video_callsta_2_mask;
+        }
+    else if ( iCallFlags & CBubbleManager::EVoIPCall )
+        {
+        bitmap = EQgn_indi_call_voip_active_2;
+        mask  = EQgn_indi_call_voip_active_2_mask;
+        }
+    else
+        {
+        bitmap = EQgn_indi_call_active_2;
+        mask  = EQgn_indi_call_active_2_mask;
+        }
+    
+    iImageManager.SetBitmapToImage(
+        image,
+        (TBMIcons)bitmap,
+        (TBMIcons)mask );
+    
+    AddFrameToAnimationL( *image );
+    
+    CleanupStack::PopAndDestroy( image );
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMCallStatusIndi.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Call status indicator
+*
+*/
+
+#include "BMCallStatusIndi.h"
+#include "BMBubbleImageManager.h"
+#include "BMBubbleHeader.h"
+
+// ---------------------------------------------------------------------------
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+CBubbleCallStatusIndi::CBubbleCallStatusIndi( 
+    CBubbleImageManager& aImageManager ) :
+    iImageManager( aImageManager )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// ReadBubbleHeader
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallStatusIndi::ReadBubbleHeader( const CBubbleHeader& aHeader )
+    {
+    iCallState = aHeader.CallState();
+    iCallFlags = aHeader.CallFlags();
+    }
+
+// ---------------------------------------------------------------------------
+// MakeVisible
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallStatusIndi::MakeVisible(TBool aVisible)
+    {
+    CTelBubbleImage::MakeVisible( aVisible );
+    
+    if ( aVisible )
+        {
+        SetImageAndMask();
+        }
+    else
+        {
+        SetPicture( NULL, NULL );
+        }
+    };
+
+// ---------------------------------------------------------------------------
+// SetImageAndMask
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallStatusIndi::SetImageAndMask()
+    {
+    SetPicture( NULL, NULL );
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMCallStatusIndiBig.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Big call status indicator
+*
+*/
+
+#include "BMCallStatusIndiBig.h"
+#include "BMBubbleImageManager.h"
+#include "BMBubbleHeader.h"
+
+// ---------------------------------------------------------------------------
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+CBubbleCallStatusIndiBig::CBubbleCallStatusIndiBig( 
+    CBubbleImageManager& aImageManager ) :
+    CBubbleCallStatusIndi( aImageManager )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CBubbleCallStatusIndiBig* CBubbleCallStatusIndiBig::NewL(
+        CBubbleImageManager& aImageManager )
+    {
+    CBubbleCallStatusIndiBig* self = 
+        new( ELeave ) CBubbleCallStatusIndiBig( aImageManager );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBubbleCallStatusIndiBig::~CBubbleCallStatusIndiBig()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// SetImageAndMask
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallStatusIndiBig::SetImageAndMask()
+    {
+    TInt image = KErrNotFound;  
+    TInt mask = KErrNotFound; 
+    
+    switch ( iCallState )
+        {
+        case CBubbleManager::EOutgoing:
+            if ( iCallFlags & CBubbleManager::EVideo )
+                {
+                image = EQgn_indi_call_video_1;
+                mask  = EQgn_indi_call_video_1_mask;
+                }
+            else if ( iCallFlags & CBubbleManager::EVoIPCall )
+                {
+                image = EQgn_indi_call_voip_waiting_1;
+                mask  = EQgn_indi_call_voip_waiting_1_mask;
+                }
+            else
+                {
+                image = EQgn_indi_call_waiting_1;
+                mask  = EQgn_indi_call_waiting_1_mask;
+                }
+            break;
+        case CBubbleManager::EAlertToDisconnected:
+            if ( iCallFlags & CBubbleManager::EVideo )
+                {
+                image = EQgn_indi_call_video_disconn;
+                mask  = EQgn_indi_call_video_disconn_mask;
+                }
+            else if ( iCallFlags & CBubbleManager::EVoIPCall )
+                {
+                image = EQgn_indi_call_voip_callsta_disconn;
+                mask  = EQgn_indi_call_voip_callsta_disconn_mask;
+                }
+            else
+                {
+                image = EQgn_indi_call_waiting_disconn;
+                mask  = EQgn_indi_call_waiting_disconn_mask;
+                }
+            break;
+        default:
+            break;
+        }
+    
+    if ( image != KErrNotFound && mask != KErrNotFound )
+        {
+        CEikImage* self = static_cast<CEikImage*>(this);
+        iImageManager.SetBitmapToImage( 
+           self, 
+           (TBMIcons)image, 
+           (TBMIcons)mask );
+        }
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMCallStatusIndiSmall.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Small call status indicator
+*
+*/
+
+
+#include "BMCallStatusIndiSmall.h"
+#include "BMBubbleImageManager.h"
+#include "BMBubbleHeader.h"
+
+// ---------------------------------------------------------------------------
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+CBubbleCallStatusIndiSmall::CBubbleCallStatusIndiSmall( 
+    CBubbleImageManager& aImageManager ) :
+    CBubbleCallStatusIndi( aImageManager )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CBubbleCallStatusIndiSmall* CBubbleCallStatusIndiSmall::NewL(
+        CBubbleImageManager& aImageManager )
+    {
+    CBubbleCallStatusIndiSmall* self = 
+        new( ELeave ) CBubbleCallStatusIndiSmall( aImageManager );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBubbleCallStatusIndiSmall::~CBubbleCallStatusIndiSmall()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// SetImageAndMask
+// ---------------------------------------------------------------------------
+//
+void CBubbleCallStatusIndiSmall::SetImageAndMask()
+    {
+    TInt image = KErrNotFound;  
+    TInt mask = KErrNotFound; 
+    
+    switch ( iCallState )
+        {
+        case CBubbleManager::EOutgoing:
+        case CBubbleManager::EActive:
+            if ( iCallFlags&CBubbleManager::EVideo )
+                {
+                image = EQgn_indi_call_video_callsta_1;
+                mask = EQgn_indi_call_video_callsta_1_mask;
+                }   
+            else if ( iCallFlags&CBubbleManager::EVoIPCall )
+                {
+                image = EQgn_indi_call_voip_active;
+                mask = EQgn_indi_call_voip_active_mask;
+                }
+            else
+                {
+                image = EQgn_indi_call_active;
+                mask = EQgn_indi_call_active_mask;
+                }
+            break;
+        case CBubbleManager::EAlertToDisconnected:
+        case CBubbleManager::EDisconnected:
+            if ( iCallFlags&CBubbleManager::EVideo )
+                {
+                image = EQgn_indi_call_video_callsta_disconn;
+                mask = EQgn_indi_call_video_callsta_disconn_mask;
+                }   
+            else if ( iCallFlags&CBubbleManager::EVoIPCall )
+                {
+                image = EQgn_indi_call_voip_disconn;
+                mask = EQgn_indi_call_voip_disconn_mask;
+                }    
+            else
+                {
+                image = EQgn_indi_call_disconn;
+                mask = EQgn_indi_call_disconn_mask;
+                }
+
+            break;
+        case CBubbleManager::EOnHold:
+            if ( iCallFlags&CBubbleManager::EVoIPCall )
+                {
+                image = EQgn_indi_call_voip_held;
+                mask = EQgn_indi_call_voip_held_mask;
+                }
+            else 
+                {
+                image = EQgn_indi_call_held;
+                mask = EQgn_indi_call_held_mask;
+                }
+            break;
+        default:
+            break;
+        }
+    
+    if ( image != KErrNotFound && mask != KErrNotFound )
+        {
+        CEikImage* self = static_cast<CEikImage*>(this);
+        iImageManager.SetBitmapToImage( 
+           self, 
+           (TBMIcons)image, 
+           (TBMIcons)mask );
+        }
+
+    };
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMConfHeader.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,357 @@
+/*
+* 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:  Conf Header
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMConfHeader.h"
+#include    "BMCallHeader.h"
+#include    "BMPanic.h"
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CBubbleConfHeader::CBubbleConfHeader
+// Default constructor
+// 
+// ---------------------------------------------------------------------------
+//
+CBubbleConfHeader::CBubbleConfHeader()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfHeader::NewL
+// Symbian OS two phased constructor
+// 
+// ---------------------------------------------------------------------------
+//
+CBubbleConfHeader* CBubbleConfHeader::NewL( 
+                                 const CBubbleManager::TBubbleId& aBubbleId )
+    {
+    CBubbleConfHeader* self = new( ELeave )CBubbleConfHeader( );    
+    CleanupStack::PushL( self );
+    self->ConstructL( aBubbleId );
+    CleanupStack::Pop( );    // self
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleConfHeader::ConstructL
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleConfHeader::ConstructL( 
+    const CBubbleManager::TBubbleId& aBubbleId )
+    {
+    CBubbleHeader::ConstructL( aBubbleId ); // call to parent's ConstructL
+    
+    iCalls = new ( ELeave ) 
+        CArrayPtrFlat<CBubbleCallHeader>( KBubbleMaxCallsInConf );    
+    iCalls->SetReserveL( KBubbleMaxCallsInConf );
+    
+    Reset();
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfHeader::~CBubbleConfHeader
+// Destructor
+// 
+// ---------------------------------------------------------------------------
+//
+CBubbleConfHeader::~CBubbleConfHeader()
+    {
+    if ( iCalls )
+        {
+        iCalls->Reset();
+        delete iCalls;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfHeader::IsConference
+// 
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CBubbleConfHeader::IsConference( ) const
+    {
+    return ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfHeader::Reset
+// Puts everything in initial state
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleConfHeader::Reset()
+    {
+    iIsUsed = EFalse;
+    iIsExpanded = EFalse;
+    iSelection = KBubbleNoHighlightRow;
+    
+    TInt callCount = iCalls->Count();
+    for ( TUint8 i = 0 ; i < callCount; i++ )
+        {
+        iCalls->At( i )->SetIsInConference( EFalse );
+        }
+    
+    iCalls->Delete( 0 , callCount );
+    ResetParent( ); // call to parent's Reset
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfHeader::AddRow
+// Adds new call to conference
+// If max calls are already set to conference function, panics
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleConfHeader::AddRow( CBubbleCallHeader& aCall )
+    {
+    __ASSERT_ALWAYS( iCalls->Count() < KBubbleMaxCallsInConf, 
+                     Panic( EBMPanicTooManyCallsInConference ) );
+    
+    iCalls->InsertL( iCalls->Count( ) , &aCall ); //space pre-reserved
+    aCall.SetIsInConference( ETrue );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfHeader::RemoveRow
+// Removes specified row from the conference call
+// If BubbleId doesn't exist in conference call function panics
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleConfHeader::RemoveRow( const CBubbleManager::TBubbleId& aCallId )
+    {
+    // Search the element.
+    TUint8 index = 0;
+    __ASSERT_ALWAYS( iCalls->Count() > 0, 
+                     Panic( EBMPanicConferenceCallEmpty ) );
+
+    if ( iCalls->Count() == 0 )
+        {
+        // Own panic function may not Panic the thread.
+        return;
+        }
+
+    while ( iCalls->At( index )->BubbleId() != aCallId )
+        {
+        index++;
+        __ASSERT_ALWAYS( index != iCalls->Count(), 
+                         Panic( EBMPanicBubbleIdDoesNotExist ) );
+        if ( index == iCalls->Count() )
+            {
+            // Own panic implementation does not panic the thread in every case
+            return;
+            }
+        }
+    
+    CBubbleManager::TBubbleId oldhighlightid = HighlightId();
+    
+    iCalls->At( index )->SetIsInConference( EFalse );
+    
+    iCalls->Delete( index );
+    
+    // move highlight to new position
+    if ( oldhighlightid != aCallId )
+        {
+        SetHighlightId( oldhighlightid );
+        }
+    else if ( iSelection >= iCalls->Count( ) )
+        {
+        iSelection = static_cast<TUint8>( iCalls->Count() );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfHeader::GetRows
+// 
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleConfHeader::GetRows( 
+                           CArrayPtrFlat<CBubbleCallHeader>& aCalls ) const
+    {
+    aCalls.Delete( 0 , aCalls.Count() );
+    TInt callCount = iCalls->Count();
+    
+    for ( TUint8 outIndex = 0; outIndex < callCount ; outIndex++ )
+        {
+        aCalls.InsertL( outIndex , iCalls->At( outIndex ) ); // can't leave.
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfHeader::RowCount
+// 
+// 
+// ---------------------------------------------------------------------------
+//
+TUint8 CBubbleConfHeader::RowCount( ) const
+    {
+    return static_cast<TUint8>( iCalls->Count() );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfHeader::IsUsed
+// 
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CBubbleConfHeader::IsUsed( ) const
+    {
+    return iIsUsed;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfHeader::SetIsUsed
+// If set not used, reset the header.
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleConfHeader::SetIsUsed( const TBool& aIsUsed )
+    {
+    iIsUsed = aIsUsed;
+    if ( !iIsUsed )
+        {
+        Reset( );
+        }       
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfHeader::SetIsExpanded
+//
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleConfHeader::SetIsExpanded( TBool aIsExpanded )
+    {
+    iIsExpanded = aIsExpanded;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfHeader::IsExpanded
+// 
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CBubbleConfHeader::IsExpanded( ) const
+    {
+    return iIsExpanded;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfHeader::SetHighlight
+// 
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleConfHeader::SetHighlight( const CBubbleManager::TRowNumber& aRow )
+    {
+    __ASSERT_ALWAYS( aRow <= iCalls->Count(),
+                     Panic( EBMPanicInvalidConfRowNumber ) );
+    
+    iSelection = aRow;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfHeader::SetHighlightId
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleConfHeader::SetHighlightId( 
+                                const CBubbleManager::TBubbleId& aBubbleId )
+    {
+    if ( aBubbleId == KBubbleInvalidId )
+        {
+        iSelection = KBubbleNoHighlightRow;
+        return;
+        }
+    
+    for ( TInt i = 0 ; i < iCalls->Count() ; i++ )
+        {
+        if ( iCalls->At(i)->BubbleId() == aBubbleId )
+            {
+            iSelection = static_cast<CBubbleManager::TRowNumber>( i+1 );
+            return;
+            }
+        }
+    __ASSERT_DEBUG( EFalse , Panic( EBMPanicBubbleIdDoesNotExist ) );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfHeader::Highlight
+// 
+// 
+// ---------------------------------------------------------------------------
+//
+CBubbleManager::TRowNumber CBubbleConfHeader::Highlight() const
+    {
+    return iSelection;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfHeader::HighlightId
+// 
+// 
+// ---------------------------------------------------------------------------
+//
+CBubbleManager::TBubbleId CBubbleConfHeader::HighlightId() const
+    {
+    if ( iSelection == KBubbleNoHighlightRow || iSelection > iCalls->Count() )
+        {
+        return KBubbleInvalidId;
+        }  
+    return iCalls->At( iSelection - 1 )->BubbleId();
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfHeader::MoveHighlightOneUp
+// 
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleConfHeader::MoveHighlightOneUp()
+    {
+    if( iSelection == KBubbleNoHighlightRow || iSelection == 1 )
+        {
+        return;
+        }
+    
+    iSelection--;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfHeader::MoveHighlightOneDown
+// 
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleConfHeader::MoveHighlightOneDown()
+    {
+    if ( iSelection == KBubbleNoHighlightRow || 
+        iSelection >= iCalls->Count() )
+        {
+        return;
+        }
+    iSelection++;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMConfPane.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,317 @@
+/*
+* 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:  Conf Pane
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMConfPane.h"  //definition
+#include    "BMLayout.h" //coordinates
+#include    "BMLayout2.h" //coordinates
+#include    "BMLayout4.h" //coordinates
+#include    "BMUtils.h"     //utility functions
+
+#include    <eiklabel.h>    //CEikLabel
+#include    <eikimage.h>    //CEikImage
+#include    <eikenv.h>      //environment
+#include    <AknsDrawUtils.h>
+#include    <AknsConstants.h>
+#include    <skinlayout.cdl.h>
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CBubbleConfPane::ConstructL( )
+// Symbian OS two phased constructor
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleConfPane::ConstructL( TBool aTouchCallHandling )
+    {
+    iTouchCallHandling = aTouchCallHandling;
+    iFullText.Set( NULL , 0 );
+    
+    iIsHighlighted = EFalse;
+    ActivateL();
+    }
+
+
+// Destructor
+CBubbleConfPane::~CBubbleConfPane()
+    {
+    Reset();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleConfPane::SizeChanged
+// called by framework when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleConfPane::SizeChanged()
+    { 
+    AknsUtils::RegisterControlPosition( this );
+
+    if ( iTouchCallHandling )
+        {
+        DoCall4Layout();                
+        }
+    else if ( !iCallObjectDisplay )
+        {
+        DoCall1Layout();            
+        }
+    else
+        {
+        DoCall2Layout();                
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfPane::PositionChanged
+// ---------------------------------------------------------------------------
+//
+void CBubbleConfPane::PositionChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfPane::CountComponentControls
+//
+//  
+// ---------------------------------------------------------------------------
+//
+TInt CBubbleConfPane::CountComponentControls() const
+    {
+    TInt amount = 0;
+    if ( iCallIndication ) 
+        {
+        amount++;
+        }
+    if ( iCyphOffImage ) 
+        {
+        amount++;
+        }
+    if ( iTextLine )
+        {
+        amount++;
+        }
+    return amount;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfPane::ComponentControl
+//
+//  
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CBubbleConfPane::ComponentControl( TInt aIndex ) const
+    {
+    TInt amount = -1;
+    if ( iCallIndication )
+        {
+        amount++;
+        }
+    if ( aIndex == amount ) 
+        {
+        return iCallIndication;
+        }
+    if ( iCyphOffImage )
+        {
+        amount++;
+        }
+    if ( aIndex == amount ) 
+        {
+        return iCyphOffImage;
+        }
+    if ( iTextLine ) 
+        {
+        amount++;
+        }
+    if ( aIndex == amount ) 
+        {
+        return iTextLine;
+        }
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfPane::Draw
+// 
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleConfPane::Draw( const TRect& /*aRect*/ ) const
+    {
+    
+    CWindowGc& gc = SystemGc( );
+    gc.SetBrushColor( AKN_LAF_COLOR( BubbleLayout::LayoutColourWhite() ) );
+    
+    // Set texts to fit.
+    BubbleUtils::ClipToLabel( iFullText , iTextLine , iTextClipDirection );
+
+    // draw hightlight rectangles if needed
+    if ( iIsHighlighted ) 
+        {      
+        TBool highlightDrawn = EFalse;
+        TAknLayoutRect topLeft;
+        topLeft.LayoutRect(
+            iHighlight.Rect(), 
+            SkinLayout::List_highlight_skin_placing__general__Line_2() );
+
+        TAknLayoutRect bottomRight;
+        bottomRight.LayoutRect(
+            iHighlight.Rect(), 
+            SkinLayout::List_highlight_skin_placing__general__Line_5() );
+
+        TRect outerRect = TRect( topLeft.Rect().iTl, bottomRight.Rect().iBr );
+        TRect innerRect = TRect( topLeft.Rect().iBr, bottomRight.Rect().iTl );
+        
+        MAknsSkinInstance *skin = AknsUtils::SkinInstance();
+        gc.SetPenStyle( CGraphicsContext::ENullPen );
+        highlightDrawn = AknsDrawUtils::DrawFrame( skin, gc, 
+                                                   outerRect,
+                                                   innerRect,
+                                                   KAknsIIDQsnFrList, 
+                                                   KAknsIIDQsnFrListCenter );
+
+        if ( !highlightDrawn )
+            {
+            iShadow.DrawRect( gc );
+            iHighlight.DrawRect( gc );
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleConfPane::Reset
+//  
+// Put member variables to initial state.
+// ---------------------------------------------------------------------------
+//
+void CBubbleConfPane::Reset( )
+    {
+    BubbleUtils::AddTextToEikLabel( iTextLine , KNullDesC );
+    iFullText.Set( NULL , 0 );
+    iIsHighlighted = EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfPane::SetHighlight
+//  
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleConfPane::SetHighlight( const TBool& aIsHighlighted )
+    {
+    iIsHighlighted = aIsHighlighted;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfPane::GetCallIndicationHandle
+//  
+//  Returns pointer to image so that bubble outlook can attach bitmap to it
+// ---------------------------------------------------------------------------
+//
+CEikImage*& CBubbleConfPane::CallIndicationHandle( )
+    {
+    return iCallIndication;
+    } 
+
+// ---------------------------------------------------------------------------
+// CBubbleConfPane::SetText
+//  
+//  
+// ---------------------------------------------------------------------------
+//
+void CBubbleConfPane::SetText( TPtrC aText , 
+                        const CBubbleManager::TPhoneClippingDirection& aDir )
+    {
+    iFullText.Set( aText );
+    iTextClipDirection = aDir;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfPane::DoCall1Layout
+// ---------------------------------------------------------------------------
+//    
+void CBubbleConfPane::DoCall1Layout()
+    {
+    // Deprecated
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfPane::DoCall2Layout
+// ---------------------------------------------------------------------------
+//
+void CBubbleConfPane::DoCall2Layout()
+    {
+    BubbleUtils::LayoutImage( 
+        iCallIndication, 
+        Rect() , 
+        BubbleLayout2::popup_call2_conf_single_list_pane_call_status_icon() );
+
+    BubbleUtils::LayoutImage( 
+        iCyphOffImage, 
+        Rect() , 
+        BubbleLayout2::popup_call2_conf_single_list_pane_ciphering_icon() );
+
+    BubbleUtils::LayoutLabel( 
+        iTextLine, 
+        Rect(), 
+        BubbleLayout2::popup_call2_conf_single_list_pane_cli_text());
+
+    iShadow.LayoutRect( 
+        Rect() , 
+        BubbleLayout2::popup_call2_conf_single_list_highlight_pane() );
+
+    iHighlight.LayoutRect( 
+        Rect() ,
+        BubbleLayout2::popup_call2_conf_single_list_highlight_pane() ); 
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleConfPane::DoCall4Layout
+// ---------------------------------------------------------------------------
+//
+void CBubbleConfPane::DoCall4Layout()
+    {
+    BubbleUtils::LayoutImage( 
+        iCallIndication, 
+        Rect() , 
+        BubbleLayout4::popup_call4_conf_single_list_pane_call_status_icon() );
+
+    BubbleUtils::LayoutImage( 
+        iCyphOffImage, 
+        Rect() , 
+        BubbleLayout4::popup_call4_conf_single_list_pane_ciphering_icon() );
+
+    BubbleUtils::LayoutLabel( 
+        iTextLine, 
+        Rect(), 
+        BubbleLayout4::popup_call4_conf_single_list_pane_cli_text());
+
+    iShadow.LayoutRect( 
+        Rect() , 
+        BubbleLayout4::popup_call4_conf_single_list_highlight_pane() );
+
+    iHighlight.LayoutRect( 
+        Rect() ,
+        BubbleLayout4::popup_call4_conf_single_list_highlight_pane() ); 
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMCustomManager.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,279 @@
+/*
+* 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 manager
+*
+*/
+
+#include "BMCustomManager.h"
+#include "BMDefaultManager.h"
+#include "BMBubbleHeader.h"
+#include "BMPanic.h"
+
+
+// ---------------------------------------------------------------------------
+// TArrayItem class
+// ---------------------------------------------------------------------------
+//
+class TArrayItem
+    {
+public:
+    TArrayItem( 
+        CTelBubbleCustomElement* aElement,
+        TInt aPriority ): 
+            iElement( *aElement ),
+            iPriority( aPriority ) {};
+        
+    static TInt Compare( const TArrayItem& aFirst, const TArrayItem& aSecond )
+        {
+        if( aFirst.iPriority > aSecond.iPriority )
+            {
+            return 1;
+            }
+        else if( aFirst.iPriority < aSecond.iPriority )
+            {
+            return -1;
+            }
+        else
+            {
+            return 0;
+            }
+        }
+
+    CTelBubbleCustomElement* Item() { return &iElement; }
+private:
+    CTelBubbleCustomElement& iElement;
+    TInt iPriority;
+    };
+
+// ---------------------------------------------------------------------------
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+CBubbleCustomManager::CBubbleCustomManager( CBubbleManager& aBubbleManager ) :
+    iBubbleManager( aBubbleManager )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CBubbleCustomManager::ConstructL()
+    {
+    // create default implementations
+    iDefaultManager = CBubbleDefaultManager::NewL( iBubbleManager );
+    }
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CBubbleCustomManager* CBubbleCustomManager::NewL(
+    CBubbleManager& aBubbleManager )
+    {
+    CBubbleCustomManager* self = 
+        new( ELeave ) CBubbleCustomManager( aBubbleManager );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBubbleCustomManager::~CBubbleCustomManager()
+    {
+    for( TInt i = 0; i < iCustomizations.Count(); i++)
+        {
+        for( TInt j = 0; j < iCustomizations[j].Count(); j++ )
+            {
+            iCustomizations[i][j].Reset();
+            iCustomizations[i][j].Close();
+            }
+        }
+    
+    delete iDefaultManager;
+    }
+
+// ---------------------------------------------------------------------------
+// AddCustomElement
+// ---------------------------------------------------------------------------
+//
+void CBubbleCustomManager::AddCustomElement( 
+    const CBubbleManager::TBubbleId& aBubbleId,
+    CTelBubbleCustomElement* aElement,
+    TInt aPriority )
+    {
+    __ASSERT_DEBUG( aElement->Control(), Panic( EBMPanicCustomization ) ) ;
+    TRAPD( err, aElement->Control()->SetContainerWindowL( iBubbleManager ) );
+    
+    if ( !err )
+        {
+        TArrayItem item( aElement, aPriority );
+        iCustomizations[aBubbleId]
+                       [aElement->ElementType()].InsertInOrderAllowRepeats(
+            item, TLinearOrder<TArrayItem>(TArrayItem::Compare) );    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// RemoveCustomElement
+// ---------------------------------------------------------------------------
+//
+void CBubbleCustomManager::RemoveCustomElement(
+    const CBubbleManager::TBubbleId& aBubbleId,
+    CTelBubbleCustomElement* aElement )
+    {
+    RArray<TArrayItem>& array = 
+        iCustomizations[aBubbleId][aElement->ElementType()];
+    
+    for( TInt j = 0; j < array.Count(); j++ )
+        {
+        if( array[j].Item() == aElement )
+            {
+            array.Remove(j);
+            return;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// RemoveCustomElements
+// ---------------------------------------------------------------------------
+//
+void CBubbleCustomManager::RemoveCustomElements( 
+    const CBubbleManager::TBubbleId& aBubbleId )
+    {
+    for( TInt i = 0; i < iCustomizations[aBubbleId].Count(); i++ )
+        {
+        iCustomizations[aBubbleId][i].Reset();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ReserveCustomElement
+// ---------------------------------------------------------------------------
+//
+CTelBubbleCustomElement* CBubbleCustomManager::ReserveCustomElement( 
+    const CBubbleHeader& aBubbleHeader,
+    CTelBubbleCustomElement::TElementType aElement )
+    {
+    TBool isDefault;
+    return ReserveCustomElement( aBubbleHeader, aElement, isDefault );
+    }
+
+// ---------------------------------------------------------------------------
+// ReserveCustomElement
+// ---------------------------------------------------------------------------
+//
+CTelBubbleCustomElement* CBubbleCustomManager::ReserveCustomElement( 
+    const CBubbleHeader& aBubbleHeader,
+    CTelBubbleCustomElement::TElementType aElement,
+    TBool& aIsDefault )
+    {
+    const CBubbleManager::TBubbleId bubbleId = aBubbleHeader.BubbleId();
+    CTelBubbleCustomElement* customElement = NULL;
+    aIsDefault = EFalse;
+    
+    if( bubbleId != KBubbleConferenceId &&
+        iCustomizations[bubbleId][aElement].Count() )
+        {
+        // Get custom implmentation.
+        customElement = 
+            iCustomizations[aBubbleHeader.BubbleId()][aElement][0].Item();
+        customElement->Control()->MakeVisible( ETrue );
+        }
+    
+    if ( !customElement )
+        {
+        // Get default implementation, if exists.
+        customElement = DefaultElement( aBubbleHeader, aElement );
+        if ( customElement )
+            {
+            aIsDefault = ETrue;
+            }
+        }
+    
+    return customElement;
+    }
+
+// ---------------------------------------------------------------------------
+// ReleaseCustomElement
+// ---------------------------------------------------------------------------
+//
+void CBubbleCustomManager::ReleaseCustomElement( 
+    CTelBubbleCustomElement*& aCustomElement )
+    {
+    if ( aCustomElement )
+        {
+        aCustomElement->Control()->MakeVisible( EFalse );
+        iDefaultManager->ReleaseElement( aCustomElement );
+        aCustomElement = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// DefaultElement
+// ---------------------------------------------------------------------------
+//
+CTelBubbleCustomElement* CBubbleCustomManager::DefaultElement( 
+    const CBubbleHeader& aBubbleHeader,
+    CTelBubbleCustomElement::TElementType aElement )
+    {
+    CTelBubbleCustomElement* element = NULL;
+    
+    switch( aElement )
+        {
+        case CTelBubbleCustomElement::EBigCallIndicator:
+            {
+            element = iDefaultManager->ReserveBigCallIndicatorElement(
+                aBubbleHeader );
+            }
+            break;
+        case CTelBubbleCustomElement::ENumberTypeIcon:
+            {
+            element = iDefaultManager->ReserveNumberTypeIconElement(
+                aBubbleHeader );
+            }
+            break;
+        case CTelBubbleCustomElement::ESmallCallIndicator:
+            {
+            element = iDefaultManager->ReserveSmallCallIndicatorElement(
+                aBubbleHeader );
+            }
+            break;
+        case CTelBubbleCustomElement::ECallImage:
+            {
+            element = iDefaultManager->ReserveCallImageElement(
+                aBubbleHeader );
+            }
+            break;
+        default:
+            // NULL
+            break;
+        }
+    
+    if ( element )
+        {
+        // Make found element visible
+        element->Control()->MakeVisible( ETrue );
+        }
+    
+    return element;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMDefaultManager.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,415 @@
+/*
+* 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 manager
+*
+*/
+
+#include "BMDefaultManager.h"
+#include "BMBubbleImageManager.h"
+#include "BMBubbleHeader.h"
+#include "BMCallStatusIndiBig.h"
+#include "BMCallStatusIndiSmall.h"
+#include "BMCallStatusAnimBig.h"
+#include "BMCallStatusAnimSmall.h"
+#include "BMNumberTypeIcon.h"
+#include "BMPanic.h"
+#include <telbubblecallimage.h>
+
+// max amounts per type
+const TInt KBubbleMaxCallStatusIndiBig  = 2;
+const TInt KBubbleMaxCallStatusIndiSmall  = 7;
+const TInt KBubbleMaxCallStatusAnimBig  = 2;
+const TInt KBubbleMaxCallStatusAnimSmall  = 1;
+const TInt KBubbleMaxNumberTypeIcon  = 2;
+const TInt KBubbleMaxCallerImageDrawer = 1;
+
+// ---------------------------------------------------------------------------
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+CBubbleDefaultManager::CBubbleDefaultManager( CBubbleManager& aBubbleManager )
+    : iBubbleManager( aBubbleManager )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CBubbleDefaultManager::ConstructL()
+    {
+    iMaxAmounts.Append( KBubbleMaxCallStatusIndiBig );
+    iMaxAmounts.Append( KBubbleMaxCallStatusIndiSmall );
+    iMaxAmounts.Append( KBubbleMaxCallStatusAnimBig );
+    iMaxAmounts.Append( KBubbleMaxCallStatusAnimSmall );
+    iMaxAmounts.Append( KBubbleMaxNumberTypeIcon );
+    iMaxAmounts.Append( KBubbleMaxCallerImageDrawer );
+    
+    const TInt kDifferentElements = iMaxAmounts.Count();
+
+    for ( TInt i = 0 ; i < kDifferentElements ; i++ )
+        {
+        iAvailabilities.Append( 0 );
+        }
+
+    // Create main array
+    iElements = new( ELeave ) 
+                    CArrayPtrFlat<CSingleElement>( kDifferentElements );
+    iElements->SetReserveL( kDifferentElements );
+
+    // Create arrays inside the main array and add them to the main array
+    TInt resource = 0;
+    for ( resource = 0 ; resource < kDifferentElements ; resource++ )
+        {
+        CSingleElement* single = new( ELeave ) 
+                                    CSingleElement( iMaxAmounts[resource] );
+        CleanupStack::PushL( single );
+        single->SetReserveL( iMaxAmounts[resource] );
+        iElements->AppendL( single );
+        CleanupStack::Pop( single );
+        }
+
+    // Create implementations to individual arrays:
+    for ( resource = 0 ; resource < kDifferentElements ; resource++ )
+        {
+        TInt maxCellAmount = iMaxAmounts[resource];
+        CSingleElement* single = iElements->At( resource );
+        switch( resource )
+            {
+            case EBMDefaultCallStatusIndiBig:
+                {
+                for ( TInt i = 0 ; i < maxCellAmount ; i++ )
+                    {
+                    CBubbleCallStatusIndiBig* indiControl = 
+                        CBubbleCallStatusIndiBig::NewL( 
+                            iBubbleManager.ImageManager() );
+                    CleanupStack::PushL( indiControl );
+                    indiControl->SetContainerWindowL( iBubbleManager );
+                    indiControl->SetParent( &iBubbleManager );
+                    CTelBubbleCustomElement* indiElem =  
+                        CTelBubbleCustomElement::NewL( indiControl, 
+                            CTelBubbleCustomElement::EBigCallIndicator );
+                    CleanupStack::PushL( indiElem );
+                    single->AppendL( indiElem );
+                    CleanupStack::Pop(2,indiControl);
+                    }
+                break;
+                }
+                
+            case EBMDefaultCallStatusIndiSmall:
+                {
+                for ( TInt i = 0 ; i < maxCellAmount ; i++ )
+                    {
+                    CBubbleCallStatusIndiSmall* indiControl = 
+                        CBubbleCallStatusIndiSmall::NewL( 
+                            iBubbleManager.ImageManager() );
+                    CleanupStack::PushL( indiControl );
+                    indiControl->SetContainerWindowL( iBubbleManager );
+                    indiControl->SetParent( &iBubbleManager );
+                    CTelBubbleCustomElement* indiElem =  
+                        CTelBubbleCustomElement::NewL( indiControl, 
+                            CTelBubbleCustomElement::ESmallCallIndicator );
+                    CleanupStack::PushL( indiElem );
+                    single->AppendL( indiElem );
+                    CleanupStack::Pop(2,indiControl);
+                    }
+                break;
+                }
+                
+            case EBMDefaultCallStatusAnimBig:
+                {
+                for ( TInt i = 0 ; i < maxCellAmount ; i++ )
+                    {
+                    CBubbleCallStatusAnimBig* animControl = 
+                        CBubbleCallStatusAnimBig::NewL( 
+                            iBubbleManager.ImageManager() );
+                    CleanupStack::PushL( animControl );
+                    animControl->SetContainerWindowL( iBubbleManager );
+                    animControl->SetParent( &iBubbleManager );
+                    CTelBubbleCustomElement* animElem =  
+                        CTelBubbleCustomElement::NewL( animControl, 
+                            CTelBubbleCustomElement::EBigCallIndicator );
+                    CleanupStack::PushL( animElem );
+                    single->AppendL( animElem );
+                    CleanupStack::Pop(2,animControl);
+                    }
+                break;
+                }
+                
+            case EBMDefaultCallStatusAnimSmall:
+                {
+                for ( TInt i = 0 ; i < maxCellAmount ; i++ )
+                    {
+                    CBubbleCallStatusAnimSmall* animControl = 
+                        CBubbleCallStatusAnimSmall::NewL( 
+                            iBubbleManager.ImageManager() );
+                    CleanupStack::PushL( animControl );
+                    animControl->SetContainerWindowL( iBubbleManager );
+                    animControl->SetParent( &iBubbleManager );
+                    CTelBubbleCustomElement* animElem =  
+                        CTelBubbleCustomElement::NewL( animControl, 
+                            CTelBubbleCustomElement::ESmallCallIndicator );
+                    CleanupStack::PushL( animElem );
+                    single->AppendL( animElem );
+                    CleanupStack::Pop(2,animControl);
+                    }
+                break;
+                }
+                
+            case EBMDefaultNumberTypeIcon:
+                {
+                for ( TInt i = 0 ; i < maxCellAmount ; i++ )
+                    {
+                    CBubbleNumberTypeIcon* numberTypeIcon = 
+                        CBubbleNumberTypeIcon::NewL( 
+                            iBubbleManager.ImageManager() );
+                    CleanupStack::PushL( numberTypeIcon );
+                    numberTypeIcon->SetContainerWindowL( iBubbleManager );
+                    numberTypeIcon->SetParent( &iBubbleManager );
+                    CTelBubbleCustomElement* numberTypeIconElem =  
+                        CTelBubbleCustomElement::NewL( numberTypeIcon, 
+                            CTelBubbleCustomElement::EBigCallIndicator );
+                    CleanupStack::PushL( numberTypeIconElem );
+                    single->AppendL( numberTypeIconElem );
+                    CleanupStack::Pop( 2, numberTypeIcon );
+                    }
+                break;
+                }
+                
+            case EBMDefaultCallImageControl:
+                {
+                for ( TInt i = 0 ; i < maxCellAmount ; i++ )
+                    {
+                    CTelBubbleCallImage* image = 
+                        CTelBubbleCallImage::NewL();
+                    CleanupStack::PushL( image );
+                    image->SetContainerWindowL( iBubbleManager );
+                    image->SetParent( &iBubbleManager );
+                    CTelBubbleCustomElement* imageElem =  
+                        CTelBubbleCustomElement::NewL( image, 
+                            CTelBubbleCustomElement::ECallImage );
+                    CleanupStack::PushL( imageElem );
+                    single->AppendL( imageElem );
+                    CleanupStack::Pop(2,image);
+                    }
+                break;
+                }    
+                
+            default:
+                Panic( EBMPanicUnhandledSwitchCase );
+            }
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CBubbleDefaultManager* CBubbleDefaultManager::NewL(
+    CBubbleManager& aBubbleManager )
+    {
+    CBubbleDefaultManager* self = 
+        new( ELeave ) CBubbleDefaultManager( aBubbleManager );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBubbleDefaultManager::~CBubbleDefaultManager()
+    {
+    if ( iElements )
+        {
+        for ( TInt i = 0 ; i < iElements->Count() ; i++ )
+            {
+            if ( iElements->At( i ) )
+                {
+                iElements->At( i )->ResetAndDestroy();
+                }
+            }
+        iElements->ResetAndDestroy();
+        delete iElements;
+        }
+
+    iAvailabilities.Close();
+    iMaxAmounts.Close();    
+    }
+
+// ---------------------------------------------------------------------------
+// ReserveCallIndicatorElement
+// ---------------------------------------------------------------------------
+//
+CTelBubbleCustomElement* CBubbleDefaultManager::ReserveBigCallIndicatorElement(
+    const CBubbleHeader& aHeader )
+    {
+    CTelBubbleCustomElement* element;
+    CBubbleManager::TPhoneCallState state = aHeader.CallState();
+    
+    if ( state == CBubbleManager::EOutgoing ||
+         state == CBubbleManager::EAlertToDisconnected )
+        {
+        // Image
+        element = ReserveElement( EBMDefaultCallStatusIndiBig );
+        CBubbleCallStatusIndi* indi = 
+            static_cast<CBubbleCallStatusIndi*> ( element->Control() ); 
+        indi->ReadBubbleHeader( aHeader );
+        }
+    else
+        {
+        // Animation
+        element = ReserveElement( EBMDefaultCallStatusAnimBig );
+        CBubbleCallStatusAnim* anim =
+            static_cast<CBubbleCallStatusAnim*> ( element->Control() ); 
+        anim->ReadBubbleHeader( aHeader );
+        }    
+    
+    return element;
+    }
+
+// ---------------------------------------------------------------------------
+// ReserveSmallCallIndicatorElement
+// ---------------------------------------------------------------------------
+//
+CTelBubbleCustomElement* CBubbleDefaultManager::ReserveSmallCallIndicatorElement(
+    const CBubbleHeader& aHeader )
+    {
+    CTelBubbleCustomElement* element;
+    CBubbleManager::TPhoneCallState state = aHeader.CallState();
+    
+    if( state == CBubbleManager::EOutgoing ||
+        state == CBubbleManager::EWaiting ||
+        state == CBubbleManager::EAlerting )
+        {
+        // Show animation
+        element = ReserveElement( EBMDefaultCallStatusAnimSmall );
+        CBubbleCallStatusAnim* anim =
+            static_cast<CBubbleCallStatusAnim*> ( element->Control() ); 
+        anim->ReadBubbleHeader( aHeader );
+        }
+    else
+        {
+        // Show image
+        element = ReserveElement( EBMDefaultCallStatusIndiSmall );
+        CBubbleCallStatusIndi* indi = 
+            static_cast<CBubbleCallStatusIndi*> ( element->Control() ); 
+        indi->ReadBubbleHeader( aHeader );
+        }
+    
+    return element;
+    }
+
+// ---------------------------------------------------------------------------
+// ReserveNumberTypeIconElement
+// ---------------------------------------------------------------------------
+//
+CTelBubbleCustomElement* CBubbleDefaultManager::ReserveNumberTypeIconElement(
+     const CBubbleHeader& aHeader )
+    {
+    CTelBubbleCustomElement* element = 
+        ReserveElement( EBMDefaultNumberTypeIcon );
+    
+    CBubbleNumberTypeIcon* icon = 
+        static_cast<CBubbleNumberTypeIcon*> ( element->Control() ); 
+
+    icon->ReadBubbleHeader( aHeader );
+    
+    return element;
+    }
+
+// ---------------------------------------------------------------------------
+// ReserveCallerImageElement
+// ---------------------------------------------------------------------------
+//
+CTelBubbleCustomElement* CBubbleDefaultManager::ReserveCallImageElement(
+    const CBubbleHeader& /*aHeader*/ )
+    {
+    return ReserveElement( EBMDefaultCallImageControl );
+    }
+
+// ---------------------------------------------------------------------------
+// ReserveElement
+// ---------------------------------------------------------------------------
+//
+CTelBubbleCustomElement* CBubbleDefaultManager::ReserveElement(
+    TBubbleDefaultElements aType )
+    {
+    CTelBubbleCustomElement* element = NULL;
+    TUint amount = iElements->At( aType )->Count();
+    // 1 mean is reserved and 0 free slot
+    TUint& available = iAvailabilities[aType]; 
+    TUint bit = 1; // start from first bit
+    for ( TUint slot = 0 ; slot < amount ; slot++ )
+        {
+        // if flag is one the seat is taken...
+        if ( available&bit )
+            {
+            bit = bit<<1; //move to next bit of for next round
+            continue;
+            }
+
+        // so we found a free slot
+        element = iElements->At( aType )->At( slot );
+        if ( element != NULL )
+            {
+            available |= bit; // set the corrensponding bit 
+                              // for reserved indicator
+            }
+        break;
+        }
+    __ASSERT_DEBUG( element != NULL , 
+                    Panic( EBMPanicCustomization ) );
+    return element;
+    }
+
+// ---------------------------------------------------------------------------
+// ReleaseElement
+// ---------------------------------------------------------------------------
+//
+void CBubbleDefaultManager::ReleaseElement(
+    CTelBubbleCustomElement*& aElement )
+    {
+    if ( aElement == NULL )
+        {
+        return;
+        }
+
+    for ( TInt i = 0 ; i < iElements->Count() ; i++ )
+        {
+        CSingleElement* single = iElements->At( i );
+        TUint amount = single->Count();
+        TUint& available = iAvailabilities[i]; // 1 mean is reserved 
+                                                   // and 0 free slot
+        TUint bit = 1; // start from first bit
+        for ( TUint slot = 0 ; slot < amount ; slot++ )
+            {
+            if ( single->At( slot ) == aElement )
+                {
+                __ASSERT_DEBUG( available&bit, 
+                                Panic( EBMPanicCustomization ) );
+                available &= ~bit; // zero the corrensponding bit 
+                                   // for freed indicator
+                aElement = NULL;
+                break;
+                }
+            bit = bit<<1; //move to next bit of for next round
+            }
+        }
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMImageReader.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,197 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Reader for JPEG/GIF/BMP images (ImageHandlingLib wrapper)
+*
+*/
+
+
+#include <coemain.h>
+#include <IHLImageFactory.h>
+#include <IHLViewerFactory.h>
+#include <MIHLFileImage.h>
+#include <MIHLBitmap.h>
+#include <MIHLImageViewer.h>
+#include <IHLBitmapUtil.h>
+
+#include "BMImageReader.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+CBubbleImageReader::CBubbleImageReader()                                          
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CBubbleImageReader::ConstructL( const TDesC& aFileName )
+    {
+    iSourceImage = IHLImageFactory::OpenFileImageL( 
+        CCoeEnv::Static()->FsSession(),
+        aFileName );
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CBubbleImageReader* CBubbleImageReader::NewL(
+    const TDesC& aFileName )
+    {
+    CBubbleImageReader* self = new( ELeave ) CBubbleImageReader();
+    CleanupStack::PushL( self );
+    self->ConstructL( aFileName );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBubbleImageReader::~CBubbleImageReader()
+    {
+    delete iViewerEngine;
+    delete iDestinationBitmap;
+    delete iSourceImage;
+    }
+
+
+// ---------------------------------------------------------------------------
+// StartReadingL
+// ---------------------------------------------------------------------------
+//    
+void CBubbleImageReader::StartReadingL(
+    const TSize& aTargetSize,
+    const TReal& aScaleFactor,
+    const TRect& aClipRect, 
+    MBubbleMediaReaderObserver* aObserver )
+    {
+    iObserver = aObserver;
+    
+    iDestinationBitmap = IHLBitmap::CreateL();
+    
+    iViewerEngine = IHLViewerFactory::CreateImageViewerL(
+       aTargetSize,
+       *iSourceImage,
+       *iDestinationBitmap,
+       *this );
+       
+    iViewerEngine->SetZoomRatio( aScaleFactor );
+    iViewerEngine->SetViewerSize( aTargetSize );
+    iViewerEngine->SetSourceRectPosition( aClipRect.iTl );
+    }
+
+
+// ---------------------------------------------------------------------------
+// SetScaleAndClip
+// ---------------------------------------------------------------------------
+//
+TInt CBubbleImageReader::SetScaleAndClip(
+    const TSize& aTargetSize,
+    const TReal& aScaleFactor,
+    const TRect& aClipRect )
+    {
+    TInt err = KErrNone;
+    
+    if ( iViewerEngine )
+        {
+        iViewerEngine->SetZoomRatio( aScaleFactor );
+        iViewerEngine->SetViewerSize( aTargetSize );
+        iViewerEngine->SetSourceRectPosition( aClipRect.iTl );
+        }
+    else
+        {
+        err = KErrNotReady;    
+        }        
+    
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// CancelReadingL
+// ---------------------------------------------------------------------------
+//    
+void CBubbleImageReader::CancelReading()
+    {
+    delete iViewerEngine;
+    iViewerEngine = NULL;
+    }
+    
+// ---------------------------------------------------------------------------
+// CancelReadingL
+// ---------------------------------------------------------------------------
+//
+const TSize CBubbleImageReader::SourceSize() const 
+    { 
+    return iSourceImage->Size(); 
+    }
+
+// ---------------------------------------------------------------------------
+// CancelReadingL
+// ---------------------------------------------------------------------------
+//
+TBool CBubbleImageReader::IsAnimation() const
+    { 
+    //return iSourceImage->IsAnimation();
+    return EFalse; // Not supported. 
+    };    
+
+// ---------------------------------------------------------------------------
+// Play
+// ---------------------------------------------------------------------------
+//
+void CBubbleImageReader::Play()
+    {
+    iViewerEngine->Play();
+    }
+
+// ---------------------------------------------------------------------------
+// Stop
+// ---------------------------------------------------------------------------
+//
+void CBubbleImageReader::Stop()
+    {
+    iViewerEngine->Stop();
+    } 
+
+// ---------------------------------------------------------------------------
+// ViewerBitmapChangedL
+// ---------------------------------------------------------------------------
+//    
+void CBubbleImageReader::ViewerBitmapChangedL()
+    {
+    iFrameBuffer = &iDestinationBitmap->Bitmap();
+    iMask = iDestinationBitmap->HasMask() ? &iDestinationBitmap->Mask() :
+        NULL;
+
+    HandleReadingComplete();    
+    }
+
+// ---------------------------------------------------------------------------
+// ViewerError
+// ---------------------------------------------------------------------------
+//
+void CBubbleImageReader::ViewerError( TInt aError )
+    {
+    HandleReadingError( aError );    
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMMainPaneControl.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,282 @@
+/*
+* 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:  Call status indicator
+*
+*/
+
+
+#include "BMBubbleManager.h"
+#include "BMMainPaneControl.h"
+#include "BMCustomManager.h"
+#include "BMBubbleHeader.h"
+#include "BMUtils.h"
+#include "BMCallObjectManager.h"
+#include "BMBubbleImageManager.h"
+
+#include <telbubblecallimage.h>
+#include <AknIconUtils.h>
+#include <layoutmetadata.cdl.h>
+
+// ---------------------------------------------------------------------------
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+CBubbleMainPaneControl::CBubbleMainPaneControl( 
+    CBubbleManager& aBubbleManager,  
+    CBubbleCallObjectManager& aCallObjectManager ) : 
+    iBubbleManager( aBubbleManager ), 
+    iCallObjectManager ( aCallObjectManager )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CBubbleMainPaneControl::ConstructL()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CBubbleMainPaneControl* CBubbleMainPaneControl::NewL(
+    CBubbleManager& aBubbleManager,
+    CBubbleCallObjectManager& aCallObjectManager )
+    {
+    CBubbleMainPaneControl* self = 
+        new( ELeave ) CBubbleMainPaneControl( aBubbleManager, 
+                                               aCallObjectManager );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBubbleMainPaneControl::~CBubbleMainPaneControl()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// ReadBubbleHeader
+// ---------------------------------------------------------------------------
+//
+void CBubbleMainPaneControl::ReadBubbleHeader( 
+    const CBubbleHeader& aHeader )
+    {
+    iBubble = aHeader.BubbleId();
+    iBitmap = aHeader.CallObjectImage();
+    iMask = aHeader.CallObjectImageMask();
+    iThreeLinedBubble = ( aHeader.CNAP().Length() > 0 );
+    
+    if ( iBitmap )
+        {
+        CFbsBitmap* bitmap;
+        CFbsBitmap* mask;
+        TBool bitmapOwnership;
+        TBool maskOwnership;
+        
+        TRAPD(err, PrepareBitmapsL( bitmap, 
+                                    bitmapOwnership, 
+                                    mask, 
+                                    maskOwnership,
+                                    aHeader.CallObjectImageType() == 
+                                    CBubbleHeader::EThemeImage ) );
+        
+        if ( err )
+            {
+            return;
+            }
+
+        iCallImage = iBubbleManager.CustomManager().ReserveCustomElement(
+                aHeader, CTelBubbleCustomElement::ECallImage );
+        SizeChanged();
+        
+        if ( iCallImage->ControlType() == 
+             CTelBubbleCustomElement::EBubbleCallImage )
+            {
+            CTelBubbleCallImage* image = 
+                static_cast<CTelBubbleCallImage*> ( iCallImage->Control() );
+            image->SetImage( bitmap, EFalse, mask, maskOwnership );
+            } 
+        
+        iIsUsed = ETrue;
+        MakeVisible( ETrue );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// PrepareBitmapsL
+// ---------------------------------------------------------------------------
+//
+void CBubbleMainPaneControl::PrepareBitmapsL( 
+    CFbsBitmap*& aBitmap,
+    TBool& aBitmapOwnership, 
+    CFbsBitmap*& aMask,
+    TBool& aMaskOwnership,
+    TBool aIsScalable )
+    {
+    aBitmap = iBitmap;
+    aMask = iMask;
+    aBitmapOwnership = EFalse;
+    aMaskOwnership = EFalse;
+    
+    if ( aIsScalable )
+        {
+        // Switch to preloaded image when available
+        if ( iCallObjectManager.CallThemeImageIcon() )
+            {
+            aBitmap = iCallObjectManager.CallThemeImageIcon()->Bitmap();
+            aMask = iCallObjectManager.CallThemeImageIcon()->Mask();
+            }
+    
+        // Secure that SVG image is initialized
+        User::LeaveIfError( AknIconUtils::SetSize( aBitmap,
+             iBubbleManager.MainPaneImageRect().Size(),
+             EAspectRatioPreservedSlice ) != KErrNone );
+        }
+    
+    TSize imageSize = aBitmap->SizeInPixels();
+    TSize tinyImageSize( iBubbleManager.MainPaneImageRect( ETrue ).Size() );
+    TBool fullScreen = !( ( imageSize.iWidth <= tinyImageSize.iWidth ) &&
+                          ( imageSize.iHeight <= tinyImageSize.iHeight ) );  
+    
+    if ( iBubbleManager.IsTouchCallHandling() &&
+         fullScreen )
+        {
+        // Attach display mask to image.
+        CEikImage* displayMask = new( ELeave ) CEikImage;
+        CleanupStack::PushL( displayMask ); 
+    
+        TBMIcons maskId = 
+            Layout_Meta_Data::IsLandscapeOrientation() ?
+            EQgn_indi_call4_image_mask_lsc :
+            EQgn_indi_call4_image_mask_prt;
+    
+        iBubbleManager.ImageManager().SetBitmapToImage( 
+            displayMask,
+            maskId );
+    
+        User::LeaveIfError( AknIconUtils::SetSize( 
+            const_cast<CFbsBitmap*> (displayMask->Bitmap()),
+            imageSize,
+            EAspectRatioNotPreserved ) );
+            
+        if ( aMask )
+            {
+            // Combine display mask and image mask.
+            CFbsBitmap* combinedMask = 
+                BubbleUtils::CreateCombinedMaskL(
+                    displayMask->Bitmap(),
+                    aMask );        
+            aMask = combinedMask;
+            }
+        else
+            {
+            aMask = 
+                const_cast<CFbsBitmap*> ( displayMask->Bitmap());
+            displayMask->SetPictureOwnedExternally( ETrue );
+            }                        
+            
+        aMaskOwnership = ETrue;    
+        CleanupStack::PopAndDestroy( displayMask );
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// Reset
+// ---------------------------------------------------------------------------
+//
+void CBubbleMainPaneControl::Reset()
+    {
+    if ( iIsUsed )
+        {
+        iIsUsed = EFalse;
+        MakeVisible( EFalse );
+        iBubble = KErrNotFound;
+        
+        if ( iCallImage && 
+             iCallImage->ControlType() == 
+             CTelBubbleCustomElement::EBubbleCallImage )
+            {
+            CTelBubbleCallImage* image = 
+                static_cast<CTelBubbleCallImage*> ( iCallImage->Control() );
+            image->SetImage( NULL, EFalse, NULL, EFalse );
+            }
+        
+        iBubbleManager.CustomManager().ReleaseCustomElement( iCallImage );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// DrawBitmaps
+// ---------------------------------------------------------------------------
+//
+void CBubbleMainPaneControl::DrawBitmaps( const TRect& aRect ) const
+    {
+    if ( iCallImage )
+        {
+        // ToDo: propagate to components
+        iCallImage->Control()->DrawForeground( aRect );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleId
+// ---------------------------------------------------------------------------
+//
+CBubbleManager::TBubbleId CBubbleMainPaneControl::BubbleId() const
+    {
+    return iBubble;
+    }
+
+// ---------------------------------------------------------------------------
+// IsUsed
+// ---------------------------------------------------------------------------
+//
+TBool CBubbleMainPaneControl::IsUsed() const
+    {
+    return iIsUsed;
+    }
+
+// ---------------------------------------------------------------------------
+// SizeChanged
+// ---------------------------------------------------------------------------
+//
+void CBubbleMainPaneControl::SizeChanged()
+    {
+    if ( iCallImage )
+        {
+        iCallImage->Control()->SetRect( Rect() );
+        if ( iCallImage->ControlType() == 
+             CTelBubbleCustomElement::EBubbleCallImage )
+            {
+            CTelBubbleCallImage* image = 
+                static_cast<CTelBubbleCallImage*> ( iCallImage->Control() );
+            TRect imageArea( iBubbleManager.MainPaneImageRect( 
+                                 ETrue, iThreeLinedBubble ) );
+            
+            image->SetImagePlacingArea( imageArea );
+            }
+        }
+    }
+
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMMediaReader.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Base class for media readers.
+*
+*/
+
+
+#include "BMMediaReader.h"
+#include "BMMediaReaderObserver.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CBubbleMediaReader::CBubbleMediaReader()
+    {
+    
+    }    
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBubbleMediaReader::~CBubbleMediaReader()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// HandleReadingComplete
+// ---------------------------------------------------------------------------
+//
+void CBubbleMediaReader::HandleReadingComplete()
+    {
+    if ( iObserver )
+        {
+        iObserver->FrameBufferDataChanged();            
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// HandleReadingError
+// ---------------------------------------------------------------------------
+//
+void CBubbleMediaReader::HandleReadingError( TInt aError )
+    {
+    if ( iObserver )
+        {
+        iObserver->ReaderError( aError );            
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// FrameBuffer
+// ---------------------------------------------------------------------------
+//    
+const CFbsBitmap* CBubbleMediaReader::FrameBuffer() const 
+    { 
+    return iFrameBuffer;
+    }
+
+// ---------------------------------------------------------------------------
+// Mask
+// ---------------------------------------------------------------------------
+//    
+const CFbsBitmap* CBubbleMediaReader::Mask() const
+    { 
+    return iMask;
+    }
+    
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMMediaReaderFactory.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Creator of media readers.
+*
+*/
+
+
+#include "BMMediaReaderFactory.h"
+#include "BMImageReader.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CreateReaderL
+// ---------------------------------------------------------------------------
+//
+MBubbleMediaReader* BubbleMediaReaderFactory::CreateReaderL( 
+    const TDesC& aFileName )
+    {
+    // To be done: Reader selection to be based on MIME type
+    // or file extension. Now there is just one default reader
+    // available. 
+    return CBubbleImageReader::NewL( aFileName );  
+    }
+
+
+    
+    
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMNumberTypeIcon.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,238 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Number type icon
+*
+*/
+
+
+#include "BMNumberTypeIcon.h"
+#include "BMBubbleImageManager.h"
+#include "BMBubbleHeader.h"
+
+// ---------------------------------------------------------------------------
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+CBubbleNumberTypeIcon::CBubbleNumberTypeIcon( 
+    CBubbleImageManager& aImageManager ) :
+    iImageManager( aImageManager )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CBubbleNumberTypeIcon::ConstructL()
+    {
+    CTelBubbleImage::ConstructL();
+    }
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CBubbleNumberTypeIcon* CBubbleNumberTypeIcon::NewL(
+        CBubbleImageManager& aImageManager )
+    {
+    CBubbleNumberTypeIcon* self = 
+        new( ELeave ) CBubbleNumberTypeIcon( aImageManager );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBubbleNumberTypeIcon::~CBubbleNumberTypeIcon()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// ReadBubbleHeader
+// ---------------------------------------------------------------------------
+//
+void CBubbleNumberTypeIcon::ReadBubbleHeader( const CBubbleHeader& aHeader )
+    {
+    iNumberType = aHeader.NumberType();
+    iCallFlags = aHeader.CallFlags();
+    }
+
+// ---------------------------------------------------------------------------
+// MakeVisible
+// ---------------------------------------------------------------------------
+//
+void CBubbleNumberTypeIcon::MakeVisible(TBool aVisible)
+    {
+    CTelBubbleImage::MakeVisible( aVisible );
+    
+    if( aVisible )
+        {
+        TInt picture = KErrNotFound;
+        TInt pictureMask = KErrNotFound;
+        
+        switch ( iNumberType )
+            {
+            case CBubbleManager::EHome:
+                if ( iCallFlags&CBubbleManager::EDiverted )
+                    {
+                    picture = EQgn_prop_nrtyp_home_div;
+                    pictureMask = EQgn_prop_nrtyp_home_div_mask;
+                    }
+                else
+                    {
+                    picture = EQgn_prop_nrtyp_home;
+                    pictureMask = EQgn_prop_nrtyp_home_mask;
+                    }
+                break;
+            case CBubbleManager::EMobile:
+                if ( iCallFlags&CBubbleManager::EDiverted )
+                    {
+                    picture = EQgn_prop_nrtyp_mobile_div;
+                    pictureMask = EQgn_prop_nrtyp_mobile_div_mask;
+                    }
+                else
+                    {
+                    picture = EQgn_prop_nrtyp_mobile;
+                    pictureMask = EQgn_prop_nrtyp_mobile_mask;
+                    }
+                break;
+            case CBubbleManager::EWork:
+                if ( iCallFlags&CBubbleManager::EDiverted )
+                    {
+                    picture = EQgn_prop_nrtyp_work_div;
+                    pictureMask = EQgn_prop_nrtyp_work_div_mask;
+                    }
+                else
+                    {
+                    picture = EQgn_prop_nrtyp_work;
+                    pictureMask = EQgn_prop_nrtyp_work_mask;
+                    }
+                break;
+            case CBubbleManager::EPhone:
+                if ( iCallFlags&CBubbleManager::EDiverted )
+                    {
+                    picture = EQgn_prop_nrtyp_phone_div;
+                    pictureMask = EQgn_prop_nrtyp_phone_div_mask;
+                    }
+                else
+                    {
+                    picture = EQgn_prop_nrtyp_phone;
+                    pictureMask = EQgn_prop_nrtyp_phone_mask;
+                    }
+                break;
+            case CBubbleManager::EFaxNumber:
+                if ( iCallFlags&CBubbleManager::EDiverted )
+                    {
+                    picture = EQgn_indi_call_diverted;
+                    pictureMask = EQgn_indi_call_diverted_mask;
+                    }
+                else
+                    {
+                    picture = EQgn_prop_nrtyp_fax;
+                    pictureMask = EQgn_prop_nrtyp_fax_mask;
+                    }
+                break;
+            case CBubbleManager::EPager:
+                if ( iCallFlags&CBubbleManager::EDiverted )
+                    {
+                    picture = EQgn_indi_call_diverted;
+                    pictureMask = EQgn_indi_call_diverted_mask;
+                    }
+                else
+                    {
+                    picture = EQgn_prop_nrtyp_pager;
+                    pictureMask = EQgn_prop_nrtyp_pager_mask;
+                    }
+                break;
+            case CBubbleManager::ECar:
+                if ( iCallFlags&CBubbleManager::EDiverted )
+                    {
+                    picture = EQgn_indi_call_diverted;
+                    pictureMask = EQgn_indi_call_diverted_mask;
+                    }
+                else
+                    {
+                    picture = EQgn_prop_nrtyp_car;
+                    pictureMask = EQgn_prop_nrtyp_car_mask;
+                    }
+                break;            
+            case CBubbleManager::EAssistant:
+                if ( iCallFlags&CBubbleManager::EDiverted )
+                    {
+                    picture = EQgn_indi_call_diverted;
+                    pictureMask = EQgn_indi_call_diverted_mask;
+                    }
+                else
+                    {
+                    picture = EQgn_prop_nrtyp_assistant;
+                    pictureMask = EQgn_prop_nrtyp_assistant_mask;
+                    }
+                break;            
+            case CBubbleManager::ENotSet: // Flow through
+            default:
+                if ( iCallFlags&CBubbleManager::EDiverted )
+                    {
+                    picture = EQgn_indi_call_diverted;
+                    pictureMask = EQgn_indi_call_diverted_mask;
+                    }
+                break;
+            }
+
+        if ( iCallFlags&CBubbleManager::EVideo )
+            {
+            // No number type icon for video call
+            if ( iCallFlags&CBubbleManager::EDiverted )
+                {
+                picture = EQgn_indi_call_diverted;
+                pictureMask = EQgn_indi_call_diverted_mask;
+                }
+            else
+                {
+                picture = KErrNotFound;
+                pictureMask = KErrNotFound;            
+                }            
+            }
+        
+        if ( pictureMask == KErrNotFound )
+            {
+            CEikImage* self = static_cast<CEikImage*>(this);
+            iImageManager.SetBitmapToImage( 
+               self, 
+               (TBMIcons)picture );
+            }
+        else
+            {
+            CEikImage* self = static_cast<CEikImage*>(this);
+            iImageManager.SetBitmapToImage( 
+               self, 
+               (TBMIcons)picture, 
+               (TBMIcons)pictureMask );
+            }
+
+        }
+    else
+        {
+        SetPicture( NULL, NULL );
+        }
+
+    
+    };
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMPanic.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Panic function
+*
+*/
+
+
+#include "BMPanic.h"
+
+#ifdef _DEBUG
+    _LIT( KBMPanicCategory, "Bubblemanager" );
+#endif    
+
+GLREF_C void Panic( 
+#ifdef _DEBUG                  
+                TBMPanic aPanic
+#else           
+                TBMPanic /*aPanic*/
+#endif
+                )
+    {
+    // May be used in debug purposes. We do not really want 
+    // to kill phone app's thread..
+    __ASSERT_DEBUG( EFalse, User::Panic( KBMPanicCategory, aPanic ) );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMResourceManager.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,315 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource Manager
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMResourceManager.h"
+#include    "BMBubbleManager.h"
+#include    "BMUtils.h"
+#include    "BMPanic.h"
+#include    "BMBubbleImage.h"
+#include    <eikimage.h>            //CEikImage
+#include    <eiklabel.h>            //CEikLabel
+#include    <AknsUtils.h>
+
+// CONSTANTS
+const TInt KBubbleMaxEikImages = 17;
+const TInt KBubbleMaxEikLabels = 6;
+
+// ================= MEMBER FUNCTIONS * ======================================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CBubbleResourceManager::CBubbleResourceManager( CBubbleManager& aParentWindow )
+: iParentWindow( aParentWindow )
+    {
+    }
+
+// Symbian OS default constructor can leave.
+void CBubbleResourceManager::ConstructL()
+    {
+    // Set max values to each resource
+    iMaxAmounts.Append( KBubbleMaxEikImages );
+    iMaxAmounts.Append( KBubbleMaxEikLabels );
+
+    const TInt kDifferentResources = iMaxAmounts.Count();
+
+    // Zero all availabilities
+    for ( TInt i = 0 ; i < kDifferentResources ; i++ )
+        {
+        iAvailabilities.Append( 0 );
+        }
+    
+
+    // Create main array
+    iResources = new( ELeave ) 
+                    CArrayPtrFlat<CSingleResource>( kDifferentResources );
+    iResources->SetReserveL( kDifferentResources );
+
+    // Create arrays inside the main array and add them to the main array
+    TInt resource = 0;
+    for ( resource = 0 ; resource < kDifferentResources ; resource++ )
+        {
+        CSingleResource* single = new( ELeave ) 
+                                    CSingleResource( iMaxAmounts[resource] );
+        CleanupStack::PushL( single );
+        single->SetReserveL( iMaxAmounts[resource] );
+        iResources->AppendL( single );
+        CleanupStack::Pop(); // single
+        }
+
+    //Create components to individual arrays:
+    for ( resource = 0 ; resource < kDifferentResources ; resource++ )
+        {
+        TInt maxCellAmount = iMaxAmounts[resource];
+        CSingleResource* single = iResources->At( resource );
+        switch( resource )
+            {
+            case EBMEikImage:
+                {
+                for ( TInt i = 0 ; i < maxCellAmount ; i++ )
+                    {
+                    CBubbleImage* newImage = new( ELeave ) CBubbleImage;
+                    CleanupStack::PushL( newImage );
+                    newImage->SetContainerWindowL( iParentWindow );
+                    newImage->SetParent( &iParentWindow );
+                    newImage->SetPictureOwnedExternally( ETrue );
+                    newImage->SetPicture( NULL );
+                    newImage->MakeVisible( EFalse );
+                    single->AppendL( newImage );
+                    CleanupStack::Pop(); //newImage
+                    }
+                break;
+                }
+            case EBMEikLabel:
+                {
+                for ( TInt i = 0 ; i < maxCellAmount ; i++ )
+                    {
+                    CEikLabel* newText = new( ELeave ) CEikLabel;
+                    CleanupStack::PushL( newText );
+                    newText->SetContainerWindowL( iParentWindow );
+                    newText->SetParent( &iParentWindow );
+                    newText->SetBufferReserveLengthL( KBubbleLabelMaxLength );
+                    newText->SetTextL( KNullDesC );
+                    single->AppendL( newText );
+                    CleanupStack::Pop(); //newText
+                    }
+                break;
+                }
+            default:
+                Panic( EBMPanicUnhandledSwitchCase );
+            }
+        }
+    }
+
+// Two-phased constructor.
+CBubbleResourceManager* CBubbleResourceManager::NewL( 
+    CBubbleManager& aParentWindow )
+    {
+    CBubbleResourceManager* self = 
+                        new (ELeave) CBubbleResourceManager( aParentWindow );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+    
+// Destructor
+CBubbleResourceManager::~CBubbleResourceManager()
+    {
+    if ( iResources )
+        {
+        // Destroy the inner arrays
+        for ( TInt i = 0 ; i < iResources->Count() ; i++ )
+            {
+            if ( iResources->At( i ) )
+                {
+                iResources->At( i )->ResetAndDestroy();
+                }
+            }
+        iResources->ResetAndDestroy();
+        delete iResources;
+        }
+
+    iAvailabilities.Close();
+    iMaxAmounts.Close();
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// CBubbleResourceManager::ActivateL
+// Activates all the controls.
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleResourceManager::ActivateL()
+    {
+    TInt resourcesTotal = iResources->Count();
+    for ( TInt oneResource = 0 ; oneResource < resourcesTotal ; oneResource++ )
+        {
+        CSingleResource* singleResource = iResources->At( oneResource );
+        TInt elementsTotal = singleResource->Count();
+        for ( TInt element = 0 ; element < elementsTotal ; element++)
+            {
+            singleResource->At( element )->ActivateL();
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleResourceManager::ReserveEikLabel
+// Gets free label and returns pointer to it.
+// 
+// ---------------------------------------------------------------------------
+//
+CEikLabel* CBubbleResourceManager::ReserveEikLabel()
+    {
+    CEikLabel* label = NULL;
+    ReserveResource( (CCoeControl*&)label , EBMEikLabel );
+    return label;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleResourceManager::ReleaseEikLabel
+// Zeros the label and releases it.
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleResourceManager::ReleaseEikLabel( CEikLabel*& aLabel )
+    {
+    if ( aLabel )
+        {
+        BubbleUtils::AddTextToEikLabel( aLabel , KNullDesC );
+        }
+    ReleaseResource( (CCoeControl*&)aLabel , EBMEikLabel );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleResourceManager::ReserveEikImage
+// Gets new image object and sets it visible.
+// 
+// ---------------------------------------------------------------------------
+//
+CEikImage* CBubbleResourceManager::ReserveEikImage( 
+    TBool aIsBackgroundImage )
+    {
+    CBubbleImage* image = NULL;
+    ReserveResource( ( CCoeControl*& )image , EBMEikImage );
+    if ( image )
+        {
+        if( aIsBackgroundImage )
+            {
+            image->SetAsBackgroundImage( ETrue );
+            }
+        image->MakeVisible( ETrue );
+        }
+    return image;
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleResourceManager::ReleaseEikImage
+// NULLs the bitmaps, makes invisible and releases the image.
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleResourceManager::ReleaseEikImage( CEikImage*& aImage )
+    {
+    if ( aImage )
+        {
+        aImage->SetPicture( NULL , NULL );
+        aImage->SetPictureOwnedExternally( ETrue );
+        aImage->MakeVisible( EFalse );
+        static_cast<CBubbleImage*>( aImage )->SetAsBackgroundImage( EFalse );
+        }
+    ReleaseResource( (CCoeControl*&)aImage , EBMEikImage );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CBubbleResourceManager::ReserveResource
+// Reserves some CCoeControl. Uses the second parameter for indexing
+// the main arrays.
+// ---------------------------------------------------------------------------
+//
+void CBubbleResourceManager::ReserveResource( CCoeControl*& aResource , 
+                                              TBubbleResource aType )
+    {
+    TUint amount = iResources->At( aType )->Count();
+    // 1 mean is reserved and 0 free slot
+    TUint& available = iAvailabilities[aType]; 
+    TUint bit = 1; // start from first bit
+    for ( TUint slot = 0 ; slot < amount ; slot++ )
+        {
+        // if flag is one the seat is taken...
+        if ( available&bit )
+            {
+            bit = bit<<1; //move to next bit of for next round
+            continue;
+            }
+
+        // so we found a free slot
+        aResource = iResources->At( aType )->At( slot );
+        if ( aResource != NULL )
+            {
+            available |= bit; // set the corrensponding bit 
+                              // for reserved indicator
+            }
+        break;
+        }
+    __ASSERT_DEBUG( aResource != NULL , Panic( EBMPanicImages ) );
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleResourceManager::ReleaseResource
+// Releases CCoeControl object.
+// 
+// ---------------------------------------------------------------------------
+//
+void CBubbleResourceManager::ReleaseResource( CCoeControl*& aResource , 
+                                              TBubbleResource aType )
+    {
+    if ( aResource == NULL )
+        {
+        return;
+        }
+
+    CSingleResource* single = iResources->At( aType );
+    TUint amount = single->Count();
+    TUint& available = iAvailabilities[aType]; // 1 mean is reserved 
+                                               // and 0 free slot
+    TUint bit = 1; // start from first bit
+    for ( TUint slot = 0 ; slot < amount ; slot++ )
+        {
+        if ( single->At( slot ) == aResource )
+            {
+            __ASSERT_DEBUG( available&bit , Panic( EBMPanicImages ) );
+            available &= ~bit; // zero the corrensponding bit 
+                               // for freed indicator
+            aResource = NULL;
+            break;
+            }
+        bit = bit<<1; //move to next bit of for next round
+        }
+    __ASSERT_DEBUG( aResource == NULL , Panic( EBMPanicImages ) );
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMTouchPane.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,473 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 touch controls.
+*
+*/
+
+
+#include <layoutmetadata.cdl.h>
+#include <barsread.h>
+
+#include "BMTouchPane.h"
+#include "BMPanic.h"
+#include "BMLayout4.h"
+#include "BMLayout6.h"
+#include "BMTouchPaneButton.h"
+
+// CONSTANTS
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// C++ default constructor
+// ---------------------------------------------------------------------------
+//
+CBubbleTouchPane::CBubbleTouchPane()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CBubbleTouchPane::ConstructL()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CBubbleTouchPane* CBubbleTouchPane::NewL()
+    {
+    CBubbleTouchPane* self = new(ELeave) CBubbleTouchPane;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBubbleTouchPane::~CBubbleTouchPane()
+    {
+    iButtons.ResetAndDestroy();
+    iButtons.Close();
+    
+    iButtonsToBeDeleted.ResetAndDestroy();
+    iButtonsToBeDeleted.Close();
+    delete iIdleProcessor; 
+    }
+
+// ---------------------------------------------------------------------------
+// SizeChanged
+// ---------------------------------------------------------------------------
+//
+void CBubbleTouchPane::SizeChanged( )
+    {
+    if ( !iButtons.Count() )
+        return;
+    
+    // button index
+    //  1 2  OR  1 2 3 4
+    //  3 4
+    TInt i = 0;
+    
+    TInt rows = 0;
+    TInt columns = 0;
+    BubbleLayout6::button_grp_row_column_count(0, rows, columns);
+    for ( TInt row = 0; row < rows; row++ )
+        {
+        for ( TInt col = 0; col < columns; col++ )
+            {
+            TAknLayoutRect buttonPane;        
+            buttonPane.LayoutRect( 
+                Rect(), 
+                BubbleLayout6::cell_call6_button_pane(0, col, row) );
+            
+            if ( i < iButtons.Count() && iButtons[i] )
+                {
+                // Button control layout according to background
+                AknLayoutUtils::LayoutControl( 
+                    iButtons[i], 
+                    buttonPane.Rect(), 
+                    BubbleLayout6::button_call6_background_graphics(0)); 
+                
+                TAknLayoutText text;
+                text.LayoutText( buttonPane.Rect(), 
+                        BubbleLayout6::button_call6_function_text(0));
+
+                TAknLayoutRect icon;
+                icon.LayoutRect( buttonPane.Rect(), 
+                        BubbleLayout6::button_call6_function_graphics(0));   
+                
+                iButtons[i]->SetIconSize( icon.Rect().Size() );
+                iButtons[i++]->SetLayout( text, icon.Rect() );
+                }
+            }            
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CountComponentControls
+// ---------------------------------------------------------------------------
+//
+TInt CBubbleTouchPane::CountComponentControls( ) const
+    {
+    return iButtons.Count();            
+    }
+
+// ---------------------------------------------------------------------------
+// ComponentControl
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CBubbleTouchPane::ComponentControl( TInt aIndex ) const
+    {
+    return iButtons[ aIndex ];
+    }
+
+// ---------------------------------------------------------------------------
+// HandlePointerEventL
+// ---------------------------------------------------------------------------
+//
+void CBubbleTouchPane::HandlePointerEventL
+    ( const TPointerEvent& aPointerEvent )           
+    {
+    CCoeControl::HandlePointerEventL( aPointerEvent );
+    }
+
+// ---------------------------------------------------------------------------
+// HandleControlEventL
+// ---------------------------------------------------------------------------
+//    
+void CBubbleTouchPane::HandleControlEventL(
+    CCoeControl* aControl, 
+    TCoeEvent aEventType)
+    {
+    if ( aEventType != EEventStateChanged )
+        {
+        return;
+        }
+    
+    CBubbleTouchPaneButton* tappedButton = NULL;
+    for ( TInt i=0; i < iButtons.Count(); i++ )
+        {
+        if ( iButtons[i] == aControl )
+            {
+            tappedButton = iButtons[i];
+            break;
+            }    
+        }
+    if ( tappedButton )
+        {
+        iDeleteButtonsAsync = ETrue;
+        CEikAppUi* appUi = CEikonEnv::Static()->EikAppUi();
+        appUi->HandleCommandL( tappedButton->CommandId( ETrue ) );
+        iDeleteButtonsAsync = EFalse;
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// HandleResourceChange
+// ---------------------------------------------------------------------------
+//    
+void CBubbleTouchPane::HandleResourceChange( TInt aType )
+    {
+    for ( TInt i=0; i < iButtons.Count(); i++ )
+        {
+        iButtons[i]->HandleResourceChange( aType );
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// SetUpdating
+// ---------------------------------------------------------------------------
+//    
+void CBubbleTouchPane::SetUpdating( TBool aUpdating )
+    {
+    iUpdating = aUpdating;    
+    }
+
+// ---------------------------------------------------------------------------
+// IdleCallback
+// ---------------------------------------------------------------------------
+//     
+TInt CBubbleTouchPane::IdleCallback( TAny* aThis )
+    {
+    CBubbleTouchPane* self = 
+            static_cast<CBubbleTouchPane*>( aThis );
+    self->DoDeleteButtonsInIdle();
+    return KErrNone;                
+    }
+
+// ---------------------------------------------------------------------------
+// DoDeleteButtonsInIdle
+// ---------------------------------------------------------------------------
+//
+void CBubbleTouchPane::DoDeleteButtonsInIdle()
+    {
+    iButtonsToBeDeleted.ResetAndDestroy();
+    }
+
+// ---------------------------------------------------------------------------
+// SetButtonSet
+// ---------------------------------------------------------------------------
+//
+TInt CBubbleTouchPane::SetButtonSet( TInt aResourceId )
+    {
+    TRAPD( err, SetButtonSetL( aResourceId ) );
+    
+    return err;    
+    }
+
+// ---------------------------------------------------------------------------
+// SetButtonSetL
+// ---------------------------------------------------------------------------
+//
+void CBubbleTouchPane::SetButtonSetL( TInt aResourceId )
+    {
+    // reset touch pane
+    if ( iDeleteButtonsAsync )
+        {
+        // swap buttons to another array
+        for ( TInt i=0; i < iButtons.Count(); i++  )
+            {
+            iButtonsToBeDeleted.AppendL( iButtons[i] );    
+            }
+            
+        iButtons.Reset();            
+        }
+    else
+        {
+        iButtons.ResetAndDestroy();    
+        }        
+        
+    if ( iButtonsToBeDeleted.Count() )        
+        {
+        if ( !iIdleProcessor )
+            {
+            iIdleProcessor = CIdle::NewL( CActive::EPriorityIdle );                
+            }
+        
+        if ( !iIdleProcessor->IsActive() )
+            {
+            TCallBack idleCallback( IdleCallback, this );
+            iIdleProcessor->Start( idleCallback );            
+            }            
+        }
+    
+    iCurrentButtonSetId = 0;
+    
+    // load new buttons
+    if ( aResourceId )    
+        {
+        TResourceReader reader;
+        iCoeEnv->CreateResourceReaderLC( reader, aResourceId );
+        LoadButtonsFromResourceL( reader );
+        CleanupStack::PopAndDestroy();
+        iCurrentButtonSetId = aResourceId;
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// LoadButtonsFromResourceL
+// ---------------------------------------------------------------------------
+//
+void CBubbleTouchPane::LoadButtonsFromResourceL( TResourceReader& aReader )
+    {
+    __ASSERT_DEBUG( (iButtons.Count() == 0), Panic( EBMPanicTouchPane ) );
+    
+    TInt flags = aReader.ReadInt16();
+    
+    TInt buttonCount = aReader.ReadInt16();
+    for ( TInt i=0; i < buttonCount; i++ )    
+        {
+        TInt buttonId( aReader.ReadInt32() );
+        TResourceReader buttonReader;
+        iCoeEnv->CreateResourceReaderLC( buttonReader, buttonId );
+        
+        CBubbleTouchPaneButton* button = CBubbleTouchPaneButton::NewL( 
+                iIconProvider, flags );
+        CleanupStack::PushL( button );
+        button->ConstructFromResouceL( buttonReader ); 
+        
+        CleanupStack::Pop( button );
+        CleanupStack::PopAndDestroy(); // buttonReader
+        
+        iButtons.Append( button );
+        }
+        
+    for ( TInt i=0; i < iButtons.Count(); i++ )
+        {
+        CBubbleTouchPaneButton* button = iButtons[i];
+        button->SetContainerWindowL( *this );
+        button->SetObserver( this );    
+        button->ActivateL();
+        }        
+    
+    SizeChanged();
+    if ( IsVisible() )        
+        {
+        if ( iUpdating )
+            {
+            DrawDeferred();                
+            }
+        else
+            {
+            DrawNow();            
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// SetButtonState
+// ---------------------------------------------------------------------------
+//    
+void CBubbleTouchPane::SetButtonState( TInt aCommand )
+    {
+    for ( TInt i=0; i < iButtons.Count(); i++ )
+        {
+        TBool drawNow = ( IsVisible() && !iUpdating ) ? ETrue : EFalse;
+        iButtons[i]->SetState( aCommand, drawNow );    
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// SetButtonDimmed
+// ---------------------------------------------------------------------------
+//
+void CBubbleTouchPane::SetButtonDimmed( TInt aCommand, TBool aDimmed )
+    {
+    TInt buttonCount = iButtons.Count();
+    
+    for ( TInt i=0; i < buttonCount; i++ )
+        {
+        if ( iButtons[i]->CommandId() == aCommand )
+            {
+            iButtons[i]->SetDimmed( aDimmed );                
+            }
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// NumberOfButtonsInPane
+// ---------------------------------------------------------------------------
+//    
+TInt CBubbleTouchPane::NumberOfButtonsInPane()  const
+    {
+    return CountComponentControls();
+    }
+
+// ---------------------------------------------------------------------------
+// ButtonCommandId
+// ---------------------------------------------------------------------------
+//
+TInt CBubbleTouchPane::ButtonCommandId( TInt aButtonIndex ) const
+    {
+    return iButtons[ aButtonIndex ]->CommandId();    
+    }
+
+// ---------------------------------------------------------------------------
+// ButtonHasState
+// ---------------------------------------------------------------------------
+//    
+TBool CBubbleTouchPane::ButtonHasState( TInt aButtonIndex, TInt aCommand ) const
+    {
+    return iButtons[ aButtonIndex ]->HasState( aCommand );   
+    }
+
+// ---------------------------------------------------------------------------
+// ReplaceButton
+// ---------------------------------------------------------------------------
+//    
+TInt CBubbleTouchPane::ReplaceButton( TInt aButtonIndex, TInt aResourceId )
+    {
+    TInt err;
+    
+    if ( 0 <= aButtonIndex && aButtonIndex < iButtons.Count() &&
+         aResourceId )
+        {
+        TRAP( err, ReplaceButtonL( aButtonIndex, aResourceId ) );
+        }
+    else
+        {
+        err = KErrGeneral;    
+        }        
+            
+    return err;    
+    }
+
+// ---------------------------------------------------------------------------
+// ReplaceButton
+// ---------------------------------------------------------------------------
+//    
+void CBubbleTouchPane::ReplaceButtonL( TInt aButtonIndex, TInt aResourceId )
+    {
+    TResourceReader reader;
+    iCoeEnv->CreateResourceReaderLC( reader, aResourceId );
+       
+    CBubbleTouchPaneButton* button = CBubbleTouchPaneButton::NewL( 
+                                     iIconProvider);
+    CleanupStack::PushL( button );
+    button->ConstructFromResouceL( reader ); 
+        
+    CleanupStack::Pop( button );
+    CleanupStack::PopAndDestroy(); // reader
+        
+    button->SetContainerWindowL( *this );
+    button->SetObserver( this );    
+    button->ActivateL();
+        
+    if ( !iDeleteButtonsAsync )
+        {
+        delete iButtons[ aButtonIndex ];
+        iButtons[ aButtonIndex ] = NULL;        
+        }
+    else
+        {
+        iButtonsToBeDeleted.Append( iButtons[ aButtonIndex ] );
+        iButtons[ aButtonIndex ] = NULL;    
+        if ( !iIdleProcessor )
+            {
+            iIdleProcessor = CIdle::NewL( CActive::EPriorityIdle );                
+            }
+            
+        if ( !iIdleProcessor->IsActive() )
+            {
+            TCallBack idleCallback( IdleCallback, this );
+            iIdleProcessor->Start( idleCallback );            
+            }
+        }            
+        
+    iButtons[ aButtonIndex ] = button;
+        
+    SizeChanged();
+    if ( IsVisible() )        
+        {
+        DrawDeferred();            
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// SetIconProvider
+// ---------------------------------------------------------------------------
+//
+void CBubbleTouchPane::SetIconProvider(
+    MBubbleTouchPaneIconProvider* aIconProvider )
+    {
+    iIconProvider = aIconProvider;    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMTouchPaneButton.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,412 @@
+/*
+* 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:  Button for touch pane.
+*
+*/
+
+#include <AknBidiTextUtils.h>
+#include <aknsdrawutils.h>
+#include <aknlayoutscalable_avkon.cdl.h>
+#include <gulicon.h>
+#include <barsread.h> 
+#include <AknsFrameBackgroundControlContext.h>
+#include <aknsconstants.h>
+
+#include "bmtouchpanebutton.h"
+#include "BMTouchPaneInterface.h"
+#include "bmpanic.h"
+
+
+const TInt KBubbleButtonText = 255;
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// C++ default constructor
+// ---------------------------------------------------------------------------
+//
+CBubbleTouchPaneButton::CBubbleTouchPaneButton(
+    MBubbleTouchPaneIconProvider* aIconProvider,
+    const TInt aFlags ) :
+    CAknButton( aFlags ),
+    iIconProvider( aIconProvider )
+    {
+    }
+    
+// -----------------------------------------------------------------------------
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CBubbleTouchPaneButton* CBubbleTouchPaneButton::NewL( 
+        MBubbleTouchPaneIconProvider* aIconProvider, 
+        const TInt aFlags )
+    {
+    CBubbleTouchPaneButton* self = 
+    new(ELeave) CBubbleTouchPaneButton( aIconProvider, aFlags );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// Symbian 2nd phase constructor 
+// -----------------------------------------------------------------------------
+//
+void CBubbleTouchPaneButton::ConstructL()
+    {
+    CAknButton::ConstructL();
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBubbleTouchPaneButton::~CBubbleTouchPaneButton()
+    {
+    iCommands.Close();   
+    }
+        
+// ---------------------------------------------------------------------------
+// CBubbleTouchPaneButton::ConstructFromResouceL
+// ---------------------------------------------------------------------------
+//
+void CBubbleTouchPaneButton::ConstructFromResouceL( TResourceReader& aReader )
+    {
+    
+    TInt commandCount = aReader.ReadInt16();
+    for ( TInt i=0; i < commandCount; i++ )    
+        {
+        TInt command = aReader.ReadInt16();
+        iCommands.AppendL( command );
+        }
+    
+    aReader.ReadInt16(); // this is mystery?
+    
+    CAknButton::ConstructFromResourceL( aReader );
+    
+    // function button text color
+    SetTextColorIds( KAknsIIDQsnTextColors, 
+                              EAknsCIQsnTextColorsCG65 );
+    
+    // Customize icons
+    if ( iIconProvider )
+        {
+        LoadCustomIcons( *iIconProvider );
+        }
+    
+    if ( State()->Icon() )
+        {
+        SetIconScaleMode( EAspectRatioPreserved );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleTouchPaneButton::LoadCustomIconsL
+// ---------------------------------------------------------------------------
+//    
+void CBubbleTouchPaneButton::LoadCustomIcons(
+    MBubbleTouchPaneIconProvider& aIconProvider )
+    {
+    TInt commandCount = iCommands.Count();
+    
+    for ( TInt i=0; i < commandCount; i++ )    
+        {
+        CGulIcon* icon = NULL;
+           
+        TRAPD( err, icon = aIconProvider.GetIconForCommandL( 
+                               iCommands[i] ) );
+     
+        if ( !err && icon )       
+            {
+            CAknButtonState* state = State( i );
+            // State takes ownership of icon
+            state->SetIcon( icon );                
+            }
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleTouchPaneButton::CommandId
+// ---------------------------------------------------------------------------
+//
+TInt CBubbleTouchPaneButton::CommandId( TBool aPreviousState ) const
+    {
+    __ASSERT_DEBUG( iCommands.Count(), Panic( EBMPanicTouchPane ) );
+    
+    TInt command;
+    if ( iCommands.Count() > 1 )
+        {
+        TInt index =  StateIndex();
+        if ( aPreviousState )
+            {
+            // return command from previous state
+            index -= 1;
+            if ( index < 0 )
+                {
+                index = iCommands.Count() - 1;    
+                }
+            }
+        
+        command = iCommands[index];            
+        }
+    else
+        {
+        command = iCommands[0];    
+        }        
+    
+    return command;    
+    }    
+
+// ---------------------------------------------------------------------------
+// CBubbleTouchPaneButton::SetState
+// ---------------------------------------------------------------------------
+//    
+void CBubbleTouchPaneButton::SetState( TInt aCommand,
+                                       TBool aDrawNow )
+    {
+    for ( TInt i=0; i < iCommands.Count(); i++ )
+        {
+        if ( iCommands[i] == aCommand )
+            {
+            if ( i != StateIndex() )
+                {
+                SetCurrentState( i, aDrawNow );                
+                }
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleTouchPaneButton::SetDimmed
+// ---------------------------------------------------------------------------
+//
+void CBubbleTouchPaneButton::SetDimmed( TBool aDimmed )
+    {
+    CAknButton::SetDimmed( aDimmed );
+    DrawDeferred();                
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleTouchPaneButton::HasState
+// ---------------------------------------------------------------------------
+//   
+TBool CBubbleTouchPaneButton::HasState( TInt aCommand ) const
+    {
+    TBool hasState = EFalse;
+    
+    for ( TInt i=0; i < iCommands.Count(); i++ )
+        {
+        if ( iCommands[i] == aCommand )
+            {
+            hasState = ETrue;
+            break;    
+            }
+        }
+    
+    return hasState;
+    }
+   
+
+// ---------------------------------------------------------------------------
+// Draw button, text and icon.
+// ---------------------------------------------------------------------------
+// 
+void CBubbleTouchPaneButton::Draw( const TRect& aRect ) const
+    {
+    TAknsItemID frameId( KAknsIIDQsnFrButtonNormal );
+    TAknLayoutRect centerLayout;
+    centerLayout.LayoutRect( aRect,
+        AknLayoutScalable_Avkon::toolbar_button_pane_g1().LayoutLine() );
+    TRect innerRect = centerLayout.Rect();
+
+    CWindowGc& gc = SystemGc();
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+
+    TInt commandCount = iCommands.Count();
+    
+    for ( TInt i=0; i < commandCount; i++ )    
+        {
+        frameId = iIconProvider->GetButtonForCommandL( 
+                                   iCommands[i]);
+
+        if ( iButtonPressed )
+            {
+            frameId = SelectPressedButton( frameId );
+            }
+        else if ( IsDimmed() )
+            {
+            frameId = SelectDimmedButton( frameId );
+            }
+    
+        iBgContext->SetFrame( frameId );
+        iBgContext->SetCenter( KAknsIIDQsnFrButtonCenterNormal );
+        iBgContext->SetFrameRects( aRect, innerRect );
+    
+        if ( !AknsDrawUtils::Background( skin, 
+                                        iBgContext, 
+                                        NULL, 
+                                        gc, 
+                                        aRect, 
+                                        KAknsDrawParamNoClearUnderImage ) )
+            {
+            gc.SetBrushColor( KRgbRed );
+            gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
+            gc.DrawRect( aRect );
+            }
+        LayoutIconAndText( gc );
+        }
+    }
+
+// --------------------------------------------------------------------------
+// Draw text and icon according to the layout.
+// --------------------------------------------------------------------------
+
+void CBubbleTouchPaneButton::LayoutIconAndText( CWindowGc& aGc ) const
+    {
+    TRect parentRect( Rect() );
+    CAknButtonState* state = State();
+    if ( !state  ||       
+         !state->Icon() ||
+         !state->Text().Length() )
+        {
+        return;
+        }    
+
+    TRgb penColor;
+    TRgb brushColor;
+    GetTextColors( penColor ); 
+    
+    // buffer for visually ordered text
+    TBuf< KBubbleButtonText + KAknBidiExtraSpacePerLine> visualText; 
+    TInt clipWidth = iLayoutText.TextRect().Width();
+    
+    // bidi processing - using AknBidiTextUtils.
+    AknBidiTextUtils::ConvertToVisualAndClip(
+        state->Text(),
+        visualText,
+        *iLayoutText.Font(),
+        clipWidth,
+        clipWidth );
+    
+    iLayoutText.DrawText( aGc, visualText, EFalse, penColor );
+    
+    const CGulIcon* icon = GetCurrentIcon();
+    if ( icon )
+        {
+        CFbsBitmap* buttonBmp = icon->Bitmap();
+        CFbsBitmap* buttonMask = icon->Mask();
+   
+        if( buttonBmp && buttonMask )
+            {
+            aGc.BitBltMasked( iIconRect.iTl, buttonBmp,
+                    iIconRect.Size(), buttonMask, ETrue );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleTouchPaneButton::SetLayout
+// ---------------------------------------------------------------------------
+//
+void CBubbleTouchPaneButton::SetLayout( const TAknLayoutText aLayoutText,
+                                        const TRect aIconRect ) 
+    {
+    iLayoutText = aLayoutText;
+    iIconRect = aIconRect;
+    }    
+
+// ---------------------------------------------------------------------------
+// CBubbleTouchPaneButton::HandleResourceChange
+// ---------------------------------------------------------------------------
+//
+void CBubbleTouchPaneButton::HandleResourceChange( TInt aType )
+    {
+    CAknButton::HandleResourceChange( aType );
+    
+    if ( aType == KAknsMessageSkinChange &&
+         iIconProvider )
+        {
+        LoadCustomIcons( *iIconProvider );
+        }    
+    }
+
+// -----------------------------------------------------------------------------
+// Gets the correct text color.
+// -----------------------------------------------------------------------------
+//
+void CBubbleTouchPaneButton::GetTextColors( TRgb& aPenColor ) const 
+   { 
+   if ( IsDimmed() ) 
+       {
+       aPenColor = iEikonEnv->ControlColor( EColorButtonTextDimmed, *this ); 
+       }
+   else if ( iButtonPressed )
+       {
+       aPenColor = iEikonEnv->ControlColor( EColorButtonTextPressed, *this );
+       }
+   else
+       {
+       aPenColor = iEikonEnv->ControlColor( EColorButtonText, *this );
+       }
+   }
+
+// -----------------------------------------------------------------------------
+// Selects the correct pressed button.
+// -----------------------------------------------------------------------------
+//
+TAknsItemID CBubbleTouchPaneButton::SelectPressedButton( TAknsItemID frameId ) const
+   { 
+   if( frameId == KAknsIIDQsnFrButtonNormalAnswer )
+       {
+       return KAknsIIDQsnFrButtonPressedAnswer;
+       }
+   else if( frameId == KAknsIIDQsnFrButtonNormalReject )
+       {
+       return KAknsIIDQsnFrButtonPressedReject;
+       }
+   else if( frameId == KAknsIIDQsnFrButtonNormalHold )
+       {
+       return KAknsIIDQsnFrButtonPressedHold;   
+       }
+   else
+       {
+       return KAknsIIDQsnFrButtonPressed;
+       }
+   }
+
+// -----------------------------------------------------------------------------
+// Selects the correct dimmed button.
+// -----------------------------------------------------------------------------
+//
+ TAknsItemID CBubbleTouchPaneButton::SelectDimmedButton( TAknsItemID frameId ) const
+   {
+   if( frameId == KAknsIIDQsnFrButtonNormalAnswer )
+       {
+       return KAknsIIDQsnFrButtonInactiveAnswer;
+       }
+   else if( frameId == KAknsIIDQsnFrButtonNormalReject )
+       {
+       return KAknsIIDQsnFrButtonInactiveReject;
+       }
+   else if( frameId == KAknsIIDQsnFrButtonNormalHold )
+       {
+       return KAknsIIDQsnFrButtonInactiveHold;
+       }
+   else
+       {
+       return KAknsIIDQsnFrButtonInactive;
+       }
+   }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMUtils.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,1783 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Utils
+*
+*/
+
+
+// INCLUDE FILES
+#include    "BMUtils.h"             // definition
+#include    "BMBubbleHeader.h"      // CBubbleHeader
+#include    "BMBubbleImageManager.h"// CBubbleImageManager
+#include    "BMResourceManager.h"   // Resource pool
+#include    "BMPanic.h"             // Panic
+#include    "BMLayout.h"
+#include    "BMLayout2.h"
+#include    "BubbleManagerPaths.h"
+#include    "BMCallObjectManager.h"
+#include    "BMCallObjectUtils.h"
+#include    "telbubblecustomelement.h"
+
+#include    <eikimage.h>            // CEikImage
+#include    <eiklabel.h>            // CEikLabel
+#include    <bldvariant.hrh>
+#include    <AknsUtils.h>
+#include    <AknBidiTextUtils.h>
+#include    <featmgr.h>
+#include    <aknlayoutscalable_apps.cdl.h>
+#include    <AknLayout2ScalableDef.h>
+#include    <applayout.cdl.h>
+#include    <layoutmetadata.cdl.h>
+
+#include    <AknsDrawUtils.h>
+#include	<akniconconfig.h>
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+//  BubbleUtils::SetCallTypePane
+//  Selects item for call type pane (small bubbles and connected big bubbles)
+// ---------------------------------------------------------------------------
+//
+TBool BubbleUtils::SetCallTypePane( const CBubbleHeader& aHeader, 
+                                      CEikImage*& aTypeImage1, 
+                                      CEikImage*& aTypeImage2, 
+                                      CBubbleManager& aBubbleManager )
+    {
+    CBubbleManager::TPhoneCallState callState = aHeader.CallState( );
+    TUint32 callFlags = aHeader.CallFlags( ); 
+    
+    TInt picture1 = KErrNotFound;
+    TInt picture2 = KErrNotFound;
+    TInt picture1mask = KErrNotFound;
+    TInt picture2mask = KErrNotFound;
+
+    switch ( callState )
+        {
+        case CBubbleManager::EWaiting:
+        case CBubbleManager::EIncoming:
+        case CBubbleManager::EOutgoing:
+        case CBubbleManager::EAlertToDisconnected:
+        case CBubbleManager::EAlerting:
+        case CBubbleManager::EDisconnected:
+        case CBubbleManager::EActive:
+        case CBubbleManager::EOnHold:
+            if ( callFlags&CBubbleManager::ELine2 )
+                {
+                picture1 = EQgn_indi_call_line2;
+                picture1mask = EQgn_indi_call_line2_mask;
+                }
+            
+            break;
+        case CBubbleManager::ENone:
+        default:
+            picture1 = KErrNotFound;
+            picture2 = KErrNotFound;
+            break;
+        }
+
+    if ( picture1 == KErrNotFound )
+        {
+        return EFalse;
+        }
+
+    __ASSERT_DEBUG( aTypeImage1 == NULL , 
+        Panic( EBMPanicErrorInResourceManager ) );
+
+    aTypeImage1 = aBubbleManager.ResourceManager().ReserveEikImage();
+
+    __ASSERT_DEBUG( aTypeImage1 != NULL , 
+        Panic( EBMPanicErrorInResourceManager ) );
+
+    if ( aTypeImage1 == NULL )
+        {
+        return EFalse;
+        }
+
+    aBubbleManager.ImageManager().SetBitmapToImage( aTypeImage1 , 
+        (TBMIcons)picture1,(TBMIcons)picture1mask );
+
+    if ( picture2 != KErrNotFound )
+        {
+        __ASSERT_DEBUG( aTypeImage2 == NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+
+        aTypeImage2 = aBubbleManager.ResourceManager().ReserveEikImage();
+
+        __ASSERT_DEBUG( aTypeImage2 != NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+
+        aBubbleManager.ImageManager().SetBitmapToImage( aTypeImage2 , 
+            (TBMIcons)picture2 , (TBMIcons)picture2mask );
+
+        }
+    return ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+//  BubbleUtils::SetCyphOffImage
+// ---------------------------------------------------------------------------
+// 
+TBool BubbleUtils::SetCyphOffImage( const CBubbleHeader& aHeader, 
+                                      CEikImage*& aCypfOffImage, 
+                                      CBubbleManager& aBubbleManager )
+    {
+    TUint32 callFlags = aHeader.CallFlags(); 
+    if ( callFlags&CBubbleManager::ENoCiphering )
+        {
+        aCypfOffImage = aBubbleManager.ResourceManager().ReserveEikImage();
+        __ASSERT_DEBUG( aCypfOffImage != NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+
+        aBubbleManager.ImageManager().SetBitmapToImage( aCypfOffImage , 
+            EQgn_indi_call_cyphering_off,
+            EQgn_indi_call_cyphering_off_mask );
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+//  BubbleUtils::ChooseTextsToTwoLines
+// ---------------------------------------------------------------------------
+// 
+void  BubbleUtils::ChooseTextsToTwoLines( const CBubbleHeader& aHeader,
+            TPtrC& aFirstLineText,
+            TPtrC& aSecondLineText,
+            CEikLabel*& aTimerCost,
+            CEikLabel*& aTextLine1,
+            CEikLabel*& aTextLine2,
+            CBubbleManager& aBubbleManager,
+            CBubbleManager::TPhoneClippingDirection& aFirstLineDir,
+            CBubbleManager::TPhoneClippingDirection& aSecondLineDir,
+            TUint8& aTextLineNumber )
+    {
+    CBubbleManager::TPhoneCallState callState = aHeader.CallState( );
+    TUint32 callFlags = aHeader.CallFlags( ); 
+
+    __ASSERT_DEBUG( aTextLine1 == NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+    __ASSERT_DEBUG( aTextLine2 == NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+    __ASSERT_DEBUG( aTimerCost == NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+
+    switch ( callState )
+        {
+        case CBubbleManager::EWaiting:        // 1.cli 2.text
+        case CBubbleManager::EIncoming:        // 1.cli 2.text
+            // if there is arriving data or fax call and there is
+            // cli -> there is something in text field, swap texts
+            aTextLine1 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine2 = aBubbleManager.ResourceManager().ReserveEikLabel();
+        
+            aFirstLineText.Set( aHeader.CLI() );
+            aFirstLineDir = aHeader.CLIClipDirection( );
+            aSecondLineText.Set( aHeader.Text() );
+            aSecondLineDir = aHeader.TextClipDirection( );
+            aTextLineNumber = 2;    // Bubble text line number
+            break;
+        case CBubbleManager::EAlertToDisconnected:
+        case CBubbleManager::EDisconnected:
+        case CBubbleManager::EOnHold:
+        case CBubbleManager::EAlerting:         // 1.cli 2.text
+            aTextLine1 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine2 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aFirstLineText.Set( aHeader.CLI() );
+            aFirstLineDir = aHeader.CLIClipDirection( );
+            aSecondLineText.Set( aHeader.Text() );
+            aSecondLineDir = aHeader.TextClipDirection( );
+            aTextLineNumber = 2;    // Bubble text line number
+            break;
+        case CBubbleManager::EActive:            // 1.cli 2.timer
+            aTextLine1 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTimerCost = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aFirstLineText.Set( aHeader.CLI() );
+            aFirstLineDir = aHeader.CLIClipDirection( );
+            AddTextToEikLabel( *aTimerCost , aHeader.TimerCost( ) );
+            aSecondLineText.Set( NULL , 0 );
+            aTextLineNumber = 0;    // no text is used
+            break;
+        case CBubbleManager::EOutgoing:    // 2.cli 1.text
+            aTextLine1 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine2 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aSecondLineText.Set( aHeader.CLI() );
+            aSecondLineDir = aHeader.CLIClipDirection( );
+            aFirstLineText.Set( aHeader.Text() );
+            aFirstLineDir = aHeader.TextClipDirection( );
+            aTextLineNumber = 1;    // Bubble text line number
+            break;
+        case CBubbleManager::ENone: // flow through
+        default:
+            aFirstLineText.Set( NULL , 0 );
+            aSecondLineText.Set( NULL , 0 );
+            aTextLineNumber = 0;    // no text is used
+            break;
+        }
+
+    __ASSERT_DEBUG( aTextLine1 != NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+    __ASSERT_DEBUG( aTextLine2 != NULL || aTimerCost != NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+    
+    }
+
+// ---------------------------------------------------------------------------
+//  BubbleUtils::ChooseTextsToTwoLines
+// ---------------------------------------------------------------------------
+// 
+void  BubbleUtils::ChooseTextsToThreeLines( const CBubbleHeader& aHeader,
+            TPtrC& aFirstLineText,
+            TPtrC& aSecondLineText,
+            TPtrC& aThirdLineText,
+            CEikLabel*& aTimerCost,
+            CEikLabel*& aTextLine1,
+            CEikLabel*& aTextLine2,
+            CEikLabel*& aTextLine3,
+            CBubbleManager& aBubbleManager,
+            CBubbleManager::TPhoneClippingDirection& aFirstLineDir,
+            CBubbleManager::TPhoneClippingDirection& aSecondLineDir,
+            CBubbleManager::TPhoneClippingDirection& aThirdLineDir,
+            TUint8& aTextLineNumber )
+    {
+    CBubbleManager::TPhoneCallState callState = aHeader.CallState( );
+    TUint8 callFlags = aHeader.CallFlags( );
+
+    __ASSERT_DEBUG( aTextLine1 == NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+    __ASSERT_DEBUG( aTextLine2 == NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+    __ASSERT_DEBUG( aTimerCost == NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+
+    switch ( callState )
+        {
+        case CBubbleManager::EWaiting:        // 1.cli 2.cnap 3.text
+        case CBubbleManager::EIncoming:        // 1.cli 2.cnap 3.text
+            // if there is arriving data or fax call and there is
+            // cli -> there is something in text field, swap texts
+            aTextLine1 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine2 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine3 = aBubbleManager.ResourceManager().ReserveEikLabel();
+
+            aFirstLineText.Set( aHeader.CLI() );
+            aFirstLineDir = aHeader.CLIClipDirection( );
+            aSecondLineText.Set( aHeader.CNAP() );
+            aSecondLineDir = aHeader.CNAPClipDirection( ); 
+            aThirdLineText.Set( aHeader.Text() );
+            aThirdLineDir = aHeader.TextClipDirection( );
+            aTextLineNumber = 3;    // Bubble text line number
+            break;
+        case CBubbleManager::EActive:            // 1.cli 2.cnap, 3.timer
+            aTextLine1 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine2 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine3 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTimerCost = aBubbleManager.ResourceManager().ReserveEikLabel();
+            AddTextToEikLabel( *aTimerCost , aHeader.TimerCost( ) );
+            aFirstLineText.Set( aHeader.CLI() );
+            aFirstLineDir = aHeader.CLIClipDirection( );
+            aSecondLineText.Set( aHeader.CNAP() );
+            aSecondLineDir = aHeader.CNAPClipDirection( ); 
+            aThirdLineText.Set( NULL, 0 );
+            aTextLineNumber = 0;    // no text is used
+            break;        
+        case CBubbleManager::EDisconnected:
+        case CBubbleManager::EOnHold:
+        case CBubbleManager::EAlerting:
+        case CBubbleManager::EAlertToDisconnected:
+            aTextLine1 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine2 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine3 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aFirstLineText.Set( aHeader.CLI() );
+            aFirstLineDir = aHeader.CLIClipDirection( );
+            aSecondLineText.Set( aHeader.CNAP() );
+            aSecondLineDir = aHeader.CNAPClipDirection( ); 
+            aThirdLineText.Set( aHeader.Text() );
+            aThirdLineDir = aHeader.TextClipDirection( );
+            aTextLineNumber = 3;    // text is used
+            break;
+        case CBubbleManager::EOutgoing:
+            aTextLine1 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine2 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine3 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aFirstLineText.Set( aHeader.Text() );
+            aFirstLineDir = aHeader.TextClipDirection( );
+            aSecondLineText.Set( aHeader.CLI() );
+            aSecondLineDir = aHeader.CLIClipDirection( );
+            aThirdLineText.Set( aHeader.CNAP() );
+            aThirdLineDir = aHeader.CNAPClipDirection( ); 
+            aTextLineNumber = 1;    // Bubble text line number
+            break;
+        case CBubbleManager::ENone: // flow through
+        default:
+            aFirstLineText.Set( NULL , 0 );
+            aSecondLineText.Set( NULL , 0 );
+            aThirdLineText.Set( NULL , 0 );
+            aTextLineNumber = 0;    // no text is used
+            break;
+        }
+    
+    __ASSERT_DEBUG( aTextLine1 != NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+    __ASSERT_DEBUG( aTextLine2 != NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+    __ASSERT_DEBUG( aTextLine3 != NULL || aTimerCost != NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+    
+    }
+    
+// ---------------------------------------------------------------------------
+//  BubbleUtils::ChooseTextsToFiveLines
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::ChooseTextsToFiveLines( 
+    const CBubbleHeader& aHeader,
+    TPtrC& aFirstLineText,
+    TPtrC& aSecondLineText,
+    TPtrC& aThirdLineText,
+    CEikLabel*& aTextLine1,
+    CEikLabel*& aTextLine2,
+    CEikLabel*& aTextLine3,
+    CEikLabel*& aTextLine4,
+    CEikLabel*& aTextLine5,
+    CBubbleManager& aBubbleManager,
+    CBubbleManager::TPhoneClippingDirection& aFirstLineDir,
+    CBubbleManager::TPhoneClippingDirection& aSecondLineDir,
+    CBubbleManager::TPhoneClippingDirection& aThirdLineDir,
+    TUint8& aTextLineNumber,
+    TBool aThreeLinesOfText )
+    {
+    CBubbleManager::TPhoneCallState callState = aHeader.CallState( );
+    TUint8 callFlags = aHeader.CallFlags( );
+
+    __ASSERT_DEBUG( aTextLine1 == NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+    __ASSERT_DEBUG( aTextLine2 == NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+    __ASSERT_DEBUG( aTextLine3 == NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+    __ASSERT_DEBUG( aTextLine4 == NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+    __ASSERT_DEBUG( aTextLine5 == NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+    
+    switch ( callState )
+        {
+        case CBubbleManager::EIncoming:
+            aTextLine1 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine2 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine3 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine4 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine5 = aBubbleManager.ResourceManager().ReserveEikLabel();
+
+            aFirstLineText.Set( aHeader.CLI() );
+            aFirstLineDir = aHeader.CLIClipDirection( );
+            
+            if ( aThreeLinesOfText )
+                {
+                aSecondLineText.Set( aHeader.CNAP() );
+                aSecondLineDir = aHeader.CNAPClipDirection( );
+                aThirdLineText.Set( aHeader.Text() );
+                aThirdLineDir = aHeader.TextClipDirection( );
+                aTextLineNumber = 3; // Bubble text line number    
+                }
+            else
+                {
+                aSecondLineText.Set( aHeader.Text() );
+                aSecondLineDir = aHeader.TextClipDirection( );
+                aTextLineNumber = 2; // Bubble text line number        
+                }
+            break;
+            
+        case CBubbleManager::EOutgoing:
+            aTextLine1 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine2 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine3 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine4 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine5 = aBubbleManager.ResourceManager().ReserveEikLabel();
+
+            if ( aThreeLinesOfText )
+                {
+                aFirstLineText.Set( aHeader.Text() );
+                aFirstLineDir = aHeader.TextClipDirection( );
+                aSecondLineText.Set(  aHeader.CLI() );
+                aSecondLineDir = aHeader.CLIClipDirection( );
+                aThirdLineText.Set( aHeader.CNAP() );
+                aThirdLineDir = aHeader.CNAPClipDirection( );
+                aTextLineNumber = 1; // Bubble text line number
+                }
+            else
+                {
+                aFirstLineText.Set( aHeader.Text() );
+                aFirstLineDir = aHeader.TextClipDirection( );
+                aSecondLineText.Set(  aHeader.CLI() );
+                aSecondLineDir = aHeader.CLIClipDirection( );
+                aTextLineNumber = 1; // Bubble text line number
+                }                
+            
+            break;
+            
+        case CBubbleManager::EAlertToDisconnected:
+        case CBubbleManager::EDisconnected:
+        case CBubbleManager::EAlerting:         // 1.cli 2.text
+            aTextLine1 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine2 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine3 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine4 = aBubbleManager.ResourceManager().ReserveEikLabel();
+            aTextLine5 = aBubbleManager.ResourceManager().ReserveEikLabel();
+        
+            if ( aThreeLinesOfText )
+                {
+                aFirstLineText.Set( aHeader.CLI() );
+                aFirstLineDir = aHeader.CLIClipDirection( );
+                aSecondLineText.Set( aHeader.CNAP() );
+                aSecondLineDir = aHeader.CNAPClipDirection( );
+                aThirdLineText.Set( aHeader.Text() );
+                aThirdLineDir = aHeader.TextClipDirection( );
+                aTextLineNumber = 3;    // Bubble text line number
+                }
+            else
+                {
+                aFirstLineText.Set( aHeader.CLI() );
+                aFirstLineDir = aHeader.CLIClipDirection( );
+                aSecondLineText.Set( aHeader.Text() );
+                aSecondLineDir = aHeader.TextClipDirection( );
+                aTextLineNumber = 2;    // Bubble text line number
+                }                
+            break;            
+            
+        case CBubbleManager::ENone: // flow through
+        default:
+            aFirstLineText.Set( NULL , 0 );
+            aSecondLineText.Set( NULL , 0 );
+            aThirdLineText.Set( NULL , 0 );
+            aTextLineNumber = 0;    // no text is used
+            break;
+        }
+    
+    __ASSERT_DEBUG( aTextLine1 != NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+    __ASSERT_DEBUG( aTextLine2 != NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+    __ASSERT_DEBUG( aTextLine3 != NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );
+    __ASSERT_DEBUG( aTextLine4 != NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );                        
+    __ASSERT_DEBUG( aTextLine5 != NULL , 
+            Panic( EBMPanicErrorInResourceManager ) );            
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::SetTextInLabel
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::SetTextInLabel( 
+                     const TDesC16& aText, 
+                     CEikLabel*& aLabel ,
+                     const CBubbleManager::TPhoneClippingDirection& aClipDir )
+    {
+    __ASSERT_DEBUG( aLabel , Panic( EBMPanicErrorInResourceManager ) );
+    if ( aLabel == NULL )
+        {
+        return;
+        }
+    SetTextInLabel( aText, *aLabel, aClipDir );
+    }
+
+// ---------------------------------------------------------------------------
+//  BubbleUtils::SetTextInLabel
+//  Gets usable text from given buffer. There might be long and short version.
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::SetTextInLabel( 
+                    const TDesC16& aText, 
+                    CEikLabel& aLabel ,
+                    const CBubbleManager::TPhoneClippingDirection& aClipDir )
+    {
+    // Trivial case
+    if ( aText.Length() == 0 || aText == KNullDesC )
+        {
+        AddTextToEikLabel( aLabel , KNullDesC );
+        return;
+        }
+
+    // Find text separator (/t) if long and short text are both added to the
+    // same descriptor.
+    TInt separator = KErrNotFound;
+    for ( TInt i = 0 ; i < aText.Length() ; i++ )
+        {
+        if ( aText[i] == KBubbleTextSeparator()[0] )
+            {
+            separator = i;
+            break;
+            }
+        }
+
+    TPtrC longText( NULL ,0 );
+    TPtrC shortText( NULL ,0 );
+    TPtrC usedText( NULL , 0 );
+    if ( separator != KErrNotFound )
+        {
+        // The buffer is like 'LongText'+'/t'(+'ShortText').
+        longText.Set( aText.Left( separator ) );
+        if ( separator != aText.Length()-1 )
+            {
+            shortText.Set( aText.Right( aText.Length() - separator -1 ) );
+            }
+        }
+    else
+        {
+        longText.Set( aText );
+        }
+
+    // does the long text fit in label?
+    if ( aLabel.Font()->TextWidthInPixels( longText ) > aLabel.Size().iWidth )
+        {
+        //no. Use short text if there is one
+        if ( shortText.Length() > 0 )
+            {
+            usedText.Set( shortText );
+            }
+        else
+            {
+            usedText.Set( longText );
+            } 
+        }
+    else
+        {
+        //yes - so use the long text
+        usedText.Set( longText );
+        }
+
+    // fit the used text in label - clip if needed
+    ClipToLabel( usedText , aLabel , aClipDir );
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::ClipToLabel
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::ClipToLabel( 
+                     const TDesC16& aText, 
+                     CEikLabel*& aLabel ,
+                     const CBubbleManager::TPhoneClippingDirection& aClipDir )
+    {
+    __ASSERT_DEBUG( aLabel , Panic( EBMPanicErrorInResourceManager ) );
+    if ( aLabel == NULL )
+        {
+        return;
+        }
+    ClipToLabel( aText, *aLabel, aClipDir );
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::ClipToLabel
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::ClipToLabel( 
+                    const TDesC16& aText, 
+                    CEikLabel& aLabel ,
+                    const CBubbleManager::TPhoneClippingDirection& aClipDir )
+    {
+    // Trivial case
+    if ( aText.Length() == 0  || aText == KNullDesC )
+        {
+        AddTextToEikLabel( aLabel , KNullDesC );
+        return;
+        }
+
+    // allocations not leaving
+    HBufC* textBuffer = 
+        HBufC::New( aText.Length() + KAknBidiExtraSpacePerLine );
+    HBufC* visualBuffer = 
+        HBufC::New( aText.Length() + KAknBidiExtraSpacePerLine );
+
+    if( visualBuffer && textBuffer && aClipDir == CBubbleManager::ERight )
+        {
+        *textBuffer = aText;
+        TPtr ptr1 = textBuffer->Des();
+        TPtr ptr2 = visualBuffer->Des();
+        // fit the used text in label - clip if needed
+        AknBidiTextUtils::ConvertToVisualAndClip( 
+            ptr1,
+            ptr2, 
+            *aLabel.Font(),
+            aLabel.Size().iWidth,
+            aLabel.Size().iWidth );
+        aLabel.UseLogicalToVisualConversion( EFalse );
+        AddTextToEikLabel( aLabel , ptr2 );
+        }
+    else
+        {
+        CBubbleManager::TBubbleLabelString usedText = aText;
+        AknTextUtils::TClipDirection dir = 
+            AknTextUtils::EClipFromBeginning;
+        if ( aClipDir == CBubbleManager::ERight )
+            {
+            dir = AknTextUtils::EClipFromEnd;
+            }
+        else
+            {
+            ConvertToArabicIndic( usedText );
+            }
+        AknTextUtils::ClipToFit( 
+            usedText, 
+            *aLabel.Font(), 
+            aLabel.Size().iWidth, 
+            dir );
+        AddTextToEikLabel( aLabel, usedText );
+        }
+
+    delete textBuffer;
+    delete visualBuffer;
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::DrawMaskedImage
+// ---------------------------------------------------------------------------
+//
+TBool BubbleUtils::DrawMaskedImage( CBitmapContext& aGc , CEikImage* aImage )
+    {
+    if ( aImage == NULL )
+        {
+        return EFalse;
+        }
+    
+    // Bitmap is initialized
+    if ( aImage->Bitmap() && aImage->Bitmap()->Handle() )
+        {
+        DrawMaskedImage( aGc , *aImage );
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;        
+        }           
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::DrawMaskedImage
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::DrawMaskedImage( CBitmapContext& aGc , CEikImage& aImage )
+    { 
+    TSize imageSize = aImage.MinimumSize();
+    if ( aImage.Mask() )
+        {
+        aGc.BitBltMasked( 
+            aImage.Rect().iTl,
+            aImage.Bitmap(),
+            TRect( TPoint( 0 , 0 ) , 
+            TPoint( imageSize.iWidth , imageSize.iHeight ) ),
+            aImage.Mask(),
+            ETrue );
+        }
+    else
+        {
+        aGc.BitBlt
+            ( 
+            aImage.Rect().iTl, 
+            aImage.Bitmap(),
+            TRect( TPoint( 0 , 0 ) , 
+            TPoint( imageSize.iWidth , imageSize.iHeight ) )
+            );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::AddTextToEikLabel
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::AddTextToEikLabel( CEikLabel& aLabel , const TDesC& aText )
+    {
+    if ( aText.Length() > KBubbleLabelMaxLength )
+        {
+        TRAPD ( error, aLabel.SetBufferReserveLengthL( aText.Length() ) );
+        if ( error != KErrNone )
+            {
+            aLabel.SetTextL( aText.Left( KBubbleLabelMaxLength ) );
+            return;
+            }
+        }
+    aLabel.SetTextL( aText );    
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::AddTextToEikLabel
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::AddTextToEikLabel( CEikLabel*& aLabel , const TDesC& aText )
+    {
+    if ( aLabel == NULL )
+        {
+        return;
+        }
+    AddTextToEikLabel( *aLabel, aText );
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::AddTextToHeader
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::AddTextToHeader( 
+                CBubbleHeader& aHeader,
+                const KBubbleUtilsHeaderTextPlace aTextPlace,
+                const TDesC& aTextToSet,
+                const TInt aMaxLength,
+                const CBubbleManager::TPhoneClippingDirection aClipDirection )
+    {
+    
+    TPtrC buffer( NULL , 0 );
+    
+    if ( aTextToSet.Length() > aMaxLength )
+        {
+        if ( aClipDirection == CBubbleManager::ERight )
+            {
+            buffer.Set( aTextToSet.Left( aMaxLength ) );
+            }
+        else 
+            {
+            buffer.Set( aTextToSet.Right( aMaxLength ) );
+            }
+        }
+    else
+        {
+        buffer.Set( aTextToSet );
+        }
+    
+    switch ( aTextPlace )
+        {
+        case EBubbleHeaderCLI:
+            aHeader.SetCLI( buffer, aClipDirection );
+            break;
+        case EBubbleHeaderLabel:
+            aHeader.SetText( buffer, aClipDirection );
+            break;
+        case EBubbleHeaderTimerCost:
+            aHeader.SetTimerCost( buffer );
+            break;
+        case EBubbleHeaderCNAP:
+            aHeader.SetCNAP( buffer, aClipDirection );
+            break;
+        default:
+            Panic( EBMPanicUnhandledSwitchCase );
+            break;
+            
+        }
+    
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::LayoutControl
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::LayoutControl( CCoeControl* aControl, 
+                                 const TRect& aControlParent, 
+                                 const TAknWindowLineLayout& aLayout )
+    {
+    if ( aControl == NULL )
+        {
+        return;
+        }
+    AknLayoutUtils::LayoutControl( aControl, aControlParent, aLayout );
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::LayoutBackgroundImage
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::LayoutBackgroundImage( CEikImage* aImage, 
+                                 const TRect& aParent, 
+                                 const TAknWindowLineLayout& aLayout )
+    {
+    if ( aImage == NULL )
+        {
+        return;
+        }
+
+    AknLayoutUtils::LayoutControl( aImage, aParent, aLayout );
+    if ( aImage->Bitmap() )
+        {
+        AknIconUtils::SetSize( const_cast<CFbsBitmap*>( aImage->Bitmap() ), 
+                               aImage->Rect().Size(),
+                               EAspectRatioNotPreserved );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::LayoutImage
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::LayoutImage( CEikImage* aImage, 
+                               const TRect& aParent, 
+                               const TAknWindowLineLayout& aLayout )
+    {
+    if ( aImage == NULL )
+        {
+        return;
+        }
+    AknLayoutUtils::LayoutImage( aImage,  aParent, aLayout );
+    }
+
+void BubbleUtils::LayoutImage( CEikImage* aImage, 
+                               const TRect& aParent, 
+                               const AknLayoutUtils::SAknLayoutControl& aLayout )
+    {
+    if ( aImage == NULL )
+        {
+        return;
+        }
+    AknLayoutUtils::LayoutImage( aImage,  aParent, aLayout );
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::LayoutLabel
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::LayoutLabel( CEikLabel* aLabel, 
+                               const TRect& aLabelParent, 
+                               const TAknTextLineLayout& aLayout )
+    {
+    if ( aLabel == NULL )
+        {
+        return;
+        }
+    AknLayoutUtils::LayoutLabel( aLabel, aLabelParent, aLayout );
+
+    // Check skinnig colour for the text:
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    TRgb skinColor;
+    TInt error = 
+        AknsUtils::GetCachedColor( 
+            skin, 
+            skinColor, 
+            KAknsIIDQsnTextColors,
+            EAknsCIQsnTextColorsCG51 );
+    if ( error == KErrNone )
+        {
+        // Ignore error
+        TRAP_IGNORE( aLabel->OverrideColorL( EColorLabelText, skinColor ) );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::LayoutCustomElement
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::LayoutCustomElement(
+    CTelBubbleCustomElement* aElement, 
+    const TRect& aParent, 
+    const TAknWindowLineLayout& aLayout)
+    {
+    if ( aElement == NULL )
+        {
+        return;
+        }
+    
+    if ( aElement->ControlType() == CTelBubbleCustomElement::EBubbleImage )
+        {
+        BubbleUtils::LayoutImage(
+            static_cast<CEikImage*>( aElement->Control() ),
+            aParent,
+            aLayout );
+        }
+    else
+        {
+        BubbleUtils::LayoutControl(
+            aElement->Control(),
+            aParent,
+            aLayout );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  BubbleUtils::ConvertToArabicIndic
+//  
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::ConvertToArabicIndic( 
+    TDes& aResult, 
+    const TDesC& aSource )
+    {
+    __ASSERT_DEBUG( aResult.MaxLength() >= aSource.Length(), 
+        User::Invariant());
+    if ( aResult.MaxLength() < aSource.Length() )
+        {
+        return;
+        }
+
+    aResult = aSource;
+    ConvertToArabicIndic( aResult );
+    }
+
+// ---------------------------------------------------------------------------
+//  BubbleUtils::ConvertToArabicIndic
+//  
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::ConvertToArabicIndic( TDes& aDes )
+    {
+    AknTextUtils::DisplayTextLanguageSpecificNumberConversion( aDes );
+    }
+
+// ---------------------------------------------------------------------------
+//  BubbleUtils::ConvertToArabicIndic
+//  
+// ---------------------------------------------------------------------------
+//
+HBufC* BubbleUtils::ConvertToArabicIndic( const TDesC& aDes )
+    {
+    HBufC* buffer = HBufC::New( aDes.Length() );
+    if ( !buffer )
+        {
+        return NULL;
+        }
+    TPtr ptr = buffer->Des();
+    ConvertToArabicIndic( ptr , aDes );
+    return buffer;
+    }
+
+// ---------------------------------------------------------------------------
+//  BubbleUtils::SetLayoutForCellTypePane
+//  
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::SetLayoutForCellTypePane( 
+            const CBubblePlace::TPhoneBubblePlace& aBubblePlace,
+            const TRect& aParent,
+            CEikImage* aTypeIndication1,
+            CEikImage* aTypeIndication2 )
+    {
+    CCoeControl* cellTypePane = new CCoeControl;
+    if ( !cellTypePane )
+        {
+        return;
+        }
+
+    switch ( aBubblePlace )
+        {
+        case CBubblePlace::EBottom:
+        case CBubblePlace::EBottomCnap:
+            LayoutControl( cellTypePane , aParent , 
+                BubbleLayout::popup_call_audio_first_window_1_elements_2() );
+            break;
+        case CBubblePlace::EBottomRightActive:
+        case CBubblePlace::EBottomRightHeld:
+        case CBubblePlace::EBottomRightCnap:
+        case CBubblePlace::EBottomRightActiveTouch:
+        case CBubblePlace::EBottomRightActiveCnapTouch:
+            LayoutControl( cellTypePane , aParent , 
+                BubbleLayout::popup_call_audio_second_window_1_elements_2() );
+            break;
+        case CBubblePlace::EMiddleActive:
+        case CBubblePlace::EMiddleHeld:
+        case CBubblePlace::EMiddleCnap:
+            LayoutControl( cellTypePane , aParent , 
+                BubbleLayout::popup_call_audio_first_window_2_elements_2() );
+            break;
+        case CBubblePlace::ETopLeft:
+        case CBubblePlace::EMiddleHeldTouch:
+            LayoutControl( cellTypePane , aParent , 
+                BubbleLayout::popup_call_audio_first_window_4_elements_2() );
+            break;
+        case CBubblePlace::ETopRight:
+            LayoutControl( cellTypePane , aParent , 
+                BubbleLayout::popup_call_audio_second_window_3_elements_2() );
+            break;
+        default:
+            break;
+        }
+
+    LayoutImage( aTypeIndication1 , cellTypePane->Rect() , 
+        BubbleLayout::call_type_pane_elements_1() );
+    LayoutImage( aTypeIndication2 , cellTypePane->Rect() , 
+        BubbleLayout::call_type_pane_elements_2() );
+
+    delete cellTypePane;
+    }
+
+// ---------------------------------------------------------------------------
+//  BubbleUtils::SetLayoutFofCypheringOffIcon
+//  
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::SetLayoutFofCypheringOffIcon(
+    const CBubbleHeader& aHeader,
+    const CBubblePlace::TPhoneBubblePlace& aBubblePlace,
+    const TRect& aParent,
+    CEikImage* aCyphOffImage )
+    {
+    const CBubbleManager::TPhoneCallState callState = aHeader.CallState();
+
+    const TBool connected = 
+        callState == CBubbleManager::EOnHold || 
+        callState == CBubbleManager::EDisconnected || 
+        callState == CBubbleManager::EActive;
+
+    switch ( aBubblePlace )
+        {
+        case CBubblePlace::EBottomCnap:
+        case CBubblePlace::EBottom:
+            if ( connected )
+                {
+                LayoutImage( aCyphOffImage, aParent, 
+                  BubbleLayout::popup_call_audio_first_window_1_elements_3() );
+                }
+            else
+                {
+                LayoutImage( aCyphOffImage, aParent, 
+                    BubbleLayout::popup_call_audio_in_window_1_elements_15() );
+                }
+            break;      
+        case CBubblePlace::EBottomRightActive:
+        case CBubblePlace::EBottomRightHeld:
+        case CBubblePlace::EBottomRightCnap:
+        case CBubblePlace::EBottomRightActiveTouch:
+        case CBubblePlace::EBottomRightActiveCnapTouch:
+            if ( connected )
+                {
+                LayoutImage( aCyphOffImage, aParent, 
+                  BubbleLayout::popup_call_audio_second_window_1_elements_3() );
+                }
+            else
+                {
+                LayoutImage( aCyphOffImage, aParent, 
+                  BubbleLayout::popup_call_audio_out_window_1_elements_15() );
+                }
+            break;
+        case CBubblePlace::EMiddleActive:
+        case CBubblePlace::EMiddleHeld:
+        case CBubblePlace::EMiddleCnap:
+            if ( connected )
+                {
+                LayoutImage( aCyphOffImage, aParent, 
+                  BubbleLayout::popup_call_audio_first_window_2_elements_15() );
+                }
+            else
+                {
+                LayoutImage( aCyphOffImage, aParent, 
+                    BubbleLayout::popup_call_audio_in_window_2_elements_15() );
+                }
+            break;
+        case CBubblePlace::ETopLeft:
+        case CBubblePlace::EMiddleHeldTouch:
+            if ( connected )
+                {
+                LayoutImage( aCyphOffImage, aParent, 
+                  BubbleLayout::popup_call_audio_first_window_4_elements_3() );
+                }
+            else
+                {
+                LayoutImage( aCyphOffImage, aParent, 
+                    BubbleLayout::popup_call_audio_wait_window_3_elements_3() );
+                }
+            break;
+        case CBubblePlace::ETopRight:
+            if ( connected )
+                {
+                LayoutImage( aCyphOffImage, aParent, 
+                  BubbleLayout::popup_call_audio_second_window_3_elements_3() );
+                }
+            else
+                {
+                LayoutImage( aCyphOffImage, aParent, 
+                    BubbleLayout::popup_call_audio_out_window_2_elements_15() );
+                }
+            break;
+        case CBubblePlace::EBottomText:
+            if ( connected )
+                {
+                LayoutImage( aCyphOffImage, aParent, 
+                  BubbleLayout2::popup_call2_audio_in_ciphering_icon( 0 ) );
+                }
+            break;            
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  BubbleUtils::PlaceThumbnail
+//  
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::PlaceThumbnail(
+    const CBubblePlace::TPhoneBubblePlace& aBubblePlace,
+    CEikImage* aImage , 
+    TBubbleLayoutRect& aShadow,
+    const TRect& aParentRect,
+    CFbsBitmap* aThumbNailBitmap )
+    {
+    if ( !( aImage && aImage->Bitmap() ) )
+        {
+        return;
+        }
+    
+    TAknLayoutRect thumbnailLayoutRect;
+    TAknLayoutRect shadowLayoutRect;
+    TAknWindowLineLayout thumbnailShadowLine;
+    
+    // Bitmap is resized separately, not via AknLayoutUtils::LayoutImage()
+    aImage->SetPicture( NULL );
+
+    // wrong layout data within AppLayout::Incoming_call_pop_up_window_elements_Line_14()
+    switch ( aBubblePlace )
+        {
+        case CBubblePlace::EBottom:
+        case CBubblePlace::EBottomCnap:            
+            AknLayoutUtils::LayoutImage( aImage, aParentRect, 
+                AppLayout::Incoming_call_pop_up_window_elements_Line_12() );
+            thumbnailLayoutRect.LayoutRect( aParentRect, 
+                AppLayout::Incoming_call_pop_up_window_elements_Line_12() );
+            thumbnailShadowLine = 
+                AppLayout::Incoming_call_pop_up_window_elements_Line_11();
+            shadowLayoutRect.LayoutRect( aParentRect, thumbnailShadowLine );
+            break;
+        case CBubblePlace::EBottomRightActive:
+        case CBubblePlace::EBottomRightHeld:
+        case CBubblePlace::EBottomRightCnap:
+        case CBubblePlace::EBottomRightActiveTouch:
+        case CBubblePlace::EBottomRightActiveCnapTouch:
+            AknLayoutUtils::LayoutImage( aImage, aParentRect, 
+                AppLayout::Outgoing_call_pop_up_window_elements__held__Line_12() );
+            thumbnailLayoutRect.LayoutRect( aParentRect, 
+                AppLayout::Outgoing_call_pop_up_window_elements__held__Line_12() );
+            thumbnailShadowLine = 
+                AppLayout::Outgoing_call_pop_up_window_elements__held__Line_11();
+            shadowLayoutRect.LayoutRect( aParentRect, thumbnailShadowLine );
+            break;
+        case CBubblePlace::EMiddleActive:
+        case CBubblePlace::EMiddleHeld:
+        case CBubblePlace::EMiddleCnap:
+            AknLayoutUtils::LayoutImage( aImage, aParentRect, 
+                AppLayout::Incoming_call_pop_up_window_elements__NE__Line_12() );
+            thumbnailLayoutRect.LayoutRect( aParentRect, 
+                AppLayout::Incoming_call_pop_up_window_elements__NE__Line_12() );
+            thumbnailShadowLine = 
+                AppLayout::Incoming_call_pop_up_window_elements__NE__Line_11();
+            shadowLayoutRect.LayoutRect( aParentRect, thumbnailShadowLine );
+            break;
+        default:
+            break;
+        }
+
+    AknIconUtils::SetSize( aThumbNailBitmap, thumbnailLayoutRect.Rect().Size(), 
+                           EAspectRatioPreservedAndUnusedSpaceRemoved );
+    aImage->SetPicture( aThumbNailBitmap );
+    aShadow.SetColor( AKN_LAF_COLOR(221) );
+    // aShadow.SetColor( shadowLayoutRect.Color() ); 
+    // int leftGap = shadowLayoutRect.Rect().iTl.iX - thumbnailLayoutRect.Rect().iTl.iX;
+    // int topGap = shadowLayoutRect.Rect().iTl.iY - thumbnailLayoutRect.Rect().iTl.iY;
+    int leftGap = 1;
+    int topGap = 1;
+    aShadow.SetRect( aImage->Position() + TPoint( leftGap, topGap ), 
+                     aImage->MinimumSize() );
+
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::IsCustomImageWidth
+// ---------------------------------------------------------------------------
+//
+TBool BubbleUtils::IsCustomizedImage( const TRect& aParent, const TInt aWidth )
+    {
+    TInt type = GetThumbnailImageType( aParent, aWidth );
+    TBool ret = EFalse;
+    if( ( type == 0 ) && ( aWidth != 0 ) ) // Customized
+        {
+        ret = ETrue;
+        }
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::LabelExtent
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::LabelExtent( CEikLabel* aLabel, 
+                              const TRect& aParent, 
+                              const TInt aWidth )
+    {
+    if ( aLabel == NULL )
+        {
+        return;
+        }
+
+    if( BubbleUtils::IsCustomizedImage( aParent, aWidth ) )
+        {    
+        TInt width = aLabel->Size().iWidth - aWidth;
+        if( width > 0 )
+            {
+            TRect rect = aLabel->Rect();
+
+            if( AknLayoutUtils::LayoutMirrored() ) 
+                {
+                rect.iTl.iX += aWidth;
+                }
+            rect.SetWidth( width );
+
+            aLabel->SetRect( rect );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::GetThumbnailImageType
+// ---------------------------------------------------------------------------
+//
+TInt BubbleUtils::GetThumbnailImageType( const TRect& /*aParent*/, 
+                                         const TInt aWidth )
+    {
+    /* Scalable UI uses only one image size.
+    TAknLayoutRect rectVGAturned;
+    rectVGAturned.LayoutRect( aParent, AppLayout::VGA_turned_90() );
+    const TInt widthVGAturned = rectVGAturned.Rect().Width();
+
+    TAknLayoutRect rectCIFturned;
+    rectCIFturned.LayoutRect( aParent, AppLayout::CIF_turned_90() );
+    const TInt widthCIFturned = rectCIFturned.Rect().Width();
+
+    TAknLayoutRect rectVGAnormal;
+    rectVGAnormal.LayoutRect( aParent, AppLayout::VGA() );
+    const TInt widthVGAnormal = rectVGAnormal.Rect().Width();
+    
+    TAknLayoutRect rectCIFnormal;
+    rectCIFnormal.LayoutRect( aParent, AppLayout::CIF() );
+    const TInt widthCIFnormal = rectCIFnormal.Rect().Width();
+    
+    TAknLayoutRect rectCommmunicator;
+    rectCommmunicator.LayoutRect( aParent, 
+        AppLayout::Communicator_personal_image() );
+    const TInt widthCommmunicator = rectCommmunicator.Rect().Width();
+
+    TInt ret;
+    if( aWidth == widthVGAturned )
+        {
+        ret = 1;
+        }
+    else if( aWidth == widthCIFturned )
+        {
+        ret = 2;
+        }
+    else if( aWidth == widthVGAnormal || aWidth == widthCommmunicator ) 
+        {
+        ret = 3;
+        }
+    else if( aWidth == widthCIFnormal )
+        {
+        ret = 4;
+        }
+    else // no image.
+        {
+        ret = 0; 
+        }*/
+
+    TInt ret(0); // no thumbnail       
+    if ( aWidth > 0 )
+        {
+        // see First_call_pop_up_window_texts__one_call__Line_1 in
+        // Adaptation_Layer_AppLayout_Elaf
+        ret = 4;    
+        }
+    
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::BubbleIconFileName
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::BubbleIconFileName( TDes& aFileName )
+    {
+    aFileName = KBMMbmZDrive;
+    aFileName.Append( KDC_APP_BITMAP_DIR );
+    aFileName.Append( KBMBitmapFile );
+    aFileName.ZeroTerminate();
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::BubbleResourceFileName
+// ---------------------------------------------------------------------------
+//
+void BubbleUtils::BubbleResourceFileName( TDes& aFileName )
+    {
+    aFileName = KBMMbmZDrive;
+    aFileName.Append( KDC_RESOURCE_FILES_DIR );
+    aFileName.Append( KBMResourcesFile );
+    aFileName.ZeroTerminate();
+    }
+
+// ----------------------------------------------------------------------------
+// BubbleUtils::::DrawBackgroundRect
+// ----------------------------------------------------------------------------
+//    
+void BubbleUtils::DrawBackgroundRect( CBitmapContext& aGc,
+                                      const TRect& aRect )
+    {
+    TRect bgRect( aRect );
+    bgRect.Shrink( aRect.Width() / 48, aRect.Height() / 24 );
+    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); 
+    aGc.SetPenStyle( CGraphicsContext::ENullPen ); 
+
+    bgRect.Move(2,2);
+    aGc.SetBrushColor( AKN_LAF_COLOR(221) );
+    aGc.DrawRect( bgRect );
+    bgRect.Move(-2,-2);
+    aGc.SetBrushColor( AKN_LAF_COLOR(0) );
+    aGc.SetPenStyle( CGraphicsContext::ESolidPen ); 
+    aGc.SetPenColor( AKN_LAF_COLOR(217) );
+    aGc.DrawRect( bgRect );
+
+    aGc.SetBrushStyle( CGraphicsContext::ENullBrush );    
+    }
+
+// ----------------------------------------------------------------------------
+// TBubbleLayoutRect::TBubbleLayoutRect
+// ----------------------------------------------------------------------------
+//
+TBubbleLayoutRect::TBubbleLayoutRect() {}
+
+// ----------------------------------------------------------------------------
+// TBubbleLayoutRect::SetRect
+// ----------------------------------------------------------------------------
+//
+void TBubbleLayoutRect::SetRect( const TPoint& aPoint, const TSize& aSize ) 
+    {
+    iRect.SetRect( aPoint, aSize );
+    }
+
+// ----------------------------------------------------------------------------
+// TBubbleLayoutRect::Rect
+// ----------------------------------------------------------------------------
+//
+TRect TBubbleLayoutRect::Rect() const
+    {
+    return iRect;
+    }
+
+// ----------------------------------------------------------------------------
+// TBubbleLayoutRect::SetColor
+// ----------------------------------------------------------------------------
+//
+void TBubbleLayoutRect::SetColor( const TRgb aColor ) 
+    {
+    iColor = aColor;
+    }
+
+// ----------------------------------------------------------------------------
+// TBubbleLayoutRect::Color
+// ----------------------------------------------------------------------------
+//
+TRgb TBubbleLayoutRect::Color() const
+    {
+    return iColor;
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::PrepareBubbleImageL
+// ---------------------------------------------------------------------------
+//    
+void BubbleUtils::PrepareBubbleImageL(
+    const TAknsItemID& aFrameID,
+    const TRect& aOuterRect,
+    const TRect& aInnerRect,    
+    CEikImage*& aBubble )
+    {
+    ///////////////////////////////////////////////////////
+    // Create bitmap
+    ///////////////////////////////////////////////////////
+    CFbsBitmap* bitmap = new(ELeave) CFbsBitmap;
+    CleanupStack::PushL( bitmap );
+    
+    // create bitmap to target size
+    AknIconConfig::TPreferredDisplayMode mode;
+    AknIconConfig::PreferredDisplayMode( mode, 
+                                         AknIconConfig::EImageTypeIcon);
+    User::LeaveIfError( bitmap->Create( aOuterRect.Size(), 
+                                        mode.iBitmapMode ) );
+    
+    // create context
+    CFbsBitmapDevice* bitmapDev = CFbsBitmapDevice::NewL( bitmap );
+    CleanupStack::PushL( bitmapDev );
+    CFbsBitGc* bitmapCtx;
+    User::LeaveIfError( bitmapDev->CreateContext( bitmapCtx ) );
+    CleanupStack::PushL( bitmapCtx ); 
+    
+    // draw frame
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    
+    AknsDrawUtils::DrawFrame( skin,
+                              *bitmapCtx,
+                              aOuterRect,
+                              aInnerRect,
+                              aFrameID,
+                              KAknsIIDDefault,
+                              KAknsDrawParamRGBOnly );
+
+    aBubble->SetBitmap( bitmap );
+    
+    CleanupStack::PopAndDestroy( 2, bitmapDev );
+    CleanupStack::Pop( bitmap );
+    
+    ///////////////////////////////////////////////////////
+    // Create mask
+    ///////////////////////////////////////////////////////
+    CFbsBitmap* mask = new(ELeave) CFbsBitmap;
+    CleanupStack::PushL( mask );
+    
+    // create bitmap to target size
+    User::LeaveIfError( mask->Create( aOuterRect.Size(), 
+                                      mode.iMaskMode ) );
+    
+    // create context
+    CFbsBitmapDevice* maskDev = CFbsBitmapDevice::NewL( mask );
+    CleanupStack::PushL( maskDev );
+    CFbsBitGc* maskCtx;
+    User::LeaveIfError( maskDev->CreateContext( maskCtx ) );
+    CleanupStack::PushL( maskCtx ); 
+    
+    // draw frame
+    AknsDrawUtils::DrawFrame( skin,
+                              *maskCtx,
+                              aOuterRect,
+                              aInnerRect,
+                              aFrameID,
+                              KAknsIIDDefault,
+                              KAknsSDMAlphaOnly );
+
+    aBubble->SetMask( mask );
+    
+    CleanupStack::PopAndDestroy( 2, maskDev );
+    CleanupStack::Pop( mask );
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::AddTransparencyToBubbleImageL
+// ---------------------------------------------------------------------------
+//    
+void BubbleUtils::AddTransparencyToBubbleImageL(
+    const TAknsItemID& aFrameID,
+    const TRect& aOuterRect,
+    const TRect& aInnerRect,    
+    CEikImage*& aBubble )
+    {
+    
+    const CFbsBitmap* currentMask = aBubble->Mask();
+    TSize maskSize( currentMask->SizeInPixels() );
+    TRect rect( maskSize );
+    
+    // create transparency frame
+    CFbsBitmap* transparency = new(ELeave) CFbsBitmap;
+    CleanupStack::PushL( transparency );
+    User::LeaveIfError( transparency->Create( aOuterRect.Size(), 
+                                              EGray256 ) );
+    CFbsBitmapDevice* transparencyDev = CFbsBitmapDevice::NewL( transparency );
+    CleanupStack::PushL( transparencyDev );
+    CFbsBitGc* transparencyCtx;
+    User::LeaveIfError( transparencyDev->CreateContext( transparencyCtx ) );
+    CleanupStack::PushL( transparencyCtx );
+    transparencyCtx->SetBrushColor( KRgbDarkGray );
+    transparencyCtx->SetBrushStyle( CGraphicsContext::ESolidBrush );
+    transparencyCtx->DrawRect( rect );
+
+    CleanupStack::PopAndDestroy( 2, transparencyDev );
+            
+    // create solid black mask
+    CFbsBitmap* solidBlack = new(ELeave) CFbsBitmap;
+    CleanupStack::PushL( solidBlack );
+    User::LeaveIfError( solidBlack->Create( maskSize, EGray256 ) );
+    CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL( solidBlack );
+    CleanupStack::PushL( dev );
+    CFbsBitGc* gc;
+    User::LeaveIfError( dev->CreateContext( gc ) ); 
+    CleanupStack::PushL( gc );
+    
+    gc->SetBrushColor( KRgbBlack );
+    gc->SetBrushStyle( CGraphicsContext::ESolidBrush );
+    gc->DrawRect( rect );
+    
+    // blit original mask on the black mask using transparency mask
+    gc->BitBltMasked( TPoint(0,0), 
+                      currentMask,
+                      TRect( currentMask->SizeInPixels() ), 
+                      transparency, 
+                      ETrue );
+ 
+    CleanupStack::PopAndDestroy( 2, dev);
+    
+    CleanupStack::Pop(solidBlack);
+    aBubble->SetMask( solidBlack );
+        
+    CleanupStack::PopAndDestroy( transparency );
+    delete currentMask;
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::PrepareCallObjectToBubbleImageL
+// ---------------------------------------------------------------------------
+//    
+void BubbleUtils::PrepareCallObjectToBubbleImageL(
+    const CFbsBitmap* aCOImage,
+    const CFbsBitmap* aCOImageMask,
+    const TRect& /*aCallObjectRect*/,
+    const TAknsItemID& aFrameID,
+    const TRect& aOuterRect,
+    const TRect& aInnerRect,
+    CEikImage*& aBubble,
+    TBool aDimmed )
+    {
+    const CFbsBitmap* bubbleBitmap = aBubble->Bitmap();
+    TSize callObjectSize( aCOImage->SizeInPixels() );
+    
+    // set source rectangle, clip from center if bigger than target
+    TRect srcRect( aCOImage->SizeInPixels() );
+    TInt clipX = ( callObjectSize.iWidth > aOuterRect.Width() ) ? 
+                 ( callObjectSize.iWidth - aOuterRect.Width() ) : 0;
+    TInt clipY = ( callObjectSize.iHeight > aOuterRect.Height() ) ? 
+                 ( callObjectSize.iHeight - aOuterRect.Height() ) : 0;
+    srcRect.Shrink( clipX / 2, clipY / 2 );
+    
+    // set offset/alignment for image
+    TPoint offset(0,0);
+    if ( ( callObjectSize.iWidth > aOuterRect.Width() ) )
+        {
+        // Not usual situation, only if smaller image is under scaling.
+        // Set horizontally centered.
+        offset.iX = (aOuterRect.Width() - callObjectSize.iWidth) / 2;
+        }
+    else if ( !Layout_Meta_Data::IsMirrored() )
+        {
+        // Align image horizontally right
+        offset.iX = ( callObjectSize.iWidth < aOuterRect.Width() ) ? 
+                    (aOuterRect.Width() - callObjectSize.iWidth )  : 0;
+        }
+    // vertically centered
+    offset.iY = (aOuterRect.Height() - callObjectSize.iHeight) / 2;
+    
+    // create gradient mask
+    CFbsBitmap* gradientMask = new(ELeave) CFbsBitmap;
+    CleanupStack::PushL( gradientMask );
+    // mask has to be in same size than call object
+    User::LeaveIfError( gradientMask->Create( callObjectSize, 
+                                              EGray256 ) );
+    CFbsBitmapDevice* gradientMaskDev = CFbsBitmapDevice::NewL( gradientMask );
+    CleanupStack::PushL( gradientMaskDev );
+    CFbsBitGc* gradientMaskCtx;
+    User::LeaveIfError( gradientMaskDev->CreateContext( gradientMaskCtx ) );
+    CleanupStack::PushL( gradientMaskCtx );
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    // initialize mask to black color
+    gradientMaskCtx->SetBrushColor( AKN_LAF_COLOR(215) ); // black
+    gradientMaskCtx->SetBrushStyle( CGraphicsContext::ESolidBrush );
+    gradientMaskCtx->SetPenStyle( CGraphicsContext::ENullPen );
+    gradientMaskCtx->DrawRect( callObjectSize );
+    // shift origin
+    gradientMaskCtx->SetOrigin( -offset ); 
+    AknsDrawUtils::DrawFrame( skin,
+                              *gradientMaskCtx,
+                              aOuterRect,
+                              aInnerRect,
+                              aFrameID,
+                              KAknsIIDDefault,
+                              KAknsDrawParamDefault );
+
+    CleanupStack::PopAndDestroy( 2, gradientMaskDev );
+    
+    if ( aCOImageMask )
+        {
+        // combine image and gradient mask
+        CFbsBitmap* combinedMask = CreateCombinedMaskL(
+            gradientMask, aCOImageMask );
+        // switch to combined mask
+        CleanupStack::PopAndDestroy(gradientMask);
+        gradientMask = combinedMask;
+        CleanupStack::PushL( gradientMask );            
+        }
+    
+    // blit image to bubble through gradient mask
+    CFbsBitmapDevice* bubbleDev = 
+        CFbsBitmapDevice::NewL( const_cast<CFbsBitmap*>(bubbleBitmap) );
+    CleanupStack::PushL( bubbleDev );
+    CFbsBitGc* bubbleGc;
+    User::LeaveIfError( bubbleDev->CreateContext( bubbleGc ) ); 
+    CleanupStack::PushL( bubbleGc );
+    
+    
+    TPoint blitOffset; 
+    blitOffset.iX = ( offset.iX < 0 ) ? 0 : offset.iX;
+    blitOffset.iY = ( offset.iY < 0 ) ? 0 : offset.iY;
+    
+    bubbleGc->SetFaded( aDimmed );
+    bubbleGc->BitBltMasked( aOuterRect.iTl + blitOffset, 
+                            aCOImage,
+                            srcRect, 
+                            gradientMask, 
+                            ETrue );
+
+    CleanupStack::PopAndDestroy( 3, gradientMask );
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::LayoutCallTypeIndicators
+// ---------------------------------------------------------------------------
+//    
+void BubbleUtils::LayoutCallTypeIndicators( 
+    const TRect& aParent,
+    const TAknWindowLineLayout& aCallTypePane,
+    CEikImage*   aTypeIndication1,
+    CEikImage*   aTypeIndication2 )    
+    {
+    if ( !aTypeIndication1 && !aTypeIndication2 )
+        {
+        return;            
+        }
+    
+    // split pane
+    TAknLayoutRect callTypePaneRect;
+    callTypePaneRect.LayoutRect( aParent,
+                                 aCallTypePane );
+        
+    TRect paneRect = callTypePaneRect.Rect();
+    TInt  paneWidth = paneRect.Width();
+    TInt  paneHeight = paneRect.Height();
+    TSize indSize( paneWidth/2, paneHeight );
+        
+    TRect indRect1 = TRect( TPoint( paneRect.iTl ), indSize );
+                                
+    TRect indRect2 = TRect( TPoint( paneRect.iTl.iX + ( paneWidth / 2 ),
+                                    paneRect.iTl.iY ), indSize );                
+    
+    if ( Layout_Meta_Data::IsMirrored() )
+        {
+        // switch positions
+        TRect tmp = indRect2;
+        indRect2 = indRect1;
+        indRect1 = tmp;
+        }
+    
+    if ( aTypeIndication1 )
+        {
+        aTypeIndication1->SetRect( indRect1 );
+        }
+    
+    if ( aTypeIndication2 )        
+        {
+        if ( aTypeIndication1 )
+            {
+            aTypeIndication2->SetRect( indRect2 );    
+            }
+        else
+            {
+            aTypeIndication2->SetRect( indRect1 );    
+            }            
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::PrepareCallObjectImageL
+// ---------------------------------------------------------------------------
+//    
+void BubbleUtils::PrepareCallObjectImageL( 
+    CBubbleHeader& aHeader,
+    const TSize& aSize )
+    {
+    CFbsBitmap* bitmap = aHeader.CallObjectImage();
+     
+    if ( bitmap )
+        {
+        CBubbleHeader::TBMCallObjectImageType imageType = 
+            aHeader.CallObjectImageType();
+        
+        if ( imageType == CBubbleHeader::EThemeImage &&
+             AknIconUtils::IsMifIcon( bitmap ) )
+            {
+            // This does nothing, if icon is already in requested size.
+            TInt err =  AknIconUtils::SetSize( 
+                            bitmap,
+                            aSize,
+                            EAspectRatioPreservedSlice );
+            
+            if ( err != KErrNone ) // out of memory
+                {
+                aHeader.SetCallObjectImage( NULL );
+                aHeader.SetCallObjectImageMask( NULL );
+                User::Leave( err );
+                }
+            }
+        else if ( imageType == CBubbleHeader::EGalleryImage &&
+                  aHeader.TnBitmap() )
+            {
+            TSize thumbnailSize = aHeader.TnBitmap()->SizeInPixels();
+            
+            // Allow one pixel rounding inaccuracy
+            if ( thumbnailSize.iWidth  >= (aSize.iWidth - 1) &&
+                 thumbnailSize.iHeight >= (aSize.iHeight - 1) )
+                {
+                aHeader.SwitchToThumbnailImage();    
+                }
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// BubbleUtils::CreateCombinedMaskL
+// ---------------------------------------------------------------------------
+//
+CFbsBitmap* BubbleUtils::CreateCombinedMaskL(
+    const CFbsBitmap* aPrimaryMask,
+    const CFbsBitmap* aSecondaryMask )
+    {
+    __ASSERT_DEBUG( aPrimaryMask != NULL, 
+        Panic( EBMPanicErrorInResourceManager ) );
+    __ASSERT_DEBUG( aSecondaryMask != NULL, 
+        Panic( EBMPanicErrorInResourceManager ) );
+        
+    TSize size = aPrimaryMask->SizeInPixels();
+    
+    // create combined mask
+    CFbsBitmap* combinedMask = new(ELeave) CFbsBitmap;
+    CleanupStack::PushL( combinedMask );
+    User::LeaveIfError( combinedMask->Create( size, 
+                                              EGray256 ) );
+    
+    CFbsBitmapDevice* combinedMaskDev = 
+        CFbsBitmapDevice::NewL( combinedMask );
+    CleanupStack::PushL( combinedMaskDev );
+    CFbsBitGc* combinedMaskCtx;
+    User::LeaveIfError( combinedMaskDev->CreateContext( 
+        combinedMaskCtx ) );
+    CleanupStack::PushL( combinedMaskCtx ); 
+        
+    // initialize mask to black color
+    combinedMaskCtx->SetBrushColor( AKN_LAF_COLOR(215) ); // black
+    combinedMaskCtx->SetBrushStyle( CGraphicsContext::ESolidBrush );
+    combinedMaskCtx->SetPenStyle( CGraphicsContext::ENullPen );
+    combinedMaskCtx->DrawRect( size );
+        
+    // blit secondary mask through primary mask
+    combinedMaskCtx->BitBltMasked( TPoint(0,0), 
+                                   aSecondaryMask,
+                                   size, 
+                                   aPrimaryMask, 
+                                   ETrue );                                 
+        
+    CleanupStack::PopAndDestroy( 2, combinedMaskDev );
+    CleanupStack::Pop( combinedMask );
+    
+    return combinedMask;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMVideoController.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,568 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 player controller.
+*
+*/
+
+
+// INCLUDES
+#include    <AudioPreference.h>
+#include    "BMVideoController.h"
+#include    "BMVideoPlayer.h"
+#include    "BMBubbleVideoContainer.h"
+#include    "BMVideoPlaybackObserver.h"
+#include    "BMTrace.h"
+
+// ======== LOCAL FUNCTIONS ========
+static CBubbleVideoPlayer::TRingingType ConvertRingingType(
+    CBubbleManager::TBubbleVideoPlayMode aRingingMode );    
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CBubbleVideoController::ConstructL()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+CBubbleVideoController::CBubbleVideoController(
+    CBubbleManager& aBubbleManager ) :
+    CActive( CActive::EPriorityStandard ),
+    iBubbleManager( aBubbleManager )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CBubbleVideoController* CBubbleVideoController::NewL(
+    CBubbleManager& aBubbleManager )
+    {
+    CBubbleVideoController* self = new( ELeave ) CBubbleVideoController( 
+        aBubbleManager );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    
+    return self;    
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBubbleVideoController::~CBubbleVideoController()
+    {
+    Cancel();
+    
+    if ( iPlayer )
+        {
+        iPlayer->StopPlaying();
+        }
+    
+    Reset();
+    }
+
+// ---------------------------------------------------------------------------
+// Reset
+// ---------------------------------------------------------------------------
+//    
+void CBubbleVideoController::Reset()
+    {
+    delete iPlayer;
+    iPlayer = NULL;
+    delete iContainer;
+    iContainer = NULL;
+    delete iFileName;    
+    iFileName = NULL;
+    iVolumeLevel = 0;
+    iObserver = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// PrepareToPlayVideo
+// ---------------------------------------------------------------------------
+//
+void CBubbleVideoController::PrepareToPlayVideo( 
+    const TDesC& aFileName,
+    CBubbleManager::TBubbleVideoPlayMode aPlayMode,
+    TInt aVolumeLevel,
+    TBool aArbitraryScaling,
+    MBubbleVideoPlaybackObserver* aObserver )
+    {
+    delete iFileName;
+    iFileName = aFileName.Alloc();
+    iPlayMode = aPlayMode;
+    iVolumeLevel = aVolumeLevel;
+    iArbitraryScaling = aArbitraryScaling;
+    iObserver = aObserver;
+    }
+
+// ---------------------------------------------------------------------------
+// CreatePlayerAndPlay
+// ---------------------------------------------------------------------------
+//
+void CBubbleVideoController::CreatePlayerAndPlay()
+    {
+    BUBBLE_PRINT("VideoCtrl::Play>");
+    TRAPD( err, DoPlayL() );
+   
+    if ( err != KErrNone )
+        {
+        ReportErrorAsync( MBubbleVideoPlaybackObserver::EPlayerInitFailure,
+                          err );            
+        }
+    BUBBLE_PRINTF("VideoCtrl::Play<:", err );                        
+    }
+
+// ---------------------------------------------------------------------------
+// StopAndDeleteVideoPlayer
+// ---------------------------------------------------------------------------
+//    
+void CBubbleVideoController::StopAndDeletePlayer()
+    {
+    BUBBLE_PRINT("VideoCtrl::StopAndDel");
+    if ( iPlayer )
+        {
+        iPlayer->StopPlaying();
+        }
+    // To delete player.
+    Reset();
+    }
+    
+// ---------------------------------------------------------------------------
+// Stop
+// ---------------------------------------------------------------------------
+//    
+void CBubbleVideoController::StopPlaying()
+    {
+    BUBBLE_PRINT("VideoCtrl::Stop");
+    if ( iPlayer )
+        {
+        iPlayer->StopPlaying();
+        }
+    }    
+
+// ---------------------------------------------------------------------------
+// Mute
+// ---------------------------------------------------------------------------
+//
+void CBubbleVideoController::MutePlaying()
+    {
+    BUBBLE_PRINT("VideoCtrl::Mute");
+    if ( iPlayer )
+        {
+        iPlayer->MuteAudio();    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// HandleLayoutChange
+// ---------------------------------------------------------------------------
+//    
+void CBubbleVideoController::HandleLayoutChange()
+    {
+    BUBBLE_PRINT("VideoCtrl::HLC>");
+    if ( iPlayer && ( iPlayer->State() >= CBubbleVideoPlayer::EVideoReady ) )
+        {
+        BUBBLE_PRINT("VideoCtrl::HLC>1");
+        iPlayer->PausePlaying();
+        EnableRedraws();    
+        LayoutContainer();
+        if ( iArbitraryScaling )
+            {
+            iPlayer->AdjustToWindow2( iContainer->GetWindow() );     
+            }
+        else
+            {
+            iPlayer->AdjustToWindow( iContainer->GetWindow(), 
+                                     iUncropPane,
+                                     EFalse );    
+            }            
+        iContainer->DrawNow();
+        DisableRedraws();
+        iPlayer->ResumePlaying();
+        }
+    else if ( iContainer )
+        {
+        BUBBLE_PRINT("VideoCtrl::HLC>2");
+        LayoutContainer();    
+        }
+    BUBBLE_PRINT("VideoCtrl::HLC<");                
+    }
+    
+// ---------------------------------------------------------------------------
+// SetQcifVideoRects
+// ---------------------------------------------------------------------------
+//
+void CBubbleVideoController::SetQcifVideoPaneRects(
+    const TRect& aVideoPane,
+    const TRect& aUncropPane )
+    {
+    iVideoPaneRectQcif = aVideoPane;
+    iUncropPaneRectQcif = aUncropPane;
+    }
+    
+// ---------------------------------------------------------------------------
+// SetSubQcifVideoRects
+// ---------------------------------------------------------------------------
+//
+void CBubbleVideoController::SetSubQcifVideoPaneRects(
+    const TRect& aVideoPane,
+    const TRect& aUncropPane )
+    {
+    iVideoPaneRectSubQcif = aVideoPane;
+    iUncropPaneRectSubQcif = aUncropPane;   
+    }    
+                            
+// ---------------------------------------------------------------------------
+// SetVideoPaneBackgroundFrame
+// ---------------------------------------------------------------------------
+//
+void CBubbleVideoController::SetVideoPaneBackgroundFrame( 
+    const TAknsItemID& aFrameId,
+    const TRect& aOuterRect,
+    const TRect& aInnerRect )
+    {
+    TBool skinChanged = ( aFrameId == iBgFrameId ) ? EFalse : ETrue;
+    
+    iBgFrameId = aFrameId;
+    iBgFrameOuterRect = aOuterRect;
+    iBgFrameInnerRect = aInnerRect;
+    
+    if ( iContainer && skinChanged )
+        {
+        UpdateContainerBackground();
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// ConvertRingingType
+// ---------------------------------------------------------------------------
+//    
+CBubbleVideoPlayer::TRingingType ConvertRingingType(
+    CBubbleManager::TBubbleVideoPlayMode aRingingMode )
+    {
+    CBubbleVideoPlayer::TRingingType aRingingType
+        = CBubbleVideoPlayer::ETypeRinging; 
+    
+    switch ( aRingingMode )
+        {
+        case CBubbleManager::EPlayInLoop:
+            aRingingType = CBubbleVideoPlayer::ETypeRinging;
+            break;
+        case CBubbleManager::EPlayAscending:
+            aRingingType = CBubbleVideoPlayer::ETypeAscending;
+            break;
+        case CBubbleManager::EPlayOnce:
+            aRingingType = CBubbleVideoPlayer::ETypeRingingOnce;
+            break;
+        default:
+            break;
+        }
+    
+    return aRingingType;
+    }    
+
+// ---------------------------------------------------------------------------
+// DoPlayL
+// ---------------------------------------------------------------------------
+//
+void CBubbleVideoController::DoPlayL()
+    {
+    if ( !iContainer )
+        {
+        // Create container window for video playback
+        iContainer = CBubbleVideoContainer::NewL( &iBubbleManager ); 
+        LayoutContainer();
+        // Container window is set visible just before play. 
+        iContainer->MakeVisible( EFalse );
+        iContainer->ActivateL();
+        }
+    
+    // Create video player
+    delete iPlayer;
+    iPlayer = NULL;
+    iPlayer = CBubbleVideoPlayer::NewL( 
+              *iFileName,
+              KAudioPriorityPhoneCall, 
+              KAudioPrefIncomingCall,
+              *this, 
+              iContainer->GetWindow() );
+
+    // Play
+    iPlayer->Play( ConvertRingingType(iPlayMode), iVolumeLevel );
+    }
+
+// ---------------------------------------------------------------------------
+// LayoutContainer
+// ---------------------------------------------------------------------------
+//    
+void CBubbleVideoController::LayoutContainer()
+    {
+    if ( !iContainer )
+        {
+        return;    
+        }
+    
+    CBubbleVideoPlayer::TVideoResolution resolution =
+        CBubbleVideoPlayer::EVideoQCIF; 
+    if ( iPlayer && 
+         ( iPlayer->State() >= CBubbleVideoPlayer::EVideoReady ) )
+        {
+        resolution = iPlayer->VideoResolution();    
+        }
+        
+    TPoint offset = iBubbleManager.PositionRelativeToScreen();
+    if ( resolution == CBubbleVideoPlayer::EVideoSubQCIF &&
+         !iArbitraryScaling )
+        {
+        iContainer->SetRect( iVideoPaneRectSubQcif );
+        iUncropPane = iUncropPaneRectSubQcif;
+        iUncropPane.Move( offset );
+        }
+    else
+        {
+        iContainer->SetRect( iVideoPaneRectQcif );
+        iUncropPane = iUncropPaneRectQcif;
+        iUncropPane.Move( offset );
+        }        
+    
+    UpdateContainerBackground();
+    }
+    
+// ---------------------------------------------------------------------------
+// UpdateContainerBackground
+// ---------------------------------------------------------------------------
+//
+void CBubbleVideoController::UpdateContainerBackground()
+    {
+    // Set relative to container position
+    TPoint cntPosition = iContainer->Position();
+    TRect outerCntRect( iBgFrameOuterRect );
+    TRect innerCntRect( iBgFrameInnerRect );
+    outerCntRect.Move( -cntPosition );
+    innerCntRect.Move( -cntPosition );
+    iContainer->SetBackgroundFrame( iBgFrameId, 
+                                    outerCntRect, 
+                                    innerCntRect );    
+    }
+    
+// ---------------------------------------------------------------------------
+// ReportErrorAsync
+// ---------------------------------------------------------------------------
+//
+void CBubbleVideoController::ReportErrorAsync(
+    MBubbleVideoPlaybackObserver::TBubbleVideoPlaybackError aErrorType,
+    TInt aErrorCode )
+    {
+    BUBBLE_PRINT("VideoCtrl::RErrA");
+    Cancel();
+    iState = EReportingError;
+    iErrorType = aErrorType;
+    iErrorCode = aErrorCode;
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, KErrNone );
+    SetActive();    
+    }
+    
+// ---------------------------------------------------------------------------
+// ReportEventAsync
+// ---------------------------------------------------------------------------
+//
+void CBubbleVideoController::ReportEventAsync(
+    MBubbleVideoPlaybackObserver::TBubbleVideoPlaybackEvent aEvent )
+    {
+    BUBBLE_PRINT("VideoCtrl::REvnA");
+    Cancel();
+    iState = EReportingEvent;
+    iEventCode = aEvent;
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, KErrNone );
+    SetActive();    
+    }    
+
+
+// ---------------------------------------------------------------------------
+// From class MBubbleVideoPlayerObserver.
+// HandleVideoPlayerError
+// ---------------------------------------------------------------------------
+// 
+void CBubbleVideoController::HandleVideoPlayerError( 
+    TBubbleVideoPlayerErrorEvent aEvent,
+    TInt aError )
+    {
+    BUBBLE_PRINTF("VideoCtrl::HVPE.evn:", aEvent );
+    BUBBLE_PRINTF("VideoCtrl::HVPE.err:", aError );
+    switch( aEvent )
+        {
+        case EVideoPlayerInitializingFailure:
+            ReportErrorAsync( 
+                MBubbleVideoPlaybackObserver::EPlayerInitFailure, aError );    
+            break;
+        case EVideoPlayerPlayingFailure:
+            ReportErrorAsync( 
+                MBubbleVideoPlaybackObserver::EPlaybackFailure, aError );
+            break;
+        default:
+            break;            
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBubbleVideoPlayerObserver.
+// HandleVideoPlayerInitComplete
+// ---------------------------------------------------------------------------
+//
+void CBubbleVideoController::HandleVideoPlayerInitComplete()
+    {
+    BUBBLE_PRINT("VideoCtrl::HVPInitComp");
+    if ( iObserver )
+        {
+        ReportEventAsync( 
+            MBubbleVideoPlaybackObserver::EPlayerInitComplete );
+        }
+    
+    if ( iArbitraryScaling )
+        {
+        iPlayer->AdjustToWindow2( iContainer->GetWindow() );    
+        }
+    else
+        {
+        if ( iPlayer->VideoResolution() == CBubbleVideoPlayer::EVideoSubQCIF  )
+            {
+            // relayout for subqcif
+            LayoutContainer();    
+            }
+        iPlayer->AdjustToWindow( iContainer->GetWindow(), 
+                                 iUncropPane,
+                                 iArbitraryScaling );               
+        }
+    
+    // Make container visible before playin starts.
+    iContainer->MakeVisible( ETrue );
+     // Draw container now to prevent playback time redraw event.
+    iContainer->DrawNow();
+    DisableRedraws(); 
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBubbleVideoPlayerObserver.
+// HandleVideoPlayerPlayingComplete
+// ---------------------------------------------------------------------------
+// 
+void CBubbleVideoController::HandleVideoPlayerPlayingComplete()
+    {
+    BUBBLE_PRINT("VideoCtrl::HVPPlayComp");
+    if ( iObserver )
+        {
+        ReportEventAsync(
+            MBubbleVideoPlaybackObserver::EPlayingComplete );    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBubbleVideoPlayerObserver.
+// HandleVideoPlayerPlayingComplete
+// ---------------------------------------------------------------------------
+//    
+void CBubbleVideoController::HandleVideoPlayerBlittingAreaDefined( 
+    const TRect& aBlitRect )
+    {
+    if ( iArbitraryScaling )
+        {
+        TPoint offset = iBubbleManager.PositionRelativeToScreen();
+        TRect containerRect( aBlitRect );
+        containerRect.Move( -offset );
+        iContainer->SetRect( containerRect );    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class CActive.
+// RunL
+// ---------------------------------------------------------------------------
+//    
+void CBubbleVideoController::RunL()
+    {
+    BUBBLE_PRINT("VideoCtrl::RunL");
+    switch ( iState )    
+        {
+        case EReportingError:
+            if ( iObserver )
+                {
+                EnableRedraws();
+                iObserver->HandleBubbleVideoPlaybackError( 
+                    iErrorType, iErrorCode );                        
+                }
+            break;
+        case EReportingEvent:
+            if ( iObserver )
+                {
+                iObserver->HandleBubbleVideoPlaybackEvent( 
+                    iEventCode );                        
+                }
+            break;            
+        default:
+            break;            
+        }
+    
+    iState = EIdle;
+    }
+
+// ---------------------------------------------------------------------------
+// From class CActive.
+// DoCancel
+// ---------------------------------------------------------------------------
+//        
+void CBubbleVideoController::DoCancel()
+    {
+    // Request is completed immediately before SetActive.
+    }
+
+// ---------------------------------------------------------------------------
+// EnableRedraws
+// ---------------------------------------------------------------------------
+//
+void CBubbleVideoController::EnableRedraws()
+    {
+    iContainer->SetRedrawDisabled( EFalse );    
+    }
+
+// ---------------------------------------------------------------------------
+// DisableRedraws
+// ---------------------------------------------------------------------------
+//
+void CBubbleVideoController::DisableRedraws()
+    {
+    if ( iArbitraryScaling )    
+        {
+        // Container is covered entirely by video only
+        // when arbitrary scaling is supported.
+        iContainer->SetRedrawDisabled( ETrue );    
+        }    
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/Src/BMVideoPlayer.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,937 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 player implementation.
+*
+*/
+
+
+// INCLUDE FILES
+#include <coemain.h>       // CCoeEnv 
+#include <eikenv.h>        // CEikEnv 
+#include <videoplayer.h>   // CVideoPlayerUtility
+#include "BMVideoPlayer.h"
+#include "BMVideoPlayerObserver.h"
+#include "BMPanic.h"
+#include "BMTrace.h"
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES  
+
+// CONSTANTS
+const TInt KBubbleVideoMinVolumeLevel = 0;
+const TInt KBubbleVideoMaxVolumeLevel = 10;
+const TInt KBubbleVideoVolumeRampInterval = 3000000;
+const TInt KBubbleVideoVolumeRampStep = 1;
+const TInt KBubbleVideoRepeatsTrailPause = 1000000;
+const TInt KBubbleVideoIACoef = 1000; // Precision for fixed point math
+const TInt KBubbleMaxVideoCrop = 0; // Allowed max cropping. 0, 1 .. 20 (%).
+// The margin between aWindowRect and aClipRect parameters passed to player,
+// which can be used to eliminate black fill (scaled image is matched to
+// target area by clipping it).
+const TInt KBubbleVideoClipMarginX = 2;
+const TInt KBubbleVideoClipMarginY = 2;
+
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+TInt DivideAndCeil(const TInt aVal, const TInt aDiv)
+    {
+    return (((aVal%aDiv)>0) ? (TInt)((aVal/aDiv)+1):(TInt)(aVal/aDiv));
+    }
+
+// ---------------------------------------------------------------------------
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+CBubbleVideoPlayer::CBubbleVideoPlayer(
+    MBubbleVideoPlayerObserver& aObserver )
+    :
+    iObserver( aObserver ),
+    iVideoPlayer( NULL ),
+    iPlayerState( EVideoClosed ),
+    iVolume( 0 )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CBubbleVideoPlayer::ConstructL( 
+    const TDesC& aFileName, 
+    TInt aPriority, 
+    TUint aPreference,
+    RWindow& aVideoTarget  )
+    {
+    BUBBLE_PRINT("VideoPlayer::Const>");
+    // Screen and clip rectangles to window dimensions
+    TPoint wndPosition( aVideoTarget.AbsPosition() );
+    TSize wndSize( aVideoTarget.Size() );
+    TRect wndRect( wndPosition, wndSize );
+    
+    // Create video player instance
+    CCoeEnv* coeEnv = CCoeEnv::Static();
+    iVideoPlayer = CVideoPlayerUtility::NewL(
+        *this,
+        aPriority,
+        static_cast<TMdaPriorityPreference>( aPreference ),
+        coeEnv->WsSession(),
+        *coeEnv->ScreenDevice(),    
+        aVideoTarget,
+        wndRect, 
+        wndRect );
+
+    RFs fs = CEikonEnv::Static()->FsSession();
+    User::LeaveIfError( iFileHandle.Open( fs,
+                                          aFileName,
+                                          EFileShareReadersOnly | 
+                                          EFileStream | 
+                                          EFileRead ) );        
+    
+    iVideoPlayer->OpenFileL( iFileHandle ); // async
+    
+    iPlayerState = EVideoOpening;
+    BUBBLE_PRINT("VideoPlayer::Const<");
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::NewL
+// -----------------------------------------------------------------------------
+//
+CBubbleVideoPlayer* CBubbleVideoPlayer::NewL(
+    const TDesC& aRingingTone, 
+    TInt aPriority, 
+    TUint aPreference,
+    MBubbleVideoPlayerObserver& aObserver, 
+    RWindow& aVideoTarget )
+    {
+    CBubbleVideoPlayer* self = new(ELeave) CBubbleVideoPlayer( aObserver );
+        
+    CleanupStack::PushL( self );
+    self->ConstructL( aRingingTone, 
+                      aPriority, aPreference, 
+                      aVideoTarget );
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::New
+// -----------------------------------------------------------------------------
+//
+CBubbleVideoPlayer* CBubbleVideoPlayer::New(
+    const TDesC& aRingingTone,  
+    TInt aPriority, 
+    TUint aPreference,
+    MBubbleVideoPlayerObserver& aObserver, 
+    RWindow& aVideoTarget )
+    {
+    CBubbleVideoPlayer* self = NULL;
+
+    TRAPD( ignore, self = CBubbleVideoPlayer::NewL(
+                              aRingingTone, 
+                              aPriority, 
+                              aPreference,
+                              aObserver,   
+                              aVideoTarget ) );
+    ignore = ignore;                              
+    
+    return self; // this is NULL if NewL leaves
+    }
+
+// -----------------------------------------------------------------------------
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CBubbleVideoPlayer::~CBubbleVideoPlayer()
+    {
+    if ( iVolumeRampTimer )
+        {
+        iVolumeRampTimer->Cancel();
+        delete iVolumeRampTimer;
+        }
+        
+    if ( iRepeatsTrailPauseTimer )
+        {
+        iRepeatsTrailPauseTimer->Cancel();
+        delete iRepeatsTrailPauseTimer;    
+        }
+
+    if ( iVideoPlayer )
+        {
+        iVideoPlayer->Close();
+        delete iVideoPlayer;
+        }
+        
+    iFileHandle.Close();        
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::Play
+// -----------------------------------------------------------------------------
+//
+void CBubbleVideoPlayer::Play( TRingingType aRingType, 
+                              TInt aVolume )
+    {
+    BUBBLE_PRINT("VideoPlayer::Play>");
+    __ASSERT_DEBUG( iVideoPlayer, Panic( EBMPanicVideoPlayer ) );
+    
+    iRingingType = aRingType;
+    iVolume = aVolume;
+
+    switch( iPlayerState )
+        {
+        case EVideoOpening:
+        case EVideoPreparing:
+        case EVideoOpen:
+            // see MvpuoPrepareComplete()
+            iToBePlayed = ETrue;   
+            break;
+        
+        case EVideoReady:
+        case EVideoPaused:
+            iVideoPlayer->Play();
+            iPlayerState = EVideoPlaying;
+            break;
+        
+        case EVideoPlaying:
+        case EVideoClosed:
+        case EVideoError:
+        default:
+            // NOP
+            break;
+        }
+
+    BUBBLE_PRINT("VideoPlayer::Play<");
+    return;
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::StopPlaying
+// -----------------------------------------------------------------------------
+//
+void CBubbleVideoPlayer::StopPlaying()
+    {
+    BUBBLE_PRINT("VideoPlayer::Stop>");
+    iToBePlayed = EFalse;
+
+    if ( iVolumeRampTimer )
+        {
+        iVolumeRampTimer->Cancel();
+        }
+        
+    if ( iRepeatsTrailPauseTimer )        
+        {
+        iRepeatsTrailPauseTimer->Cancel();    
+        }
+    
+    if ( iPlayerState == EVideoPlaying ||
+         iPlayerState == EVideoPaused )
+        {
+        iVideoPlayer->Stop();
+        iPlayerState = EVideoReady;
+        }
+    BUBBLE_PRINT("VideoPlayer::Stop<");        
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::PausePlaying
+// -----------------------------------------------------------------------------
+//    
+TInt CBubbleVideoPlayer::PausePlaying()
+    {
+    BUBBLE_PRINT("VideoPlayer::Pause>");
+    TInt err = KErrNone;
+    
+    if ( iPlayerState == EVideoPlaying )
+        {
+        TRAP( err, iVideoPlayer->PauseL() );
+        if ( err == KErrNone )    
+            {
+            iPlayerState = EVideoPaused;    
+            }
+        }
+    else
+        {
+        err = KErrNotReady;    
+        }        
+
+    BUBBLE_PRINTF("VideoPlayer::Pause<:", err);        
+    return err;        
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::ResumePlaying
+// -----------------------------------------------------------------------------
+//    
+void CBubbleVideoPlayer::ResumePlaying()
+    {
+    BUBBLE_PRINT("VideoPlayer::Resume>");
+    if ( iPlayerState == EVideoPaused )
+        {
+        iVideoPlayer->Play(); 
+        iPlayerState = EVideoPlaying;       
+        }
+    BUBBLE_PRINT("VideoPlayer::Resume<");        
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::MuteAudio
+// -----------------------------------------------------------------------------
+//
+void CBubbleVideoPlayer::MuteAudio()
+    {
+    BUBBLE_PRINT("VideoPlayer::Mute");
+    if ( iVolumeRampTimer )
+        {
+        iVolumeRampTimer->Cancel();
+        }
+
+    iVolume = 0;
+    SetVolume( 0 );
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::SetVolume
+// -----------------------------------------------------------------------------
+//
+void CBubbleVideoPlayer::SetVolume( TInt aVolume )
+    {
+    BUBBLE_PRINT("VideoPlayer::SetVol>");
+    TInt maxVolume( iVideoPlayer->MaxVolume() );
+    maxVolume = ( maxVolume > 0 ) ? maxVolume : KBubbleVideoMaxVolumeLevel; 
+
+    TInt scaledVolume = ( aVolume * maxVolume ) / KBubbleVideoMaxVolumeLevel;
+    
+    TRAP_IGNORE( iVideoPlayer->SetVolumeL( scaledVolume ) );
+    BUBBLE_PRINT("VideoPlayer::SetVol<");
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::SetRingingType
+// -----------------------------------------------------------------------------
+//
+void CBubbleVideoPlayer::SetRingingType( TRingingType aRingingType )
+    {
+    BUBBLE_PRINT("VideoPlayer::SetRingType");
+    if ( aRingingType == ETypeAscending )
+        {
+        if ( !iVolumeRampTimer )
+            {
+            iVolumeRampTimer = CPeriodic::New( CActive::EPriorityStandard );
+            }
+
+        if ( iVolumeRampTimer && !iVolumeRampTimer->IsActive() )
+            {
+            TCallBack cb( VolumeRampTimerCallback, this );
+
+            SetVolume( KBubbleVideoMinVolumeLevel );
+            iRampedVolume = KBubbleVideoMinVolumeLevel;
+            iVolumeRampTimer->Start( KBubbleVideoVolumeRampInterval, 
+                                     KBubbleVideoVolumeRampInterval, 
+                                     cb );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::VolumeRampTimerCallback
+// -----------------------------------------------------------------------------
+//
+TInt CBubbleVideoPlayer::VolumeRampTimerCallback( TAny* aObj )
+    {
+    return static_cast<CBubbleVideoPlayer*>( aObj )->DoVolumeRamp();
+    }
+    
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::DoVolumeRamp
+// -----------------------------------------------------------------------------
+//
+TInt CBubbleVideoPlayer::DoVolumeRamp()
+    {
+    BUBBLE_PRINT("VideoPlayer::DoVolRamp");
+    if ( iRampedVolume < iVolume )
+        {
+        iRampedVolume = iRampedVolume + KBubbleVideoVolumeRampStep;
+        if ( iRampedVolume >= iVolume )
+            {
+            // target volume level reached
+            iRampedVolume = iVolume;
+            iVolumeRampTimer->Cancel();
+            }
+
+        SetVolume( iRampedVolume );
+        }
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::RepeatsTrailPauseTimerCallback
+// -----------------------------------------------------------------------------
+//
+TInt CBubbleVideoPlayer::RepeatsTrailPauseTimerCallback( TAny* aObj )
+    {
+    return static_cast<CBubbleVideoPlayer*>( aObj )->DoRingingRepeat();    
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::DoRingingRepeat
+// -----------------------------------------------------------------------------
+//    
+TInt CBubbleVideoPlayer::DoRingingRepeat()
+    {
+    iRepeatsTrailPauseTimer->Cancel();
+    
+    if ( iPlayerState == EVideoReady )
+        {
+        iVideoPlayer->Play();
+        iPlayerState = EVideoPlaying;
+        }
+
+    return KErrNone;    
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::State
+// -----------------------------------------------------------------------------
+//
+CBubbleVideoPlayer::TVideoPlayerState CBubbleVideoPlayer::State() const
+    {
+    return iPlayerState;
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::VideoResolution
+// -----------------------------------------------------------------------------
+//
+CBubbleVideoPlayer::TVideoResolution CBubbleVideoPlayer::VideoResolution() const
+    {
+    TSize frameSize( VideoFrameSize() );
+    
+    // SubQCCIF video resolution is 128x96 pixels
+    if ( frameSize.iWidth == 128 && frameSize.iHeight == 96 )
+        {
+        return EVideoSubQCIF;
+        }
+    else if ( frameSize.iWidth == 176 && frameSize.iHeight == 144 )        
+        {
+        return EVideoQCIF;        
+        }
+    else
+        {
+        return EVideoOther;    
+        }        
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::VideoResolution
+// -----------------------------------------------------------------------------
+//    
+TSize CBubbleVideoPlayer::VideoFrameSize() const
+    {
+    TSize frameSize( 0,0 );
+    
+    TRAPD( err, iVideoPlayer->VideoFrameSizeL( frameSize ) );
+    
+    if ( err != KErrNone )
+        {
+        return TSize(0,0);
+        }
+
+    return frameSize;            
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::AdjustToWindow
+// -----------------------------------------------------------------------------
+//    
+void CBubbleVideoPlayer::AdjustToWindow( RWindow& aDisplayWindow,
+                                        const TRect& aUncropPane,
+                                        TBool aArbitaryScalingSupported )
+    {
+    BUBBLE_PRINT("VideoPlayer::AdjToWin>");
+    __ASSERT_DEBUG( ( iPlayerState == EVideoReady || 
+                      iPlayerState == EVideoPaused ), 
+                    Panic( EBMPanicVideoPlayer ) );
+                    
+    // Get video frame dimensions
+    TSize  frameSize( VideoFrameSize() );
+    if ( frameSize.iWidth == 0 || frameSize.iHeight == 0 )
+        {
+        return; // invalid            
+        }
+
+    // Get window position and dimensions.
+    TSize  wndSize( aDisplayWindow.Size() );
+    TPoint wndPosition( aDisplayWindow.AbsPosition() );
+    
+    // Set screenRect equal to aDisplayWindow.
+    TRect screenRect( wndPosition, wndSize );
+    
+    TVideoResolution resolution = VideoResolution();         
+    if ( resolution == EVideoQCIF || resolution == EVideoSubQCIF )
+        {
+        // aUncropPane is valid only for qcif and sqcif.
+        
+        // The pane where uncropped video is positioned.
+        TSize uncropPaneSize( aUncropPane.Size() );
+
+        // Calculate size for aScreenRect passed to video player. Size is
+        // calculated so that auto scaled video frame covers uncrop pane.
+        TSize screenRectSize = CalculateScreenRectSize( 
+            uncropPaneSize, frameSize, aArbitaryScalingSupported );
+    
+        // Position aScreenRect.    
+        screenRect = TRect( aUncropPane.iTl, screenRectSize );     
+        TInt offsetX = (uncropPaneSize.iWidth - screenRectSize.iWidth) / 2;
+        TInt offsetY = (uncropPaneSize.iHeight - screenRectSize.iHeight) / 2;
+        screenRect.Move( offsetX, offsetY );    
+        }
+    
+    // Video is autoscaled by video player.
+    // iVideoPlayer->SetScaleFactorL(...);
+    
+    // Clip to display window
+    TRect clipRect( wndPosition, wndSize );
+    
+    // Update settings to video player.
+    CCoeEnv* coeEnv = CCoeEnv::Static();
+    TRAP_IGNORE( iVideoPlayer->SetDisplayWindowL( 
+           coeEnv->WsSession(),
+           *coeEnv->ScreenDevice(),
+           aDisplayWindow,
+           screenRect,
+           clipRect ) );
+    BUBBLE_PRINT("VideoPlayer::AdjToWin<");           
+    }
+    
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::AdjustToWindow2
+// -----------------------------------------------------------------------------
+// 
+void CBubbleVideoPlayer::AdjustToWindow2( 
+    RWindow& aDisplayWindow )
+    {
+    BUBBLE_PRINT("VideoPlayer::AdjToWin2>");
+    __ASSERT_DEBUG( ( iPlayerState == EVideoReady || 
+                      iPlayerState == EVideoPaused ), 
+                    Panic( EBMPanicVideoPlayer ) );
+                    
+    // Get video frame dimensions
+    TSize  frameSize( VideoFrameSize() );
+    if ( frameSize.iWidth == 0 || frameSize.iHeight == 0 )
+        {
+        return; // invalid            
+        }
+        
+    // Get video container position and dimensions
+    TSize  wndSize( aDisplayWindow.Size() );
+    TPoint wndPosition( aDisplayWindow.AbsPosition() );        
+
+    // Get sizes for clip and screen rectangles.
+    TSize clipSize;
+    TSize screenSize;
+    CalculateClipAndScreenRectSize( wndSize,
+                                    frameSize,
+                                    clipSize,
+                                    screenSize );
+    
+    // Center clip rectangle to aDisplayWindow
+    TRect clipRect( wndPosition, clipSize );
+    TInt offsetX = (wndSize.iWidth - clipSize.iWidth) / 2;
+    TInt offsetY = (wndSize.iHeight - clipSize.iHeight) / 2;
+    clipRect.Move( offsetX, offsetY );
+    
+    // Center screen rectangle to aDisplayWindow
+    TRect screenRect( wndPosition, screenSize );
+    offsetX = (wndSize.iWidth - screenSize.iWidth) / 2;
+    offsetY = (wndSize.iHeight - screenSize.iHeight) / 2;
+    screenRect.Move( offsetX, offsetY );
+    
+    iObserver.HandleVideoPlayerBlittingAreaDefined( clipRect );
+    
+    // Update rectangles to video player.
+    CCoeEnv* coeEnv = CCoeEnv::Static();
+    TRAP_IGNORE( iVideoPlayer->SetDisplayWindowL( 
+           coeEnv->WsSession(),
+           *coeEnv->ScreenDevice(),
+           aDisplayWindow,
+           screenRect,
+           clipRect ) );
+    BUBBLE_PRINT("VideoPlayer::AdjToWin2<");             
+    }
+
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::CalculateScreenRectSize
+// -----------------------------------------------------------------------------
+//
+TSize CBubbleVideoPlayer::CalculateScreenRectSize( 
+    const TSize& aCanvasSize,
+    const TSize& aVideoFrameSize,
+    TBool aArbitraryScalingSupported )
+    {
+    // Mismatch between canvas size and video size
+    TInt xDelta( aCanvasSize.iWidth - aVideoFrameSize.iWidth );
+    TInt yDelta( aCanvasSize.iHeight - aVideoFrameSize.iHeight );
+    
+    // Find minimum scaling factor to cover canvas by video.
+    TInt dScaleFactor( KBubbleVideoIACoef ); // use integer arithmetic 
+            
+    if ( xDelta == 0 && yDelta == 0 )
+        {
+        // correct size, scaling not needed
+        }
+    else if ( xDelta < 0 && yDelta == 0 )
+        {
+        // wide, but cannot downscale -> just crop
+        }
+    else if ( yDelta < 0 && xDelta == 0 )
+        {
+        // tall, but cannot downscale -> just crop    
+        }    
+    else if ( xDelta > 0 && yDelta > 0 )
+        {            
+        // small, narrow and flat  -> enlarge
+        TInt xProp( ( KBubbleVideoIACoef * aCanvasSize.iWidth ) / 
+                    aVideoFrameSize.iWidth );
+        TInt yProp( ( KBubbleVideoIACoef * aCanvasSize.iHeight ) / 
+                    aVideoFrameSize.iHeight );
+        
+        dScaleFactor = xProp > yProp ? xProp : yProp;
+        }
+    else if ( xDelta < 0 && yDelta < 0 ) 
+        {
+        // large, wide and tall -> downscale
+        TInt xProp( ( KBubbleVideoIACoef * aCanvasSize.iWidth ) / 
+                    aVideoFrameSize.iWidth );
+        TInt yProp( ( KBubbleVideoIACoef * aCanvasSize.iHeight ) / 
+                    aVideoFrameSize.iHeight );
+        
+        dScaleFactor = xProp > yProp ? xProp : yProp;      
+        }
+    else if ( xDelta > 0 && yDelta <= 0 )
+        {
+        // narrow -> enlarge
+        dScaleFactor = ( KBubbleVideoIACoef * aCanvasSize.iWidth ) / 
+                       aVideoFrameSize.iWidth;
+        }
+    else if ( yDelta > 0 && xDelta <= 0 )
+        {
+        // flat  -> enlarge
+        dScaleFactor = ( KBubbleVideoIACoef * aCanvasSize.iHeight) / 
+                       aVideoFrameSize.iHeight;              
+        }
+    else
+        {
+        // do nothing
+        }
+    
+    if ( !aArbitraryScalingSupported )
+        {
+        TInt remainder( dScaleFactor % KBubbleVideoIACoef );
+        
+        ///////////////////////////////////////////////////////
+        // Fixed scales are 200, 162, 137, 112, 100, 50  ( %)
+        // Fixed values not used: 325, 275, 250, 225, 
+        ///////////////////////////////////////////////////////
+        if ( dScaleFactor > ( 2 * KBubbleVideoIACoef ) )
+            {
+            dScaleFactor = ( 2 * KBubbleVideoIACoef ); // 200% is MAX    
+            }
+        else if ( remainder )
+            {
+            if ( dScaleFactor > KBubbleVideoIACoef )    
+                {
+                // upscale
+                TInt scale = ( 100 * dScaleFactor ) / KBubbleVideoIACoef;
+                
+                if ( scale > 162 )
+                    {
+                    // 200%
+                    dScaleFactor = 2 * KBubbleVideoIACoef;   
+                    }
+                else if ( scale > 137 )
+                    {
+                    // 162%
+                    dScaleFactor = 162 * ( KBubbleVideoIACoef / 100 );    
+                    }
+                else if ( scale > 112 )
+                    {
+                    // 137%
+                    dScaleFactor = 137 * ( KBubbleVideoIACoef / 100 );        
+                    }
+                else
+                    {
+                    // 112%
+                    dScaleFactor = 112 * ( KBubbleVideoIACoef / 100 );    
+                    }                    
+                }
+            else
+                {
+                // downscale    
+                if ( remainder > ( KBubbleVideoIACoef / 2 ) )
+                    {
+                    dScaleFactor = KBubbleVideoIACoef; // 100%    
+                    }
+                else
+                    {
+                    dScaleFactor = ( KBubbleVideoIACoef / 2 ); // 50%    
+                    }
+                }
+            }        
+        }
+    
+    ////////////////////////////////////////////////
+    // Calculate scaled frame size (virtual canvas)
+    ////////////////////////////////////////////////
+    TInt screenWidth = DivideAndCeil( 
+                           ( dScaleFactor * aVideoFrameSize.iWidth ), 
+                           KBubbleVideoIACoef );
+    TInt screenHeight = DivideAndCeil( 
+                           ( dScaleFactor * aVideoFrameSize.iHeight ), 
+                           KBubbleVideoIACoef );
+    
+    return TSize( screenWidth, screenHeight );    
+    }
+    
+// -----------------------------------------------------------------------------
+// CBubbleVideoPlayer::CalculateClipAndScreenRectSize
+// -----------------------------------------------------------------------------
+//
+void CBubbleVideoPlayer::CalculateClipAndScreenRectSize( 
+    const TSize& aWindowSize,
+    const TSize& aVideoFrameSize,
+    TSize& aClipSize,
+    TSize& aScreenSize )    
+    {
+    // Check aspect ratios
+    // aWindowSize or aVideoFrameSize cannot be zero in this phase.
+    TInt windowAspectRatio = ( KBubbleVideoIACoef * aWindowSize.iWidth ) / 
+                             aWindowSize.iHeight;
+    TInt videoAspectRatio = ( KBubbleVideoIACoef * aVideoFrameSize.iWidth ) / 
+                             aVideoFrameSize.iHeight;                             
+    
+    
+    if ( videoAspectRatio == windowAspectRatio )
+        {
+        // Aspect ratios are same.
+        
+        // Set clip and screen rect equal to window.
+        // Scaled video will cover window entirely.
+        aClipSize = aWindowSize;
+        aScreenSize = aWindowSize;            
+        }
+    else if ( windowAspectRatio > videoAspectRatio )
+        {
+        // Window is more wide screen than video.
+        
+        // Window height sets the limit.
+        TInt maxHeight = aWindowSize.iHeight;
+
+        // Calculate max scale according to allowed crop.
+        // Formula:
+        // ( 100 - crop )   visible    window_height x scale x video_width
+        // -------------- = ------- =  -----------------------------------
+        //      100       scaled_size  (scale)^2 x video_width x video_height
+        //
+        TInt dScaleFactor = ( maxHeight * 100 * KBubbleVideoIACoef ) /
+            ( (100 - KBubbleMaxVideoCrop) * aVideoFrameSize.iHeight );
+            
+        TInt scaledWidth = 
+            DivideAndCeil( ( dScaleFactor * aVideoFrameSize.iWidth ), 
+                           KBubbleVideoIACoef );
+        
+        // Limit to window width
+        if ( scaledWidth > aWindowSize.iWidth )
+            {
+            scaledWidth = aWindowSize.iWidth;
+            dScaleFactor = ( KBubbleVideoIACoef * aWindowSize.iWidth ) / 
+                             aVideoFrameSize.iWidth;                
+            }
+            
+        TInt scaledHeight = 
+            DivideAndCeil( ( dScaleFactor * aVideoFrameSize.iHeight ), 
+                           KBubbleVideoIACoef );            
+            
+        aClipSize = TSize( scaledWidth, maxHeight );
+        aScreenSize = TSize( scaledWidth  + ( 2 * KBubbleVideoClipMarginX ), 
+                             scaledHeight + ( 2 * KBubbleVideoClipMarginY ) );    
+        }
+    else
+        {
+        // Video is more wide screen than window.
+        
+        // Window width sets the limit.
+        TInt maxWidth = aWindowSize.iWidth;
+
+        // Calculate max scale according to allowed crop.
+        // Formula:
+        // ( 100 - crop )   visible    window_width x scale x video_heigth
+        // -------------- = ------- =  -----------------------------------
+        //      100       scaled_size  (scale)^2 x video_width x video_height
+        //
+        TInt dScaleFactor = ( maxWidth * 100 * KBubbleVideoIACoef ) /
+            ( (100 - KBubbleMaxVideoCrop) * aVideoFrameSize.iWidth );
+                                       
+            
+        TInt scaledHeight = 
+            DivideAndCeil( ( dScaleFactor * aVideoFrameSize.iHeight ), 
+                           KBubbleVideoIACoef );
+        
+        // Limit to window height
+        if ( scaledHeight > aWindowSize.iHeight )
+            {
+            scaledHeight = aWindowSize.iHeight;
+            dScaleFactor = ( KBubbleVideoIACoef * aWindowSize.iHeight ) / 
+                             aVideoFrameSize.iHeight;                
+            }
+            
+        TInt scaledWidth = 
+            DivideAndCeil( ( dScaleFactor * aVideoFrameSize.iWidth ), 
+                           KBubbleVideoIACoef );            
+            
+        aClipSize = TSize( maxWidth, scaledHeight );
+        aScreenSize = TSize( scaledWidth  + ( 2 * KBubbleVideoClipMarginX ), 
+                             scaledHeight + ( 2 * KBubbleVideoClipMarginY ) );   
+        }
+    }
+
+// ============================================================================
+// Callbacks from VideoPlayerutility
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// see MVideoPlayerUtilityObserver::MvpuoOpenComplete
+// ----------------------------------------------------------------------------
+//
+void CBubbleVideoPlayer::MvpuoOpenComplete( TInt aError )
+    {
+    BUBBLE_PRINTF("VideoPlayer::OpenComp:", aError);
+    if ( aError == KErrNone )
+        {
+        // Prepare clip for playing
+        iPlayerState = EVideoPreparing;
+        iVideoPlayer->Prepare();
+        }
+    else // Report error
+        {
+        iPlayerState = EVideoError;
+        iObserver.HandleVideoPlayerError( 
+            MBubbleVideoPlayerObserver::EVideoPlayerInitializingFailure,
+            aError );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// see MVideoPlayerUtilityObserver::MvpuoPrepareComplete
+// ----------------------------------------------------------------------------
+//
+void CBubbleVideoPlayer::MvpuoPrepareComplete( TInt aError )
+    {
+    BUBBLE_PRINTF("VideoPlayer::PrepComp:", aError);
+    if ( aError == KErrNone )
+        {
+        iPlayerState = EVideoReady;
+        iObserver.HandleVideoPlayerInitComplete();
+
+        SetVolume( iVolume );
+        SetRingingType( iRingingType );
+
+        if ( iToBePlayed )
+            {
+            iVideoPlayer->Play();
+            iPlayerState = EVideoPlaying;
+            }
+        }
+    else  // Report error
+        {
+        iPlayerState = EVideoError;
+        iObserver.HandleVideoPlayerError( 
+            MBubbleVideoPlayerObserver::EVideoPlayerInitializingFailure,
+            aError );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// see MVideoPlayerUtilityObserver::MvpuoFrameReady
+// ----------------------------------------------------------------------------
+//
+void CBubbleVideoPlayer::MvpuoFrameReady( CFbsBitmap& /*aFrame*/,
+                                          TInt /*aError*/ )
+    {
+    // NOP
+    }
+
+// ----------------------------------------------------------------------------
+// see MVideoPlayerUtilityObserver::MvpuoPlayComplete
+// ----------------------------------------------------------------------------
+//
+void CBubbleVideoPlayer::MvpuoPlayComplete( TInt aError )
+    {
+    BUBBLE_PRINTF("VideoPlayer::PlayComp:", aError);
+    if ( aError == KErrNone )
+        {
+        iPlayerState = EVideoReady;
+        
+        if ( iRingingType == ETypeRingingOnce )
+            {
+            iObserver.HandleVideoPlayerPlayingComplete();
+            } 
+        else // continue playing
+            {
+            if ( !iRepeatsTrailPauseTimer )
+                {
+                iRepeatsTrailPauseTimer = 
+                    CPeriodic::New( CActive::EPriorityStandard );
+                }
+            
+            if ( iRepeatsTrailPauseTimer && 
+                 !iRepeatsTrailPauseTimer->IsActive() )
+                {
+                TCallBack cb( RepeatsTrailPauseTimerCallback, this );
+                iRepeatsTrailPauseTimer->Start( KBubbleVideoRepeatsTrailPause, 
+                                         KBubbleVideoRepeatsTrailPause, 
+                                         cb );
+                }
+            }        
+        }
+    else // report error
+        {
+        iPlayerState = EVideoError;
+        iObserver.HandleVideoPlayerError( 
+            MBubbleVideoPlayerObserver::EVideoPlayerPlayingFailure,
+            aError );
+        }
+    }
+        
+// ----------------------------------------------------------------------------
+// see MVideoPlayerUtilityObserver::MvpuoEvent
+// ----------------------------------------------------------------------------
+//
+void CBubbleVideoPlayer::MvpuoEvent( const TMMFEvent& /*aEvent*/ )
+    {
+    // NOP
+    }
+    
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/bmcustomization/bwins/bmcustomizationu.def	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,46 @@
+EXPORTS
+	??0CTelBubbleAnim@@IAE@XZ @ 1 NONAME ; CTelBubbleAnim::CTelBubbleAnim(void)
+	??0CTelBubbleCallImage@@IAE@XZ @ 2 NONAME ; CTelBubbleCallImage::CTelBubbleCallImage(void)
+	??0CTelBubbleImage@@IAE@XZ @ 3 NONAME ; CTelBubbleImage::CTelBubbleImage(void)
+	??1CTelBubbleAnim@@UAE@XZ @ 4 NONAME ; CTelBubbleAnim::~CTelBubbleAnim(void)
+	??1CTelBubbleCallImage@@UAE@XZ @ 5 NONAME ; CTelBubbleCallImage::~CTelBubbleCallImage(void)
+	??1CTelBubbleCustomElement@@UAE@XZ @ 6 NONAME ; CTelBubbleCustomElement::~CTelBubbleCustomElement(void)
+	??1CTelBubbleImage@@UAE@XZ @ 7 NONAME ; CTelBubbleImage::~CTelBubbleImage(void)
+	?AddFrameToAnimationL@CTelBubbleAnim@@QBEXAAVCEikImage@@@Z @ 8 NONAME ; void CTelBubbleAnim::AddFrameToAnimationL(class CEikImage &) const
+	?AddFrameToAnimationLD@CTelBubbleAnim@@QBEXPAVCEikImage@@@Z @ 9 NONAME ; void CTelBubbleAnim::AddFrameToAnimationLD(class CEikImage *) const
+	?ConstructL@CTelBubbleAnim@@MAEXH@Z @ 10 NONAME ; void CTelBubbleAnim::ConstructL(int)
+	?ConstructL@CTelBubbleCallImage@@MAEXXZ @ 11 NONAME ; void CTelBubbleCallImage::ConstructL(void)
+	?ConstructL@CTelBubbleImage@@MAEXXZ @ 12 NONAME ; void CTelBubbleImage::ConstructL(void)
+	?Control@CTelBubbleCustomElement@@QBEPAVCCoeControl@@XZ @ 13 NONAME ; class CCoeControl * CTelBubbleCustomElement::Control(void) const
+	?ControlType@CTelBubbleCustomElement@@QBE?AW4TControlType@1@XZ @ 14 NONAME ; enum CTelBubbleCustomElement::TControlType CTelBubbleCustomElement::ControlType(void) const
+	?CountComponentControls@CTelBubbleAnim@@MBEHXZ @ 15 NONAME ; int CTelBubbleAnim::CountComponentControls(void) const
+	?Draw@CTelBubbleAnim@@MBEXABVTRect@@@Z @ 16 NONAME ; void CTelBubbleAnim::Draw(class TRect const &) const
+	?Draw@CTelBubbleCallImage@@MBEXABVTRect@@@Z @ 17 NONAME ; void CTelBubbleCallImage::Draw(class TRect const &) const
+	?ElementType@CTelBubbleCustomElement@@QBE?AW4TElementType@1@XZ @ 18 NONAME ; enum CTelBubbleCustomElement::TElementType CTelBubbleCustomElement::ElementType(void) const
+	?Image@CTelBubbleCallImage@@IBEPBVCFbsBitmap@@XZ @ 19 NONAME ; class CFbsBitmap const * CTelBubbleCallImage::Image(void) const
+	?ImageChanged@CTelBubbleCallImage@@MAEXXZ @ 20 NONAME ; void CTelBubbleCallImage::ImageChanged(void)
+	?ImagePlacingArea@CTelBubbleCallImage@@IBEABVTRect@@XZ @ 21 NONAME ; class TRect const & CTelBubbleCallImage::ImagePlacingArea(void) const
+	?IsFullScreenImage@CTelBubbleCallImage@@IBEHXZ @ 22 NONAME ; int CTelBubbleCallImage::IsFullScreenImage(void) const
+	?MakeVisible@CTelBubbleAnim@@MAEXH@Z @ 23 NONAME ; void CTelBubbleAnim::MakeVisible(int)
+	?Mask@CTelBubbleCallImage@@IBEPBVCFbsBitmap@@XZ @ 24 NONAME ; class CFbsBitmap const * CTelBubbleCallImage::Mask(void) const
+	?NewL@CTelBubbleAnim@@SAPAV1@H@Z @ 25 NONAME ; class CTelBubbleAnim * CTelBubbleAnim::NewL(int)
+	?NewL@CTelBubbleCallImage@@SAPAV1@XZ @ 26 NONAME ; class CTelBubbleCallImage * CTelBubbleCallImage::NewL(void)
+	?NewL@CTelBubbleCustomElement@@SAPAV1@PAVCCoeControl@@W4TElementType@1@@Z @ 27 NONAME ; class CTelBubbleCustomElement * CTelBubbleCustomElement::NewL(class CCoeControl *, enum CTelBubbleCustomElement::TElementType)
+	?NewL@CTelBubbleCustomElement@@SAPAV1@PAVCTelBubbleAnim@@W4TElementType@1@@Z @ 28 NONAME ; class CTelBubbleCustomElement * CTelBubbleCustomElement::NewL(class CTelBubbleAnim *, enum CTelBubbleCustomElement::TElementType)
+	?NewL@CTelBubbleCustomElement@@SAPAV1@PAVCTelBubbleCallImage@@W4TElementType@1@@Z @ 29 NONAME ; class CTelBubbleCustomElement * CTelBubbleCustomElement::NewL(class CTelBubbleCallImage *, enum CTelBubbleCustomElement::TElementType)
+	?NewL@CTelBubbleCustomElement@@SAPAV1@PAVCTelBubbleImage@@W4TElementType@1@@Z @ 30 NONAME ; class CTelBubbleCustomElement * CTelBubbleCustomElement::NewL(class CTelBubbleImage *, enum CTelBubbleCustomElement::TElementType)
+	?NewL@CTelBubbleCustomElement@@SAPAV1@PAVCTelBubbleLabel@@W4TElementType@1@@Z @ 31 NONAME ; class CTelBubbleCustomElement * CTelBubbleCustomElement::NewL(class CTelBubbleLabel *, enum CTelBubbleCustomElement::TElementType)
+	?NewL@CTelBubbleImage@@SAPAV1@XZ @ 32 NONAME ; class CTelBubbleImage * CTelBubbleImage::NewL(void)
+	?Offset@CTelBubbleCallImage@@IBEABVTPoint@@XZ @ 33 NONAME ; class TPoint const & CTelBubbleCallImage::Offset(void) const
+	?PositionChanged@CTelBubbleImage@@MAEXXZ @ 34 NONAME ; void CTelBubbleImage::PositionChanged(void)
+	?Reset@CTelBubbleAnim@@QBEXXZ @ 35 NONAME ; void CTelBubbleAnim::Reset(void) const
+	?SetContainerWindowL@CTelBubbleAnim@@MAEXABVCCoeControl@@@Z @ 36 NONAME ; void CTelBubbleAnim::SetContainerWindowL(class CCoeControl const &)
+	?SetImage@CTelBubbleCallImage@@QAEXPAVCFbsBitmap@@H0H@Z @ 37 NONAME ; void CTelBubbleCallImage::SetImage(class CFbsBitmap *, int, class CFbsBitmap *, int)
+	?SetImagePlacingArea@CTelBubbleCallImage@@QAEXAAVTRect@@@Z @ 38 NONAME ; void CTelBubbleCallImage::SetImagePlacingArea(class TRect &)
+	?SizeChanged@CTelBubbleAnim@@MAEXXZ @ 39 NONAME ; void CTelBubbleAnim::SizeChanged(void)
+	?SizeChanged@CTelBubbleCallImage@@MAEXXZ @ 40 NONAME ; void CTelBubbleCallImage::SizeChanged(void)
+	?SizeChanged@CTelBubbleImage@@MAEXXZ @ 41 NONAME ; void CTelBubbleImage::SizeChanged(void)
+	?SourceRect@CTelBubbleCallImage@@IBEABVTRect@@XZ @ 42 NONAME ; class TRect const & CTelBubbleCallImage::SourceRect(void) const
+	?StartAnimationL@CTelBubbleAnim@@QAEXXZ @ 43 NONAME ; void CTelBubbleAnim::StartAnimationL(void)
+	?StopAnimation@CTelBubbleAnim@@QAEXXZ @ 44 NONAME ; void CTelBubbleAnim::StopAnimation(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/bmcustomization/eabi/bmcustomizationu.def	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,63 @@
+EXPORTS
+	_ZN14CTelBubbleAnim10ConstructLEi @ 1 NONAME
+	_ZN14CTelBubbleAnim11MakeVisibleEi @ 2 NONAME
+	_ZN14CTelBubbleAnim11SizeChangedEv @ 3 NONAME
+	_ZN14CTelBubbleAnim13StopAnimationEv @ 4 NONAME
+	_ZN14CTelBubbleAnim15StartAnimationLEv @ 5 NONAME
+	_ZN14CTelBubbleAnim19SetContainerWindowLERK11CCoeControl @ 6 NONAME
+	_ZN14CTelBubbleAnim4NewLEi @ 7 NONAME
+	_ZN14CTelBubbleAnimC1Ev @ 8 NONAME
+	_ZN14CTelBubbleAnimC2Ev @ 9 NONAME
+	_ZN14CTelBubbleAnimD0Ev @ 10 NONAME
+	_ZN14CTelBubbleAnimD1Ev @ 11 NONAME
+	_ZN14CTelBubbleAnimD2Ev @ 12 NONAME
+	_ZN15CTelBubbleImage10ConstructLEv @ 13 NONAME
+	_ZN15CTelBubbleImage11SizeChangedEv @ 14 NONAME
+	_ZN15CTelBubbleImage15PositionChangedEv @ 15 NONAME
+	_ZN15CTelBubbleImage4NewLEv @ 16 NONAME
+	_ZN15CTelBubbleImageC1Ev @ 17 NONAME
+	_ZN15CTelBubbleImageC2Ev @ 18 NONAME
+	_ZN15CTelBubbleImageD0Ev @ 19 NONAME
+	_ZN15CTelBubbleImageD1Ev @ 20 NONAME
+	_ZN15CTelBubbleImageD2Ev @ 21 NONAME
+	_ZN19CTelBubbleCallImage10ConstructLEv @ 22 NONAME
+	_ZN19CTelBubbleCallImage11SizeChangedEv @ 23 NONAME
+	_ZN19CTelBubbleCallImage12ImageChangedEv @ 24 NONAME
+	_ZN19CTelBubbleCallImage19SetImagePlacingAreaER5TRect @ 25 NONAME
+	_ZN19CTelBubbleCallImage4NewLEv @ 26 NONAME
+	_ZN19CTelBubbleCallImage8SetImageEP10CFbsBitmapiS1_i @ 27 NONAME
+	_ZN19CTelBubbleCallImageC1Ev @ 28 NONAME
+	_ZN19CTelBubbleCallImageC2Ev @ 29 NONAME
+	_ZN19CTelBubbleCallImageD0Ev @ 30 NONAME
+	_ZN19CTelBubbleCallImageD1Ev @ 31 NONAME
+	_ZN19CTelBubbleCallImageD2Ev @ 32 NONAME
+	_ZN23CTelBubbleCustomElement4NewLEP11CCoeControlNS_12TElementTypeE @ 33 NONAME
+	_ZN23CTelBubbleCustomElement4NewLEP14CTelBubbleAnimNS_12TElementTypeE @ 34 NONAME
+	_ZN23CTelBubbleCustomElement4NewLEP15CTelBubbleImageNS_12TElementTypeE @ 35 NONAME
+	_ZN23CTelBubbleCustomElement4NewLEP15CTelBubbleLabelNS_12TElementTypeE @ 36 NONAME
+	_ZN23CTelBubbleCustomElement4NewLEP19CTelBubbleCallImageNS_12TElementTypeE @ 37 NONAME
+	_ZN23CTelBubbleCustomElementD0Ev @ 38 NONAME
+	_ZN23CTelBubbleCustomElementD1Ev @ 39 NONAME
+	_ZN23CTelBubbleCustomElementD2Ev @ 40 NONAME
+	_ZNK14CTelBubbleAnim20AddFrameToAnimationLER9CEikImage @ 41 NONAME
+	_ZNK14CTelBubbleAnim21AddFrameToAnimationLDEP9CEikImage @ 42 NONAME
+	_ZNK14CTelBubbleAnim22CountComponentControlsEv @ 43 NONAME
+	_ZNK14CTelBubbleAnim4DrawERK5TRect @ 44 NONAME
+	_ZNK14CTelBubbleAnim5ResetEv @ 45 NONAME
+	_ZNK19CTelBubbleCallImage10SourceRectEv @ 46 NONAME
+	_ZNK19CTelBubbleCallImage16ImagePlacingAreaEv @ 47 NONAME
+	_ZNK19CTelBubbleCallImage17IsFullScreenImageEv @ 48 NONAME
+	_ZNK19CTelBubbleCallImage4DrawERK5TRect @ 49 NONAME
+	_ZNK19CTelBubbleCallImage4MaskEv @ 50 NONAME
+	_ZNK19CTelBubbleCallImage5ImageEv @ 51 NONAME
+	_ZNK19CTelBubbleCallImage6OffsetEv @ 52 NONAME
+	_ZNK23CTelBubbleCustomElement11ControlTypeEv @ 53 NONAME
+	_ZNK23CTelBubbleCustomElement11ElementTypeEv @ 54 NONAME
+	_ZNK23CTelBubbleCustomElement7ControlEv @ 55 NONAME
+	_ZTI14CTelBubbleAnim @ 56 NONAME ; #<TI>#
+	_ZTI15CTelBubbleImage @ 57 NONAME ; #<TI>#
+	_ZTI19CTelBubbleCallImage @ 58 NONAME ; #<TI>#
+	_ZTV14CTelBubbleAnim @ 59 NONAME ; #<VT>#
+	_ZTV15CTelBubbleImage @ 60 NONAME ; #<VT>#
+	_ZTV19CTelBubbleCallImage @ 61 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/bmcustomization/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,35 @@
+/*
+* 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:  Build file
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/bmcustomization.iby    CORE_APP_LAYER_IBY_EXPORT_PATH(bmcustomization.iby)
+
+PRJ_EXTENSIONS
+
+
+PRJ_MMPFILES
+../group/bmcustomization.mmp
+
+PRJ_TESTMMPFILES
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/bmcustomization/group/bmcustomization.mmp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This is project specification file for the Bubblemanager 
+*                customization. 
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+// Capability assignment.
+CAPABILITY CAP_GENERAL_DLL
+
+// Assign Vendor ID.
+VENDORID VID_DEFAULT
+
+TARGET      bmcustomization.dll
+TARGETTYPE  dll
+UID         0x1000008d 0x102078F5
+
+sourcepath  ../src
+SOURCE telbubblecustomelement.cpp 
+SOURCE telbubbleimage.cpp 
+SOURCE telbubbleanim.cpp 
+SOURCE telbubblelabel.cpp
+SOURCE telbubblecallimage.cpp
+
+USERINCLUDE . ../inc
+
+SYSTEMINCLUDE ../../../../inc  // s60/app/telephony/inc
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY euser.lib
+LIBRARY cone.lib   // CCoeControl
+LIBRARY avkon.lib  // animation
+LIBRARY bmpanim.lib  // animation
+LIBRARY aknskins.lib // image, skins
+LIBRARY aknicon.lib  // image, icon
+LIBRARY eikcoctl.lib // image
+LIBRARY fbscli.lib // fbsbitmap 
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/bmcustomization/rom/bmcustomization.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* 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:  IBY file for Bmcustomization
+*
+*/
+
+
+#ifndef BMCUSTOMIZATION_IBY
+#define BMCUSTOMIZATION_IBY
+
+file=ABI_DIR\BUILD_DIR\bmcustomization.dll            SHARED_LIB_DIR\bmcustomization.dll
+
+#endif // BMCUSTOMIZATION_IBY
+
+//  End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/bmcustomization/src/telbubbleanim.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,196 @@
+/*
+* 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:  Default animation implementation.
+*
+*/
+
+#include <AknBitmapAnimation.h>  // Animation definition
+#include <eikimage.h>
+
+#include "telbubbleanim.h"
+
+// ======== LOCAL FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CBubbleAnim::NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTelBubbleAnim* CTelBubbleAnim::NewL( TInt aFrameInterval )
+    {
+    CTelBubbleAnim* self = new( ELeave )CTelBubbleAnim();
+    CleanupStack::PushL( self );
+    self->ConstructL( aFrameInterval );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleAnim::~CTelBubbleAnim
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTelBubbleAnim::~CTelBubbleAnim()
+    {
+    delete iAnimation;
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleAnim::StartAnimation
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTelBubbleAnim::StartAnimationL()
+    {
+    iAnimation->StartAnimationL();
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleAnim::StopAnimation
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTelBubbleAnim::StopAnimation()
+    {
+    iAnimation->CancelAnimation();
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleAnim::AddFrameToAnimationLD
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTelBubbleAnim::AddFrameToAnimationLD( CEikImage* aFrame ) const
+    {
+    CleanupStack::PushL( aFrame );
+
+    CBitmapFrameData* frame = CBitmapFrameData::NewL(
+        MUTABLE_CAST( CFbsBitmap*, aFrame->Bitmap() ),
+        MUTABLE_CAST( CFbsBitmap*, aFrame->Mask() ) );
+    aFrame->SetPictureOwnedExternally( ETrue );
+    CleanupStack::PushL( frame );
+    
+    frame->SetInterval( KErrNotFound );
+    frame->SetBitmapsOwnedExternally( EFalse );
+    iAnimation->BitmapAnimData()->AppendFrameL( frame ); // Takes ownership
+
+    CleanupStack::Pop( frame );
+    CleanupStack::PopAndDestroy( aFrame );
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleAnim::AddFrameToAnimationL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTelBubbleAnim::AddFrameToAnimationL( CEikImage& aFrame ) const
+    {
+    CBitmapFrameData* frame = CBitmapFrameData::NewL(
+        MUTABLE_CAST( CFbsBitmap*, aFrame.Bitmap() ),
+        MUTABLE_CAST( CFbsBitmap*, aFrame.Mask() ) );
+    CleanupStack::PushL( frame );
+    
+    frame->SetInterval( KErrNotFound );
+    frame->SetBitmapsOwnedExternally( ETrue );
+    iAnimation->BitmapAnimData()->AppendFrameL( frame ); // Takes ownership
+
+    CleanupStack::Pop( frame );
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleAnim::Reset
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTelBubbleAnim::Reset() const
+    {
+    iAnimation->BitmapAnimData()->ResetFrameArray();
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleAnim::CountComponentControls
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CTelBubbleAnim::CountComponentControls() const
+    {
+    // do not return animation here!
+    return 0;
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleAnim::Reset
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTelBubbleAnim::SetContainerWindowL( const CCoeControl& aContainer )
+    {
+    CCoeControl::SetContainerWindowL( aContainer );
+
+    iAnimation->SetContainerWindowL( aContainer );
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleAnim::Reset
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTelBubbleAnim::SizeChanged()
+    {
+    CCoeControl::SizeChanged();
+    
+    iAnimation->SetRect( Rect() );
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleAnim::Draw
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTelBubbleAnim::Draw( const TRect& /*aRect*/ ) const
+    {
+    // drawing is done in iAnimation
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleAnim::MakeVisible
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTelBubbleAnim::MakeVisible( TBool aVisible )
+    {
+    CCoeControl::MakeVisible( aVisible );
+    iAnimation->MakeVisible( aVisible );
+    
+    if( !aVisible )
+        {
+        StopAnimation();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleAnim::ConstructL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTelBubbleAnim::ConstructL( TInt aFrameInterval )
+    {
+    iAnimation = CAknBitmapAnimation::NewL();
+
+    iAnimation->MakeVisible( EFalse );
+    iAnimation->SetContainerWindowL( *this );
+    iAnimation->ActivateL();
+
+    CBitmapAnimClientData* animData = iAnimation->BitmapAnimData();
+    animData->SetPlayMode( CBitmapAnimClientData::ECycle );
+    animData->SetFrameInterval( aFrameInterval );
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleAnim::CTelBubbleAnim
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTelBubbleAnim::CTelBubbleAnim()
+    {
+    }
+
+// end of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/bmcustomization/src/telbubblecallimage.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Call image control.
+*
+*/
+
+
+#include <telbubblecallimage.h>
+#include <gdi.h>
+
+// ======== LOCAL FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTelBubbleCallImage::CTelBubbleCallImage()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTelBubbleCallImage* CTelBubbleCallImage::NewL()
+    {
+    CTelBubbleCallImage* self = new( ELeave )CTelBubbleCallImage();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTelBubbleCallImage::~CTelBubbleCallImage()
+    {
+    if ( iImageOwnership )
+        {
+        delete iImage;
+        }
+    if ( iMaskOwnership )
+        {
+        delete iMask;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCallImage::ConstructL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTelBubbleCallImage::ConstructL()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCallImage::SetImage
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTelBubbleCallImage::SetImage( 
+    CFbsBitmap* aImage, 
+    TBool aImageOwnership,
+    CFbsBitmap* aMask,
+    TBool aMaskOwnership )
+    {
+    if ( iImageOwnership )
+        {
+        delete iImage;
+        }
+    if ( iMaskOwnership )
+        {
+        delete iMask;
+        }
+    
+    iImage = aImage;
+    iMask = aMask;
+    iImageOwnership = aImageOwnership;
+    iMaskOwnership = aMaskOwnership;
+    
+    SizeChanged();
+    ImageChanged();
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCallImage::ReleaseImage
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTelBubbleCallImage::ImageChanged()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCallImage::ReleaseImage
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTelBubbleCallImage::SetImagePlacingArea( TRect& aRect )
+    {
+    iImagePlacingArea = aRect;
+    }
+  
+// ---------------------------------------------------------------------------
+// CTelBubbleCallImage::ReleaseImage
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const CFbsBitmap* CTelBubbleCallImage::Image() const
+    {
+    return iImage;
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCallImage::ReleaseImage
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const CFbsBitmap* CTelBubbleCallImage::Mask() const
+    {
+    return iMask;
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCallImage::IsFullScreenImage
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CTelBubbleCallImage::IsFullScreenImage() const
+    {
+    TBool isFullScreen = ETrue;
+    
+    if ( iImage )
+        {
+        TSize imageSize = iImage->SizeInPixels();
+        TSize thisSize( Rect().Size() );
+        isFullScreen = ( imageSize.iWidth >= thisSize.iWidth ) ||
+                       ( imageSize.iHeight >= thisSize.iHeight );
+        }
+        
+    return isFullScreen;  
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCallImage::Offset
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TPoint& CTelBubbleCallImage::Offset() const
+    {
+    return iOffset;
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCallImage::SourceRect
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TRect& CTelBubbleCallImage::SourceRect() const
+    {
+    return iSourceRect;
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCallImage::ImagePlacingArea
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TRect& CTelBubbleCallImage::ImagePlacingArea() const
+    {
+    return iImagePlacingArea;
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCallImage::SizeChanged
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTelBubbleCallImage::SizeChanged()
+    {
+    if ( !iImage )
+        {
+        return;                    
+        }
+    
+    // If bitmap is bigger than drawing area then clip from center.
+    TRect rect;
+    if ( IsFullScreenImage() )
+        {
+        rect = Rect();
+        }
+    else
+        {
+        rect = ImagePlacingArea();
+        }
+    
+    iSourceRect = iImage->SizeInPixels();
+    
+    TInt offsetX = ( iSourceRect.Width() > rect.Width() ) ? 
+                   ((iSourceRect.Width() - rect.Width()) / 2) : 0;
+    TInt offsetY = ( iSourceRect.Height() > rect.Height() ) ? 
+                   ((iSourceRect.Height() - rect.Height()) / 2) : 0;
+    iSourceRect.Shrink( offsetX, offsetY );    
+    
+    // If bitmap is smaller than drawing area then center it.
+    iOffset.iX = ( iSourceRect.Width() < rect.Width() ) ? 
+                ((rect.Width() - iSourceRect.Width()) / 2) : 0;
+    iOffset.iY = ( iSourceRect.Height() < rect.Height() ) ? 
+                ((rect.Height() - iSourceRect.Height()) / 2) : 0;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCallImage::Draw
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTelBubbleCallImage::Draw( const TRect& /*aRect*/ ) const
+    {
+    CWindowGc& gc = SystemGc();
+    
+    TPoint topLeft = IsFullScreenImage() ? Rect().iTl : iImagePlacingArea.iTl;
+    
+    
+    if ( iImage && iMask )
+        {
+        gc.BitBltMasked( topLeft + iOffset,
+                         iImage, 
+                         iSourceRect, 
+                         iMask, 
+                         EFalse );
+        }
+    else if ( iImage )
+        {
+        gc.BitBlt( topLeft + iOffset, 
+                   iImage,
+                   iSourceRect );    
+        }
+    }
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/bmcustomization/src/telbubblecustomelement.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Capsulates animation, image, label or control information.
+*
+*/
+
+
+#include "telbubblecustomelement.h"
+#include "telbubbleanim.h"
+#include "telbubbleimage.h"
+#include "telbubblelabel.h"
+#include "telbubblecallimage.h"
+
+// ======== LOCAL FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CBubbleCustomElement::NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTelBubbleCustomElement* CTelBubbleCustomElement::NewL( 
+    CCoeControl* aControl, TElementType aElement )
+    {
+    CTelBubbleCustomElement* self = new( ELeave )CTelBubbleCustomElement( 
+        aControl, aElement );
+    
+    return self;
+    }
+    
+// ---------------------------------------------------------------------------
+// CTelBubbleCustomElement::NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTelBubbleCustomElement* CTelBubbleCustomElement::NewL( 
+    CTelBubbleAnim* aControl, TElementType aElement )
+    {
+    CTelBubbleCustomElement* self = new( ELeave )CTelBubbleCustomElement( 
+        aControl, aElement );
+    
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCustomElement::NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTelBubbleCustomElement* CTelBubbleCustomElement::NewL( 
+    CTelBubbleLabel* aControl, TElementType aElement )
+    {
+    CTelBubbleCustomElement* self = new( ELeave )CTelBubbleCustomElement( 
+        aControl, aElement );
+    
+    return self;
+    }
+    
+// ---------------------------------------------------------------------------
+// CTelBubbleCustomElement::NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTelBubbleCustomElement* CTelBubbleCustomElement::NewL(
+    CTelBubbleImage* aControl, TElementType aElement )
+    {
+    CTelBubbleCustomElement* self = new( ELeave )CTelBubbleCustomElement( 
+        aControl, aElement );
+    
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCustomElement::NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTelBubbleCustomElement* CTelBubbleCustomElement::NewL(
+    CTelBubbleCallImage* aControl, TElementType aElement )
+    {
+    CTelBubbleCustomElement* self = new( ELeave )CTelBubbleCustomElement( 
+        aControl, aElement );
+    
+    return self;
+    }
+    
+// ---------------------------------------------------------------------------
+// CTelBubbleCustomElement::Control
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CCoeControl* CTelBubbleCustomElement::Control() const
+    {
+    return iControl;
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCustomElement::Element
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTelBubbleCustomElement::TElementType 
+    CTelBubbleCustomElement::ElementType() const
+    {
+    return iElementType;
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCustomElement::Type
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTelBubbleCustomElement::TControlType 
+    CTelBubbleCustomElement::ControlType() const
+    {
+    return iControlType;
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCustomElement::~CTelBubbleCustomElement
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTelBubbleCustomElement::~CTelBubbleCustomElement()
+    {
+    delete iControl;
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCustomElement::CTelBubbleCustomElement
+// ---------------------------------------------------------------------------
+//
+CTelBubbleCustomElement::CTelBubbleCustomElement(
+    CCoeControl* aControl, TElementType aElement ) :
+    iControl( aControl ),
+    iElementType( aElement )
+    {
+    iControlType = EBubbleControl;
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCustomElement::CTelBubbleCustomElement
+// ---------------------------------------------------------------------------
+//
+CTelBubbleCustomElement::CTelBubbleCustomElement( 
+    CTelBubbleAnim* aControl, TElementType aElement ) :
+    iControl( aControl ),
+    iElementType( aElement )
+    {
+    iControlType = EBubbleAnimation;
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCustomElement::CTelBubbleCustomElement
+// ---------------------------------------------------------------------------
+//
+CTelBubbleCustomElement::CTelBubbleCustomElement( 
+    CTelBubbleLabel* aControl, TElementType aElement ) :
+    iControl( aControl ),
+    iElementType( aElement )
+    {
+    iControlType = EBubbleLabel;
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCustomElement::CTelBubbleCustomElement
+// ---------------------------------------------------------------------------
+//
+CTelBubbleCustomElement::CTelBubbleCustomElement( 
+    CTelBubbleImage* aControl, TElementType aElement ) :
+    iControl( aControl ),
+    iElementType( aElement )
+    {
+    iControlType = EBubbleImage;
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleCustomElement::CTelBubbleCustomElement
+// ---------------------------------------------------------------------------
+//
+CTelBubbleCustomElement::CTelBubbleCustomElement( 
+    CTelBubbleCallImage* aControl, TElementType aElement ) :
+    iControl( aControl ),
+    iElementType( aElement )
+    {
+    iControlType = EBubbleCallImage;
+    }    
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/bmcustomization/src/telbubbleimage.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Default image implementation.
+*
+*/
+
+
+#include <AknsUtils.h>
+
+
+#include "telbubbleimage.h"
+
+// ======== LOCAL FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTelBubbleImage::CTelBubbleImage()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CBubbleAnim::NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTelBubbleImage* CTelBubbleImage::NewL()
+    {
+    CTelBubbleImage* self = new( ELeave )CTelBubbleImage();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTelBubbleImage::~CTelBubbleImage()
+    {
+    AknsUtils::DeregisterControlPosition( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleImage::SizeChanged
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTelBubbleImage::SizeChanged()
+    { 
+    AknsUtils::RegisterControlPosition( this );
+
+    if ( this->Bitmap() )
+        {
+        AknIconUtils::SetSize( 
+            const_cast<CFbsBitmap*> ( this->Bitmap() ), 
+            Rect().Size() );
+        }
+
+    CEikImage::SizeChanged();
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleImage::PositionChanged
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTelBubbleImage::PositionChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    CEikImage::PositionChanged();
+    }
+
+// ---------------------------------------------------------------------------
+// CTelBubbleImage::ConstructL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTelBubbleImage::ConstructL()
+    {
+    }
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/bmcustomization/src/telbubblelabel.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,24 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Default label implementation
+*
+*/
+
+
+#include "telbubblelabel.h"
+
+// ======== LOCAL FUNCTIONS ========
+
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/eabi/bubblemanageru.def	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,141 @@
+EXPORTS
+	_ZN14CBubbleManager10EndChangesEv @ 1 NONAME
+	_ZN14CBubbleManager11SetCallFlagERKiRKNS_19TPhoneCallTypeFlagsES1_ @ 2 NONAME
+	_ZN14CBubbleManager11SetCallTimeERKiRK7TDesC16 @ 3 NONAME
+	_ZN14CBubbleManager12PrepareIconsEv @ 4 NONAME
+	_ZN14CBubbleManager12SetCallFlagsERKiRKm @ 5 NONAME
+	_ZN14CBubbleManager12SetThumbnailERKiP10CFbsBitmapS3_i @ 6 NONAME
+	_ZN14CBubbleManager12StartChangesEv @ 7 NONAME
+	_ZN14CBubbleManager13SetNumberTypeERKiRKNS_16TPhoneNumberTypeE @ 8 NONAME
+	_ZN14CBubbleManager13SetPhoneMutedERKi @ 9 NONAME
+	_ZN14CBubbleManager14UpdateCallTimeERKiRK7TDesC16 @ 10 NONAME
+	_ZN14CBubbleManager16AddCustomElementERKiP23CTelBubbleCustomElementi @ 11 NONAME
+	_ZN14CBubbleManager16ChangeEditorModeEi @ 12 NONAME
+	_ZN14CBubbleManager16CreateCallHeaderEv @ 13 NONAME
+	_ZN14CBubbleManager16CreateConferenceERKiS1_ @ 14 NONAME
+	_ZN14CBubbleManager16RemoveCallHeaderERKi @ 15 NONAME
+	_ZN14CBubbleManager16RemoveConferenceEv @ 16 NONAME
+	_ZN14CBubbleManager16SetPbkNumberTypeERKii @ 17 NONAME
+	_ZN14CBubbleManager16SetVideoRingToneERK7TDesC16NS_20TBubbleVideoPlayModeEiiP28MBubbleVideoPlaybackObserver @ 18 NONAME
+	_ZN14CBubbleManager17CreateNumberEntryEv @ 19 NONAME
+	_ZN14CBubbleManager17MuteVideoRingToneEv @ 20 NONAME
+	_ZN14CBubbleManager17RemoveNumberEntryEv @ 21 NONAME
+	_ZN14CBubbleManager17SetCallObjectTextERKiRK7TDesC16 @ 22 NONAME
+	_ZN14CBubbleManager17StopVideoRingToneEv @ 23 NONAME
+	_ZN14CBubbleManager18AddRowToConferenceERKi @ 24 NONAME
+	_ZN14CBubbleManager18SetCallObjectImageERKiP10CFbsBitmapS3_i @ 25 NONAME
+	_ZN14CBubbleManager18SetCallObjectImageERKiRK7TDesC16 @ 26 NONAME
+	_ZN14CBubbleManager18SetPhCntNumberTypeERKiN11MPhCntMatch11TNumberTypeE @ 27 NONAME
+	_ZN14CBubbleManager19CancelVideoRingToneEv @ 28 NONAME
+	_ZN14CBubbleManager19RemoveCustomElementERKiP23CTelBubbleCustomElement @ 29 NONAME
+	_ZN14CBubbleManager19SetTouchPaneVisibleEi @ 30 NONAME
+	_ZN14CBubbleManager20SetTextToNumberEntryERK7TDesC16 @ 31 NONAME
+	_ZN14CBubbleManager20UpdateCallHeaderTextERKiRK7TDesC16S4_RKNS_23TPhoneClippingDirectionE @ 32 NONAME
+	_ZN14CBubbleManager21PreloadCallThemeImageEi @ 33 NONAME
+	_ZN14CBubbleManager21SetNumberEntryVisibleERKi @ 34 NONAME
+	_ZN14CBubbleManager21SetParticipantListCLIERKiNS_25TBubbleParticipantListCLIE @ 35 NONAME
+	_ZN14CBubbleManager22GetTextFromNumberEntryER6TDes16 @ 36 NONAME
+	_ZN14CBubbleManager22SetCallObjectFromThemeERKi @ 37 NONAME
+	_ZN14CBubbleManager23RemoveRowFromConferenceERKi @ 38 NONAME
+	_ZN14CBubbleManager24SetSelectionInConferenceERKh @ 39 NONAME
+	_ZN14CBubbleManager26ResetEditorToDefaultValuesEv @ 40 NONAME
+	_ZN14CBubbleManager26SetSelectionIdInConferenceERKi @ 41 NONAME
+	_ZN14CBubbleManager27HandleBackgroundImageChangeEv @ 42 NONAME
+	_ZN14CBubbleManager30MoveHighlightOneUpInConferenceEv @ 43 NONAME
+	_ZN14CBubbleManager31SetExpandedConferenceCallHeaderERKi @ 44 NONAME
+	_ZN14CBubbleManager32MoveHighlightOneDownInConferenceEv @ 45 NONAME
+	_ZN14CBubbleManager4NewLERK11CCoeControlRK5TRect @ 46 NONAME
+	_ZN14CBubbleManager4NewLERK11CCoeControlRK5TRecti @ 47 NONAME
+	_ZN14CBubbleManager6SetCLIERKiRK7TDesC16RKNS_23TPhoneClippingDirectionE @ 48 NONAME
+	_ZN14CBubbleManager7SetCNAPERKiRK7TDesC16RKNS_23TPhoneClippingDirectionE @ 49 NONAME
+	_ZN14CBubbleManager8SetLabelERKiRK7TDesC16RKNS_23TPhoneClippingDirectionE @ 50 NONAME
+	_ZN14CBubbleManager8SetLabelERKiRK7TDesC16S4_RKNS_23TPhoneClippingDirectionE @ 51 NONAME
+	_ZN14CBubbleManager8SetStateERKiRKNS_15TPhoneCallStateE @ 52 NONAME
+	_ZN14CBubbleManager9TouchPaneEv @ 53 NONAME
+	_ZN14CBubbleManager9UpdateCLIERKiRK7TDesC16RKNS_23TPhoneClippingDirectionE @ 54 NONAME
+	_ZN14CBubbleManagerD0Ev @ 55 NONAME
+	_ZN14CBubbleManagerD1Ev @ 56 NONAME
+	_ZN14CBubbleManagerD2Ev @ 57 NONAME
+	_ZNK14CBubbleManager13GetEditorModeEv @ 58 NONAME
+	_ZNK14CBubbleManager14GetNumberEntryEv @ 59 NONAME
+	_ZNK14CBubbleManager16ShownHeaderCountEv @ 60 NONAME
+	_ZNK14CBubbleManager17IsNumberEntryUsedEv @ 61 NONAME
+	_ZNK14CBubbleManager18ConferenceRowCountEv @ 62 NONAME
+	_ZNK14CBubbleManager20IsConferenceExpandedEv @ 63 NONAME
+	_ZNK14CBubbleManager21SelectionInConferenceEv @ 64 NONAME
+	_ZNK14CBubbleManager23SelectionIdInConferenceEv @ 65 NONAME
+	_ZTI12CBubbleImage @ 66 NONAME
+	_ZTI12CBubblePlace @ 67 NONAME
+	_ZTI13CBubbleHeader @ 68 NONAME
+	_ZTI14CBubbleOutlook @ 69 NONAME
+	_ZTI15CBubbleConfPane @ 70 NONAME
+	_ZTI16CBubbleTouchPane @ 71 NONAME
+	_ZTI17CBubbleCallHeader @ 72 NONAME
+	_ZTI17CBubbleConfHeader @ 73 NONAME
+	_ZTI17CBubbleSkinBitmap @ 74 NONAME
+	_ZTI18CBubbleImageReader @ 75 NONAME
+	_ZTI18CBubbleMediaReader @ 76 NONAME
+	_ZTI18CBubbleOutlookHide @ 77 NONAME
+	_ZTI18CBubbleVideoPlayer @ 78 NONAME
+	_ZTI19CBubbleImageManager @ 79 NONAME
+	_ZTI19CBubbleOutlookVideo @ 80 NONAME
+	_ZTI20CBubbleOutlookBottom @ 81 NONAME
+	_ZTI20CBubbleOutlookMiddle @ 82 NONAME
+	_ZTI21CBubbleOutlookTopLeft @ 83 NONAME
+	_ZTI21CBubbleVideoContainer @ 84 NONAME
+	_ZTI22CBubbleOutlookOneLined @ 85 NONAME
+	_ZTI22CBubbleOutlookTopRight @ 86 NONAME
+	_ZTI22CBubbleOutlookTwoLined @ 87 NONAME
+	_ZTI22CBubbleResourceManager @ 88 NONAME
+	_ZTI22CBubbleVideoController @ 89 NONAME
+	_ZTI23CBubbleOutlookFiveLined @ 90 NONAME
+	_ZTI23CBubbleOutlookVideoCnap @ 91 NONAME
+	_ZTI24CBubbleCallObjectManager @ 92 NONAME
+	_ZTI24CBubbleOutlookBottomCnap @ 93 NONAME
+	_ZTI24CBubbleOutlookBottomText @ 94 NONAME
+	_ZTI24CBubbleOutlookConference @ 95 NONAME
+	_ZTI24CBubbleOutlookMiddleCnap @ 96 NONAME
+	_ZTI24CBubbleOutlookThreeLined @ 97 NONAME
+	_ZTI25CBubbleOutlookBottomImage @ 98 NONAME
+	_ZTI25CBubbleOutlookBottomRight @ 99 NONAME
+	_ZTI25CBubbleOutlookNumberEntry @ 100 NONAME
+	_ZTI29CBubbleOutlookBottomImageCnap @ 101 NONAME
+	_ZTI29CBubbleOutlookBottomRightCnap @ 102 NONAME
+	_ZTV12CBubbleImage @ 103 NONAME
+	_ZTV12CBubblePlace @ 104 NONAME
+	_ZTV13CBubbleHeader @ 105 NONAME
+	_ZTV14CBubbleOutlook @ 106 NONAME
+	_ZTV15CBubbleConfPane @ 107 NONAME
+	_ZTV16CBubbleTouchPane @ 108 NONAME
+	_ZTV17CBubbleCallHeader @ 109 NONAME
+	_ZTV17CBubbleConfHeader @ 110 NONAME
+	_ZTV17CBubbleSkinBitmap @ 111 NONAME
+	_ZTV18CBubbleImageReader @ 112 NONAME
+	_ZTV18CBubbleMediaReader @ 113 NONAME
+	_ZTV18CBubbleOutlookHide @ 114 NONAME
+	_ZTV18CBubbleVideoPlayer @ 115 NONAME
+	_ZTV19CBubbleImageManager @ 116 NONAME
+	_ZTV19CBubbleOutlookVideo @ 117 NONAME
+	_ZTV20CBubbleOutlookBottom @ 118 NONAME
+	_ZTV20CBubbleOutlookMiddle @ 119 NONAME
+	_ZTV21CBubbleOutlookTopLeft @ 120 NONAME
+	_ZTV21CBubbleVideoContainer @ 121 NONAME
+	_ZTV22CBubbleOutlookOneLined @ 122 NONAME
+	_ZTV22CBubbleOutlookTopRight @ 123 NONAME
+	_ZTV22CBubbleOutlookTwoLined @ 124 NONAME
+	_ZTV22CBubbleResourceManager @ 125 NONAME
+	_ZTV22CBubbleVideoController @ 126 NONAME
+	_ZTV23CBubbleOutlookFiveLined @ 127 NONAME
+	_ZTV23CBubbleOutlookVideoCnap @ 128 NONAME
+	_ZTV24CBubbleCallObjectManager @ 129 NONAME
+	_ZTV24CBubbleOutlookBottomCnap @ 130 NONAME
+	_ZTV24CBubbleOutlookBottomText @ 131 NONAME
+	_ZTV24CBubbleOutlookConference @ 132 NONAME
+	_ZTV24CBubbleOutlookMiddleCnap @ 133 NONAME
+	_ZTV24CBubbleOutlookThreeLined @ 134 NONAME
+	_ZTV25CBubbleOutlookBottomImage @ 135 NONAME
+	_ZTV25CBubbleOutlookBottomRight @ 136 NONAME
+	_ZTV25CBubbleOutlookNumberEntry @ 137 NONAME
+	_ZTV29CBubbleOutlookBottomImageCnap @ 138 NONAME
+	_ZTV29CBubbleOutlookBottomRightCnap @ 139 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/laf/BMLayout.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,1212 @@
+/*
+* 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:  LAF coordinates
+*
+*/
+
+
+// INCLUDE FILES
+#include "BMLayout.h"
+#include "BMPanic.h"
+#include "BMBubbleManager.h"
+#include <aknenv.h>
+#include <applayout.cdl.h>
+#include <AknUtils.h>
+#include <AknLayout2ScalableDef.h>
+#include <aknlayoutscalable_apps.cdl.h>
+#include <layoutmetadata.cdl.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::LayoutColourWhite
+// -----------------------------------------------------------------------------
+//
+TInt BubbleLayout::LayoutColourWhite()
+    {
+    return 0;
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::MainPaneRect
+// -----------------------------------------------------------------------------
+//
+const TRect BubbleLayout::MainPaneRect()
+    {
+    TSize screenSize = CEikonEnv::Static()->ScreenDevice()->SizeInPixels();
+    TRect screenRect( TPoint(0,0), screenSize );
+
+    TAknLayoutRect appRect;
+    appRect.LayoutRect( screenRect, AknLayout::application_window( screenRect ) );
+    TAknLayoutRect mainRect;
+    mainRect.LayoutRect( appRect.Rect(), 
+        AknLayout::main_pane( appRect.Rect(), 0, 1, 1 ) ); // 1 = normal status pane, control pane
+
+    return mainRect.Rect();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_number_entry_window
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_number_entry_window( TInt aIndex )
+    {
+    if ( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
+	    {
+	    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+    	    {
+    	    if ( aIndex < 4 ) 
+        	    {
+        	    // portrait 0..1 == landscape 2..3
+                aIndex += 2;    	                	        
+        	    }
+        	else
+        	    {
+        	    // portrait 4 == landscape 5
+        	    aIndex += 1;    
+        	    }
+    	    }
+	            
+        TAknWindowComponentLayout layout1 = 
+            AknLayoutScalable_Apps::main_call_pane();
+        TAknWindowComponentLayout layout2 = 
+            AknLayoutScalable_Apps::popup_number_entry_window( aIndex );
+        return TAknWindowComponentLayout::
+            Compose( layout1, layout2 ).LayoutLine();
+	    }
+    else
+        {
+        return AppLayout::popup_number_entry_window();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_in_window
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_in_window( TInt aLine )
+    {
+    if ( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
+	    {
+        if ( Layout_Meta_Data::IsLandscapeOrientation() )
+            {
+            // portrait 0..3 == landscape 4..7 
+            aLine += 4;    	        
+    	    }        
+    	    
+        if ( aLine < 1 || aLine > 8 )
+            {
+            Panic( EBMPanicLAF );
+            }        	    
+	    
+	    return AknLayoutScalable_Apps::popup_call_audio_in_window( 
+	                                   aLine - 1 ).LayoutLine();
+	    }
+    else
+        {
+        if ( aLine < 1 || aLine > 4 )
+            {
+            Panic( EBMPanicLAF );
+            }    
+        
+        return AppLayout::popup_call_audio_in_window( aLine - 1 );                
+        }	    
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_out_window
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_out_window( TInt aLine )
+    {
+    if ( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
+	    {
+        if ( Layout_Meta_Data::IsLandscapeOrientation() )
+            {
+            // portrait 0..2 == landscape 3..6 
+            aLine += 3;    	        
+    	    }        
+	    
+	    return AknLayoutScalable_Apps::popup_call_audio_out_window( 
+	                                   aLine - 1 ).LayoutLine();;
+	    }
+    else
+        {
+        if ( aLine < 1 || aLine > 2 )
+            {
+            Panic( EBMPanicLAF );
+            }    
+        
+        return AppLayout::popup_call_audio_out_window( aLine - 1 );                
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_first_window( TInt aLine )
+    {
+    if ( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
+	    {
+        if ( Layout_Meta_Data::IsLandscapeOrientation() )
+            {
+            // portrait 0..6 == landscape 7..13 
+            aLine += 7;    	        
+    	    }        
+	    
+	    return AknLayoutScalable_Apps::popup_call_audio_first_window( 
+	                                   aLine - 1 ).LayoutLine();;
+	    }
+    else
+        {
+        if ( aLine < 1 || aLine > 7 )
+            {
+            Panic( EBMPanicLAF );
+            }  
+        
+        // aLine = 3, 2, 4, 6 called before bootup fails.
+        TInt command1 = aLine - 1;
+        TInt command2 = command1;
+        return AppLayout::popup_call_audio_first_window( command1, command2 );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_wait_window
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_wait_window( TInt aLine )
+    {
+    if ( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
+	    {
+        if ( Layout_Meta_Data::IsLandscapeOrientation() )
+            {
+            // portrait 0..3 == landscape 4..7 
+            aLine += 4;    	        
+    	    }        
+	    
+	    return AknLayoutScalable_Apps::popup_call_audio_wait_window( 
+	                                   aLine - 1 ).LayoutLine();;
+	    }
+    else
+        {
+        if ( aLine < 1 || aLine > 4 )
+            {
+            Panic( EBMPanicLAF );
+            } 
+        
+        return AppLayout::popup_call_audio_wait_window( aLine - 1 );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_second_window
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_second_window( TInt aLine )
+    {
+    if ( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
+	    {
+        if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        	{
+        	// portrait 0..4 == landscape 5..9 
+            aLine += 5;    	        
+        	}        
+	    
+	    return AknLayoutScalable_Apps::popup_call_audio_second_window(
+	                                   aLine - 1 ).LayoutLine();
+	    }
+    else
+        {
+        if ( aLine < 1 || aLine > 5 )
+            {
+            Panic( EBMPanicLAF );
+            }
+        
+        TInt command1 = aLine - 1;
+        TInt command2 = command1;
+        return AppLayout::popup_call_audio_second_window( command1, command2 );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_conf_window
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_conf_window( TInt aLine )
+    {
+    if ( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
+	    {
+        if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        	{
+        	// portrait 0..3 == landscape 4..7 
+            aLine += 4;    	        
+        	}        
+	    
+	    return AknLayoutScalable_Apps::popup_call_audio_conf_window(
+	                                   aLine - 1 ).LayoutLine();
+	    }
+    else
+        {
+        if ( aLine < 1 || aLine > 4 )
+            {
+            Panic( EBMPanicLAF );
+            }
+        
+        return AppLayout::popup_call_audio_conf_window( aLine - 1 );   
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::list_single_graphic_popup_conf_pane
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::list_single_graphic_popup_conf_pane( TInt aLine )
+    {
+    if ( aLine < 1 || aLine > 6 )
+        {
+        Panic( EBMPanicLAF );
+        }
+    return AppLayout::list_single_graphic_popup_conf_pane( aLine - 1 );     
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::list_single_graphic_popup_conf_pane_elements_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout
+    BubbleLayout::list_single_graphic_popup_conf_pane_elements_1()
+    {
+    return AppLayout::List_pane_elements__conf_single_graphic__Line_1(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::list_single_graphic_popup_conf_pane_elements_2
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::list_single_graphic_popup_conf_pane_elements_2()
+    {
+    return AppLayout::List_pane_elements__conf_single_graphic__Line_2(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::list_single_graphic_popup_conf_pane_texts_1
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout::list_single_graphic_popup_conf_pane_texts_1()
+    {    
+    return AppLayout::List_pane_texts__conf_single_graphic__Line_1(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::list_single_graphic_popup_conf_pane_graphics_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::list_single_graphic_popup_conf_pane_graphics_1
+    ( const TRect& aParentRect )
+    {
+    return AppLayout::Highlight_graphics_Line_1( aParentRect );
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::list_single_graphic_popup_conf_pane_graphics_2
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::list_single_graphic_popup_conf_pane_graphics_2
+    ( const TRect& aParentRect )
+    {
+    return AppLayout::Highlight_graphics_Line_2( aParentRect ); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_number_entry_window_texts_1
+// -----------------------------------------------------------------------------
+//
+
+const TAknTextLineLayout 
+    BubbleLayout::popup_number_entry_window_texts_1( TInt aIndex )
+    {
+    if ( aIndex < 0 || aIndex > 1 )
+        {
+        Panic( EBMPanicLAF );
+        }
+    return AppLayout::Number_entry_pop_up_window_texts_Line_1( aIndex ); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_number_entry_window_texts_2
+// -----------------------------------------------------------------------------
+//
+
+const TAknTextLineLayout 
+    BubbleLayout::popup_number_entry_window_texts_2( TInt aIndex, TInt aLine )
+    {
+    if ( ( aIndex < 0 || aIndex > 1 ) || ( aLine < 0 || aLine > 1 ) )
+        {
+        Panic( EBMPanicLAF );
+        }
+
+    if ( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
+        {
+        aIndex = 0;
+        }
+    return AppLayout::Number_entry_pop_up_window_texts_Line_2( aIndex, aLine );
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_number_entry_window_texts_2
+// -----------------------------------------------------------------------------
+//    
+const TAknTextLineLayout 
+    BubbleLayout::popup_number_entry_window_texts_3( TInt aLine )
+    {
+    if ( aLine < 0 || aLine > 1 )
+        {
+        Panic( EBMPanicLAF );
+        }
+        
+    if ( aLine == 0  )    
+        {
+        return AknLayoutScalable_Apps::text_title_cp2(1).LayoutLine();    
+        }
+    else
+        {
+        return AknLayoutScalable_Apps::popup_number_entry_window_t5(1).LayoutLine();    
+        }            
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_number_entry_window_graphics_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_number_entry_window_graphics_1( TInt aIndex )
+    {
+    return AppLayout::Number_entry_pop_up_window_graphics_Line_1( aIndex );
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_in_window_1_elements_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_in_window_1_elements_1()
+    {    
+    return AppLayout::Incoming_call_pop_up_window_elements_Line_1();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_in_window_1_elements_2
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_in_window_1_elements_2()
+    {
+    return AppLayout::Incoming_call_pop_up_window_elements_Line_2(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_in_window_1_elements_15
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_in_window_1_elements_15()
+    {
+    return AppLayout::Incoming_call_pop_up_window_elements_Line_15(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_in_window_1_texts_1
+// -----------------------------------------------------------------------------
+//
+
+const TAknTextLineLayout 
+    BubbleLayout::popup_call_audio_in_window_1_texts_1( TInt aLine, 
+                                                        TInt aType )
+    {
+    if ( aLine < 1 && aLine > 2 )
+        {
+        Panic( EBMPanicLAF );
+        }    
+    TInt command1 = aLine - 1 ;
+    TInt command2 = aType;
+    return AppLayout::Incoming_call_pop_up_window_texts_Line_1( command1, command2 ); 
+    }
+
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_in_window_1_texts_2
+// -----------------------------------------------------------------------------
+//
+
+const TAknTextLineLayout 
+    BubbleLayout::popup_call_audio_in_window_1_texts_2( TInt aLine, 
+                                                        TInt aImageType )
+    {
+    if ( aLine < 1 && aLine > 3 )
+        {
+        Panic( EBMPanicLAF );
+        }    
+    TInt command1 = aLine - 1 ;    
+    TInt command2 = aImageType;
+    return AppLayout::Incoming_call_pop_up_window_texts_Line_2( command1, command2 ); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_in_window_1_graphics_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_in_window_1_graphics_1( TInt aLine )
+    {
+    if ( aLine < 1 && aLine > 2 )
+        {
+        Panic( EBMPanicLAF );
+        }
+    TInt index_h = aLine - 1;
+    return AppLayout::Incoming_call_pop_up_window_graphics_Line_1( index_h ); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_in_window_2_elements_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_in_window_2_elements_1()
+    {
+    return AppLayout::Incoming_call_pop_up_window_elements__NE__Line_1(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_in_window_2_elements_2
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_in_window_2_elements_2()
+    {
+    return AppLayout::Incoming_call_pop_up_window_elements__NE__Line_2();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_in_window_2_elements_15
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_in_window_2_elements_15()
+    {
+    return AppLayout::Incoming_call_pop_up_window_elements__NE__Line_15(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_in_window_2_texts_1
+// -----------------------------------------------------------------------------
+//
+
+const TAknTextLineLayout 
+    BubbleLayout::popup_call_audio_in_window_2_texts_1( TInt aLine, 
+                                                        TInt aType )
+    {
+    if ( aLine < 1 || aLine > 2 )
+        {
+        Panic( EBMPanicLAF );
+        }
+    TInt command1 = aLine - 1;
+    TInt command2 = aType;
+    return AppLayout::Incoming_call_pop_up_window_texts__NE__Line_1( command1, command2 );
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_in_window_2_texts_2
+// -----------------------------------------------------------------------------
+//
+
+const TAknTextLineLayout 
+    BubbleLayout::popup_call_audio_in_window_2_texts_2( TInt aLine, 
+                                                        TInt aType )
+    {
+    if ( aLine < 1 || aLine > 3 )
+        {
+        Panic( EBMPanicLAF );
+        }
+    TInt command1 = aLine - 1;
+    TInt command2 = aType;
+    return AppLayout::Incoming_call_pop_up_window_texts__NE__Line_2( command1, command2 ); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_in_window_2_graphics_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_in_window_2_graphics_1()
+    {
+    return AppLayout::Incoming_call_pop_up_window_graphics__NE__Line_1();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_out_window_1_elements_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_out_window_1_elements_1()
+    {
+    return AppLayout::Outgoing_call_pop_up_window_elements__held__Line_1(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_out_window_1_elements_2
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_out_window_1_elements_2()
+    {
+    return AppLayout::Outgoing_call_pop_up_window_elements__held__Line_2(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_out_window_1_elements_15
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_out_window_1_elements_15()
+    {
+    return AppLayout::Outgoing_call_pop_up_window_elements__held__Line_15();   
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_out_window_1_texts_1
+// -----------------------------------------------------------------------------
+//
+
+const TAknTextLineLayout 
+    BubbleLayout::popup_call_audio_out_window_1_texts_1( TInt aLine, 
+                                                         TInt aType )
+    {
+    if ( aLine < 1 || aLine > 2 )
+        {
+        Panic( EBMPanicLAF );
+        }
+    TInt command1 = aLine - 1;
+    TInt command2 = aType;
+    return AppLayout::Outgoing_call_pop_up_window_texts__held__Line_1( command1, command2 ); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_out_window_1_graphics_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_out_window_1_graphics_1()
+    {
+    return AppLayout::Outgoing_call_pop_up_window_graphics__held__Line_1();               
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_out_window_2_elements_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_out_window_2_elements_1()
+    {
+    return AppLayout::Outgoing_call_pop_up_window_elements__held__Line_1();     
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_out_window_2_elements_2
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_out_window_2_elements_2()
+    {
+    return AppLayout::Outgoing_call_pop_up_window_elements__held__Line_2();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_out_window_2_elements_3
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_out_window_2_elements_3()
+    {
+    return AppLayout::Outgoing_call_pop_up_window_elements__held__Line_3();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_out_window_2_elements_15
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_out_window_2_elements_15()
+    {
+    return AppLayout::Outgoing_call_pop_up_window_elements__held__Line_15();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_out_window_2_texts_1
+// -----------------------------------------------------------------------------
+//
+
+const TAknTextLineLayout  
+    BubbleLayout::popup_call_audio_out_window_2_texts_1()
+    {
+    return AppLayout::Outgoing_call_pop_up_window_texts__held_NE__Line_1(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_out_window_2_graphics_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_out_window_2_graphics_1()
+    {
+    return AppLayout::Outgoing_call_pop_up_window_graphics__held_NE__Line_1(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_1_elements_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_first_window_1_elements_1()
+    {
+    return AppLayout::First_call_pop_up_window_elements__one_call__Line_1();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_1_elements_2
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_first_window_1_elements_2()
+    {
+    return AppLayout::First_call_pop_up_window_elements__one_call__Line_2(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_1_elements_3
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_first_window_1_elements_3()
+    {
+    return AppLayout::First_call_pop_up_window_elements__one_call__Line_3(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_1_texts_1
+// -----------------------------------------------------------------------------
+//
+
+const TAknTextLineLayout 
+    BubbleLayout::popup_call_audio_first_window_1_texts_1( TInt aLine, 
+                                                           TInt aType )
+    {
+    if ( aLine < 1 || aLine > 3 )
+        {
+        Panic( EBMPanicLAF );
+        }
+    TInt command1 = aLine - 1;
+    TInt command2 = aType;
+    return AppLayout::First_call_pop_up_window_texts__one_call__Line_1( command1, command2 ); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_1_texts_2
+// -----------------------------------------------------------------------------
+//
+
+const TAknTextLineLayout 
+    BubbleLayout::popup_call_audio_first_window_1_texts_2( TInt aLine, 
+                                                           TInt aImageType )
+    {
+    if ( aLine < 1 || aLine > 3 )
+        {
+        Panic( EBMPanicLAF );
+        }
+    TInt command1 = ( aImageType > 0 ) ? 1 : 0;
+    return AppLayout::First_call_pop_up_window_texts__one_call__Line_2( command1 ); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_1_texts_3
+// -----------------------------------------------------------------------------
+//
+
+const TAknTextLineLayout 
+    BubbleLayout::popup_call_audio_first_window_1_texts_3()
+    {
+    return AppLayout::First_call_pop_up_window_texts__one_call__Line_3(); 
+    }
+
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_1_graphics_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_first_window_1_graphics_1()
+    {
+    return AppLayout::First_call_pop_up_window_graphics__one_call__Line_1(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_2_elements_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_first_window_2_elements_1()
+    {
+    return AppLayout::First_call_pop_up_window_elements__two_calls__Line_1(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_2_elements_2
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_first_window_2_elements_2()
+    {
+    return AppLayout::First_call_pop_up_window_elements__two_calls__Line_2();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_2_elements_15
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_first_window_2_elements_15()
+    {
+    return AppLayout::First_call_pop_up_window_elements__two_calls__Line_15(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_2_texts_1
+// -----------------------------------------------------------------------------
+//
+
+const TAknTextLineLayout 
+    BubbleLayout::popup_call_audio_first_window_2_texts_1( TInt aLine , 
+                                                           TInt aType )
+    {
+    if ( aLine < 1 || aLine > 2 )
+        {
+        Panic( EBMPanicLAF );
+        }
+    TInt command1 = aLine - 1;
+    TInt command2 = aType;
+    return AppLayout::First_call_pop_up_window_texts__two_calls__Line_1( command1, command2 ); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_2_texts_2
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout::popup_call_audio_first_window_2_texts_2( TInt aLine , 
+                                                           TInt aImageType )
+    {
+    if ( aLine < 1 || aLine > 2 )
+        {
+        Panic( EBMPanicLAF );
+        }
+    TInt command1 = ( aImageType > 0 ) ? 1 : 0;
+    return AppLayout::First_call_pop_up_window_texts__two_calls__Line_2( command1 ); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_2_texts_3
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout::popup_call_audio_first_window_2_texts_3()
+    {
+    return AppLayout::First_call_pop_up_window_texts__two_calls__Line_3(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_2_graphics_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_first_window_2_graphics_1()
+    {
+    return AppLayout::First_call_pop_up_window_graphics__two_calls__Line_1(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_4_elements_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_first_window_4_elements_1()
+    {
+    return AppLayout::First_call_pop_up_window_elements__two_calls_a_waiting_call__Line_1(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_4_elements_2
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_first_window_4_elements_2()
+    {
+    return AppLayout::First_call_pop_up_window_elements__two_calls_a_waiting_call__Line_2();  
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_4_elements_3
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_first_window_4_elements_3()
+    {
+    return AppLayout::First_call_pop_up_window_elements__two_calls_a_waiting_call__Line_3(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_4_texts_1
+// -----------------------------------------------------------------------------
+//
+
+const TAknTextLineLayout 
+    BubbleLayout::popup_call_audio_first_window_4_texts_1()
+    {
+    return AppLayout::First_call_pop_up_window_texts__two_calls_a_waiting_call__Line_1(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_4_graphics_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_first_window_4_graphics_1()
+    {
+    return AppLayout::First_call_pop_up_window_graphics__two_calls_a_waiting_call__Line_1(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_6_graphics_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_first_window_6_graphics_1()
+    {
+    return AppLayout::First_call_pop_up_window_graphics__two_wait_NE__Line_1();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_first_window_7_graphics_1
+// Three-line CDMA emergency call.
+// -----------------------------------------------------------------------------
+//
+const AknLayoutUtils::SAknLayoutControl 
+    BubbleLayout::popup_call_audio_first_window_7_graphics_1()
+    {
+    AknLayoutUtils::SAknLayoutControl layout = {ELayoutEmpty, 0, 0, 
+        ELayoutEmpty, ELayoutEmpty, 176, 77};
+    return layout;
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_wait_window_3_elements_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_wait_window_3_elements_1()
+    {
+    return AppLayout::Waiting_call_pop_up_window_elements__held_out_NE__Line_1(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_wait_window_3_elements_2
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_wait_window_3_elements_2()
+    {
+    return AppLayout::Waiting_call_pop_up_window_elements__held_out_NE__Line_2(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_wait_window_3_elements_3
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_wait_window_3_elements_3()
+    {
+    return AppLayout::Waiting_call_pop_up_window_elements__held_out_NE__Line_3(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_wait_window_3_texts_1
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout::popup_call_audio_wait_window_3_texts_1()
+    {
+    return AppLayout::Waiting_call_pop_up_window_texts__held_out_NE__Line_1(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_wait_window_3_graphics_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_wait_window_3_graphics_1()
+    {
+    return AppLayout::First_call_pop_up_window_graphics__two_wait_NE__Line_1(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_wait_window_4_graphics_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_wait_window_4_graphics_1()
+    {
+    return AppLayout::Waiting_call_pop_up_window_graphics__out__Line_1(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_second_window_1_elements_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_second_window_1_elements_1()
+    {
+    return AppLayout::Second_call_pop_up_window_elements__two__Line_1(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_second_window_1_elements_2
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_second_window_1_elements_2()
+    {
+    return AppLayout::Second_call_pop_up_window_elements__two__Line_2(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_second_window_1_elements_3
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_second_window_1_elements_3()
+    {
+    return AppLayout::Second_call_pop_up_window_elements__two__Line_3(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_second_window_1_texts_1
+// -----------------------------------------------------------------------------
+//
+
+const TAknTextLineLayout 
+    BubbleLayout::popup_call_audio_second_window_1_texts_1( TInt aLine , 
+                                                            TInt aType )
+    {
+    if ( aLine < 1 || aLine > 2 )
+        {
+        Panic( EBMPanicLAF );
+        }
+    TInt command1 = aLine - 1;
+    TInt command2 = aType;
+    return AppLayout::Second_call_pop_up_window_texts__two_calls__Line_1( command1, command2 );
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_second_window_1_texts_2
+// -----------------------------------------------------------------------------
+//
+
+const TAknTextLineLayout 
+    BubbleLayout::popup_call_audio_second_window_1_texts_2( TInt aImageType )
+    {
+    TInt command1 = ( aImageType > 0 ) ? 1 : 0;
+    return AppLayout::Second_call_pop_up_window_texts__two_calls__Line_2( command1 ); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_second_window_1_graphics_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_second_window_1_graphics_1()
+    {
+    return AppLayout::Second_call_pop_up_window_graphics__two_calls__Line_1(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_second_window_3_elements_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_second_window_3_elements_1()
+    {
+    return AppLayout::Second_call_pop_up_window_elements__two_calls_waiting_call__Line_1();  
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_second_window_3_elements_2
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_second_window_3_elements_2()
+    {
+    return AppLayout::Second_call_pop_up_window_elements__two_calls_waiting_call__Line_2();     
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_second_window_3_elements_3
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_second_window_3_elements_3()
+    {
+    return AppLayout::Second_call_pop_up_window_elements__two_calls_waiting_call__Line_3(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_second_window_3_texts_1
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout::popup_call_audio_second_window_3_texts_1()
+    {
+    return AppLayout::Second_call_pop_up_window_texts__two_calls_waiting_call__Line_1(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_second_window_3_graphics_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_second_window_3_graphics_1()
+    {
+    return AppLayout::Second_call_pop_up_window_graphics__two_calls_waiting_call__Line_1();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_conf_window_elements_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_conf_window_elements_1( 
+    const TRect& aParentRect )
+    {
+    return AppLayout::Conference_call_pop_up_window_descendants_and_elements_Line_1( aParentRect ); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_conf_window_elements_2
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::popup_call_audio_conf_window_elements_2( TInt aLine )
+    {
+
+    if ( aLine < 1 || aLine > 4 )
+        {
+        Panic( EBMPanicLAF );
+        }
+    TInt command1 = aLine - 1;
+    return AppLayout::list_conf_pane( command1 ); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::ConferencePaneHeight
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::ConferencePane()
+    {    
+    TInt index_t = 0;
+    return AppLayout::list_single_graphic_popup_conf_pane( index_t );
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::popup_call_audio_cont_window_texts_1
+// -----------------------------------------------------------------------------
+//
+
+const TAknTextLineLayout 
+    BubbleLayout::popup_call_audio_cont_window_texts_1( TInt aLine )
+    {
+    if ( aLine < 1 || aLine > 4 )
+        {
+        Panic( EBMPanicLAF );
+        }
+    TInt command1 = aLine - 1;
+    return AppLayout::Conference_call_pop_up_window_texts_Line_1( command1 ); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::main_pane_elements_muted
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout BubbleLayout::main_pane_elements_muted( 
+    TBool aNumberEditorActive )
+    {
+    if ( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
+	    {
+	    if ( aNumberEditorActive )
+    	    {
+    	    return AknLayoutScalable_Apps::call_muted_g2().LayoutLine();   
+    	    }
+	    else
+	        {
+	        return AknLayoutScalable_Apps::call_muted_g(0).LayoutLine();    
+	        }
+	    }
+    else
+        {
+        return AppLayout::Muted_state_elements_Line_1();       
+        }	    
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::call_type_pane_elements_1
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::call_type_pane_elements_1()
+    {
+    return AppLayout::Call_type_pane_split_Line_1(); 
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout::call_type_pane_elements_2
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout::call_type_pane_elements_2()
+    {
+    return AppLayout::Call_type_pane_split_Line_2();
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/laf/BMLayout.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,339 @@
+/*
+* 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:  Layout definitions from Application LAF
+*
+*/
+
+
+
+#ifndef BMLAYOUT_H
+#define BMLAYOUT_H
+
+// INCLUDES
+#include <calslbs.h>
+#include <bldvariant.hrh> 
+#include <AknLayoutDef.h>
+
+/**
+* Layout coordinates from Application LAF
+* 
+* @lib      bubblemanager.lib
+* @since    2.0
+*/
+class BubbleLayout
+    { 
+    public: // Helper functions
+
+        /**
+        * Get background image colour
+        * @return White colour
+        */ 
+        static TInt LayoutColourWhite();
+
+        /**
+        * Get main pane rect
+        * @return the main pane rect
+        * since   Series60_2.8
+        */ 
+        static const TRect MainPaneRect();
+
+    public: // Layout coordinates
+
+        /**
+        * Popup window coordinates.
+        * One function returns one line of coordinates is Application LAF.
+        * @since 2.0
+        * @param aLine Line number from the same item. From 1-n
+        * @param aParentWidth Parent control's width
+        * @param aParentHeight Parent control's height
+        * @param aImageWidth Thumbnail image's width
+        * @param aImageHeight Thumbnail image's height
+        * @return Layout for current item.
+        */
+
+        // Table 78. Pop up windows (main pane as parent)
+        static const TAknWindowLineLayout 
+            popup_number_entry_window( TInt aIndex = 0 );
+        static const TAknWindowLineLayout 
+            popup_call_audio_in_window( TInt aLine );
+        static const TAknWindowLineLayout 
+            popup_call_audio_out_window( TInt aLine );
+        static const TAknWindowLineLayout 
+            popup_call_audio_first_window( TInt aLine );
+        static const TAknWindowLineLayout 
+            popup_call_audio_wait_window( TInt aLine );
+        static const TAknWindowLineLayout 
+            popup_call_audio_second_window( TInt aLine );
+        static const TAknWindowLineLayout 
+            popup_call_audio_conf_window( TInt aLine );
+
+        // Table 80. Pop up window list pane descendants (call, conf)
+        static const TAknWindowLineLayout 
+            list_single_graphic_popup_conf_pane( TInt aLine );
+
+        // Table 81. List pane elements (conf, single, graphic)
+        static const TAknWindowLineLayout
+            list_single_graphic_popup_conf_pane_elements_1();
+        static const TAknWindowLineLayout 
+            list_single_graphic_popup_conf_pane_elements_2();
+
+        // Table 82. List pane texts (conf, single, graphic)
+        static const TAknTextLineLayout 
+            list_single_graphic_popup_conf_pane_texts_1();
+
+        // Table 85. Highlight graphics 
+        static const TAknWindowLineLayout 
+            list_single_graphic_popup_conf_pane_graphics_1( const TRect& aParentRect ); // shadow
+        static const TAknWindowLineLayout 
+            list_single_graphic_popup_conf_pane_graphics_2( const TRect& aParentRect ); // highlight
+
+        // Table 91. Number entry pop up window texts
+        static const TAknTextLineLayout 
+            popup_number_entry_window_texts_1( TInt aIndex );
+        static const TAknTextLineLayout 
+            popup_number_entry_window_texts_2( TInt aIndex, TInt aLine );
+        static const TAknTextLineLayout 
+            popup_number_entry_window_texts_3( TInt aLine );            
+
+        // Table 92. Number entry pop up window graphics
+        static const TAknWindowLineLayout 
+            popup_number_entry_window_graphics_1( TInt aIndex );
+
+        // Table 119. Incoming call pop up window elements
+        static const TAknWindowLineLayout 
+            popup_call_audio_in_window_1_elements_1();
+        static const TAknWindowLineLayout 
+            popup_call_audio_in_window_1_elements_2();
+        static const TAknWindowLineLayout 
+            popup_call_audio_in_window_1_elements_15();
+
+        // Table 120. Incoming call pop up window texts
+        // Use line 1 or 2 (or 3 CNAP). Right and Width values are calculated 
+        // from the image width.
+        static const TAknTextLineLayout 
+            popup_call_audio_in_window_1_texts_1( TInt aLine, TInt aImageWidth );
+        static const TAknTextLineLayout 
+            popup_call_audio_in_window_1_texts_2( TInt aLine, TInt aImageWidth );
+
+        // Table 121. Incoming call pop up window graphics
+        static const TAknWindowLineLayout 
+            popup_call_audio_in_window_1_graphics_1( TInt aLine );
+
+        // Table 122. Incoming call pop-up window elements (ne)
+        static const TAknWindowLineLayout 
+            popup_call_audio_in_window_2_elements_1();
+        static const TAknWindowLineLayout 
+            popup_call_audio_in_window_2_elements_2();
+        static const TAknWindowLineLayout 
+            popup_call_audio_in_window_2_elements_15();
+
+        // Table 123. Incoming call pop up window texts (ne)
+        static const TAknTextLineLayout 
+            popup_call_audio_in_window_2_texts_1( TInt aLine, 
+                                                  TInt aImageWidth );
+        static const TAknTextLineLayout 
+            popup_call_audio_in_window_2_texts_2( TInt aLine, TInt aImageWidth );
+
+        // Table 124. Incoming call pop up window graphics (ne) 
+        static const TAknWindowLineLayout 
+            popup_call_audio_in_window_2_graphics_1();
+
+        // Table 125. Outgoing call pop up window elements (held)
+        static const TAknWindowLineLayout 
+            popup_call_audio_out_window_1_elements_1();
+        static const TAknWindowLineLayout 
+            popup_call_audio_out_window_1_elements_2();
+        static const TAknWindowLineLayout 
+            popup_call_audio_out_window_1_elements_15();
+
+        // Table 126. Outgoing call pop up window texts (held)
+        static const TAknTextLineLayout 
+            popup_call_audio_out_window_1_texts_1( TInt aLine, 
+                                                   TInt aImageWidth );
+
+        // Table 127. Outgoing call pop up window graphics (held)
+        static const TAknWindowLineLayout 
+            popup_call_audio_out_window_1_graphics_1();
+
+        // Table 128. Outgoing call pop up window elements (held, ne)
+        static const TAknWindowLineLayout 
+            popup_call_audio_out_window_2_elements_1();
+        static const TAknWindowLineLayout 
+            popup_call_audio_out_window_2_elements_2();
+        static const TAknWindowLineLayout 
+            popup_call_audio_out_window_2_elements_3();
+        static const TAknWindowLineLayout 
+            popup_call_audio_out_window_2_elements_15();
+
+        // Table 129. Outgoing call pop up window texts (held, ne)
+        static const TAknTextLineLayout 
+            popup_call_audio_out_window_2_texts_1();
+
+        // Table 130. Outgoing call pop up window graphics (held, ne)
+        static const TAknWindowLineLayout 
+            popup_call_audio_out_window_2_graphics_1();
+
+        // Table 131. First call pop up window elements (one call)
+        static const TAknWindowLineLayout 
+            popup_call_audio_first_window_1_elements_1();
+        static const TAknWindowLineLayout 
+            popup_call_audio_first_window_1_elements_2();
+        static const TAknWindowLineLayout 
+            popup_call_audio_first_window_1_elements_3();
+        
+        // Table 132. First call pop up window texts (one call)
+        static const TAknTextLineLayout 
+            popup_call_audio_first_window_1_texts_1( TInt aLine, 
+                            TInt aImageWidth );
+        static const TAknTextLineLayout 
+            popup_call_audio_first_window_1_texts_2( TInt aLine, 
+                            TInt aImageWidth );
+
+        static const TAknTextLineLayout 
+            popup_call_audio_first_window_1_texts_3();
+
+        // Table 133. First call pop up window graphics (one call)
+        static const TAknWindowLineLayout 
+            popup_call_audio_first_window_1_graphics_1();
+
+        // Table 134. First call pop up window elements (two calls)
+        static const TAknWindowLineLayout 
+            popup_call_audio_first_window_2_elements_1();
+        static const TAknWindowLineLayout 
+            popup_call_audio_first_window_2_elements_2();
+        static const TAknWindowLineLayout 
+            popup_call_audio_first_window_2_elements_15();
+
+        // Table 135. First call pop up window texts (two calls)
+        static const TAknTextLineLayout 
+            popup_call_audio_first_window_2_texts_1( TInt aLine , 
+                                                     TInt aImageWidth );
+        static const TAknTextLineLayout 
+            popup_call_audio_first_window_2_texts_2( TInt aLine, 
+                                                     TInt aImageWidth );
+        static const TAknTextLineLayout 
+            popup_call_audio_first_window_2_texts_3();
+
+        // Table 136. First call pop up window graphics (two calls)
+        static const TAknWindowLineLayout 
+            popup_call_audio_first_window_2_graphics_1();
+
+        // Table 137. First call pop up window elements (two calls, a waiting call)
+        static const TAknWindowLineLayout 
+            popup_call_audio_first_window_4_elements_1();
+        static const TAknWindowLineLayout 
+            popup_call_audio_first_window_4_elements_2();
+        static const TAknWindowLineLayout 
+            popup_call_audio_first_window_4_elements_3();
+
+        // Table 138. First call pop up window texts (two calls, a waiting call)
+        static const TAknTextLineLayout 
+            popup_call_audio_first_window_4_texts_1();
+
+        // Table 139. First call pop up window graphics (two calls, a waiting call)
+        static const TAknWindowLineLayout 
+            popup_call_audio_first_window_4_graphics_1();
+
+        // Table 140. First call pop up window graphics (two, wait, ne)
+        static const TAknWindowLineLayout 
+            popup_call_audio_first_window_6_graphics_1();
+
+        // Table 5.1. First call pop up window graphics (emergency call)
+        static const AknLayoutUtils::SAknLayoutControl
+            popup_call_audio_first_window_7_graphics_1();
+
+        // Table 141. Waiting call pop up window elements (held, out, ne)
+        static const TAknWindowLineLayout 
+            popup_call_audio_wait_window_3_elements_1();
+        static const TAknWindowLineLayout 
+            popup_call_audio_wait_window_3_elements_2();
+        static const TAknWindowLineLayout 
+            popup_call_audio_wait_window_3_elements_3();
+
+        // Table 142. Waiting call pop up window texts (held, out, ne)
+        static const TAknTextLineLayout 
+            popup_call_audio_wait_window_3_texts_1();
+
+        // Table 143. Waiting call pop up window graphics (held, out, ne)
+        static const TAknWindowLineLayout 
+            popup_call_audio_wait_window_3_graphics_1();
+
+        // Table 144. Waiting call pop up window graphics (out)
+        static const TAknWindowLineLayout 
+            popup_call_audio_wait_window_4_graphics_1();
+
+        // Table 145. Second call pop up window elements (two)
+        static const TAknWindowLineLayout 
+            popup_call_audio_second_window_1_elements_1();
+        static const TAknWindowLineLayout 
+            popup_call_audio_second_window_1_elements_2();
+        static const TAknWindowLineLayout 
+            popup_call_audio_second_window_1_elements_3();
+
+        // Table 146. Second call pop up window texts (two calls)
+        static const TAknTextLineLayout 
+            popup_call_audio_second_window_1_texts_1( TInt aLine , 
+                                                      TInt aImageWidth );
+        static const TAknTextLineLayout 
+            popup_call_audio_second_window_1_texts_2( TInt aImageWidth );
+
+        // Table 147. Second call pop up window graphics (two calls)
+        static const TAknWindowLineLayout 
+            popup_call_audio_second_window_1_graphics_1();
+
+        // Table 148. Second call pop up window elements (two calls, waiting call)
+        static const TAknWindowLineLayout 
+            popup_call_audio_second_window_3_elements_1();
+        static const TAknWindowLineLayout 
+            popup_call_audio_second_window_3_elements_2();
+        static const TAknWindowLineLayout 
+            popup_call_audio_second_window_3_elements_3();
+
+        // Table 149. Second call pop up window texts (two calls, waiting call)
+        static const TAknTextLineLayout 
+            popup_call_audio_second_window_3_texts_1();
+
+        // Table 150. Second call pop up window graphics (two calls, waiting call)
+        static const TAknWindowLineLayout 
+            popup_call_audio_second_window_3_graphics_1();
+
+        // Table 151. Conference call pop up window descendant and element
+        static const TAknWindowLineLayout 
+            popup_call_audio_conf_window_elements_1( const TRect& aParentRect );
+        static const TAknWindowLineLayout 
+            popup_call_audio_conf_window_elements_2( TInt aLine );
+
+        // Non-specified
+        static const TAknWindowLineLayout
+            ConferencePane();
+
+        // Table 152. Conference call pop up window texts
+        static const TAknTextLineLayout 
+            popup_call_audio_cont_window_texts_1( TInt aLine );
+
+        // Table 153. Muted state elements
+        static const TAknWindowLineLayout 
+            main_pane_elements_muted( TBool aNumberEditorActive );
+
+        // Non-specified
+        static const TAknWindowLineLayout 
+            call_type_pane_elements_1();
+        static const TAknWindowLineLayout 
+            call_type_pane_elements_2();
+
+    };
+
+#endif      // BMLAYOUT_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/laf/BMLayout2.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,1719 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  LAF coordinates (Call2)
+*
+*/
+
+
+// INCLUDE FILES
+#include "BMLayout2.h"
+#include "BMPanic.h"
+#include "BMBubbleManager.h"
+#include <aknenv.h>
+#include <applayout.cdl.h>
+#include <AknUtils.h>
+#include <AknLayout2ScalableDef.h>
+#include <aknlayoutscalable_apps.cdl.h>
+#include <layoutmetadata.cdl.h>
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+    
+////////////////////////////////////////////////////////////////////////////////
+//
+// Call2 Layouts
+//
+////////////////////////////////////////////////////////////////////////////////    
+
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::RectFrameInnerOuterRects
+// -----------------------------------------------------------------------------
+//
+void BubbleLayout2::RectFrameInnerOuterRects( const TRect& aFrameRect,
+                                              TRect& aOuterRect,
+                                              TRect& aInnerRect )
+    {
+    if ( Layout_Meta_Data::IsMirrored() )
+        {
+        TAknLayoutRect frameTopRight;        
+        frameTopRight.LayoutRect( 
+            aFrameRect, 
+            BubbleLayout2::call2_rect_pane_fr_cor_topright() );                
+                
+        TAknLayoutRect frameBottomLeft;        
+        frameBottomLeft.LayoutRect( 
+            aFrameRect, 
+            BubbleLayout2::call2_rect_pane_fr_cor_bottomleft() );                        
+
+        aOuterRect = TRect( frameTopRight.Rect().iTl, 
+                            frameBottomLeft.Rect().iBr );
+                
+        aInnerRect = TRect( frameTopRight.Rect().iBr, 
+                            frameBottomLeft.Rect().iTl );    
+        }
+    else
+        {
+        TAknLayoutRect frameTopLeft;        
+        frameTopLeft.LayoutRect( 
+            aFrameRect, 
+            BubbleLayout2::call2_rect_pane_fr_cor_topleft() );
+
+        TAknLayoutRect frameBottomRight;        
+        frameBottomRight.LayoutRect( 
+            aFrameRect, 
+            BubbleLayout2::call2_rect_pane_fr_cor_bottomright() );
+        
+        aOuterRect = TRect( frameTopLeft.Rect().iTl, 
+                            frameBottomRight.Rect().iBr );
+        aInnerRect = TRect( frameTopLeft.Rect().iBr, 
+                            frameBottomRight.Rect().iTl );    
+        }                    
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::BubbleFrameInnerOuterRects
+// -----------------------------------------------------------------------------
+//
+void BubbleLayout2::BubbleFrameInnerOuterRects( const TRect& aFrameRect,
+                                                TRect& aOuterRect,
+                                                TRect& aInnerRect )
+    {
+    if ( Layout_Meta_Data::IsMirrored() )
+        {
+        TAknLayoutRect bubbleTopRight;        
+        bubbleTopRight.LayoutRect( 
+            aFrameRect, 
+            BubbleLayout2::call2_bubble_pane_fr_cor_topright() );                
+                
+        TAknLayoutRect bubbleBottomLeft;        
+        bubbleBottomLeft.LayoutRect( 
+            aFrameRect, 
+            BubbleLayout2::call2_bubble_pane_fr_cor_bottomleft() );                        
+
+        aOuterRect = TRect( bubbleTopRight.Rect().iTl, 
+                            bubbleBottomLeft.Rect().iBr );
+                
+        aInnerRect = TRect( bubbleTopRight.Rect().iBr, 
+                            bubbleBottomLeft.Rect().iTl );    
+        }
+    else
+        {
+        TAknLayoutRect bubbleTopLeft;        
+        bubbleTopLeft.LayoutRect( 
+            aFrameRect, 
+            BubbleLayout2::call2_bubble_pane_fr_cor_topleft() );
+
+        TAknLayoutRect bubbleBottomRight;        
+        bubbleBottomRight.LayoutRect( 
+            aFrameRect, 
+            BubbleLayout2::call2_bubble_pane_fr_cor_bottomright() );
+        
+        aOuterRect = TRect( bubbleTopLeft.Rect().iTl, 
+                            bubbleBottomRight.Rect().iBr );
+        aInnerRect = TRect( bubbleTopLeft.Rect().iBr, 
+                            bubbleBottomRight.Rect().iTl );    
+        }    
+    }
+
+////////////////////////////////////////////////////////////////////////////////    
+// LAF Table 4.50: bubble/rect window positions
+////////////////////////////////////////////////////////////////////////////////    
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_first_window
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_first_window( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_first_window_ParamLimits();
+
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        if ( aVariety < 17 )
+            {
+            // portrait 0..6 == landscape 7..13 
+            aVariety += 7;    	        
+            }
+        else
+            {
+            // portrait 18 == landscape 17 
+            aVariety -= 1;    
+            }            
+    	} 
+    
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }
+        
+    TAknWindowComponentLayout layout1 = 
+        AknLayoutScalable_Apps::main_call2_pane();
+    TAknWindowComponentLayout layout2 = 
+        AknLayoutScalable_Apps::popup_call2_audio_first_window( aVariety );
+    
+    return TAknWindowComponentLayout::
+        Compose( layout1, layout2 ).LayoutLine();    
+    }
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_in_window
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_in_window( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_in_window_ParamLimits();
+
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        if ( aVariety == 8 )
+            {
+            aVariety = 9;    
+            }
+        else
+            {
+            // portrait 0..3 == landscape 4..7 
+            aVariety += 4;    	                
+            }
+    	}        
+    
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }
+    
+    TAknWindowComponentLayout layout1 = 
+        AknLayoutScalable_Apps::main_call2_pane();
+    TAknWindowComponentLayout layout2 = 
+        AknLayoutScalable_Apps::popup_call2_audio_in_window( aVariety );
+    
+    return TAknWindowComponentLayout::
+        Compose( layout1, layout2 ).LayoutLine();    
+    }
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_out_window
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_out_window( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_out_window_ParamLimits();
+
+
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        // portrait 0..2 == landscape 3..6 
+        aVariety += 3;    	        
+    	} 
+    	    
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }
+    
+    TAknWindowComponentLayout layout1 = 
+        AknLayoutScalable_Apps::main_call2_pane();
+    TAknWindowComponentLayout layout2 = 
+        AknLayoutScalable_Apps::popup_call2_audio_out_window( aVariety );
+    
+    return TAknWindowComponentLayout::
+        Compose( layout1, layout2 ).LayoutLine();    
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_second_window
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_second_window( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_second_window_ParamLimits();
+
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        // portrait 0..4 == landscape 5..9 
+        aVariety += 5;    	        
+        }
+
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }
+    
+    TAknWindowComponentLayout layout1 = 
+        AknLayoutScalable_Apps::main_call2_pane();
+    TAknWindowComponentLayout layout2 = 
+        AknLayoutScalable_Apps::popup_call2_audio_second_window( aVariety );
+    
+    return TAknWindowComponentLayout::
+        Compose( layout1, layout2 ).LayoutLine();    
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_wait_window
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_wait_window( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_wait_window_ParamLimits();
+
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        if ( aVariety < 8 )
+            {
+            // portrait 0..3 == landscape 4..7 
+            aVariety += 4;    	        
+            }
+        else
+            {
+            // portrait 9 == landscape 8 
+            aVariety -= 1;    
+            }            
+    	}
+
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }
+    
+    TAknWindowComponentLayout layout1 = 
+        AknLayoutScalable_Apps::main_call2_pane();
+    TAknWindowComponentLayout layout2 = 
+        AknLayoutScalable_Apps::popup_call2_audio_wait_window( aVariety );
+    
+    return TAknWindowComponentLayout::
+        Compose( layout1, layout2 ).LayoutLine();    
+    }                    
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_conf_window
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_conf_window( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_conf_window_ParamLimits();
+        
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        // portrait 0..3 == landscape 4..7 
+        aVariety += 4;    	        
+        }
+
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }
+    
+    TAknWindowComponentLayout layout1 = 
+        AknLayoutScalable_Apps::main_call2_pane();
+    TAknWindowComponentLayout layout2 = 
+        AknLayoutScalable_Apps::popup_call2_audio_conf_window( aVariety );
+    
+    return TAknWindowComponentLayout::
+        Compose( layout1, layout2 ).LayoutLine();    
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_call_object_visual_pane
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_call_object_visual_pane()
+    {
+    return AknLayoutScalable_Apps::call2_cli_visual_pane().LayoutLine();
+    }    
+    
+////////////////////////////////////////////////////////////////////////////////            
+// LAF Table 4.60: conference call bubble contents
+////////////////////////////////////////////////////////////////////////////////
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_conf_pane_bg
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_conf_pane_background()
+    {
+        return AknLayoutScalable_Apps::bg_popup_call2_act_pane_cp03().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_conf_cli_list
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_conf_cli_list()
+    {
+    return AknLayoutScalable_Apps::list_conf_pane_cp().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_conf_window_call_timer_txt
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_conf_window_call_timer_text()
+    {
+    return AknLayoutScalable_Apps::popup_call2_audio_conf_window_t1().LayoutLine();
+    }            
+    
+    
+////////////////////////////////////////////////////////////////////////////////
+// LAF Table 4.61: conference call bubble bg graphics
+////////////////////////////////////////////////////////////////////////////////
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_conf_single_list_graphic_pane
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_conf_single_list_graphic_pane( TInt aRow )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::list_single_graphic_popup_conf2_pane_ParamLimits();
+
+    /*if ( aRow < parLimits.FirstVariety() || aRow > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }*/
+    
+    return AknLayoutScalable_Apps::
+        list_single_graphic_popup_conf2_pane( aRow ).LayoutLine();    
+    }
+    
+
+////////////////////////////////////////////////////////////////////////////////
+// LAF Table 4.62: conference call members list entries
+////////////////////////////////////////////////////////////////////////////////
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_conf_single_list_highlight_pane
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_conf_single_list_highlight_pane()
+    {
+    return AknLayoutScalable_Apps::list_highlight_pane_cp04().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_conf_single_list_pane_call_status_icon
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_conf_single_list_pane_call_status_icon()
+    {
+    return AknLayoutScalable_Apps::list_single_graphic_popup_conf2_pane_g1().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_conf_single_list_pane_ciphering_icon
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_conf_single_list_pane_ciphering_icon()
+    {
+    return AknLayoutScalable_Apps::list_single_graphic_popup_conf2_pane_g2().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_conf_single_list_pane_cli_text
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_conf_single_list_pane_cli_text()
+    {
+    return AknLayoutScalable_Apps::list_single_graphic_popup_conf2_pane_t1().LayoutLine();
+    }
+
+
+////////////////////////////////////////////////////////////////////////////////
+// LAF Table 4.59: second call bubble contents           
+////////////////////////////////////////////////////////////////////////////////
+  
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_second_call_background
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_second_call_background( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::bg_popup_call2_act_pane_cp01_ParamLimits();
+
+    if ( aVariety < parLimits.FirstVariety() || aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }
+    
+    return AknLayoutScalable_Apps::bg_popup_call2_act_pane_cp01( 
+        aVariety ).LayoutLine(); 
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_second_call_type_icon
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_second_call_type_icon( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::call_type_pane_cp05_ParamLimits();
+
+    if ( aVariety < parLimits.FirstVariety() || aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }
+    
+    return AknLayoutScalable_Apps::call_type_pane_cp05( aVariety ).LayoutLine();    
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_second_call_status_icon
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_second_call_status_icon( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_second_window_g1_ParamLimits();
+
+    if ( aVariety < parLimits.FirstVariety() || aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }
+    
+    return AknLayoutScalable_Apps::popup_call2_audio_second_window_g1( 
+        aVariety ).LayoutLine(); 
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_second_call_cyphering_icon
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_second_call_cyphering_icon( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_second_window_g2_ParamLimits();
+
+    if ( aVariety < parLimits.FirstVariety() || aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }
+    
+    return AknLayoutScalable_Apps::popup_call2_audio_second_window_g2( 
+        aVariety ).LayoutLine(); 
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_second_call_cli_text
+// -----------------------------------------------------------------------------
+//    
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_audio_second_call_cli_text( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_second_window_t1_ParamLimits();
+
+    if ( aVariety < parLimits.FirstVariety() || aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }
+    
+    return AknLayoutScalable_Apps::popup_call2_audio_second_window_t1( 
+        aVariety ).LayoutLine(); 
+    }                
+     
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_second_call_timer_text
+// -----------------------------------------------------------------------------
+//    
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_audio_second_call_timer_text( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_second_window_t2_ParamLimits();
+
+    if ( aVariety < parLimits.FirstVariety() || aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }
+    
+    return AknLayoutScalable_Apps::popup_call2_audio_second_window_t2( 
+        aVariety ).LayoutLine(); 
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_second_call_state_text
+// -----------------------------------------------------------------------------
+//    
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_audio_second_call_state_text( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits = ( aVariety >= 15 ) ?
+      AknLayoutScalable_Apps::popup_call2_audio_second_window_t4_ParamLimits(
+       aVariety ):
+      AknLayoutScalable_Apps::popup_call2_audio_second_window_t3_ParamLimits();
+
+    if ( aVariety < parLimits.FirstVariety() || aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }
+    
+    if ( aVariety >= 15 )
+        {
+        return AknLayoutScalable_Apps::popup_call2_audio_second_window_t4( 
+            aVariety ).LayoutLine(); 
+        }
+    else
+        {
+        return AknLayoutScalable_Apps::popup_call2_audio_second_window_t3( 
+            aVariety ).LayoutLine();     
+        }        
+    }                                                         
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_second_call_number_text
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_audio_second_call_number_text( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_second_window_t4_ParamLimits( aVariety );
+
+    if ( aVariety < parLimits.FirstVariety() || aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }
+    
+    return AknLayoutScalable_Apps::popup_call2_audio_second_window_t4( 
+        aVariety ).LayoutLine();    
+    }
+    
+////////////////////////////////////////////////////////////////////////////////
+// LAF Table 4.58: waiting call bubble contents
+////////////////////////////////////////////////////////////////////////////////
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_wait_call_background
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_wait_call_background()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_in_pane_cp02().LayoutLine(); 
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_wait_call_type_icon
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_wait_call_type_icon()
+    {
+    return AknLayoutScalable_Apps::call_type_pane_cp04().LayoutLine(); 
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_wait_call_status_icon
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_wait_call_status_icon()
+    {
+    return AknLayoutScalable_Apps::popup_call2_audio_wait_window_g1().LayoutLine(); 
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_wait_call_cyphering_icon
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_wait_call_cyphering_icon()
+    {
+    return AknLayoutScalable_Apps::popup_call2_audio_wait_window_g2().LayoutLine(); 
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_wait_call_cli_text
+// -----------------------------------------------------------------------------
+//    
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_audio_wait_call_cli_text()
+    {
+    return AknLayoutScalable_Apps::popup_call2_audio_wait_window_t3().LayoutLine(); 
+    }
+
+    
+////////////////////////////////////////////////////////////////////////////////
+// LAF Table 4.55: first call bubble contents
+////////////////////////////////////////////////////////////////////////////////
+       
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_first_call_background
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_first_call_background( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::bg_popup_call2_act_pane_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+    
+    return AknLayoutScalable_Apps::bg_popup_call2_act_pane( aVariety ).LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_first_call_type_icon
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_first_call_type_icon( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::call_type_pane_cp03_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::call_type_pane_cp03( aVariety ).LayoutLine();
+    }    
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_first_call_status_icon
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_first_call_status_icon( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_first_window_g1_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_first_window_g1( 
+        aVariety ).LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_first_call_window_ciphering_icon
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_first_call_window_ciphering_icon( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_first_window_g2_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_first_window_g2( 
+        aVariety ).LayoutLine();
+    }        
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_first_call_cli_text
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_audio_first_call_cli_text( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_first_window_t1_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_first_window_t1( 
+        aVariety ).LayoutLine();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_first_call_cli_text
+// -----------------------------------------------------------------------------
+//    
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_audio_first_call_number_text( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_first_window_t4_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_first_window_t4( 
+        aVariety ).LayoutLine();            
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_first_call_state_text
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_audio_first_call_state_text( TInt aVariety )
+    {
+    if ( aVariety < 18 )
+        {
+        TAknLayoutScalableParameterLimits parLimits =
+            AknLayoutScalable_Apps::popup_call2_audio_first_window_t4_ParamLimits();
+        
+        if ( aVariety < parLimits.FirstVariety() || aVariety > parLimits.LastVariety() )
+            {
+            Panic( EBMPanicLAF );
+            }   
+        
+        return AknLayoutScalable_Apps::popup_call2_audio_first_window_t4( 
+            aVariety ).LayoutLine();
+        }
+    else
+        {
+        TAknLayoutScalableParameterLimits parLimits =
+            AknLayoutScalable_Apps::popup_call2_audio_first_window_t6_ParamLimits( aVariety );
+        
+        if ( aVariety < parLimits.FirstVariety() || aVariety > parLimits.LastVariety() )
+            {
+            Panic( EBMPanicLAF );
+            }   
+        
+        return AknLayoutScalable_Apps::popup_call2_audio_first_window_t6( 
+            aVariety ).LayoutLine();
+        }
+        
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_first_call_text_5
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout
+    BubbleLayout2::popup_call2_audio_first_call_text_5( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_first_window_t5_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_first_window_t5( 
+        aVariety ).LayoutLine();
+    }
+
+
+////////////////////////////////////////////////////////////////////////////////
+// LAF Table 4.56: CLI graphics (bubble)
+////////////////////////////////////////////////////////////////////////////////
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_bubble_pane_graphics
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_bubble_pane_graphics()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_bubble_pane().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_bubble_pane_graphics_cli
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_bubble_pane_graphics_cli()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_act_pane_g1().LayoutLine();
+    }    
+
+    
+////////////////////////////////////////////////////////////////////////////////
+// LAF Table 4.54: outgoing call bubble
+////////////////////////////////////////////////////////////////////////////////
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_out_background
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_out_background( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::bg_popup_call2_in_pane_cp01_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() 
+        || aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+    
+    return AknLayoutScalable_Apps::bg_popup_call2_in_pane_cp01( 
+        aVariety ).LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_out_call_number_type_icon
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_out_call_number_type_icon( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_out_window_g2_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_out_window_g2( 
+        aVariety ).LayoutLine();
+    }    
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_out_call_waiting_icon
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_out_call_waiting_icon( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_out_window_g1_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_out_window_g1( 
+        aVariety ).LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_out_ciphering_icon
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_out_ciphering_icon( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_out_window_g3_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_out_window_g3( 
+        aVariety ).LayoutLine();
+    }        
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_out_call_text_1
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_audio_out_call_text_1( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_out_window_t1_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_out_window_t1( 
+        aVariety ).LayoutLine();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_out_call_text_2
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_audio_out_call_text_2( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_out_window_t2_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_out_window_t2( 
+        aVariety ).LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_out_call_text_3
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_audio_out_call_text_3( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_out_window_t6_ParamLimits( aVariety );
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_out_window_t6( 
+        aVariety ).LayoutLine();
+    }    
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_out_cli_textual_1
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_audio_out_cli_textual_1( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_out_window_t3_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_out_window_t3( 
+        aVariety ).LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_out_cli_textual_2
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_audio_out_cli_textual_2( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_out_window_t4_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_out_window_t4( 
+        aVariety ).LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_out_cli_textual_3
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_audio_out_cli_textual_3( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_out_window_t5_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_out_window_t5( 
+        aVariety ).LayoutLine();
+    }                
+
+
+////////////////////////////////////////////////////////////////////////////////
+// LAF Table 4.54: incoming call bubble
+////////////////////////////////////////////////////////////////////////////////
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_in_background
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_in_background( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::bg_popup_call2_in_pane_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+    
+    return AknLayoutScalable_Apps::bg_popup_call2_in_pane( aVariety ).LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_in_call_waiting_icon
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_in_call_waiting_icon( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_in_window_g1_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_in_window_g1( 
+        aVariety ).LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_in_call_number_type_icon
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_in_call_number_type_icon( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_in_window_g2_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_in_window_g2( 
+        aVariety ).LayoutLine();
+    }    
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_in_ciphering_icon
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_audio_in_ciphering_icon( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_in_window_g3_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() ||
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_in_window_g3( 
+        aVariety ).LayoutLine();
+    }        
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_in_brand_image
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout
+    BubbleLayout2::popup_call2_audio_in_brand_image( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_in_window_g4_ParamLimits(0);
+
+   	if ( aVariety < parLimits.FirstVariety() ||
+   	    aVariety > parLimits.LastVariety() )
+   	    {
+   	    Panic( EBMPanicLAF );
+   	    }
+
+    return AknLayoutScalable_Apps::popup_call2_audio_in_window_g4(
+   	    aVariety ).LayoutLine();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_out_brand_image
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout
+    BubbleLayout2::popup_call2_audio_out_brand_image( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_out_window_g4_ParamLimits(0);
+
+   	if ( aVariety < parLimits.FirstVariety() ||
+   	    aVariety > parLimits.LastVariety() )
+   	    {
+   	    Panic( EBMPanicLAF );
+   	    }
+
+    return AknLayoutScalable_Apps::popup_call2_audio_out_window_g4(
+   	    aVariety ).LayoutLine();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_first_brand_image
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout
+    BubbleLayout2::popup_call2_audio_first_brand_image( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_first_window_g4_ParamLimits(0);
+
+   	if ( aVariety < parLimits.FirstVariety() ||
+   	    aVariety > parLimits.LastVariety() )
+   	    {
+   	    Panic( EBMPanicLAF );
+   	    }
+
+    return AknLayoutScalable_Apps::popup_call2_audio_first_window_g4(
+   	    aVariety ).LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_first_brand_image2
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout
+    BubbleLayout2::popup_call2_audio_first_brand_image2( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_first_window_g5_ParamLimits(0);
+
+   	if ( aVariety < parLimits.FirstVariety() ||
+   	    aVariety > parLimits.LastVariety() )
+   	    {
+   	    Panic( EBMPanicLAF );
+   	    }
+
+    return AknLayoutScalable_Apps::popup_call2_audio_first_window_g5(
+   	    aVariety ).LayoutLine();
+    }    
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_second_brand_image
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout
+    BubbleLayout2::popup_call2_audio_second_brand_image( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_second_window_g3_ParamLimits(0);
+
+   	if ( aVariety < parLimits.FirstVariety() ||
+   	    aVariety > parLimits.LastVariety() )
+   	    {
+   	    Panic( EBMPanicLAF );
+   	    }
+
+    return AknLayoutScalable_Apps::popup_call2_audio_second_window_g3(
+   	    aVariety ).LayoutLine();
+    }
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_in_call_text_1
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_audio_in_call_text_1( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_in_window_t1_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_in_window_t1( 
+        aVariety ).LayoutLine();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_out_call_text_2
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_audio_in_call_text_2( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_in_window_t2_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_in_window_t2( 
+        aVariety ).LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_out_call_text_3
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_audio_in_call_text_3( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_in_window_t3_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_in_window_t3(
+        aVariety ).LayoutLine();
+    }    
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_in_cli_textual_1
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_audio_in_cli_textual_1( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_in_window_t4_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() ||
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_in_window_t4( 
+        aVariety ).LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_in_cli_textual_2
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_audio_in_cli_textual_2( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_in_window_t5_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_in_window_t5( 
+        aVariety ).LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_audio_in_cli_textual_3
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout2::popup_call2_audio_in_cli_textual_3( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call2_audio_in_window_t6_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call2_audio_in_window_t6( 
+        aVariety ).LayoutLine();
+    }
+
+
+////////////////////////////////////////////////////////////////////////////////
+// LAF Table 4.52: CLI graphics (rect)
+////////////////////////////////////////////////////////////////////////////////
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_bubble_rect_pane_graphics
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_bubble_rect_pane_graphics( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::bg_popup_call2_rect_pane_ParamLimits();
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+
+    return AknLayoutScalable_Apps::bg_popup_call2_rect_pane(
+        aVariety ).LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_bubble_rect_pane_graphics_cli
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::popup_call2_bubble_rect_pane_graphics_cli()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_in_pane_g1().LayoutLine();
+    } 
+
+
+////////////////////////////////////////////////////////////////////////////////
+// LAF Table 4.63: CLI graphics (mainpane)
+////////////////////////////////////////////////////////////////////////////////
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_bubble_rect_pane_graphics_cli
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_cli_visual_graphic_pane()
+    {
+    return AknLayoutScalable_Apps::call2_cli_visual_graphic_pane().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_bubble_rect_pane_graphics_cli
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_cli_visual_text_pane()
+    {
+    return AknLayoutScalable_Apps::call2_cli_visual_text_pane().LayoutLine();
+    }    
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::popup_call2_bubble_rect_pane_graphics_cli
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout BubbleLayout2::call2_main_pane_text( TInt aRow )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::call2_cli_visual_pane_t1_ParamLimits();
+        
+    if ( aRow > parLimits.LastRow() )
+        {
+        Panic( EBMPanicLAF );
+        }
+    
+    return AknLayoutScalable_Apps::call2_cli_visual_pane_t1( aRow ).LayoutLine();        
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_cli_visual_text_number_of_rows
+// -----------------------------------------------------------------------------
+//    
+TInt BubbleLayout2::call2_cli_visual_text_number_of_rows()
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::call2_cli_visual_pane_t1_ParamLimits();
+        
+    return parLimits.LastRow();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_image_placing_area
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout BubbleLayout2::call2_image_placing_area( 
+    TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::aid_image_placing_area_ParamLimits( aVariety );
+     
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        // portrait 0..1 == landscape 2..3 
+        aVariety += 2;    	        
+    	}
+        
+    if ( aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }
+    
+    return AknLayoutScalable_Apps::aid_image_placing_area( 
+        aVariety ).LayoutLine();
+    }
+
+////////////////////////////////////////////////////////////////////////////////
+// LAF Table 4.65: CLI graphics (mainpane)
+////////////////////////////////////////////////////////////////////////////////
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_cli_visual_graphic_pane_g1
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_cli_visual_graphic_pane_g1() // image
+    {
+    return AknLayoutScalable_Apps::call2_cli_visual_graphic_pane_g1().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_cli_visual_graphic_pane_g2
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_cli_visual_graphic_pane_g2() // small graphics
+    {
+    return AknLayoutScalable_Apps::call2_cli_visual_graphic_pane_g2().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_cli_visual_graphic_pane_g3
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_cli_visual_graphic_pane_g3() // default object
+    {
+    return AknLayoutScalable_Apps::call2_cli_visual_graphic_pane_g3().LayoutLine();
+    }        
+
+
+////////////////////////////////////////////////////////////////////////////////
+// LAF Table 4.53: Rectangle frame
+////////////////////////////////////////////////////////////////////////////////
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_rect_pane_fr_cor_center
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_rect_pane_fr_cor_center()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_rect_pane_g1().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_rect__pane_fr_cor_topleft
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_rect_pane_fr_cor_topleft()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_rect_pane_g2().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_rect__pane_fr_cor_topright
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_rect_pane_fr_cor_topright()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_rect_pane_g3().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_rect_pane_fr_cor_bottomleft
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_rect_pane_fr_cor_bottomleft()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_rect_pane_g4().LayoutLine();
+    } 
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_rect_pane_fr_cor_bottomright
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_rect_pane_fr_cor_bottomright()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_rect_pane_g5().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_rect_pane_fr_side_sidetop
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_rect_pane_fr_side_top()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_rect_pane_g6().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_rect_pane_fr_side_bottom
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_rect_pane_fr_side_bottom()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_rect_pane_g7().LayoutLine();
+    }                        
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_rect_pane_fr_side_left
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_rect_pane_fr_side_left()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_rect_pane_g8().LayoutLine();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_rect_pane_fr_side_right
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_rect_pane_fr_side_right()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_rect_pane_g9().LayoutLine();
+    }    
+    
+
+////////////////////////////////////////////////////////////////////////////////
+// LAF Table 4.57: Bubble frame
+////////////////////////////////////////////////////////////////////////////////
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_bubble_pane_fr_cor_center
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_bubble_pane_fr_cor_center()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_bubble_pane_g1().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_bubble__pane_fr_cor_topleft
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_bubble_pane_fr_cor_topleft()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_bubble_pane_g2().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_bubble__pane_fr_cor_topright
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_bubble_pane_fr_cor_topright()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_bubble_pane_g3().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_bubble_pane_fr_cor_bottomleft
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_bubble_pane_fr_cor_bottomleft()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_bubble_pane_g4().LayoutLine();
+    } 
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_bubble_pane_fr_cor_bottomright
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_bubble_pane_fr_cor_bottomright()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_bubble_pane_g5().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_bubble_pane_fr_side_sidetop
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_bubble_pane_fr_side_top()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_bubble_pane_g6().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_bubble_pane_fr_side_bottom
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_bubble_pane_fr_side_bottom()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_bubble_pane_g7().LayoutLine();
+    }                        
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_bubble_pane_fr_side_left
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_bubble_pane_fr_side_left()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_bubble_pane_g8().LayoutLine();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout2::call2_bubble_pane_fr_side_right
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout2::call2_bubble_pane_fr_side_right()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_bubble_pane_g9().LayoutLine();
+    }    
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/laf/BMLayout2.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,383 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Layout definitions from Application LAF (Call2 layouts)
+*
+*/
+
+
+
+#ifndef BMLAYOUT2_H
+#define BMLAYOUT2_H
+
+// INCLUDES
+#include <calslbs.h>
+#include <bldvariant.hrh> 
+#include <AknLayoutDef.h>
+
+/**
+* Layout coordinates from Application LAF
+* 
+* @lib      bubblemanager.lib
+* @since    2.0
+*/
+class BubbleLayout2
+    { 
+    public: // Helper functions
+        /**
+        * Get inner and outer rectangles for rectangle frame.
+        * @param aFrameRect Frame rectangle.
+        * @param aOuterRect Outer rectangle (return).
+        * @param aInnerRect Inner rectangle (return).
+        */ 
+        static void RectFrameInnerOuterRects( const TRect& aFrameRect,
+                                              TRect& aOuterRect,
+                                              TRect& aInnerRect );
+
+        /**
+        * Get inner and outer rectangles for bubble frame.
+        * @param aFrameRect Frame rectangle.
+        * @param aOuterRect Outer rectangle (return).
+        * @param aInnerRect Inner rectangle (return).
+        */ 
+        static void BubbleFrameInnerOuterRects( const TRect& aFrameRect,
+                                                TRect& aOuterRect,
+                                                TRect& aInnerRect );                                       
+
+    public: // Layout coordinates
+    
+        ///////////////////////////////////////////////////////////////////////
+        // LAF Table 4.50: bubble/rect window positions
+        ///////////////////////////////////////////////////////////////////////
+        static const TAknWindowLineLayout 
+            popup_call2_audio_first_window( TInt aVariety );                        
+            
+        static const TAknWindowLineLayout 
+            popup_call2_audio_in_window( TInt aVariety );
+            
+        static const TAknWindowLineLayout 
+            popup_call2_audio_out_window( TInt aVariety );
+            
+        static const TAknWindowLineLayout 
+            popup_call2_audio_second_window( TInt aVariety );
+            
+        static const TAknWindowLineLayout 
+            popup_call2_audio_wait_window( TInt aVariety );
+            
+        static const TAknWindowLineLayout 
+            popup_call2_audio_conf_window( TInt aVariety );
+
+        static const TAknWindowLineLayout 
+            call2_call_object_visual_pane();            
+
+        ///////////////////////////////////////////////////////////////////////            
+        // LAF Table 4.60: conference call bubble contents
+        ///////////////////////////////////////////////////////////////////////
+        static const TAknWindowLineLayout 
+            popup_call2_conf_pane_background();
+            
+        static const TAknWindowLineLayout 
+            popup_call2_conf_cli_list();
+            
+        static const TAknTextLineLayout 
+            popup_call2_conf_window_call_timer_text();
+    
+        ///////////////////////////////////////////////////////////////////////
+        // LAF Table 4.61: conference call bubble bg graphics
+        ///////////////////////////////////////////////////////////////////////
+        static const TAknWindowLineLayout 
+            popup_call2_conf_single_list_graphic_pane( TInt aRow );                                                
+
+        ///////////////////////////////////////////////////////////////////////
+        // LAF Table 4.62: conference call members list entries
+        ///////////////////////////////////////////////////////////////////////            
+        static const TAknWindowLineLayout 
+            popup_call2_conf_single_list_highlight_pane();
+            
+        static const TAknWindowLineLayout 
+            popup_call2_conf_single_list_pane_call_status_icon();
+            
+        static const TAknWindowLineLayout 
+            popup_call2_conf_single_list_pane_ciphering_icon();
+            
+        static const TAknTextLineLayout 
+            popup_call2_conf_single_list_pane_cli_text();                                                
+
+        ///////////////////////////////////////////////////////////////////////
+        // LAF Table 4.59: second call bubble contents           
+        ///////////////////////////////////////////////////////////////////////
+        static const TAknWindowLineLayout 
+            popup_call2_audio_second_call_background( TInt aVariety );
+       
+        static const TAknWindowLineLayout 
+            popup_call2_audio_second_call_type_icon( TInt aVariety );
+            
+        static const TAknWindowLineLayout 
+            popup_call2_audio_second_call_status_icon( TInt aVariety );
+            
+        static const TAknWindowLineLayout 
+            popup_call2_audio_second_call_cyphering_icon( TInt aVariety );
+            
+        static const TAknTextLineLayout 
+            popup_call2_audio_second_call_cli_text( TInt aVariety );
+            
+        static const TAknTextLineLayout 
+            popup_call2_audio_second_call_timer_text( TInt aVariety );                                                
+        
+        static const TAknTextLineLayout 
+            popup_call2_audio_second_call_state_text( TInt aVariety );
+            
+        static const TAknTextLineLayout
+            popup_call2_audio_second_call_number_text( TInt aVariety );
+            
+        ///////////////////////////////////////////////////////////////////////
+        // LAF Table 4.58: waiting call bubble contents
+        ///////////////////////////////////////////////////////////////////////
+        static const TAknWindowLineLayout 
+            popup_call2_audio_wait_call_background();
+            
+        static const TAknWindowLineLayout 
+            popup_call2_audio_wait_call_type_icon();
+            
+        static const TAknWindowLineLayout 
+            popup_call2_audio_wait_call_status_icon();
+            
+        static const TAknWindowLineLayout 
+            popup_call2_audio_wait_call_cyphering_icon();
+            
+        static const TAknTextLineLayout 
+            popup_call2_audio_wait_call_cli_text();                                                            
+            
+        ///////////////////////////////////////////////////////////////////////
+        // LAF Table 4.55: first call bubble contents
+        ///////////////////////////////////////////////////////////////////////
+        static const TAknWindowLineLayout 
+            popup_call2_audio_first_call_background( TInt aVariety );
+    
+        static const TAknWindowLineLayout 
+            popup_call2_audio_first_call_type_icon( TInt aVariety );
+    
+        static const TAknWindowLineLayout 
+            popup_call2_audio_first_call_status_icon( TInt aVariety );
+    
+        static const TAknWindowLineLayout 
+            popup_call2_audio_first_call_window_ciphering_icon( TInt aVariety );
+    
+        static const TAknTextLineLayout 
+            popup_call2_audio_first_call_cli_text( TInt aVariety );
+            
+        static const TAknTextLineLayout 
+            popup_call2_audio_first_call_number_text( TInt aVariety );            
+    
+        static const TAknTextLineLayout 
+            popup_call2_audio_first_call_state_text( TInt aVariety );
+    
+        static const TAknTextLineLayout
+            popup_call2_audio_first_call_text_5( TInt aVariety );
+        
+        ///////////////////////////////////////////////////////////////////////
+        // LAF Table 4.56: CLI graphics (bubble)
+        ///////////////////////////////////////////////////////////////////////
+        static const TAknWindowLineLayout 
+            popup_call2_bubble_pane_graphics();            
+            
+        static const TAknWindowLineLayout 
+            popup_call2_bubble_pane_graphics_cli();
+            
+        ///////////////////////////////////////////////////////////////////////
+        // LAF Table 4.54: outgoing call bubble
+        ///////////////////////////////////////////////////////////////////////
+        static const TAknWindowLineLayout 
+            popup_call2_audio_out_background( TInt aVariety );
+    
+        static const TAknWindowLineLayout 
+            popup_call2_audio_out_call_number_type_icon( TInt aVariety );
+    
+        static const TAknWindowLineLayout 
+            popup_call2_audio_out_call_waiting_icon( TInt aVariety );
+    
+        static const TAknWindowLineLayout 
+            popup_call2_audio_out_ciphering_icon( TInt aVariety );
+    
+        static const TAknTextLineLayout 
+            popup_call2_audio_out_call_text_1( TInt aVariety );
+
+        static const TAknTextLineLayout 
+            popup_call2_audio_out_call_text_2( TInt aVariety );
+            
+        static const TAknTextLineLayout 
+            popup_call2_audio_out_call_text_3( TInt aVariety );            
+    
+        static const TAknTextLineLayout 
+            popup_call2_audio_out_cli_textual_1( TInt aVariety );
+
+        static const TAknTextLineLayout 
+            popup_call2_audio_out_cli_textual_2( TInt aVariety );
+
+        static const TAknTextLineLayout 
+            popup_call2_audio_out_cli_textual_3( TInt aVariety );                            
+
+        ///////////////////////////////////////////////////////////////////////
+        // LAF Table 4.54: incoming call bubble
+        ///////////////////////////////////////////////////////////////////////
+        static const TAknWindowLineLayout 
+            popup_call2_audio_in_background( TInt aVariety );
+            
+        static const TAknWindowLineLayout 
+            popup_call2_audio_in_call_waiting_icon( TInt aVariety );
+    
+        static const TAknWindowLineLayout 
+            popup_call2_audio_in_call_number_type_icon( TInt aVariety );
+    
+        static const TAknWindowLineLayout 
+            popup_call2_audio_in_ciphering_icon( TInt aVariety );
+    
+        static const TAknTextLineLayout 
+            popup_call2_audio_in_call_text_1( TInt aVariety );
+    
+        static const TAknTextLineLayout 
+            popup_call2_audio_in_call_text_2( TInt aVariety );
+
+        static const TAknTextLineLayout 
+            popup_call2_audio_in_call_text_3( TInt aVariety );
+        
+        static const TAknTextLineLayout 
+            popup_call2_audio_in_cli_textual_1( TInt aVariety );
+
+        static const TAknTextLineLayout 
+            popup_call2_audio_in_cli_textual_2( TInt aVariety );
+    
+        static const TAknTextLineLayout 
+            popup_call2_audio_in_cli_textual_3( TInt aVariety );
+
+        static const TAknWindowLineLayout
+            popup_call2_audio_in_brand_image( TInt aVariety );
+
+        static const TAknWindowLineLayout
+      	    popup_call2_audio_out_brand_image( TInt aVariety );
+
+      	static const TAknWindowLineLayout
+      	    popup_call2_audio_first_brand_image( TInt aVariety );
+      	    
+        // option 2
+        static const TAknWindowLineLayout
+      	    popup_call2_audio_first_brand_image2( TInt aVariety );      	    
+
+      	static const TAknWindowLineLayout
+      	    popup_call2_audio_second_brand_image( TInt aVariety );
+
+        ///////////////////////////////////////////////////////////////////////
+        // LAF Table 4.52: CLI graphics (rect)
+        ///////////////////////////////////////////////////////////////////////
+        static const TAknWindowLineLayout 
+            popup_call2_bubble_rect_pane_graphics( TInt aVariety );
+            
+        static const TAknWindowLineLayout 
+            popup_call2_bubble_rect_pane_graphics_cli();
+            
+        ///////////////////////////////////////////////////////////////////////
+        // LAF Table 4.63: CLI graphics (mainpane)
+        ///////////////////////////////////////////////////////////////////////
+        static const TAknWindowLineLayout 
+            call2_cli_visual_graphic_pane();
+            
+        static const TAknWindowLineLayout 
+            call2_cli_visual_text_pane();
+            
+        static const TAknTextLineLayout 
+            call2_main_pane_text( TInt aRow );
+            
+        static TInt call2_cli_visual_text_number_of_rows();
+        
+        static const TAknWindowLineLayout 
+            call2_image_placing_area( TInt aVariety );                
+                    
+        ///////////////////////////////////////////////////////////////////////
+        // LAF Table 4.65: CLI graphics (mainpane)
+        ///////////////////////////////////////////////////////////////////////
+        // Large image
+        static const TAknWindowLineLayout 
+            call2_cli_visual_graphic_pane_g1();
+        // Tiny image    
+        static const TAknWindowLineLayout 
+            call2_cli_visual_graphic_pane_g2();            
+        // Default call object            
+        static const TAknWindowLineLayout 
+            call2_cli_visual_graphic_pane_g3();            
+
+        ///////////////////////////////////////////////////////////////////////
+        // LAF Table 4.53: Rectangle frame
+        ///////////////////////////////////////////////////////////////////////
+        static const TAknWindowLineLayout 
+            call2_rect_pane_fr_cor_center();
+    
+        static const TAknWindowLineLayout 
+            call2_rect_pane_fr_cor_topleft();
+    
+        static const TAknWindowLineLayout 
+            call2_rect_pane_fr_cor_topright();
+    
+        static const TAknWindowLineLayout 
+            call2_rect_pane_fr_cor_bottomleft();
+
+        static const TAknWindowLineLayout 
+            call2_rect_pane_fr_cor_bottomright();
+
+        static const TAknWindowLineLayout 
+            call2_rect_pane_fr_side_top();
+    
+        static const TAknWindowLineLayout 
+            call2_rect_pane_fr_side_bottom();
+    
+        static const TAknWindowLineLayout 
+            call2_rect_pane_fr_side_left();
+    
+        static const TAknWindowLineLayout 
+            call2_rect_pane_fr_side_right();
+            
+        ///////////////////////////////////////////////////////////////////////
+        // LAF Table 4.57: Bubble frame
+        ///////////////////////////////////////////////////////////////////////
+        static const TAknWindowLineLayout 
+            call2_bubble_pane_fr_cor_center();
+    
+        static const TAknWindowLineLayout 
+            call2_bubble_pane_fr_cor_topleft();
+    
+        static const TAknWindowLineLayout 
+            call2_bubble_pane_fr_cor_topright();
+    
+        static const TAknWindowLineLayout 
+            call2_bubble_pane_fr_cor_bottomleft();
+
+        static const TAknWindowLineLayout 
+            call2_bubble_pane_fr_cor_bottomright();
+
+        static const TAknWindowLineLayout 
+            call2_bubble_pane_fr_side_top();
+    
+        static const TAknWindowLineLayout 
+            call2_bubble_pane_fr_side_bottom();
+    
+        static const TAknWindowLineLayout 
+            call2_bubble_pane_fr_side_left();
+    
+        static const TAknWindowLineLayout 
+            call2_bubble_pane_fr_side_right();            
+            
+        
+    };
+
+#endif      // BMLAYOUT2_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/laf/BMLayout3.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,344 @@
+/*
+* 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:  Call3 LAF
+*
+*/
+
+
+// INCLUDE FILES
+#include "BMLayout3.h"
+#include "BMPanic.h"
+#include <aknenv.h>
+#include <applayout.cdl.h>
+#include <AknUtils.h>
+#include <AknLayout2ScalableDef.h>
+#include <aknlayoutscalable_apps.cdl.h>
+#include <layoutmetadata.cdl.h>
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// BubbleLayout3::popup_call3_audio_in_window_rect
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TRect BubbleLayout3::popup_call3_audio_in_window_rect( TInt aVariety )
+    {
+    TRect screenRect( CEikonEnv::Static()->ScreenDevice()->SizeInPixels() );
+
+    TAknLayoutRect appRect;
+    appRect.LayoutRect( 
+        screenRect, 
+        AknLayout::application_window( screenRect ) );
+        
+    TAknLayoutRect mainRect;
+    
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        mainRect.LayoutRect( 
+            appRect.Rect(), 
+            AknLayout::main_pane( appRect.Rect(), 0, 1, 1 ) ); // stacon included            
+        }
+    else
+        {
+        mainRect.LayoutRect( 
+            appRect.Rect(), 
+            AknLayout::main_pane( appRect.Rect(), 0, 1, 1 ) ); // statuspane excluded        
+        }
+        
+    TAknLayoutRect mainCall3Pane;
+    mainCall3Pane.LayoutRect( 
+        mainRect.Rect(), 
+        AknLayoutScalable_Apps::main_call3_pane().LayoutLine() );
+        
+    TAknLayoutRect call3WindowRect;
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        aVariety += 2;            
+        }    
+    call3WindowRect.LayoutRect( 
+        mainCall3Pane.Rect(), 
+        AknLayoutScalable_Apps::popup_call3_audio_in_window( aVariety ).LayoutLine() );
+        
+    return call3WindowRect.Rect();                    
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout3::main_call3_pane
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout BubbleLayout3::main_call3_pane()
+    {
+    return AknLayoutScalable_Apps::main_call3_pane().LayoutLine();    
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout3::popup_call3_audio_in_window
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout BubbleLayout3::popup_call3_audio_in_window(
+    TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        aVariety += 2;            
+        }
+        
+    TAknWindowComponentLayout layout1 = 
+        AknLayoutScalable_Apps::main_call3_pane();
+    TAknWindowComponentLayout layout2 = 
+        AknLayoutScalable_Apps::popup_call3_audio_in_window( aVariety );
+    
+    return TAknWindowComponentLayout::
+        Compose( layout1, layout2 ).LayoutLine();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout3::popup_call3_audio_in_pane
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout BubbleLayout3::popup_call3_audio_in_pane(
+    TInt aVariety )
+    {    
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        aVariety += 2;            
+        }
+    return AknLayoutScalable_Apps::bg_popup_call3_in_pane( aVariety).LayoutLine();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout3::popup_call3_audio_in_window_fr_center
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout BubbleLayout3::popup_call3_audio_in_window_fr_center()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call3_rect_pane_g1().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout3::popup_call3_audio_in_window_fr_corner_topleft
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout BubbleLayout3::popup_call3_audio_in_window_fr_corner_topleft()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call3_rect_pane_g2().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout3::popup_call3_audio_in_window_fr_corner_topright
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout BubbleLayout3::popup_call3_audio_in_window_fr_corner_topright()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call3_rect_pane_g3().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout3::popup_call3_audio_in_window_fr_corner_bottomleft
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout BubbleLayout3::popup_call3_audio_in_window_fr_corner_bottomleft()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call3_rect_pane_g4().LayoutLine();
+    }        
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout3::popup_call3_audio_in_window_fr_corner_bottomright
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout BubbleLayout3::popup_call3_audio_in_window_fr_corner_bottomright()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call3_rect_pane_g5().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout3::popup_call3_audio_in_window_call_indication
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout BubbleLayout3::popup_call3_audio_in_window_call_indication(
+    TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        aVariety += 2;            
+        }
+    return AknLayoutScalable_Apps::popup_call3_audio_in_window_g1( aVariety ).LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout3::popup_call3_audio_in_window_numbertype_indication
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout BubbleLayout3::popup_call3_audio_in_window_numbertype_indication(
+    TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        aVariety += 2;            
+        }
+    return AknLayoutScalable_Apps::popup_call3_audio_in_window_g2( aVariety ).LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout3::popup_call3_audio_in_window_cipheringoff_indication
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout BubbleLayout3::popup_call3_audio_in_window_cipheringoff_indication(
+    TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        aVariety += 2;            
+        }
+    return AknLayoutScalable_Apps::popup_call3_audio_in_window_g3( aVariety ).LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout3::popup_call3_audio_in_window_separator_line
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout BubbleLayout3::popup_call3_audio_in_window_separator_line(
+    TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        aVariety += 1;            
+        }
+    return AknLayoutScalable_Apps::popup_call3_audio_in_window_g4( aVariety ).LayoutLine();
+    }                            
+
+// -----------------------------------------------------------------------------
+// BubbleLayout3::popup_call3_audio_in_window_text_line_1
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout BubbleLayout3::popup_call3_audio_in_window_text_line_1(
+    TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        aVariety += 2;            
+        }
+    return AknLayoutScalable_Apps::popup_call3_audio_in_window_t1( aVariety ).LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout3::popup_call3_audio_in_window_text_line_2
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout BubbleLayout3::popup_call3_audio_in_window_text_line_2(
+    TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        aVariety += 2;            
+        }
+    return AknLayoutScalable_Apps::popup_call3_audio_in_window_t2( aVariety ).LayoutLine();
+    }    
+
+// -----------------------------------------------------------------------------
+// BubbleLayout3::popup_call3_audio_in_window_text_line_3
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout BubbleLayout3::popup_call3_audio_in_window_text_line_3(
+    TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        aVariety += 1;            
+        }
+    return AknLayoutScalable_Apps::popup_call3_audio_in_window_t3( aVariety ).LayoutLine();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout3::call3_video_qcif_pane
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout BubbleLayout3::call3_video_qcif_pane( 
+    TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        aVariety += 1;            
+        }
+        
+    return AknLayoutScalable_Apps::call3_video_qcif_pane( aVariety ).LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout3::call3_video_subqcif_pane
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout BubbleLayout3::call3_video_subqcif_pane( 
+    TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        aVariety += 1;            
+        }
+    return AknLayoutScalable_Apps::call3_video_subqcif_pane( aVariety ).LayoutLine();
+    }    
+
+// -----------------------------------------------------------------------------
+// BubbleLayout3::call3_video_qcif_uncrop_pane
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout BubbleLayout3::call3_video_qcif_uncrop_pane( 
+    TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        aVariety += 1;            
+        }
+        
+    return AknLayoutScalable_Apps::call3_video_qcif_uncrop_pane( aVariety ).LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout3::main_call3_video_subqcif_uncrop_pane
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout BubbleLayout3::call3_video_subqcif_uncrop_pane( 
+    TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        aVariety += 1;            
+        }
+    return AknLayoutScalable_Apps::call3_video_subqcif_uncrop_pane( aVariety ).LayoutLine();
+    }    
+    
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/laf/BMLayout3.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,112 @@
+/*
+* 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:  Call3 layout definitions from Application LAF
+*
+*/
+
+
+
+#ifndef BMLAYOUT3_H
+#define BMLAYOUT3_H
+
+// INCLUDES
+#include <calslbs.h>
+#include <bldvariant.hrh> 
+#include <AknLayoutDef.h>
+
+/**
+* Call3 (video cli) layout coordinates from Application LAF 
+* 
+* @lib      bubblemanager.lib
+* @since    3.1
+*/
+class BubbleLayout3
+    { 
+    public: 
+        /**
+        * Window layout for video ringing tone
+        * @since Series 60 3.1
+        * @param aVariety LAF variety
+        * @return Window rectange for video ringing tone
+        */
+        static TRect popup_call3_audio_in_window_rect( TInt aVariety );
+        
+        
+        /**
+        * Wrappers for layout data functions.
+        * @since Series 60 3.1
+        * @param aVariety LAF variety
+        * @return Component layout
+        */
+        static const TAknWindowLineLayout 
+            main_call3_pane();
+        
+        static const TAknWindowLineLayout 
+            popup_call3_audio_in_window( TInt aVariety );
+        
+        static const TAknWindowLineLayout
+            popup_call3_audio_in_pane( TInt aVariety );
+        
+        static const TAknWindowLineLayout
+            popup_call3_audio_in_window_fr_center();
+        
+        static const TAknWindowLineLayout 
+            popup_call3_audio_in_window_fr_corner_topleft();
+        
+        static const TAknWindowLineLayout 
+            popup_call3_audio_in_window_fr_corner_topright();
+            
+        static const TAknWindowLineLayout 
+            popup_call3_audio_in_window_fr_corner_bottomleft();            
+        
+        static const TAknWindowLineLayout
+            popup_call3_audio_in_window_fr_corner_bottomright();
+        
+        static const TAknWindowLineLayout 
+            popup_call3_audio_in_window_call_indication( TInt aVariety );
+        
+        static const TAknWindowLineLayout
+            popup_call3_audio_in_window_numbertype_indication( TInt aVariety );
+        
+        static const TAknWindowLineLayout
+            popup_call3_audio_in_window_cipheringoff_indication( TInt aVariety );
+        
+        static const TAknWindowLineLayout
+            popup_call3_audio_in_window_separator_line( TInt aVariety );
+        
+        static const TAknTextLineLayout
+            popup_call3_audio_in_window_text_line_1( TInt aVariety );
+        
+        static const TAknTextLineLayout
+            popup_call3_audio_in_window_text_line_2( TInt aVariety );
+       
+        static const TAknTextLineLayout
+            popup_call3_audio_in_window_text_line_3( TInt aVariety );
+        
+        static const TAknWindowLineLayout
+            call3_video_qcif_pane( TInt aVariety );
+        
+        static const TAknWindowLineLayout
+            call3_video_subqcif_pane( TInt aVariety );
+
+        static const TAknWindowLineLayout
+            call3_video_qcif_uncrop_pane( TInt aVariety );
+        
+        static const TAknWindowLineLayout
+            call3_video_subqcif_uncrop_pane( TInt aVariety );            
+    };
+
+#endif // BMLAYOUT3_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/laf/BMLayout4.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,434 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Layout definitions from Application LAF (Call4 layouts)
+*
+*/
+
+
+// INCLUDE FILES
+#include "BMLayout4.h"
+#include "BMPanic.h"
+#include "BMBubbleManager.h"
+#include <aknenv.h>
+#include <applayout.cdl.h>
+#include <AknUtils.h>
+#include <AknLayout2ScalableDef.h>
+#include <aknlayoutscalable_apps.cdl.h>
+#include <layoutmetadata.cdl.h>
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Utility functions
+//
+////////////////////////////////////////////////////////////////////////////////
+
+// -----------------------------------------------------------------------------
+// BubbleLayout4::button_grid_row_column_count
+// -----------------------------------------------------------------------------
+//
+void BubbleLayout4::button_grid_row_column_count( 
+    TInt  aVariety,
+    TInt& aRows, 
+    TInt& aColumns )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        // portrait 0..1 == landscape 2..3 
+        aVariety += 1;    	        
+    	}
+    	
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::cell_call4_button_pane_ParamLimits( aVariety );
+    aRows = parLimits.LastRow() + 1;        
+    aColumns = parLimits.LastColumn() + 1;        
+    }
+
+    
+////////////////////////////////////////////////////////////////////////////////
+//
+// Call4 Layouts
+//
+////////////////////////////////////////////////////////////////////////////////    
+
+// -----------------------------------------------------------------------------
+// BubbleLayout4::call4_windows_pane
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout
+    BubbleLayout4::call4_windows_pane( TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        // portrait 0..1 == landscape 2..3 
+        aVariety += 1;    	        
+    	} 
+    	
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::call4_windows_pane_ParamLimits( aVariety );
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::call4_windows_pane( 
+        aVariety ).LayoutLine();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout4::call4_button_grid_pane
+// -----------------------------------------------------------------------------
+//            
+const TAknWindowLineLayout
+    BubbleLayout4::call4_button_grid_pane( TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        // portrait 0..1 == landscape 2..3 
+        aVariety += 1;    	        
+    	} 
+    	
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::grid_call4_button_pane_ParamLimits( aVariety );
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::grid_call4_button_pane( 
+        aVariety ).LayoutLine();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout4::call4_image_pane
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout4::call4_image_pane( TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        // portrait 2 == landscape 1 
+        aVariety -= 1;    	        
+    	} 
+    	
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::call4_image_pane_ParamLimits( aVariety );
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::call4_image_pane( 
+        aVariety ).LayoutLine();    
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout4::popup_call4_audio_first_window
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout4::popup_call4_audio_first_window( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call4_audio_first_window_ParamLimits( 
+            aVariety );
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call4_audio_first_window( 
+        aVariety ).LayoutLine();    
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout4::popup_call4_audio_second_window
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout4::popup_call4_audio_second_window( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call4_audio_second_window_ParamLimits( 
+            aVariety );
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call4_audio_second_window( 
+        aVariety ).LayoutLine();    
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout4::popup_call4_audio_in_window
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout4::popup_call4_audio_in_window( TInt aVariety )
+    {
+    return AknLayoutScalable_Apps::popup_call4_audio_in_window( 
+        aVariety ).LayoutLine();    
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout4::popup_call4_audio_wait_window
+// -----------------------------------------------------------------------------
+//    
+const TAknWindowLineLayout 
+    BubbleLayout4::popup_call4_audio_wait_window( TInt aVariety )
+    {
+    return AknLayoutScalable_Apps::popup_call4_audio_wait_window( 
+        aVariety ).LayoutLine();    
+    }                    
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout4::popup_call4_audio_conference_window
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout4::popup_call4_audio_conference_window( TInt aVariety )
+    {
+    // same variety in portrait and landscape
+    return AknLayoutScalable_Apps::call4_windows_conf_pane( 
+        aVariety ).LayoutLine();    
+    }    
+
+// -----------------------------------------------------------------------------
+// BubbleLayout4::popup_call4_audio_conference_window
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout4::popup_call4_audio_conference_window_pane( 
+        TInt aVariety,
+        TInt aRow )
+    {
+    // same variety in portrait and landscape
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call4_audio_conf_window_ParamLimits(
+            aVariety );
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }    
+
+    return AknLayoutScalable_Apps::popup_call4_audio_conf_window( 
+        aVariety, 0, aRow ).LayoutLine();    
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout4::popup_call4_conf_pane_bg
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout4::popup_call4_conf_pane_background()
+    {
+    return AknLayoutScalable_Apps::bg_popup_call2_act_pane_cp02().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout4::popup_call4_conf_cli_list
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout4::popup_call4_conf_cli_list()
+    {
+    return AknLayoutScalable_Apps::call4_list_conf_pane().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout4::popup_call4_conf_single_list_graphic_pane
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout4::popup_call4_conf_single_list_graphic_pane( TInt aRow )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::list_single_graphic_popup_conf4_pane_ParamLimits();
+
+    /*if ( aRow < parLimits.FirstVariety() || aRow > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }*/
+    
+    return AknLayoutScalable_Apps::
+        list_single_graphic_popup_conf4_pane( 0, 0, aRow ).LayoutLine();    
+    }        
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout4::popup_call4_conf_single_list_highlight_pane
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout4::popup_call4_conf_single_list_highlight_pane()
+    {
+    return AknLayoutScalable_Apps::list_highlight_pane_cp022().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout4::popup_call2_conf_single_list_pane_call_status_icon
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout4::popup_call4_conf_single_list_pane_call_status_icon()
+    {
+    return AknLayoutScalable_Apps::list_single_graphic_popup_conf4_pane_g1().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout4::popup_call4_conf_single_list_pane_ciphering_icon
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout4::popup_call4_conf_single_list_pane_ciphering_icon()
+    {
+    return AknLayoutScalable_Apps::list_single_graphic_popup_conf4_pane_g2().LayoutLine();
+    }
+    
+// -----------------------------------------------------------------------------
+// BubbleLayout4::popup_call2_conf_single_list_pane_cli_text
+// -----------------------------------------------------------------------------
+//
+const TAknTextLineLayout 
+    BubbleLayout4::popup_call4_conf_single_list_pane_cli_text()
+    {
+    return AknLayoutScalable_Apps::list_single_graphic_popup_conf4_pane_t1().LayoutLine();
+    }    
+
+// -----------------------------------------------------------------------------
+// BubbleLayout4::cell_call4_button_pane
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout4::cell_call4_button_pane( TInt aVariety, TInt aCol, TInt aRow )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        // portrait 0..1 == landscape 2..3 
+        aVariety += 1;    	        
+    	}
+    
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::cell_call4_button_pane_ParamLimits( aVariety );
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::cell_call4_button_pane( 
+        aVariety, aCol, aRow ).LayoutLine();    
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout4::button_call4_background_graphics
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout4::button_call4_background_graphics( TInt aVariety )
+    {
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::bg_button_pane_cp09_ParamLimits( aVariety );
+        
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        // portrait 0..1 == landscape 2..3 
+        aVariety += 2;    	        
+    	}        
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::bg_button_pane_cp09( 
+        aVariety ).LayoutLine();    
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout4::button_call4_function_graphics
+// -----------------------------------------------------------------------------
+//            
+const TAknWindowLineLayout 
+    BubbleLayout4::button_call4_function_graphics( TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        // portrait 0..1 == landscape 2..3 
+        aVariety += 2;    	        
+    	}
+    
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::cell_call4_button_pane_g1_ParamLimits( 
+            aVariety );
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::cell_call4_button_pane_g1( 
+        aVariety ).LayoutLine();    
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout4::button_call4_function_text
+// -----------------------------------------------------------------------------
+//            
+const TAknTextLineLayout 
+    BubbleLayout4::button_call4_function_text( TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        // portrait 0..1 == landscape 2..3 
+        aVariety += 2;    	        
+    	}
+    
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::cell_call4_button_pane_t1_ParamLimits( 
+            aVariety );
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::cell_call4_button_pane_t1( 
+        aVariety ).LayoutLine();    
+    }
+
+
+    
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/laf/BMLayout4.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Layout definitions from Application LAF (call4/touch layouts)
+*
+*/
+
+
+
+#ifndef BMLAYOUT4_H
+#define BMLAYOUT4_H
+
+// INCLUDES
+#include <calslbs.h>
+#include <bldvariant.hrh> 
+#include <AknLayoutDef.h>
+
+/**
+* Layout coordinates from Application LAF
+* 
+* @lib      bubblemanager.lib
+* @since    S60 v5.0
+*/
+class BubbleLayout4
+    {
+    public:
+        ///////////////////////////////////////////////////////////////////////
+        // Utils 
+        ///////////////////////////////////////////////////////////////////////
+        static void button_grid_row_column_count( 
+            TInt  aVariety,
+            TInt& aRows, 
+            TInt& aColumns );
+     
+    public:
+        ///////////////////////////////////////////////////////////////////////
+        // LAF Table 1.1: Main call4 pane contents 
+        ///////////////////////////////////////////////////////////////////////
+        static const TAknWindowLineLayout 
+            call4_windows_pane( TInt aVariety );
+            
+        static const TAknWindowLineLayout 
+            call4_button_grid_pane( TInt aVariety );
+            
+        static const TAknWindowLineLayout 
+            call4_image_pane( TInt aVariety );            
+            
+        ///////////////////////////////////////////////////////////////////////
+        // LAF Table 1.2: Call4 windows pane contents 
+        ///////////////////////////////////////////////////////////////////////                        
+        static const TAknWindowLineLayout 
+            popup_call4_audio_first_window( TInt aVariety );
+            
+        static const TAknWindowLineLayout 
+            popup_call4_audio_second_window( TInt aVariety );            
+            
+        static const TAknWindowLineLayout 
+            popup_call4_audio_in_window( TInt aVariety );
+            
+        static const TAknWindowLineLayout 
+            popup_call4_audio_wait_window( TInt aVariety );                        
+        
+        static const TAknWindowLineLayout 
+            popup_call4_audio_conference_window( TInt aVariety );
+            
+        ///////////////////////////////////////////////////////////////////////
+        // LAF Table 1.3: Call4 windows conf pane contents 
+        ///////////////////////////////////////////////////////////////////////
+        static const TAknWindowLineLayout 
+            popup_call4_audio_conference_window_pane( TInt aVariety, 
+                                                      TInt aRow );
+        static const TAknWindowLineLayout 
+            popup_call4_conf_pane_background();
+            
+        static const TAknWindowLineLayout 
+            popup_call4_conf_cli_list();
+            
+        static const TAknWindowLineLayout 
+            popup_call4_conf_single_list_graphic_pane( TInt aRow );            
+        
+        static const TAknWindowLineLayout 
+            popup_call4_conf_single_list_highlight_pane();
+            
+        static const TAknWindowLineLayout 
+            popup_call4_conf_single_list_pane_call_status_icon();
+            
+        static const TAknWindowLineLayout 
+            popup_call4_conf_single_list_pane_ciphering_icon();
+            
+        static const TAknTextLineLayout 
+            popup_call4_conf_single_list_pane_cli_text();                                                      
+            
+        ///////////////////////////////////////////////////////////////////////
+        // LAF Table 1.4: Grid call4 button pane contents
+        ///////////////////////////////////////////////////////////////////////
+        static const TAknWindowLineLayout 
+            cell_call4_button_pane( TInt aVariety, TInt aCol, TInt aRow );
+            
+        ///////////////////////////////////////////////////////////////////////
+        // LAF Table 1.5: Cell call4 button pane contents
+        ///////////////////////////////////////////////////////////////////////
+        static const TAknWindowLineLayout 
+            button_call4_background_graphics( TInt aVariety );
+            
+        static const TAknWindowLineLayout 
+            button_call4_function_graphics( TInt aVariety );
+            
+        static const TAknTextLineLayout 
+            button_call4_function_text( TInt aVariety );            
+    };
+
+#endif      // BMLAYOUT4_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/laf/BMLayout6.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,222 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Layout definitions from Application LAF (Call4 layouts)
+*
+*/
+
+
+#include "BMLayout6.h"
+#include "BMPanic.h"
+#include "BMBubbleManager.h"
+#include <aknenv.h>
+#include <applayout.cdl.h>
+#include <aknutils.h>
+#include <aknlayout2scalabledef.h>
+#include <aknlayoutscalable_apps.cdl.h>
+#include <layoutmetadata.cdl.h>
+
+
+
+
+
+const TAknWindowLineLayout
+    BubbleLayout6::call6_button_grp_pane( TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        // portrait 0 == landscape 1
+        aVariety += 1;              
+        } 
+        
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::call6_btn_grp_pane_ParamLimits( aVariety );
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::call6_btn_grp_pane( 
+        aVariety ).LayoutLine();
+    }
+
+
+// -----------------------------------------------------------------------------
+// BubbleLayout6::button_grp_row_column_count
+// -----------------------------------------------------------------------------
+//
+void BubbleLayout6::button_grp_row_column_count( 
+    TInt  aVariety,
+    TInt& aRows, 
+    TInt& aColumns )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        // portrait 0 == landscape 1 
+        aVariety += 1;              
+        }
+        
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::cell_call6_btn_pane_ParamLimits( aVariety );
+    aRows = parLimits.LastRow() + 1;        
+    aColumns = parLimits.LastColumn() + 1;        
+    }
+
+
+// -----------------------------------------------------------------------------
+// BubbleLayout6::cell_call4_button_pane
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout6::cell_call6_button_pane( TInt aVariety, TInt aCol, TInt aRow )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        // portrait 0 == landscape 1
+        aVariety += 1;              
+        }
+    
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::cell_call6_btn_pane_ParamLimits( aVariety );
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::cell_call6_btn_pane( 
+        aVariety, aCol, aRow ).LayoutLine();    
+    }
+
+const TAknTextLineLayout 
+    BubbleLayout6::button_call6_function_text( TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        // portrait 0 == landscape 1 
+        aVariety += 1;              
+        }
+
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::cell_call6_btn_pane_ParamLimits( 
+            aVariety );
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::cell_call6_btn_pane_t1( aVariety ).LayoutLine();    
+    }
+
+
+// -----------------------------------------------------------------------------
+// BubbleLayout6::button_call6_function_graphics
+// -----------------------------------------------------------------------------
+//            
+const TAknWindowLineLayout 
+    BubbleLayout6::button_call6_function_graphics( TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        // portrait 0 == landscape 1 
+        aVariety += 1;              
+        }
+    
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::cell_call6_btn_pane_ParamLimits( 
+            aVariety );
+    
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::cell_call6_btn_pane_g1( 
+        aVariety ).LayoutLine();    
+    }
+
+const TAknWindowLineLayout
+    BubbleLayout6::call6_windows_pane( TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        // portrait 0 == landscape 1
+        aVariety += 1;              
+        } 
+        
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::call6_pane_g1_ParamLimits( aVariety );
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::call6_pane_g1( 
+        aVariety ).LayoutLine();
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout6::button_call6_background_graphics
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout6::button_call6_background_graphics( TInt aVariety )
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        // portrait 0 == landscape 1  
+        aVariety += 1;              
+        }        
+         
+    return AknLayoutScalable_Apps::bg_button_pane_cp15( 
+        aVariety ).LayoutLine();    
+    }
+
+// -----------------------------------------------------------------------------
+// BubbleLayout6::popup_call6_audio_first_window
+// -----------------------------------------------------------------------------
+//
+const TAknWindowLineLayout 
+    BubbleLayout6::popup_call6_audio_first_window( TInt aVariety )
+    {
+    
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        // portrait 0 == landscape 1
+        aVariety += 1;              
+        }    
+    
+    TAknLayoutScalableParameterLimits parLimits =
+        AknLayoutScalable_Apps::popup_call6_1st_window_ParamLimits( 
+            aVariety );
+        
+    if ( aVariety < parLimits.FirstVariety() || 
+         aVariety > parLimits.LastVariety() )
+        {
+        Panic( EBMPanicLAF );
+        }   
+        
+    return AknLayoutScalable_Apps::popup_call6_1st_window( 
+        aVariety ).LayoutLine();    
+    }
+ 
+ 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/laf/BMLayout6.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Layout definitions from Application LAF (call4/touch layouts)
+*
+*/
+#ifndef BMLAYOUT6_H_
+#define BMLAYOUT6_H_
+
+
+#include <calslbs.h>
+#include <bldvariant.hrh> 
+#include <aknlayoutdef.h>
+/**
+* Layout coordinates from Application LAF
+* 
+* @lib      bubblemanager.lib
+* @since    S60 9.2
+*/
+class BubbleLayout6
+    {
+    public:
+        
+        
+        static const TAknWindowLineLayout call6_button_grp_pane( TInt aVariety );
+        
+        static void button_grp_row_column_count( TInt  aVariety, TInt& aRows, TInt& aColumns );
+        
+        static const TAknWindowLineLayout cell_call6_button_pane( TInt aVariety, TInt aCol, TInt aRow );
+        
+        static const TAknTextLineLayout button_call6_function_text( TInt aVariety );
+        
+        static const TAknWindowLineLayout button_call6_function_graphics( TInt aVariety );
+        
+        static const TAknWindowLineLayout call6_windows_pane( TInt aVariety );
+        
+        static const TAknWindowLineLayout button_call6_background_graphics( TInt aVariety );
+        
+        static const TAknWindowLineLayout popup_call6_audio_first_window( TInt aVariety );
+        
+    };
+
+#endif /* BMLAYOUT6_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/BubbleManager/rom/Bubblemanager.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* 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:  IBY file for BubbleManager
+*
+*/
+
+
+#ifndef BUBBLEMANAGER_IBY
+#define BUBBLEMANAGER_IBY
+
+
+file=ABI_DIR\BUILD_DIR\BUBBLEMANAGER.dll            SHARED_LIB_DIR\BubbleManager.dll
+data=DATAZ_\RESOURCE_FILES_DIR\BUBBLEMANAGER.rsc   RESOURCE_FILES_DIR\BUBBLEMANAGER.rsc
+SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,BubbleManager)
+
+data=ZSYSTEM\install\bubblemanager_stub.sis    System\Install\bubblemanager_stub.sis
+
+#endif // BUBBLEMANAGER_IBY
+
+//  End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ConnectUtil/data/101F8625.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 8625 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECom resource file for connection utility.
+*
+*/
+
+
+
+//  INCLUDES
+#include    <registryinfov2.rh>
+#include    "CoUtlInterface.hrh"
+
+//  RESOURCE DEFINITIONS 
+
+// -----------------------------------------------------------------------------
+//   
+// theInfo
+// ECOM registry information - defined as ROM only.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE REGISTRY_INFO theInfo
+    {
+    resource_format_version = RESOURCE_FORMAT_VERSION_2;
+
+    dll_uid = KCoUtlImplementationUid;
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KCoUtlInterfaceUid;
+            implementations = 
+            {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = KCoUtlImplementationUid;
+                    version_no = 1;
+                    display_name = "Connection utility";
+                    default_data = "default";
+                    opaque_data = "";
+                    rom_only = 1;
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ConnectUtil/data/connectutil.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains all the resources 
+*                for the Connection utility.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME     COUT
+
+//  INCLUDES
+#include <eikon.rh>
+#include <avkon.rh>
+#include <avkon.hrh>
+#include <avkon.rsg>
+#include <avkon.loc>
+
+#include <connectutil.loc>
+
+
+//  RESOURCE DEFINITIONS 
+
+// -----------------------------------------------------------------------------
+//
+//    RSS_SIGNATURE
+//    Signature.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE { }
+
+// -----------------------------------------------------------------------------
+//
+//    r_coutl_confirm_one_connection
+//    Text for confirming termination of one connection.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_coutl_confirm_one_connection
+    {
+    buf = qtn_dea_gprs_disconnect_single;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_coutl_confirm_connections
+//    Text for confirming termination of multiple connections.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_coutl_confirm_connections
+    {
+    buf = qtn_dea_gprs_disconnect_many;
+    }
+
+// End of File
Binary file phoneuis/ConnectUtil/data/connectutil_stub.SIS has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ConnectUtil/data/connectutil_stub.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,34 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing connectutil stub.
+;
+; connectutil_stub.pkg
+
+; Languages
+&EN
+
+; Header
+#{"connectutil"},(0x101F8625),1,0,0,TYPE=SA
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+; Target
+
+""-"z:\sys\bin\connectutil.dll"
+""-"z:\resource\ConnectUtilrsc.rsc"
+""-"z:\resource\plugins\ConnectUtil.rsc"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ConnectUtil/group/ConnectUtil.mmp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2003-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification for connection utility.
+*
+*/
+
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+// Capability assignment.
+CAPABILITY CAP_ECOM_PLUGIN
+
+TARGET          connectutil.dll
+TARGETTYPE      PLUGIN
+UID             0x10009D8D 0x101F8625
+
+SOURCEPATH      ../src
+SOURCE          CCoUtlImplementation.cpp
+SOURCE          CoUtlMain.cpp
+SOURCE          CCoUtlActive.cpp
+
+SOURCEPATH      ../data
+START RESOURCE 101F8625.rss
+TARGET connectutil.rsc
+END
+
+START RESOURCE connectutil.rss
+DEPENDS avkon.rsg
+TARGET connectutilrsc.rsc
+TARGETPATH RESOURCE_FILES_DIR
+HEADER
+LANGUAGE_IDS
+END
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../src
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   ../../../inc
+
+LIBRARY         cone.lib
+LIBRARY         euser.lib
+LIBRARY         ecom.lib
+LIBRARY         etel.lib
+LIBRARY         etelmm.lib
+LIBRARY         etelpckt.lib
+LIBRARY         connmon.lib
+LIBRARY         aknnotify.lib
+LIBRARY         commonengine.lib
+LIBRARY         avkon.lib
+LIBRARY         efsrv.lib
+
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ConnectUtil/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* 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:  Build information specification for connection utility.
+*
+*/
+
+#include  <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../inc/CCoUtlInterface.h        |../../../inc/ccoutlinterface.h
+../inc/CCoUtlInterface.inl      |../../../inc/ccoutlinterface.inl
+../inc/CoUtlInterface.hrh       |../../../inc/coutlinterface.hrh
+
+../data/connectutil_stub.SIS    /epoc32/data/z/system/install/connectutil_stub.sis
+
+../rom/connectutil.iby          CORE_APP_LAYER_IBY_EXPORT_PATH(connectutil.iby)
+../rom/connectutilResources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(connectutilResources.iby)
+../loc/connectutil.loc          APP_LAYER_LOC_EXPORT_PATH(connectutil.loc)
+
+PRJ_MMPFILES
+../group/ConnectUtil.mmp
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ConnectUtil/inc/CCoUtlActive.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,385 @@
+/*
+* Copyright (c) 2003-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:  Implementation of connection termination plug-in.
+*
+*/
+
+
+
+#ifndef CCOUTLACTIVE_H
+#define CCOUTLACTIVE_H
+
+//  INCLUDES
+#include    <CCoUtlInterface.h>
+#include    <etel.h>
+#include    <etelmm.h>
+#include    <etelpckt.h>
+#include    <rconnmon.h>
+
+// FORWARD DECLARATION
+class CAknGlobalConfirmationQuery;
+
+// CLASS DECLARATION
+
+/**
+*  CCoUtlInterface implementation.
+*
+*  @since 2.6
+*/
+class CCoUtlActive 
+    : public CActive,
+      public MConnectionMonitorObserver
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Constructor.
+        */
+        CCoUtlActive();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CCoUtlActive();
+
+    public: // New functions
+
+        /**
+        * Enumerates state of the operation.
+        */
+        enum TState
+            {
+            EIdle,
+            EStarted,
+            ECheckIfAttached,
+            ECheckIfNetworkModeIII,
+            EStopConnectionsAndDetach,
+            EGetConnectionCount,
+            EGoThroughConnections,
+            EGoThroughConnectionsGetBearer,
+            EGoThroughConnectionsGetStatus,
+            ECheckConnectionCount,
+            ECheckDetachRequired, 
+            EStopConnectionsAndCheckDetachRequired, 
+            EConfirmAllConnectionsTermination,
+            EGetBearerThenNameThenConfirmTermination,
+            EGetNameThenConfirmTermination,
+            EDetach
+            };
+
+        /**
+        * Returns current state.
+        * @return current state.
+        */
+        TState CurrentState() const;
+
+        /**
+        * Starts termination.
+        * @param aStatus request to be completed once finished.
+        */
+        void Start( TRequestStatus& aStatus );
+
+    public: // Functions from base classes
+
+        /**
+        * From CActive, handles completion of current operation.
+        */
+        virtual void RunL();
+
+        /**
+        * From CActive, cancels ongoing asynchronous operation.
+        */
+        virtual void DoCancel();
+
+        /**
+        * From CActive, handles errors from CActive.
+        * @param aError error to be handled.
+        * @return error to be passed to scheduler.
+        */
+        virtual TInt RunError( TInt aError );
+        
+        /**
+        * From MConnectionMonitorObserver, receive notifications.
+        */
+        void EventL( const CConnMonEventBase &aConnMonEvent );
+        
+    private:
+
+        /**
+        * Gets attach status.
+        */
+        void GetAttachStatusL();
+
+        /**
+        * Gets network mode.
+        */
+        void GetNetworkModeL();
+
+        /**
+        * Stop connections and detach.
+        */
+        void StopConnectionsAndDetachL();
+
+        /**
+        * Gets number of connections.
+        */
+        void GetConnectionCountL();
+
+        /**
+        * Goes through connections.
+        */
+        void CheckConnectionsL();
+
+        /**
+        * Goes through connections - get bearer.
+        */
+        void GoThroughConnectionsGetBearerL();
+
+        /**
+        * Goes through connections - get status.
+        */
+        void GoThroughConnectionsGetStatusL();
+
+        /**
+        * Gets attach mode - detach if required, 
+        * i.e. attach mode is 'on demand'.
+        */
+        void GetAttachModeAndDetachIfRequiredL();
+        
+        /**
+        * Confirms all connections termination.
+        */
+        void ConfirmAllConnectionsTerminationL();
+
+        /**
+        * Gets bearer of the connection.
+        */
+        void GetBearerThenNameThenConfirmTerminationL();
+
+        /**
+        * Gets name of connection.
+        */
+        void GetNameThenConfirmTerminationL();
+
+        /**
+        * Confirms termination.
+        * @param aAmount amount of connections.
+        */
+        void ConfirmTerminationL( TInt aAmount );
+
+        /**
+        * Confirms termination.
+        * @param aName name of connection.
+        */
+        void ConfirmTerminationL( const TDesC& aName );
+
+        /**
+        * Confirms termination.
+        * @param aText text shown in query.
+        */
+        void DoConfirmTerminationL( const TDesC& aText );
+
+        /**
+        * Stop all connections and detach if required.
+        */
+        void StopAllConnectionsAndDetachIfRequiredL();
+
+        /**
+        * Stops all connections.
+        * @return error code.
+        */
+        TInt DoStopAllConnectionsL();
+
+        /**
+        * Detaches from network.
+        */
+        void DetachL();
+
+        /**
+        * Checks if attached.
+        * @return EFalse if not attached. Otherwise ETrue.
+        */
+        inline TBool IsAttached() const;
+
+        /**
+        * Checks if current network mode is III.
+        * @return ETrue if operating in network mode III.
+        *         Otherwise EFalse.
+        */
+        inline TBool IsNetworkModeIII() const;
+
+        /**
+        * Returns ETrue if there are connections.
+        * @return ETrue if there are connections.
+        *         Otherwise EFalse.
+        */
+        inline TBool IsConnections() const;
+
+        /**
+        * Returns ETrue if bearer is GPRS.
+        * @return ETrue if bearer is GPRS.
+        *         Otherwise EFalse.
+        */
+        inline TBool AcceptConnectionBearer() const;
+
+        /**
+        * Returns ETrue if connection is active.
+        * @return ETrue if connection is active.
+        *         Otherwise EFalse.
+        */
+        inline TBool IsConnectionActive() const;
+
+        /**
+        * Returns ETrue if attach mode is 'on demand'.
+        * @return ETrue if attach mode is 'on demand'.
+        *         Otherwise EFalse.
+        */
+        inline TBool IsAttachModeOnDemand() const;
+
+        /**
+        * Returns ETrue if user confirmed connection termination.
+        * @return ETrue if termination has been confirmed.
+        *         Otherwise EFalse.
+        */
+        inline TBool IsConfirmed() const;
+
+        /**
+        * Returns telephony server session.
+        * @return ETel session.
+        */
+        inline RTelServer& TelServerL();
+
+        /**
+        * Returns mobile phone.
+        * @return phone subsession.
+        */
+        inline RMobilePhone& MobilePhoneL();
+
+        /**
+        * Returns packet service.
+        * @return packet service subsession.
+        */
+        inline RPacketService& PacketServiceL();
+
+        /**
+        * Returns connection monitor.
+        * @return connection monitor session.
+        */
+        inline RConnectionMonitor& ConnectionMonitorL();
+
+        /**
+        * Completes client's request with aErrorCode code.
+        * @param aErrorCode error code.
+        */
+        void CompleteRequest( TInt aErrorCode );
+
+        /**
+        * Go to specified state.
+        * @param aNewState new state.
+        */ 
+        inline void GoToState( TState aNewState );
+
+        /**
+        * Go to specified state and complete - operation
+        * continues with next RunL call.
+        * @param aNewState new state.
+        * @param aError error code, KErrNone by default.
+        */
+        inline void GoToStateAndComplete( 
+            TState aNewState,
+            TInt aError = KErrNone );
+
+    private:    // Data
+        
+        // Current state.
+        TState iState;
+
+        // Packet service status.
+        TInt iServiceStatus;
+
+        // Packet service current class.
+        RPacketService::TMSClass iCurrentClass;
+
+        // Packet service max class.
+        RPacketService::TMSClass iMaxClass;
+
+        // Packet service attach mode.
+        RPacketService::TAttachMode iAttachMode;
+
+        // Amount of connections.
+        TUint iConnectionCount;
+
+        // Telephony server session.
+        /***************************************************** 
+        *   Series 60 Customer / ETel 
+        *   Series 60  ETel API 
+        *****************************************************/
+        RTelServer iServer;
+
+        // Owned mobile phone subsession.
+        /***************************************************** 
+        *   Series 60 Customer / ETel 
+        *   Series 60  ETel API 
+        *****************************************************/
+        RMobilePhone iMobilePhone;
+
+        // Owned packet service subsession.
+        /***************************************************** 
+        *   Series 60 Customer / ETel 
+        *   Series 60  ETel API 
+        *****************************************************/
+        RPacketService iPacketService;
+
+        // Owned connection monitor session.
+        RConnectionMonitor iConnectionMonitor;
+
+        struct TConnectionId
+            {
+            TUint iConnectionId;
+            TUint iSubConnectionId;
+            };
+
+        // Owned array of connection ids.
+        RArray< TConnectionId > iConnections;
+
+        // Current index in connections array.
+        TInt iConnectionsIndex;
+        
+        // Connection bearer .
+        TInt iConnectionBearer;
+
+        // Connection status.
+        TInt iConnectionStatus;
+
+        // Connection name.
+        TName iConnectionName;
+
+        // Owned confirmation query.
+        CAknGlobalConfirmationQuery* iConfirmationQuery;
+
+        // Owned text in confirmation query.
+        HBufC* iConfirmationText;
+
+        // Ref to request status to be completed. NULL if
+        // operation is not ongoing.
+        TRequestStatus* iRequestStatus;
+
+        //WCDMA connection status.
+        TInt iWcdmaConnectionStatus;
+
+    };
+
+#endif      // CCOUTLACTIVE_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ConnectUtil/inc/CCoUtlImplementation.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,94 @@
+/*
+* 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:  Implementation of connection termination plug-in.
+*
+*/
+
+
+
+#ifndef CCOUTLIMPLEMENTATION_H
+#define CCOUTLIMPLEMENTATION_H
+
+//  INCLUDES
+#include    <CCoUtlInterface.h>
+#include    <ConeResLoader.h>
+
+// FORWARD DECLARATION
+class CCoUtlActive;
+
+// CLASS DECLARATION
+
+/**
+*  CCoUtlInterface implementation.
+*
+*  @since 2.6
+*/
+class CCoUtlImplementation 
+    : public CCoUtlInterface
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        * @return an instance of CCoUtlImplementation.
+        */
+        static CCoUtlImplementation* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CCoUtlImplementation();
+
+    public: // Functions from base classes
+
+        /**
+        * @see CCoUtlInterface::CurrentState.
+        */
+        virtual TState CurrentState();
+
+        /**
+        * @see CCoUtlInterface::Terminate.
+        */
+        virtual void Terminate( TRequestStatus& aStatus );
+    
+        /**
+        * @see CCoUtlInterface::Cancel.
+        */
+        virtual void Cancel();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CCoUtlImplementation();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+
+        // Owned active object to do the task.
+        CCoUtlActive* iActive;
+
+        // Owned resource loader.
+        RConeResourceLoader iResourceLoader;
+
+    };
+
+#endif      // CCOUTLIMPLEMENTATION_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ConnectUtil/inc/CCoUtlInterface.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,93 @@
+/*
+* 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:  Provides abstract ECOM interface for connection utility.
+*
+*/
+
+
+
+#ifndef CCOUTLINTERFACE_H
+#define CCOUTLINTERFACE_H
+
+//  INCLUDES
+#include    <e32base.h>
+
+// CLASS DECLARATION
+
+/**
+*  Abstract ECOM interface for connection termination.
+*
+*  @since 2.6
+*/
+class CCoUtlInterface 
+    : public CBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        inline static CCoUtlInterface* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CCoUtlInterface();
+
+    public: // New functions
+        
+        /**
+        * Enumerates states.
+        *
+        * EIdle - idle, 
+        * EConfirm - asking for user decision,
+        * ETerminate - terminating
+        */
+        enum TState
+            {
+            EIdle,
+            EConfirm,
+            ETerminate
+            };
+
+        /**
+        * Returns current state.
+        * @return current state.
+        */
+        virtual TState CurrentState() = 0;
+
+        /**
+        * Terminates connections.
+        * @param aStatus request status to be completed once
+        *                finished.
+        */
+        virtual void Terminate( TRequestStatus& aStatus ) = 0;
+    
+        /**
+        * Interrupts termination. 
+        */
+        virtual void Cancel() = 0;
+
+    private:    // Data
+        
+        // Uid required by ECOM.
+        TUid iDtor_ID_Key;
+
+    };
+
+#include    <CCoUtlInterface.inl>
+
+#endif      // CCOUTLINTERFACE_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ConnectUtil/inc/CCoUtlInterface.inl	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* 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:  Inline functions for CCoUtlInterface class.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    <ecom/ecom.h>
+#include    <CoUtlInterface.hrh>
+
+// CONSTANTS
+_LIT8( KCoUtlResolverData, "default" );
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CCoUtlInterface::NewL
+// ECom is used to create instance.
+// -----------------------------------------------------------------------------
+//
+inline CCoUtlInterface* CCoUtlInterface::NewL()
+    {
+    const TUid KCoUtlInterfaceDefinitionUid = 
+        { KCoUtlInterfaceUid };
+
+    TEComResolverParams params;
+    params.SetDataType( KCoUtlResolverData );
+    params.SetWildcardMatch( EFalse );
+
+    TAny* ptr = 
+        REComSession::CreateImplementationL(
+            KCoUtlInterfaceDefinitionUid,
+            _FOFF( CCoUtlInterface, iDtor_ID_Key ), 
+            params,
+            KRomOnlyResolverUid );
+
+    return reinterpret_cast< CCoUtlInterface* >( ptr );
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlInterface::~CCoUtlInterface
+// ECom is used to delete instance..
+// -----------------------------------------------------------------------------
+//
+inline CCoUtlInterface::~CCoUtlInterface()
+    {
+    REComSession::DestroyedImplementation( iDtor_ID_Key );
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ConnectUtil/inc/CoUtlInterface.hrh	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* 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:  Defines UIDs used.
+*
+*/
+
+
+#ifndef CONNECTIONUTILITY_HRH
+#define CONNECTIONUTILITY_HRH
+
+// MACROS
+
+// Connection utility interface uid
+#define KCoUtlInterfaceUid 0x101F8624
+
+// Connection utility implementation uid
+#define KCoUtlImplementationUid 0x101F8625
+
+#endif // CONNECTIONUTILITY_HRH
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ConnectUtil/loc/connectutil.loc	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,38 @@
+/*
+* 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 localised strings for 
+*                Connection utility.
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+// d: When long End key is pressed and there is one GPRS connection
+// d: ongoing, a confirmation query with this text is shown. %U is replaced
+// d: with name of the connection.
+// l: popup_note_window
+//
+#define qtn_dea_gprs_disconnect_single "End packet data connection '%U'?"
+
+// d: When long End key is pressed and there are more than one GPRS connections
+// d: ongoing, a confirmation query with this text is shown. %N is replaced
+// d: with the amount of connections.
+// l: popup_note_window
+//
+#define qtn_dea_gprs_disconnect_many "End all %N packet data connections?"
+
+//  End of File  
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ConnectUtil/rom/connectutil.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  IBY file for connection utility.
+*
+*/
+
+
+#ifndef __CONNECTUTIL_IBY__
+#define __CONNECTUTIL_IBY__
+
+REM Connection utility
+ECOM_PLUGIN(ConnectUtil.dll,101F8625.rsc)
+
+data=ZSYSTEM\install\connectutil_stub.sis    System\Install\connectutil_stub.sis
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ConnectUtil/rom/connectutilResources.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -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 for connection utility.
+*
+*/
+
+
+#ifndef __CONNECTUTIL_RESOURCES_IBY__
+#define __CONNECTUTIL_RESOURCES_IBY__
+
+data=ZRESOURCE\ConnectUtilrsc.rsc                                       RESOURCE_FILES_DIR\ConnectUtilrsc.rsc
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ConnectUtil/src/CCoUtlActive.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,938 @@
+/*
+* 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:  Implementation of CCoUtlActive.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CCoUtlActive.h"
+#include    <mmtsy_names.h>
+#include    <nifvar.h>
+#include    <pcktcs.h>
+#include    <AknGlobalConfirmationQuery.h>
+#include    <AknUtils.h>
+#include    <StringLoader.h>
+#include    <ConnectUtilRsc.rsg>
+#include    <avkon.hrh>
+#include    <e32property.h>
+#include    <PSVariables.h>
+
+
+
+// CONSTANTS
+
+// Panic category.
+_LIT( KCoUtlPanicCategory, "CoUtl" );
+
+// Enumerates panic reasons
+enum 
+    {
+    // Terminate is already called and operation has not been completed yet. 
+    // Cancel before calling Terminate.
+    ECoUtlPanicTerminateAlreadyActive = 0
+    };
+
+// MACROS
+
+#if defined _DEBUG && !defined __WINS__
+// Target UDEB environment - debug traces enabled
+
+#define COUTL_RDEBUG(X)             RDebug::Print(X);
+#define COUTL_RDEBUG_INT(X,Y)       RDebug::Print(X,Y);
+
+#else           
+// Other environments - debug traces disabled
+
+#define COUTL_RDEBUG(X)
+#define COUTL_RDEBUG_INT(X,Y)
+
+#endif
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::CCoUtlActive
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CCoUtlActive::CCoUtlActive()
+    : CActive( CActive::EPriorityStandard )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::~CCoUtlActive
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+/***************************************************** 
+*   Series 60 Customer / ETel 
+*   Series 60  ETel API 
+*****************************************************/
+CCoUtlActive::~CCoUtlActive()
+    {
+    Cancel();
+
+    if ( iServer.Handle() )
+        {
+        // Error is ignored - loading might have failed.
+        iServer.UnloadPhoneModule( KMmTsyModuleName ); 
+        }
+
+    delete iConfirmationQuery;
+    delete iConfirmationText;
+
+    iConnections.Close();
+    iPacketService.Close();
+    iMobilePhone.Close();
+    iServer.Close();
+    iConnectionMonitor.CancelNotifications();
+    iConnectionMonitor.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::CurrentState
+// -----------------------------------------------------------------------------
+//
+CCoUtlActive::TState CCoUtlActive::CurrentState() const
+    {
+    return iState;
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::Start
+// -----------------------------------------------------------------------------
+//
+void CCoUtlActive::Start( TRequestStatus& aStatus )
+    {
+    if ( !IsActive() )
+        {
+        aStatus = KRequestPending;
+        iRequestStatus = &aStatus;
+        GoToStateAndComplete( EStarted );
+        }
+    else
+        {
+        User::Panic( KCoUtlPanicCategory, ECoUtlPanicTerminateAlreadyActive );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::RunL
+// -----------------------------------------------------------------------------
+//
+void CCoUtlActive::RunL()
+    {
+    COUTL_RDEBUG_INT( _L("CCoUtlActive::RunL - State %d: "), iState )
+    COUTL_RDEBUG_INT( _L("CCoUtlActive::RunL - Status %d: "), iStatus.Int() )
+
+    // Clean up parameters that might require uninitialisation.
+    delete iConfirmationQuery;
+    iConfirmationQuery = NULL;
+
+    delete iConfirmationText;
+    iConfirmationText = NULL;
+
+    // Leave in case of error.
+    User::LeaveIfError( iStatus.Int() );
+
+    // Handle state transitions.
+    switch ( iState )
+        {
+        case EStarted:
+            iConnections.Reset();
+            GetAttachStatusL();
+            break;
+
+        case ECheckIfAttached:
+            if ( IsAttached() )
+                {
+                GetConnectionCountL();
+                }
+            break;
+        
+        case EGetConnectionCount:
+            iConnectionsIndex = 0;
+            CheckConnectionsL();
+            break;
+
+        case EGoThroughConnections:
+            if ( iConnectionsIndex < iConnections.Count() )
+                {
+                GoThroughConnectionsGetBearerL();
+                }
+            else
+                {
+                GetNetworkModeL();
+                }
+            break;
+        
+        case EGoThroughConnectionsGetBearer:
+            if ( AcceptConnectionBearer() )
+                {
+                GoThroughConnectionsGetStatusL();
+                }
+            else
+                {
+                // Not accepted - delete and continue to the next.
+                iConnections.Remove( iConnectionsIndex );
+                GoToStateAndComplete( EGoThroughConnections );
+                }
+            break;
+
+        case EGoThroughConnectionsGetStatus:
+            if ( !IsConnectionActive() )
+                {
+                // Not accepted - delete and continue to the next.
+                iConnections.Remove( iConnectionsIndex );
+                }
+            else
+                {
+                // Accepted, go to next one.
+                iConnectionsIndex++;
+                }
+
+            GoToStateAndComplete( EGoThroughConnections );
+            break;
+
+        case ECheckIfNetworkModeIII:
+            if ( IsNetworkModeIII() )
+                {
+                StopConnectionsAndDetachL();
+                }
+            else
+                {
+                GoToStateAndComplete( ECheckConnectionCount );
+                }
+            break;
+
+        case EStopConnectionsAndDetach:
+            DetachL();
+            break;
+
+        case ECheckConnectionCount:
+            if ( !IsConnections() )
+                {
+                GetAttachModeAndDetachIfRequiredL();
+                }
+            else 
+                {
+                ConfirmAllConnectionsTerminationL();
+                }
+            break;
+
+        case EStopConnectionsAndCheckDetachRequired:
+            GetAttachModeAndDetachIfRequiredL();
+            break;
+
+        case ECheckDetachRequired:
+            if ( IsAttachModeOnDemand() )
+                {
+                DetachL();
+                }
+            break;
+
+        case EGetBearerThenNameThenConfirmTermination:
+            GetNameThenConfirmTerminationL();
+            break;
+
+        case EGetNameThenConfirmTermination:
+            ConfirmTerminationL( iConnectionName );
+            break;
+
+        case EConfirmAllConnectionsTermination:
+            if ( IsConfirmed() )
+                {
+                StopAllConnectionsAndDetachIfRequiredL();
+                }
+            break;
+
+        case EDetach:
+        case EIdle:
+        default:
+            break;
+        }
+
+    if ( !IsActive() )
+        {
+        // Operation has been finished.
+        iState = EIdle;
+        CompleteRequest( KErrNone );
+        }
+
+    COUTL_RDEBUG_INT( _L("CCoUtlActive::RunL finished - %d: "), iState )
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::DoCancel
+// -----------------------------------------------------------------------------
+//
+/***************************************************** 
+*   Series 60 Customer / ETel 
+*   Series 60  ETel API 
+*****************************************************/
+void CCoUtlActive::DoCancel()
+    {
+    COUTL_RDEBUG_INT( _L("CCoUtlActive::DoCancel - %d: "), iState )
+    // Operation is canceled - cancel ongoing operation and 
+    // complete original request with the KErrCancel error code.
+
+    TInt packetServiceCancel = 0;
+    TInt connectionMonitorCancel = 0;
+
+    switch ( iState )
+        {
+        case ECheckIfNetworkModeIII:
+            packetServiceCancel = EPacketGetMSClass;
+            break;
+
+        case EGetConnectionCount:
+            connectionMonitorCancel = EConnMonGetConnectionCount;
+            break;
+
+        case EGoThroughConnectionsGetStatus:
+        case EGoThroughConnectionsGetBearer:
+        case EGetBearerThenNameThenConfirmTermination:
+            connectionMonitorCancel = EConnMonGetIntAttribute;
+            break;       
+
+        case ECheckDetachRequired:
+            packetServiceCancel = EPacketGetAttachMode;
+            break;
+        
+        case EGetNameThenConfirmTermination:
+            connectionMonitorCancel = EConnMonGetStringAttribute;
+            break;
+
+        case EConfirmAllConnectionsTermination:
+            if ( iConfirmationQuery )
+                {
+                iConfirmationQuery->CancelConfirmationQuery();
+                delete iConfirmationQuery;
+                iConfirmationQuery = NULL;
+
+                delete iConfirmationText;
+                iConfirmationText = NULL;
+                }
+            break;
+
+        case EDetach:
+            packetServiceCancel = EPacketDetach;
+            break;
+
+        case EIdle:
+        case EStarted:
+        case ECheckIfAttached:     
+        case EStopConnectionsAndDetach:
+        case EGoThroughConnections:
+        case ECheckConnectionCount:
+        case EStopConnectionsAndCheckDetachRequired:
+        default:
+            break;
+        }
+
+    if ( packetServiceCancel && iPacketService.SubSessionHandle() )
+        {
+        iPacketService.CancelAsyncRequest( packetServiceCancel );
+        }
+    if ( connectionMonitorCancel && iConnectionMonitor.Handle() )
+        {
+        iConnectionMonitor.CancelAsyncRequest( connectionMonitorCancel );
+        }
+
+    CompleteRequest( KErrCancel );
+    GoToState( EIdle );
+    
+    COUTL_RDEBUG( _L("CCoUtlActive::DoCancel finished") )
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::RunError
+// -----------------------------------------------------------------------------
+//
+TInt CCoUtlActive::RunError( TInt aError )
+    {
+    COUTL_RDEBUG_INT( _L("CCoUtlActive::RunError - %d: "), aError )
+
+    // Handles exceptions. Either operation has completed with aError code,
+    // or then exception has occured while performing RunL when state has
+    // been specified.
+    // However, RunL has been implemented in such a way that once asynchronous
+    // request has been made, then exception is not raised in that RunL.
+
+    switch ( iState )
+        {
+        case EStopConnectionsAndDetach:
+            // Try to move on.
+            GoToStateAndComplete( EDetach );
+            break;
+            
+        case EGoThroughConnectionsGetBearer:
+        case EGoThroughConnectionsGetStatus:
+            if ( aError == KErrNotFound && 
+                ( iConnectionsIndex < iConnections.Count() ) )
+                {
+                iConnections.Remove( iConnectionsIndex );
+                GoToStateAndComplete( EGoThroughConnections );
+                break;
+                }
+            //lint -fallthrough
+        case EStarted: 
+        case ECheckIfAttached:
+        case ECheckIfNetworkModeIII:
+        case EGetConnectionCount:
+        case EGoThroughConnections:
+        case ECheckConnectionCount:
+        case EGetBearerThenNameThenConfirmTermination:
+        case EGetNameThenConfirmTermination:
+        case EConfirmAllConnectionsTermination:
+        case EStopConnectionsAndCheckDetachRequired:
+        case EDetach:
+        case ECheckDetachRequired:
+        case EIdle:
+        default:
+            CompleteRequest( aError );
+            GoToState( EIdle );
+            break;
+        }
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::GetAttachStatusL
+// -----------------------------------------------------------------------------
+//
+void CCoUtlActive::GetAttachStatusL()
+    {
+    TInt status = KErrNone;
+    TInt statusWcdma = KErrNone;
+
+    //Fetch attach status from RProperty.
+    TInt error = RProperty::Get( KUidSystemCategory, KPSUidGprsStatusValue, status );
+    if ( error != KErrNone )
+        {
+        // On error, assume attached - connection monitor will inform
+        // detailed information.
+        status = EPSGprsAttach;
+        }
+    error = RProperty::Get( KUidSystemCategory, KPSUidWcdmaStatusValue, statusWcdma );
+    if ( error != KErrNone )
+        {
+        // On error, assume attached - connection monitor will inform
+        // detailed information.
+        statusWcdma = EPSWcdmaAttach;
+        }
+    iServiceStatus = status;
+    iWcdmaConnectionStatus = statusWcdma;
+    GoToStateAndComplete( ECheckIfAttached );
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::GetNetworkModeL
+// -----------------------------------------------------------------------------
+//
+void CCoUtlActive::GetNetworkModeL()
+    {
+    PacketServiceL().GetMSClass( iStatus, iCurrentClass, iMaxClass );
+    SetActive();
+    GoToState( ECheckIfNetworkModeIII );
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::StopConnectionsAndDetachL
+// -----------------------------------------------------------------------------
+//
+void CCoUtlActive::StopConnectionsAndDetachL()
+    {
+    TInt err = DoStopAllConnectionsL();
+    GoToStateAndComplete( 
+        EStopConnectionsAndDetach,
+        err );
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::GetConnectionCountL
+// -----------------------------------------------------------------------------
+//
+void CCoUtlActive::GetConnectionCountL()
+    {
+    GoToState( EGetConnectionCount );
+    ConnectionMonitorL().GetConnectionCount( iConnectionCount, iStatus );
+    SetActive();
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::CheckConnectionsL
+// -----------------------------------------------------------------------------
+//
+void CCoUtlActive::CheckConnectionsL()
+    {
+    RConnectionMonitor& monitor = ConnectionMonitorL();
+    iConnections.Reset();
+
+    // Go through all connections
+    // Note indexing from 1, 2, 3, .., iConnectionCount.
+    for ( TUint index = 1; index <= iConnectionCount; index++ )
+        {
+        TConnectionId id;
+        TUint subConnectionCount = 0;
+        
+        TInt err = 
+            monitor.GetConnectionInfo( 
+                index, 
+                id.iConnectionId, 
+                subConnectionCount );
+
+        // SubConnectionIds are not used.
+        id.iSubConnectionId = 0;
+
+        if ( err != KErrNotFound )
+            {
+            // the KErrNotFound error code indicates that connection has
+            // already been dropped, so those indices are simply ignored.
+            User::LeaveIfError( err );
+            User::LeaveIfError( iConnections.Append( id ) );
+            }
+        }
+
+    GoToStateAndComplete( EGoThroughConnections );
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::GoThroughConnectionsGetBearerL
+// -----------------------------------------------------------------------------
+//
+void CCoUtlActive::GoThroughConnectionsGetBearerL()
+    {
+    TConnectionId& current = iConnections[ iConnectionsIndex ];
+    ConnectionMonitorL().GetIntAttribute( 
+        current.iConnectionId,
+        current.iSubConnectionId,
+        KBearer,
+        iConnectionBearer,
+        iStatus );
+    SetActive();
+    GoToState( EGoThroughConnectionsGetBearer );
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::GoThroughConnectionsGetStatusL
+// -----------------------------------------------------------------------------
+//
+void CCoUtlActive::GoThroughConnectionsGetStatusL()
+    {
+    TConnectionId& current = iConnections[ iConnectionsIndex ];
+    ConnectionMonitorL().GetIntAttribute( 
+        current.iConnectionId,
+        current.iSubConnectionId,
+        KConnectionStatus,
+        iConnectionStatus,
+        iStatus );
+    SetActive();
+    GoToState( EGoThroughConnectionsGetStatus );
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::GetAttachModeAndDetachIfRequiredL
+// -----------------------------------------------------------------------------
+//
+void CCoUtlActive::GetAttachModeAndDetachIfRequiredL()
+    {
+    PacketServiceL().GetAttachMode( iStatus, iAttachMode );
+    SetActive();
+    GoToState( ECheckDetachRequired );
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::ConfirmAllConnectionsTerminationL
+// -----------------------------------------------------------------------------
+//
+void CCoUtlActive::ConfirmAllConnectionsTerminationL()
+    {
+    if ( iConnections.Count() == 1 ) // Exactly one connection
+        {
+        GetBearerThenNameThenConfirmTerminationL();
+        }
+    else
+        {
+        ConfirmTerminationL( iConnections.Count() );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::ConfirmTerminationL
+// -----------------------------------------------------------------------------
+//
+void CCoUtlActive::ConfirmTerminationL( TInt aAmount )
+    {
+    HBufC* text =
+        StringLoader::LoadLC( 
+            R_COUTL_CONFIRM_CONNECTIONS,
+            aAmount );
+
+    TPtr ptr = text->Des();
+    
+    // Convert digits in the string to correct digit type.
+    AknTextUtils::DisplayTextLanguageSpecificNumberConversion( ptr );
+
+    DoConfirmTerminationL( *text );
+    CleanupStack::Pop( text );
+    iConfirmationText = text;
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::ConfirmTerminationL
+// -----------------------------------------------------------------------------
+//
+void CCoUtlActive::ConfirmTerminationL( const TDesC& aName )
+    {
+    HBufC* text = 
+        StringLoader::LoadLC( 
+            R_COUTL_CONFIRM_ONE_CONNECTION,
+            aName );
+
+    DoConfirmTerminationL( *text );
+    CleanupStack::Pop( text );
+    iConfirmationText = text;
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::DoConfirmTerminationL
+// -----------------------------------------------------------------------------
+//
+void CCoUtlActive::DoConfirmTerminationL( const TDesC& aText )
+    {
+    CAknGlobalConfirmationQuery* confirmationQuery =
+        CAknGlobalConfirmationQuery::NewLC();
+    confirmationQuery->ShowConfirmationQueryL(
+        iStatus,
+        aText );
+    CleanupStack::Pop( confirmationQuery );
+    
+    SetActive();
+    iConfirmationQuery = confirmationQuery;
+    GoToState( EConfirmAllConnectionsTermination );
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::GetBearerThenNameThenConfirmTerminationL
+// -----------------------------------------------------------------------------
+//
+void CCoUtlActive::GetBearerThenNameThenConfirmTerminationL()
+    {
+    TConnectionId& id = iConnections[ 0 ]; // first
+    ConnectionMonitorL().GetIntAttribute( 
+        id.iConnectionId,
+        id.iSubConnectionId,
+        KBearer,
+        iConnectionBearer,
+        iStatus );
+    SetActive();
+    GoToState( EGetBearerThenNameThenConfirmTermination );
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::GetNameThenConfirmTerminationL
+// -----------------------------------------------------------------------------
+//
+void CCoUtlActive::GetNameThenConfirmTerminationL()
+    {
+    TConnectionId& id = iConnections[ 0 ]; // first
+
+    TUint attribute = KIAPName;
+    if ( iConnectionBearer == EBearerExternalGPRS || 
+         iConnectionBearer == EBearerExternalEdgeGPRS ||
+         iConnectionBearer == EBearerExternalWCDMA )
+        {
+        attribute = KAccessPointName;
+        }
+
+    ConnectionMonitorL().GetStringAttribute(
+        id.iConnectionId,
+        id.iSubConnectionId,
+        attribute,
+        iConnectionName,
+        iStatus );
+    SetActive();
+    GoToState( EGetNameThenConfirmTermination );
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::StopAllConnectionsAndDetachIfRequiredL
+// -----------------------------------------------------------------------------
+//
+void CCoUtlActive::StopAllConnectionsAndDetachIfRequiredL()
+    {
+    TInt err = DoStopAllConnectionsL();
+    GoToStateAndComplete( 
+        EStopConnectionsAndCheckDetachRequired,
+        err );
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::DoStopAllConnectionsL
+// -----------------------------------------------------------------------------
+//
+TInt CCoUtlActive::DoStopAllConnectionsL()
+    {
+    TInt err = KErrNone;
+
+    for ( TInt index = iConnections.Count() - 1; index >= 0; index-- )
+        {
+        const TConnectionId& id = iConnections[ index ];
+
+        TInt result = ConnectionMonitorL().SetBoolAttribute(
+            id.iConnectionId, id.iSubConnectionId, KConnectionStop, ETrue );
+        if ( result == KErrNotFound )
+            {
+            // the KErrNotFound error code is ignored, because connection
+            // may have been ended by another client.
+            result = KErrNone;
+            }
+
+        // Combine error codes.
+        err = Min( err, result );
+        }
+
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::DetachL
+// -----------------------------------------------------------------------------
+//
+void CCoUtlActive::DetachL()
+    {
+    PacketServiceL().Detach( iStatus );
+    SetActive();
+    GoToState( EDetach );
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::IsAttached
+// -----------------------------------------------------------------------------
+//
+inline TBool CCoUtlActive::IsAttached() const
+    {
+    return ( 
+        ( iServiceStatus != EPSGprsUnattached ) ||
+        ( iWcdmaConnectionStatus != EPSWcdmaUnattached ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::IsNetworkModeIII
+// -----------------------------------------------------------------------------
+//
+inline TBool CCoUtlActive::IsNetworkModeIII() const
+    {
+    return 
+        ( iCurrentClass == RPacketService::EMSClassAlternateMode ) || 
+        ( iCurrentClass == RPacketService::EMSClassPacketSwitchedOnly ) ||
+        ( iCurrentClass == RPacketService::EMSClassCircuitSwitchedOnly );
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::IsConnections
+// -----------------------------------------------------------------------------
+//
+inline TBool CCoUtlActive::IsConnections() const
+    {
+    return iConnections.Count();
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::AcceptConnectionBearer
+// -----------------------------------------------------------------------------
+//
+inline TBool CCoUtlActive::AcceptConnectionBearer() const
+    {
+    return ( iConnectionBearer == EBearerGPRS ) ||
+           ( iConnectionBearer == EBearerEdgeGPRS ) ||
+           ( iConnectionBearer == EBearerWCDMA ) ||
+           ( iConnectionBearer == EBearerExternalGPRS ) ||
+           ( iConnectionBearer == EBearerExternalEdgeGPRS ) ||
+           ( iConnectionBearer == EBearerExternalWCDMA );
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::IsAttachModeOnDemand
+// -----------------------------------------------------------------------------
+//
+inline TBool CCoUtlActive::IsAttachModeOnDemand() const
+    {
+    return ( iAttachMode == RPacketService::EAttachWhenNeeded );
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::IsConnectionActive
+// -----------------------------------------------------------------------------
+//
+inline TBool CCoUtlActive::IsConnectionActive() const
+    {
+    return ( iConnectionStatus != KConnectionClosed ) &&
+           ( iConnectionStatus != KLinkLayerClosed );
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::Confirmed
+// -----------------------------------------------------------------------------
+//
+inline TBool CCoUtlActive::IsConfirmed() const
+    {
+    return iStatus.Int() == EAknSoftkeyYes;
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::TelServerL
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*   Series 60 Customer / TSY
+*   Needs customer TSY implementation
+*****************************************************/
+inline RTelServer& CCoUtlActive::TelServerL()
+    {
+    if ( !iServer.Handle() )
+        {
+        // ETel server session will be closed if any of the following operations
+        // fail. In this way, the above Handle condition is sufficient; if 
+        // session has been opened, then it has been initialised properly as
+        // well.
+        CleanupClosePushL( iServer ); 
+        User::LeaveIfError( iServer.Connect() );
+        User::LeaveIfError( 
+            iServer.SetExtendedErrorGranularity( 
+                RTelServer::EErrorExtended ) );
+        User::LeaveIfError( iServer.LoadPhoneModule( KMmTsyModuleName ) );
+        CleanupStack::Pop(); // Success
+        }
+
+    return iServer;
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::MobilePhoneL
+// -----------------------------------------------------------------------------
+//
+/***************************************************** 
+*   Series 60 Customer / ETel 
+*   Series 60  ETel API 
+*****************************************************/
+inline RMobilePhone& CCoUtlActive::MobilePhoneL()
+    {
+    if ( !iMobilePhone.SubSessionHandle() )
+        {
+        User::LeaveIfError( iMobilePhone.Open( TelServerL(), KMmTsyPhoneName ) );
+        }
+
+    return iMobilePhone;
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::PacketServiceL
+// -----------------------------------------------------------------------------
+//
+/***************************************************** 
+*   Series 60 Customer / ETel 
+*   Series 60  ETel API 
+*****************************************************/
+inline RPacketService& CCoUtlActive::PacketServiceL()
+    {
+    if ( !iPacketService.SubSessionHandle() )
+        {
+        User::LeaveIfError( iPacketService.Open( MobilePhoneL() ) );
+        }
+
+    return iPacketService;
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::ConnectionMonitorL
+// -----------------------------------------------------------------------------
+//
+inline RConnectionMonitor& CCoUtlActive::ConnectionMonitorL()
+    {
+    if ( !iConnectionMonitor.Handle() )
+        {
+        User::LeaveIfError( iConnectionMonitor.ConnectL() );
+        User::LeaveIfError( iConnectionMonitor.NotifyEventL( *this ) ); 
+        }
+
+    return iConnectionMonitor;
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::CompleteRequest
+// -----------------------------------------------------------------------------
+//
+void CCoUtlActive::CompleteRequest( TInt aErrorCode )
+    {
+    if ( iRequestStatus )
+        {
+        User::RequestComplete( iRequestStatus, aErrorCode );
+        iRequestStatus = NULL;
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CCoUtlActive::EventL
+// -----------------------------------------------------------------------------
+//    
+void CCoUtlActive::EventL( const CConnMonEventBase &aConnMonEvent )
+    {
+    COUTL_RDEBUG_INT( _L("CCoUtlActive::EventL - Event %d: "), aConnMonEvent.EventType() )
+    switch ( aConnMonEvent.EventType() )
+		{
+        case EConnMonDeleteConnection:
+            {
+            if ( IsActive() && iConfirmationQuery )
+                {
+                COUTL_RDEBUG( _L("CCoUtlActive::EventL - Cancel()") )
+                Cancel();
+                }
+		    }
+			break;
+		default:
+			break;
+		} 
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::GoToState
+// -----------------------------------------------------------------------------
+//
+inline void CCoUtlActive::GoToState( TState aNewState )
+    {
+    iState = aNewState;
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlActive::GoToStateAndComplete
+// -----------------------------------------------------------------------------
+//
+inline void CCoUtlActive::GoToStateAndComplete( TState aNewState, TInt aError )
+    {
+    GoToState( aNewState );
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, aError );
+    SetActive();
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ConnectUtil/src/CCoUtlImplementation.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,151 @@
+/*
+* 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:  Implementation of CCoUtlImplementation.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CCoUtlImplementation.h"
+#include    "CCoUtlActive.h"
+#include    <coemain.h>
+#include    <data_caging_path_literals.hrh>
+
+// CONSTANTS
+// Path to ConnectUtil engine resource file.
+_LIT( KCoUtlResourceFile, "z:connectutilrsc.rsc" );
+ 
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CCoUtlImplementation::CCoUtlImplementation
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CCoUtlImplementation::CCoUtlImplementation()
+    : iResourceLoader( *CCoeEnv::Static() )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlImplementation::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CCoUtlImplementation::ConstructL()
+    {
+    TParse* fp = new (ELeave) TParse();
+    fp->Set( KCoUtlResourceFile, &KDC_RESOURCE_FILES_DIR, NULL ); 
+    TFileName fileName( fp->FullName() );
+    delete fp;
+    User::LeaveIfError( iResourceLoader.Open( fileName ) );
+
+    iActive = new (ELeave) CCoUtlActive;
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlImplementation::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CCoUtlImplementation* CCoUtlImplementation::NewL()
+    {
+    if ( !CCoeEnv::Static() )
+        {
+        // CONE must exist - use only from applications
+        User::Leave( KErrNotSupported ); 
+        }
+
+    CCoUtlImplementation* self = new( ELeave ) CCoUtlImplementation;
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlImplementation::~CCoUtlImplementation
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CCoUtlImplementation::~CCoUtlImplementation()
+    {
+    delete iActive;
+    iResourceLoader.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlImplementation::CurrentState
+// -----------------------------------------------------------------------------
+//
+CCoUtlInterface::TState CCoUtlImplementation::CurrentState()
+    {
+    CCoUtlInterface::TState result = CCoUtlInterface::EIdle;
+
+    switch ( iActive->CurrentState() )
+        {
+        case CCoUtlActive::EStarted:
+        case CCoUtlActive::ECheckIfAttached:
+        case CCoUtlActive::ECheckIfNetworkModeIII:
+        case CCoUtlActive::EGetConnectionCount:
+        case CCoUtlActive::EGoThroughConnections:
+        case CCoUtlActive::EGoThroughConnectionsGetBearer:
+        case CCoUtlActive::EGoThroughConnectionsGetStatus:
+        case CCoUtlActive::ECheckConnectionCount:
+        case CCoUtlActive::EGetNameThenConfirmTermination:
+        case CCoUtlActive::EConfirmAllConnectionsTermination:
+            result = CCoUtlInterface::EConfirm;
+            break;
+
+        case CCoUtlActive::ECheckDetachRequired:
+        case CCoUtlActive::EStopConnectionsAndDetach:
+        case CCoUtlActive::EStopConnectionsAndCheckDetachRequired:
+        case CCoUtlActive::EDetach:
+            result = CCoUtlInterface::ETerminate;
+            break;
+ 
+        case CCoUtlActive::EIdle:
+        default:
+            break;
+        }
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlImplementation::Terminate
+// -----------------------------------------------------------------------------
+//
+void CCoUtlImplementation::Terminate( TRequestStatus& aStatus )
+    {
+    if ( !iActive->IsActive() )
+    	{
+    	iActive->Start( aStatus );
+    	}
+    }
+
+// -----------------------------------------------------------------------------
+// CCoUtlImplementation::Cancel
+// -----------------------------------------------------------------------------
+//
+void CCoUtlImplementation::Cancel()
+    {
+    iActive->Cancel();
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ConnectUtil/src/CoUtlMain.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,53 @@
+/*
+* 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:  Global functions for Connection utility.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    <ecom.h>
+#include    <implementationproxy.h>
+#include    <CoUtlInterface.hrh>
+#include    "CCoUtlImplementation.h"
+
+// CONSTANTS
+
+// Holds implementation table.
+const TImplementationProxy KCoUtlImplementationTable[] =
+    {
+        IMPLEMENTATION_PROXY_ENTRY(
+             KCoUtlImplementationUid, 
+            CCoUtlImplementation::NewL )
+    };
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Returns implementation table and updates aTableCount parameter to hold
+// amount of elements in table.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
+    {
+    aTableCount = 
+        sizeof( KCoUtlImplementationTable ) / 
+        sizeof( TImplementationProxy );
+
+    return KCoUtlImplementationTable;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/bwins/TelephonyDeviceModeU.DEF	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z20CTelDMHandlerCreateLv @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/group/TelephonyDeviceMode.mmp	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,29 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,29 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file 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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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	Mon Jan 18 20:18:27 2010 +0200
@@ -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/Ussd/aif/UssdAif.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,40 @@
+/*
+* 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:  RSS for creating the aif file for Ussd.
+*
+*/
+
+
+
+//  INCLUDES
+#include <aiftool.rh>
+
+
+//  RESOURCE DEFINITIONS 
+
+// -----------------------------------------------------------------------------
+//   
+// AIF_DATA
+// Resource for AIF.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AIF_DATA
+    {
+    app_uid = 0x10005955;
+    num_icons = 2;
+    hidden=KAppIsHidden;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/data/Ussd.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,31 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing ussd.
+;
+; Languages
+&EN
+
+; Header
+#{"Ussd"}, (0x10005955), 10, 1, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files to install
+"\epoc32\release\armv5\urel\ussd.exe"-"z:\sys\bin\ussd.exe"
+"\epoc32\data\z\resource\apps\ussd.rsc"-"!:\resource\apps\ussd.rsc"
+"\epoc32\data\z\private\10003a3f\apps\ussd_reg.rsc"-"!:\private\10003a3f\import\apps\ussd_reg.rsc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/data/Ussd_caption.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the resources of caption.
+*
+*/
+
+
+//  INCLUDES
+#include <apcaptionfile.rh>
+#include <ussd.loc>
+
+
+//  RESOURCE DEFINITIONS 
+
+
+// -----------------------------------------------------------------------------
+//   
+// CAPTION_DATA
+// Resource for Caption Data.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CAPTION_DATA
+    {
+    caption = qtn_apps_ussd_list;
+    shortcaption = qtn_apps_ussd_grid;
+    }
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/data/Ussd_reg.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Resource file for ussd.
+*
+*/
+
+#include <appinfo.rh>
+#include <ussd.rsg>
+#include <data_caging_paths_strings.hrh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10005955 // Ussd UID
+
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file = "Ussd";
+    hidden = KAppIsHidden;
+
+    localisable_resource_file = APP_RESOURCE_DIR"//Ussd";
+    localisable_resource_id = R_USSD_LOCALISABLE_APP_INFO;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/data/Ussd_stub.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,31 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing ussd stub.
+;
+; Languages
+&EN
+
+; Header
+#{"Ussd"}, (0x10005955), 10, 0, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files to install
+""-"z:\sys\bin\ussd.exe"
+""-"z:\resource\apps\ussd.rsc"
+""-"z:\private\10003a3f\import\apps\ussd_reg.rsc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/data/ussd.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,227 @@
+/*
+* 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 all the resources for the module.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME    USSD // 4 letter ID
+
+//  INCLUDES
+#include <eikon.rh>
+#include "ussd.hrh"
+#include <ussd.loc>
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.loc>
+
+#include <bldvariant.hrh> 
+#include <data_caging_paths_strings.hrh>
+#include <appinfo.rh>
+
+//  RESOURCE DEFINITIONS 
+
+//----------------------------------------------------
+//   
+//    
+//    RSS signature.
+//----------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE { }
+
+
+//----------------------------------------------------
+//   
+//    
+//    Name of the buffer.
+//----------------------------------------------------
+//
+RESOURCE TBUF { buf = qtn_apps_ussd_grid; }
+
+
+//----------------------------------------------------
+//   
+//    
+//    Application information.
+//----------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+    {
+    menubar = r_ussd_menubar;
+    cba = r_ussd_softkeys_options_exit_options;
+
+    status_pane = r_status_pane;
+    }
+
+RESOURCE LOCALISABLE_APP_INFO r_ussd_localisable_app_info
+    {
+    short_caption = qtn_apps_ussd_grid;
+    caption_and_icon = 
+        CAPTION_AND_ICON_INFO
+        {
+        caption = qtn_apps_ussd_list;
+#ifdef __SCALABLE_ICONS
+        number_of_icons = 1;
+        icon_file = "Z:"APP_RESOURCE_DIR"\\Ussd_aif.mif";
+#else
+        number_of_icons = 2;
+        icon_file = "Z:"APP_RESOURCE_DIR"\\Ussd_aif.mbm";
+#endif // __SCALABLE_ICONS
+        };
+    }
+
+
+//----------------------------------------------------
+//   
+//    r_ussd_menubar
+//    Empty menubar. With this edit menu will be generated.
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_ussd_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane = r_ussd_menu; }
+        };
+    }
+
+
+//----------------------------------------------------
+//   
+//    r_ussd_menu
+//    Menu items
+//    
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_ussd_menu
+    {
+    items=
+        {
+        MENU_ITEM { command = EUssdMenuItemSend; txt = qtn_ussd_editor_send; },
+        MENU_ITEM { command = EAknCmdHelp; txt = qtn_options_help; },
+        MENU_ITEM { command = EAknCmdExit; txt = qtn_options_exit; }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_ussd_softkeys_options_exit_send_options
+//    Softkeys for application when there is no text in editor
+//
+//----------------------------------------------------
+//
+RESOURCE CBA r_ussd_softkeys_options_exit_options
+    {
+    buttons =
+        {
+        CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option;},
+        CBA_BUTTON { id = EAknSoftkeyExit; txt = text_softkey_exit; },
+        CBA_BUTTON { id = EAknSoftkeyEmpty; txt = text_softkey_empty;}
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_ussd_softkeys_send_exit
+//    Softkeys for application when there is some text in editor
+//
+//----------------------------------------------------
+//
+RESOURCE CBA r_ussd_softkeys_send_exit
+    {
+    buttons =
+        {
+        CBA_BUTTON { id = EUssdSoftkeySend; txt = text_softkey_send; },
+        CBA_BUTTON { id = EAknSoftkeyExit; txt = text_softkey_exit; },
+        CBA_BUTTON { id = EAknSoftkeyEmpty; txt = text_softkey_empty;}
+        };
+    }
+
+
+//----------------------------------------------------
+//   
+//    r_status_pane
+//    Application statuspane
+//    Context pane image is defined in AIF.
+//----------------------------------------------------
+//
+
+RESOURCE STATUS_PANE_APP_MODEL r_status_pane
+    {
+    panes =
+        {
+        SPANE_PANE
+            {
+            id = EEikStatusPaneUidTitle;
+            type = EAknCtTitlePane;
+            resource = r_overridden_app_editor_name;
+            }
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+//   
+// r_overridden_app_editor_name
+// Title pane for r_status_pane.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TITLE_PANE r_overridden_app_editor_name
+    {
+    txt = qtn_ussd_header;
+    }
+
+
+// -----------------------------------------------------------------------------
+//   
+// r_ussd_edwin_editor_elaf
+// The USSD editor in ELAF variant.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_CONFIG_EDWIN r_ussd_edwin_editor_elaf
+    {
+    editingSpace = 182;    // From LAF
+    editingWindow = 8;     // From LAF
+    characterCase = EAknEditorCharactersUpperCase;
+    justification = EAknEditorAlignLeft;
+    allowedToMoveInsertionPoint = 1;   // From LAF
+    cursorYesNo = 1;                   // From LAF
+    overflowYesNo = 0;                 // From LAF
+    }
+
+
+// -----------------------------------------------------------------------------
+//   
+// r_ussd_edwin_editor_apac
+// The USSD editor in APAC variant.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_CONFIG_EDWIN r_ussd_edwin_editor_apac
+    {
+    editingSpace = 182;    // From LAF
+    editingWindow = 7;     // From LAF
+    characterCase = EAknEditorCharactersUpperCase;
+    justification = EAknEditorAlignLeft;
+    allowedToMoveInsertionPoint = 1;   // From LAF
+    cursorYesNo = 1;                   // From LAF
+    overflowYesNo = 0;                 // From LAF
+    }
+
+
+            
+// End of File
Binary file phoneuis/Ussd/data/ussd_stub.SIS has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,44 @@
+/*
+* 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 file provides the information required for building the 
+*                whole of a ussd.
+*
+*/
+
+#include  <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+//  Help exports
+#include "../help/group/bld.inf"
+
+PRJ_EXPORTS
+
+../data/ussd_stub.SIS       /epoc32/data/z/system/install/Ussd_stub.sis
+../rom/Ussd.iby             CORE_APP_LAYER_IBY_EXPORT_PATH(Ussd.iby)
+../rom/UssdResources.iby    LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(UssdResources.iby)
+../loc/ussd.loc             APP_LAYER_LOC_EXPORT_PATH(ussd.loc)
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  Option TARGETFILE ussd_aif.mif
+  OPTION SOURCES -c8,8 qgn_menu_ussd
+END
+
+PRJ_MMPFILES
+//gnumakefile ussd_icons_aif_scalable_dc.mk
+../group/ussd.mmp
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/group/ussd.mmp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,85 @@
+/*
+* 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 is project specification file for the ussd.
+*
+*/
+
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+// Capability assignment.
+CAPABILITY CAP_APPLICATION NetworkControl
+// Assign Vendor ID.
+VENDORID VID_DEFAULT
+
+TARGET      ussd.exe
+TARGETTYPE  exe
+
+UID  0x100039CE 0x10005955
+
+START RESOURCE ../data/ussd.rss
+TARGETPATH  APP_RESOURCE_DIR
+HEADER
+LANGUAGE_IDS
+END  // RESOURCE
+
+SOURCEPATH ../src
+
+SOURCE    UssdApp.cpp 
+SOURCE    UssdAppUi.cpp
+SOURCE    UssdDocument.cpp
+SOURCE    UssdContainer.cpp
+SOURCE    UssdEditorLines.cpp
+SOURCE    UssdComms.cpp
+SOURCE    UssdLayout.cpp
+SOURCE    UssdNaviPane.cpp
+
+USERINCLUDE . ../inc
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE ../../../inc
+
+LIBRARY    euser.lib 
+LIBRARY    apparc.lib
+LIBRARY    cone.lib
+LIBRARY    eikcore.lib
+LIBRARY    ws32.lib
+LIBRARY    eikcoctl.lib
+LIBRARY    avkon.lib
+LIBRARY    egul.lib 
+LIBRARY    phoneclient.lib
+LIBRARY    hlplch.lib // for "Help" options menu 
+LIBRARY    FeatMgr.lib
+LIBRARY    CdlEngine.lib
+LIBRARY    charconv.lib            // for detecting unicode chars
+LIBRARY    CommonEngine.lib
+
+LIBRARY     AknLayout2Scalable.lib
+LIBRARY    AknSkins.lib
+LIBRARY    etext.lib
+LIBRARY    CentralRepository.lib
+
+// ============================================================================
+// AIF
+// ============================================================================
+
+START RESOURCE ../data/Ussd_reg.rss
+DEPENDS ussd.rsg
+// Do not change the UID below.
+TARGETPATH /private/10003a3f/apps
+END
+
+// AIF
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/group/ussd_icons_aif_bitmaps.mk	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,68 @@
+#
+# 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: Make file for ussd icons.
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\SYSTEM\APPS\Ussd
+ICONTARGETFILENAME=$(TARGETDIR)\ussd_aif.mbm
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_ussd_cxt.bmp \
+		/c8,8 qgn_menu_ussd_lst.bmp
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/group/ussd_icons_aif_bitmaps_dc.mk	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,68 @@
+#
+# 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: Make file for ussd icons.
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\RESOURCE\APPS
+ICONTARGETFILENAME=$(TARGETDIR)\ussd_aif.mbm
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_ussd_lst.bmp \
+		/c8,8 qgn_menu_ussd_cxt.bmp
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/group/ussd_icons_aif_scalable.mk	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,67 @@
+#
+# 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: Make file for ussd icons.
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\SYSTEM\APPS\Ussd
+ICONTARGETFILENAME=$(TARGETDIR)\ussd_aif.mif
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_ussd.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/group/ussd_icons_aif_scalable_dc.mk	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,67 @@
+#
+# 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: Make file for ussd icons.
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\RESOURCE\APPS
+ICONTARGETFILENAME=$(TARGETDIR)\ussd_aif.mif
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_ussd.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
Binary file phoneuis/Ussd/help/data/xhtml.zip has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/help/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - Initial contribution
+* 
+* Contributors:
+* 
+* 
+* Description:
+* Export help related files.
+*
+*/
+
+#include <platform_paths.hrh>				
+PRJ_EXPORTS
+:zip ../data/xhtml.zip   /epoc32/data/z/resource/ overwrite
+:zip ../data/xhtml.zip   /epoc32/winscw/c/resource/ overwrite
+
+../inc/ussd.hlp.hrh	APP_LAYER_PLATFORM_EXPORT_PATH(csxhelp/ussd.hlp.hrh)
+../rom/ussdhelps_variant.iby		CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(ussdhelps_variant.iby)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/help/inc/ussd.hlp.hrh	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description:
+*
+*/
+	
+//
+// ussd.hlp.hrh generated by CSXHelp Utilities.
+//           
+
+#ifndef __USSD_HLP_HRH__
+#define __USSD_HLP_HRH__
+
+_LIT(KUSSD_HLP_EDITOR, "USSD_HLP_EDITOR"); // 
+
+#endif 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/help/rom/ussdhelps_variant.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef __USSDHELPS_VARIANT_IBY__
+#define __USSDHELPS_VARIANT_IBY__
+
+#if defined(FF_S60_HELPS_IN_USE) && defined(__USSD)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x10005955\contents.zip, RESOURCE_FILES_DIR\xhtml\%02d\0x10005955\contents.zip)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x10005955\index.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x10005955\index.xml)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x10005955\keywords.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x10005955\keywords.xml)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x10005955\meta.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x10005955\meta.xml)
+#endif
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/inc/UssdApp.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declares main application class.
+*
+*/
+
+
+#ifndef USSDAPP_H
+#define USSDAPP_H
+
+// INCLUDES
+#include <aknapp.h>
+
+// CONSTANTS
+// UID of the application
+const TUid KUidussd = { 0x10005955 };
+
+
+// CLASS DECLARATION
+
+/**
+*  CUssdApp application class.
+*  Provides factory to create concrete document object.
+* 
+*  @since 1.0
+*/
+class CUssdApp : public CAknApplication
+    {
+    
+    private:
+
+        /**
+        * From CApaApplication, creates CUssdDocument document object.
+        * @return A pointer to the created document object.
+        */
+        CApaDocument* CreateDocumentL();
+        
+        /**
+        * From CApaApplication, returns application's UID (KUidussd).
+        * @return The value of KUidussd.
+        */
+        TUid AppDllUid() const;
+    };
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/inc/UssdAppUi.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,114 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declares UI class for application.
+*
+*/
+
+
+#ifndef USSDAPPUI_H
+#define USSDAPPUI_H
+
+
+// INCLUDES
+#include <aknappui.h>
+#include <bldvariant.hrh> 
+
+// FORWARD DECLARATIONS
+class CUssdContainer;
+class CUssdComms;
+
+
+
+// CLASS DECLARATION
+
+/**
+*  Application UI class.
+*  Provides support for the following features:
+*  - EIKON control architecture
+* 
+*  @since 1.0
+*/
+class CUssdAppUi : public CAknAppUi
+    {
+
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        */      
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */      
+        ~CUssdAppUi();
+
+
+    public: // New functions
+
+        /**
+        * Set manu pane items.
+        * To be used only if help is defined, otherwise does nothing.
+        *
+        * @param aResourceId The resource ID.
+        * @param aMenuPane The menu pane.
+        */
+        void DynInitMenuPaneL( TInt aResourceId,CEikMenuPane* aMenuPane );
+
+        /**
+        * Set's left seftkey visible.
+        * To be used only when help not defined. Otherwise does nothing.
+        *
+        * @param aVisible ETrue if set visible.
+        */
+        void SetSoftkeySendVisibleL( TBool aVisible = ETrue );
+
+        
+    public: // Functions from base classes
+        /**
+        * From CEikAppUi, takes care of command handling.
+        * @param aCommand command to be handled
+        */
+        void HandleCommandL( TInt aCommand );
+
+        /**
+        * From CEikAppUi, handles resource changes.
+        * @param aType type of event.
+        */
+        virtual void HandleResourceChangeL( TInt aType );
+
+    private:
+
+        // From CAknAppUi
+        void HandleForegroundEventL(TBool aForeground);
+
+
+    private: //Data
+
+        // Object for sneding the string.
+        CUssdComms* iComms;
+
+        // Main "view".
+        CUssdContainer* iAppContainer;
+
+        // Current softkeys. Used only when help is not defined.
+        TInt iCbaResource;
+
+        // Is control added to stack.
+        TBool iIsAddedToStack;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/inc/UssdComms.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,109 @@
+/*
+* 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:  Handles Ussd communications to the Phone Server.
+*
+*/
+
+
+#ifndef USSDCOMMS_H
+#define USSDCOMMS_H
+
+
+// INCLUDES
+#include <coemain.h>
+#include <CPhCltUssdInt.h>
+#include <PhCltTypes.h>
+
+
+// CONSTANTS
+const TInt KUssdEditorMaxLenght = 182;
+
+
+// FORWARD DECLARATIONS    
+class CPhCltUssd;
+
+
+// CLASS DECLARATION
+
+/**
+*  CUssdComms  
+*  Handles Ussd communications to the Phone Server.
+*
+*  @since 1.0
+*/
+class CUssdComms : public CBase  
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Two-phased constructor
+        */
+        static CUssdComms* NewL();
+     
+        /**
+        * Destructor.
+        */
+        ~CUssdComms();
+
+
+    public: // Member functions
+
+        /**
+        * Send created string
+        * 
+        * @param aString String to be sent.
+        * @return Error code
+        */
+        TInt SendString( const TDesC& aString );
+
+        /**
+        * Application to foreground
+        * 
+        * @return ETrue if editor needs clearing.
+        */
+        TBool InformAppForeground();
+
+        /**
+        * Application to background
+        */
+        void InformAppBackground();
+
+        /**
+        * Tell the reason why app was terminated.
+        */
+        void InformExitReason( TPhCltUssdAppExitReason aExitReason );
+
+
+    protected: // Constructor
+
+        // Default constructor
+        CUssdComms();
+
+        // 2nd phase constructor
+        void ConstructL();
+
+
+    private: // Data
+
+        // Sending Ussd, Inform ussd
+        CPhCltUssdInt* iUssdClientInt; 
+
+        // Ussd application exit reason.
+        TPhCltUssdAppExitReason  iExitReason;
+    };
+
+#endif // USSDCOMMS_H
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/inc/UssdContainer.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,155 @@
+/*
+* 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:  Declares container control for application.
+*
+*/
+
+
+#ifndef USSDCONTAINER_H
+#define USSDCONTAINER_H
+
+
+// INCLUDES
+#include <coecntrl.h>
+#include <bldvariant.hrh>
+// Include file for MEikEdwinObserver
+#include <eikedwob.h>
+
+// FORWARD DECLARATIONS
+class CEikEdwin;
+class CUssdEditorLines;
+class CUssdAppUi;
+class CAknsBasicBackgroundControlContext;
+class CUssdNaviPane;
+
+
+// CLASS DECLARATION
+
+/**
+*  CUssdContainer
+*  Declares container control for application.
+*
+*  @since 1.0
+*/
+class CUssdContainer : public CCoeControl,
+                       public MEikEdwinObserver
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Constructor.
+        * @param aAppUi A reference to AppUI for container.
+        */
+        CUssdContainer( CUssdAppUi& aAppUi );
+
+
+        /**
+        * 2nd phase constructor
+        * @param aRect Frame rectangle for container.
+        */
+        void ConstructL( const TRect& aRect );
+
+        /**
+        * Destructor.
+        */
+        ~CUssdContainer();
+
+    public: // New functions
+
+        /**
+        * Gives editor.
+        * @return Reference to editor
+        */
+        CEikEdwin& Editor();
+
+    public: // Functions from base classes
+
+        /**
+        * From CoeControl,GetHelpContext.
+        * Does nothing if help is not defined.
+        */
+        void GetHelpContext( TCoeHelpContext& aContext ) const;
+
+        /**
+        * From CoeControl, FocusChanged
+        */
+        void FocusChanged( TDrawNow aDrawNow );
+
+        /**
+        * Update the message length information to navipane
+        */
+        void UpdateNavipaneMsgLengthL();
+
+    private: // Functions from base classes
+
+        /**
+        * From CoeControl, SizeChanged.
+        */
+        void SizeChanged();
+
+        /**
+        * From CoeControl, CountComponentControls.
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl, ComponentControl.
+        */
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+
+        /**
+        * From CCoeControl, Draw.
+        */
+        void Draw( const TRect& aRect ) const;
+
+        /**
+        * From CCoeControl, OfferKeyEventL.
+        */
+        TKeyResponse OfferKeyEventL(
+            const TKeyEvent& aKeyEvent, TEventCode aType );
+
+        /**
+        * From CCoeControl, HandleResourceChange
+        */
+        void HandleResourceChange( TInt aType );
+
+        /**
+        * From CCoeControl, MopSupplyObject
+        */
+        TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
+
+        /**
+        * Functions from MEikEdwinObserver, Handle editor event.
+        */
+        void HandleEdwinEventL( CEikEdwin* aEdwin, TEdwinEvent aEventType );
+
+    private: //new functions
+
+        // Creates edwin
+        CEikEdwin* CreateEdwinL();
+
+    private: //data
+
+        CUssdAppUi& iAppUi;       // Application UI
+        CEikEdwin* iEditor;       // The edit window.
+        CUssdEditorLines* iLines; // Application ine drawer
+
+        CAknsBasicBackgroundControlContext* iBgContext; // Skinning context.
+        // The navipane control handler
+        CUssdNaviPane*               iNaviPaneHandler;
+    };
+
+#endif // USSDCONTAINER_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/inc/UssdDocument.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declares document for application.
+*
+*/
+
+
+#ifndef USSDDOCUMENT_H
+#define USSDDOCUMENT_H
+
+// INCLUDES
+#include <AknDoc.h>
+
+
+// FORWARD DECLARATIONS
+class  CEikAppUi;
+
+
+// CLASS DECLARATION
+
+/**
+*  CUssdDocument application class.
+*
+*  @since 1.0
+*/
+class CUssdDocument : public CAknDocument
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CUssdDocument* NewL( CEikApplication& aApp );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CUssdDocument();
+
+    private:
+
+        /**
+        * C++ constructor.
+        */
+        CUssdDocument( CEikApplication& aApp );
+
+    private:
+
+        /**
+        * From CEikDocument, create CUssdAppUi "App UI" object.
+        */
+        CEikAppUi* CreateAppUiL();
+    };
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/inc/UssdEditorLines.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,80 @@
+/*
+* 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:  Declares window owning control for editor lines.
+*
+*/
+
+
+#ifndef USSDEDITORLINES_H
+#define USSDEDITORLINES_H
+
+// INCLUDES
+#include    <calslbs.h>
+#include    <aknview.h>
+#include    "UssdLayout.h"
+
+/**
+*  Declares window owning control for editor lines.
+*
+*  @since 1.0
+*/
+class CUssdEditorLines : public CCoeControl
+    {
+    public: // Constructors and destructor
+            
+        // Default constructor
+        CUssdEditorLines();
+
+        /**
+        * Symbian OS default constructor.
+        * @param aParent The parent control.
+        */
+        void ConstructL( const CCoeControl* aParent );
+
+        /**
+        * Destructor.
+        */
+        ~CUssdEditorLines();
+
+    private: // Functions from base classes
+
+       /**
+        * From CoeControl,SizeChanged.
+        */
+        void SizeChanged();
+
+       /**
+        * From CCoeControl,Draw.
+        */
+        void Draw( const TRect& aRect ) const;
+        
+        /**
+        * From CoeControl,HandlePointerEventL.
+        * Redirect pointer event to CEikEdwin.
+        */
+        void HandlePointerEventL(const TPointerEvent& aPointerEvent);
+
+    private: //data
+
+        // The line rectangles.
+        CArrayPtrFlat< TAknLayoutRect >*           iRects;
+
+        // Buffer for RRegion objects.
+        RRegionBuf< KUssdMaxNumberOfEditorLines >* iRegBuf;
+    
+    };
+
+#endif // USSDEDITORLINES_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/inc/UssdLayout.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,86 @@
+/*
+* 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:  Declares coordinates from LAF specification
+*
+*/
+
+
+#ifndef USSDLAF_H
+#define USSDLAF_H
+
+// INCLUDE FILES
+#include    <calslbs.h> 
+#include    <AknLayoutDef.h>
+
+
+// CONSTANTS
+
+// The maximum number of editor lines method NumberOfEditorLines can return.
+const TInt KUssdMaxNumberOfEditorLines = 16;
+
+/**
+* Layout coordinates from Application LAF
+*
+* @since 2.0
+*/
+class UssdLayout
+    {
+    public: // New functions
+
+        typedef TAknWindowLineLayout TWindowLineLayoutType;
+        typedef TAknMultiLineTextLayout TTextLineLayoutType;
+
+        /**
+        * Returns current Layout ID
+        * @since 2.0
+        * @return EAknLayoutIdELAF, EAknLayoutIdABRW, EAknLayoutIdAPAC
+        */
+        static TAknLayoutId CurrentLayout();
+
+        /**
+        * Get background image colour
+        * @since 2.0
+        * @return White colour
+        */ 
+        static TInt LayoutColourWhite();
+
+        /**
+        * Get number of editor lines
+        * @since 2.0
+        * @return Number of lines
+        */ 
+        static TInt NumberOfEditorLines();
+
+        /**
+        * One line coordinate definitions from LAF
+        * @since 2.0
+        * @param aLine Line number from 1 to NumberOfEditorLines()
+        * @return Current line coordinates
+        */ 
+        static TWindowLineLayoutType 
+            MessageWritingLayoutElements6( TInt aLine );
+
+        /**
+        * Editor coordinate definitions from LAF
+        * @since 2.0
+        * @return Editor coordinates
+        */ 
+        static TTextLineLayoutType MessageWritingTexts3();
+
+    };
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/inc/UssdNaviPane.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,141 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 container control for application.
+*
+*/
+
+
+#ifndef USSDNAVIPANE_H
+#define USSDNAVIPANE_H
+
+
+// INCLUDES
+#include <coecntrl.h>
+    
+
+// FORWARD DECLARATIONS
+class CUssdAppUi;
+class CAknNaviLabel;
+class CAknNavigationDecorator;
+class CAknNavigationControlContainer;
+class CCnvCharacterSetConverter;
+
+
+// CLASS DECLARATION
+
+/**
+*  CUssdNaviPane
+*  Declares navi pane control for application.
+*  @since 2.8.
+*
+*/
+class CUssdNaviPane : public CCoeControl
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Constructor.
+        * @param aAppUi A reference to AppUI for container.
+        */
+        CUssdNaviPane( CUssdAppUi& aAppUi );
+
+        /**
+        * Two-phased constructor.
+        * @param aAppUi A reference to AppUI for container.
+        */
+        static CUssdNaviPane*  NewL( CUssdAppUi& aAppUi );
+        
+        /**
+        * 2nd phase constructor
+        *  
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CUssdNaviPane();
+
+    public: // New functions
+
+        /**
+        * Update the message length information to navipane
+        * @param aInputString Reference to a string to be checked
+        * @param aControl for handling backspace key event
+        * @return Updated value of maximum size of string
+        */
+        TInt UpdateMsgLengthL( 
+            const TDesC& aInputString,
+            CCoeControl* aControl );
+
+    public: // Functions from base classes
+
+        
+    private: // Functions from base classes
+
+ 
+    private: //new functions
+                
+        /**
+        * Creates an extra navi label. It is needed so that the msg length
+        * won't dissapear when the focus is on the picture of a picture msg.
+        */
+        void CreateExtraNaviLabelL();
+        
+        /**
+        * Checks if there are any unicode characters in the message
+        * @param aInputString Reference to a string to be checked
+        * @return ETrue whether we have unicode chars otherwise EFalse
+        */
+        TBool NeedsToBeSentAsUnicodeL( const TDesC& aInputString ) const;
+        
+        /**
+        * Counts if there are 7bit extended table characters in message 
+        * (see more info from ETSI 03.38)
+        * @param aInputString Reference to chars to be checked
+        * @return amount of extended table chars
+        */
+        TInt CountExtendedTableChars( const TDesC& aInputString ) const;
+
+        /**
+        * Generates a backspace key press event.
+        * @param aControl Reference to control class
+        */
+        void GenerateBackSpaceKeyL(CCoeControl* aControl);
+       
+         
+    private: //data
+
+        // Application UI.
+        CUssdAppUi&                         iAppUi;
+
+         // Char converter.
+        CCnvCharacterSetConverter*          iCharacterSetConverter;
+
+        // The navipane decorator.
+        CAknNavigationDecorator*            iNaviDecorator;
+
+        // The navipane label.
+        CAknNaviLabel*                      iNaviLabel;
+
+        // The navipane control container.
+        CAknNavigationControlContainer*     iNaviPane;
+        
+        
+
+    };
+
+#endif // USSDNAVIPANE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/inc/UssdVariant.hrh	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,57 @@
+/*
+* 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:  Local variation flags for Ussd
+ *
+*/
+
+
+#ifndef __USSDVARIANT_HRH__
+#define __USSDVARIANT_HRH__
+
+/**
+* User's guide to Local Ussd variation:
+* Shared data file: KSDUidUssdLV (10005955.ini)
+* Keyword KUssdUILV1:
+* How to use: 
+*     TInt featureBitmask = 0;
+*     if ( sharedDataClient.Assign( KSDUidUssdLV ) == KErrNone )
+*         {
+*         if ( sharedDataClient.GetInt( 
+*             KUssdUILV1, featureBitmask ) != KErrNone )
+*             {
+*             // if problems reading shared data, assume everything is off.
+*             featureBitmask = 0;
+*             } 
+*         }
+* 
+*     //
+*     // Get the value once and save it for later use.
+*     // No need always to access shared data every time when a value is needed
+* 
+*     if  ( featureBitmask & KUssdFeatureIdRemainingChars )
+*         {
+*         // This feature is ON, so act accordingly
+*         }
+*/
+
+/**
+* Shared data KSDUidUssdLV
+* Keyword KUssdUILV1: R-RemChars
+* If KUssdUILV1 is on, Ussd shows number of remaining characters 
+*/
+#define KUssdFeatureIdRemainingChars 0x01
+
+#endif // __USSDVARIANT_HRH__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/inc/ussd.hlp.hrh	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* 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 ussd help.
+*
+*/
+
+
+
+#ifndef __USSD_HLP_HRH__
+#define __USSD_HLP_HRH__
+
+
+// DATA TYPES
+
+_LIT(KUSSD_HLP_EDITOR,"USSD_HLP_EDITOR"); // Service command editor
+_LIT(KUSSD_HLP_VIEWER,"USSD_HLP_VIEWER"); // Network initiated USSD operation
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/inc/ussd.hrh	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains declarations for resources of ussd.
+*                The file can be included in C++ or resource file.
+*
+*/
+
+
+#ifndef USSD_HRH
+#define USSD_HRH
+
+// Contains the menu "Send" id.
+enum TUssdMenuItems
+    {
+    EUssdMenuItemSend = 6000
+    };
+
+// Contains the softkey "Send" id.
+enum TUssdSoftkeys
+    {
+    EUssdSoftkeySend = 6100
+    };
+
+
+#endif      //  USSD_HRH
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/loc/ussd.loc	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  This file contains the localised strings for Ussd.
+*
+*/
+
+
+
+//  LOCALISATION STRINGS
+
+//d:Name in application grid form
+//l:cell_app_pane_t1
+//
+#define qtn_apps_ussd_grid             "Ussd"
+
+
+//d:Name in applicaton list form
+//l:list_single_large_graphic_pane_t1
+//
+#define qtn_apps_ussd_list             "Ussd"
+
+
+//d:Text in Ussd editor title pane
+//l:title_pane_t2/opt9
+//
+#define qtn_ussd_header "Service command editor"
+
+
+//d:Left softkey in application.
+//l:control_pane_t1/opt7
+//
+#define text_softkey_send "Send"
+
+
+//d: Options menu item for sending the written Ussd string to the network.
+//l: list_single_pane_t1_cp2
+//
+#define qtn_ussd_editor_send "Send"
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/rom/Ussd.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Ussd's iby definitions.
+ *
+*/
+
+#ifndef __USSDAPP_IBY__
+#define __USSDAPP_IBY__
+
+#ifdef __USSD
+
+file=ABI_DIR\BUILD_DIR\USSD.EXE             PROGRAMS_DIR\Ussd.exe
+
+data=ZSYSTEM\install\Ussd_stub.sis    		  System\Install\Ussd_stub.sis
+S60_APP_AIF_ICONS(Ussd)
+S60_APP_AIF_RSC(Ussd)
+#endif
+
+#endif // __USSDAPP_IBY__
+
+// End Of File.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/rom/UssdResources.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Ussd resources' iby definitions.
+ *
+*/
+
+#ifndef __USSD_RESOURCES_IBY__
+#define __USSD_RESOURCES_IBY__
+
+REM Resource file(s) for Ussd application (ussd.iby)
+
+#ifdef __USSD
+S60_APP_RESOURCE(ussd) 
+S60_APP_CAPTION(ussd)
+#endif
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/src/UssdApp.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,75 @@
+/*
+* 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:  Declares main application class.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "UssdApp.h"
+#include    "UssdDocument.h"
+#include 	<eikstart.h>
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CUssdApp::AppDllUid()
+// Returns application UID
+// -----------------------------------------------------------------------------
+//
+TUid CUssdApp::AppDllUid() const
+    {
+    return KUidussd;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdApp::CreateDocumentL()
+// Creates CUssdDocument object
+// -----------------------------------------------------------------------------
+//
+CApaDocument* CUssdApp::CreateDocumentL()
+    {
+    return CUssdDocument::NewL(*this);
+    }
+
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// NewApplication() 
+// Constructs CUssdApp
+// Returns: CApaDocument*: created application object
+// -----------------------------------------------------------------------------
+//
+LOCAL_C CApaApplication* NewApplication()
+    {
+    return new CUssdApp;
+    }
+
+// -----------------------------------------------------------------------------
+// E32Main implements
+// 
+// It is called when executable is started. 
+//
+// Returns: error code.
+// -----------------------------------------------------------------------------
+//
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication( NewApplication );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/src/UssdAppUi.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,278 @@
+/*
+* 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:  Application UI class
+*
+*/
+
+
+// INCLUDE FILES
+#include "UssdAppUi.h"
+#include "UssdContainer.h"
+#include "UssdComms.h"
+#include <ussd.rsg>
+#include <avkon.rsg>
+#include "ussd.hrh"
+#include <eikmenub.h>
+#include <eikedwin.h>
+#include <avkon.hrh>
+#include <bldvariant.hrh>
+#include <featmgr.h>
+
+#include <AknDef.h>
+#include <hlplch.h>   // For HlpLauncher
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CUssdAppUi::ConstructL
+// Creates all members
+// -----------------------------------------------------------------------------
+void CUssdAppUi::ConstructL()
+    {
+    // Sets up TLS, must be done before FeatureManager is used in USSD.
+    FeatureManager::InitializeLibL();
+
+    BaseConstructL(
+        EAknEnableSkin | EAknEnableMSK
+        );
+
+    // Softkeys at start:
+    // With HELP: Options-Exit (defined in the resource file, default)
+    // Without HELP: <empty>-Exit
+    if ( !FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+        {
+        // Feature not supported, set correct softkeys.
+        Cba()->SetCommandSetL( R_AVKON_SOFTKEYS_EXIT );
+        iCbaResource = R_AVKON_SOFTKEYS_EXIT;
+        Cba()->DrawNow();
+        }
+
+    iComms = CUssdComms::NewL();
+
+    iAppContainer = new( ELeave ) CUssdContainer( *this );
+    iAppContainer->SetMopParent( this );
+    iAppContainer->ConstructL( ClientRect() );
+    AddToStackL( iAppContainer );
+    iIsAddedToStack = ETrue;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdAppUi::~CUssdAppUi
+// Destructor
+// Frees reserved resources
+// -----------------------------------------------------------------------------
+CUssdAppUi::~CUssdAppUi()
+    {
+    if ( iIsAddedToStack )
+        {
+        RemoveFromStack( iAppContainer );
+        }
+
+    delete iAppContainer;
+    iAppContainer = NULL;
+
+    delete iComms;
+    iComms = NULL;
+
+    // Frees the TLS! Must be done after FeatureManager is used.
+    FeatureManager::UnInitializeLib();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdAppUi::HandleCommandL
+// Handle commands from the user.
+// -----------------------------------------------------------------------------
+void CUssdAppUi::HandleCommandL( TInt aCommand )
+    {
+    switch ( aCommand )
+        {
+        case EAknCmdExit:
+        case EEikCmdExit:
+        case EAknSoftkeyExit:
+        case EAknSoftkeyBack:
+            {
+            iComms->InformExitReason( EPhCltUserExit );
+            Exit();
+            break;
+            }
+
+        case EUssdMenuItemSend:
+        case EUssdSoftkeySend:
+            {
+            // Send string and exit the application
+            HBufC* buffer = iAppContainer->Editor().GetTextInHBufL();
+            __ASSERT_DEBUG(
+                buffer->Length() <= KUssdEditorMaxLenght ,
+                User::Invariant() );
+
+            if  ( buffer->Length() &&
+                  buffer->Length() <= KUssdEditorMaxLenght &&
+                  KErrNone == iComms->SendString( buffer->Des() ) )
+                {
+                iComms->InformExitReason( EPhCltSendCompleted );
+                Exit();                
+                }         
+
+            delete buffer;
+            break;
+            }
+
+        case EAknCmdHelp:
+            {
+            if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                 // Feature supported, launch the help application.
+                HlpLauncher::LaunchHelpApplicationL(
+                    iEikonEnv->WsSession(), AppHelpContextL() );
+                }
+            break;
+            }
+
+        default:
+            break;
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdAppUi::HandleResourceChangeL
+// -----------------------------------------------------------------------------
+void CUssdAppUi::HandleResourceChangeL( TInt aType )
+    {
+    CAknAppUi::HandleResourceChangeL( aType );
+
+    if( aType == KEikDynamicLayoutVariantSwitch )
+        {
+        iAppContainer->SetRect( ClientRect() );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CUssdAppUi::HandleForegroundEventL
+// Handle foreground event.
+// -----------------------------------------------------------------------------
+void CUssdAppUi::HandleForegroundEventL( TBool aForeground )
+    {
+    if ( iComms )
+        {
+        if ( aForeground )
+            {
+            // If app comes to foreground, we must know is the
+            // editor needs clearing.
+            if ( iComms->InformAppForeground() ) // ret ETrue if needs clearing
+                {
+                if ( iAppContainer )
+                    {
+                    iAppContainer->Editor().SetCursorPosL( 0, EFalse );
+                    iAppContainer->Editor().Text()->Reset();
+                    iAppContainer->Editor().HandleTextChangedL();
+
+                    if ( !FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                        {
+                        SetSoftkeySendVisibleL( EFalse );
+                        }
+
+                    }
+                }
+            }
+        else
+            {
+            iComms->InformAppBackground();
+            }
+        }
+
+    // Refresh message character counter
+    if( aForeground && iAppContainer )
+        {
+        iAppContainer->UpdateNavipaneMsgLengthL();
+        }
+    
+    CAknAppUi::HandleForegroundEventL( aForeground );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdAppUi::DynInitMenuPaneL
+// Set's Send option visible.
+//
+// If HELP is defined, the Options menu item 'Send' is removed if
+// the editor is empty. If it is not defined, the left softkey is 'Send' or
+// <empty>.
+// -----------------------------------------------------------------------------
+void CUssdAppUi::DynInitMenuPaneL(
+    TInt aResourceId,
+    CEikMenuPane* aMenuPane )
+    {
+    if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+        {
+        if ( aResourceId == R_USSD_MENU )
+            {
+            if ( aMenuPane )
+                {
+                aMenuPane->SetItemDimmed(
+                    EUssdMenuItemSend,
+                    iAppContainer->Editor().TextLength() == 0 );
+                }
+            // If aMenuPane == NULL, do nothing.
+            }
+
+        // If aResourceId != R_USSD_MENU, do nothing
+        }
+
+    // If help not defined, do nothing
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdAppUi::SetSofkeySendVisibleL
+// Sets Send softkey (in)visible.
+// -----------------------------------------------------------------------------
+void CUssdAppUi::SetSoftkeySendVisibleL(
+    TBool aVisible )
+    {
+    if ( !FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+        {
+        // Help not defined
+        TInt newResource;
+
+        if ( aVisible )
+            {
+            if ( iCbaResource == R_USSD_SOFTKEYS_SEND_EXIT )
+                {
+                return; // Send is already visible
+                }
+            newResource = R_USSD_SOFTKEYS_SEND_EXIT; // change it
+            }
+        else
+            {
+            if ( iCbaResource == R_AVKON_SOFTKEYS_EXIT )
+                {
+                return; // Send is already invisible
+                }
+            newResource = R_AVKON_SOFTKEYS_EXIT; // change it.
+            }
+
+        // Update Softkeys
+        Cba()->SetCommandSetL( newResource );
+        iCbaResource = newResource;
+        Cba()->DrawNow();
+        }
+
+    // If help defined, do nothing.
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/src/UssdComms.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,131 @@
+/*
+* 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:  Handles Ussd communications to the Phone Server.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "UssdComms.h"
+#include <CPhCltUssd.h>
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+// -----------------------------------------------------------------------------
+// CUssdComms::CUssdComms
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CUssdComms::CUssdComms()
+:   iExitReason( EPhCltExitReasonUnknown )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CUssdComms::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CUssdComms* CUssdComms::NewL()
+    {
+    CUssdComms* self = new( ELeave ) CUssdComms();    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();    // self
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdComms::ConstructL
+// Symbian 2nd phase constructor can leave.
+// 
+// -----------------------------------------------------------------------------
+//
+void CUssdComms::ConstructL()
+    {
+    iUssdClientInt = CPhCltUssdInt::NewL();
+    User::LeaveIfError( iUssdClientInt->AppStarting() );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdComms::~CUssdComms
+// Destructor.
+// 
+// -----------------------------------------------------------------------------
+//
+CUssdComms::~CUssdComms()
+    {
+    //disconnect from server. No need to check SubSessionHandles.
+
+    // Inform the exit reason.
+    // If send completed, then the USSD session is not canceled in server side,
+    // to ensure reply possibility to possible network request.
+    
+    if( iUssdClientInt )
+        {
+        iUssdClientInt->AppTerminating( iExitReason ); 
+        }
+    delete iUssdClientInt;  
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdAppUi::SendString
+// Sends given string to network via phone client.
+//
+// -----------------------------------------------------------------------------
+TInt CUssdComms::SendString( const TDesC& aString )
+    {
+    return iUssdClientInt->SendUssd( aString );
+    }
+
+// -----------------------------------------------------------------------------
+// CUssdAppUi::InformAppForeground
+// Informs the server that app is on foreground.
+//
+// -----------------------------------------------------------------------------
+TBool CUssdComms::InformAppForeground()
+    {
+    return iUssdClientInt->AppToForeground();
+    }
+
+// -----------------------------------------------------------------------------
+// CUssdAppUi::InformAppBackground
+// Informs the Server that app in on background
+//
+// -----------------------------------------------------------------------------
+void CUssdComms::InformAppBackground()
+    {
+    iUssdClientInt->AppToBackground();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdAppUi::InformExitReason
+// 
+// Inform the reason why app was terminated.
+// -----------------------------------------------------------------------------
+void CUssdComms::InformExitReason( TPhCltUssdAppExitReason aExitReason )
+    {
+    iExitReason = aExitReason;
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/src/UssdContainer.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,513 @@
+/*
+* 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: 
+*             Declares container control for application.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "UssdComms.h"
+#include    "UssdNaviPane.h"
+#include    "UssdAppUi.h"
+#include    "UssdContainer.h"
+#include    "UssdEditorLines.h"
+#include    <ussd.rsg>
+#include    "UssdLayout.h"
+#include    <aknkeys.h>
+#include    "ussd.hrh"
+#include    <eikedwin.h>
+#include    <bldvariant.hrh>
+#include    <featmgr.h>
+
+#include    <centralrepository.h>
+#include    <telinternalcrkeys.h>
+#include    "telephonyvariant.hrh"
+
+#include <csxhelp/ussd.hlp.hrh>  // for help context
+#include    "UssdApp.h" // for applicationUID
+#include    <AknUtils.h>
+
+// For skinning.
+#include    <AknsBasicBackgroundControlContext.h>
+#include    <AknsDrawUtils.h>
+#include    <AknsUtils.h>
+#include    <txtglobl.h>
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CUssdContainer::CUssdContainer
+// C++ constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CUssdContainer::CUssdContainer( CUssdAppUi& aAppUi ): iAppUi( aAppUi )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdContainer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CUssdContainer::ConstructL( const TRect& aRect )
+    {
+    CreateWindowL();
+
+    // Create background control context for skins.
+    iBgContext = CAknsBasicBackgroundControlContext::NewL(
+        KAknsIIDQsnBgAreaMainMessage, aRect, ETrue /*Parent absolute*/ );
+
+    // Create editor
+    iEditor = CreateEdwinL();
+
+    // Lines
+    iLines = new ( ELeave ) CUssdEditorLines;
+    iLines->ConstructL( this );
+
+    TInt featureBitmask( 0 );
+
+    // Connecting and initialization KCRUidTelVariation
+    CRepository* repository = CRepository::NewL( KCRUidTelVariation );
+    CleanupStack::PushL( repository );
+
+    // Get the value from Central Repository
+    repository->Get( KTelVariationFlags, featureBitmask );
+    if ( featureBitmask & KTelephonyLVFlagUssdUIRemainingChars )
+        {
+        iNaviPaneHandler = CUssdNaviPane::NewL( iAppUi );
+        }
+
+    CleanupStack::PopAndDestroy( repository );
+
+    // Finish the job
+    SetRect( aRect );
+    ActivateL();
+
+    iEditor->SetFocus( ETrue );
+    }
+
+
+// Destructor
+CUssdContainer::~CUssdContainer()
+    {
+    delete iLines;
+
+    AknsUtils::DeregisterControlPosition( iEditor );
+    delete iEditor;
+    delete iNaviPaneHandler;
+
+    delete iBgContext; // For skinning, can be deleted, NULL if not exist.
+    }
+
+// -----------------------------------------------------------------------------
+// CUssdContainer::HandleEdwinEventL
+// Called by framework when the Editor is changed
+//
+// -----------------------------------------------------------------------------
+//
+void CUssdContainer::HandleEdwinEventL( CEikEdwin* /*aEdwin*/,
+        TEdwinEvent aEventType )
+    {
+     switch( aEventType )
+         {
+         case EEventTextUpdate:
+             {
+             UpdateNavipaneMsgLengthL();
+             break;
+             }
+         default:
+             break;
+         }
+    }
+    
+// -----------------------------------------------------------------------------
+// CUssdContainer::SizeChanged
+// Called by framework when the view size is changed
+//
+// -----------------------------------------------------------------------------
+//
+void CUssdContainer::SizeChanged()
+    {
+    // Backgroud context
+    iBgContext->SetParentPos( PositionRelativeToScreen() );
+    iBgContext->SetRect( Rect() ) ;
+    // Edwin
+    AknLayoutUtils::LayoutEdwin(
+        iEditor,
+        Rect(),
+        UssdLayout::MessageWritingTexts3() );
+
+    // We need to make some room for scrollbar to fit
+    // so the editor must be narrowed down a bit.
+
+    TAknLayoutId layout = UssdLayout::CurrentLayout();
+    TRect sbr = iEditor->ScrollBarFrame()->VerticalScrollBar()->Rect();
+
+    if( layout != EAknLayoutIdABRW )
+        {
+        TPoint editorTLPoint(Rect().iTl.iX, iEditor->Rect().iTl.iY);
+
+        iEditor->SetExtent( editorTLPoint ,
+                    TSize( Rect().Width() - sbr.Width(), sbr.Height() ) );
+        }
+    else // right to left layout
+        {
+        TPoint editorTLPoint( ( Rect().iTl.iX + sbr.Width() ),
+                                iEditor->Rect().iTl.iY);
+
+        iEditor->SetExtent( editorTLPoint ,
+                            TSize( Rect().Width() - sbr.Width(),
+                            sbr.Height() ) );
+        }
+
+    TRAP_IGNORE( UpdateNavipaneMsgLengthL() );
+
+    // overwite inputmode in portraitmode
+    if ( Rect().Height() > Rect().Width() )
+        {
+        iEditor->SetAknEditorCurrentInputMode( EAknEditorNumericInputMode );
+        }
+
+    // Change the colour of the edwin if needed
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    if ( skin )
+        {
+        TRgb color;
+        TInt error = AknsUtils::GetCachedColor(
+            skin,
+            color,
+            KAknsIIDQsnTextColors,
+            EAknsCIQsnTextColorsCG6 );
+
+        if ( error == KErrNone )
+            {
+            TCharFormat charFormat;
+            TCharFormatMask charFormatMask;
+            ( reinterpret_cast< CGlobalText* >( iEditor->Text() ) )
+                ->GetCharFormat( charFormat, charFormatMask, 0, 0 );
+
+            charFormat.iFontPresentation.iTextColor = color;
+            charFormatMask.SetAll();
+
+            CCharFormatLayer* charFormatLayer = NULL;
+
+            TRAP( error, charFormatLayer =
+                CCharFormatLayer::NewL( charFormat,charFormatMask ) );
+
+            if ( !error )
+                {
+                iEditor->SetCharFormatLayer( charFormatLayer );
+                }
+            }
+        }
+
+    // Set editor lines
+    iLines->SetRect( Rect() );
+
+    AknsUtils::RegisterControlPosition( iEditor );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdContainer::CountComponentControls
+//
+//
+// -----------------------------------------------------------------------------
+//
+TInt CUssdContainer::CountComponentControls() const
+    {
+    return 2; // editor and lines
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdContainer::ComponentControl
+//
+// -----------------------------------------------------------------------------
+//
+CCoeControl* CUssdContainer::ComponentControl( TInt aIndex ) const
+    {
+    switch ( aIndex )
+        {
+        case 0:
+            return iEditor;
+        case 1:
+            return iLines;
+        default:
+            return NULL;
+        }
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdContainer::Draw
+//
+// -----------------------------------------------------------------------------
+//
+void CUssdContainer::Draw( const TRect& aRect ) const
+    {
+    CWindowGc& gc = SystemGc();
+
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+
+    if ( iBgContext )
+        {
+        AknsDrawUtils::Background(
+            skin, iBgContext, this, gc, aRect);
+        }
+    else
+        {
+        // Otherwise clear the area
+        gc.SetBrushColor( AKN_LAF_COLOR( UssdLayout::LayoutColourWhite() ) );
+        DrawUtils::ClearBetweenRects( gc, aRect, iEditor->Rect() );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdContainer::OfferKeyEventL
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CUssdContainer::OfferKeyEventL(
+    const TKeyEvent& aKeyEvent, TEventCode aType )
+    {
+    TKeyResponse response = EKeyWasNotConsumed;
+
+    // Special key handling comes first.
+    if ( aKeyEvent.iScanCode == EStdKeyYes ) // Send key.
+        {
+        // The reason that the send key is handled via TStdScanCode rather than TKeyCode is that
+        // we also have to be able to catch EEventKeyUp and EEventKeyDown key events in addition
+        // to EEventKey. This is because TKeyEvent::iCode is always 0 when TEventCode is EEventKey.
+        if ( iEditor->TextLength() )
+            {
+            if ( aType == EEventKey )
+                {
+                if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                    {
+                    iAppUi.HandleCommandL( EUssdMenuItemSend );
+                    }
+                else
+                    {
+                    iAppUi.HandleCommandL( EUssdSoftkeySend );
+                    }
+                }
+            response = EKeyWasConsumed; // Dialer should not be launched when the USSD string exists and send key is used.
+            }
+        }
+    else if ( aKeyEvent.iCode == EKeyEscape )
+        {
+        iAppUi.HandleCommandL( EAknSoftkeyExit );
+        response = EKeyWasConsumed;
+        }
+    else // Default keys are handled here.
+        {
+        response = iEditor->OfferKeyEventL( aKeyEvent, aType );
+
+        if ( aType == EEventKey || aType == EEventKeyUp )
+            {
+            UpdateNavipaneMsgLengthL();
+            }
+
+        if ( !FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+            {
+            // Change softkeys if needed.
+            iAppUi.SetSoftkeySendVisibleL( iEditor->TextLength() != 0 );
+            }
+
+            iAppUi.Cba()->SetCommandSetL( R_USSD_SOFTKEYS_OPTIONS_EXIT_OPTIONS );
+            iAppUi.Cba()->DrawNow();
+        }
+
+    return response;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdContainer::Editor
+// Give editor
+// -----------------------------------------------------------------------------
+//
+CEikEdwin& CUssdContainer::Editor()
+    {
+    return *iEditor;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdContainer::FocusChanged
+//
+// -----------------------------------------------------------------------------
+//
+void CUssdContainer::FocusChanged( TDrawNow aDrawNow )
+    {
+    iEditor->SetFocus( IsFocused(), aDrawNow );
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CUssdContainer::GetHelpContext
+// This function is called when Help application is launched.
+//
+// -----------------------------------------------------------------------------
+//
+void CUssdContainer::GetHelpContext(
+    TCoeHelpContext& aContext ) const
+    {
+    // If help defined.
+    if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+        {
+        aContext.iMajor = KUidussd;
+        aContext.iContext = KUSSD_HLP_EDITOR;
+        }
+
+    // If help not defined, do nothing
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CUssdContainer::HandleResourceChange
+// This function is called when Help application is launched.
+//
+// -----------------------------------------------------------------------------
+//
+void CUssdContainer::HandleResourceChange( TInt aType )
+    {
+    switch ( aType )
+        {
+        case KEikColorResourceChange:
+        case KAknsMessageSkinChange:
+            {
+            SizeChanged();
+            DrawDeferred();
+            break;
+            }
+
+        default:
+            {
+            CCoeControl::HandleResourceChange( aType );
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdContainer::MopSupplyObject
+//
+// -----------------------------------------------------------------------------
+//
+TTypeUid::Ptr CUssdContainer::MopSupplyObject( TTypeUid aId )
+    {
+    if ( aId.iUid == MAknsControlContext::ETypeId )
+        {
+        return MAknsControlContext::SupplyMopObject( aId, iBgContext );
+        }
+    return CCoeControl::MopSupplyObject( aId );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdContainer::CreateEdwinL
+// Creates new edwin
+//
+// -----------------------------------------------------------------------------
+//
+CEikEdwin* CUssdContainer::CreateEdwinL()
+    {
+    CEikEdwin* newEditor = new ( ELeave ) CEikEdwin;
+    CleanupStack::PushL( newEditor );
+    newEditor->SetContainerWindowL( *this );
+    //Set the editor observer
+    newEditor->SetEdwinObserver( this );
+    
+    newEditor->SetAknEditorAllowedInputModes(
+        EAknEditorNumericInputMode | EAknEditorTextInputMode );
+    newEditor->SetAknEditorInputMode( EAknEditorNumericInputMode );
+    newEditor->SetAknEditorNumericKeymap( EAknEditorStandardNumberModeKeymap );
+
+    TInt editorFlags = EAknEditorFlagNoT9 | EAknEditorFlagEnableScrollBars;
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdJapanese ) )
+        {
+        editorFlags |= EAknEditorFlagLatinInputModesOnly;
+        }
+
+     if( FeatureManager::FeatureSupported( KFeatureIdPenSupport ) )
+        {
+        editorFlags |= EAknEditorFlagDeliverVirtualKeyEventsToApplication;
+        }
+
+    newEditor->SetAknEditorFlags( editorFlags );
+
+    // Get the layout, i.e. variant.
+    EVariantFlag variant = AknLayoutUtils::Variant();
+
+    // According to layout, construct the editor.
+    if ( variant == EApacVariant )
+        {
+        // APAC variant
+        AknEditUtils::ConstructEditingL( newEditor , R_USSD_EDWIN_EDITOR_APAC );
+        }
+    else
+        {
+        // EEuropeanVariant (includes ABRW)
+        AknEditUtils::ConstructEditingL( newEditor , R_USSD_EDWIN_EDITOR_ELAF );
+        }
+
+    CleanupStack::Pop( newEditor );
+    return newEditor;
+    }
+
+// ---------------------------------------------------------
+// CUssdContainer::UpdateNavipaneMsgLengthL
+// ---------------------------------------------------------
+void CUssdContainer::UpdateNavipaneMsgLengthL()
+    {
+
+    if ( iNaviPaneHandler )
+        {
+
+        TInt maxLen=0;
+        TBuf<KUssdEditorMaxLenght> inputTexts;
+
+        iEditor->GetText( inputTexts );
+
+        maxLen = iNaviPaneHandler->UpdateMsgLengthL( inputTexts, this );
+
+        // if pasted more than 91 chinese characters then it must be
+        // cutted and set correct message length in navi pane
+        if ( inputTexts.Length() > maxLen )
+            {
+            inputTexts.Copy( inputTexts.Left( maxLen ) );
+            iEditor->SetTextL( &inputTexts );
+            iNaviPaneHandler->UpdateMsgLengthL( inputTexts, this );
+            iEditor->DrawNow();
+            iEditor->SetCursorPosL( maxLen, EFalse );
+            }
+
+        iEditor->SetMaxLength( maxLen );
+
+        }
+
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/src/UssdDocument.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  USSD application document functionality. 
+*
+*/
+
+
+// INCLUDE FILES
+#include "UssdDocument.h"
+#include "UssdAppUi.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+// -----------------------------------------------------------------------------
+// CUssdDocument::CUssdDocument
+// C++ constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CUssdDocument::CUssdDocument( CEikApplication& aApp )
+    : CAknDocument( aApp )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdDocument::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CUssdDocument* CUssdDocument::NewL(
+    CEikApplication& aApp )     // CUssdApp reference
+    {
+    CUssdDocument* self = new ( ELeave ) CUssdDocument(aApp);
+    return self;
+    }
+
+    
+// Destructor
+CUssdDocument::~CUssdDocument()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdDocument::CreateAppUiL()
+// constructs CUssdAppUi
+//
+// -----------------------------------------------------------------------------
+CEikAppUi* CUssdDocument::CreateAppUiL()
+    {
+    return new(ELeave) CUssdAppUi;
+    }
+
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/src/UssdEditorLines.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,176 @@
+/*
+* 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:  Declares window owning control for editor lines.
+*
+*/
+
+
+// INCLUDE FILES
+#include    <AknsDrawUtils.h>
+#include    <eikenv.h>
+
+#include    "UssdEditorLines.h"
+#include    "UssdLayout.h"
+
+// CONSTANTS
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CUssdEditorLines::CUssdEditorLines
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CUssdEditorLines::CUssdEditorLines()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdEditorLines::ConstructL
+// Symbian 2nd phase constructor can leave.
+// 
+// -----------------------------------------------------------------------------
+//
+void CUssdEditorLines::ConstructL( const CCoeControl* aParent )
+    {
+    // Create an own window
+    CreateWindowL( aParent );
+    
+    // This window draws editor row lines, so enable window 
+    // transparency to display the editor window content as background 
+    // for this line-window.
+    EnableWindowTransparency();
+      
+    // Create region buffer.
+    iRegBuf = new ( ELeave ) RRegionBuf< KUssdMaxNumberOfEditorLines >;
+
+    // Create rects
+
+    iRects = new ( ELeave ) CArrayPtrFlat<TAknLayoutRect>( KUssdMaxNumberOfEditorLines );
+    iRects->SetReserveL( KUssdMaxNumberOfEditorLines );
+
+    TAknLayoutRect* rect = NULL;
+    for ( TInt i = 0 ; i < KUssdMaxNumberOfEditorLines ; i++ )
+        {
+        rect = new ( ELeave ) TAknLayoutRect;
+        iRects->InsertL( i , rect ); // Can't leave
+        }
+
+    SetRect( aParent->Rect() );
+    SetFocus( ETrue );
+
+    // activate control
+    ActivateL();
+    }
+
+
+// Destructor
+CUssdEditorLines::~CUssdEditorLines()
+    {
+    if ( iRects )
+        {
+        iRects->ResetAndDestroy() ;
+        delete iRects;
+        }
+
+    if ( iRegBuf )
+        {
+        iRegBuf->Close() ;
+        delete iRegBuf;
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdEditorLines::SizeChanged
+// Called by framework when the view size is changed
+//  
+// -----------------------------------------------------------------------------
+//
+void CUssdEditorLines::SizeChanged()
+    {
+    // Move rectangles to right position
+    
+    for ( TInt i = 0; 
+          iRects && i < iRects->Count() && i < UssdLayout::NumberOfEditorLines(); 
+          i++ )
+        {
+        iRects->At( i )->LayoutRect( Rect() , 
+            UssdLayout::MessageWritingLayoutElements6( i+1 ) );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CUssdEditorLines::Draw
+// 
+// -----------------------------------------------------------------------------
+//
+void CUssdEditorLines::Draw( const TRect& aRect ) const
+    {
+    // Take the colour from some ramdom line.
+    // Here it is takem from the first line.
+
+    TRgb lineColour( KRgbWhite );
+
+    if ( iRects->Count() )
+        {
+        lineColour = iRects->At( 0 )->Color();
+        }
+
+    // Get skin colour if set.
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    TRgb skinColor;
+    TInt error = 
+        AknsUtils::GetCachedColor( 
+            skin, 
+            skinColor, 
+            KAknsIIDQsnLineColors,
+            EAknsCIQsnLineColorsCG6 );
+
+    if ( error == KErrNone )
+        {
+        lineColour = skinColor;
+        }
+    CWindowGc& gc = SystemGc();
+    gc.SetBrushColor( lineColour );
+    
+    // Draw row lines by clearing rectangles corresponding to row locations.
+    TInt count( iRects->Count() );
+    TInt lines( UssdLayout::NumberOfEditorLines() );
+    for ( TInt i = 0; iRects && i < count && i < lines; i++ )
+        {
+        gc.Clear( iRects->At( i )->Rect() );
+        }
+   }
+
+// -----------------------------------------------------------------------------
+// CUssdEditorLines::HandlePointerEventL
+//
+// -----------------------------------------------------------------------------
+//
+void CUssdEditorLines::HandlePointerEventL(const TPointerEvent& aPointerEvent)
+    {
+    // Temporary variant for text editor.
+    CCoeControl *editor( Parent() ? Parent()->ComponentControl( 0 ) : NULL );
+    // Redirect pointer event to CEikEdwin, so as that CEikEdwin can popup
+    // virtual keyboard when user gives a click input.
+    if ( editor )
+        {
+        editor->HandlePointerEventL( aPointerEvent );
+        }
+    }
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/src/UssdLayout.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,111 @@
+/*
+* 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:  Layout definitions from Application LAF
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "UssdLayout.h"
+#include    <aknenv.h>
+#include    <bldvariant.hrh>
+#include    <featmgr.h>
+#include    <applayout.cdl.h>
+#include <aknlayoutscalable_apps.cdl.h>
+
+
+// CONSTANTS
+
+#ifdef _DEBUG
+// Panic types to be used in this file.
+enum TUssdPanicTypes
+    {
+    EUssdPanicNOEL = 0,
+    EUssdPanicPBL,
+    EUssdPanicMWLE6,
+    EUssdPanicMWT3,
+    //
+    EPhCltPanicLast
+    };
+
+#endif
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+// -----------------------------------------------------------------------------
+// UssdLayout::CurrentLayout
+// -----------------------------------------------------------------------------
+//
+TAknLayoutId UssdLayout::CurrentLayout()
+    {
+    TAknLayoutId layoutId;
+    CAknEnv::Static()->GetCurrentLayoutId( layoutId );
+    return layoutId;
+    }
+
+// -----------------------------------------------------------------------------
+// UssdLayout::LayoutColourWhite
+// -----------------------------------------------------------------------------
+//
+TInt UssdLayout::LayoutColourWhite()
+    {
+    return 0;  // White
+    }
+
+// -----------------------------------------------------------------------------
+// UssdLayout::NumberOfEditorLines
+// -----------------------------------------------------------------------------
+//
+TInt UssdLayout::NumberOfEditorLines()
+    {
+    TInt retVal = KErrNotFound;
+	TAknLayoutScalableParameterLimits scalbleParamLimits;
+	scalbleParamLimits = AknLayoutScalable_Apps::list_single_mce_message_pane_ParamLimits();    
+    
+    retVal = scalbleParamLimits.LastRow();
+    return retVal;
+    }
+
+// -----------------------------------------------------------------------------
+// UssdLayout::MessageWritingLayoutElements6
+// -----------------------------------------------------------------------------
+//
+UssdLayout::TWindowLineLayoutType
+    UssdLayout::MessageWritingLayoutElements6( TInt aLine )
+    {
+    __ASSERT_ALWAYS( 
+        aLine >= 1 && aLine <= NumberOfEditorLines(), 
+        User::Invariant() );
+
+    TInt index_C = 0;
+    TInt index_T = aLine - 1;
+    return 
+        AppLayout::Message_writing_layout_elements_Line_6( index_C, index_T );
+    }
+
+// -----------------------------------------------------------------------------
+// UssdLayout::MessageWritingTexts3
+// -----------------------------------------------------------------------------
+//
+UssdLayout::TTextLineLayoutType UssdLayout::MessageWritingTexts3()
+    {
+    TInt numberOfLines = NumberOfEditorLines();
+    return
+        AppLayout::Multiline_Message_writing_texts_Line_3( numberOfLines ); 
+    }
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/Ussd/src/UssdNaviPane.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,313 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declares navi pane control for application.
+*
+*/
+
+
+// INCLUDE FILES
+#include    <gsmuset.h>                 // CCnvCharacterSetConverter
+#include    <aknenv.h>                  // CAknEnv
+#include    <aknnavide.h>               // CAknNavigationDecorator
+#include    <aknEditStateIndicator.h>
+#include    <AknIndicatorContainer.h>
+#include    <aknnavilabel.h>
+#include    "UssdComms.h" 
+
+#include    "UssdAppUi.h"
+#include    "UssdNaviPane.h"
+ 
+#include <AknUtils.h>
+// CONSTANTS
+
+// Unicode char codes for GSM 03.38 7 bit ext table characters 
+static const TUint KUssdEdEuroSymbol = 0x20ac;
+static const TUint KUssdEdLeftSquareBracket = 0x5b;
+static const TUint KUssdEdReverseSolidus = 0x5c;
+static const TUint KUssdEdRightSquareBracket = 0x5d;
+static const TUint KUssdEdCircumflexAccent = 0x5e;
+static const TUint KUssdEdLeftCurlyBracket = 0x7b;
+static const TUint KUssdEdVerticalLine = 0x7c;
+static const TUint KUssdEdRightCurlyBracket = 0x7d;
+static const TUint KUssdEdTilde = 0x7e;
+static const TUint KUssdDownwardsArrowLeft = 0x21B2;
+static const TUint KUssdDownwardsArrowRight = 0x21B3;
+static const TUint KUssdCharDwithLine = 0xD0;
+static const TUint KUssdCharBigRhoo = 0xDE; 
+static const TUint KUssdCharSmallDelta = 0xF0;
+static const TUint KUssdCharSmallFii = 0xFE;
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CUssdNaviPane::CUssdNaviPane
+// C++ constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CUssdNaviPane::CUssdNaviPane( CUssdAppUi& aAppUi ): iAppUi( aAppUi )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CUssdNaviPane::NewL
+//
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+CUssdNaviPane* CUssdNaviPane::NewL( CUssdAppUi& aAppUi )
+    {
+    CUssdNaviPane* self = new ( ELeave ) CUssdNaviPane( aAppUi );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CUssdNaviPane::ConstructL
+//
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CUssdNaviPane::ConstructL()
+    {
+    
+    CreateExtraNaviLabelL();
+
+    iCharacterSetConverter = CCnvCharacterSetConverter::NewL();
+
+    iCharacterSetConverter->PrepareToConvertToOrFromL(
+        KCharacterSetIdentifierSms7Bit,
+        iCoeEnv->FsSession() );
+
+    iCharacterSetConverter->SetDowngradeForExoticLineTerminatingCharacters(
+        CCnvCharacterSetConverter::EDowngradeExoticLineTerminatingCharactersToJustLineFeed );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CUssdNaviPane::~CUssdNaviPane
+// 
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CUssdNaviPane::~CUssdNaviPane()
+    {
+    
+    if ( iNaviPane && iNaviDecorator )
+        {
+        iNaviPane->Pop( iNaviDecorator );
+        delete iNaviDecorator;
+        iNaviDecorator = NULL;
+        iNaviPane = NULL;
+        }
+    
+    delete iCharacterSetConverter;
+    iCharacterSetConverter = NULL;
+
+    iNaviLabel = NULL;
+
+    }
+  
+// ----------------------------------------------------
+// CUssdNaviPane::CreateExtraNaviLabelL
+// Creates an extra navi label.
+// (other items were commented in a header).
+// ----------------------------------------------------
+//
+void CUssdNaviPane::CreateExtraNaviLabelL()
+    {
+      
+    CEikStatusPane* sp = iAppUi.StatusPane();
+    iNaviPane = static_cast<CAknNavigationControlContainer*>( 
+        sp->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) );     
+    
+    iNaviDecorator = iNaviPane->CreateNavigationLabelL( 
+        KNullDesC );
+    iNaviLabel = static_cast<CAknNaviLabel*>( 
+        iNaviDecorator->DecoratedControl() );
+    iNaviPane->PushL( *iNaviDecorator ) ;
+    
+    }
+
+// ---------------------------------------------------------
+// CUssdNaviPane::UpdateMsgLengthL
+// Update the message length information to navipane
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CUssdNaviPane::UpdateMsgLengthL( const TDesC& aInputString, 
+                                             CCoeControl* aControl )
+    {
+    TInt maxLen(0);
+    const TInt txtLen = aInputString.Length();
+ 
+    HBufC* digitBuffer = HBufC::NewLC( EAknMaxIntegerDigits ); 
+    TPtr bufPtr( digitBuffer->Des() );
+ 
+    if ( NeedsToBeSentAsUnicodeL( aInputString ) )
+        {
+        bufPtr.AppendNum( KUssdEditorMaxLenght/2 - txtLen );
+        maxLen=KUssdEditorMaxLenght/2;
+        }
+    else
+        {
+        TInt extendedCount = CountExtendedTableChars( aInputString );
+        TInt totalLen = KUssdEditorMaxLenght - ( txtLen + extendedCount );
+        if ( totalLen < 0 ) // last was alphabet extended when one left
+            {
+            GenerateBackSpaceKeyL( aControl );
+            extendedCount--;
+            totalLen = totalLen+2;
+            }
+        bufPtr.AppendNum( totalLen );
+        maxLen=KUssdEditorMaxLenght-extendedCount;
+        }
+    
+   AknTextUtils::LanguageSpecificNumberConversion( bufPtr );
+
+    // Giving msg length string to indicator container
+    MAknEditingStateIndicator* stateIndicator = 
+        iAvkonEnv->EditingStateIndicator();
+    if ( stateIndicator )
+        {
+        CAknIndicatorContainer* iIndicatorContainerSMS = 
+            stateIndicator->IndicatorContainer();
+        if ( iIndicatorContainerSMS )
+            {
+            iIndicatorContainerSMS->SetIndicatorState( 
+                TUid::Uid( EAknNaviPaneEditorIndicatorMessageLength ), 
+                EAknIndicatorStateOn );
+            iIndicatorContainerSMS->SetIndicatorValueL(
+                TUid::Uid( EAknNaviPaneEditorIndicatorMessageLength ), 
+                *digitBuffer );
+            }
+        }
+    
+    iNaviLabel->SetTextL( *digitBuffer );
+    CleanupStack::PopAndDestroy( digitBuffer );
+    
+    return maxLen;
+    }
+ 
+
+// ---------------------------------------------------------
+// CUssdNaviPane::NeedsToBeSentAsUnicodeL
+// Checks if there are any unicode characters in the message
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TBool CUssdNaviPane::NeedsToBeSentAsUnicodeL( const TDesC& aInputString ) const
+    {
+    
+    TBool needsToBeSentAsUnicode = EFalse;
+      
+    for ( TPtrC remainderOfInputString( aInputString ); 
+          remainderOfInputString.Length()>0 ; )
+        {
+        TBuf8<KUssdEditorMaxLenght> notUsedForeignParam;
+        TInt numberOfUnconvertibleCharacters = 0;
+        const TInt returnValue = 
+            iCharacterSetConverter->ConvertFromUnicode( 
+                notUsedForeignParam,
+                remainderOfInputString, 
+                numberOfUnconvertibleCharacters );
+        if ( ( returnValue < 0 ) || 
+             ( numberOfUnconvertibleCharacters > 0 )) 
+            // if there was an error in trying to do the conversion, or if 
+            // there was an unconvertible character (e.g. a Chinese character)
+            {
+            TUint uChar;
+            for ( TInt i = 0;i < remainderOfInputString.Length();i++ )
+                {
+                uChar = TUint( remainderOfInputString[ i ] );
+                if ( uChar ==  KUssdDownwardsArrowLeft || 
+                     uChar == KUssdDownwardsArrowRight ||
+                     uChar == KUssdCharDwithLine ||
+                     uChar == KUssdCharBigRhoo ||
+                     uChar == KUssdCharSmallDelta ||
+                     uChar == KUssdCharSmallFii )
+                    {
+                    numberOfUnconvertibleCharacters--;
+                    }  
+                }
+                   
+            if ( returnValue < 0 || numberOfUnconvertibleCharacters > 0  ) 
+                {
+                // if there was an error in trying to do the conversion, or if there was an
+                // unconvertible character (e.g. a Chinese character)
+                needsToBeSentAsUnicode = ETrue;
+                break;
+                }      
+            }
+        
+        remainderOfInputString.Set( 
+            remainderOfInputString.Right( returnValue ) );
+        }
+    return needsToBeSentAsUnicode;
+    }
+
+// ---------------------------------------------------------
+// CUssdNaviPane::CountExtendedTableChars
+// Counts if there are 7bit extended table characters in message
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CUssdNaviPane::CountExtendedTableChars( const TDesC& aInputString ) const
+    {
+    const TInt total = aInputString.Length();
+    TInt extChars = 0;
+    
+    TUint uChar;
+    for ( TInt i=0; i < total; i++ )
+        {
+        uChar = TUint(aInputString[i]);
+        if (( uChar == KUssdEdLeftSquareBracket) || 
+            ( uChar == KUssdEdReverseSolidus ) || 
+            ( uChar == KUssdEdRightSquareBracket ) || 
+            ( uChar == KUssdEdCircumflexAccent ) || 
+            ( uChar == KUssdEdLeftCurlyBracket ) || 
+            ( uChar == KUssdEdVerticalLine ) || 
+            ( uChar == KUssdEdRightCurlyBracket ) || 
+            ( uChar == KUssdEdTilde ) || 
+            ( uChar == KUssdEdEuroSymbol )) 
+            {
+            extChars = extChars + 1;
+            }
+        }
+    return extChars;
+    }
+
+// ---------------------------------------------------------
+// CUssdNaviPane::GenerateBackSpaceKeyL
+// Generates a backspace key press event.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CUssdNaviPane::GenerateBackSpaceKeyL( CCoeControl* aControl )
+    {
+    TKeyEvent keyEvent;
+    keyEvent.iCode = EKeyBackspace;
+    keyEvent.iScanCode = EStdKeyBackspace;
+    keyEvent.iRepeats = 1;
+    keyEvent.iModifiers = 0;
+    TEventCode type = EEventKey;
+
+    if ( aControl )
+        {
+        aControl->OfferKeyEventL( keyEvent, type );
+        }
+    }
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/bwins/dialeru.def	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,8 @@
+EXPORTS
+	??1CDialer@@UAE@XZ @ 1 NONAME ; CDialer::~CDialer(void)
+	??1CVideoDTMFDialer@@UAE@XZ @ 2 NONAME ; CVideoDTMFDialer::~CVideoDTMFDialer(void)
+	?NewL@CDialer@@SAPAV1@ABVCCoeControl@@ABVTRect@@@Z @ 3 NONAME ; class CDialer * CDialer::NewL(class CCoeControl const &, class TRect const &)
+	?NewL@CVideoDTMFDialer@@SAPAV1@ABVCCoeControl@@AAV2@ABVTRect@@@Z @ 4 NONAME ; class CVideoDTMFDialer * CVideoDTMFDialer::NewL(class CCoeControl const &, class CCoeControl &, class TRect const &)
+	?NumberEntry@CDialer@@QAEPAVMNumberEntry@@XZ @ 5 NONAME ; class MNumberEntry * CDialer::NumberEntry(void)
+	?SetNumberEntryObserver@CDialer@@UAEXAAVMNumberEntryObserver@@@Z @ 6 NONAME ; void CDialer::SetNumberEntryObserver(class MNumberEntryObserver &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/data/dialer.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,30 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing the dialer.
+;
+; Languages
+&EN
+
+; Header
+#{"Dialer"}, (0x102078ED), 10, 1, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files to install
+"\epoc32\release\armv5\urel\dialer.dll"-"z:\sys\bin\dialer.dll"
+"\epoc32\data\z\resource\dialer.rsc"-"z:\resource\dialer.rsc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/data/dialer.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  This file contains all the resources for the Dialer. 
+*
+*/
+
+
+// RESOURCE IDENTIFIER
+NAME DIAL // 4 letter ID
+
+// INCLUDES
+#include <e32keys.h>
+#include <eikon.rh>
+#include <eikon.rsg>
+#include <EIKCORE.rsg>
+#include <uikon.hrh>
+#include <avkon.hrh>
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.mbg>
+#include <avkon.loc>
+#include <data_caging_paths_strings.hrh>
+
+
+
+// CONSTANTS 
+
+// RESOURCE DEFINITIONS 
+
+// ---------------------------------------------------------
+//   
+// RSS_SIGNATURE
+// Signature.
+//
+// ---------------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE { }
+
+// ---------------------------------------------------------
+//   
+// Default Document Name
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF { buf="Dialer"; }
+
+
+RESOURCE EIK_APP_INFO
+    {
+    cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
+    }
+
+// -----------------------------------------------------------------------------
+//   
+// r_inputfield
+// Input field definion
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE PHONE_NUMBER_EDITOR r_inputfield
+    {
+    maxChars = 100;
+    maxLines = 5;
+    truncation = <0x2026>; // three dots: ...
+    formats =
+        {
+        PHONE_NUMBER_EDITOR_FORMAT // 4 lines
+            {
+            top=0;
+            left=0;
+            bottom=0;
+            right=0;
+            lines=4;
+            bottomBaselineOffset=0;
+            baselineSeparation=0;
+            font=ELatinBold17;
+            },
+        PHONE_NUMBER_EDITOR_FORMAT // 5 lines
+            {
+            top=94;
+            left=11;
+            bottom=130;
+            right=165;
+            lines=5;
+            bottomBaselineOffset=0;
+            baselineSeparation=0;
+            font=ELatinBold13;
+            }
+        };
+     }
+
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/data/dialer_stub.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,30 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing the dialer stub.
+;
+; Languages
+&EN
+
+; Header
+#{"Dialer"}, (0x102078ED), 10, 0, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files to install
+""-"z:\sys\bin\dialer.dll"
+""-"z:\resource\dialer.rsc"
Binary file phoneuis/dialer/data/dialer_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/eabi/dialeru.def	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,13 @@
+EXPORTS
+	_ZN16CVideoDTMFDialer4NewLERK11CCoeControlRS0_RK5TRect @ 1 NONAME
+	_ZN16CVideoDTMFDialerD0Ev @ 2 NONAME
+	_ZN16CVideoDTMFDialerD1Ev @ 3 NONAME
+	_ZN16CVideoDTMFDialerD2Ev @ 4 NONAME
+	_ZN7CDialer11NumberEntryEv @ 5 NONAME
+	_ZN7CDialer22SetNumberEntryObserverER20MNumberEntryObserver @ 6 NONAME
+	_ZN7CDialer4NewLERK11CCoeControlRK5TRect @ 7 NONAME
+	_ZN7CDialerD0Ev @ 8 NONAME
+	_ZN7CDialerD1Ev @ 9 NONAME
+	_ZN7CDialerD2Ev @ 10 NONAME
+	_ZThn52_N7CDialer22SetNumberEntryObserverER20MNumberEntryObserver @ 11 NONAME ; #<thunk>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build file for the Dialer
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../inc/cdialer.h            |../../../inc/cdialer.h
+../inc/mnumberentry.h       |../../../inc/mnumberentry.h
+../inc/dialer.hrh           |../../../inc/dialer.hrh
+
+../data/dialer_stub.sis     /epoc32/data/z/system/install/dialer_stub.sis
+
+../rom/dialer.iby           CORE_APP_LAYER_IBY_EXPORT_PATH(dialer.iby)
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE dialer.mif
+  OPTION HEADERFILE dialer.mbg
+  OPTION SOURCEFILE iconlist.txt
+END
+
+PRJ_MMPFILES
+../group/dialer.mmp
+../group/dialerstub.mmp
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/group/dialer.mmp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This is project specification file for the Dialer. 
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+// Capability assignment.
+CAPABILITY CAP_GENERAL_DLL
+
+// Assign Vendor ID.
+VENDORID VID_DEFAULT
+
+TARGET      dialer.dll
+TARGETTYPE  dll
+UID         0x1000008d 0x102078ED 
+
+START RESOURCE ../data/dialer.rss
+TARGETPATH   RESOURCE_FILES_DIR 
+HEADER
+LANGUAGE_IDS
+END  // RESOURCE
+
+SOURCEPATH  ../src
+SOURCE  cdialer.cpp
+SOURCE  cdialercontainerbase.cpp
+SOURCE  cdialerkeypadcontainer.cpp
+SOURCE  cdialernumberentry.cpp
+SOURCE  cdialervideocontainer.cpp
+SOURCE  cvideodtmfdialer.cpp
+
+USERINCLUDE ../inc 
+USERINCLUDE ../data 
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY euser.lib eikcore.lib estor.lib etext.lib 
+LIBRARY cone.lib ws32.lib bmpanim.lib 
+LIBRARY eikcoctl.lib fbscli.lib bafl.lib 
+
+LIBRARY aknskins.lib aknicon.lib avkon.lib
+LIBRARY cdlengine.lib
+LIBRARY aknlayout2scalable.lib
+
+LIBRARY egul.lib
+LIBRARY efsrv.lib
+LIBRARY aknlayout2.lib touchfeedback.lib
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/group/dialer_icons.mk	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,80 @@
+#
+# Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: Make icons for the dialer.
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\Resource\Apps
+HEADERDIR=\epoc32\include
+ICONTARGETFILENAME=$(TARGETDIR)\dialer.mif
+HEADERFILENAME=$(HEADERDIR)\dialer.mbg
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# TODO: Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+/c8,8  qgn_indi_dialer_eight.svg \
+/c8,8  qgn_indi_dialer_five.svg \
+/c8,8  qgn_indi_dialer_four.svg \
+/c8,8  qgn_indi_dialer_hash.svg \
+/c8,8  qgn_indi_dialer_nine.svg \
+/c8,8  qgn_indi_dialer_one.svg \
+/c8,8  qgn_indi_dialer_prefix.svg \
+/c8,8  qgn_indi_dialer_seven.svg \
+/c8,8  qgn_indi_dialer_six.svg \
+/c8,8  qgn_indi_dialer_three.svg \
+/c8,8  qgn_indi_dialer_two.svg \
+/c8,8  qgn_indi_dialer_zero.svg \
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/group/dialerstub.mmp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  This is project specification file for the dummy Dialer. 
+*                It is used to compile dummy dialer dll in phones without touch.
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+// Capability assignment.
+CAPABILITY CAP_GENERAL_DLL
+
+// Assign Vendor ID.
+VENDORID VID_DEFAULT
+
+TARGET      dialerstub.dll
+TARGETTYPE  dll
+UID         0x1000008d 0x102078ED 
+
+ #if defined(ARMCC)
+ DEFFILE ../eabi/dialer.def
+ #elif defined( WINSCW )
+ DEFFILE ../bwins/dialer.def
+ #else
+ DEFFILE ../bmarm/dialer.def
+ #endif
+
+START RESOURCE ../data/dialer.rss
+HEADER
+TARGETPATH   RESOURCE_FILES_DIR 
+LANG    sc
+END  // RESOURCE
+
+SOURCEPATH  ../src
+SOURCE  cdialerstub.cpp
+SOURCE  cvideodtmfdialerstub.cpp
+
+USERINCLUDE ../../../phoneapp/phoneui/srcdata
+USERINCLUDE ../../../phoneapp/phoneuiview/inc
+USERINCLUDE ../../../phoneapp/phoneuiutils/inc
+USERINCLUDE ../inc 
+USERINCLUDE ../data 
+
+SYSTEMINCLUDE ../../../inc  // s60/app/telephony/inc
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY euser.lib eikcore.lib estor.lib etext.lib 
+LIBRARY cone.lib ws32.lib bmpanim.lib 
+LIBRARY eikcoctl.lib fbscli.lib bafl.lib 
+
+LIBRARY commonengine.lib
+
+LIBRARY gdi.lib
+LIBRARY bitgdi.lib
+LIBRARY egul.lib
+LIBRARY efsrv.lib
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/group/iconlist.txt	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,12 @@
+-c8,8  qgn_indi_dialer_eight
+-c8,8  qgn_indi_dialer_five
+-c8,8  qgn_indi_dialer_four
+-c8,8  qgn_indi_dialer_hash
+-c8,8  qgn_indi_dialer_nine
+-c8,8  qgn_indi_dialer_one
+-c8,8  qgn_indi_dialer_prefix
+-c8,8  qgn_indi_dialer_seven
+-c8,8  qgn_indi_dialer_six
+-c8,8  qgn_indi_dialer_three
+-c8,8  qgn_indi_dialer_two
+-c8,8  qgn_indi_dialer_zero
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/inc/cdialer.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,349 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 CDialer class.
+*
+*/
+
+
+
+#ifndef CDIALER_H
+#define CDIALER_H
+
+//  INCLUDES
+#include <coecntrl.h>
+#include <coemain.h>
+
+#include "mnumberentry.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CEikButtonGroupContainer;
+class CDialerKeyPadContainer;
+class CDialerNumberEntry;
+class MNumberEntry;
+class CEikMenuPane;
+class CEikonEnv;
+class CAknEdwinState;
+class MNumberEntryObserver;
+
+// CLASS DECLARATION
+
+/**
+*  CDialer class.
+*
+*  @lib dialer.lib
+*  @since Series60_5.0
+*
+*  Description:
+*   Dialer is used in two applications, telephony and video telephony.
+*
+*   In Telephony dialer handles number (number/sip address) input from 
+*   user via touch screen, VKB or hw keyboard (ITU-T and QWERTY).
+*
+*   From host application dialer requires:
+*   - View/container as CCoeControl
+*
+* 
+*  Usage:
+*
+
+    // Hide status pane.
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        static_cast<CAknAppUi*>( CEikonEnv::Static()->EikAppUi())->
+            StatusPane()->MakeVisible( ETrue);
+        }
+    else
+        {
+        static_cast<CAknAppUi*>( CEikonEnv::Static()->EikAppUi())->
+            StatusPane()->MakeVisible( EFalse );
+        }
+
+    // Calculate dialer area:
+    TRect screenRect( 
+        TPoint( 0, 0 ), 
+        iCoeEnv->ScreenDevice()->SizeInPixels() );   
+
+    TAknLayoutRect appRect;
+    appRect.LayoutRect( 
+        screenRect, AknLayout::application_window( screenRect );
+
+    TAknLayoutRect mainRect;
+    mainRect.LayoutRect( 
+        appRect.Rect(), 
+        AknLayout::main_pane( appRect.Rect(), 0, 1, 0 ) );
+
+    TRect mainPane( mainRect.Rect() );
+
+    // Reduce the space that CBA need from the rect
+    CEikButtonGroupContainer cba = iEikEnv.AppUiFactory()->Cba();
+    TRect mainPane( aRect );    
+    cba->ReduceRect( mainPane );
+
+    // Create dialer from container (CCoeControl) that created
+    // dialer window (CreateWindowL).
+
+
+*  In telephony dialer:
+
+    // Create dialer.
+    CDialer* dialer = CDialer::NewL( *this, aDialerArea );
+
+    // Open dialer
+    // Open and show dialer
+    iDialer->CreateNumberEntry();
+
+    // methods in MNumberEntry are available to contol dialer and
+    // get/set text in number entry.
+    
+    // Close dialer
+    iDialer->RemoveNumberEntry( );
+    // Delete dialer
+    delete dialer;
+*
+*/
+NONSHARABLE_CLASS(CDialer) : public CCoeControl, public MNumberEntry
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two phase constructor
+        * @param aContainer Parent container
+        * @param aRect Area to use for dialer
+        * @return New instance of Dialer
+        */
+        IMPORT_C static CDialer* NewL( const CCoeControl& aContainer,
+                                       const TRect& aRect );
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CDialer();
+
+    public: // New functions
+
+        /**
+        * Return MNumberEntry API of Dialer
+        * @return Pointer to MNumberEntry implementation
+        */
+        IMPORT_C MNumberEntry* NumberEntry();
+
+        /**
+        * Set number entry observer.
+        */
+        IMPORT_C void SetNumberEntryObserver( MNumberEntryObserver& aObserver );
+        
+    public: // from MNumberEntry 
+
+        /**
+        * Sets number entry active.
+        */
+        void CreateNumberEntry();
+        
+        /**
+        * Return pointer to number entry
+        * @return The NE.
+        */
+        CCoeControl* GetNumberEntry( ) const;
+        
+        /**
+        * Query, is number entry used.
+        * @return ETrue is NE is used.
+        */
+        TBool IsNumberEntryUsed( ) const;
+        
+        /**
+        * This disables NE drawing but doesn't empty the component.
+        * @param aVisibility NE visible or not.
+        */
+        void SetNumberEntryVisible( 
+            const TBool& aVisibility = ETrue );
+        
+        /**
+        * Set Number Entry text.
+        * @param aDesC The text.
+        */
+        void SetTextToNumberEntry( const TDesC& aDesC );
+        
+        /**
+        * Get Number Entry Text.
+        * @param aDesC The text.
+        */
+        void GetTextFromNumberEntry( TDes& aDesC );
+        
+        /**
+        * Removes NE and empties the buffer.
+        */
+        void RemoveNumberEntry( );
+        
+        /**
+        * Set number entry's editor mode.
+        * @param aMode for number editor input mode.
+        * @return Input mode of the editor.
+        */
+        TInt ChangeEditorMode( TBool aDefaultMode = EFalse );
+        
+        /**
+        * Open VKB
+        */
+        void OpenVkbL();
+        
+        /**
+        * Get number entry's editor mode.
+        * @return Input mode of the editor.
+        */
+        TInt GetEditorMode() const;
+
+        /**
+        * Resets number entry editor to default values.
+        */
+        void ResetEditorToDefaultValues();
+        
+        /**
+        * Set number entry's prompt text.
+        * @param aPromptText.
+        */        
+        void SetNumberEntryPromptText( const TDesC& aPromptText );
+        
+        /**
+        * Enable or disable tactile feedback. 
+        * @param aEnable.
+        */             
+        void EnableTactileFeedback( const TBool aEnable );
+
+    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 FocusChanged( TDrawNow aDrawNow );
+                
+        /**
+        * @see CCoeControl
+        */        
+        void MakeVisible( TBool aVisible );  
+        
+        /**
+        * @see CCoeControl
+        */ 
+        void PrepareForFocusGainL();
+        
+        /**
+        * @see CCoeControl
+        */
+        void HandleResourceChange( TInt aType );
+        
+        /**
+        * @see CCoeControl
+        */
+        void HandlePointerEventL( const TPointerEvent& aPointerEvent );
+              
+        
+    private:
+
+        /**
+        * Constructor
+        */
+        CDialer();
+
+        /**
+        * 2nd phase constructor.
+        * @param aContainer Parent container
+        * @param aRect Area to use for dialer
+        */
+        void ConstructL( const CCoeControl& aContainer , 
+            const TRect& aRect );
+        
+        /**
+        * Load resource file.
+        */
+        void LoadResourceL();
+        
+        /**
+        * Unload resource file.
+        */
+        void UnLoadResources();
+        
+        /**
+        * @see CCoeControl::ComponentControl()
+        * @param aIndex control index
+        */
+        CCoeControl* ComponentControlForDialerMode( const TInt aIndex ) const;
+        
+        /**
+         * Returns edwin state
+         * @return Pointer to CAknEdwinState
+         */
+        CAknEdwinState* EdwinState();
+        
+        /**
+         * Updates editor flags for virtual
+         * keyboard.
+         */
+        void UpdateVkbEditorFlagsL();
+
+    private:    // Data
+          
+        // Keypad container  - owned
+        CDialerKeyPadContainer* iKeypadArea;
+             
+        // Number entry container - owned
+        CDialerNumberEntry* iNumberEntry;
+        
+        // Parent container
+        const CCoeControl* iParentControl;
+        
+        // Is Number entry (e.g. dialer) being used at the moment
+        TBool iIsUsed;
+        
+        // Reference to CEikonEnv
+        CEikonEnv& iEikEnv;
+        
+        // Resource 
+        TInt iResourceOffset;
+        
+        // Is virtual key board open
+        TBool iVirtualKeyBoardOpen;
+
+    };
+
+#endif      // CDIALER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/inc/cdialercontainerbase.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Base class for all dialer containers
+*
+*/
+
+
+
+#ifndef CDIALERCONTAINERBASE_H
+#define CDIALERCONTAINERBASE_H
+
+//  INCLUDES
+#include <coecntrl.h>
+#include <coemain.h>
+#include <bldvariant.hrh>
+
+#include "dialercommon.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+class CAknButton;
+class TAknsItemID;
+class CGulIcon;
+
+/**
+*  CDialerContainerBase container class
+*
+*  @lib dialer.lib
+*  @since S60 v5.0
+*/
+NONSHARABLE_CLASS(CDialerContainerBase) : public CCoeControl, 
+                                          public MCoeControlObserver
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CDialerContainerBase();
+            
+
+    protected:
+        
+        // Constructor
+        CDialerContainerBase( 
+            CCoeControl& aContainer );
+
+        /**
+        * Base constructor.
+        */
+        void BaseConstructL( );
+
+        /**
+        * Set variety currently in use
+        */
+        virtual void SetVariety( ) = 0;
+        
+        /**
+        * Set layout
+        */
+        virtual void SetLayout( ) = 0;   
+
+        
+    protected:  // Functions from CCoeControl
+        
+        /**
+        * @see CCoeControl
+        */
+        TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
+        
+        /**
+        * @see CCoeControl
+        */
+        virtual void SizeChanged();
+        
+        /**
+        * @see CCoeControl
+        */
+        virtual void PositionChanged();
+
+        /**
+        * @see CCoeControl
+        */
+        void HandleResourceChange( TInt aType );
+             
+        
+    protected: // From MCoeControlObserver
+
+        /**
+        * @see MCoeControlObserver
+        */
+        virtual void HandleControlEventL( CCoeControl* /*aControl*/, TCoeEvent /*aEventType*/ ) {};
+
+    protected:    // Data
+
+        // Variety set according to conditions of number etc of buttons.
+        // See Variety method of each implementing class.
+        TInt iVariety;
+
+        // Parent container
+        CCoeControl& iParentControl;
+
+
+    };
+
+#endif      // CDIALERCONTAINERBASE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/inc/cdialerkeypadbutton.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Definition of CDialerKeyPadButton class.
+*
+*/
+
+
+#ifndef C_CDIALERKEYPADBUTTON_H
+#define C_CDIALERKEYPADBUTTON_H
+
+#include <e32base.h>
+#include <aknbutton.h>
+
+// CLASS DECLARATION
+
+/**
+*  Contains keypad button data.
+*
+*  @lib dialer.lib
+*  @since S60 v5.0
+*/
+NONSHARABLE_CLASS( CDialerKeyPadButton ) : public CBase
+    {
+    public:
+    
+        CDialerKeyPadButton();
+
+        ~CDialerKeyPadButton();
+    
+    public:
+        CCoeControl* Control() const { return iButton; };
+        TInt ScanCode() const;
+        TInt KeyCode() const;
+        void CreateButtonL( const TInt aScanCode,
+                            const TInt aKeyCode, 
+                            const TMifDialer aButtonIcon, 
+                            const TMifDialer aButtonIconMask );
+        void SetIconSize( TSize& aSize );                    
+        void HandleResourceChange( TInt aType );
+        void MapDialerIconToSkinIcon( const TInt aDialerIcon, 
+                                      TAknsItemID& aItemId ) const;  
+        void EnableAudioFeedback( const TBool aEnable );
+
+    private:
+        void UpdateIconL();
+        
+    private: // data
+    
+        CAknButton*  iButton;
+        
+        TInt iScanCode;
+        TInt iKeyCode;
+        TMifDialer iButtonIcon;
+        TMifDialer iButtonIconMask;
+    };
+
+#endif // C_CDIALERKEYPADBUTTON_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/inc/cdialerkeypadcontainer.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,181 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CDialerKeyPadContainer class provides number keypad fuctionality 
+*
+*/
+
+
+
+#ifndef CDIALERKEYPADCONTAINER_H
+#define CDIALERKEYPADCONTAINER_H
+
+//  INCLUDES
+#include    <coecntrl.h>
+#include    <coecobs.h>    // MCoeControlObserver
+#include    <coemain.h>
+
+#include    "cdialercontainerbase.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CDialerKeyPadButton;
+
+// CLASS DECLARATION
+ 
+/**
+*  CDialerKeyPadContainer container class
+*
+*  @lib dialer.lib
+*  @since S60 v5.0
+*/
+NONSHARABLE_CLASS(CDialerKeyPadContainer) : public CDialerContainerBase, 
+                                            public MCoeForegroundObserver
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two phase constructor
+        * @param aContainer Parent container
+        * @param aOperatingMode 
+        * @return New instance
+        */
+        static CDialerKeyPadContainer* NewL( 
+            const CCoeControl& aContainer,
+            TDialerOperationMode aOperatingMode
+             );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CDialerKeyPadContainer();      
+        
+    public:
+        
+        /**
+        * Enables or disables tactile feedback audio for keypad buttons.
+        */
+        
+        void EnableTactileFeedback( const TBool aEnable );
+        
+    private:  // Functions from base classes
+        
+        /**
+        * From CCoeControl
+        */
+        TInt CountComponentControls() const;
+        
+        /**
+        * From CCoeControl
+        */
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+        
+        /**
+         * From CoeControl.
+         */
+        void HandlePointerEventL( const TPointerEvent& aPointerEvent );
+        
+        /**
+        * @see CCoeControl
+        */
+        void HandleResourceChange( TInt aType );   
+        
+        /**
+        * @see CCoeControl
+        */        
+        void MakeVisible( TBool aVisible );     
+        
+        /**
+        * @see MCoeControlObserver
+        */        
+        void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType );      
+        
+        /**
+        * @see MCoeForegroundObserver
+        */ 
+        void HandleGainingForeground();
+        
+        /**
+        * @see MCoeForegroundObserver
+        */         
+        void HandleLosingForeground();      
+        
+        
+    private: // From CDialerContainerBase
+    
+        /**
+        * @see CDialerContainerBase
+        */
+        void SetVariety();
+        
+        /**
+        * @see CDialerContainerBase
+        */
+        void SetLayout();
+
+    private:
+    
+		CDialerKeyPadContainer( const CCoeControl& aContainer, 
+            TDialerOperationMode aOperatingMode );
+            	
+        /**
+        * 2nd phase constructor.
+        */
+        void ConstructL( );
+
+        /**
+        * Set layout in Phone Dialer mode
+        */
+        void SetPhoneLayout();
+
+        /**
+        * Set layout in Video DTMF mode
+        */
+        void SetVideoLayout();
+        
+        /**
+        * Create keypad buttons.
+        */
+        void CreateButtonsL();
+        
+        
+    private:    // Data
+    
+        TDialerOperationMode iOperatingMode;
+        
+        /**
+         * Keypad buttons.
+         * Owned.
+         */
+        RPointerArray<CDialerKeyPadButton> iButtons;  
+        
+        /**
+         * Number of buttons.
+         */
+        TInt iButtonCount;
+         
+        /**
+         * True, when EEventStateChanged event reported. 
+         */        
+        TBool iButtonPressedDown;
+        
+        /**
+         * Stores last pointer event. 
+         */        
+        TPointerEvent iPointerEvent;
+    };
+
+#endif      // CDIALERKEYPADCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/inc/cdialernumberentry.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,296 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CDialerNumberEntry class handles viewing
+*                and positioning of Number Entry and offers API
+*                to access NE contents.
+*
+*/
+
+
+
+#ifndef CDIALERNUMBERENTRY_H
+#define CDIALERNUMBERENTRY_H
+
+//  INCLUDES
+#include <coecntrl.h>
+#include <coemain.h>
+#include <AknPhoneNumberEditor.h>
+
+#include "cdialercontainerbase.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CAknPhoneNumberEditor;
+class CAknButton;
+class CAknsFrameBackgroundControlContext;
+class MNumberEntryObserver;
+class CEikLabel;
+
+
+// Number entry varietys
+enum TDialerNEVariety
+    {
+    KDialerNELayoutLargeFont,
+    KDialerNELayoutSmallFont
+    };
+
+// CLASS DECLARATION
+
+/**
+*  CDialerNumberEntry control class
+*
+*  @lib dialer.lib
+*  @since S60 v5.0
+*/
+NONSHARABLE_CLASS(CDialerNumberEntry) : 
+    public CDialerContainerBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two phase constructor
+        * @param aContainer Parent container
+        * @return New instance of CDialerNumberEntry
+        */
+        static CDialerNumberEntry* NewL( 
+            const CCoeControl& aContainer );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CDialerNumberEntry();
+
+    public: // New functions
+
+        /**
+        * Return text length in number entry
+        * @return text length
+        */
+        TInt TextLength();
+
+        /**
+        * Return number entry as CCoeControl
+        * @return CCoeControl pointer of CAknPhoneNumberEditor
+        */
+        CCoeControl* GetNumberEntry( ) const;
+
+        /**
+        * Create and show number entry
+        */
+        void CreateNumberEntry();
+
+        /**
+        * Toggles editor mode from number->text->number->..
+        * @param aDefaultMode if EFalse, set mode to number,
+        *        else toggle mode.
+        */
+        TInt ChangeEditorMode( TBool aDefaultMode );
+
+        /**
+        * Return current editor mode
+        * @return editor mode.
+        */
+        TInt GetEditorMode() const;
+
+        /**
+        * Set text to number entry
+        * @param aDesc Text to set.
+        */
+        void SetTextToNumberEntry( const TDesC& aDesC );
+
+        /**
+        * Get tect from number entry.
+        * @param aDesc Text is returned here.
+        */
+        void GetTextFromNumberEntry( TDes& aDesC );
+
+        /**
+        * Reset editor to default values.
+        */
+        void ResetEditorToDefaultValues();
+
+        /**
+        * Set number entry's prompt text.
+        * @param aPromptText.
+        */        
+        void SetNumberEntryPromptTextL( const TDesC& aPromptText );
+        
+
+        /**
+        * Handles command targeted to this container.
+        * @param aCommand Command.
+        */
+        TBool HandleCommandL( TDialerCommandId aCommand);
+
+        /**
+        * Set number entry observer.
+        */
+        void SetNumberEntryObserver( MNumberEntryObserver& aObserver );
+
+        /**
+        * Clear editor flags to default values.
+        */
+        void ClearEditorFlags();
+        
+    private:  // Functions from MCoeControlObserver
+        /**
+        * @see MCoeControlObserver
+        */
+        void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType );
+
+    private:  // Functions from CCoeControl
+
+        /**
+        * @see CCoeControl
+        */
+        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, 
+                                     TEventCode aType );
+
+        /**
+        * @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 );        
+
+    public:        
+        /**
+        * @see CCoeControl
+        */
+        void SetFocus( TBool aFocus, 
+                       TDrawNow aDrawNow=ENoDrawNow );
+   
+    private: // From CDialerContainerBase
+
+
+        /**
+        * @see CDialerContainerBase
+        */
+        void SetVariety( );
+        
+        /**
+        * @see CDialerContainerBase
+        */
+        void SetLayout( );
+        
+        /**
+        * @see CDialerContainerBase
+        */                                         
+        TTypeUid::Ptr MopSupplyObject( TTypeUid aId );                                         
+        
+        
+        /**
+        * Get inner and outer rectangles for rectangle frame.
+        * @param aFrameRect Frame rectangle.
+        * @param aOuterRect Outer rectangle (return).
+        * @param aInnerRect Inner rectangle (return).
+        */ 
+        void RectFrameInnerOuterRects( const TRect& aFrameRect,
+                                              TRect& aOuterRect,
+                                              TRect& aInnerRect );        
+    private:
+
+        /**
+        * 2nd phase constructor.
+        */
+        void ConstructL();
+            
+        /**
+        * Constructor
+        * @param aContainer Parent container
+        * @param aCommandHandler
+        */
+        CDialerNumberEntry(
+            const CCoeControl& aContainer/*,
+            MDialerCommandHandler& aCommandHandler */);
+
+        /**
+        * Construct number editor from layout.
+        */
+        void ConstructEditorFromResourceL( TResourceReader& aReader );
+
+        /**
+        * Update formats in number entry from layout
+        */
+        void UpdateNumberEntryFormats();
+        
+        /**
+        * Calculates number entry layout & format for given number entry variety
+        * @param aFormat -format to be filled
+        * @param aNEVariety -determines the format layot
+        */
+        void CalculateLayout( CAknPhoneNumberEditor::TFormat& aFormat,
+						      TInt aNEVariety );
+        /**
+        * Start virtual keyboard.
+        */
+        void StartVirtualKeyBoard();
+
+        /**
+        * Checks the number entry and informs client via observer interface
+        * whether the state is changed.
+        */
+        void InformNumberEntryState(); 
+        
+        
+        void CheckLabelSkinningColor();
+        
+        /**
+         * Checks editor formatting.
+         */
+        void HandleEditorFormatting(); 
+         
+    private:    // Data
+        
+        // Number editor field
+        CAknPhoneNumberEditor* iEditor;
+        
+        //Prompt text label for number entry.
+        CEikLabel* iLabel;        
+        
+        // NE Font.
+        CFbsFont* iNEFont;
+        
+        // Amount of formats for updating.
+        TInt iFormatCount;
+         
+        // Skin control context for the editor (9-piece)
+        CAknsFrameBackgroundControlContext* iFrameContext;
+
+        TRect iOuterRect; 
+        
+        TRect iInnerRect;
+        
+        MNumberEntryObserver* iObserver;    
+        
+        TBool iNumberContents;  
+    };
+
+#endif      // CDIALERNUMBERENTRY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/inc/cdialertoolbar.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Updates toolbar.
+ *
+*/
+
+
+#ifndef __CDIALERTOOLBAR_H__
+#define __CDIALERTOOLBAR_H__
+
+#ifdef RD_SCALABLE_UI_V2
+
+#include <akntoolbar.h>
+#include <akntoolbarobserver.h>
+#include <coecobs.h>    // MCoeControlObserver
+#include <dialer.hrh>
+
+//Forward declarations
+class CAknToolbar;
+class CAknButton;
+class CAknAppUi;
+class CCoeControl;
+class CDialerNumberEntry;
+
+NONSHARABLE_CLASS( CDialerToolBar ) : public CBase, 
+    public MCoeControlObserver
+    {
+    public:
+    
+        /**
+        * Two phase constructor
+        * @param CAknAppUi reference
+        * @param CDialerNumberEntry reference
+        * @return New instance
+        */    
+        static CDialerToolBar* NewL( CAknAppUi* aAppUi, 
+                                     CDialerNumberEntry& aNumberEntry );
+        static CDialerToolBar* NewLC( CAknAppUi* aAppUi, 
+                                      CDialerNumberEntry& aNumberEntry );
+    
+        /**
+        * Destructor.
+        */    
+        virtual ~CDialerToolBar();
+
+    public: // New functions
+        
+        void UpdateToolbar( TDialerCommandId aCommand );
+        
+        void DetermineCurrentToolbarButtons();
+
+
+    public: // from MCoeControlObserver
+    
+        void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType );
+
+    private:
+        
+        /**
+        * Constructor
+        */        
+        CDialerToolBar( CDialerNumberEntry& aNumberEntry );
+    
+        /**
+        * 2nd phase constructor.
+        */
+        void ConstructL( CAknAppUi* aAppUi );
+        
+        CAknButton* CreateButtonL( TInt aNormalIconId,
+                               TInt aNormalMaskId,
+                               const TDesC& aText, 
+                               const TAknsItemID& aSkinIconId,
+                               TInt aCommand = EDialedCmdNone );
+
+        
+        void CreateButtonSetNumberEntryEmpty();
+        
+        void CreateButtonSetNumberEntryNotEmpty();
+
+    private: // data
+
+        CAknToolbar* iToolbar;
+        CAknAppUi* iAppUi;
+        TBool iNumberEntryEmpty;
+        CDialerNumberEntry& iNumberEntry;
+
+    };
+
+#endif // RD_SCALABLE_UI_V2
+
+#endif // CDIALERTOOLBAR
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/inc/cdialervideocontainer.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  CDialerVideoContainer class handles positioning 
+*                and viewing the control.
+*
+*/
+
+
+
+#ifndef CDIALERVIDEOCONTAINER_H
+#define CDIALERVIDEOCONTAINER_H
+
+//  INCLUDES
+
+//#include <fbs.h>
+#include <coecntrl.h>
+#include <coemain.h>
+
+#include "cdialercontainerbase.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  CDialerVideoContainer container class
+*
+*  @lib dialer.lib
+*  @since S60 v5.0
+*/
+NONSHARABLE_CLASS(CDialerVideoContainer) : 
+    public CDialerContainerBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two phase constructor
+        * @param aContainer Parent container
+        * @param aVideoWindow
+        * @return New instance
+        */
+        static CDialerVideoContainer* NewL( 
+            const CCoeControl& aContainer,
+            CCoeControl& aVideoWindow );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CDialerVideoContainer();
+
+    private:  // Functions from base classes
+
+        /**
+        * From CCoeControl
+        */
+        TInt CountComponentControls() const;
+        
+        /**
+        * From CCoeControl
+        */
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+
+        /**
+        * From CCoeControl
+        */
+        void Draw( const TRect& /*aRect */) const;
+    
+    public:        
+        /**
+        * @see CCoeControl
+        */
+        void SetFocus( TBool aFocus, 
+                       TDrawNow aDrawNow=ENoDrawNow );        
+    
+    private: // From CDialerContainerBase
+   
+
+        /**
+        * @see CDialerContainerBase
+        */
+        void SetVariety( );
+        
+        /**
+        * @see CDialerContainerBase
+        */
+        void SetLayout( );
+        
+        
+    private:
+
+        /**
+        * 2nd phase constructor.
+        */
+        void ConstructL();
+            
+        /**
+        * Constructor
+        * @param aContainer Parent container
+        * @param aVideoWindow
+        * @param aCommandHandler
+        */
+       CDialerVideoContainer(
+            const CCoeControl& aContainer,
+            CCoeControl& aVideoWindow );
+
+    private:    // Data
+
+        // Video window
+        CCoeControl& iVideoWindow;
+    };
+
+#endif      // CDIALERVIDEOCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/inc/dialer.hrh	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 resources of Dialer.
+*     The file can be included in C++ or resource file.
+*     
+*
+*/
+
+
+#ifndef DIALER_HRH
+#define DIALER_HRH
+
+#define KDialerCmdBase 7000
+
+enum TDialerCommandId
+    {
+    // Commands from buttons
+    EDialedCmdNone = -1,        // 
+    EDialerCmdOne = KDialerCmdBase,          // 1
+    EDialerCmdTwo,              // 2
+    EDialerCmdThree,            // 3
+
+    EDialerCmdFour,             // 4
+    EDialerCmdFive,             // 5
+    EDialerCmdSix,              // 6
+
+    EDialerCmdSeven,            // 7
+    EDialerCmdEight,            // 8
+    EDialerCmdNine,             // 9
+
+    EDialerCmdPrefix,           // *+
+    EDialerCmdZero,             // 0
+    EDialerCmdHash,             // #
+
+    EDialerCmdClear,            // clear
+    EDialerCmdClearNumberEntry,  // clears number entry
+    EDialerCmdCallVoice,        // create voice call
+    EDialerCmdCallVideo,        // create video call
+
+    // Commands from buttons and menus
+    EDialerCmdLog,              // open recent calls log (dialled)
+    EDialerCmdContacts,         // open contacts
+    EDialerCmdAddToContacts,       // add number/address to contacts.
+    EDialerCmdAddNewToContact,         // open contacts
+    EDialerCmdAddToExistingContact,         // open contacts
+    EDialerCmdSpeedDial,         // open speed dial
+    
+    // Commands from menus
+    EDialerCallHandling,
+    EDialerCmdTouchInput, 
+    EDialerCallSettings,
+    EDialerSendServiceCmd,
+    EDialerCmdEditText,
+    EDialerCmdCopyText,
+    EDialerCmdCutText,
+    EDialerCmdPasteText,
+
+    // General commands    
+    EDialerCmdUpdateButtons,
+    EDialerAiwCommandVoiceCall,
+    EDialerAiwCommandVideoCall,
+    EDialerAiwCommandWriteMessaage, 
+    
+    // Informative commands.
+		EDialerMsgCallRemoved,		// 
+		EDialerMsgCallAdded,		// 
+		EDialerMsgSSInNumberEntry,		// number entry contains SS, USSD or phone service string.
+		EDialerMsgNumberInNumberEntry,	// number entry contains phone number.
+    
+    // NumberEntry commands
+    EDialerNumberEntryEmpty,
+    EDialerNumberEntryNotEmpty, 
+    
+    EDialerExit, 
+    
+    EDialerCmdLast
+    };
+
+
+enum TDialerNumberEntryContentType
+    {
+    EDialerContentEmpty,
+    EDialerServiceString,
+    EDialerVoIPAddress,
+    EDialerPhoneNumber
+    };
+    
+// The mode the dialer is operating.
+enum TDialerOperationMode
+    {
+    EModeDialer, // Phone Dialer
+    EModeVoiceDTMF, // Phone DTMF string query 
+    EModeVideoDTMF // Video telephony DTMF send
+    };
+
+enum TVideoVariety 
+    {
+    EVideoVarietyPortrait = 0,
+    EVideoVarietyLandscape = 1
+    };
+    
+enum TDialerVariety 
+    {
+    EDialerVarietyPortrait = 0,
+    EDialerVarietyLandscape = 1
+    };    
+    
+#endif // _DIALER_HRH_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/inc/dialercommon.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Definition of common constants of the dialer.
+*
+*/
+
+
+#ifndef DIALERCOMMON_H
+#define DIALERCOMMON_H
+
+#include <e32def.h>
+#include <e32keys.h>
+
+#ifndef __DIALER_MBG
+#define __DIALER_MBG
+#include "dialer.mbg"
+#endif // __DIALER_MBG
+
+#include "dialer.hrh"
+
+const TInt KDialerPhoneNumberEntryBufferSize = 100;
+const TUid KPhoneUidAppPhone = { 0x100058B3 };
+
+// ROM drive.
+_LIT( KDriveZ, "z:" );
+
+#endif // DIALERCOMMON_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/inc/dialertrace.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Macros for tracing.
+*
+*/
+
+
+
+#ifndef DIALERTRACE_H
+#define DIALERTRACE_H
+
+#ifdef _DEBUG
+
+// INCLUDES
+#include <e32svr.h>
+
+// CONSTANTS
+
+const TInt KDialerDebugBufferSize = 60;
+
+// MACROS
+
+typedef TBuf<KDialerDebugBufferSize> TDialerDebBuf;
+
+#define DIALER_PRINT(x) { _LIT( KDialerDebugPrintPrefix, "Dialer: ");\
+    TDialerDebBuf buf( KDialerDebugPrintPrefix);\
+    if ((_L(x).Length()) + buf.Length() <= KDialerDebugBufferSize )\
+        buf.Append(_L(x)); RDebug::Print(buf); }
+
+#define DIALER_PRINTF(x,y) { _LIT( KDialerDebugPrintPrefix, "Dialer: ");\
+    TDialerDebBuf buf( KDialerDebugPrintPrefix);\
+    if ((_L(x).Length()) + buf.Length() <= KDialerDebugBufferSize )\
+        buf.Append(_L(x)); RDebug::Print(buf,y);}
+
+#define DIALER_PRINTF2(x,y,z) { _LIT( KDialerDebugPrintPrefix, "Dialer: ");\
+    TDialerDebBuf buf( KDialerDebugPrintPrefix);\
+    if ((_L(x).Length()) + buf.Length() <= KDialerDebugBufferSize )\
+        buf.Append(_L(x)); RDebug::Print(buf,y,z); }
+
+#else // !_DEBUG
+
+#define DIALER_PRINT(x)
+#define DIALER_PRINTF(x,y)
+#define DIALER_PRINTF2(x,y,z)
+
+#endif      // _DEBUG
+
+#endif      // DIALERTRACE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/inc/mnumberentry.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,153 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  MNumberEntry class provides an bubble manager like
+*                API to Dialer for Phone.
+*
+*/
+
+
+
+#ifndef MNUMBERENTRY_H
+#define MNUMBERENTRY_H
+
+//  INCLUDES
+#include <e32def.h>
+#include <e32cmn.h>
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CCoeControl;
+
+// CLASS DECLARATION
+
+/**
+*  MNumberEntryObserver class
+*
+*  @lib dialer.lib
+*  @since Series60 5.0
+*/
+class MNumberEntryObserver
+    {
+    public:
+      
+    /**
+     * Indication that numberentry state changed
+     *
+     * @since S60 v5.0
+     */
+    virtual void NumberEntryStateChanged( TBool aHidePromptText ) = 0;         
+
+    };
+    
+/**
+*  MNumberEntry container class
+*
+*  @lib dialer.lib
+*  @since Series60 5.0
+*/
+class MNumberEntry
+    {
+    public: // New functions
+
+        /**
+        * Sets number entry active.
+        */
+        virtual void CreateNumberEntry() = 0;
+        
+        /**
+        * Return pointer to number entry
+        * @return The NE.
+        */
+        virtual CCoeControl* GetNumberEntry( ) const = 0;
+        
+        /**
+        * Query, is number entry used.
+        * @return ETrue is NE is used.
+        */
+        virtual TBool IsNumberEntryUsed( ) const = 0;
+        
+        /**
+        * This disables NE drawing but doesn't empty the component.
+        * @param aVisibility NE visible or not.
+        */
+        virtual void SetNumberEntryVisible( 
+            const TBool& aVisibility = ETrue ) = 0;
+        
+        /**
+        * Set Number Entry text.
+        * @param aDesC The text.
+        */
+        virtual void SetTextToNumberEntry( const TDesC& aDesC ) = 0;
+        
+        /**
+        * Get Number Entry Text.
+        * @param aDesC The text.
+        */
+        virtual void GetTextFromNumberEntry( TDes& aDesC ) = 0;
+        
+        /**
+        * Removes NE and empties the buffer.
+        */
+        virtual void RemoveNumberEntry( ) = 0;
+        
+        /**
+        * Set number entry's editor mode.
+        * @param aMode for number editor input mode.
+        * @return Input mode of the editor.
+        */
+        virtual TInt ChangeEditorMode( TBool aDefaultMode = EFalse ) = 0;
+        
+        /**
+        * Open VKB
+        */
+        virtual void OpenVkbL() = 0;
+        
+        /**
+        * Get number entry's editor mode.
+        * @return Input mode of the editor.
+        */
+        virtual TInt GetEditorMode() const = 0;
+
+        /**
+        * Resets number entry editor to default values.
+        */
+        virtual void ResetEditorToDefaultValues() = 0;
+        
+         /**
+         * Sets number editor observer. 
+         * 
+         * @param aObserver Observer.
+         */    
+        virtual void SetNumberEntryObserver( 
+            MNumberEntryObserver& aObserver ) = 0;    
+            
+         /**
+         * Sets prompt text to numberentry. 
+         * 
+         * @param aPromptText.
+         */    
+        virtual void SetNumberEntryPromptText( const TDesC& aPromptText ) = 0;       
+        
+        /**
+        * Enable or disable tactile feedback. 
+        * 
+        * @param aEnable.
+        */          
+        virtual void EnableTactileFeedback( const TBool aEnable ) = 0;
+    };
+
+#endif      // MNUMBERENTRY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/rom/dialer.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 Dialer
+*
+*/
+
+
+#ifndef DIALER_IBY
+#define DIALER_IBY
+
+#ifdef __ON_SCREEN_DIALER
+file=ABI_DIR\BUILD_DIR\dialer.dll                SHARED_LIB_DIR\DIALER.dll
+#else
+file=ABI_DIR\BUILD_DIR\dialerstub.dll            SHARED_LIB_DIR\DIALER.dll
+#endif
+
+#ifdef __ON_SCREEN_DIALER
+data=ZSYSTEM\install\dialer_stub.sis            	System\Install\dialer_stub.sis
+data=DATAZ_\RESOURCE_FILES_DIR\DIALER.rsc       	RESOURCE_FILES_DIR\DIALER.rsc
+SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,Dialer)
+#else
+// No resource or icon/image files needed when stub dialer is used.
+#endif __ON_SCREEN_DIALER
+
+#endif // DIALER_IBY
+
+//  End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/src/cdialer.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,527 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 for keypad and numberentry container.
+*
+*/
+
+
+// INCLUDE FILES
+
+#include <avkon.rsg>
+#include <apgcli.h>
+#include <apacmdln.h>
+#include <eikspane.h>
+#include <aknenv.h>                         // AKN_LAF_COLOR
+#include <AknUtils.h>
+#include <AknsUtils.h>
+#include <aknappui.h>
+#include <aknlayoutscalable_apps.cdl.h>
+#include <layoutmetadata.cdl.h>
+#include <data_caging_path_literals.hrh>    // for KDC_APP_RESOURCE_DIR
+#include <bautils.h>                        // for BaflUtils
+#include <aknedsts.h>
+
+#include "cdialer.h"
+#include "dialercommon.h"
+#include <dialer.rsg>
+#include "dialer.hrh"
+#include "cdialerkeypadcontainer.h"
+#include "cdialernumberentry.h"
+#include "dialertrace.h"
+#include "mnumberentry.h"
+
+/// ROM drive.
+_LIT( KDialerResourceFile, "dialer.rsc" );
+// number entry, keypad area
+const TInt KContainedControlsInTelephonyMode = 2;  
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CDialer::NewL
+//
+// Symbian OS two phased constructor for telephony phone dialer mode
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDialer* CDialer::NewL( const CCoeControl& aContainer, 
+                                 const TRect& aRect )
+    {
+    CDialer* self = new( ELeave )CDialer ( );    
+    CleanupStack::PushL( self );
+    self->ConstructL( aContainer , aRect );
+    CleanupStack::Pop();    // self
+    return self;
+    }
+
+// Destructor
+EXPORT_C CDialer::~CDialer()
+    {
+    DIALER_PRINT("CDialer::~CDialer<"); 
+    AknsUtils::DeregisterControlPosition( this );
+
+    delete iKeypadArea;
+    delete iNumberEntry;
+
+    UnLoadResources();
+    DIALER_PRINT("CDialer::~CDialer>"); 
+    }
+
+// ---------------------------------------------------------------------------
+// CDialer::ConstructL
+//
+// Symbian OS two phased constructor for phone dialer more.
+// ---------------------------------------------------------------------------
+//
+void CDialer::ConstructL( 
+    const CCoeControl& aContainer, 
+    const TRect& aRect )
+    {    
+    DIALER_PRINT("CDialer::ConstructL<");	
+    LoadResourceL();    
+    
+    // set window
+    SetContainerWindowL( aContainer );
+    SetParent( const_cast<CCoeControl*>(&aContainer) );
+    iParentControl = &aContainer;
+
+    iNumberEntry = CDialerNumberEntry::NewL( *this );    
+
+    iKeypadArea = CDialerKeyPadContainer::NewL( *this,  EModeDialer );    
+    
+    SetRect( aRect );
+    
+    SetComponentsToInheritVisibility( ETrue );
+    
+    ActivateL();
+    DIALER_PRINT("CDialer::ConstructL>");
+    }
+
+// Constructor
+CDialer::CDialer( ) :
+    iEikEnv( *CEikonEnv::Static() )
+    {
+    // Empty    
+    }
+
+// -----------------------------------------------------------------------------
+// CDialer::NumberEntry
+//
+// Return pointer to MNumberEntry interface.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MNumberEntry* CDialer::NumberEntry()
+    {
+    return this;
+    }
+
+// -----------------------------------------------------------------------------
+// CDialer::SetNumberEntryObserver
+//
+// 
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CDialer::SetNumberEntryObserver( MNumberEntryObserver& aObserver ) 
+    {
+    iNumberEntry->SetNumberEntryObserver( aObserver );  
+    }
+
+// Methods from MNumberEntry
+
+// ---------------------------------------------------------------------------
+// CDialer::CreateNumberEntry
+//  
+// Creates number entry in phone dialer mode. 
+// ---------------------------------------------------------------------------
+//
+void CDialer::CreateNumberEntry()
+    {
+    DIALER_PRINT("CDialer::CreateNumberEntry<");
+    
+    iIsUsed = ETrue;    
+    
+    DIALER_PRINT("CDialer::CreateNumberEntry>");        
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::GetNumberEntry
+//  
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CDialer::GetNumberEntry( ) const
+    {
+    CCoeControl* control( NULL );
+    control = iNumberEntry->GetNumberEntry();
+    return control;
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::IsNumberEntryUsed
+//  
+// ---------------------------------------------------------------------------
+//
+TBool CDialer::IsNumberEntryUsed( ) const
+    {
+    return iIsUsed;
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::SetNumberEntryVisible
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialer::SetNumberEntryVisible( const TBool& /*aVisibility*/ )
+    {
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::SetTextToNumberEntry
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialer::SetTextToNumberEntry( const TDesC& aDesC )
+    {
+    iNumberEntry->SetTextToNumberEntry( aDesC );
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::GetTextFromNumberEntry
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialer::GetTextFromNumberEntry( TDes& aDesC )
+    {
+    iNumberEntry->GetTextFromNumberEntry( aDesC );
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::RemoveNumberEntry
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialer::RemoveNumberEntry( )
+    {
+    ResetEditorToDefaultValues();
+    iIsUsed = EFalse;
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::ChangeEditorMode
+//  
+// ---------------------------------------------------------------------------
+//
+TInt CDialer::ChangeEditorMode( TBool aDefaultMode )
+    {
+    TInt ret( KErrNotSupported );
+    ret = iNumberEntry->ChangeEditorMode( aDefaultMode );        
+    return ret;
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::OpenVKBL
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialer::OpenVkbL()
+    {
+    iVirtualKeyBoardOpen = ETrue;
+    UpdateVkbEditorFlagsL();
+    
+    iNumberEntry->HandleCommandL( EDialerCmdTouchInput );
+    }
+
+// ---------------------------------------------------------------------------
+// CDialer::GetEditorMode
+//  
+// ---------------------------------------------------------------------------
+//
+TInt CDialer::GetEditorMode() const
+    {
+    return iVirtualKeyBoardOpen ? EAknEditorTextInputMode : 
+                                  EAknEditorNumericInputMode;
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::ResetEditorToDefaultValues
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialer::ResetEditorToDefaultValues()
+    {
+    iNumberEntry->ResetEditorToDefaultValues();
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::SetNumberEntryPromptText
+//  
+// ---------------------------------------------------------------------------
+//    
+void CDialer::SetNumberEntryPromptText( const TDesC& aPromptText ) 
+    {
+    TRAP_IGNORE( iNumberEntry->SetNumberEntryPromptTextL( aPromptText ) );
+    }
+
+// ---------------------------------------------------------------------------
+// CDialer::EnableTactileFeedback
+//  
+// ---------------------------------------------------------------------------
+//    
+void CDialer::EnableTactileFeedback( const TBool aEnable )
+    {
+    iKeypadArea->EnableTactileFeedback( aEnable );
+    }
+
+// Functions from CCoeControl
+
+// ---------------------------------------------------------------------------
+// CDialer::SizeChanged
+// 
+// Called by framework when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialer::SizeChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    TRect parentRect(Rect()); 
+       
+    // Method is called before containers are created.
+    if ( !iKeypadArea )
+        {
+        return;
+        }
+        
+    TDialerVariety variety( EDialerVarietyLandscape );
+    if (  !Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        variety = EDialerVarietyPortrait;
+        }            
+    // number entry
+    AknLayoutUtils::LayoutControl(
+        iNumberEntry, parentRect, 
+        AknLayoutScalable_Apps::dialer2_ne_pane( variety ).LayoutLine() );
+    // keypad area.
+    AknLayoutUtils::LayoutControl(
+        iKeypadArea, parentRect, 
+        AknLayoutScalable_Apps::grid_dialer2_keypad_pane( variety ).LayoutLine() );
+    }
+
+// ---------------------------------------------------------------------------
+// CDialer::PositionChanged
+// ---------------------------------------------------------------------------
+//
+void CDialer::PositionChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CDialer::CountComponentControls
+//
+// Returns contained controls in phone dialer mode
+// ---------------------------------------------------------------------------
+//
+TInt CDialer::CountComponentControls() const
+    {
+    TInt count(0);
+    count = KContainedControlsInTelephonyMode;
+    return count;
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::ComponentControl(TInt aIndex) const
+//
+// Returns contained control by given index.
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CDialer::ComponentControl( TInt aIndex ) const
+    {
+    CCoeControl* currentControl(NULL);
+    currentControl = ComponentControlForDialerMode( aIndex);
+    return currentControl;
+    } 
+
+// ---------------------------------------------------------------------------
+// CDialer::Draw
+// ---------------------------------------------------------------------------
+//
+void CDialer::Draw( const TRect& /*aRect*/ ) const
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CDialer::FocusChanged
+// ---------------------------------------------------------------------------
+//
+void CDialer::FocusChanged(TDrawNow aDrawNow)
+    {
+    iNumberEntry->SetFocus( IsFocused(), aDrawNow );    
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::MakeVisible
+// ---------------------------------------------------------------------------
+//
+void CDialer::MakeVisible( TBool aVisible )
+	{
+	CCoeControl::MakeVisible( aVisible );
+	}
+
+// ---------------------------------------------------------------------------
+// CDialer::PrepareForFocusGainL
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialer::PrepareForFocusGainL( )
+    {
+    if ( iVirtualKeyBoardOpen )
+        {
+        // Clear editor flags and report
+        // edwin state changed.
+        iVirtualKeyBoardOpen = EFalse;
+        iNumberEntry->ClearEditorFlags();
+        EdwinState()->ReportAknEdStateEventL(
+                MAknEdStateObserver::EAknEdwinStateEventStateUpdate );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDialer::HandleResourceChange
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialer::HandleResourceChange( TInt aType )
+    {
+    if ( aType == KEikDynamicLayoutVariantSwitch )
+        {
+        SizeChanged();
+        }
+    CCoeControl::HandleResourceChange( aType );
+    }
+
+// -----------------------------------------------------------------------------
+// CDialer::HandlePointerEventL
+//
+// -----------------------------------------------------------------------------
+//
+void CDialer::HandlePointerEventL( const TPointerEvent& aPointerEvent )
+    {
+    // Calling base class implementation
+    CCoeControl::HandlePointerEventL(aPointerEvent);    
+    }
+
+// Private methods
+
+// -----------------------------------------------------------------------------
+// CDialer::LoadResourceL
+//
+// -----------------------------------------------------------------------------
+//
+void CDialer::LoadResourceL()
+    {
+    TFileName path( KDriveZ );
+    path.Append( KDC_RESOURCE_FILES_DIR );
+    path.Append( KDialerResourceFile );
+    
+    RFs &fsSession= iEikEnv.FsSession();
+    BaflUtils::NearestLanguageFile( fsSession, path ); 
+    iResourceOffset = iEikEnv.AddResourceFileL( path );
+    }
+
+// -----------------------------------------------------------------------------
+// CDialer::UnLoadResources
+//
+// -----------------------------------------------------------------------------
+//    
+void CDialer::UnLoadResources()
+    {
+    if ( iResourceOffset > 0 )
+        {
+        iEikEnv.DeleteResourceFile( iResourceOffset );
+        iResourceOffset = 0;
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::ComponentControlForDialerMode
+// 
+// Returns contained control by given index in ohonedialer mode.
+//  
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CDialer::ComponentControlForDialerMode( const TInt aIndex ) const
+    {
+    CCoeControl* currentControl(NULL);
+    
+    switch ( aIndex )
+        {
+        case 0:
+            currentControl = iNumberEntry;
+            break;
+        case 1:
+            currentControl = iKeypadArea;
+            break;
+        default:
+            {
+            __ASSERT_DEBUG( EFalse, _L("CDialer::ComponentControl no such component defined"));
+            }
+        }
+
+    return currentControl;
+    } 
+
+// ---------------------------------------------------------------------------
+// CDialer::EdwinState
+// 
+// Returns edwin state of the editor.
+//  
+// ---------------------------------------------------------------------------
+//
+CAknEdwinState* CDialer::EdwinState()
+    {
+    MCoeFepAwareTextEditor_Extension1* extension = 
+        static_cast<MCoeFepAwareTextEditor_Extension1*>
+              ( static_cast<CAknPhoneNumberEditor*> (GetNumberEntry()) );
+
+    return static_cast< CAknEdwinState* >( extension->State( KNullUid ) );
+    } 
+
+// ---------------------------------------------------------------------------
+// CDialer::UpdateVkbEditorFlagsL
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialer::UpdateVkbEditorFlagsL()
+    {
+    CAknEdwinState* edwinState = EdwinState();
+    // Set flags, input mode, SCT, permitted modes,
+    // keymapping and menu for alphanumeric virtual
+    // keyboard.
+    edwinState->SetCurrentInputMode( EAknEditorTextInputMode );
+    edwinState->SetSpecialCharacterTableResourceId( 
+        R_AVKON_URL_SPECIAL_CHARACTER_TABLE_DIALOG );    
+    edwinState->SetFlags( EAknEditorFlagNoT9 |
+                          EAknEditorFlagLatinInputModesOnly | 
+                          EAknEditorFlagNoEditIndicators );            
+    edwinState->SetPermittedInputModes( 
+                          EAknEditorNumericInputMode |
+                          EAknEditorTextInputMode );    
+    edwinState->SetNumericKeymap( EAknEditorAlphanumericNumberModeKeymap );    
+    edwinState->SetMenu();
+    
+    // Report state updated
+    edwinState->ReportAknEdStateEventL(
+                    MAknEdStateObserver::EAknEdwinStateEventStateUpdate );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/src/cdialercontainerbase.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,112 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 for containers
+*
+*/
+
+
+// INCLUDE FILES
+#include <eikapp.h>
+#include <gulicon.h>
+#include <AknUtils.h>
+#include <aknbutton.h>
+#include <AknsUtils.h>
+#include <AknsDrawUtils.h>
+#include <AknLayout2Def.h>
+#include <AknsSkinInstance.h>
+#include <AknsControlContext.h>
+#include <aknlayoutscalable_apps.cdl.h>
+
+#include "cdialercontainerbase.h"
+#include "dialercommon.h"
+#include "dialertrace.h"
+
+// Constructor
+CDialerContainerBase::CDialerContainerBase( 
+    CCoeControl& aContainer )
+    : iParentControl( aContainer )
+    {
+    // empty
+    }
+
+
+// Destructor
+CDialerContainerBase::~CDialerContainerBase()
+    {
+    AknsUtils::DeregisterControlPosition( this );
+
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerContainerBase::ConstructL
+// Symbian OS two phased constructor
+// 
+// ---------------------------------------------------------------------------
+//
+void CDialerContainerBase::BaseConstructL( )
+    {    
+    DIALER_PRINT("ContainerBase::BaseConstructL<");
+    SetContainerWindowL( iParentControl );
+    SetParent( &iParentControl );
+
+    // Define variety according to features available etc.
+    SetVariety();
+
+    DIALER_PRINT("ContainerBase::BaseConstructL>");    
+	}
+
+// ---------------------------------------------------------------------------
+// CDialerContainerBase::MopSupplyObject
+//
+// ---------------------------------------------------------------------------
+//
+TTypeUid::Ptr CDialerContainerBase::MopSupplyObject( TTypeUid aId )
+    {
+    return CCoeControl::MopSupplyObject( aId );
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerContainerBase::SizeChanged
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialerContainerBase::SizeChanged( )
+    {
+    SetVariety();
+    SetLayout();
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerContainerBase::PositionChanged
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialerContainerBase::PositionChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerContainerBase::HandleResourceChange
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialerContainerBase::HandleResourceChange( TInt aType )
+    {
+    // Call implementation class SizeChanged()
+    SizeChanged();
+    CCoeControl::HandleResourceChange( aType );
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/src/cdialerkeypadcontainer.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,771 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Shows number keypad and generates keypress event when 
+*                 buttons are pressed.
+*
+*/
+
+
+// INCLUDE FILES
+#include <e32event.h>
+#include <gulicon.h>
+#include <eikapp.h>
+#include <AknUtils.h>
+#include <aknbutton.h>
+#include <AknControl.h>
+#include <AknsUtils.h>
+#include <AknsSkinInstance.h>
+#include <AknsDrawUtils.h>
+#include <AknsConstants.h>
+#include <AknLayout2Def.h>
+#include <aknlayoutscalable_apps.cdl.h>
+#include <layoutmetadata.cdl.h>
+#include <data_caging_path_literals.hrh> // for KDC_APP_RESOURCE_DIR
+#include <touchfeedback.h>
+
+#include "cdialerkeypadcontainer.h"
+#include "dialercommon.h"
+#include "dialertrace.h"
+
+#include "cdialerkeypadbutton.h"
+_LIT( KDialerMifFileName, "dialer.mif" );
+
+// Number of buttons in this container
+const TInt KNumberOfButtons = 12; 
+
+// Keypad button images
+const TMifDialer KKeyPadButtons[] =
+    {
+    EMbmDialerQgn_indi_dialer_one,
+    EMbmDialerQgn_indi_dialer_two,
+    EMbmDialerQgn_indi_dialer_three,
+    EMbmDialerQgn_indi_dialer_four,
+    EMbmDialerQgn_indi_dialer_five,
+    EMbmDialerQgn_indi_dialer_six,
+    EMbmDialerQgn_indi_dialer_seven,
+    EMbmDialerQgn_indi_dialer_eight,
+    EMbmDialerQgn_indi_dialer_nine,
+    EMbmDialerQgn_indi_dialer_prefix,
+    EMbmDialerQgn_indi_dialer_zero,
+    EMbmDialerQgn_indi_dialer_hash
+    };
+
+// Keypad button image masks
+const TMifDialer KKeyPadButtonsMasks[] =
+    {
+    EMbmDialerQgn_indi_dialer_one_mask,
+    EMbmDialerQgn_indi_dialer_two_mask,
+    EMbmDialerQgn_indi_dialer_three_mask,
+    EMbmDialerQgn_indi_dialer_four_mask,
+    EMbmDialerQgn_indi_dialer_five_mask,
+    EMbmDialerQgn_indi_dialer_six_mask,
+    EMbmDialerQgn_indi_dialer_seven_mask,
+    EMbmDialerQgn_indi_dialer_eight_mask,
+    EMbmDialerQgn_indi_dialer_nine_mask,
+    EMbmDialerQgn_indi_dialer_prefix_mask,
+    EMbmDialerQgn_indi_dialer_zero_mask,
+    EMbmDialerQgn_indi_dialer_hash_mask
+    };
+
+// Match keypresses to keyevents send to the phone
+//
+const TInt TDialerButtonToKeypadMap[12][2] = 
+        {  
+            { 49, // ScanCode
+              49  // KeyCode
+            },
+            { 50,
+              50
+            },
+            { 51,
+              51
+            },
+            { 52,
+              52
+            },    
+            { 53,
+              53
+            },
+            { 54,
+              54
+            },
+            { 55,
+              55
+            },
+            { 56,
+              56
+            },
+            { 57,
+              57
+            },                        
+            { EStdKeyNkpAsterisk,
+              42
+            },
+            { '0',
+              '0'
+            }, 
+            { EStdKeyHash,
+              35
+            }                                                                                                       
+        };   
+
+// Class declaration for CDialerKeyPadButton separated to cdialerkeypadbutton.h.
+
+// ---------------------------------------------------------------------------
+// C++ default constructor
+// ---------------------------------------------------------------------------
+//
+CDialerKeyPadButton::CDialerKeyPadButton()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CDialerKeyPadButton::~CDialerKeyPadButton()
+    {
+    MTouchFeedback* feedback = MTouchFeedback::Instance();
+    if ( feedback )
+        {
+        feedback->RemoveFeedbackForControl( iButton );
+        }
+    delete iButton;   
+    }
+        
+// ---------------------------------------------------------------------------
+// Creates number keypad button
+// ---------------------------------------------------------------------------
+//
+void CDialerKeyPadButton::CreateButtonL( const TInt aScanCode, 
+                                         const TInt aKeyCode,
+                                         const TMifDialer aButtonIcon, 
+                                         const TMifDialer aButtonIconMask )
+    {
+    iScanCode = aScanCode;
+    iKeyCode  = aKeyCode;
+    iButtonIcon = aButtonIcon;
+    iButtonIconMask = aButtonIconMask;
+    
+    TFileName mifPath( KDriveZ );
+    mifPath.Append( KDC_APP_BITMAP_DIR );
+    mifPath.Append( KDialerMifFileName );
+
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    CFbsBitmap* bitmap (NULL);
+    CFbsBitmap* mask (NULL);
+
+    // Get icon ids.
+    TAknsItemID skinItemId( KAknsIIDNone );  
+    
+    // Create button image.
+    MapDialerIconToSkinIcon( aButtonIcon ,skinItemId );
+    AknsUtils::CreateColorIconLC( 
+        skin, 
+        skinItemId,
+        KAknsIIDQsnIconColors, 
+        EAknsCIQsnIconColorsCG30,
+        bitmap, 
+        mask, 
+        mifPath, 
+        aButtonIcon, 
+        aButtonIconMask,
+        KRgbBlack
+        );
+
+    CGulIcon* icon = CGulIcon::NewL( bitmap, mask );
+    CleanupStack::Pop( 2 );
+    CleanupStack::PushL( icon );
+    iButton = CAknButton::NewL(
+        icon , // ownership taken
+        NULL, NULL, NULL, _L(""), _L(""), 0, 0 );
+    iButton->SetButtonFlags( KAknButtonReportOnLongPress|
+                            KAknButtonReportOnKeyDown  |
+                            KAknButtonRequestExitOnButtonUpEvent );
+    iButton->SetIconScaleMode( EAspectRatioPreserved );
+    iButton->SetMargins( TMargins8(0,0,0,0) );    
+    CleanupStack::Pop( icon ); 
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//    
+TInt CDialerKeyPadButton::ScanCode() const
+    {
+    return iScanCode;
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//    
+TInt CDialerKeyPadButton::KeyCode() const
+    {
+    return iKeyCode;
+    }    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CDialerKeyPadButton::MapDialerIconToSkinIcon( const TInt aDialerIcon, 
+                                         TAknsItemID& aItemId ) const
+    {    
+    switch ( aDialerIcon )
+        {
+        case EMbmDialerQgn_indi_dialer_one:
+            aItemId = KAknsIIDQgnIndiDialerOne;
+            break;
+        case EMbmDialerQgn_indi_dialer_two:
+            aItemId = KAknsIIDQgnIndiDialerTwo;
+            break;
+        case EMbmDialerQgn_indi_dialer_three:
+            aItemId = KAknsIIDQgnIndiDialerThree;
+            break;
+        case EMbmDialerQgn_indi_dialer_four:
+            aItemId = KAknsIIDQgnIndiDialerFour;
+            break;
+        case EMbmDialerQgn_indi_dialer_five:
+            aItemId = KAknsIIDQgnIndiDialerFive;
+            break;
+        case EMbmDialerQgn_indi_dialer_six:
+            aItemId = KAknsIIDQgnIndiDialerSix;
+            break;
+        case EMbmDialerQgn_indi_dialer_seven:
+            aItemId = KAknsIIDQgnIndiDialerSeven;
+            break;    
+        case EMbmDialerQgn_indi_dialer_eight:
+            aItemId = KAknsIIDQgnIndiDialerEight;
+            break;
+        case EMbmDialerQgn_indi_dialer_nine:
+            aItemId = KAknsIIDQgnIndiDialerNine;
+            break;
+        case EMbmDialerQgn_indi_dialer_zero:
+            aItemId = KAknsIIDQgnIndiDialerZero;
+            break;
+        case EMbmDialerQgn_indi_dialer_prefix:
+            aItemId = KAknsIIDQgnIndiDialerPrefix;
+            break;
+        case EMbmDialerQgn_indi_dialer_hash:
+            aItemId = KAknsIIDQgnIndiDialerHash;
+            break;                        
+        default:
+            break;
+        }
+    }   
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//   
+void CDialerKeyPadButton::SetIconSize( TSize& aSize )
+    {
+    iButton->SetIconSize( aSize );
+    }  
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//   
+void CDialerKeyPadButton::UpdateIconL()
+    {
+    TFileName mifPath( KDriveZ );
+    mifPath.Append( KDC_APP_BITMAP_DIR );
+    mifPath.Append( KDialerMifFileName );
+    
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    CFbsBitmap* bitmap (NULL);
+    CFbsBitmap* mask (NULL);
+        
+    // Get icon id.
+    TAknsItemID skinItemId( KAknsIIDNone );  
+    MapDialerIconToSkinIcon( iButtonIcon, skinItemId );
+    
+    AknsUtils::CreateColorIconLC( 
+            skin, 
+            skinItemId,
+            KAknsIIDQsnIconColors, 
+            EAknsCIQsnIconColorsCG30,
+            bitmap, 
+            mask, 
+            mifPath, 
+            iButtonIcon, 
+            iButtonIconMask,
+            KRgbBlack
+            );
+    
+    CGulIcon* icon = CGulIcon::NewL( bitmap, mask );
+    CleanupStack::Pop( 2 );
+    
+    iButton->State()->SetIcon( icon ); // icon ownership transfered
+    
+    }  
+
+// ---------------------------------------------------------------------------
+// 
+// Enable or disable audio but keep vibra feedback 
+// ---------------------------------------------------------------------------
+//   
+void CDialerKeyPadButton::EnableAudioFeedback( const TBool aEnable )
+    {
+    MTouchFeedback* feedback = MTouchFeedback::Instance();
+    if ( feedback )
+        {
+        feedback->EnableFeedbackForControl( iButton, ETrue, aEnable );
+        }
+    }
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CDialerKeyPadButton::HandleResourceChange( TInt aType )
+    {
+    if ( aType == KAknsMessageSkinChange )
+        {
+        TRAP_IGNORE( UpdateIconL() );
+        iButton->HandleResourceChange( aType );
+        }    
+    }
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// Symbian OS two phased constructor
+// ---------------------------------------------------------------------------
+//
+CDialerKeyPadContainer* CDialerKeyPadContainer::NewL( 
+    const CCoeControl& aContainer,
+    TDialerOperationMode aOperatingMode
+     )
+    {
+    CDialerKeyPadContainer* self = 
+        new( ELeave )CDialerKeyPadContainer ( aContainer, aOperatingMode );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Symbian OS two phased constructor
+// ---------------------------------------------------------------------------
+//
+void CDialerKeyPadContainer::ConstructL()
+    {    
+    DIALER_PRINT("KeyPadContainer::ConstructL<");
+    BaseConstructL();
+    CreateButtonsL();
+    CCoeEnv* env = CCoeEnv::Static();
+    env->AddForegroundObserverL( *this );
+    DIALER_PRINT("KeyPadContainer::ConstructL>");
+    }
+
+// Constructor
+CDialerKeyPadContainer::CDialerKeyPadContainer( 
+    const CCoeControl& aContainer, 
+    TDialerOperationMode aOperatingMode )
+    : CDialerContainerBase ( 
+        const_cast<CCoeControl&>(aContainer) ),
+      iOperatingMode( aOperatingMode ),
+      iButtonCount( KNumberOfButtons )
+    {
+    }
+    
+// Destructor
+CDialerKeyPadContainer::~CDialerKeyPadContainer()
+    {
+    for ( TInt i = 0; i < iButtonCount; i++ )
+        {
+        AknsUtils::DeregisterControlPosition( 
+                   ((CDialerKeyPadButton*)iButtons[i])->Control());   
+        delete iButtons[i];
+        }
+    iButtons.Close();
+    CCoeEnv* env = CCoeEnv::Static();
+    env->RemoveForegroundObserver( *this );
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerKeyPadContainer::CountComponentControls
+//
+// ---------------------------------------------------------------------------
+//
+TInt CDialerKeyPadContainer::CountComponentControls() const
+    {
+    return KNumberOfButtons;
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerKeyPadContainer::ComponentControl
+//
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CDialerKeyPadContainer::ComponentControl( TInt aIndex ) const
+    {
+    __ASSERT_DEBUG( aIndex < KNumberOfButtons, 
+    _L("CDialerKeyPadContainer::ComponentControl, index out of range."));
+    
+    return ((CDialerKeyPadButton*)iButtons[aIndex])->Control();
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialerKeyPadContainer::HandlePointerEventL
+//
+// ---------------------------------------------------------------------------
+//  
+void CDialerKeyPadContainer::HandlePointerEventL(
+    const TPointerEvent& aPointerEvent )
+    {
+    DIALER_PRINT("KeyPadContainer::HandlePointerEventL<");    
+    
+    CCoeControl::HandlePointerEventL( aPointerEvent );    
+
+    if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) 
+        {
+        iPointerEvent = aPointerEvent;    
+        }
+    DIALER_PRINT("KeyPadContainer::HandlePointerEventL>");     
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialerKeyPadContainer::SetVariety
+//
+// Set variety according to current state.
+// ---------------------------------------------------------------------------
+//
+void CDialerKeyPadContainer::SetVariety()
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        iVariety = EVideoVarietyLandscape;
+        }
+    else
+        {
+        iVariety = EVideoVarietyPortrait;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerKeyPadContainer::SetLayout
+//
+// Set layout for video dtmf or phone dialer 
+// ---------------------------------------------------------------------------
+//
+void CDialerKeyPadContainer::SetLayout()
+    {
+    if ( iOperatingMode == EModeDialer )
+        {
+        SetPhoneLayout();
+        }
+    else
+        {
+        SetVideoLayout();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerKeyPadContainer::SetPhoneLayout
+//
+// ---------------------------------------------------------------------------
+//
+void CDialerKeyPadContainer::SetPhoneLayout()
+    {
+    // Set Number entry layout.
+    /*
+
+    // LAF Table : grid_dialer2_keypad_pane
+    inline TAknLayoutScalableParameterLimits cell_dialer2_keypad_pane_ParamLimits()
+    inline TAknWindowComponentLayout cell_dialer2_keypad_pane()
+
+    // LAF Table : cell_dialer2_keypad_pane
+    inline TAknLayoutScalableParameterLimits bg_button_pane_pane_cp04_ParamLimits()
+    inline TAknWindowComponentLayout bg_button_pane_pane_cp04()
+    inline TAknLayoutScalableParameterLimits cell_dialer2_keypad_pane_g1_ParamLimits()
+    */
+    
+    TRect parentRect( Rect() );
+
+    // Icon size - all in same size
+    TAknLayoutRect functionGraphics;  
+             
+    functionGraphics.LayoutRect( 
+        parentRect,
+        TAknWindowComponentLayout::Compose(
+            AknLayoutScalable_Apps::cell_dialer2_keypad_pane( iVariety ),
+            AknLayoutScalable_Apps::cell_dialer2_keypad_pane_g1( 
+                                                        iVariety ) ) );
+    TSize iconSize = functionGraphics.Rect().Size();
+    
+    // Layout buttons
+    TAknLayoutScalableParameterLimits limits = 
+    AknLayoutScalable_Apps::cell_dialer2_keypad_pane_ParamLimits( iVariety );
+    
+    TInt i = 0;
+    for ( TInt row = limits.FirstRow(); row <= limits.LastRow(); row++ )
+        {
+        for ( TInt col = limits.FirstColumn(); 
+              col <= limits.LastColumn(); col++ )
+            {
+            // Layout button
+            AknLayoutUtils::LayoutControl(
+                ((CDialerKeyPadButton*)iButtons[i])->Control(), parentRect, 
+                TAknWindowComponentLayout::Compose( 
+                    AknLayoutScalable_Apps::cell_dialer2_keypad_pane( iVariety,
+                                                col, row ), 
+                    AknLayoutScalable_Apps::bg_button_pane_pane_cp04( 
+                                                iVariety ) ) );
+            
+            // Set icon size
+            ((CDialerKeyPadButton*)iButtons[i++])->SetIconSize( iconSize );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerKeyPadContainer::SetVideoLayout
+//
+// ---------------------------------------------------------------------------
+//
+void CDialerKeyPadContainer::SetVideoLayout()
+    {
+    TRect parentRect( Rect() );
+    
+    // Icon size - all in same size
+    TAknLayoutRect functionGraphics;  
+             
+    functionGraphics.LayoutRect( 
+        parentRect,
+        TAknWindowComponentLayout::Compose(
+            AknLayoutScalable_Apps::cell_video_dialer_keypad_pane( iVariety, 
+                                        0, 0 ),
+            AknLayoutScalable_Apps::cell_video_dialer_keypad_pane_g1( 
+                                        iVariety ) ) );
+    TSize iconSize = functionGraphics.Rect().Size();
+    
+    TAknLayoutScalableParameterLimits limits = 
+        AknLayoutScalable_Apps::cell_video_dialer_keypad_pane_ParamLimits( 
+                                        iVariety ) ;
+    
+    TInt i = 0;
+    for ( TInt row = limits.FirstRow(); row <= limits.LastRow(); row++ )
+        {
+        for ( TInt col = limits.FirstColumn(); 
+              col <= limits.LastColumn(); 
+              col++ )
+            {
+            // Layout button
+            AknLayoutUtils::LayoutControl(
+                ((CDialerKeyPadButton*)iButtons[i])->Control(), parentRect, 
+                TAknWindowComponentLayout::Compose( 
+                    AknLayoutScalable_Apps::cell_video_dialer_keypad_pane( 
+                        iVariety, col, row ), 
+                    AknLayoutScalable_Apps::bg_button_pane_cp08( 
+                                        iVariety ) ) );
+            
+            // Set icon size
+            iButtons[i++]->SetIconSize( iconSize );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerKeyPadContainer::CreateButtonsL
+//
+// Create buttons for this container.
+// ---------------------------------------------------------------------------
+//
+void CDialerKeyPadContainer::CreateButtonsL()
+    {
+    DIALER_PRINT("KeyPadContainer::CreateButtonsL<");
+    
+    for ( TInt i=0; i < KNumberOfButtons; i++ )
+        {
+        CDialerKeyPadButton* button = new (ELeave) CDialerKeyPadButton();
+        CleanupStack::PushL( button );
+        button->CreateButtonL( TDialerButtonToKeypadMap[i][0],
+                               TDialerButtonToKeypadMap[i][1],         
+                               KKeyPadButtons[i],
+                               KKeyPadButtonsMasks[i] );
+        CleanupStack::Pop( button );
+        iButtons.Append( button );                      
+        button->Control()->SetMopParent( this );
+        button->Control()->SetParent( this );    
+        button->Control()->SetContainerWindowL( *this );
+        button->Control()->SetObserver( this );    
+        button->Control()->ActivateL();
+        AknsUtils::RegisterControlPosition( button->Control() );   
+        }     
+    DIALER_PRINT("KeyPadContainer::CreateButtonsL>");        
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerKeyPadContainer::HandleControlEventL
+//
+// Handles an event from an observed button item.
+// Finds the pressed button and generates key press event, which
+// is handled by parent control.
+//
+// ---------------------------------------------------------------------------
+//
+void CDialerKeyPadContainer::HandleControlEventL( CCoeControl* aControl,
+                                                TCoeEvent aEventType )
+    {
+    DIALER_PRINTF("KeyPadContainer::HandleControlEventL.EventType=",
+                 (TInt)aEventType);
+    
+   if ( aEventType == EEventStateChanged   || 
+        aEventType == EEventRequestCancel ||
+        aEventType == EEventRequestExit)
+        
+        {
+        // Find tapped control 
+
+        CDialerKeyPadButton* tappedButton = NULL;
+        for ( TInt i=0; i < iButtons.Count(); i++ )
+            {
+            if ( iButtons[i]->Control() == aControl )
+                {
+                tappedButton = iButtons[i];
+                break;
+                }    
+            }
+            
+        // Send key event to phone.
+        TKeyEvent keyEvent;
+        keyEvent.iScanCode = tappedButton->ScanCode();
+        keyEvent.iCode = tappedButton->KeyCode();
+        keyEvent.iModifiers = 0;
+        keyEvent.iRepeats = 0;  
+             
+        switch ( aEventType )
+            {
+            case EEventRequestExit:
+            case EEventRequestCancel:
+                {
+                DIALER_PRINT("HandleControlEventL.EEventRequestExit");
+                iButtonPressedDown = EFalse;
+                keyEvent.iCode = 0;
+                ControlEnv()->SimulateKeyEventL( keyEvent, EEventKeyUp );
+                }
+                break;
+            case EEventStateChanged:
+                {    
+                DIALER_PRINT("HandleControlEventL.EEventStateChanged");
+                iButtonPressedDown = ETrue;
+
+                iParentControl.PrepareForFocusGainL();
+
+                ControlEnv()->SimulateKeyEventL( keyEvent, EEventKeyDown );    
+
+                if( iButtonPressedDown )
+                    {
+                    // Send event key if key havent be lifted up already
+                    ControlEnv()->SimulateKeyEventL( keyEvent, EEventKey );
+                    }
+                }
+                break;
+            default:
+            break;
+            }
+        }
+    DIALER_PRINT("KeyPadContainer::HandleControlEventL>");        
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialerKeyPadContainer::HandleResourceChange
+//
+// Forwards skin change event to buttons
+//
+// ---------------------------------------------------------------------------
+//
+void CDialerKeyPadContainer::HandleResourceChange( TInt aType )
+    {
+    if ( aType == KAknsMessageSkinChange )
+        {    
+        for ( TInt i=0; i < iButtons.Count(); i++ )
+            {
+            (( CDialerKeyPadButton* )iButtons[i])->HandleResourceChange( 
+                                                                    aType );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerKeyPadContainer::MakeVisible
+//
+// Called when dialer control come visible or unvisible
+//
+// ---------------------------------------------------------------------------
+//
+void CDialerKeyPadContainer::MakeVisible( TBool aVisible )
+    {
+    // This is needed when dialer control disappeares during keypress. 
+    // Last pressed pointer event must be forwarted to framework 
+    // as pointer up event. Thus button is set to unpressed state etc. 
+    // 
+    if ( !aVisible && iButtonPressedDown )
+        {    
+        iPointerEvent.iType = TPointerEvent::EButton1Up;
+        TRAP_IGNORE( HandlePointerEventL( iPointerEvent ) );
+        }    
+    CCoeControl::MakeVisible( aVisible );        
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDialerKeyPadContainer::HandleGainingForeground
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CDialerKeyPadContainer::HandleGainingForeground()
+    {
+    
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialerKeyPadContainer::HandleLosingForeground
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CDialerKeyPadContainer::HandleLosingForeground()
+    {
+    // This is needed when dialer control disappeares during keypress. 
+    // Last pressed pointer event must be forwarted to framework 
+    // as pointer up event. Thus button is set to unpressed state etc. 
+    // 
+    if ( iButtonPressedDown )
+        {    
+        iPointerEvent.iType = TPointerEvent::EButton1Up;
+        TRAP_IGNORE( HandlePointerEventL( iPointerEvent ) );
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerKeyPadContainer::EnableTactileFeedback
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CDialerKeyPadContainer::EnableTactileFeedback( const TBool aEnable )
+    {
+    for ( TInt i=0; i < iButtons.Count(); i++ )
+        {
+        (( CDialerKeyPadButton* )iButtons[i])->EnableAudioFeedback( aEnable );
+        }
+
+    }
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/src/cdialernumberentry.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,774 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 for numberentry 
+*
+*/
+
+
+// INCLUDE FILES
+#include <eikenv.h>
+#include <eikapp.h>
+#include <gulicon.h>
+#include <w32std.h>
+#include <baclipb.h>            // CClipboard
+#include <dialer.rsg>
+#include <eikimage.h>           // CEikImage
+#include <barsread.h>           // TResourceReader
+#include <eiklabel.h> 
+#include <aknappui.h>
+#include <AknUtils.h>
+#include <AknsDrawUtils.h>
+#include <applayout.cdl.h>
+#include <AknLayoutFont.h>
+#include <AknLayout2Def.h>
+#include <AknPhoneNumberEditor.h>
+#include <AknLayout2ScalableDef.h>
+#include <AknsBasicBackgroundControlContext.h>
+#include <AknsFrameBackgroundControlContext.h>
+#include <aknlayoutscalable_apps.cdl.h>
+#include <layoutmetadata.cdl.h>
+
+#include "cdialernumberentry.h"
+#include "dialercommon.h"
+#include "dialertrace.h"
+#include "dialer.hrh"
+#include "mnumberentry.h"
+
+
+const TInt KNumberEntryControlCount = 2; //  = number entry, label
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// NewL
+// Symbian OS two phased constructor
+// 
+// ---------------------------------------------------------------------------
+//
+CDialerNumberEntry* CDialerNumberEntry::NewL( 
+    const CCoeControl& aContainer )
+    {
+    CDialerNumberEntry* self = 
+        new( ELeave )CDialerNumberEntry( aContainer );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();    // self
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// Symbian OS two phased constructor
+// 
+// ---------------------------------------------------------------------------
+//
+void CDialerNumberEntry::ConstructL()
+    {   
+   	DIALER_PRINT("numberentry::ConstructL<");  
+    BaseConstructL();
+ 
+    // Create number entry editor    
+    iEditor = new( ELeave ) CAknPhoneNumberEditor;
+    iEditor->SetContainerWindowL( *this );
+    iEditor->SetParent( this );
+    iEditor->SetMopParent( this );
+    TResourceReader reader;
+    iCoeEnv->CreateResourceReaderLC( reader, R_INPUTFIELD );
+    ConstructEditorFromResourceL( reader );
+    
+    iFrameContext = CAknsFrameBackgroundControlContext::NewL(
+            KAknsIIDNone, TRect(0,0,4,4), TRect(1,1,3,3), EFalse );    
+            
+    iFrameContext->SetFrame( KAknsIIDQsnFrCall2Rect );      
+    
+    iFrameContext->SetParentContext( 
+        AknsDrawUtils::ControlContextOfParent(this) );           
+                
+    CleanupStack::PopAndDestroy();    // reader    
+    iEditor->SetObserver( this );
+    
+    iLabel = new( ELeave ) CEikLabel;
+    iLabel->SetContainerWindowL( *this );
+    iLabel->SetParent( this );
+    iLabel->SetMopParent( this ); 
+    iLabel->SetTextL( KNullDesC );
+    iLabel->MakeVisible( EFalse );    
+    CheckLabelSkinningColor();
+     
+    ActivateL();
+    DIALER_PRINT("numberentry::ConstructL>");
+    }
+
+
+// Constructor
+CDialerNumberEntry::CDialerNumberEntry(
+    const CCoeControl& aContainer )
+    : CDialerContainerBase ( const_cast<CCoeControl&>(aContainer)  )
+	{
+	}
+
+
+// Destructor
+CDialerNumberEntry::~CDialerNumberEntry()
+    {
+    AknsUtils::DeregisterControlPosition( this );
+    
+    delete iEditor;
+    delete iFrameContext;
+    delete iLabel;
+    
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::SetNumberEntryObserver 
+// ---------------------------------------------------------------------------
+//
+void CDialerNumberEntry::SetNumberEntryObserver( 
+                                MNumberEntryObserver& aObserver )
+    {
+    iObserver = &aObserver;
+    }
+        
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::SetFocus
+// ---------------------------------------------------------------------------
+//
+void CDialerNumberEntry::SetFocus( TBool aFocus, 
+                                            TDrawNow /*aDrawNow*/ )
+    {
+    DIALER_PRINT("numberentry::SetFocus<");
+    
+    iEditor->SetFocus( aFocus );
+     
+    DIALER_PRINT("numberentry::SetFocus>");    
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::TextLength 
+// ---------------------------------------------------------------------------
+//
+TInt CDialerNumberEntry::TextLength()
+    {
+    return iEditor->TextLength();
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::GetNumberEntry
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CDialerNumberEntry::GetNumberEntry( ) const
+    {
+    return iEditor;
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::CreateNumberEntry
+// ---------------------------------------------------------------------------
+//
+void CDialerNumberEntry::CreateNumberEntry()
+    {
+    iEditor->SetFocus( ETrue );
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::ChangeEditorMode
+// ---------------------------------------------------------------------------
+//
+TInt CDialerNumberEntry::ChangeEditorMode( TBool aDefaultMode )
+    {
+    return iEditor->ChangeEditorMode( aDefaultMode );
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::GetEditorMode  
+// ---------------------------------------------------------------------------
+//
+TInt CDialerNumberEntry::GetEditorMode() const
+    {
+    return iEditor->GetEditorMode();
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::SetTextToNumberEntry
+// ---------------------------------------------------------------------------
+//
+void CDialerNumberEntry::SetTextToNumberEntry( const TDesC& aDesC )
+    {
+    DIALER_PRINT("numberentry::SetTextToNumberEntry<");
+        	
+    iEditor->SetText( aDesC );   
+    iEditor->DrawNow();
+    
+    DIALER_PRINT("numberentry::SetTextToNumberEntry>");
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::GetTextFromNumberEntry
+// ---------------------------------------------------------------------------
+//
+void CDialerNumberEntry::GetTextFromNumberEntry( TDes& aDesC )
+    {
+    iEditor->GetText( aDesC );
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::ResetEditorToDefaultValues
+// ---------------------------------------------------------------------------
+//
+void CDialerNumberEntry::ResetEditorToDefaultValues()
+    {
+    iEditor->SetFocus( EFalse );
+    SetTextToNumberEntry( KNullDesC );
+    iEditor->ResetEditorToDefaultValues();
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::SetNumberEntryPromptTextL
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialerNumberEntry::SetNumberEntryPromptTextL( const TDesC& aPromptText )
+    {
+    if ( aPromptText.Length() )
+        {
+        iLabel->MakeVisible( ETrue );
+        }
+    else
+        {
+        iLabel->MakeVisible( EFalse );
+        }
+    
+    iLabel->SetTextL( aPromptText );   
+    }
+
+// ----------------------------------------------------------------------------
+// CDialerNumberEntry::HandleCommandL
+// Handles NE specific commands.
+// ----------------------------------------------------------------------------
+//
+TBool CDialerNumberEntry::HandleCommandL( TDialerCommandId aCommand)
+    {
+    DIALER_PRINTF("numberentry::HandleCommandL<:", aCommand); 
+    	
+    TBool handled( ETrue );
+    switch ( aCommand )
+        {
+        case EDialerCmdTouchInput:  // open touch input (VKB)
+            {
+            StartVirtualKeyBoard();
+            }
+            break;
+        default:
+            {
+            handled = EFalse;
+            }
+            break;
+        }
+        
+    DIALER_PRINT("numberentry::HandleCommandL>");         
+    return handled;
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::ClearEditorFlags
+// ---------------------------------------------------------------------------
+//
+void CDialerNumberEntry::ClearEditorFlags()
+    {
+    iEditor->ResetEditorToDefaultValues();
+    }
+
+// ---------------------------------------------------------------------------
+//  CDialerNumberEntry::HandleControlEventL
+// ---------------------------------------------------------------------------
+//
+void CDialerNumberEntry::HandleControlEventL( CCoeControl* aControl, 
+                                              TCoeEvent aEventType )
+    {
+    DIALER_PRINT("numberentry::HandleControlEventL<"); 
+    
+    TInt format( KDialerNELayoutLargeFont );
+    if ( aControl == iEditor && aEventType == EEventStateChanged )
+        {
+        HandleEditorFormatting();
+        InformNumberEntryState();        
+        iEditor->DrawDeferred();
+        
+        }
+        
+    DIALER_PRINT("numberentry::HandleControlEventL>");                
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::OfferKeyEventL
+// ---------------------------------------------------------------------------
+//
+TKeyResponse CDialerNumberEntry::OfferKeyEventL( 
+                                            const TKeyEvent& aKeyEvent, 
+                                            TEventCode aType )
+    {   
+    return iEditor->OfferKeyEventL( aKeyEvent, aType );
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::CountComponentControls 
+// ---------------------------------------------------------------------------
+//
+TInt CDialerNumberEntry::CountComponentControls() const
+    {
+    return KNumberEntryControlCount;
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::ComponentControl
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CDialerNumberEntry::ComponentControl( TInt aIndex ) const
+    {
+    __ASSERT_DEBUG( aIndex < KNumberEntryControlCount, 
+                             User::Panic(_L("Dialer"), KErrArgument) );
+    
+    if ( aIndex == 0 )
+        {
+        return iEditor;
+        }
+    else if ( aIndex == 1 )
+        {
+        return iLabel;
+        }
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::Draw
+// ---------------------------------------------------------------------------
+//
+void CDialerNumberEntry::Draw( const TRect& /*aRect*/ ) const
+    {
+    CWindowGc& gc = SystemGc( );
+    gc.SetBrushColor( AKN_LAF_COLOR( 0 /** White - get from layout */ ));
+    TRect rect = Rect();
+    
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    
+    // Draw the skin background of the parent 
+    if ( !AknsDrawUtils::DrawFrame( skin,
+                             (CWindowGc&) gc,  
+                             iOuterRect,
+                             iInnerRect,
+                             KAknsIIDQsnFrCall2Rect,
+                             KAknsIIDDefault ))
+        {
+        DIALER_PRINT("numberentry::Draw.Frame.failed"); 
+        }
+                            
+    gc.SetBrushStyle( CGraphicsContext::ENullBrush );        
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::SetVariety
+// Set variety according to status
+// ---------------------------------------------------------------------------
+//
+void CDialerNumberEntry::SetVariety()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::SetLayout
+// ---------------------------------------------------------------------------
+//
+void CDialerNumberEntry::SetLayout()
+    {
+    AknsUtils::RegisterControlPosition( this );
+
+    TDialerVariety variety( EDialerVarietyLandscape );
+    if (  !Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        variety = EDialerVarietyPortrait;
+        }      
+        
+    TRect parentRect( Rect() );
+    TAknTextComponentLayout neLayout = 
+                        AknLayoutScalable_Apps::dialer2_ne_pane_t1( variety ); 
+
+    AknLayoutUtils::LayoutControl(
+        iEditor, parentRect, 
+        neLayout.C(),
+        neLayout.l(),
+        neLayout.t(),
+        neLayout.r(),
+        neLayout.b(),
+        neLayout.W(),
+        neLayout.H()
+        );
+
+    UpdateNumberEntryFormats(); 
+      
+    RectFrameInnerOuterRects(
+           Rect(),
+           iOuterRect,
+           iInnerRect );
+
+    iFrameContext->SetFrameRects( iOuterRect, iInnerRect );
+                
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    AknsDrawUtils::PrepareFrame( skin,
+                                 iOuterRect,
+                                 iInnerRect,
+                                 KAknsIIDQsnFrCall2Rect,
+                                 KAknsIIDDefault ); 
+    // Label layout
+
+    // Portrait variety is temporarily used also in landscape.
+    // Landscape layout data is now unavailable. 
+    TAknTextComponentLayout labelLayout = 
+                        AknLayoutScalable_Apps::dialer2_ne_pane_t2( 
+                                                    EDialerVarietyPortrait );
+    // Temporary solution 
+    labelLayout.Setl(neLayout.l());
+    AknLayoutUtils::LayoutLabel( iLabel, parentRect, labelLayout );
+    
+    HandleEditorFormatting();
+    iEditor->DrawDeferred();
+    
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::ConstructEditorFromResourceL 
+// ---------------------------------------------------------------------------
+//
+void CDialerNumberEntry::ConstructEditorFromResourceL( 
+                                TResourceReader& aReader )
+    {
+    TInt maxChars = aReader.ReadInt16();
+    TInt maxLines = aReader.ReadInt16();
+    HBufC* truncation = aReader.ReadHBufCL();
+    CleanupStack::PushL( truncation );
+    TInt formatCount = aReader.ReadInt16();
+    iEditor->ConstructL( maxChars, maxLines, formatCount, *truncation );  
+    CleanupStack::PopAndDestroy( truncation );       
+    iFormatCount = formatCount;
+
+    for ( TInt ii = 0; ii < iFormatCount; ii++ )
+        {
+        CAknPhoneNumberEditor::TFormat format( aReader );
+	    CalculateLayout( format, ii );
+        iEditor->AddFormat( format );
+        }
+
+    iEditor->SetFormat( KDialerNELayoutLargeFont );
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::UpdateNumberEntryFormats
+// ---------------------------------------------------------------------------
+//
+void CDialerNumberEntry::UpdateNumberEntryFormats( )
+    {
+    DIALER_PRINT("numberentry::UpdateNumberEntryFormats<");
+    TInt currentFormat = iEditor->CurrentFormatIndex();
+
+    for ( TInt ii = 0; ii < iFormatCount; ii++ )
+        {
+        CAknPhoneNumberEditor::TFormat format( iEditor->Format( ii ) );
+		CalculateLayout( format, ii );
+        iEditor->Format( ii ) = format;
+        }
+
+    iEditor->SetFormat( currentFormat );
+    DIALER_PRINT("numberentry::UpdateNumberEntryFormats>");
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::CalculateLayout
+// ---------------------------------------------------------------------------
+//
+void CDialerNumberEntry::CalculateLayout( 
+        CAknPhoneNumberEditor::TFormat& aFormat, TInt aNEVariety )
+    {
+    TAknLayoutText textsLargeFontLine1Text;
+    TAknLayoutText textsLargeFontLine2Text;
+    TAknLayoutText textsLargeFontLine3Text;
+    
+    TAknLayoutText textsSmallFontLine1Text;
+    TAknLayoutText textsSmallFontLine2Text;
+    TAknLayoutText textsSmallFontLine3Text;    		
+      
+    const CAknLayoutFont* layoutFont;
+	
+	switch ( aNEVariety )
+		{
+		case KDialerNELayoutLargeFont:
+			{
+			TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 2 : 0;
+			
+            TAknLayoutScalableParameterLimits limits = 
+                AknLayoutScalable_Apps::dialer2_ne_pane_t1_ParamLimits( 
+                                                         variety );                
+            //Line 1
+            textsLargeFontLine1Text.LayoutText( Rect(), 
+                 AknLayoutScalable_Apps::dialer2_ne_pane_t1( 
+                                                         variety, 0, 0 ) );  
+            //Line 2     
+            textsLargeFontLine2Text.LayoutText( Rect(), 
+                 AknLayoutScalable_Apps::dialer2_ne_pane_t1( 
+                                                         variety, 
+                                                         0, 
+                                                         1 ) );
+            //Last row
+            textsLargeFontLine3Text.LayoutText( Rect(), 
+                AknLayoutScalable_Apps::dialer2_ne_pane_t1( variety,
+                                                            0, 
+                                                            limits.LastRow() ) );
+
+            //Need to add one row because zero is the first line                
+            aFormat.iNumLines =  limits.LastRow()+1;
+                            	
+        	//take font from line 1    
+            aFormat.iFont = textsLargeFontLine1Text.Font();
+            layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( aFormat.iFont);
+            aFormat.iBottomBaselineOffset = 
+                                         layoutFont->BaselineToTextPaneBottom();
+            //outer rect from last line
+            aFormat.iOuterRect = textsLargeFontLine3Text.TextRect();
+            // have to add extra gap
+            aFormat.iOuterRect.iTl.iY -= aFormat.iBottomBaselineOffset; 
+         
+            //calculate baselineSeparation from the difference of the second 
+            //line and the first line bottom right Y coordinates            
+            TInt baselineSeparation = textsLargeFontLine2Text.TextRect().iBr.iY 
+                - textsLargeFontLine1Text.TextRect().iBr.iY;
+            
+            aFormat.iOuterRect.iTl.iY -= ( (aFormat.iNumLines - 1) 
+                                            * baselineSeparation );
+            aFormat.iBaselineSeparation = baselineSeparation;  									
+			}
+			break;
+		case KDialerNELayoutSmallFont:
+			{
+			TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 3 : 1;
+			
+            TAknLayoutScalableParameterLimits limits = 
+                AknLayoutScalable_Apps::dialer2_ne_pane_t1_ParamLimits( 
+                                                                variety );                   
+            //Line 1
+            textsSmallFontLine1Text.LayoutText( Rect(), 
+                 AknLayoutScalable_Apps::dialer2_ne_pane_t1( variety,0,0 ) );  
+            //Line 2     
+            textsSmallFontLine2Text.LayoutText( Rect(), 
+                 AknLayoutScalable_Apps::dialer2_ne_pane_t1( variety,0,1 ) );
+            //Last row
+            textsSmallFontLine3Text.LayoutText( Rect(), 
+                 AknLayoutScalable_Apps::dialer2_ne_pane_t1( 
+                                                         variety,
+                                                         0, 
+                                                         limits.LastRow() ) ); 
+            
+            //Need to add one row because zero is the first line
+            aFormat.iNumLines =  limits.LastRow()+1;
+                                                                   
+        	 //take font from line 1     
+            aFormat.iFont = textsSmallFontLine1Text.Font();
+            layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( 
+                                                           aFormat.iFont);
+            aFormat.iBottomBaselineOffset = 
+                                        layoutFont->BaselineToTextPaneBottom();
+            //outer rect from line 3
+            aFormat.iOuterRect = textsSmallFontLine3Text.TextRect();
+            // have to add extra gap
+            aFormat.iOuterRect.iTl.iY -= aFormat.iBottomBaselineOffset; 
+            
+            //calculate baselineSeparation from the difference of the second 
+            //line and the first line bottom right Y coordinates
+            TInt baselineSeparation = textsSmallFontLine2Text.TextRect().iBr.iY 
+                - textsSmallFontLine1Text.TextRect().iBr.iY;
+            
+            aFormat.iOuterRect.iTl.iY -= ( (aFormat.iNumLines - 1) 
+                                            * baselineSeparation );
+            aFormat.iBaselineSeparation = baselineSeparation; 					
+			} 
+			break;
+	 	default:
+	 		break;
+		} 				
+	}
+
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::HandleResourceChange  
+// ---------------------------------------------------------------------------
+//
+void CDialerNumberEntry::HandleResourceChange( TInt aType )
+    {
+    CCoeControl::HandleResourceChange( aType );
+    
+    if ( aType == KAknsMessageSkinChange )
+        {
+        CheckLabelSkinningColor(); 
+        }
+    }
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::HandleEditorFormatting  
+// ---------------------------------------------------------------------------
+//
+void CDialerNumberEntry::HandleEditorFormatting()
+    {
+    TInt format( KDialerNELayoutLargeFont );
+  
+    if ( !iEditor->WouldTextFitInFormat( KDialerNELayoutLargeFont )  )
+        {
+        format = KDialerNELayoutSmallFont;
+        }
+   
+    if ( iEditor->CurrentFormatIndex() != format )
+        {
+        iEditor->DrawDeferred();
+        iEditor->SetFormat( format );              
+        iFrameContext->SetRect( Rect() );                
+        }
+    
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::StartVirtualKeyBoard 
+// ---------------------------------------------------------------------------
+//
+void CDialerNumberEntry::StartVirtualKeyBoard( )
+    {
+    // To change focus to VKB, if not called VKB will not come visible
+    CEikonEnv::Static()->SyncNotifyFocusObserversOfChangeInFocus();
+    iEditor->OpenVKB();
+    }
+  
+// ---------------------------------------------------------------------------
+// CDialerNumberEntry::MopSupplyObject
+// ---------------------------------------------------------------------------
+//
+TTypeUid::Ptr CDialerNumberEntry::MopSupplyObject( TTypeUid aId )  
+    {
+    if ( aId.iUid == MAknsControlContext::ETypeId && iFrameContext )
+        {
+        return MAknsControlContext::SupplyMopObject( aId, iFrameContext );
+        }
+    else
+        {
+        return CCoeControl::MopSupplyObject( aId );
+        } 
+    }    
+    
+// -----------------------------------------------------------------------------
+// CDialerNumberEntry::RectFrameInnerOuterRects
+// -----------------------------------------------------------------------------
+//
+void CDialerNumberEntry::RectFrameInnerOuterRects( const TRect& aFrameRect,
+                                              TRect& aOuterRect,
+                                              TRect& aInnerRect )
+    {
+    if ( Layout_Meta_Data::IsMirrored() )
+        {
+        TAknLayoutRect frameTopRight;        
+        frameTopRight.LayoutRect( 
+         aFrameRect, 
+         AknLayoutScalable_Apps::bg_popup_call2_rect_pane_g3().LayoutLine() );                
+                
+        TAknLayoutRect frameBottomLeft;        
+        frameBottomLeft.LayoutRect( 
+         aFrameRect, 
+         AknLayoutScalable_Apps::bg_popup_call2_rect_pane_g4().LayoutLine() );                        
+
+        aOuterRect = TRect( frameTopRight.Rect().iTl, 
+                            frameBottomLeft.Rect().iBr );
+                
+        aInnerRect = TRect( frameTopRight.Rect().iBr, 
+                            frameBottomLeft.Rect().iTl );    
+        }
+    else
+        {
+        TAknLayoutRect frameTopLeft;        
+        frameTopLeft.LayoutRect( 
+         aFrameRect, 
+         AknLayoutScalable_Apps::bg_popup_call2_rect_pane_g2().LayoutLine() );
+
+        TAknLayoutRect frameBottomRight;        
+        frameBottomRight.LayoutRect( 
+         aFrameRect, 
+         AknLayoutScalable_Apps::bg_popup_call2_rect_pane_g5().LayoutLine() );
+        
+        aOuterRect = TRect( frameTopLeft.Rect().iTl, 
+                            frameBottomRight.Rect().iBr );
+        aInnerRect = TRect( frameTopLeft.Rect().iBr, 
+                            frameBottomRight.Rect().iTl );    
+        }                    
+    }    
+    
+// -----------------------------------------------------------------------------
+// CDialerNumberEntry::InformNumberEntryState()
+// -----------------------------------------------------------------------------
+//
+void CDialerNumberEntry::InformNumberEntryState()
+    {
+    if ( !iNumberContents && iEditor->TextLength() )
+        {
+        // Hide prompt text
+        if ( iLabel->Text()->Length() )
+            {
+            iLabel->MakeVisible( EFalse );     
+            }         
+        iNumberContents = ETrue;
+        }
+    else if ( iNumberContents && !iEditor->TextLength() )
+        {  
+        // Show prompt text
+        if ( iLabel->Text()->Length() )
+            {
+            iLabel->MakeVisible( ETrue );     
+            } 
+        iNumberContents = EFalse;
+        } 
+
+    if( iObserver )
+        {
+        iObserver->NumberEntryStateChanged( iNumberContents );
+        }
+    
+    }
+    
+// -----------------------------------------------------------------------------
+// CDialerNumberEntry::CheckLabelSkinningColor()
+// -----------------------------------------------------------------------------
+//
+void CDialerNumberEntry::CheckLabelSkinningColor()
+    {
+    // Check skinning colour for the prompt text:
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    TRgb skinColor;
+    TInt error = 
+        AknsUtils::GetCachedColor( 
+            skin, 
+            skinColor, 
+            KAknsIIDQsnTextColors,
+            EAknsCIQsnTextColorsCG51 );
+            
+    if ( error == KErrNone )
+        {
+        // Ignore error
+        TRAP_IGNORE( iLabel->OverrideColorL( EColorLabelText, skinColor ) );
+        }   
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/src/cdialerstub.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,386 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 dialer stub.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cdialer.h"
+
+#include <aknenv.h>
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CDialer::NewL
+//
+// Symbian OS two phased constructor for telephony phone dialer mode
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDialer* CDialer::NewL( const CCoeControl& aContainer, 
+                                 const TRect& aRect )
+    {
+    CDialer* self = new( ELeave )CDialer ( );    
+    CleanupStack::PushL( self );
+    self->ConstructL( aContainer , aRect );
+    CleanupStack::Pop();    // self
+    return self;
+    }
+
+// Destructor
+EXPORT_C CDialer::~CDialer()
+    {
+    // Empty
+    }
+
+// ---------------------------------------------------------------------------
+// CDialer::ConstructL
+//
+// Symbian OS two phased constructor for phone dialer more.
+// ---------------------------------------------------------------------------
+//
+void CDialer::ConstructL( 
+    const CCoeControl& aContainer, 
+    const TRect& aRect )
+    {    
+    // set window
+    SetContainerWindowL( aContainer );
+    SetParent( const_cast<CCoeControl*>(&aContainer) );
+    iParentControl = &aContainer;
+    SetRect( aRect );
+    }
+
+// Constructor
+CDialer::CDialer( ) :
+    iEikEnv( *CEikonEnv::Static() )
+    {
+    // Empty    
+    }
+
+// -----------------------------------------------------------------------------
+// CDialer::NumberEntry
+//
+// Return pointer to MNumberEntry interface.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MNumberEntry* CDialer::NumberEntry()
+    {
+    return this;
+    }
+
+// -----------------------------------------------------------------------------
+// CDialer::SetNumberEntryObserver
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CDialer::SetNumberEntryObserver( MNumberEntryObserver& /*aObserver*/ ) 
+    {
+    // Empty
+    }
+
+
+// Methods from MNumberEntry
+
+// ---------------------------------------------------------------------------
+// CDialer::CreateNumberEntry
+//  
+// Creates number entry in phone dialer mode. In video DTMF mode
+// only sets CBA.
+// ---------------------------------------------------------------------------
+//
+void CDialer::CreateNumberEntry()
+    {
+    // Empty
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// CDialer::GetNumberEntry
+//  
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CDialer::GetNumberEntry( ) const
+    {
+    return NULL;
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::IsNumberEntryUsed
+//  
+// ---------------------------------------------------------------------------
+//
+TBool CDialer::IsNumberEntryUsed( ) const
+    {
+    return EFalse;
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::SetNumberEntryVisible
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialer::SetNumberEntryVisible( const TBool& /*aVisibility */)
+    {
+    // Empty
+    }
+
+    
+// ---------------------------------------------------------------------------
+// CDialer::SetTextToNumberEntry
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialer::SetTextToNumberEntry( const TDesC& /*aDesC */)
+    {
+    // Empty
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::GetTextFromNumberEntry
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialer::GetTextFromNumberEntry( TDes& aDesC )
+    {
+    aDesC = KNullDesC();
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::RemoveNumberEntry
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialer::RemoveNumberEntry( )
+    {
+    iIsUsed = EFalse;    
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::ChangeEditorMode
+//  
+// ---------------------------------------------------------------------------
+//
+TInt CDialer::ChangeEditorMode( TBool /*aDefaultMode */)
+    {
+    return KErrNotSupported;
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::OpenVKBL
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialer::OpenVkbL()
+    {
+    // Empty
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::GetEditorMode
+//  
+// ---------------------------------------------------------------------------
+//
+TInt CDialer::GetEditorMode() const
+    {
+    return KErrNotSupported;
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::ResetEditorToDefaultValues
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialer::ResetEditorToDefaultValues()
+    {
+    // Empty
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::SetNumberEntryPromptText
+//  
+// ---------------------------------------------------------------------------
+//    
+void CDialer::SetNumberEntryPromptText( const TDesC& /*aPromptText*/ ) 
+    {
+    // Empty
+    }    
+
+// ---------------------------------------------------------------------------
+// CDialer::EnableTactileFeedback
+//  
+// ---------------------------------------------------------------------------
+//    
+void CDialer::EnableTactileFeedback( const TBool /*aEnable*/ )
+    {
+    // Empty
+    }
+// Functions from CCoeControl
+
+// ---------------------------------------------------------------------------
+// CDialer::SizeChanged
+// 
+// Called by framework when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialer::SizeChanged()
+    {
+    // Empty
+    }
+
+// ---------------------------------------------------------------------------
+// CDialer::PositionChanged
+// ---------------------------------------------------------------------------
+//
+void CDialer::PositionChanged()
+    {
+    // Empty
+    }
+
+// ---------------------------------------------------------------------------
+// CDialer::CountComponentControls
+//
+// Returns contained controls in phone dialer mode or in video dtmf mode.
+// ---------------------------------------------------------------------------
+//
+TInt CDialer::CountComponentControls() const
+    {
+    return 0;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDialer::ComponentControl(TInt aIndex) const
+//
+// Returns contained control by given index.
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CDialer::ComponentControl( TInt /*aIndex*/ ) const
+    {
+    return NULL;
+    } 
+
+// ---------------------------------------------------------------------------
+// CDialer::Draw
+// ---------------------------------------------------------------------------
+//
+void CDialer::Draw( const TRect& /*aRect*/ ) const
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CDialer::FocusChanged
+// ---------------------------------------------------------------------------
+//
+void CDialer::FocusChanged(TDrawNow /*aDrawNow*/)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CDialer::PrepareForFocusGainL
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialer::PrepareForFocusGainL( )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CDialer::HandleResourceChange
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialer::HandleResourceChange( TInt aType )
+    {
+    CCoeControl::HandleResourceChange( aType );
+    }
+
+// -----------------------------------------------------------------------------
+// CDialer::HandlePointerEventL
+//
+// -----------------------------------------------------------------------------
+//
+void CDialer::HandlePointerEventL( const TPointerEvent& aPointerEvent )
+    {
+    // Calling base class implementation
+    CCoeControl::HandlePointerEventL(aPointerEvent);    
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::MakeVisible
+// ---------------------------------------------------------------------------
+//
+void CDialer::MakeVisible( TBool /*aVisible*/ )
+	{
+	}    
+
+// Private methods
+
+
+// -----------------------------------------------------------------------------
+// CDialer::LoadResourceL
+//
+// -----------------------------------------------------------------------------
+//
+void CDialer::LoadResourceL()
+    {
+    // Empty
+    }
+
+// -----------------------------------------------------------------------------
+// CDialer::UnLoadResources
+//
+// -----------------------------------------------------------------------------
+//    
+void CDialer::UnLoadResources()
+    {
+    // Empty
+    }
+    
+// ---------------------------------------------------------------------------
+// CDialer::ComponentControlForDialerMode
+// 
+// Returns contained control by given index in ohonedialer mode.
+//  
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CDialer::ComponentControlForDialerMode( const TInt /*aIndex*/ ) const
+    {
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CDialer::EdwinState
+// 
+// Returns edwin state of the editor.
+//  
+// ---------------------------------------------------------------------------
+//
+CAknEdwinState* CDialer::EdwinState()
+    {
+    return NULL;
+    } 
+
+// ---------------------------------------------------------------------------
+// CDialer::UpdateVkbEditorFlagsL
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialer::UpdateVkbEditorFlagsL()
+    {
+    // Empty
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/src/cdialervideocontainer.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,189 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Manager for video keypad 
+*
+*/
+
+
+// INCLUDE FILES
+#include <eikenv.h>
+#include <eikapp.h>
+#include <gulicon.h>
+#include <w32std.h>
+#include <eikimage.h> // CEikImage
+#include <barsread.h> // TResourceReader
+#include <aknappui.h>
+#include <AknUtils.h>
+#include <AknsDrawUtils.h>
+#include <AknLayoutFont.h>
+#include <AknLayout2Def.h>
+#include <layoutmetadata.cdl.h>
+#include <AknLayout2ScalableDef.h>
+#include <aknlayoutscalable_apps.cdl.h>
+#include <AknsBasicBackgroundControlContext.h>
+#include <AknsFrameBackgroundControlContext.h>
+
+#include "cdialervideocontainer.h"
+#include "dialercommon.h"
+
+
+// CONSTS
+const TInt KNumberOfButtons = 0;    // Number of command buttons in container.
+const TInt KVideoControlCount = KNumberOfButtons + 1; //  = Video window
+
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CDialerVideoContainer::NewL
+// Symbian OS two phased constructor
+// 
+// ---------------------------------------------------------------------------
+//
+CDialerVideoContainer* CDialerVideoContainer::NewL( 
+    const CCoeControl& aContainer,
+    CCoeControl& aVideoWindow )
+    {
+    CDialerVideoContainer* self = 
+        new( ELeave )CDialerVideoContainer( aContainer, aVideoWindow );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();    // self
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerVideoContainer::ConstructL
+// Symbian OS two phased constructor
+// 
+// ---------------------------------------------------------------------------
+//
+void CDialerVideoContainer::ConstructL()
+    {    
+    BaseConstructL();
+
+    iVideoWindow.SetContainerWindowL( *this );
+    iVideoWindow.SetParent( this );
+    iVideoWindow.SetMopParent( this );
+
+    ActivateL();
+    }
+
+
+// Constructor
+CDialerVideoContainer::CDialerVideoContainer(
+    const CCoeControl& aContainer, 
+    CCoeControl& aVideoWindow )
+    : CDialerContainerBase ( const_cast<CCoeControl&>(aContainer) ), 
+      iVideoWindow ( aVideoWindow )
+	{
+	// Empty.
+	}
+
+// Destructor
+CDialerVideoContainer::~CDialerVideoContainer()
+    {
+    // Empty.
+    }
+
+    
+// Methods from base class
+
+//
+// Methods from CDialerContainerBase
+//
+
+// ---------------------------------------------------------------------------
+// CDialerVideoContainer::SetFocus
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialerVideoContainer::SetFocus( TBool aFocus, 
+                                      TDrawNow /*aDrawNow*/ )
+    {
+    iVideoWindow.SetFocus( aFocus );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDialerVideoContainer::SetVariety
+// Set variety according to status
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialerVideoContainer::SetVariety()
+    {
+    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        iVariety = EVideoVarietyLandscape;
+        }
+    else
+        {
+        iVariety = EVideoVarietyPortrait;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerVideoContainer::SetLayout
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialerVideoContainer::SetLayout()
+    {
+    iVideoWindow.SetRect( Rect() );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDialerKeyPadContainer::CountComponentControls
+//  
+// ---------------------------------------------------------------------------
+//
+TInt CDialerVideoContainer::CountComponentControls() const
+    {
+    return KVideoControlCount;
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerVideoContainer::ComponentControl
+//  
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CDialerVideoContainer::ComponentControl( TInt aIndex ) const
+    {
+    __ASSERT_DEBUG( aIndex < KVideoControlCount, 
+    User::Panic(_L("Dialer"), KErrArgument) );
+    return &iVideoWindow;
+    }
+
+// ---------------------------------------------------------------------------
+// CDialerVideoContainer::Draw
+//  
+// ---------------------------------------------------------------------------
+//
+void CDialerVideoContainer::Draw( const TRect& /*aRect */) const
+    {
+    CWindowGc& gc = SystemGc( );
+    gc.SetBrushColor( AKN_LAF_COLOR( 0 /** White - get from layout */ ));
+    TRect rect = Rect();
+    
+    // Draw the skin background of the parent 
+    AknsDrawUtils::DrawBackground( AknsUtils::SkinInstance(), 
+        AknsDrawUtils::ControlContextOfParent(this), this, gc, 
+        rect.iTl, rect, KAknsDrawParamDefault );
+
+    gc.SetBrushStyle( CGraphicsContext::ENullBrush );    
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/src/cvideodtmfdialer.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,290 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 CVideoDTMFDialer class.
+*
+*/
+
+
+// INCLUDE FILES
+
+#include <avkon.rsg>
+#include <apgcli.h>
+#include <apacmdln.h>
+#include <eikspane.h>
+#include <aknenv.h>                         // AKN_LAF_COLOR
+#include <AknUtils.h>
+#include <AknsUtils.h>
+#include <aknappui.h>
+#include <aknlayoutscalable_apps.cdl.h>
+#include <layoutmetadata.cdl.h>
+#include <data_caging_path_literals.hrh>    // for KDC_APP_RESOURCE_DIR
+#include <bautils.h>                        // for BaflUtils
+
+#include "cvideodtmfdialer.h"
+#include "dialercommon.h"
+#include <dialer.rsg>
+#include "dialer.hrh"
+#include "cdialerkeypadcontainer.h"
+#include "cdialervideocontainer.h"
+#include "dialertrace.h"
+
+
+_LIT( KDialerResourceFile, "dialer.rsc" );
+
+// Video and keypad areas
+const TInt KContainedControlsInVideoDTMFMode = 2; 
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CVideoDTMFDialer::NewL
+//
+// Symbian OS two phased constructor for video dtmf mode
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CVideoDTMFDialer* CVideoDTMFDialer::NewL( const CCoeControl& aContainer, 
+                                 CCoeControl& aVideoWindow, 
+                                 const TRect& aRect )
+    {
+    CVideoDTMFDialer* self = new( ELeave )CVideoDTMFDialer ( );    
+    CleanupStack::PushL( self );
+    self->ConstructL( aContainer , aVideoWindow, aRect );
+    CleanupStack::Pop();    // self
+    return self;
+    }
+
+// Destructor
+EXPORT_C CVideoDTMFDialer::~CVideoDTMFDialer()
+    {
+    DIALER_PRINT("CVideoDTMFDialer::~CVideoDTMFDialer<"); 
+    AknsUtils::DeregisterControlPosition( this );
+
+    delete iKeypadArea;
+    delete iVideoWindow;
+    
+    UnLoadResources();
+
+    DIALER_PRINT("CVideoDTMFDialer::~CVideoDTMFDialer>"); 
+    }
+    
+// ---------------------------------------------------------------------------
+// CVideoDTMFDialer::ConstructL
+//
+// Symbian OS two phased constructor for video telephony mode.
+//
+// ---------------------------------------------------------------------------
+//
+void CVideoDTMFDialer::ConstructL( 
+    const CCoeControl& aContainer, 
+    CCoeControl& aVideoWindow,
+    const TRect& aRect )
+    {    
+    DIALER_PRINT("CVideoDTMFDialer::ConstructL<");
+    LoadResourceL();    
+    // set window
+    SetContainerWindowL( aContainer );
+    SetParent( const_cast<CCoeControl*>(&aContainer) );
+    iParentControl = &aContainer;
+
+    iVideoWindow = CDialerVideoContainer::NewL( *this, aVideoWindow );
+    iKeypadArea = CDialerKeyPadContainer::NewL( *this, EModeVideoDTMF );
+    
+    SetRect( aRect );
+    DIALER_PRINT("CVideoDTMFDialer::ConstructL>");        
+    }
+
+// Constructor
+CVideoDTMFDialer::CVideoDTMFDialer( ) :
+    iEikEnv( *CEikonEnv::Static() )
+    {
+    // Empty    
+    }
+    
+// Functions from CCoeControl
+
+// ---------------------------------------------------------------------------
+// CVideoDTMFDialer::SizeChanged
+// 
+// Called by framework when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CVideoDTMFDialer::SizeChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    TRect parentRect(Rect());
+    
+    // Method is called before containers are created.
+    if ( !iKeypadArea )
+        {
+        return;
+        }
+
+    TVideoVariety variety( EVideoVarietyLandscape );
+    if (  !Layout_Meta_Data::IsLandscapeOrientation() )
+        {
+        variety = EVideoVarietyPortrait;
+        }
+
+    // Layout video window.
+    AknLayoutUtils::LayoutControl(
+        iVideoWindow, parentRect, 
+        AknLayoutScalable_Apps::video_down_pane_cp( variety ).LayoutLine() );
+
+    // layout keypad area.
+    AknLayoutUtils::LayoutControl(
+        iKeypadArea, parentRect, 
+        AknLayoutScalable_Apps::grid_video_dialer_keypad_pane( variety ).LayoutLine() );
+    }
+
+// ---------------------------------------------------------------------------
+// CVideoDTMFDialer::PositionChanged
+//
+// ---------------------------------------------------------------------------
+//
+void CVideoDTMFDialer::PositionChanged()
+    {
+    AknsUtils::RegisterControlPosition( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CVideoDTMFDialer::CountComponentControls
+//
+// Returns contained controls in phone dialer mode or in video dtmf mode.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CVideoDTMFDialer::CountComponentControls() const
+    {
+    TInt count( 0 );
+    count = KContainedControlsInVideoDTMFMode;
+    return count;
+    }
+
+// ---------------------------------------------------------------------------
+// CVideoDTMFDialer::ComponentControl
+//
+// Returns contained control by given index.
+//
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CVideoDTMFDialer::ComponentControl( TInt aIndex ) const
+    {
+    CCoeControl* currentControl( NULL );
+
+    currentControl = ComponentControlForVideoMode( aIndex);
+
+    return currentControl;
+    } 
+
+// ---------------------------------------------------------------------------
+// CVideoDTMFDialer::Draw
+//
+// ---------------------------------------------------------------------------
+//
+void CVideoDTMFDialer::Draw( const TRect& /*aRect*/ ) const
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CVideoDTMFDialer::HandleResourceChange
+//  
+// ---------------------------------------------------------------------------
+//
+void CVideoDTMFDialer::HandleResourceChange( TInt aType )
+    {
+    if ( aType == KEikDynamicLayoutVariantSwitch )
+        {
+        SizeChanged();
+        }
+    CCoeControl::HandleResourceChange( aType );
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoDTMFDialer::HandlePointerEventL
+//
+// -----------------------------------------------------------------------------
+//
+void CVideoDTMFDialer::HandlePointerEventL( const TPointerEvent& aPointerEvent )
+    {
+    // Calling base class implementation
+    CCoeControl::HandlePointerEventL(aPointerEvent);    
+    }
+
+// Private methods
+
+// -----------------------------------------------------------------------------
+// CVideoDTMFDialer::LoadResourceL
+//
+// -----------------------------------------------------------------------------
+//
+void CVideoDTMFDialer::LoadResourceL()
+    {
+    TFileName path( KDriveZ );
+    path.Append( KDC_RESOURCE_FILES_DIR );
+    path.Append( KDialerResourceFile );
+    
+    RFs &fsSession= iEikEnv.FsSession();
+    BaflUtils::NearestLanguageFile( fsSession, path ); 
+    iResourceOffset = iEikEnv.AddResourceFileL( path );
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoDTMFDialer::UnLoadResources
+//
+// -----------------------------------------------------------------------------
+//    
+void CVideoDTMFDialer::UnLoadResources()
+    {
+    if ( iResourceOffset > 0 )
+        {
+        iEikEnv.DeleteResourceFile( iResourceOffset );
+        iResourceOffset = 0;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVideoDTMFDialer::ComponentControlForVideoMode
+// 
+// Returns contained control by given index in video DTMF mode.
+//  
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CVideoDTMFDialer::ComponentControlForVideoMode( const TInt aIndex ) const
+    {
+    CCoeControl* currentControl(NULL);
+    
+    switch ( aIndex )
+        {
+        case 0:
+            {
+            currentControl = iKeypadArea;
+            break;
+            }
+        case 1:
+            {
+            currentControl = iVideoWindow;
+            break;
+            }
+        default:
+            {
+            __ASSERT_DEBUG( EFalse, 
+            _L("CVideoDTMFDialer::ComponentControl no such component defined"));
+            }
+        }
+
+    return currentControl;
+    } 
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/src/cvideodtmfdialerstub.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  Implementation of CVideoDTMFDialer class, stub.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cvideodtmfdialer.h"
+
+#include <aknenv.h>
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CVideoDTMFDialer::NewL
+//
+// Symbian OS two phased constructor for video dtmf mode
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CVideoDTMFDialer* CVideoDTMFDialer::NewL( const CCoeControl& aContainer, 
+                                 CCoeControl& aVideoWindow, 
+                                 const TRect& aRect )
+    {
+    CVideoDTMFDialer* self = new( ELeave )CVideoDTMFDialer ( );    
+    CleanupStack::PushL( self );
+    self->ConstructL( aContainer , aVideoWindow, aRect );
+    CleanupStack::Pop();    // self
+    return self;
+    }
+
+// Destructor
+EXPORT_C CVideoDTMFDialer::~CVideoDTMFDialer()
+    {
+    // Empty
+    }
+    
+// ---------------------------------------------------------------------------
+// CVideoDTMFDialer::ConstructL
+//
+// Symbian OS two phased constructor for video telephony mode.
+// ---------------------------------------------------------------------------
+//
+void CVideoDTMFDialer::ConstructL( 
+    const CCoeControl& aContainer, 
+    CCoeControl& /*aVideoWindow*/,
+    const TRect& aRect )
+    {
+    // set window
+    SetContainerWindowL( aContainer );
+    SetParent( const_cast<CCoeControl*>(&aContainer) );
+    iParentControl = &aContainer;
+    SetRect( aRect );
+    }
+
+// Constructor
+CVideoDTMFDialer::CVideoDTMFDialer( ) :
+    iEikEnv( *CEikonEnv::Static() )
+    {
+    // Empty    
+    }
+    
+
+// Functions from CCoeControl
+
+// ---------------------------------------------------------------------------
+// CVideoDTMFDialer::SizeChanged
+// 
+// Called by framework when the view size is changed
+//  
+// ---------------------------------------------------------------------------
+//
+void CVideoDTMFDialer::SizeChanged()
+    {
+    // Empty
+    }
+
+// ---------------------------------------------------------------------------
+// CVideoDTMFDialer::PositionChanged
+// ---------------------------------------------------------------------------
+//
+void CVideoDTMFDialer::PositionChanged()
+    {
+    // Empty
+    }
+
+// ---------------------------------------------------------------------------
+// CVideoDTMFDialer::CountComponentControls
+//
+// Returns contained controls in phone dialer mode or in video dtmf mode.
+// ---------------------------------------------------------------------------
+//
+TInt CVideoDTMFDialer::CountComponentControls() const
+    {
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CVideoDTMFDialer::ComponentControl(TInt aIndex) const
+//
+// Returns contained control by given index.
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CVideoDTMFDialer::ComponentControl( TInt /*aIndex*/ ) const
+    {
+    return NULL;
+    } 
+
+// ---------------------------------------------------------------------------
+// CVideoDTMFDialer::Draw
+// ---------------------------------------------------------------------------
+//
+void CVideoDTMFDialer::Draw( const TRect& /*aRect*/ ) const
+    {
+    // Empty
+    }
+
+// ---------------------------------------------------------------------------
+// CVideoDTMFDialer::HandleResourceChange
+//  
+// ---------------------------------------------------------------------------
+//
+void CVideoDTMFDialer::HandleResourceChange( TInt /*aType*/ )
+    {
+    // Empty
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoDTMFDialer::HandlePointerEventL
+//
+// -----------------------------------------------------------------------------
+//
+void CVideoDTMFDialer::HandlePointerEventL( const TPointerEvent& /*aPointerEvent*/ )
+    {
+    // Empty  
+    }
+
+// Private methods
+
+// -----------------------------------------------------------------------------
+// CVideoDTMFDialer::LoadResourceL
+//
+// -----------------------------------------------------------------------------
+//
+void CVideoDTMFDialer::LoadResourceL()
+    {
+    // Empty
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoDTMFDialer::UnLoadResources
+//
+// -----------------------------------------------------------------------------
+//    
+void CVideoDTMFDialer::UnLoadResources()
+    {
+    // Empty
+    }
+
+
+// ---------------------------------------------------------------------------
+// CVideoDTMFDialer::ComponentControlForVideoMode
+// 
+// Returns contained control by given index in video DTMF mode.
+//  
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CVideoDTMFDialer::ComponentControlForVideoMode( const TInt /*aIndex*/ ) const
+    {
+    return NULL;
+    } 
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/Bwins/T_VideoDtmfDialeru.def	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/EABI/T_VideoDtmfDialeru.def	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,5 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+	_ZTI25CT_VideoDtmfDialerAppView @ 2 NONAME ; #<TI>#
+	_ZTV25CT_VideoDtmfDialerAppView @ 3 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/conf/ui_T_VideoDtmfDialer.cfg	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,40 @@
+[Test]
+title VideoDtmfDialer Test 1 - create VideoDtmfDialer, destroy all
+bringtoforeground
+create T_VideoDtmfDialer foobar
+foobar CreateView
+foobar CreateVideoDtmfDialer
+pause 5000
+foobar DeleteVideoDtmfDialer
+foobar DeleteView
+delete foobar
+sendtobackground
+[Endtest]
+
+[Test]
+title VideoDtmfDialer Test 2 - create and show VideoDtmfDialer, destroy all
+bringtoforeground
+create T_VideoDtmfDialer foobar
+foobar CreateView
+foobar CreateVideoDtmfDialer
+foobar ShowVideoDtmfDialer
+pause 5000
+foobar DeleteVideoDtmfDialer
+foobar DeleteView
+delete foobar
+sendtobackground
+[Endtest]
+
+[Test]
+title VideoDtmfDialer Test 3 - create and show Dialer, destroy all
+bringtoforeground
+create T_VideoDtmfDialer foobar
+foobar CreateView
+foobar CreateDialer
+foobar ShowDialer
+pause 5000
+foobar DeleteDialer
+foobar DeleteView
+delete foobar
+sendtobackground
+[Endtest]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/group/T_VideoDtmfDialer.mmp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  MMP file for T_VideoDtmfDialer dll.
+*
+*/
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+TARGET          T_VideoDtmfDialer.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY		ALL -TCB
+
+DEFFILE         T_VideoDtmfDialer.def
+
+SOURCEPATH      ../src
+SOURCE          T_VideoDtmfDialer.cpp
+SOURCE          T_VideoDtmfDialerBlocks.cpp
+SOURCE          T_VideoDtmfDialerAppView.cpp
+
+SOURCEPATH        ../group
+
+USERINCLUDE     ../inc 
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../../../../inc    // Telephony internal headers
+
+LIBRARY         euser.lib
+LIBRARY         cone.lib 
+LIBRARY         ws32.lib 
+LIBRARY         avkon.lib 
+LIBRARY         eikcoctl.lib 
+LIBRARY         eikctl.lib 
+LIBRARY         bafl.lib 
+LIBRARY         apgrfx.lib 
+LIBRARY         aknskins.lib 
+LIBRARY         aknskinsrv.lib 
+LIBRARY         aknswallpaperutils.lib 
+LIBRARY         eikcore.lib
+LIBRARY         featmgr.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+
+// Test target 
+LIBRARY         dialer.lib
+
+LANG            SC
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/group/T_VideoDtmfDialer.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,37 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing T_VideoDtmfDialer.
+;
+; T_VideoDtmfDialer.pkg
+
+; Languages
+&EN
+
+; Header
+#{"T_VideoDtmfDialer"},(0x101FB3E3),1,0,0
+
+;Localised Vendor name
+%{"Vendor Test EN"}
+
+;Unique Vendor name
+:"Vendor"
+
+;Key and certificate
+*"rd-key.pem","rd.cer"
+
+; Target
+
+"\epoc32\release\armv5\urel\T_VideoDtmfDialer.dll"-"C:\sys\bin\T_VideoDtmfDialer.dll"
+"..\init\T_VideoDtmfDialer.ini"-"C:\TestFramework\T_VideoDtmfDialer.ini"
+"..\conf\ui_T_VideoDtmfDialer.cfg"-"C:\TestFramework\ui_T_VideoDtmfDialer.cfg"
Binary file phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/group/T_VideoDtmfDialer.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build video dtmf dialer.
+*
+*/
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_TESTEXPORTS
+
+PRJ_EXPORTS
+../init/T_VideoDtmfDialer.ini /epoc32/winscw/c/TestFramework/T_VideoDtmfDialer.ini
+../init/T_VideoDtmfDialer.ini /epoc32/data/z/system/data/T_VideoDtmfDialer.ini
+
+../conf/ui_T_VideoDtmfDialer.cfg /epoc32/winscw/c/TestFramework/ui_T_VideoDtmfDialer.cfg
+../conf/ui_T_VideoDtmfDialer.cfg /epoc32/data/z/system/data/ui_T_VideoDtmfDialer.cfg
+
+PRJ_TESTMMPFILES
+T_VideoDtmfDialer.mmp
+
+PRJ_MMPFILES
+
+
+//  End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/inc/T_VideoDtmfDialer.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,162 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Module/API tester for CVideoDtmfDialer domain API 
+*
+*/
+
+
+
+#ifndef T_VIDEODTMFDIALER_H
+#define T_VIDEODTMFDIALER_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <aknapp.h>
+
+// MACROS
+_LIT( KT_VideoDtmfDialerLogPath, "\\logs\\testframework\\T_VideoDtmfDialer\\" ); 
+_LIT( KT_VideoDtmfDialerLogFile, "T_VideoDtmfDialer.txt" ); 
+_LIT( KT_VideoDtmfDialerLogFileWithTitle, "T_VideoDtmfDialer_[%S].txt" );
+
+// FORWARD DECLARATIONS
+class CDialer;
+class CT_VideoDtmfDialer;
+class CCoeControl;
+class CEikLabel; 
+class CVideoDTMFDialer; 
+class MNumberEntry;
+
+// CLASS DECLARATION
+
+/**
+*  CT_VideoDtmfDialer test class for STIF Test Framework TestScripter.
+*/
+NONSHARABLE_CLASS(CT_VideoDtmfDialer) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CT_VideoDtmfDialer* NewL(CTestModuleIf& aTestModuleIf);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CT_VideoDtmfDialer();
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL(CStifItemParser& aItem);
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CT_VideoDtmfDialer( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+    private: // Ui helper methods
+    
+        /** 
+        * Helper functions for UI handling are listed below
+        */ 
+        /**
+        * Set toolbar visibility
+        */        
+        void MakeToolbarVisible(TBool aVisible);
+
+        /**
+        * Set status panel visibility
+        */        
+        void MakeStatusPaneVisible(TBool aVisible);
+
+    private: // Test methods are listed below
+    
+        /**
+        * Create view 
+        */
+        virtual TInt CreateViewL(CStifItemParser& aItem);
+
+        /**
+        * Delete view 
+        */
+        virtual TInt DeleteViewL(CStifItemParser& aItem);
+
+        /**
+        * Create CDialer
+        */
+        virtual TInt CreateDialerL(CStifItemParser& aItem);
+
+        /**
+        * Show CDialer
+        */
+        virtual TInt ShowDialerL(CStifItemParser& aItem);
+
+        /**
+        * Delete CDialer
+        */
+        virtual TInt DeleteDialerL(CStifItemParser& aItem);
+
+        /**
+        * Create CVideoDtmfDialer
+        */
+        virtual TInt CreateVideoDtmfDialerL(CStifItemParser& aItem);
+
+        /**
+        * Show CVideoDtmfDialer
+        */
+        virtual TInt ShowVideoDtmfDialerL(CStifItemParser& aItem);
+
+        /**
+        * Delete CVideoDtmfDialer
+        */
+        virtual TInt DeleteVideoDtmfDialerL(CStifItemParser& aItem);
+
+    private: // Data        
+        
+        // Pointer to video dtmf dialer
+		CVideoDTMFDialer* iVideoDtmfDialer; 
+		// Pointer to video dtmf dialer control 
+    	CCoeControl* iVideoDtmfDialerControl;
+    	// Pointer to video control label
+		CEikLabel* iVideoControl;
+    	// Pointer to dialer
+	    CDialer* iDialer;
+    	// Interface to Dialer's number entry functionality   
+	    MNumberEntry* iNumberEntry;    	
+    };
+
+#endif      // T_VIDEODTMFDIALER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/inc/T_VideoDtmfDialer.pan	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Inline implementation of video dtmf dialer. 
+*
+*/
+
+#ifndef T_VIDEODTMFDIALER_PAN
+#define T_VIDEODTMFDIALER_PAN
+
+/** T_VideoDtmfDialer application panic codes */
+enum TT_VideoDtmfDialerPanics 
+    {
+    ET_VideoDtmfDialerBasicUi = 1
+    // add further panics here
+    };
+
+inline void Panic(TT_VideoDtmfDialerPanics aReason)
+    {
+	  _LIT(applicationName,"T_VideoDtmfDialer");
+    User::Panic(applicationName, aReason);
+    }
+
+#endif // T_VIDEODTMFDIALER_PAN
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/inc/T_VideoDtmfDialerAppView.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Definition of CT_VideoDtmfDialerAppView class. 
+*
+*/
+
+#ifndef T_VIDEODTMFDIALER_APPVIEW_H
+#define T_VIDEODTMFDIALER_APPVIEW_H
+
+
+#include <coecntrl.h>
+#include <coeview.h>
+
+class MNumberEntry;
+
+class CT_VideoDtmfDialerAppView : public CCoeControl, public MCoeView
+    {
+public:
+
+    static CT_VideoDtmfDialerAppView* NewL(const TRect& aRect);
+
+    static CT_VideoDtmfDialerAppView* NewLC(const TRect& aRect );
+
+     ~CT_VideoDtmfDialerAppView();
+
+    void SetControl( CCoeControl* aControl, TBool aDrawNow = EFalse );
+    CCoeControl* Control() const;
+    void SetNumberEntry( MNumberEntry* aNumberEntry );
+    
+public:  // from CCoeControl
+    void Draw(const TRect& aRect) const;
+
+    void SizeChanged();
+
+    TInt CountComponentControls() const;
+
+    CCoeControl* ComponentControl( TInt aIndex ) const;
+    
+    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+
+	TVwsViewId ViewId() const;
+
+	void ViewActivatedL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage);
+
+	void ViewDeactivated();
+
+    void ActivateL();
+
+
+private:
+
+    void ConstructL(const TRect& aRect);
+
+    CT_VideoDtmfDialerAppView();
+
+public:
+    void UpdateControlRect();
+    
+private:
+    
+    CCoeControl* iControl;
+    CCoeControl* iPrevControl;
+    
+    // Not own. Forwards key events for number entry control.
+    MNumberEntry* iNumberEntry;
+    };
+
+
+#endif // T_VIDEODTMFDIALER_APPVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/init/T_VideoDtmfDialer.ini	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,197 @@
+#
+# This is STIF initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module.
+# 	- Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation
+#		DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02
+#
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+DisableMeasurement= stifmeasurementdisablenone	# Possible values are:
+						# 'stifmeasurementdisablenone', 'stifmeasurementdisableall'
+					  	# 'stifmeasurementplugin01', 'stifmeasurementplugin02',
+					  	# 'stifmeasurementplugin03', 'stifmeasurementplugin04',
+					  	# 'stifmeasurementplugin05' or 'stifbappeaprofiler'
+
+Timeout= 0                              # Default timeout value for each test case. In milliseconds
+UITestingSupport= YES
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= testscripter
+TestCaseFile= c:\testframework\ui_T_VideoDtmfDialer.cfg
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIF logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+#	- Will write log file in unicode format.
+#		+ YES, Log file will be written in unicode format
+#		+ NO, Log will be written as normal, not unicode, file.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#'
+#NOTE: TestEngine and TestServer logging settings cannot change here
+
+#CreateLogDirectories= YES    # Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML         # Possible values: TXT or HTML
+#EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML         # Possible values: TXT or HTML
+#HardwareOutput= FILE         # Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE  # Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES       # Possible values: YES or NO
+#WithTimeStamp= YES           # Possible values: YES or NO
+#WithLineBreak= YES           # Possible values: YES or NO
+#WithEventRanking= YES        # Possible values: YES or NO
+
+#FileUnicode= YES             # Possible values: YES or NO
+#AddTestCaseTitle= YES        # Possible values: YES or NO
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/src/T_VideoDtmfDialer.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,127 @@
+/*
+* 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 CT_VideoDtmfDialer class. API testing.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include "T_VideoDtmfDialer.h"
+#include <SettingServerClient.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialer::CT_VideoDtmfDialer
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CT_VideoDtmfDialer::CT_VideoDtmfDialer( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CT_VideoDtmfDialer::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    TInt ret = settingServer.Connect();
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings(loggerSettings);
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        } 
+    // Close Setting server session
+    settingServer.Close();
+
+    TFileName logFileName;
+    
+    if(loggerSettings.iAddTestCaseTitle)
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL(title);
+        logFileName.Format(KT_VideoDtmfDialerLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KT_VideoDtmfDialerLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KT_VideoDtmfDialerLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialer::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CT_VideoDtmfDialer* CT_VideoDtmfDialer::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CT_VideoDtmfDialer* self = new (ELeave) CT_VideoDtmfDialer( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+// Destructor
+CT_VideoDtmfDialer::~CT_VideoDtmfDialer()
+    { 
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+    return ( CScriptBase* ) CT_VideoDtmfDialer::NewL( aTestModuleIf );
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/src/T_VideoDtmfDialerAppView.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,257 @@
+/*
+* 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 CT_VideoDtmfDialerAppView class.
+*
+*/
+
+#include <coemain.h>
+#include <aknutils.h> 
+#include <AknLayout.cdl.h>
+#include <LayoutMetaData.cdl.h>
+#include <AknLayoutScalable_Apps.cdl.h>
+#include <AknLayoutScalable_Avkon.cdl.h>
+#include <eikenv.h>
+#include <eikapp.h> 
+#include <eikappui.h>
+#include <AknAppUi.h>
+#include <eikspane.h>
+
+#include <mnumberentry.h>
+#include <cdialer.h>
+#include <cvideodtmfdialer.h>
+
+#include "T_VideoDtmfDialerAppView.h"
+
+const TUid KUidViewId = { 0x10282DDD };
+
+// Standard construction sequence
+CT_VideoDtmfDialerAppView* CT_VideoDtmfDialerAppView::NewL(const TRect& aRect)
+    {
+    CT_VideoDtmfDialerAppView* self = CT_VideoDtmfDialerAppView::NewLC(aRect);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CT_VideoDtmfDialerAppView* CT_VideoDtmfDialerAppView::NewLC(const TRect& aRect)
+    {
+    CT_VideoDtmfDialerAppView* self = new (ELeave) CT_VideoDtmfDialerAppView();
+    CleanupStack::PushL(self);
+    self->ConstructL(aRect);
+    return self;
+    }
+
+CT_VideoDtmfDialerAppView::CT_VideoDtmfDialerAppView() 
+    {
+    }
+
+CT_VideoDtmfDialerAppView::~CT_VideoDtmfDialerAppView()
+    {
+	// no implementation required
+    }
+
+void CT_VideoDtmfDialerAppView::ConstructL(const TRect& aRect)
+    {
+    // Create a window for this application view
+    CreateWindowL();
+
+    // Set the windows size
+    SetRect(aRect);
+
+    // Activate the window, which makes it ready to be drawn
+    ActivateL();
+    }
+
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialerAppView::ViewId
+// -----------------------------------------------------------------------------
+//
+TVwsViewId CT_VideoDtmfDialerAppView::ViewId() const
+    {
+    TVwsViewId id( 
+        CEikonEnv::Static()->EikAppUi()->Application()->AppDllUid(), 
+        KUidViewId );
+    return id;
+    }
+
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialerAppView::ViewActivatedL
+// -----------------------------------------------------------------------------
+//
+void CT_VideoDtmfDialerAppView::ViewActivatedL( 
+    const TVwsViewId& /*aPrevViewId*/, 
+    TUid /*aCustomMessageId*/, 
+    const TDesC8& /*aCustomMessage*/ )
+    {
+    MakeVisible( ETrue );
+    SetFocus( IsFocused() );
+    DrawDeferred();
+    }
+
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialerAppView::ViewDeactivated
+// -----------------------------------------------------------------------------
+//
+void CT_VideoDtmfDialerAppView::ViewDeactivated()
+    {
+    DrawDeferred();
+    }
+
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialerAppView::CountComponentControls
+// -----------------------------------------------------------------------------
+//
+TInt CT_VideoDtmfDialerAppView::CountComponentControls() const
+    {
+    TInt count = 0;
+
+    if ( iControl )
+        {
+        count++;
+        }
+        
+    return count;
+    }
+
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialerAppView::ComponentControl
+// -----------------------------------------------------------------------------
+//
+CCoeControl* CT_VideoDtmfDialerAppView::ComponentControl( TInt /*aIndex*/ ) const
+    {
+    CCoeControl* control( NULL );
+
+    if ( iControl )
+        {
+        control = iControl;
+        }
+
+    return control;        
+    }
+
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialerAppView::OfferKeyEventL
+// -----------------------------------------------------------------------------
+//    
+TKeyResponse CT_VideoDtmfDialerAppView::OfferKeyEventL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode aType)
+    {
+    TKeyResponse response = EKeyWasNotConsumed;
+    if( iControl && iNumberEntry)
+        {
+        CCoeControl* numberEntryControl = iNumberEntry->GetNumberEntry();
+        if( numberEntryControl )
+            {
+            response = numberEntryControl->OfferKeyEventL( aKeyEvent, aType );    
+            }
+        }
+    return response;
+    }
+    
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialerAppView::SetControl
+// -----------------------------------------------------------------------------
+//    
+void CT_VideoDtmfDialerAppView::SetControl( CCoeControl* aControl, TBool aDrawNow )
+    {
+    if ( iControl )
+        {
+        iControl->SetFocus( EFalse );
+        iPrevControl = iControl;    
+        }
+    
+    iControl = aControl;
+    
+    if ( iControl )
+        {
+        UpdateControlRect();
+        
+        if ( iPrevControl )
+            {
+            iPrevControl->MakeVisible( EFalse );        
+            iPrevControl = NULL;
+            }
+        
+        iControl->MakeVisible( ETrue );
+        DrawNow();
+        iControl->SetFocus( IsFocused() );
+        }
+    
+    if ( aDrawNow )        
+        {
+        DrawNow();    
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialerAppView::Control
+// -----------------------------------------------------------------------------
+//    
+CCoeControl* CT_VideoDtmfDialerAppView::Control() const
+    {
+    return iControl;    
+    }    
+
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialerAppView::SetNumberEntry
+// -----------------------------------------------------------------------------
+//    
+void CT_VideoDtmfDialerAppView::SetNumberEntry( MNumberEntry* aNumberEntry )
+    {
+    iNumberEntry = aNumberEntry;
+    }
+
+void CT_VideoDtmfDialerAppView::SizeChanged()
+    {
+    UpdateControlRect();
+    }
+
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialerAppView::UpdateControlRect
+// -----------------------------------------------------------------------------
+//
+void CT_VideoDtmfDialerAppView::UpdateControlRect()
+    {    
+    if ( iControl )
+        {
+        iControl->SetRect( Rect() );
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialerAppView::ActivateL
+// -----------------------------------------------------------------------------
+//
+void CT_VideoDtmfDialerAppView::ActivateL()
+    {
+    CCoeControl::ActivateL();
+    }
+    
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialerAppView::Draw
+// -----------------------------------------------------------------------------
+//    
+void CT_VideoDtmfDialerAppView::Draw(const TRect& aRect ) const
+    {
+    // Get the standard graphics context 
+    CWindowGc& gc = SystemGc();
+    gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
+    gc.SetBrushColor( KRgbGreen );
+    // Gets the control's extent
+    // Clears the screen
+    gc.Clear(aRect);
+    }
+
+// End of file 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/tsrc/public/basic/T_VideoDtmfDialer/src/T_VideoDtmfDialerBlocks.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,222 @@
+/*
+* 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 CT_VideoDtmfDialer class, API testing.
+*
+*/
+
+// INCLUDE FILES 
+#include <eiklabel.h> 
+#include <AknAppUi.h>
+#include <akntoolbar.h> 
+
+#include <e32svr.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+#include "T_VideoDtmfDialer.h"
+#include "T_VideoDtmfDialerAppView.h"
+
+#include <cdialer.h>
+#include <cvideodtmfdialer.h>
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialer::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CT_VideoDtmfDialer::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialer::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CT_VideoDtmfDialer::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        ENTRY( "CreateView", CT_VideoDtmfDialer::CreateViewL ),
+        ENTRY( "DeleteView", CT_VideoDtmfDialer::DeleteViewL ),
+        ENTRY( "CreateDialer", CT_VideoDtmfDialer::CreateDialerL),
+        ENTRY( "DeleteDialer", CT_VideoDtmfDialer::DeleteDialerL),
+        ENTRY( "ShowDialer", CT_VideoDtmfDialer::ShowDialerL),
+        ENTRY( "CreateVideoDtmfDialer", CT_VideoDtmfDialer::CreateVideoDtmfDialerL ),
+        ENTRY( "ShowVideoDtmfDialer", CT_VideoDtmfDialer::ShowVideoDtmfDialerL),
+        ENTRY( "DeleteVideoDtmfDialer", CT_VideoDtmfDialer::DeleteVideoDtmfDialerL ),
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+    }
+
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialer::CreateViewL()
+// -----------------------------------------------------------------------------
+//
+TInt CT_VideoDtmfDialer::CreateViewL(CStifItemParser& /*aItem*/)
+	{
+	CCoeControl* videoDtmfDialerControl = CT_VideoDtmfDialerAppView::NewL(
+		CEikonEnv::Static()->EikAppUi()->ClientRect() );	
+
+	CleanupStack::PushL( videoDtmfDialerControl ); 
+	CCoeEnv::Static()->AppUi()->AddToStackL( videoDtmfDialerControl );
+	CleanupStack::Pop( videoDtmfDialerControl ); 
+
+    // Ownership is transferred 
+    iVideoDtmfDialerControl = videoDtmfDialerControl; 
+    iVideoDtmfDialerControl->MakeVisible(ETrue);
+
+    return KErrNone;	
+	}
+
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialer::DeleteViewL()
+// -----------------------------------------------------------------------------
+//
+TInt CT_VideoDtmfDialer::DeleteViewL(CStifItemParser& /*aItem*/)
+	{
+	if( iVideoDtmfDialerControl )
+		{
+	    CCoeEnv::Static()->AppUi()->RemoveFromStack( iVideoDtmfDialerControl );
+	    delete iVideoDtmfDialerControl;
+	    iVideoDtmfDialerControl = NULL; 
+		}
+
+    return KErrNone;		
+	}
+
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialer::CreateDialerL()
+// -----------------------------------------------------------------------------
+//
+TInt CT_VideoDtmfDialer::CreateDialerL(CStifItemParser& /*aItem*/)
+    {
+    if( iVideoDtmfDialerControl )
+	    {
+	    iDialer = CDialer::NewL( 
+	    	*iVideoDtmfDialerControl, 
+	    	CEikonEnv::Static()->EikAppUi()->ClientRect() );
+	    iNumberEntry = iDialer->NumberEntry();
+
+	    return KErrNone;
+	    }
+	else
+		{
+		return KErrGeneral; 	
+		}	
+    }
+
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialer::ShowDialerL()
+// -----------------------------------------------------------------------------
+//
+TInt CT_VideoDtmfDialer::ShowDialerL(CStifItemParser& /*aItem*/)
+    {
+    if( iNumberEntry )
+        {
+        iNumberEntry->CreateNumberEntry();
+
+        static_cast<CT_VideoDtmfDialerAppView*>(iVideoDtmfDialerControl)->SetControl( iDialer );
+
+        return KErrNone;
+        }
+    else
+        {
+        return KErrGeneral; 
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialer::DeleteDialerL()
+// -----------------------------------------------------------------------------
+//
+TInt CT_VideoDtmfDialer::DeleteDialerL(CStifItemParser& /*aItem*/)
+    {
+    delete iDialer; 
+    iDialer = NULL;     
+
+    return KErrNone;
+    }
+    
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialer::CreateVideoDtmfDialerL()
+// -----------------------------------------------------------------------------
+//
+TInt CT_VideoDtmfDialer::CreateVideoDtmfDialerL(CStifItemParser& /*aItem*/)
+    {
+    if( iVideoDtmfDialerControl )
+    	{
+	    iVideoControl = new( ELeave ) CEikLabel;
+	    iVideoControl->SetBufferReserveLengthL( 10 );
+	    iVideoControl->SetTextL( _L("Video Here") ) ;
+	    iVideoControl->SetAlignment( EHCenterVCenter );
+
+	    iVideoDtmfDialer = CVideoDTMFDialer::NewL( 
+	    	*iVideoDtmfDialerControl, 
+           	*iVideoControl, 
+           	CEikonEnv::Static()->EikAppUi()->ClientRect() );
+           
+		return KErrNone;		                                           
+    	}
+    else
+    	{
+    	return KErrGeneral; 	
+    	}	    
+    }
+
+// -----------------------------------------------------------------------------
+// CT_VideoDtmfDialer::ShowVideoDtmfDialerL()
+// -----------------------------------------------------------------------------
+//
+TInt CT_VideoDtmfDialer::ShowVideoDtmfDialerL(CStifItemParser& /*aItem*/)
+    {
+    if( iVideoDtmfDialerControl )
+    	{
+    	static_cast<CT_VideoDtmfDialerAppView*>(iVideoDtmfDialerControl)->SetControl( 
+    	    iVideoDtmfDialer );
+           
+		return KErrNone;		                                           
+    	}
+    else
+    	{
+    	return KErrGeneral; 	
+    	}	    
+    }
+    
+// CT_VideoDtmfDialer::DeleteVideoDtmfDialerL()
+// -----------------------------------------------------------------------------
+//
+TInt CT_VideoDtmfDialer::DeleteVideoDtmfDialerL(CStifItemParser& /*aItem*/)
+    {
+	delete iVideoControl; 
+	iVideoControl = NULL; 
+    delete iVideoDtmfDialer;                   
+    iVideoDtmfDialer = NULL;
+    
+    return KErrNone;
+    }
+	
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/dialer/tsrc/public/basic/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,22 @@
+/*
+* 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 T_VideoDtmfDialer.
+*
+*/
+
+
+
+#include "../T_VideoDtmfDialer/group/bld.inf"
+
+//  End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* 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 "../dialer/group/bld.inf"
+#include "../BubbleManager/Group/bld.inf"
+#include "../ConnectUtil/group/bld.inf"
+#include "../Ussd/group/bld.inf"
+#include "../vmbx/group/bld.inf"
+#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/vmbx/aif/vmaif.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     RSS for creating the aif file for EditConf.
+*
+*/
+
+
+#include <aiftool.rh>
+
+RESOURCE AIF_DATA
+{
+    app_uid=0x100058F5;
+    caption_list=
+    {
+
+    };
+    num_icons=1;
+    embeddability=KAppNotEmbeddable;
+    newfile=KAppDoesNotSupportNewFile;
+}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* 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 file provides the information required for building the 
+*                whole of a vm.
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT 
+
+//  Help exports
+#include "../help/group/bld.inf"
+
+PRJ_EXPORTS
+
+// sis export
+vm_stub.SIS                         /epoc32/data/z/system/install/vm_stub.sis
+
+// iby export
+../rom/Vmbx.iby                     CORE_APP_LAYER_IBY_EXPORT_PATH(vmbx.iby)
+../rom/VmbxResources.iby            LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(vmbxresources.iby)
+
+// loc export    
+../loc/vm.loc                       APP_LAYER_LOC_EXPORT_PATH(vm.loc)
+
+PRJ_EXTENSIONS
+
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE vm_aif.mif
+  OPTION SOURCES -c8,8 qgn_menu_smsvo
+END
+
+PRJ_MMPFILES
+//gnumakefile icons_dc.mk
+//gnumakefile icons_aif_scalable_dc.mk
+
+vm.mmp
+#include "../gsvmbxplugin/group/bld.inf"
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/group/icons.mk	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,65 @@
+#
+# Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: Make file for vmbx icons.
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+TARGETDIR1=$(ZDIR)\system\apps\vm
+
+HEADERDIR=\epoc32\include
+ICONTARGETFILENAME=$(TARGETDIR1)\vm.mif
+
+HEADERFILENAME =$(HEADERDIR)\vm.mbg
+
+
+do_nothing :
+    @rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE :
+
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+	/c8,8 qgn_menu_smsvo_cxt.svg \
+	/c8,8 qgn_prop_nrtyp_sim_contact.svg \
+	/c8,8 qgn_prop_nrtyp_mobile.svg \
+	/c8,8 qgn_prop_nrtyp_video.svg \
+	/c8,8 qgn_prop_nrtyp_voip.svg \
+	/c8,8 qgn_prop_empty.svg
+	
+
+
+		
+		
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/group/icons_aif_bitmaps.mk	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,68 @@
+#
+# 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: Make file for vmbx icon bitmaps.
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\system\apps\vm
+ICONTARGETFILENAME=$(TARGETDIR)\vm_aif.mbm
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_smsvo_lst.bmp \
+		/c8,8 qgn_menu_smsvo_cxt.bmp
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/group/icons_aif_bitmaps_dc.mk	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,68 @@
+#
+# 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: Make file for vmbx.
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\vm_aif.mbm
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_smsvo_lst.bmp \
+		/c8,8 qgn_menu_smsvo_cxt.bmp
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/group/icons_aif_scalable.mk	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,67 @@
+#
+# 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: Make file for vmbx.
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\system\apps\vm
+ICONTARGETFILENAME=$(TARGETDIR)\vm_aif.mif
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_smsvo.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/group/icons_aif_scalable_dc.mk	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,67 @@
+#
+# 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: Make file for vmbx.
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\vm_aif.mif
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_smsvo.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/group/icons_dc.mk	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,65 @@
+#
+# Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: Make file for vmbx.
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+TARGETDIR1=$(ZDIR)\resource\apps
+
+HEADERDIR=\epoc32\include
+ICONTARGETFILENAME=$(TARGETDIR1)\vm.mif
+
+HEADERFILENAME =$(HEADERDIR)\vm.mbg
+
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE :
+
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+	/c8,8 qgn_menu_smsvo_cxt.svg \
+	/c8,8 qgn_prop_nrtyp_sim_contact.svg \
+	/c8,8 qgn_prop_nrtyp_mobile.svg \
+	/c8,8 qgn_prop_nrtyp_video.svg \
+	/c8,8 qgn_prop_nrtyp_voip.svg \
+	/c8,8 qgn_prop_empty.svg
+	
+
+
+		
+		
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
Binary file phoneuis/vmbx/group/vm.SIS has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/group/vm.mmp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,98 @@
+/*
+* 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 is a project specification file for the voice mailbox application.
+*
+*/
+
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+TARGET          vm.exe
+TARGETTYPE      exe
+UID             0x100039CE 0x100058F5
+
+EPOCSTACKSIZE   0x5000
+
+VENDORID        VID_DEFAULT
+//We use default capabilities (from defaultcaps.hrh)
+CAPABILITY      CAP_APPLICATION NetworkControl
+
+SOURCEPATH      ../src
+
+SOURCE          VmApp.cpp
+SOURCE          VmAppUi.cpp
+SOURCE          VmContainer.cpp
+SOURCE          VmDocument.cpp
+                
+SOURCE          VmQueryLauncher.cpp
+
+#ifdef __PROTOCOL_CDMA
+    SOURCE          VmDetailsDialog_platsec.cpp
+    SOURCE          VmDetDlgPropertyObserver.cpp
+#else
+    SOURCE          VmDetailsDlgDummy.cpp
+#endif
+
+START RESOURCE vm.rss
+TARGETPATH APP_RESOURCE_DIR
+HEADER
+LANGUAGE_IDS
+END //RESOURCE
+
+START RESOURCE vm_reg.rss
+DEPENDS vm.rsg
+// Do not change the UID below.
+TARGETPATH /private/10003a3f/apps
+END
+
+USERINCLUDE     ../inc
+SYSTEMINCLUDE 	../../../inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY         hlplch.lib
+LIBRARY         FeatMgr.lib
+
+LIBRARY         vmbx.lib
+LIBRARY         euser.lib
+LIBRARY         apparc.lib
+LIBRARY         cone.lib
+LIBRARY         eikcore.lib
+LIBRARY         bafl.lib
+LIBRARY         eikcoctl.lib
+LIBRARY         avkon.lib
+LIBRARY         ws32.lib
+LIBRARY         numbergrouping.lib
+LIBRARY         aknnotify.lib
+LIBRARY         apgrfx.lib
+
+LIBRARY         commonengine.lib
+LIBRARY         aknskins.lib
+LIBRARY         aknicon.lib
+LIBRARY         egul.lib
+LIBRARY         CdlEngine.lib
+LIBRARY         centralrepository.lib
+LIBRARY         CenRepNotifHandler.lib
+LIBRARY         ServiceHandler.lib              //Application InterWorking
+LIBRARY         aiwdialdata.lib
+LIBRARY         serviceprovidersettings.lib
+
+#ifdef __PROTOCOL_CDMA
+LIBRARY         eikctl.lib
+LIBRARY         aknlayout.lib
+#endif
+
+LIBRARY         flogger.lib
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/group/vm.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,35 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing vmbx.
+;
+; Languages
+&EN
+
+; Header
+#{"vm"},(0x100058F5),1,1,0,TYPE=PU
+
+;Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files
+"vm.exe"-"c:\sys\bin\vm.exe"
+"gsvmbxplugin.dll"-"c:\sys\bin\gsvmbxplugin.dll"
+"gsvmbxpluginrsc.rsc"-"c:\resource\apps\gsvmbxpluginrsc.rsc"
+"vm.rsc"-"c:\resource\apps\vm.rsc"
+"gsvmbxplugin.mif"-"c:\resource\apps\vm_aif.mif"
+"gsvmbxplugin.mif"-"c:\resource\apps\vm_aif.mbm"
+"vm_reg.rsc"-"c:\private\10003a3f\import\apps\vm_reg.rsc"
Binary file phoneuis/vmbx/group/vm_stub.SIS has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/group/vm_stub.pkg	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,36 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing vmbx stub.
+;
+; Languages
+&EN
+
+; Header
+#{"vm"},(0x100058F5),1,0,0,TYPE=SA
+
+;Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files
+""-"z:\sys\bin\vm.exe"
+""-"z:\sys\bin\vmbx.dll"
+""-"z:\sys\bin\gsvmbxplugin.dll"
+""-"z:\resource\gsvmbxpluginrsc.rsc"
+""-"z:\resource\vmbx.rsc"
+""-"z:\resource\apps\vm.rsc"
+""-"z:\resource\apps\gsvmbxplugin.mif"
+""-"z:\private\10003a3f\import\apps\vm_reg.rsc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/gsvmbxplugin/data/2000B4D6.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for gsvmbxplugin.
+*
+*/
+
+#include <registryinfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid     = 0x2000B4D6;
+    interfaces  =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid   = 0x10207236;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid  = 0x2000B4D7;
+                    version_no          = 1;
+                    display_name        = "Voice Mailbox Plugin";                    
+                    default_data        = "0x1020723D"; // Parent ID, Telephony
+                    opaque_data         = "30"; // Order number                    
+                    }
+                };
+            }
+        };
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/gsvmbxplugin/data/gsvmbxpluginrsc.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for gsvmbxplugin.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME        VMPL // 4 letter ID
+
+// INCLUDES
+#include    <gsvmbxplugin.loc> // localized strings
+
+#include    <data_caging_paths_strings.hrh>
+#include    <bldvariant.hrh>
+#include    <avkon.loc> // Avkon localized strings
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <EIKCORE.rsg>
+#include    <uikon.rh>
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS
+
+//----------------------------------------------------
+//
+//
+//    Needed or loading the resource fails!
+//
+//----------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_vmbx_plugin_caption
+//    Voice Mailbox Plugin caption.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_vmbx_plugin_caption
+    {    
+    buf = qtn_cp_folder_call_mail;
+    }
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/gsvmbxplugin/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,45 @@
+/*
+* 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:  Information required for building gsvmbxplugin.
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+// iby export
+../../rom/gsvmbxplugin.iby             CORE_APP_LAYER_IBY_EXPORT_PATH(gsvmbxplugin.iby)
+../../rom/gsvmbxpluginresources.iby    LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(gsvmbxpluginresources.iby)
+
+// loc export    
+../loc/gsvmbxplugin.loc                APP_LAYER_LOC_EXPORT_PATH(gsvmbxplugin.loc)
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gsvmbxplugin.mif
+  OPTION HEADERFILE gsvmbxplugin.mbg  
+  OPTION SOURCES -c8,8 qgn_prop_cp_tele_vmail
+END
+
+PRJ_MMPFILES
+//gnumakefile gsvmbxpluginicons.mk
+gsvmbxplugin.mmp
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/gsvmbxplugin/group/gsvmbxplugin.mmp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,79 @@
+/*
+* 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 specification file for gsvmbxplugin.
+*
+*/
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gsvmbxplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x2000B4D6
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          ../src
+SOURCE              gsvmbxplugin.cpp
+SOURCE              gsvmbxpluginimplementationtable.cpp
+
+USERINCLUDE         ../data
+USERINCLUDE         ../inc
+USERINCLUDE         ../../inc   // logger
+
+SYSTEMINCLUDE       .
+SYSTEMINCLUDE       /epoc32/include/ecom
+
+// Default system include paths for application layer modules.
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH          ../data
+
+// ECOM resource definition
+START RESOURCE      2000B4D6.rss
+TARGET              gsvmbxplugin.rsc
+TARGETPATH          ECOM_RESOURCE_DIR
+END // ECOM resource definition
+
+// Plugin resource definition
+START RESOURCE      gsvmbxpluginrsc.rss
+DEPENDS avkon.rsg
+DEPENDS eikcore.rsg
+TARGETPATH          RESOURCE_FILES_DIR
+HEADER
+LANGUAGE_IDS
+END // Plugin resource definition
+
+
+LIBRARY             aknskins.lib // AknsUtils.h
+LIBRARY             apgrfx.lib // RApaLsSession
+LIBRARY             apparc.lib
+LIBRARY             avkon.lib
+LIBRARY             bafl.lib
+LIBRARY             commonengine.lib // RConeResourceLoader
+LIBRARY             cone.lib
+LIBRARY             ecom.lib
+LIBRARY             efsrv.lib
+LIBRARY             eikcore.lib
+LIBRARY             euser.lib
+LIBRARY             GSEcomPlugin.lib
+LIBRARY             GSFramework.lib // Base classes
+LIBRARY             ws32.lib
+LIBRARY             flogger.lib
+
+SOURCEPATH          ../loc
+DOCUMENT            gsvmbxplugin.loc
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/gsvmbxplugin/group/gsvmbxpluginicons.mk	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,71 @@
+#
+# 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:  Icons for gsvmbxplugin
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+HEADERDIR=\epoc32\include
+ICONTARGETFILENAME=$(TARGETDIR)\gsvmbxplugin.mif
+HEADERFILENAME=$(HEADERDIR)\gsvmbxplugin.mbg
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2, \s60\bitmaps.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+		/c8,8 qgn_prop_cp_tele_vmail.svg
+
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/gsvmbxplugin/inc/gsvmbxplugin.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,180 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  gsvmbxplugin implementation.
+*
+*/
+
+#ifndef GSVMBXPLUGIN_H
+#define GSVMBXPLUGIN_H
+
+// User includes
+
+// System includes
+#include <gsplugininterface.h>
+#include <aknview.h>
+#include <ConeResLoader.h>
+#include <eikclb.h>
+#include <AknServerApp.h>
+
+// Classes referenced
+class CAknNavigationDecorator;
+class CAknViewAppUi;
+class CAknNullService;
+
+// Constants
+const TUid KGSVmbxPluginUID = { 0x2000B4D6 };
+const TUid KGsVmbxAppUid    = { 0x100058F5 };
+
+_LIT( KGSVmbxApp, "z:\\sys\\bin\\vm.exe" );
+_LIT( KVmbxPluginResourceFileName, "z:gsvmbxpluginrsc.rsc" );
+_LIT( KGSVmbxPluginIconDirAndName, "z:gsvmbxplugin.mif"); // Use KDC_BITMAP_DIR
+
+// CLASS DECLARATION
+
+//For embedding VMBX in CS
+class TAppInfo
+    {
+    public:
+        TAppInfo( TUid aUid, const TDesC& aFile )
+            : iUid( aUid ), iFile( aFile )
+            {}
+        TUid iUid;
+        TFileName iFile;
+    };
+
+
+/**
+* CGSVmbxPlugin.
+*
+* This class handles launching of the Voice Mailbox application from the 
+* General Settings. The plugin is a type of EGSItemTypeSettingDialog and 
+* therefore the GS FW will call HandleSelection() instead of DoActivate().
+* No CAknView functionality is supported even though the base class is 
+* CAknView derived via CGSPluginInterface.
+*
+*/
+class CGSVmbxPlugin : public CGSPluginInterface,
+                        public MAknServerAppExitObserver // Embedding
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        static CGSVmbxPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor.
+        */
+        ~CGSVmbxPlugin();
+
+    public: // From CAknView
+
+        /**
+        * See base class.
+        */
+        TUid Id() const;
+
+    public: // From CGSPluginInterface
+
+        /**
+        * See base class.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        TInt PluginProviderCategory() const;
+
+        /**
+        * See base class.
+        */
+        TGSListboxItemTypes ItemType();
+
+        /**
+        * See base class.
+        */
+        void GetValue( const TGSPluginValueKeys aKey,
+                       TDes& aValue );
+
+        /**
+        * See base class.
+        */
+        void HandleSelection( const TGSSelectionTypes aSelectionType );
+        
+        /**
+        * See base class.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+
+    protected: // New
+
+        /**
+        * C++ default constructor.
+        */
+        CGSVmbxPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+    protected: // From CAknView
+
+        /**
+        * This implementation is empty because this class, being just a dialog,
+        * does not implement the CAknView functionality.
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+
+        /**
+        * This implementation is empty because this class, being just a dialog,
+        * does not implement the CAknView functionality.
+        */
+        void DoDeactivate();
+
+    private: // New
+
+        /**
+        * Opens localized resource file.
+        */
+        void OpenLocalizedResourceFileL(
+            const TDesC& aResourceFileName,
+            RConeResourceLoader& aResourceLoader );
+        
+        /**
+        * Launches Voice Mailbox application.
+        */
+        void LaunchVoiceMailBoxAppL();
+        
+        /**
+        * Launches application as embedded.
+        */
+        void EmbedAppL( const TAppInfo& aApp );
+        
+    protected: // Data
+
+        // Resource loader.
+        RConeResourceLoader iResources;
+        
+        // AVKON NULL service. Own.
+        CAknNullService* iNullService;        
+    };
+
+#endif // GSVMBXPLUGIN_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/gsvmbxplugin/loc/gsvmbxplugin.loc	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for gsvmbxplugin.
+*
+*/
+
+//  LOCALISATION STRINGS
+
+//d:Voice Mailbox title for Control Panel
+//d:gsvmbxplugin
+//l:list_single_large_graphic_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_cp_folder_call_mail "Call mail"
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/gsvmbxplugin/src/gsvmbxplugin.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,342 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  gsvmbxplugin implementation.
+*
+*/
+
+
+// INCLUDE
+#include    "gsvmbxplugin.h"
+#include    "VMBLogger.h"
+#include    <gsparentplugin.h>
+#include    <gscommon.hrh>
+#include    <gsvmbxpluginrsc.rsg>
+#include    <gsvmbxplugin.mbg>
+#include    <gsprivatepluginproviderids.h>
+#include    <AknNullService.h>
+#include    <bautils.h>
+#include    <StringLoader.h>
+#include    <centralrepository.h>
+
+// Constants
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CGSVmbxPlugin::CGSVmbxPlugin()
+// Constructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSVmbxPlugin::CGSVmbxPlugin()
+    : iResources( *iCoeEnv ), iNullService(NULL)
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSVmbxPlugin::CGSVmbxPlugin()
+// Destructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSVmbxPlugin::~CGSVmbxPlugin()
+    {
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::~CGSVmbxPlugin =>" );
+    
+    iResources.Close();
+    delete iNullService;
+
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::~CGSVmbxPlugin <=" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSVmbxPlugin::ConstructL()
+// Symbian OS two-phased constructor
+//
+// ---------------------------------------------------------------------------
+//
+void CGSVmbxPlugin::ConstructL()
+    {
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::ConstructL =>" );
+    
+    BaseConstructL();
+    OpenLocalizedResourceFileL( KVmbxPluginResourceFileName, iResources );
+    
+	VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::ConstructL <=" );    
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSVmbxPlugin::NewL()
+// Static constructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSVmbxPlugin* CGSVmbxPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    CGSVmbxPlugin* self = new( ELeave ) CGSVmbxPlugin();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSVmbxPlugin::Id
+// 
+//
+// -----------------------------------------------------------------------------
+//
+TUid CGSVmbxPlugin::Id() const
+    {
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::Id =>" );
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::Id <=" );
+    return KGSVmbxPluginUID;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSVmbxPlugin::DoActivateL
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSVmbxPlugin::DoActivateL( const TVwsViewId& /*aPrevViewId*/,
+                                  TUid /*aCustomMessageId*/,
+                                  const TDesC8& /*aCustomMessage*/ )
+    {
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::DoActivateL =>" );
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::DoActivateL <=" );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSVmbxPlugin::DoDeactivate
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSVmbxPlugin::DoDeactivate()
+    {
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::DoDeactivate =>" );    
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::DoDeactivate <=" );
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+
+// -----------------------------------------------------------------------------
+// CGSVmbxPlugin::GetCaptionL
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSVmbxPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::GetCaptionL =>" );
+    
+    HBufC* result = StringLoader::LoadL( R_GS_VMBX_PLUGIN_CAPTION );
+    aCaption.Copy( *result );
+    delete result;
+    
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::GetCaptionL <=" );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSVmbxPlugin::PluginProviderCategory
+//
+//
+// -----------------------------------------------------------------------------
+//
+TInt CGSVmbxPlugin::PluginProviderCategory() const
+    {
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::PluginProviderCategory =>" );
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::PluginProviderCategory <=" );
+    return KGSPluginProviderInternal;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSVmbxPlugin::ItemType()
+//
+//
+// -----------------------------------------------------------------------------
+//
+TGSListboxItemTypes CGSVmbxPlugin::ItemType()
+    {
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::ItemType =>" );
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::ItemType <=" );
+    return EGSItemTypeSettingDialog;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSVmbxPlugin::GetValue()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSVmbxPlugin::GetValue( const TGSPluginValueKeys /*aKey*/,
+                                      TDes& /*aValue*/ )
+    {
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::GetValue =>" );
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::GetValue <=" );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSVmbxPlugin::HandleSelection()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSVmbxPlugin::HandleSelection(
+    const TGSSelectionTypes /*aSelectionType*/ )
+    {  
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::HandleSelection =>" );  
+    TRAP_IGNORE( LaunchVoiceMailBoxAppL() );
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::HandleSelection <=" );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSVmbxPlugin::CreateIconL
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGulIcon* CGSVmbxPlugin::CreateIconL( const TUid aIconType )
+    {
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::CreateIconL =>" );  
+    
+    CGulIcon* icon;
+    TParse* fp = new( ELeave ) TParse();
+    CleanupStack::PushL( fp );
+    
+    fp->Set( KGSVmbxPluginIconDirAndName, &KDC_BITMAP_DIR, NULL );
+
+    if ( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropSetConnConfig,
+        fp->FullName(),
+        EMbmGsvmbxpluginQgn_prop_cp_tele_vmail,
+        EMbmGsvmbxpluginQgn_prop_cp_tele_vmail_mask );
+        }    
+    else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    CleanupStack::PopAndDestroy( fp );
+
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::CreateIconL <=" );
+    return icon;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSVmbxPlugin::OpenLocalizedResourceFileL()
+// 
+// Opens localized resource file.
+// -----------------------------------------------------------------------------
+//
+void CGSVmbxPlugin::OpenLocalizedResourceFileL(
+    const TDesC& aResourceFileName,
+    RConeResourceLoader& aResourceLoader )
+    {
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::OpenLocalizedResourceFileL =>" );  
+    
+    RFs fsSession;
+    User::LeaveIfError( fsSession.Connect() );
+
+    // Find the resource file:
+    TParse parse;
+    parse.Set( aResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL );
+    TFileName fileName( parse.FullName() );
+
+    // Get language of resource file:
+    BaflUtils::NearestLanguageFile( fsSession, fileName );
+
+    // Open resource file:
+    aResourceLoader.OpenL( fileName );
+
+    // If leave occurs before this, close is called automatically when the
+    // thread exits.
+    fsSession.Close();
+    
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::OpenLocalizedResourceFileL <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CGSVmbxPlugin::LaunchVoiceMailBoxAppL()
+//
+// Launches Voice Mailbox application.
+// -----------------------------------------------------------------------------
+//
+void CGSVmbxPlugin::LaunchVoiceMailBoxAppL()
+    {
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::LaunchVoiceMailBoxAppL =>" );
+    
+    // Get the correct application data
+    RWsSession ws;
+    User::LeaveIfError( ws.Connect() );
+    CleanupClosePushL( ws );
+
+    // Find the task with uid
+    TApaTaskList taskList( ws );
+    TApaTask task = taskList.FindApp( KGsVmbxAppUid );
+    
+    if ( task.Exists() )
+        {
+        task.BringToForeground();
+        }
+    else
+        {
+        // Launch Voice Mailbox application as embedded
+        TAppInfo app( KGsVmbxAppUid, KGSVmbxApp );            
+        EmbedAppL( app );
+        }
+
+    CleanupStack::PopAndDestroy(); // ws
+    
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::LaunchVoiceMailBoxAppL <=" );    
+    }
+// -----------------------------------------------------------------------------
+// CGSVmbxPlugin::EmbedAppL()
+//
+// Launches application as embedded.
+// -----------------------------------------------------------------------------
+//
+void CGSVmbxPlugin::EmbedAppL( const TAppInfo& aApp )
+    {
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::EmbedAppL =>" );
+    
+    // Launch settings app
+    if ( iNullService )
+        {
+        delete iNullService;
+        iNullService = NULL;
+        }
+    iNullService = CAknNullService::NewL( aApp.iUid, this );
+    
+    VMBLOGSTRING( "VMBXPLUGIN: CGSVmbxPlugin::EmbedAppL <=" ); 
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/gsvmbxplugin/src/gsvmbxpluginimplementationtable.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for gsvmbxplugin.
+*
+*/
+
+
+// User includes
+#include "gsvmbxplugin.h"
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+
+// Constants
+const TImplementationProxy KGSVmbxPluginImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY( 0x2000B4D7, CGSVmbxPlugin::NewL )
+    };
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+    TInt& aTableCount )
+    {    
+    aTableCount = sizeof( KGSVmbxPluginImplementationTable )
+        / sizeof( TImplementationProxy );
+    return KGSVmbxPluginImplementationTable;
+    }
+
+
+// End of File
Binary file phoneuis/vmbx/help/data/xhtml.zip has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/help/group/bld.inf	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - Initial contribution
+* 
+* Contributors:
+* 
+* 
+* Description:
+* Export help related files.
+*
+*/
+
+#include <platform_paths.hrh>				
+PRJ_EXPORTS
+:zip ../data/xhtml.zip   /epoc32/data/z/resource/ overwrite
+:zip ../data/xhtml.zip   /epoc32/winscw/c/resource/ overwrite
+
+../inc/smsvo.hlp.hrh	APP_LAYER_PLATFORM_EXPORT_PATH(csxhelp/smsvo.hlp.hrh)
+../rom/vmbxhelps_variant.iby		CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(vmbxhelps_variant.iby)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/help/inc/smsvo.hlp.hrh	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description:
+*
+*/
+	
+//
+// smsvo.hlp.hrh generated by CSXHelp Utilities.
+//           
+
+#ifndef __SMSVO_HLP_HRH__
+#define __SMSVO_HLP_HRH__
+
+_LIT(KSMSVO_HLP_MAIN_VIEW, "SMSVO_HLP_MAIN_VIEW"); // 
+_LIT(KSMSVO_HLP_CS_AND_VIDEO, "SMSVO_HLP_CS_AND_VIDEO"); // 
+_LIT(KSMSVO_HLP_CS_VIDEO_AND_XSP_VOIP, "SMSVO_HLP_CS_VIDEO_AND_XSP_VOIP"); // 
+
+#endif 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/help/rom/vmbxhelps_variant.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef __VMBXHELPS_VARIANT_IBY__
+#define __VMBXHELPS_VARIANT_IBY__
+
+#if defined(FF_S60_HELPS_IN_USE)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x100058F5\contents.zip, RESOURCE_FILES_DIR\xhtml\%02d\0x100058F5\contents.zip)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x100058F5\index.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x100058F5\index.xml)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x100058F5\keywords.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x100058F5\keywords.xml)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x100058F5\meta.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x100058F5\meta.xml)
+#endif
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/inc/VMBLogger.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,118 @@
+/*
+* 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:  Provides macros for logging
+*
+*/
+
+
+#ifndef __VMBLOGGER_H__
+#define __VMBLOGGER_H__
+
+//  INCLUDES
+#include <e32def.h>
+
+/* 
+-----------------------------------------------------------------------------
+
+    USER LOG SELECTION
+
+-----------------------------------------------------------------------------
+*/
+
+
+#ifndef _DEBUG
+
+/***************************
+* Logging method variants:
+* 0 = No logging
+* 1 = Flogger
+* 2 = RDebug
+***************************/ 
+
+#define VMB_LOGGING_METHOD      0   // UREL BUILD
+
+#else
+
+#ifdef __WINS__
+#define VMB_LOGGING_METHOD      1   // UDEB BUILD, WINS
+#else
+#define VMB_LOGGING_METHOD      1   // UDEB BUILD, HW
+#endif // __WINS__
+
+#endif // _DEBUG
+
+
+// Next is for backward compatibility
+#if VMB_LOGGING_METHOD > 0
+    #define VMB_LOGGING_ENABLED    
+#endif //VMB_LOGGING_METHOD
+
+
+/**
+*
+* FLOGGER SETTINGS
+*
+*/
+#if VMB_LOGGING_METHOD == 1      // Flogger
+
+    #include <flogger.h>
+
+    _LIT(KVMBLogFolder, "vmbx");
+    _LIT(KVMBLogFile, "vmbxapp.txt");
+
+#elif VMB_LOGGING_METHOD == 2    // RDebug
+
+    #include <e32svr.h>
+
+#endif //VMB_LOGGING_METHOD
+
+
+/**
+*
+* LOGGING MACROs
+*
+* USE THESE MACROS IN YOUR CODE !
+*
+*/
+
+#if VMB_LOGGING_METHOD == 1      // Flogger
+
+#define VMBLOGTEXT(AAA) /*lint -save -e960 */              { RFileLogger::Write(KVMBLogFolder(),KVMBLogFile(),EFileLoggingModeAppend,AAA); } /*lint -restore */
+#define VMBLOGSTRING(AAA) /*lint -save -e960 */            { _LIT(tempLogDes,AAA); RFileLogger::Write(KVMBLogFolder(),KVMBLogFile(),EFileLoggingModeAppend,tempLogDes()); } /*lint -restore */
+#define VMBLOGSTRING2(AAA,BBB) /*lint -save -e960 -e437 */ { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KVMBLogFolder(),KVMBLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB); } /*lint -restore */
+#define VMBLOGSTRING3(AAA,BBB,CCC) /*lint -save -e960 */   { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KVMBLogFolder(),KVMBLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); } /*lint -restore */
+
+#elif VMB_LOGGING_METHOD == 2    // RDebug
+
+#define VMBLOGTEXT(AAA)              RDebug::Print(AAA);
+#define VMBLOGSTRING(AAA)            RDebug::Print(_L(AAA));
+#define VMBLOGSTRING2(AAA,BBB)       RDebug::Print(_L(AAA),BBB);
+#define VMBLOGSTRING3(AAA,BBB,CCC)   RDebug::Print(_L(AAA),BBB,CCC);
+
+#else    // VMB_LOGGING_METHOD == 0 or invalid
+
+// Example: VMBLOGTEXT(own_desc);
+#define VMBLOGTEXT(AAA)
+// Example: VMBLOGSTRING("Test");
+#define VMBLOGSTRING(AAA)
+// Example: VMBLOGSTRING("Test %i", aValue);
+#define VMBLOGSTRING2(AAA,BBB)
+// Example: VMBLOGSTRING("Test %i %i", aValue1, aValue2);
+#define VMBLOGSTRING3(AAA,BBB,CCC)
+
+#endif  // VMB_LOGGING_METHOD
+
+#endif    // VMBLOGGER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/inc/VmApp.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declares main application class for the application.
+*
+*/
+
+
+#ifndef VMAPP_H
+#define VMAPP_H
+
+// INCLUDES
+#include <aknapp.h>
+
+// CONSTANTS
+// UID of the application
+const TUid KUidvm = { 0x100058F5 };
+
+// CLASS DECLARATION
+
+/**
+*  CVmApp application class.
+*  Provides factory to create concrete document object.
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CVmApp : public CAknApplication
+    {
+    private:
+        /**
+         * From CApaApplication, creates CVmDocument document object.
+         * @return A pointer to the created document object.
+         */
+        CApaDocument* CreateDocumentL();
+    
+        /**
+         * From CApaApplication, returns application's UID (KUidvm).
+         * @return The value of KUidvm.
+         */
+        TUid AppDllUid() const;
+    };
+
+#endif  // VMAPP_H
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/inc/VmAppUi.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,196 @@
+/*
+* 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:  Declares UI class for application.
+*
+*/
+
+
+#ifndef VMAPPUI_H
+#define VMAPPUI_H
+
+// INCLUDES
+#include <aknappui.h>
+#include <bldvariant.hrh>
+#include "vm.hrh"
+#include "VmQueryLauncher.h"
+
+// FORWARD DECLARATIONS
+class CVmContainer;
+class CAiwServiceHandler;
+class CRepository;
+
+/**
+* Status of AppUi
+*/
+enum TVmbxAppUiState
+    {
+    /** idle state of AppUi */
+    EIdle= 0,
+    /** state of that AppUi launch to CVmQueryLauncher
+    * for querying number */
+    ELauncherQueryingNumber
+    };
+
+// Constants
+const TInt KVmCmdAiwVoiceCall = EVmCmdAiwCmdLast;
+const TInt KVmCmdAiwVideoCall = EVmCmdAiwCmdLast+1;
+const TInt KVmCmdAiwVoipCall  = EVmCmdAiwCmdLast+2;
+
+// CLASS DECLARATION
+
+/**
+*  Application UI class.
+*  Provides support for the following features:
+*  - UIKON control architecture
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CVmAppUi : public CAknAppUi, public MVmQueryLauncher
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CVmAppUi();
+
+    public: // New functions
+
+        /**
+        * Loads CBA buttons for MSK
+        * @return void
+        */
+        void DrawCbaButtonsL();
+
+        /**
+        * Get current AppUi state
+        * @return TVmbxAppUiState, state of AppUi
+        */
+        TVmbxAppUiState GetAppUiState();
+
+    private: // New functions
+
+        /**
+        * Adds an item in menu.
+        *
+        * @param aMenuPane menu pane
+        * @param aText item text
+        * @param aCommandId menu command id
+        */
+        void AddMenuItemL( CEikMenuPane* aMenuPane, const TDesC& aText,
+                                                         TInt aCommandId );
+        /**
+        * Defines whether voice mail is started from general settings
+        * @return TBool, ETrue if started from GS else EFalse
+        */
+        TBool IsStartedFromGSL();
+
+        /**
+         * Set in MenuPane cmomand's item specific property.
+         * @since S60 v5.2
+         * @param aMenuPane curent munu pane
+         * @param aCommandId command Id
+         */
+        void SetItemSpecificL( CEikMenuPane* aMenuPane, TInt aCommandId );
+
+    private: // Functions from base classes
+
+        /**
+        * From MEikMenuObserver, dynamically initialises menu pane.
+        */
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+        /**
+        * From CCoeAppUi, gets a list of help contexts for a particular
+        * application user interface.
+        */
+        CArrayFix<TCoeHelpContext>* HelpContextL() const;
+
+        /**
+        * From CEikAppUi, takes care of command handling.
+        * @param aCommand command to be handled
+        */
+        void HandleCommandL( TInt aCommand );
+
+        /**
+        * From CEikAppUi, Handles changes in keyboard focus when an application
+        * switches to,  or from, the foreground.
+        * @param aForeground ETrue if the application is in the foreground,
+        *                     otherwise EFalse.
+        */
+        void HandleForegroundEventL( TBool aForeground );
+
+       /**
+         * From MVmQueryLauncher,Callback when query number completed
+         *
+         */
+        void NumberQueryComplete();
+
+        /**
+         * see VmContainer::IsIpVoiceMailboxServices
+         */
+        TBool IsIpVoiceMailboxServices();
+
+    private: // Data
+
+        //AppUi container
+        CVmContainer* iAppContainer;
+
+        //menupane text strings
+        HBufC* iTextShowDetails;  // owned
+        HBufC* iTextClearIcon; // owned
+        HBufC* iTextCallVoiceMail;  // owned
+        HBufC* iTextDefineNumber;  // owned
+        HBufC* iTextDefineVideoNumber;  // owned
+        HBufC* iTextChangeNumber;  // owned
+        HBufC* iTextHelp;  // owned
+        HBufC* iTextExit;  // owned
+        HBufC* iTextActivate; // owned
+        HBufC* iTextCallIntVoiceMail;  // owned
+        HBufC* iTextCancel; // owned
+        HBufC* iTextCheckStatus; // owned
+        HBufC* iTextCheckMessage; // owned
+        HBufC* iTextCallVideoMail;  // owned
+
+        //type of vmbx
+        TInt iType;
+
+        //title of the popupList
+        HBufC* iTextRingingTime; // owned
+
+        //CVmQueryLauncher object for asking vmbx number
+        CVmQueryLauncher* iQueryLauncher;  // owned
+
+        // AIW
+        CAiwServiceHandler* iServiceHandler; // owned
+
+        TBool iFeatureManagerInitialized;
+
+        // Boolean defining whether voice mail is started from
+        // general settings or not
+        TBool iFromGS;
+
+        // state of AppUi
+        TVmbxAppUiState iAppUiState;
+    };
+
+#endif  // VMAPPUI_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/inc/VmContainer.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,430 @@
+/*
+* 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:  Declares a container control for the application.
+*
+*/
+
+
+#ifndef VM_CONTAINER_H
+#define VM_CONTAINER_H
+
+// INCLUDES
+#include <e32std.h>
+#include <bldvariant.hrh>
+#include <coecntrl.h>
+#include <badesca.h>
+#include <centralrepository.h>
+#include <cenrepnotifyhandler.h>
+#include <AknIconArray.h> //for sim icon
+#include <aiwdialdata.h>
+#include <vmnumber.h>
+#include "VmAppUi.h"
+
+// CONSTANTS
+enum TVmbxIndicators
+    {
+    EVmbxVoiceMessageAmountInd = 0,
+    EVmbxVoiceMailboxNumberInd,
+    EVmbxDetailsOfLastMessageInd,
+    EVmbxVideoMailboxNumberInd,
+    EVmbxIntCallVoiceMailboxNumberInd
+    };
+
+// FORWARD DECLARATIONS
+class CAknDoubleGraphicStyleListBox;
+class CPhCltExtPhoneBase;
+class CAiwServiceHandler;
+class CPNGNumberGrouping;
+class CAknsBasicBackgroundControlContext;
+class CCaUiEngApi;
+class CSPSettings;
+
+// CLASS DECLARATION
+
+/**
+*  CVmContainer, container control class.
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CVmContainer : public CCoeControl,
+                     public MVmbxNotifyHandler,
+                     public MVmbxAlsObserver,
+                     public MCenRepNotifyHandlerCallback,
+                     public MEikListBoxObserver,
+                     public MServiceNotifyHandler
+                     
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+        CVmContainer();
+
+        /**
+        * Symbian OS default constructor.
+        * @param aRect Frame rectangle for container.
+        * @param aServiceHandler AIW service handler.
+        */
+        void ConstructL( const TRect& aRect,
+                                        CAiwServiceHandler* aServiceHandler );
+
+        /**
+        * Destructor.
+        */
+        ~CVmContainer();
+
+    public:  // New functions
+        /**
+        * Query for a new voice mailbox number. Calls method of vmbx.dll.
+        * A different query is created depending on whether the vmbx number
+        * is defined before calling this.
+        *
+        * @param aQueryType query type ( 2 alternatives )
+        */
+        void QueryNumberL( TVmbxQueryType aQueryType );
+
+        /**
+        * Gets the vmbx number from SIM/SharedData and updates it
+        * in the display.
+        */
+        void UpdateVmbxNumberL();
+
+        /**
+        * Check wether is possible to edit the voice mailbox number.
+        * @since 2.7
+        * @return ETrue is editing is allowed.
+        */
+        TBool AllowedToChangeTheNumber();
+
+        /**
+        * Resets to zero the voicemail message counter in SD.
+        * @since 2.7
+        */
+        void ResetVoicemailMessageCounterL();
+
+        /**
+        * Check if VoIP profiles is found.
+        * @since 3.0
+        * @return ETrue if there is at least one VoIP profile, EFalse otherwise
+        */
+        TBool IsVoIPProfilesFound();
+
+        /**
+        * Gets index of the current item in listbox
+        * @return index of current item
+        */
+        TInt CurrentItem();
+
+
+        /**
+        * Checks if clear icon is set
+        * @return ETrue if clear icon
+        */
+        TBool IsClearIcon();
+
+        /**
+        * Calls the vmbx number using PhoneClient.
+        */
+        void CallVoiceMailBoxL();
+
+        /**
+        * Calls the VoIP vmbx number using PhoneClient.
+        */
+        void CallIntVoiceMailBoxL();
+
+        /**
+        * Makes a call request to AiwProvider.
+        * @aCommand AiwCommand id.
+        * @aCallType voice or Video call.
+        * @return KErrNone if successful.
+        **/
+        void AiwCallRequestL( TInt aCommand, CAiwDialData::TCallType aCallType );
+
+        /**
+        * Ask Vmbx type.
+        * @since 3.0
+        * @return returns type of Vmbx.
+        */
+        TInt AskTypeL();
+
+        /**
+        * Calls the vmbx number using PhoneClient.
+        * @since 3.1
+        */
+        void CallVideoMailBoxL();
+
+        /**
+        * Constructs the icons that are needed to indicate where
+        * the vmbx number is stored
+        * @since 3.0
+        */
+        void ConstructIconsForListboxL();
+
+        /**
+        * Query for a new video mailbox number. Calls method of vmbx.dll.
+        * A different query is created depending on whether the video mailbox
+        * number is defined before calling this.
+        *
+        * @param aQueryType query type ( 2 alternatives )
+        * @since 3.1
+        */
+        void QueryVideoNumberL( TVmbxQueryType aQueryType );
+
+        /**
+        * Query for a voice mailbox number.
+        *
+        * @return Voice mailbox number
+        * @since 3.1
+        */ const TDesC& Number() const;
+
+        /**
+        * Query for a video mailbox number.
+        *
+        * @return Video mailbox number
+        * @since 3.1
+        */
+        const TDesC& VideoNumber() const;
+
+        /**
+        * Informs that listbox must be updated because returned to Vmbx
+        * from other application
+        *
+        * @since
+        */
+        void UpdateData( TBool aState );
+
+        /**
+         * Checks if there are configured IP voicemail services
+         * @since 3.2
+         * @return ETrue if at least one IP voicemail service was found
+         */
+        TBool IsIpVoiceMailboxServices();
+
+        /**
+         * Get Service Id.
+         * @since 3.2
+         * @return TUint Service Id.
+         */
+        TUint ServiceId();
+
+        /**
+         * Informs that listbox must be updated immediately.
+         * @since 3.2
+         */
+        void UpdateListboxL();
+
+        /**
+         * Add brand icon if it exist.
+         * @since 3.2
+         * @param aServiceId Used Service Id
+         * @param aIconId On completion, contains branded icon's icon list id
+         */
+        void AddBrandIconL( TUint aServiceId, TInt& aIconId );
+
+        /**
+         * Is service updated.
+         * @since 3.2
+         * @return TBool ETrue if service has updated, otherwise EFalse.
+         */
+        TBool IsServiceUpdated() const;
+
+    public: // Functions from base classes
+
+        /**
+        * From MEikListBoxObserver, Handles list box events.
+        * @param aEventType The event identifier.
+        */
+        void HandleListBoxEventL( CEikListBox* /*aListBox*/,
+            					  TListBoxEvent aEventType );
+        /**
+         * Check if Video telphony is activated at FeatureManager
+         * @since 3.2
+         * @return Value of VT support
+         */
+        TBool IsVideoSupported();
+
+    private:  // Functions from base classes
+
+        /**
+        * From CCoeControl, responds to focus changes
+        * @since 3.0
+        * @param aDrawNow ?description
+        */
+        void FocusChanged( TDrawNow aDrawNow );
+
+        /**
+        * From CoeControl, responds to size changes to sets the size and
+        * position of the contents of this control
+        */
+        void SizeChanged();
+
+        /**
+        * From CoeControl, gets the number of controls contained in
+        * a compound control
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl, gets the specified component of a compound control
+        */
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+
+        /**
+        * From CCoeControl, handles key events
+        */
+        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                                 TEventCode aType );
+
+        /**
+        * From CCoeControl, handles a change to the control's resources
+        */
+        void HandleResourceChange( TInt aType );
+
+        /**
+        * From CCoeControl, draw a control - called by window server
+        */
+        void Draw( const TRect& aRect ) const;
+
+
+        /**
+        * From MVmbxNotifyHandler, user has completed an action
+        * to a vmbx number
+        */
+        void HandleNotifyL( TInt aLine, const TDesC& aValue );
+
+        /**
+        * From MVmbxAlsObserver, ALS line changed
+        */
+        void HandleAlsChangeL( TVmbxAlsLine aLine );
+
+        /**
+        * From MCenRepNotifyHandlerCallback, user has pressed integer value keys
+        **/
+        void HandleNotifyInt( TUint32 aKey, TInt aValue );
+
+        /**
+        * From MServiceNotifyHandler user has changed Services.
+        * @since S60 v3.2
+        */
+        void HandleServiceNotifyL();
+
+    private:   // New functions
+
+        /**
+        * Updates the vmbx number in the listbox shown on the app screen.
+        */
+        void UpdateVmbxNumberInListBoxL();
+
+        /**
+        * Updates the new voice message to the listbox
+        */
+        void UpdateNewVoiceMessagesInListBoxL();
+
+        /**
+        * Updates the last message details to the listbox
+        */
+        void UpdateLastMessageDetailsInListBoxL();
+
+        /**
+        * Fill array with indications
+        */
+        void FillIndArray();
+
+    private:  // data
+
+        // Video line 1
+        HBufC* iVideoLine1;  // owned
+
+        // Video line 2
+        HBufC* iVideoLine2;  // owned
+
+        // Video number
+        TBuf<KVmbxMaxNumberLength> iVideoNumber;
+
+
+        // Handler of the Application Interworking
+        CAiwServiceHandler* iServiceHandler;
+
+        //Listbox text lines
+        HBufC* iLine1;  // owned
+        HBufC* iLine2;  // owned
+        HBufC* iLine3;  // owned
+        HBufC* iLine4;  // owned
+
+        // Vmbx number handler
+        RVmbxNumber iVmbxNumber;
+
+        // Array for the listbox texts
+        CDesCArrayFlat iArray;  // owned
+
+        // Vmbx listbox
+        CAknDoubleGraphicStyleListBox* iListBox;  // owned
+
+
+        // Mailbox number
+        TBuf<KVmbxMaxNumberLength> iNumber;
+
+        // Phone groups
+        CPNGNumberGrouping* iNumberGrouping;  // owned
+
+        // Central repository handlers
+        CCenRepNotifyHandler* iNotifyHandler1;
+        CCenRepNotifyHandler* iNotifyHandler2;
+        CCenRepNotifyHandler* iNotifyHandler3;
+
+        // Central repository session
+        CRepository* iSession;  // owned
+
+        // Array for indications in listbox
+        RArray<TInt> iIndArray;
+
+        //PRI Settings
+        TInt iVmUiOpts;
+
+        // Icon array
+        CAknIconArray* iListIcons; //not own.. list box will delete this one
+
+        // skin data
+        CAknsBasicBackgroundControlContext* iSkinContext; // owned
+
+        // Mailbox type
+        TInt iType;
+
+        // Update data when back to application
+        TBool iUpdateData;
+
+        // CenRep key for video support
+        TBool iIsVideoSupported;
+
+        // Set to true if call is ongoing
+        TBool iIsCallOngoing;
+
+        /**
+         * Instance of service settings provider.
+         * Used especially to retrieve VoIP specific info.
+         * Own.
+         */
+        CSPSettings* iServiceProviderSettings;
+
+        TBool iServiceUpdated;
+
+        TBool iFeatureManagerInitialized;
+
+    };
+
+#endif  // VM_CONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/inc/VmDetDlgPropertyObserver.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Publish & Subscribe property change observer
+*
+*/
+
+
+
+#ifndef VMDETDLGPROPERTYOBSERVER_H
+#define VMDETDLGPROPERTYOBSERVER_H
+
+//  INCLUDES
+#include <e32base.h>        // CActive
+#include <e32property.h>    // RProperty
+
+// FORWARD DECLARATIONS
+class CVmDetailsDialog;
+
+// CLASS DECLARATION
+
+/**
+*  Implementation of the Publish & Subscribe property change observer
+*
+*  @lib
+*  @since 2.6
+*/
+class CVmDetDlgPropertyObserver : public CActive
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aObserver Observer to be informed when observed property
+        *                  changes
+        */
+        static CVmDetDlgPropertyObserver* NewL( CVmDetailsDialog& aDetDialog );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CVmDetDlgPropertyObserver();
+
+    public:     // New functions
+
+        /**
+        * Starts observing the given key for any changes
+        * Notifies the observer when the property changes
+        * @since 2.6
+        * @param aCategory, Category of the observed property
+        * @param aKey, Observed property
+        */
+        void ObservePropertyChangeL( TUid aCategory, TUint aKey );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From CActive
+        */
+        void RunL();
+
+        /**
+        * From CActive
+        */
+        void DoCancel();
+
+        /**
+        * From CActive
+        */
+        TInt RunError( TInt aError );
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVmDetDlgPropertyObserver( CVmDetailsDialog& aDetDialog );
+
+        /**
+        * Symbian 2nd phase constructor..
+        */
+        void ConstructL();
+
+    private:    // Data
+
+        // Owns: Observed property
+        RProperty iProperty;
+
+        // Observer to be informed when property changes
+        CVmDetailsDialog& iDetDialog;
+        
+        // Observed property
+        TUint iKey;
+    };
+
+#endif      // VMDETDLGPROPERTYOBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/inc/VmDetailsDialog.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,154 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Details dialog for last message.
+*
+*/
+
+
+#ifndef CVMDETAILSDIALOG_H
+#define CVMDETAILSDIALOG_H
+
+//  INCLUDES
+#include <AknDialog.h>
+#include <centralrepository.h>
+
+// FORWARD DECLARATIONS
+class CPNGNumberGrouping;
+class CVmDetDlgPropertyObserver;
+
+// CLASS DECLARATION
+
+/**
+*  Details dialog for last message.
+*
+*  Usage:
+*  CVmDetailsDialog* dlg = CVmDetailsDialog::NewL();
+*  dlg->ExecuteLD( R_VMBX_DETAIL_DIALOG );
+*
+*  @lib 
+*  @since 2.7
+*/
+class CVmDetailsDialog : public CAknDialog
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CVmDetailsDialog* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CVmDetailsDialog();
+        
+        // Called when the key value is changed.
+        void HandlePropertyNotificationEventL( const TDesC& aValue );
+                
+    protected:  // New functions
+        
+        /**
+        * Creates the listbox items
+        * @param aItemArray Array to fill.
+        */
+        void PopulateListboxItemsL( CDesCArray& aItemArray );
+
+        /**
+        * Adds text line to the listbox.
+        * @param aItemArray Array to append onto.
+        * @param aHeading Text for the first (heading) column.
+        * @param aData Text for the second (body/data) column.
+        * @param aItemTextRect list box rectangle where the text is drawn
+        * @param aUseMultipleLines ETrue if the text is wrapped into several
+        *                                lines (if needed) in the listbox.
+        *                          EFalse if the text is truncated into one
+        *                                 line in the listbox (default).
+        */
+        static void AppendLineL( 
+                        CDesCArray& aItemArray, 
+                        const TDesC& aHeading, 
+                        const TDesC& aData, 
+                        TRect aItemTextRect,
+                        TBool aUseMultipleLines = EFalse );
+
+        /**
+        * Sets the old title pane text.
+        */
+        void SetOldTitleL();
+
+        /**
+        * Format date string to UI style. Initial format must 
+        * be DD/MM/YYYY. If not, this leaves with KErrCorrupt.
+        * @param aDateString String to be modified.
+        */
+        static void FormatDateStringL( TDes& aDateString );
+
+        /**
+        * Format time string to UI style. Initial format must 
+        * be HH:MM:SS. If not, this leaves with KErrCorrupt.
+        * @param aTimeString String to be modified.
+        */
+        static void FormatTimeStringL( TDes& aTimeString );
+
+
+    protected:  // Functions from CAknDialog
+        
+        /**
+        * Called after the dialog is constructed and before it is launched.
+        */
+        void PreLayoutDynInitL();
+
+        /**
+        * Called when a key is pressed.
+        */
+        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                                     TEventCode aType );
+
+        /**
+        * Called when a softkey is pressed.
+        */
+        TBool OkToExitL( TInt aButtonId );
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVmDetailsDialog();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+        // Old title pane text
+        HBufC* iOldTitlePaneText;
+
+        // Central Repository
+        CRepository* iSession;
+
+        // Does the number grouping.
+        CPNGNumberGrouping* iNumberGrouping;
+        
+        // Observer class        
+        CVmDetDlgPropertyObserver* iObserver;
+    
+        // Starts observing for key value changes.
+        void StartObservingL();
+    };
+
+#endif      // CVMDETAILSDIALOG_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/inc/VmDetailsDlgDummy.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Dummy details dialog for global implementation
+*
+*/
+
+
+
+#ifndef CVMDETAILSDLGDUMMY_H
+#define CVMDETAILSDLGDUMMY_H
+
+//  INCLUDES
+#include <e32base.h>
+
+
+// CLASS DECLARATION
+
+/**
+*  Dummy details dialog for global implementation
+*
+*  Usage:
+*  CVmDetailsDialog* dlg = CVmDetailsDialog::NewL();
+*  dlg->ExecuteLD( R_VMBX_DETAIL_DIALOG );
+*
+*  @lib 
+*  @since 2.7
+*/
+class CVmDetailsDialog : public CBase
+    {
+    public:  // Constructors and destructor
+        
+       /**
+        * Two-phased constructor.
+        */
+        static CVmDetailsDialog* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CVmDetailsDialog();
+        
+    private:
+        
+       /**
+        * C++ default constructor.
+        */
+        CVmDetailsDialog();
+        
+    public:
+    
+        /**
+        * Executes dummy dialog
+        *
+        * @param aResourceId Resource id
+        * @return Returns 0
+        */        
+        TInt ExecuteLD( TInt aResourceId );
+    };
+
+#endif // CVMDETAILSDLGDUMMY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/inc/VmDocument.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declares a document for application.
+*
+*/
+
+
+#ifndef VMDOCUMENT_H
+#define VMDOCUMENT_H
+
+// INCLUDES
+#include <eikdoc.h>
+
+// FORWARD DECLARATIONS
+class CEikAppUi;
+
+// CLASS DECLARATION
+
+/**
+*  CVmDocument application class.
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CVmDocument : public CEikDocument
+    {
+    public:  // Constructors and destructor
+        /**
+         * Two-phased constructor.
+         */
+        static CVmDocument* NewL( CEikApplication& aApp );
+        
+        /**
+         * Destructor.
+         */
+        virtual ~CVmDocument();
+ 
+     private:
+        /**
+         * Symbian OS default constructor.
+         */
+        CVmDocument( CEikApplication& aApp ): CEikDocument( aApp ){  }
+     
+     private:
+        /**
+         * From CEikDocument, create CVmAppUi "App UI" object.
+         */
+        CEikAppUi* CreateAppUiL();
+
+    };
+
+#endif  // VMDOCUMENT_H
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/inc/VmQueryLauncher.h	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,100 @@
+/*
+* 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:  Active object for asking vmbx number (if it's not defined) after
+*                the vmbx application has been fully constructed.
+*
+*/
+
+
+#ifndef VM_QUERY_LAUNCHER_H
+#define VM_QUERY_LAUNCHER_H
+
+// INCLUDES
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class CVmContainer;
+
+/**
+*  MVmQueryLauncher
+*
+*  @lib vmbx.lib
+*
+**/
+NONSHARABLE_CLASS ( MVmQueryLauncher )
+    {
+    public:
+        /**
+        * query number completed
+        **/
+        virtual void NumberQueryComplete() = 0;
+
+    };
+
+
+// CLASS DECLARATION
+
+/**
+*  CVmQueryLauncher
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CVmQueryLauncher : public CActive
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        *
+        * @param aContainer VmContainer
+        * @param aObserver observer for launching number
+        * @param aPriority  Priority of CVmQueryLauncher
+        */
+        static CVmQueryLauncher* NewL( CVmContainer& aContainer, 
+                                        MVmQueryLauncher& aObserver, 
+                                TInt aPriority = CActive::EPriorityStandard );
+      
+        /**
+         * Destructor.
+         */
+        ~CVmQueryLauncher();
+ 
+     protected:  // From CActive
+
+        void RunL();
+        void DoCancel();
+     
+     private:
+        /**
+        * C++ default constructors.
+        *
+        * @param aContainer VmContainer
+        * @param aObserver observer for launching number
+        * @param aPriority  Priority of CVmQueryLauncher
+        */
+        CVmQueryLauncher( CVmContainer& aContainer,
+                         MVmQueryLauncher& aObserver, TInt aPriority );
+     
+     private:  // Data
+        CVmContainer& iContainer;
+
+        // Observer for AppUi to query number
+        MVmQueryLauncher& iObserver;
+    };
+
+#endif  // VM_QUERY_LAUNCHER_H
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/inc/VoiceMailboxAppPrivateCRKeys.h	Mon Jan 18 20:18:27 2010 +0200
@@ -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: Private keys for Voice mailbox.
+*
+*/
+
+
+#ifndef VOICEMAILBOXAPPPRIVATECRKEYS_H
+#define VOICEMAILBOXAPPPRIVATECRKEYS_H
+#include <e32std.h>
+
+/** VoiceMailbox Settings API */
+/** Provides access to the VoiceMailbox numbers and settings */
+
+const TUid KCRUidVoiceMailbox = {0x101F874F};
+
+
+/** Voice Message Date Stamp, a field in VMN 
+*
+* Text type
+*
+* Default value: ""
+**/
+const TUint32 KVmDateStamp                = 0x00000003;
+
+/** 
+* Voice message counter, a field in VMN to indicate how many messages are waiting on the network side 
+*
+* Integer type
+*
+* Default value: 0
+**/
+const TUint32  KVmMessageCounter            = 0x00000004;
+
+/** 
+* Voicemail Summary Info Set flag, a field in VMN 
+*
+* Integer type
+*
+* Possible values:
+* 0 (not set)
+* 1 (set)
+*
+* Default value: 0
+**/
+const TUint32  KVmSummaryInfoIsSet        = 0x00000005;
+
+/** 
+* Voice Message Time Stamp, a field in VMN 
+*
+* Text type
+*
+* Default value: ""
+**/
+const TUint32  KVmTimeStamp                = 0x00000006;
+
+/**
+* Voice Message Urgency Level, 
+*
+* Integer type
+*
+* Possible values:
+* 0 (ENormal)
+* 1 (EInteractive)
+* 2 (EUrgent)
+* 3 (EEmergency)
+*
+* Default value: 0
+**/
+const TUint32 KVmUrgencyLevel            = 0x00000007;
+
+/** Voice Message User Data, VMS field 
+*
+* Text type
+*
+* Default value: ""
+**/
+const TUint32  KVmUserData                = 0x00000008;
+
+
+/** Voice Message CDMA Operator Option to enable or disable UI for the user to
+* view or modify his/her voicemail box number 
+*
+* Integer type
+*
+* Default value: 2
+**/
+const TUint32 KVmUIOpts                    = 0x00000010;
+
+/** ring time index for i-Mode vmbx
+*
+* Integer type
+*
+* Default value: 2
+*/
+const TUint32 KVoiceMbxRingTimeIndex = 0x00000014;
+
+#endif      // VOICEMAILBOXAPPPRIVATECRKEYS_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/inc/smsvo.hlp.hrh	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* 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: Voice mailbox main view
+*
+*/
+//
+// smsvo.hlp.hrh
+//
+
+//
+// File generated on 13:52:21 18/3/2002
+// by cshlpcmp Version 010
+//
+
+#ifndef __SMSVO_HLP_HRH__
+#define __SMSVO_HLP_HRH__
+
+_LIT(KSMSVO_HLP_MAIN_VIEW,"SMSVO_HLP_MAIN_VIEW"); //Voice mailbox main view
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/inc/vm.hrh	Mon Jan 18 20:18:27 2010 +0200
@@ -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:  This file contains declarations for resources of vm.
+*                The file can be included in C++ or resource file.
+*
+*/
+
+
+#ifndef VM_HRH
+#define VM_HRH
+
+// DATA TYPES
+enum TvmMenuCommands
+    {
+    EVmCmdAiwPlaceholder = 500, // for aiw place holder
+    EVmCmdAiwCmdLast,
+    EvmCmdCallVoiceMail = 1,
+    EvmCmdChangeNumber = 2,
+    EvmCmdCallIntVoiceMail = 3, 
+    EvmCmdChangeAddress = 4, 
+    EvmCmdCallVideoMail = 5,
+    EvmCmdChangeVideoNumber = 6,
+    EvmCmdShowLastMessageDetails = 100,
+    EvmCmdClearIcon,   
+    EVmCbaMskDefVoMbx,
+    EVmCbaMskCallVoMbx,
+    EVmCbaMskDefViMbx,
+    EVmCbaMskCallViMbx,
+    EVmCbaMskDefVoipMbx,
+    EVmCbaMskCallVoipMbx
+    };
+
+// Dialog ID:s
+enum
+    {
+    KVmDetailsDialog = 8000
+    };
+
+#endif  // VM_HRH
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/inc/vm_variant.hrh	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* 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 Flags of vm.
+ *                The file can be included in C++ or resource file.
+ *
+*/
+
+
+#ifndef VM_VARIANT_HRH
+#define VM_VARIANT_HRH
+
+#define __RD_EXTENDED_AIW_
+//#undef __RD_EXTENDED_AIW_
+
+
+#endif  // VM_VARIANT_HRH
+
+// End of File  
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/loc/vm.loc	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,327 @@
+/*
+* 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 file contains the localised strings for vm.app
+ *
+*/
+
+
+// LOCALISATION STRINGS
+
+// d: app name in list
+// l: list_single_large_graphic_pane_t1
+//
+#define qtn_apps_smsvo_list "Voice Mailbox"
+
+// d: app name in grid
+// l: cell_app_pane_t1
+//
+#define qtn_apps_smsvo_grid "Voice Mail"
+
+// d: Displayed in title pane
+// l: title_pane_t2/opt9
+//
+#define qtn_smsvo_title_voice_mailbox "Voice Mailbox"
+
+// d: Displayed in the main view in a list pane for double item
+// d: (the other item is the vmbx number)
+// l: list_double_pane_t1
+//
+#define qtn_smsvo_call_voicemail "Voice mail"
+
+// d: When vmbx number is not defined, this text is shown in the place of it.
+// l: list_double_pane_t2
+//
+#define qtn_smsvo_number_pane_empty "No number"
+
+// d: Command in options list in Vmbx. 
+// d: Changes voice mailbox number that was already defined earlier.
+// l: list_single_pane_t1_cp2
+//
+#define qtn_smsvo_change_number "Change number"
+
+// d: Command in options list in Vmbx. 
+// d: Changes voice mailbox number that was not defined earlier.
+// l: list_single_pane_t1_cp2
+//
+#define qtn_smsvo_define_number "Define number"
+
+// d: Prompt of the query for defining video mailbox number.
+// l: list_single_pane_t1_cp2
+// w:
+// r:3.1
+//
+#define qtn_smsvi_define_number "Define number"
+
+// d: Command in options list in Vmbx. 
+// d: Calls voice mailbox.
+// l: list_single_pane_t1_cp2
+//
+#define qtn_smsvo_call_voicemail_opt "Call voice mailbox"
+
+// CDMA ADDITIONS
+
+//d:Text in infotmation note when
+//d:the voicemail icon is cleared.
+//l:popup_note_window
+//
+#define qtn_smsvo_voicemail_cleared "Voicemail icon cleared"
+
+// d: Command in options list in Vmbx. 
+// d: Clears the voicemail icon.
+// l: list_single_pane_t1_cp2
+//
+#define qtn_smsvo_clear_icon "Clear icon"
+
+// d: Displayed in the main view in a list pane for double item.
+// d: The first item. Shows the voice message count.
+// l: list_double_pane_t1_cp2
+//
+#define qtn_smsvo_voice_messages "Voice messages"
+
+// d: Text for number of new messages in the double listbox.
+// d: For no new messages.
+// l: list_double_pane_t2
+//
+#define qtn_smsvo_no_new "No new messages"
+
+// d: Text for number of new messages in the double listbox.
+// d: For one new message.
+// l: list_double_pane_t2
+//
+#define qtn_smsvo_new_messages "New messages"
+
+// d: Text for number of new messages in the double listbox.
+// d: For several new messages.
+// l: list_double_pane_t2
+//
+#define qtn_smsvo_n_new "%N new messages"
+
+// d: Displayed in the main view in a list pane for double item;
+// d: The third/last item. Open the last message details dialog.
+// l: list_double_pane_t1_cp2
+//
+#define qtn_smsvo_details_of_last "Details of last message"
+
+// d: Displayed in title pane in the last message details dialog
+// l: title_pane_t2/opt9
+//
+#define qtn_smsvo_title_details "Details of last message"
+
+// d: Heading in the details view.
+// l: list_single_heading_pane_t2
+//
+#define qtn_smsvo_urgency "Urgency"
+
+// d: Body text in the details view under Urgency heading.
+// l: list_single_heading_pane_t1
+//
+#define qtn_smsvo_emergency "Emergency"
+
+// d: Body text in the details view under Urgency heading.
+// l: list_single_heading_pane_t1
+//
+#define qtn_smsvo_urgent "Urgent"
+
+// d: Body text in the details view under Urgency heading.
+// l: list_single_heading_pane_t1
+//
+#define qtn_smsvo_normal "Normal"
+
+// d: Heading in the details view.
+// l: list_single_heading_pane_t2
+//
+#define qtn_smsvo_date "Date"
+
+// d: Heading in the details view.
+// l: list_single_heading_pane_t2
+//
+#define qtn_smsvo_time "Time"
+
+// d: Heading in the details view.
+// l: list_single_heading_pane_t2
+//
+#define qtn_smsvo_call_back "Call back"
+
+// d: Heading in the details view.
+// l: list_single_heading_pane_t2
+//
+#define qtn_smsvo_text "Text"
+
+// d: Displayed in the main view in a list pane for double item
+// d: instead of qtn_smsvo_call_voicemail in CDMA
+// l: list_double_pane_t1_cp2
+//
+#define qtn_smsvo_mailbox_number "Mailbox number"
+
+
+
+// d: Displayed in the main view in a list pane for double item
+// d: (the other item is the vmbx address)
+// l: list_double_pane_t1
+//
+#define qtn_voip_mailbox "Internet call voice mailbox"
+
+// d: When vmbx address is not defined, this text is shown in the place of it.
+// l: list_double_pane_t2
+//
+#define qtn_voip_mailbox_empty "no address"
+
+// d: Command in options list in Vmbx. 
+// d: Changes voice mailbox address that was not defined earlier.
+// l: list_single_pane_t1_cp2
+//
+#define qtn_voip_define_mailbox_address "Define address"
+
+// d: Command in options list in Vmbx. 
+// d: Changes voice mailbox address that was already defined earlier.
+// l: list_single_pane_t1_cp2
+//
+#define qtn_voip_change_address "Change address"
+
+// d: Command in options list in Vmbx. 
+// d: Calls Int. voice mailbox.
+// l: list_single_pane_t1_cp2
+//
+#define qtn_voip_call_mailbox "Call Int. voice mailbox"
+
+// d: Text for calling voice mail in the options menu.
+// l: list_single_pane_t1_cp2
+// w:
+// r: 2.8
+//
+#define qtn_jpn_vmail_options_call_voice_mail "Call voice mail"
+
+// d: Text for activating voice mail in the options menu.
+// l: list_single_pane_t1_cp2
+// w:
+// r: 2.8
+//
+#define qtn_jpn_vmail_options_activate "Activate"
+
+// d: Text for cancelling voice mail in the options menu.
+// l: list_single_pane_t1_cp2
+// w:
+// r: 2.8
+//
+#define qtn_jpn_vmail_options_cancel "Cancel"
+
+// d: Text for voice mail status checking in the options menu.
+// l: list_single_pane_t1_cp2
+// w:
+// r: 2.8
+//
+#define qtn_jpn_vmail_options_status "Check Status"
+
+// d: Text for voice mail message checking in the options menu.
+// l: list_single_pane_t1_cp2
+// w:
+// r: 2.8
+//
+#define qtn_jpn_vmail_options_check_message "Check Message"
+
+// d: Text for voice mail main pane.
+// l: list_double2_pane
+// w:
+// r: 2.8
+//
+#define qtn_jpn_vmail_list_voice_mail "Voice mail"
+
+// d: Text for application title
+// l: title_pane_t2/opt9
+// w:
+// r: 2.8
+//
+#define qtn_jpn_vmail_title_voice_mail "Voice mail"
+
+// d: Text for activation title
+// l: heading_pane_t1
+// w:
+// r: 2.8
+//
+#define qtn_jpn_vmail_lbl_ringing_time "Ringing time:"
+
+// d: Text for items in activation list
+// l: list_single_pane_t1
+// w:
+// r: 2.8
+//
+#define qtn_jpn_vmail_sublist_seconds "%N seconds"
+
+// d: Displayed in the main view in a list pane for double item
+// d: (the other item is the vmbx number)
+// l: list_single_pane_t1
+// r: 3.1
+//
+#define qtn_smsvi_list_video_mailbox "Call videomail"
+
+// d: Command in options list in Vmbx. 
+// d: Calls video mailbox.
+// l: list_single_pane_t1_cp2
+// r: 3.1
+//
+#define qtn_smsvi_call_videomail_opt "Call video call mailbox"
+
+
+
+// d: Text in middle soft key (general purposes texts).
+// l:control_pane_t3/opt7
+// w:
+// r: 3.2
+//
+#define qtn_msk_call_cs_vmbx "Call"
+
+// d: Text in middle soft key (general purposes texts).
+// l:control_pane_t3/opt7
+// w:
+// r: 3.2
+//
+#define qtn_msk_call_video_mbx "Call"
+
+// d: Text in middle soft key (general purposes texts).
+// l:control_pane_t3/opt7
+// w:
+// r: 3.2
+//
+#define qtn_msk_call_voip_vmbx "Call"
+
+// d: Text in middle soft key (general purposes texts).
+// l:control_pane_t3/opt7
+// w:
+// r: 3.2
+//
+#define qtn_msk_define_video_mbx_number "Define"
+
+
+// d: Text in middle soft key (general purposes texts).
+// l:control_pane_t3/opt7
+// w:
+// r: 3.2
+//
+#define qtn_msk_define_cs_vmbx_number "Define"
+
+// d: Text in middle soft key (general purposes texts).
+// l:control_pane_t3/opt7
+// w:
+// r: 3.2
+//
+#define qtn_msk_define_voip_mbx_address "Define"
+
+// d: Displayed in the main view in a list pane for double item
+// d: (the other item is the vmbx number)
+// l: list_double_pane_t1
+// r:VoIP Rel3.0 
+//
+#define qtn_voip_list_mailbox_name "%U mailbox"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/rom/Vmbx.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* 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:  IBY file for Voice mailbox
+ *
+*/
+
+#ifndef __VMBX_IBY__
+#define __VMBX_IBY__
+
+//Vmbx.app
+S60_APP_EXE(Vm)
+S60_APP_AIF_ICONS(Vm)
+S60_APP_AIF_RSC(Vm)
+S60_APP_BITMAP(Vm)
+
+// sis stub file
+data=ZSYSTEM\install\vm_stub.sis    System\Install\vm_stub.sis
+
+// Application registration resource file
+data=ZPRIVATE\10003a3f\apps\vm_reg.rsc       private\10003a3f\import\apps\vm_reg.rsc
+
+#endif  // __VMBX_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/rom/VmbxResources.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,24 @@
+/*
+* 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:  IBY file for those parts of voice mailbox that needs localization 
+ *
+*/
+
+#ifndef __VMBXRESOURCES_IBY__
+#define __VMBXRESOURCES_IBY__
+
+S60_APP_CAPTION(VM)
+S60_APP_RESOURCE(Vm)
+
+#endif  // __VMBXRESOURCES_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/rom/gsvmbxplugin.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  gsvmbxplugin ROM resources.
+*
+*/
+
+#ifndef GSVMBXPLUGIN_IBY
+#define GSVMBXPLUGIN_IBY
+
+ECOM_PLUGIN( gsvmbxplugin.dll, 2000B4D6.rsc )
+data=DATAZ_\BITMAP_DIR\gsvmbxplugin.mif BITMAP_DIR\gsvmbxplugin.mif
+
+#endif // GSVMBXPLUGIN_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/rom/gsvmbxpluginresources.iby	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,24 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  gsvmbxplugin ROM resources.
+*
+*/
+
+#ifndef GSVMBXPLUGINRESOURCES_IBY
+#define GSVMBXPLUGINRESOURCES_IBY
+
+data=DATAZ_\RESOURCE_FILES_DIR\gsvmbxpluginrsc.rsc RESOURCE_FILES_DIR\gsvmbxpluginrsc.rsc
+
+#endif // GSVMBXPLUGINRESOURCES_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/src/VmApp.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Voice mailbox application.
+*
+*/
+
+
+// INCLUDE FILES
+#include "VmApp.h"
+#include "VmDocument.h"
+#include <eikstart.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVmApp::AppDllUid
+// Returns application UID
+// -----------------------------------------------------------------------------
+//
+TUid CVmApp::AppDllUid() const
+    {
+    return KUidvm;
+    }
+
+// -----------------------------------------------------------------------------
+// CVmApp::CreateDocumentL
+// Creates CVmDocument object
+// -----------------------------------------------------------------------------
+//
+CApaDocument* CVmApp::CreateDocumentL()
+    {
+    return CVmDocument::NewL( *this );
+    }
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// NewApplication
+// Constructs CVmApp
+// Returns: CApaDocument*: created application object
+// -----------------------------------------------------------------------------
+//
+LOCAL_C CApaApplication* NewApplication()
+    {
+    return new CVmApp;
+    }
+
+// -----------------------------------------------------------------------------
+// E32Main implements
+// It is called when executable is started. 
+// Returns: error code.
+// -----------------------------------------------------------------------------
+//
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication( NewApplication );
+    }
+
+
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/src/VmAppUi.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,763 @@
+/*
+* 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 CVmAppUi
+*                class member functions.
+*
+*/
+
+
+// INCLUDE FILES
+#include "VoiceMailboxAppPrivateCRKeys.h"
+#include "voicemailboxdomaincrkeys.h"
+#include "VmAppUi.h"
+
+#include "VmApp.h"
+
+#include "VmContainer.h"
+
+#include <e32property.h>
+#include <PSVariables.h>
+#include "VmQueryLauncher.h"
+#include <vm.rsg>
+
+#include "vm.hrh"
+
+#include <eiklabel.h>
+#include <aknlists.h>
+#include <aknnotedialog.h>
+#include <eikmenup.h>
+#include <AknGlobalNote.h>
+#include <AknQueryDialog.h>
+#include <AknQueryValuePhone.h>
+#include <avkon.mbg>
+
+#include <AiwCommon.hrh>    //KAiwCmdCall
+#include <AiwServiceHandler.h>      //For Application InterWorking
+#include <csxhelp/smsvo.hlp.hrh>  // for help context
+#include <hlplch.h>  // for HlpLauncher
+#include <featmgr.h>  // Feature Manager
+
+#include <aknnotewrappers.h>
+#include <StringLoader.h>
+
+#ifdef __BT_SAP
+#include <BTSapDomainPSKeys.h>
+#endif
+#include <centralrepository.h>
+
+#include "VmDetailsDialog.h"
+#include <AknNotify.h>
+#include <AknNotifyStd.h>
+#include "VMBLogger.h"
+#include <gsfwviewuids.h> // For General Settings application UID
+
+const TInt KVmHelpArraySize = 1;
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVmAppUi::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CVmAppUi::ConstructL()
+    {
+    BaseConstructL( 
+    EAknEnableSkin | EAknEnableMSK | EAknSingleClickCompatible );
+    FeatureManager::InitializeLibL();
+    iFeatureManagerInitialized = ETrue;
+    iAppUiState = EIdle;
+
+#ifdef __BT_SAP
+    if ( FeatureManager::FeatureSupported( KFeatureIdBtSap ) )
+        {
+        TInt sapState( 0 );
+        TInt error = RProperty::Get( KPSUidBluetoothSapConnectionState,
+                                     KBTSapConnectionState,
+                                     sapState );
+        if (  error == KErrNone )
+            {
+            if ( sapState == EBTSapConnected )
+                {
+                HBufC* informationNoteTxt = StringLoader::LoadLC(
+                                                       R_OFFLINE_NOT_POSSIBLE_SAP );
+                TPtrC note = informationNoteTxt->Des();
+                CAknGlobalNote* globalNote = CAknGlobalNote::NewLC();
+                globalNote->SetGraphic( EMbmAvkonQgn_note_info,
+                                                      EMbmAvkonQgn_note_info_mask );
+                globalNote->ShowNoteL( EAknGlobalErrorNote, note );
+                CleanupStack::PopAndDestroy( globalNote );
+                Exit();
+                }
+            }
+        }
+#endif //__BT_SAP
+
+    iFromGS = IsStartedFromGSL();
+
+    iAppContainer = new (ELeave) CVmContainer();
+
+    iServiceHandler = CAiwServiceHandler::NewL();
+    iAppContainer->ConstructL( ClientRect(), iServiceHandler );
+    AddToStackL( iAppContainer );
+    iServiceHandler->AttachMenuL( R_VM_MENU, R_VMBX_APP_INTEREST );
+
+    CEikMenuPane* temp =
+                (CEikonEnv::Static())->AppUiFactory()->MenuBar()->MenuPane();
+
+    _LIT(KNull, "");
+    AddMenuItemL( temp, KNull, EVmCmdAiwPlaceholder );
+
+    iServiceHandler->InitializeMenuPaneL( *temp, R_VM_MENU, EVmCmdAiwCmdLast,
+                                         iServiceHandler->InParamListL() );
+
+    // fetch some localised texts from resources
+    iTextCallVoiceMail = iEikonEnv->AllocReadResourceL( R_MENU_CALL_VOICEMAIL );
+
+    iTextDefineNumber = iEikonEnv->AllocReadResourceL( R_MENU_DEFINE_NUMBER );
+    iTextChangeNumber = iEikonEnv->AllocReadResourceL( R_MENU_CHANGE_NUMBER );
+    iTextClearIcon = StringLoader::LoadL( R_CLEAR_ICON );
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) )
+        {
+        iTextCallVideoMail = iEikonEnv->AllocReadResourceL(
+            R_MENU_CALL_VIDEOMAIL );
+        iTextDefineVideoNumber = iEikonEnv->AllocReadResourceL(
+            R_MENU_DEFINE_VIDEO_NUMBER );
+        }
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
+        {
+        iTextCallIntVoiceMail =
+                      iEikonEnv->AllocReadResourceL( R_MENU_CALL_INT_MAILBOX );
+        }
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdProtocolCdma ) )
+        {
+        iTextShowDetails = StringLoader::LoadL( R_OPEN_DETAILS );
+        }
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+        {
+        iTextHelp = iEikonEnv->AllocReadResourceL( R_MENU_HELP );
+        }
+
+    iTextExit = iEikonEnv->AllocReadResourceL( R_MENU_EXIT );
+
+    if ( !iAppContainer->IsVideoSupported() )
+        {
+        // If the vmbx number is not defined, query it as soon as
+        // the app has been fully constructed.
+        if ( !iAppContainer->Number().Length() &&
+             !IsIpVoiceMailboxServices() )
+            {
+            // Query cs vmbx number since ip vmbx address cannot be asked
+            iAppContainer->QueryNumberL( EVmbxNotDefinedQuery );
+            }
+        }
+    else
+        {
+        if ( !iAppContainer->Number().Length() &&
+             !iAppContainer->VideoNumber().Length() &&
+             !IsIpVoiceMailboxServices() )
+            {
+            iQueryLauncher = CVmQueryLauncher::NewL( *iAppContainer, *this );
+            iAppUiState = ELauncherQueryingNumber;
+            }
+        }
+
+    DrawCbaButtonsL();
+    }
+
+// -----------------------------------------------------------------------------
+// CVmAppUi::~CVmAppUi
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CVmAppUi::~CVmAppUi()
+    {
+    if ( iServiceHandler )
+        {
+        delete iServiceHandler;
+        }
+
+    if ( iQueryLauncher )
+        {
+        iQueryLauncher->Cancel();
+        delete iQueryLauncher;
+        }
+
+    if ( iAppContainer )
+        {
+        RemoveFromStack( iAppContainer );
+        delete iAppContainer;
+        }
+    delete iTextCallVoiceMail;
+    delete iTextDefineNumber;
+    delete iTextDefineVideoNumber;
+    delete iTextChangeNumber;
+    delete iTextShowDetails;
+    delete iTextClearIcon;
+    delete iTextCallVideoMail;
+    delete iTextCallIntVoiceMail;
+
+    delete iTextHelp;
+    delete iTextExit;
+
+    if ( iFeatureManagerInitialized )
+        {
+        FeatureManager::UnInitializeLib();
+        }
+    }
+
+// ------------------------------------------------------------------------------
+// CVmAppUi::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
+//  This function is called by the UIKON framework just before it displays
+//  a menu pane. Menu items are created.
+// ------------------------------------------------------------------------------
+void CVmAppUi::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
+    {
+    VMBLOGSTRING( "VMBX: CVmAppUi::DynInitMenuPaneL: =>" );
+
+    iServiceHandler->InitializeMenuPaneL( *aMenuPane,
+                                            aResourceId,
+                                            EVmCmdAiwCmdLast,
+                                            iServiceHandler->InParamListL() );
+
+    if ( aResourceId == R_VM_MENU )
+        {
+        aMenuPane->SetItemDimmed( KVmCmdAiwVoiceCall, ETrue );
+
+        if ( FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) )
+            {
+            aMenuPane->SetItemDimmed( KVmCmdAiwVideoCall, ETrue );
+            }
+
+        if ( iAppContainer->IsVoIPProfilesFound() )
+            {
+            // Internet call command id is same as video call command id
+            // when video call is not supported. There is no video call
+            // option in menu when video call is not supported.
+            TInt intCallMenuPosition =
+                FeatureManager::FeatureSupported(
+                KFeatureIdCsVideoTelephony ) ?
+                KVmCmdAiwVoipCall :
+                KVmCmdAiwVideoCall;
+
+            aMenuPane->SetItemDimmed( intCallMenuPosition,ETrue );
+            }
+
+        TInt currentItem = iAppContainer->CurrentItem();
+        VMBLOGSTRING2( "VMBX: CVmAppUi::DynInitMenuPaneL:currentItem=%d",
+                currentItem );
+        switch ( currentItem )
+            {
+            case EVmbxVoiceMailboxNumberInd:
+                {
+                if ( iAppContainer->Number().Length() )
+                    {
+                    AddMenuItemL( aMenuPane, *iTextCallVoiceMail,
+                                  EvmCmdCallVoiceMail );
+                    
+                    if ( iAppContainer->AllowedToChangeTheNumber() )
+                        {
+                        AddMenuItemL( aMenuPane, *iTextChangeNumber,
+                                      EvmCmdChangeNumber );
+                        }
+                    }
+                else 
+                    {
+                    if ( iAppContainer->AllowedToChangeTheNumber() )
+                        {
+                        AddMenuItemL( aMenuPane, *iTextDefineNumber, 
+                                      EvmCmdChangeNumber );
+                        }
+                    }
+                break;
+                }
+                
+            case EVmbxVideoMailboxNumberInd:
+                {                    
+                if ( iAppContainer->IsVideoSupported() )
+                    {
+                    if ( iAppContainer->VideoNumber().Length() )
+                        {
+                        AddMenuItemL( aMenuPane, *iTextCallVideoMail,
+                                      EvmCmdCallVideoMail );
+                        if ( iAppContainer->AllowedToChangeTheNumber() )
+                            {
+                            AddMenuItemL( aMenuPane, *iTextChangeNumber,
+                                          EvmCmdChangeVideoNumber );
+                            }
+                        }
+                    else
+                        {
+                        if ( iAppContainer->AllowedToChangeTheNumber() )
+                            {
+                            AddMenuItemL( aMenuPane, *iTextDefineVideoNumber,
+                                          EvmCmdChangeVideoNumber );
+                            }
+                        }
+                    }
+                break;
+                }
+                    
+            case EVmbxIntCallVoiceMailboxNumberInd:
+                {
+                if ( iAppContainer->IsIpVoiceMailboxServices() )
+                    {
+                    AddMenuItemL( aMenuPane, *iTextCallIntVoiceMail,
+                                  EvmCmdCallIntVoiceMail );
+                    }
+                break;
+                }
+                
+            // CDMA specific:
+
+            case EVmbxVoiceMessageAmountInd:
+                {
+                if ( FeatureManager::FeatureSupported( KFeatureIdProtocolCdma ) )
+                    {
+                    if ( iAppContainer->Number().Length() )
+                        {
+                        AddMenuItemL( aMenuPane, *iTextCallVoiceMail,
+                                      EvmCmdCallVoiceMail );
+                        }
+                    }
+                break;
+                }
+            
+            case EVmbxDetailsOfLastMessageInd:
+                {
+                if ( FeatureManager::FeatureSupported( KFeatureIdProtocolCdma ) )
+                    {
+                    AddMenuItemL( aMenuPane, *iTextShowDetails,
+                                  EvmCmdShowLastMessageDetails );
+                    }
+                break;
+                }
+
+
+            default:
+                {
+                break;
+                }
+            }
+
+        if ( iAppContainer->IsClearIcon() )
+            {
+            AddMenuItemL( aMenuPane, *iTextClearIcon, EvmCmdClearIcon );
+            }
+
+        // Check if help feature is available
+        if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+            {
+            AddMenuItemL( aMenuPane, *iTextHelp, EAknCmdHelp );
+            }
+
+        AddMenuItemL( aMenuPane, *iTextExit, EAknCmdExit );
+        }
+
+    VMBLOGSTRING( "VMBX: CVmAppUi::DynInitMenuPaneL: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmAppUi::AddMenuItemL
+// Adds an item in menu
+// -----------------------------------------------------------------------------
+//
+void CVmAppUi::AddMenuItemL( CEikMenuPane* aMenuPane,
+                                                 const TDesC& aText,
+                                                             TInt aCommandId )
+    {
+    VMBLOGSTRING( "VMBX: CVmAppUi::AddMenuItemL=>" ); 
+    CEikMenuPaneItem::SData data;
+    data.iCascadeId = 0;
+    data.iFlags = 0;
+    data.iCommandId = aCommandId;
+    data.iText = aText;
+    aMenuPane->AddMenuItemL( data );
+    if ( aText.Length() 
+         && ( EAknCmdExit != aCommandId ) 
+         && ( EAknCmdHelp != aCommandId ) )
+        {
+        SetItemSpecificL( aMenuPane, aCommandId );
+        }
+    VMBLOGSTRING2( "VMBX: CVmAppUi::AddMenuItemL:aCommandId=%d",aCommandId );
+    VMBLOGSTRING( "VMBX: CVmAppUi::AddMenuItemL<=" ); 
+    }
+
+// -----------------------------------------------------------------------------
+// CVmAppUi::HandleCommandL
+// Handles menu commands and softkey-exit
+// -----------------------------------------------------------------------------
+//
+void CVmAppUi::HandleCommandL( TInt aCommand )
+    {
+    VMBLOGSTRING( "VMBX: CVmAppUi::HandleCommandL: =>" );
+    switch ( aCommand )
+        {
+        case EEikCmdExit:
+        case EAknSoftkeyExit:
+        case EAknSoftkeyBack:
+            {
+            Exit();
+            break;
+            }
+        case EVmCbaMskDefVoMbx:
+        case EvmCmdChangeNumber:
+            {
+            if ( !iAppContainer->AllowedToChangeTheNumber() )
+                {
+                User::Leave( KErrNotSupported );
+                }
+            if ( ELauncherQueryingNumber != iAppUiState )
+                {
+                iAppContainer->QueryNumberL( EVmbxChangeNumberQuery );
+                DrawCbaButtonsL();
+                }
+            break;
+            }
+
+        case EVmCbaMskCallVoipMbx:
+        case EvmCmdCallIntVoiceMail:
+           {
+            if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
+                {
+                iAppContainer->CallIntVoiceMailBoxL();
+                }
+
+            break;
+            }
+
+        case EAknCmdHelp:
+            {
+            if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(),
+                                                            AppHelpContextL() );
+                }
+            break;
+            }
+
+        case EVmCbaMskCallVoMbx:
+        case EvmCmdCallVoiceMail:
+            {
+            iAppContainer->CallVoiceMailBoxL();
+            break;
+            }
+
+        case EvmCmdShowLastMessageDetails:
+            {
+            CVmDetailsDialog* dlg = CVmDetailsDialog::NewL();
+            dlg->ExecuteLD( R_VMBX_DETAIL_DIALOG );
+            break;
+            }
+
+        case EvmCmdClearIcon:
+            {
+            // Reset counter to 0 in SD
+            iAppContainer->ResetVoicemailMessageCounterL();
+
+            // Show confirmation note:
+            HBufC* noteText = StringLoader::LoadLC( R_VOICEMAIL_CLEARED );
+
+            CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote();
+            note->ExecuteLD( *noteText );
+
+            CleanupStack::PopAndDestroy( noteText );
+            break;
+            }
+
+        case EVmCbaMskDefViMbx:
+        case EvmCmdChangeVideoNumber:
+            {
+            if ( ELauncherQueryingNumber != iAppUiState )
+                {
+                iAppContainer->QueryVideoNumberL( EVmbxChangeNumberQuery );
+                DrawCbaButtonsL();
+                }
+            break;
+            }
+
+        case EVmCbaMskCallViMbx:
+        case EvmCmdCallVideoMail:
+            {
+            iAppContainer->CallVideoMailBoxL();
+            break;
+            }
+        default:
+            break;
+        }
+    VMBLOGSTRING( "VMBX: CVmAppUi::HandleCommandL: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmAppUi::HelpContextL
+// Returns the help context
+// -----------------------------------------------------------------------------
+//
+CArrayFix<TCoeHelpContext>* CVmAppUi::HelpContextL() const
+    {
+    CArrayFixFlat<TCoeHelpContext>* array =
+                   new( ELeave ) CArrayFixFlat<TCoeHelpContext>( KVmHelpArraySize );
+
+    // Cannot leave because the buffer for the appended item is allocated
+    // in the constructor.
+    array->AppendL( TCoeHelpContext( KUidvm, KSMSVO_HLP_MAIN_VIEW ) );
+
+    return array;
+    }
+
+// -----------------------------------------------------------------------------
+// CVmAppUi::DrawCbaButtonsL
+// Loads the appropriate CBA buttons for MSK.
+// -----------------------------------------------------------------------------
+//
+void CVmAppUi::DrawCbaButtonsL()
+    {
+    VMBLOGSTRING( "VMBX: CVmAppUi::DrawCbaButtonsL: =>" );
+
+    CEikButtonGroupContainer* cba = Cba();
+    TInt currentItem = iAppContainer->CurrentItem();
+    TInt resourceId = 0;
+
+    switch ( currentItem )
+        {
+        case EVmbxVoiceMailboxNumberInd:
+            {
+            if ( !iAppContainer->Number().Length())
+                {
+                if ( iFromGS )
+                    {
+                    if ( iAppContainer->AllowedToChangeTheNumber() )
+                        {
+                        resourceId = R_VMBX_GS_CBA_DEFINE_VO_NUMBER;
+                        }
+                    else
+                        {
+                        resourceId = R_VMBX_GS_CBA_NOTALLOW_DEFINE_VO_NUMBER;
+                        }
+                    }
+                else
+                    {
+                    if ( iAppContainer->AllowedToChangeTheNumber() )
+                        {
+                        resourceId = R_VMBX_CBA_DEFINE_VO_NUMBER;
+                        }
+                    else
+                        {
+                        resourceId = R_VMBX_CBA_NOTALLOW_DEFINE_VO_NUMBER;
+                        }
+                    }
+                }
+            else
+                {
+                if(iFromGS)
+                    {
+                    resourceId = R_VMBX_GS_CBA_CALL_VO_MAILBOX;
+                    }
+                else
+                    {
+                    resourceId = R_VMBX_CBA_CALL_VO_MAILBOX;
+                    }
+                }
+            break;
+            }
+        case EVmbxVideoMailboxNumberInd:
+            {
+            if ( !iAppContainer->VideoNumber().Length() )
+                {
+                if ( iFromGS )
+                    {
+                    if ( iAppContainer->AllowedToChangeTheNumber() )
+                        {
+                        resourceId = R_VMBX_GS_CBA_DEFINE_VI_NUMBER;
+                        }
+                    else
+                        {
+                        resourceId = R_VMBX_GS_CBA_NOTALLOW_DEFINE_VI_NUMBER;
+                        }
+                    }
+                else
+                    {
+                    if ( iAppContainer->AllowedToChangeTheNumber() )
+                        {
+                        resourceId = R_VMBX_CBA_DEFINE_VI_NUMBER;
+                        }
+                    else
+                        {
+                        resourceId = R_VMBX_CBA_NOTALLOW_DEFINE_VI_NUMBER;
+                        }
+                    }
+                }
+            else
+                {
+                if ( iFromGS )
+                    {
+                    resourceId = R_VMBX_GS_CBA_CALL_VI_MAILBOX;
+                    }
+                else
+                    {
+                    resourceId = R_VMBX_CBA_CALL_VI_MAILBOX;
+                    }
+                }
+            break;
+            }
+        case EVmbxIntCallVoiceMailboxNumberInd:
+            {
+            if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
+                {
+                if ( iFromGS )
+                    {
+                    resourceId = R_VMBX_GS_CALL_VOIP_MAILBOX;
+                    }
+                else
+                    {
+                    resourceId = R_VMBX_CBA_CALL_VOIP_MAILBOX;
+                    }
+                }
+            break;
+            }
+       default:
+            break;
+        }
+
+    cba->SetCommandSetL( resourceId );
+    cba->DrawDeferred();
+    VMBLOGSTRING( "VMBX: CVmAppUi::DrawCbaButtonsL: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmAppUi::HandleForegroundEventL
+// Handles changes in keyboard focus when an application switches to or from
+// the foreground.
+// -----------------------------------------------------------------------------
+//
+void CVmAppUi::HandleForegroundEventL( TBool aForeground )
+    {
+    if ( aForeground ) // back to foreground
+        {
+        if ( iAppContainer->IsServiceUpdated() )
+            {
+            iAppContainer->UpdateListboxL();
+            }
+
+        // get numbers
+        iAppContainer->UpdateVmbxNumberL();
+        // change state so that FocusChanged will update ListBox fields
+        iAppContainer->UpdateData( ETrue );
+        }
+    CAknAppUi::HandleForegroundEventL( aForeground );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmAppUi::IsStartedFromGSL
+// Defines whether voice mail application is started from general
+// settings or not.
+// -----------------------------------------------------------------------------
+//
+TBool CVmAppUi::IsStartedFromGSL()
+    {
+    TBool result = EFalse;
+    RWsSession ws;
+    User::LeaveIfError( ws.Connect() );
+    CleanupClosePushL( ws );
+
+    // Find the task with uid
+    TApaTaskList taskList( ws );
+    TApaTask task = taskList.FindApp( KUidGS );
+
+    if ( task.Exists() )
+        {
+        // read window group id of general settings
+        TInt gsTaskId = task.WgId();
+
+        // Find task from position 1 (background)
+        TApaTask bgTask = taskList.FindByPos(1);
+
+        // Read window group id of background task
+        TInt bgTaskId = bgTask.WgId();
+
+        if( gsTaskId == bgTaskId )
+        	{
+        	// General settings is straight below voice mail application
+        	// => application is started from general settings
+        	result = ETrue;
+        	}
+        else
+        	{
+        	result = EFalse;
+        	}
+        }
+    else
+    	{
+    	// General settings task does not exist
+    	result = EFalse;
+    	}
+    CleanupStack::PopAndDestroy( ); // ws
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CVmAppUi::NumberQueryComplete
+//
+//
+// -----------------------------------------------------------------------------
+void CVmAppUi::NumberQueryComplete()
+    {
+    iAppUiState = EIdle;
+    }
+
+// -----------------------------------------------------------------------------
+// CVmAppUi::GetAppUiState
+//
+//
+// -----------------------------------------------------------------------------
+TVmbxAppUiState CVmAppUi::GetAppUiState()
+    {
+    return iAppUiState;
+    }
+
+// -----------------------------------------------------------------------------
+// CVmAppUi::IsIpVoiceMailboxServices
+//
+//
+// -----------------------------------------------------------------------------   
+TBool CVmAppUi::IsIpVoiceMailboxServices()
+    {
+    return iAppContainer->IsIpVoiceMailboxServices();
+    }
+
+// -----------------------------------------------------------------------------
+// CVmAppUi::SetItemSpecific
+//
+//
+// -----------------------------------------------------------------------------
+void CVmAppUi::SetItemSpecificL( CEikMenuPane* aMenuPane, TInt aCommandId )
+    {
+    VMBLOGSTRING2( "VMBX: CVmAppUi::SetItemSpecificL:aCommandId=%d =>",
+    aCommandId );
+    if ( aMenuPane )
+        {
+        aMenuPane->SetItemSpecific( aCommandId, ETrue );
+        }
+    else
+        {
+        User::Leave( KErrArgument );
+        }
+    VMBLOGSTRING( "VMBX: CVmAppUi::SetItemSpecificL: <=" );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/src/VmContainer.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,1688 @@
+/*
+* 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 Voice mailbox application.
+*
+*/
+
+// INCLUDE FILES
+#include <aknlists.h>
+#include <AknDef.h>
+#include <AknsUtils.h>
+#include <AknsConstants.h>
+#include <AknsUtils.h>
+#include <AknsBasicBackgroundControlContext.h>
+#include <badesca.h>
+#include <aknkeys.h>
+#include <gulicon.h>
+#include <featmgr.h>
+#include <StringLoader.h>
+#include <data_caging_path_literals.hrh>
+
+#include <PbkFields.hrh>
+#include <PhCltUtils.h>
+#include <AiwServiceHandler.h> //For Application InterWorking
+#include <NumberGrouping.h>
+#include <NumberGroupingCRKeys.h>
+#include <settingsinternalcrkeys.h>
+#include <NetworkHandlingDomainPSKeys.h>
+#include <centralrepository.h>
+#include <AiwDialDataTypes.h>
+#include <aiwdialdataext.h>
+
+#include <spsettings.h>
+#include <vmnumber.h>
+#include <vm.rsg>
+#include <vm.mbg>
+#include "vm.hrh"
+
+#include "VoiceMailboxAppPrivateCRKeys.h"
+#include "voicemailboxdomaincrkeys.h"
+#include "VMBLogger.h"
+#include "VmContainer.h"
+#include "VmApp.h"
+#include "VmAppUi.h"
+
+// CONSTANTS
+
+_LIT( KVmNoIconPrefix, "0\t");       // no icon
+_LIT( KVmSimIconPrefix, "1\t");      // CS icon, number is stored in sim
+_LIT( KVmwCSIconPrefix, "2\t");      // CS icon, number is stored in phone memory
+_LIT( KVmwVideoIconPrefix, "3\t");   // default icon to Video
+_LIT( KVmwVoIPIconPrefix,  "4\t");   // default icon to VoIP
+
+_LIT( KVmSuffix, "\t");
+//for the mbm file
+_LIT( KVmMbmDrive, "Z:");
+_LIT( KVmLibMbmFile, "vm.mbm");
+
+const TInt KVmClearIcon = 0x02;
+const TInt KVmMailboxNumber = 0x04;
+const TInt KVmMessageDetails = 0x08;
+const TInt KVmPrefixLength = 3;
+const TInt KVmIconArraySize = 2;
+const TInt KFormattedCharLength = 3;
+
+// ================= MEMBER FUNCTIONS ==========================================
+
+// -----------------------------------------------------------------------------
+// CVmContainer::CVmContainer
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+
+CVmContainer::CVmContainer()
+    : iArray( 2 ),
+      iVmUiOpts( 0 )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVmContainer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*      Series 60 Customer / ETel
+*      Series 60  ETel API
+*****************************************************/
+void CVmContainer::ConstructL( const TRect& aRect,
+                                           CAiwServiceHandler* aServiceHandler )
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::ConstructL: =>" );
+    CreateWindowL();
+    SetBlank();
+
+    iServiceProviderSettings = CSPSettings::NewL();
+
+    //Create repository and notify handlers.
+    iSession = CRepository::NewL( KCRUidVoiceMailbox );
+    iNotifyHandler1 = CCenRepNotifyHandler::NewL( *this, *iSession,
+                          CCenRepNotifyHandler::EIntKey, KVmMessageCounter );
+    iNotifyHandler2 = CCenRepNotifyHandler::NewL( *this, *iSession,
+                          CCenRepNotifyHandler::EIntKey, KVmSummaryInfoIsSet );
+    iNotifyHandler3 = CCenRepNotifyHandler::NewL( *this, *iSession,
+                          CCenRepNotifyHandler::EIntKey, KVideoMbxSupport );
+    iNotifyHandler1->StartListeningL();
+    iNotifyHandler2->StartListeningL();
+    iNotifyHandler3->StartListeningL();
+
+    FeatureManager::InitializeLibL();
+    iFeatureManagerInitialized = ETrue;
+
+    TInt result( KErrNone );
+    if ( FeatureManager::FeatureSupported( KFeatureIdProtocolCdma ) )
+        {
+        result = iSession->Get( KVmUIOpts, iVmUiOpts );
+
+        if ( result != KErrNone )
+            {
+            if ( result == KErrNotFound )
+                {
+                iVmUiOpts = 0;
+                }
+            else
+                {
+                VMBLOGSTRING2( "VMBX: CVmContainer::ConstructL: CenRep error: %d", result );
+                User::Leave( result );
+                }
+            }
+        }
+
+    result = iSession->Get( KVideoMbxSupport, iIsVideoSupported );
+    if ( result != KErrNone )
+        {
+        iIsVideoSupported = EFalse;
+        }
+
+    // connect to phoneclient
+    iServiceHandler  = aServiceHandler;
+
+    // open vmbx number interface
+    User::LeaveIfError( iVmbxNumber.Open() );
+
+    // get the vmbx number of the active ALS line
+    TInt ret( iVmbxNumber.GetVmbxNumber( iNumber ) );
+
+    if ( ret != KErrNone && ret != KErrNotFound )
+        {
+        User::Leave( ret );
+        }
+
+    if ( IsVideoSupported() )
+        {
+        // get the video mailbox number of the active ALS line
+        ret = iVmbxNumber.GetVideoMbxNumber( iVideoNumber );
+        if ( ret != KErrNone && ret != KErrNotFound )
+             {
+             User::Leave( ret );
+             }
+        }
+
+    TInt pngErr( KErrNone );
+    TInt pngSupported( 0 );
+    CRepository* repository = CRepository::NewL( KCRUidNumberGrouping );
+    pngErr = repository->Get( KNumberGrouping, pngSupported );
+    delete repository;
+
+    if ( KErrNone == pngErr && pngSupported != 0 )
+        {
+        iNumberGrouping = CPNGNumberGrouping::NewL( KVmbxMaxNumberLength );
+        }
+
+    // construct the listbox object
+    iListBox = new (ELeave) CAknDoubleGraphicStyleListBox;
+    iListBox->SetContainerWindowL( *this );
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
+        {
+        iListBox->ConstructL( this, EAknListBoxMultiselectionList );
+        }
+    else
+        {
+        iListBox->ConstructL( this, EAknListBoxSelectionList );
+        }
+
+    // load the two localised strings for the listbox
+    if (  FeatureManager::FeatureSupported( KFeatureIdProtocolCdma ) )
+        {
+        iLine1 = StringLoader::LoadL( R_MAILBOX_NUMBER );
+        }
+    else
+        {
+        iLine1 = iEikonEnv->AllocReadResourceL( R_CALL_VOICEMAIL );
+        }
+    iLine2 = iEikonEnv->AllocReadResourceL( R_NUMBER_PANE_EMPTY );
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) )
+        {
+        iVideoLine1 = iEikonEnv->AllocReadResourceL( R_CALL_VIDEOMAIL );
+        iVideoLine2 = iEikonEnv->AllocReadResourceL( R_NUMBER_PANE_EMPTY );
+        }
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
+        {
+        iLine3 = iEikonEnv->AllocReadResourceL( R_INT_CALL_VOICEMAIL );
+        iLine4 = iEikonEnv->AllocReadResourceL( R_ADDRESS_PANE_EMPTY );
+        }
+
+    FillIndArray();
+
+    // Set the text in the listbox
+    // First create space for the items
+    for ( TInt i = 0; i < iIndArray.Count(); i++ )
+        {
+        iArray.AppendL( KNullDesC );
+        }
+
+    //construct the list icon array, empty icon and sim icon
+    ConstructIconsForListboxL();
+    //set the icon array to the list box
+    iListBox->ItemDrawer()->FormattedCellData()->SetIconArrayL( iListIcons );
+    iListBox->SetListBoxObserver( this );
+
+    // New voice messages
+    UpdateNewVoiceMessagesInListBoxL();
+
+    // Voice mailbox number
+    UpdateVmbxNumberInListBoxL();
+
+    // Details
+    UpdateLastMessageDetailsInListBoxL();
+
+    iListBox->Model()->SetItemTextArray( &iArray );
+    iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    iListBox->ItemDrawer()->FormattedCellData()->EnableMarqueeL( ETrue );
+    iListBox->CreateScrollBarFrameL( ETrue );
+    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
+                        CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
+
+    TRect rect( 0, 0, 0, 0 );
+    // Temporary rect is passed. Correct rect is set in SizeChanged.
+    iSkinContext = CAknsBasicBackgroundControlContext::NewL(
+        KAknsIIDQsnBgAreaMainCalc, rect, EFalse );
+
+    SetRect( aRect );
+    ActivateL();
+    DrawNow();
+
+    // request notify on ALS line changes
+    iVmbxNumber.NotifyAlsLineChangeL( this );
+
+    // request notify on vmbx number changes
+    iVmbxNumber.NotifyVmbxNumberChangeL( this, ETrue );
+
+    // request notify on Service changes
+    iVmbxNumber.NotifyServiceChange( this );
+
+    UpdateData( EFalse );
+    iIsCallOngoing = EFalse;
+
+    VMBLOGSTRING( "VMBX: CVmContainer::ConstructL: <=" );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVmContainer::~CVmContainer
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CVmContainer::~CVmContainer()
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::~CVmContainer: =>" );
+
+    delete iServiceProviderSettings;
+    
+    delete iListBox;
+
+    iArray.Reset();
+    
+    delete iLine1;
+    delete iLine2;
+    delete iVideoLine1;
+    delete iVideoLine2;
+    delete iLine3;
+    delete iLine4;
+    
+   
+    iVmbxNumber.NotifyServiceChangeCancel();
+
+    iVmbxNumber.Close();
+    if ( iNotifyHandler1 )
+        {
+        iNotifyHandler1->StopListening();
+        delete iNotifyHandler1;
+        }
+
+    if ( iNotifyHandler2 )
+        {
+        iNotifyHandler2->StopListening();
+        delete iNotifyHandler2;
+        }
+    
+    if ( iNotifyHandler3 )
+        {
+        iNotifyHandler3->StopListening();
+        delete iNotifyHandler3;
+        }
+
+    delete iSession;
+    delete iNumberGrouping;
+
+    iIndArray.Close();
+
+    if ( iFeatureManagerInitialized )
+        {
+        FeatureManager::UnInitializeLib();
+        }
+
+    delete iSkinContext;
+
+    VMBLOGSTRING( "VMBX: CVmContainer::~CVmContainer: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::SizeChanged
+// Called by framework when the view size is changed
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::SizeChanged()
+    {
+    if ( iSkinContext )
+        {
+        iSkinContext->SetRect( TRect( TPoint( 0, 0 ), Rect().Size() ) );
+        }
+    AknLayoutUtils::LayoutControl( iListBox, Rect(),
+                                        AKN_LAYOUT_WINDOW_list_gen_pane( 0 ) );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::CountComponentControls
+// Gets a count of the component controls
+// -----------------------------------------------------------------------------
+//
+TInt CVmContainer::CountComponentControls() const
+    {
+    if( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
+        {
+        return 2; // the listbox is the only control
+        }
+    else
+        {
+        return 1; // the listbox is the only control
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::ComponentControl
+// Gets an indexed component of a compound control
+// -----------------------------------------------------------------------------
+//
+CCoeControl* CVmContainer::ComponentControl( TInt /*aIndex*/ ) const
+    {
+    return iListBox;
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::AllowedToChangeTheNumber
+// Check wether is possible to edit the voice mailbox number.
+// -----------------------------------------------------------------------------
+//
+TBool CVmContainer::AllowedToChangeTheNumber()
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::AllowedToChangeTheNumber: =>" );
+    VMBLOGSTRING( "VMBX: CVmContainer::AllowedToChangeTheNumber: <=" );
+    return iVmbxNumber.AllowedToChangeTheNumber();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVmContainer::OfferKeyEventL
+// Handles key events
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CVmContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                                             TEventCode aType )
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::OfferKeyEventL: =>" );
+    // For CDMA:
+    if ( FeatureManager::FeatureSupported( KFeatureIdProtocolCdma ) )
+        {
+        if ( aType == EEventKey )
+            {
+            TInt currentItem = CurrentItem();
+            if ( currentItem != KErrNotFound )
+                {
+                if ( aKeyEvent.iCode == EKeyPhoneSend )
+                    {
+                    if ( currentItem == EVmbxVoiceMessageAmountInd
+                                 || currentItem == EVmbxVoiceMailboxNumberInd )
+                        {
+                        CallVoiceMailBoxL();
+                        VMBLOGSTRING( "VMBX: CVmContainer::OfferKeyEventL: Send key" );
+                        return EKeyWasConsumed;
+                        }
+                    }
+
+                if ( aKeyEvent.iCode == EKeyOK )
+                    {
+                    if ( currentItem == EVmbxVoiceMessageAmountInd )
+                        {
+                        CallVoiceMailBoxL();
+                        VMBLOGSTRING( "VMBX: CVmContainer::OfferKeyEventL: OK key" );
+                        return EKeyWasConsumed;
+                        }
+                    else if ( currentItem == EVmbxVoiceMailboxNumberInd )
+                        {
+                        if ( AllowedToChangeTheNumber() )
+                            {
+                            iAvkonAppUi->HandleCommandL( EvmCmdChangeNumber );
+                            }
+                        else
+                            {
+                            CallVoiceMailBoxL();
+                            }
+                        VMBLOGSTRING( "VMBX: CVmContainer::OfferKeyEventL: OK key" );
+                        return EKeyWasConsumed;
+                        }
+                    else if ( currentItem == EVmbxIntCallVoiceMailboxNumberInd &&
+                              FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
+                        {
+                        VMBLOGSTRING( "VMBX: CVmContainer::OfferKeyEventL: OK key" );
+                        return EKeyWasConsumed;
+                        }
+                    else if ( currentItem == EVmbxDetailsOfLastMessageInd )
+                        {
+                        iAvkonAppUi->HandleCommandL( EvmCmdShowLastMessageDetails );
+                        VMBLOGSTRING( "VMBX: CVmContainer::OfferKeyEventL: OK key" );
+                        return EKeyWasConsumed;
+                        }
+                    }
+                }
+            }
+
+        return iListBox->OfferKeyEventL( aKeyEvent, aType );
+        }
+
+    // General variant:
+    if ( aType == EEventKey )
+        {
+        TInt currentItem = CurrentItem();
+        // pressing selection/SEND/enter key initiates a voice call
+        if ( ( aKeyEvent.iCode == EKeyOK
+               || aKeyEvent.iCode == EKeyPhoneSend
+               || aKeyEvent.iCode == EKeyEnter )
+            && ( currentItem == EVmbxVoiceMessageAmountInd
+                 || currentItem == EVmbxVoiceMailboxNumberInd ) )
+            {
+            CallVoiceMailBoxL();
+            }
+        else if ( ( aKeyEvent.iCode == EKeyOK
+                    || aKeyEvent.iCode == EKeyPhoneSend
+                    || aKeyEvent.iCode == EKeyEnter )
+                && ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip )
+                && currentItem != EVmbxVoiceMessageAmountInd
+                && currentItem != EVmbxVoiceMailboxNumberInd
+                && currentItem != EVmbxVideoMailboxNumberInd) )
+            {
+            CallIntVoiceMailBoxL();
+            }
+
+        else if ( IsVideoSupported()
+                  && ( aKeyEvent.iCode == EKeyOK
+                      || aKeyEvent.iCode == EKeyPhoneSend
+                      || aKeyEvent.iCode == EKeyEnter )
+                  && currentItem == EVmbxVideoMailboxNumberInd )
+            {
+            CallVideoMailBoxL();
+            }
+
+        if ( ( aKeyEvent.iCode == EKeyUpArrow || aKeyEvent.iCode == EKeyDownArrow ) &&
+             ( IsVideoSupported() ||
+               FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) ) )
+            {
+            TKeyResponse response( iListBox->OfferKeyEventL( aKeyEvent,
+                                                                    aType ) );
+            iListBox->SetCurrentItemIndex( iListBox->CurrentItemIndex() );
+            ( static_cast <CVmAppUi*>iAvkonAppUi ) ->DrawCbaButtonsL();
+            VMBLOGSTRING2( "VMBX: CVmContainer::OfferKeyEventL: \
+            response = %I", response );
+            return response;
+            }
+        }
+    VMBLOGSTRING( "VMBX: CVmContainer::OfferKeyEventL: <=" );
+    return EKeyWasConsumed;
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::HandleListBoxEventL
+// Handles listbox clicks.
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::HandleListBoxEventL(
+    CEikListBox* /*aListBox*/,
+    TListBoxEvent aEventType)
+    {
+    VMBLOGSTRING( "VMBX: HandleListBoxEventL: =>" );
+    VMBLOGSTRING2( "VMBX: HandleListBoxEventL: aEventType=%d", aEventType );
+    switch ( aEventType )
+        {
+        case EEventItemSingleClicked:
+            {
+            // at begining,if Querying number, 
+            // the key envent should not be response
+            if( ELauncherQueryingNumber != 
+                    ( static_cast <CVmAppUi*>iAvkonAppUi )->GetAppUiState() )
+                {
+                TKeyEvent aKeyEvent;
+                aKeyEvent.iCode = EKeyOK;
+                VMBLOGSTRING( "VMBX: HandleListBoxEventL: OfferKeyEventL" );
+                OfferKeyEventL( aKeyEvent, EEventKey );
+                }
+            VMBLOGSTRING( "VMBX: HandleListBoxEventL: EEventItemSingleClicked" );
+            break;
+            }
+        default:
+            VMBLOGSTRING( "VMBX: HandleListBoxEventL: default" );
+            break;
+        }
+
+    VMBLOGSTRING( "VMBX: HandleListBoxEventL: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::HandleResourceChange
+// Notifier for changing orientation
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::HandleResourceChange( TInt aType )
+    {
+    VMBLOGSTRING( "VMBX: HandleResourceChange: =>" );
+    TRect mainPaneRect ;
+    if ( aType == KEikDynamicLayoutVariantSwitch )
+        {
+        VMBLOGSTRING( "VMBX: HandleResourceChange: DynamicLayout" );
+        iListBox->HandleResourceChange( aType );
+        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,
+                                                                 mainPaneRect );
+        TRAP_IGNORE( CEikonEnv::Static()->AppUiFactory()->StatusPane()->
+                            SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL ) );
+        SetRect( mainPaneRect );
+        DrawNow();
+        }
+    CCoeControl::HandleResourceChange( aType );
+    VMBLOGSTRING( "VMBX: HandleResourceChange: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::Draw
+// Redraw the window owned by this container
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::Draw( const TRect& aRect ) const
+    {
+    VMBLOGSTRING( "VMBX: Draw: =>" );
+    CWindowGc& gc = SystemGc();
+    gc.Clear( aRect );
+
+    // Drawing skin
+    if ( iSkinContext )
+        {
+        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        AknsDrawUtils::Background( skin, iSkinContext, this, gc, aRect );
+        }
+    VMBLOGSTRING( "VMBX: Draw: <=" );
+    }
+// -----------------------------------------------------------------------------
+// CVmContainer::QueryNumberL
+// Queries for a new voice mailbox number. If the query
+// is approved, the listbox is updated.
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::QueryNumberL( TVmbxQueryType aQueryType )
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::QueryNumberL: =>" );
+    TBool ret( EFalse );
+    TRAPD( queryErr, 
+        ret = iVmbxNumber.QueryNumberL( aQueryType, iNumber, ETrue ) );
+
+    if ( KErrNone == queryErr )
+        {
+        if ( ret )
+            {
+            // if the query was approved, update vmbx number
+            UpdateVmbxNumberInListBoxL();
+            (static_cast <CVmAppUi*>iAvkonAppUi) ->DrawCbaButtonsL();
+            iListBox->DrawNow();
+            VMBLOGSTRING( "VMBX: CVmContainer::QueryNumberL: \
+            update vmbx number listbox" );
+            }
+        }
+    else
+        {
+        VMBLOGSTRING2( "VMBX: CVmContainer::QueryNumberL: \
+        queryErr = %d", queryErr );
+        
+        if ( KErrAccessDenied == queryErr )
+            {
+            VMBLOGSTRING( "VMBX: CVmContainer::QueryNumberL: \
+            not allow to change number" );
+            }
+        else
+            {
+            User::Leave( queryErr );
+            }
+        }
+    VMBLOGSTRING( "VMBX: CVmContainer::QueryNumberL: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::UpdateNewVoiceMessagesInListBoxL
+// Updates the new voice message to the listbox
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::UpdateNewVoiceMessagesInListBoxL()
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::UpdateNewVoiceMessagesInListBoxL: =>" );
+    if ( !FeatureManager::FeatureSupported( KFeatureIdProtocolCdma ) )
+        {
+        VMBLOGSTRING( "VMBX: CVmContainer::UpdateNewVoiceMessagesInListBoxL:\
+        Cdma not supported" );
+        return;
+        }
+
+    // First line
+    HBufC* firstLineText = StringLoader::LoadLC( R_VOICE_MESSAGES );
+
+    // Second line
+    HBufC* secondLineText = NULL;
+    TInt voiceMessageAmout = 0;
+
+    TInt err = iSession->Get( KVmMessageCounter, voiceMessageAmout );
+    if ( err != KErrNotFound )
+        {
+        VMBLOGSTRING2( "VMBX: CVmContainer::UpdateNewVoiceMessagesInListBoxL:\
+        CenRep error: %d", err );
+        User::LeaveIfError( err );
+        }
+
+    if ( voiceMessageAmout == 0 )
+        {
+        secondLineText = StringLoader::LoadLC( R_NO_NEW );
+        }
+    else if ( voiceMessageAmout == 1 )
+        {
+        secondLineText = StringLoader::LoadLC( R_NEW_MESSAGES );
+        }
+    else
+        {
+        secondLineText = StringLoader::LoadLC( R_N_NEW, voiceMessageAmout );
+        }
+
+    // Create combination:
+    HBufC* comboText = HBufC::NewLC( firstLineText->Length() +
+                                    secondLineText->Length() +
+                                    KFormattedCharLength ); // 3 special chars
+
+    TPtr comboPtr = comboText->Des();
+    comboPtr.Append( KVmNoIconPrefix );
+    comboPtr.Append( *firstLineText );
+    comboPtr.Append( KVmSuffix );
+    comboPtr.Append( *secondLineText );
+
+    TInt ind = iIndArray.Find( EVmbxVoiceMessageAmountInd );
+    if ( ind != KErrNotFound )
+        {
+        iArray.Delete( ind );
+        iArray.InsertL( ind, comboPtr );
+        }
+
+    CleanupStack::PopAndDestroy( comboText );
+    CleanupStack::PopAndDestroy( secondLineText );
+    CleanupStack::PopAndDestroy( firstLineText );
+    VMBLOGSTRING( "VMBX: CVmContainer::UpdateNewVoiceMessagesInListBoxL: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::UpdateVmbxNumberInListBoxL
+// Updates the vmbx number in the listbox shown on the app screen.
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::UpdateVmbxNumberInListBoxL()
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::UpdateVmbxNumberInListBoxL: =>" );
+    if ( FeatureManager::FeatureSupported( KFeatureIdProtocolCdma ) &&
+        !( iVmUiOpts & KVmMailboxNumber ) )
+        {
+        VMBLOGSTRING( "VMBX: CVmContainer::UpdateNewVoiceMessagesInListBoxL: \
+        Cdma supported or/and no vmbxnumber support" );
+        return;
+        }
+
+    // allocate buffer for icon, title, vmxb number and suffix
+    HBufC* buf = HBufC::NewLC( KVmNoIconPrefix().Length() +
+                               iLine1->Length() +
+                               KVmSuffix().Length() +
+                               KVmbxMaxNumberLength );
+        
+    TPtr bufPtr = buf->Des();
+
+    // listbox formatting
+    if ( iVmbxNumber.IsSimMemory() && iNumber.Length() )
+        {
+        VMBLOGSTRING( "UpdateNewVoiceMessagesInListBoxL::Show SIM icon" );
+        bufPtr.Append( KVmSimIconPrefix );
+        }
+    else
+        {
+        VMBLOGSTRING( "UpdateNewVoiceMessagesInListBoxL::Show CS icon, number stored to phone" );
+        bufPtr.Append( KVmwCSIconPrefix );
+        }
+
+    bufPtr.Append( *iLine1 );  // "Voice Mailbox"-text (localised)
+    bufPtr.Append( KVmSuffix );
+
+    if ( !iNumber.Length() )
+        {
+        bufPtr.Append( *iLine2 );       // "No number"-text (localised)
+        }
+    else
+        {
+        // Convert the phone number to accommodate the current locale
+        TBuf<KVmbxMaxNumberLength> locNumber;
+
+        if ( iNumberGrouping )
+            {
+            iNumberGrouping->Set( iNumber );
+            locNumber.Copy( iNumberGrouping->FormattedNumber() );
+            }
+        else
+            {
+            locNumber.Copy( iNumber );
+            }
+
+        AknTextUtils::LanguageSpecificNumberConversion( locNumber );
+
+        bufPtr.Append( locNumber );
+        }
+
+    TInt ind = iIndArray.Find( EVmbxVoiceMailboxNumberInd );
+    if ( ind  != KErrNotFound )
+        {
+        iArray.Delete( ind );
+        iArray.InsertL( ind, bufPtr );
+        }
+    CleanupStack::PopAndDestroy( buf );
+
+    // ========================================================================
+    // Video Mailbox specific part starts from here
+    // ========================================================================
+
+    if ( IsVideoSupported() )
+        {
+        TInt videoline2MaxLength( iVideoLine2->Length() );
+
+        if ( KVmbxMaxNumberLength > videoline2MaxLength )
+            {
+            videoline2MaxLength = KVmbxMaxNumberLength;
+            }
+
+        // allocate buffer for 2 listbox lines and 3 formatter chars
+        HBufC* videoBuf = HBufC::NewLC( iVideoLine1->Length() +
+                                            videoline2MaxLength +
+                                            KVmNoIconPrefix().Length() +
+                                            KVmSuffix().Length() );
+
+        TPtr videoBufPtr = videoBuf->Des();
+
+        // listbox formatting
+        videoBufPtr.Append( KVmwVideoIconPrefix );
+        videoBufPtr.Append( *iVideoLine1 );  // "Video Mailbox"-text (localised)
+        videoBufPtr.Append( KVmSuffix );
+
+        if ( !iVideoNumber.Length() )
+            {
+            videoBufPtr.Append( *iVideoLine2 );  // "No number"-text (localised)
+            }
+        else
+            {
+            // Convert the phone number to accommodate the current locale
+            TBuf<KVmbxMaxNumberLength> videoLocNumber;
+
+            if ( iNumberGrouping )
+                {
+                iNumberGrouping->Set( iVideoNumber );
+                videoLocNumber.Copy( iNumberGrouping->FormattedNumber() );
+                }
+            else
+                {
+                videoLocNumber.Copy( iVideoNumber );
+                }
+
+            AknTextUtils::LanguageSpecificNumberConversion( videoLocNumber );
+
+            videoBufPtr.Append( videoLocNumber );
+            }
+
+        TInt videoInd = iIndArray.Find( EVmbxVideoMailboxNumberInd );
+        if ( videoInd != KErrNotFound )
+            {
+            iArray.Delete( videoInd );
+            iArray.InsertL( videoInd, videoBufPtr );
+            }
+        CleanupStack::PopAndDestroy( videoBuf );
+        }
+    
+    // ========================================================================
+    // IP Mailbox specific part starts from here
+    // ========================================================================
+    
+    if ( IsIpVoiceMailboxServices() )
+        {
+        // Get all Service Ids
+        RArray<TUint> profileIds;
+        CleanupClosePushL( profileIds );
+        iVmbxNumber.GetServiceIds( profileIds );
+
+        TBuf<KVmbxMaxAddressLength> vmbxAddress;
+
+        for ( TInt i( 0 ); i < profileIds.Count(); i++ )
+            {
+            // Get mailbox name
+            TVmbxServiceInfo serviceInfo;
+            serviceInfo.iServiceId = profileIds[ i ];
+            iVmbxNumber.GetServiceInfo( serviceInfo );
+            HBufC* name = HBufC::NewLC( serviceInfo.iName.Length() );
+            name->Des().Copy( serviceInfo.iName );
+
+            HBufC* mailbox = StringLoader::LoadLC(
+                R_VOIP_LIST_MAILBOX_NAME, name->Des( ) );
+
+            HBufC* buf2 = HBufC::NewLC( mailbox->Length()
+                                        + KVmbxMaxNumberLength
+                                        + KVmNoIconPrefix().Length()
+                                        + KVmSuffix().Length() * 3 );
+            TPtr bufPtr2 = buf2->Des();
+
+            // Brand icon here, if brand icon is not available
+            // use default VoIP icon
+            TInt iconId( KErrNotFound );
+            TRAPD( error, AddBrandIconL( profileIds[ i ], iconId ) );
+
+            if ( KErrNone == error && KErrNotFound != iconId )
+                {
+                bufPtr2.AppendNum( iconId );
+                bufPtr2.Append( KVmSuffix );
+                }
+            else
+                {
+                bufPtr2.Append( KVmwVoIPIconPrefix );
+                }
+
+            // Add Mailbox text
+            bufPtr2.Append( mailbox->Des() );
+            bufPtr2.Append( KVmSuffix );
+
+            // Write address
+            vmbxAddress.Copy( serviceInfo.iAddress );
+
+            if ( !vmbxAddress.Length() )
+                {
+                bufPtr2.Append( *iLine4 );  // "No number"-text (localised)
+                }
+            else
+                {
+                bufPtr2.Append( vmbxAddress );
+                }
+
+            // this corrects SIM icon to the right place
+            bufPtr2.Append( KVmSuffix );
+
+            ind = iIndArray.Find( EVmbxIntCallVoiceMailboxNumberInd );
+            if ( KErrNotFound != ind )
+                {
+                VMBLOGSTRING2( "VMBX: CVmContainer::UpdateVmbxNumberInListBoxL: %S", buf2 );
+                iArray.Delete( ind + i );
+                iArray.InsertL( ind + i, bufPtr2 );
+                }
+
+            CleanupStack::PopAndDestroy( buf2 );
+            CleanupStack::PopAndDestroy( mailbox );
+            CleanupStack::PopAndDestroy( name );
+            }
+        CleanupStack::PopAndDestroy( &profileIds );
+        }
+    VMBLOGSTRING( "VMBX: CVmContainer::UpdateVmbxNumberInListBoxL: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::UpdateLastMessageDetailsInListBoxL
+// Updates the last message details to the listbox
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::UpdateLastMessageDetailsInListBoxL()
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::UpdateLastMessageDetailsInListBoxL: =>" );
+    if ( !FeatureManager::FeatureSupported( KFeatureIdProtocolCdma ) ||
+         !( iVmUiOpts & KVmMessageDetails ) )
+        {
+        VMBLOGSTRING( "VMBX: CVmContainer::UpdateNewVoiceMessagesInListBoxL: \
+         Cdma supported or/and no vmbxdetails support" );
+        return;
+        }
+
+    // Determine the position of this item in the list (if any)
+    TInt ind = iIndArray.Find( EVmbxDetailsOfLastMessageInd );
+
+    // if the last message is not set, hide the item:
+    // 0 = not set
+    // 1 = set.
+    TInt messageSet = 0;
+
+    iSession->Get( KVmSummaryInfoIsSet, messageSet ); // ignore error
+
+    if ( messageSet == 0 )
+        {
+        if ( ind != KErrNotFound )
+            {
+            // remove the item from the list
+            iIndArray.Remove( ind );
+            iArray.Delete( ind );
+            }
+        return;
+        }
+
+    HBufC* resourceText = StringLoader::LoadLC( R_DETAILS_OF_LAST );
+
+    // Three special chars
+    HBufC* detailsText = HBufC::NewLC( KVmPrefixLength +
+                                                    resourceText->Length() );
+    TPtr detailsPtr = detailsText->Des();
+    detailsPtr.Append( KVmNoIconPrefix );
+    detailsPtr.Append( *resourceText );
+    detailsPtr.Append( KVmSuffix );
+    detailsPtr.Append( KNullDesC ); // the second line is empty
+
+    if ( ind == KErrNotFound )
+        {
+        // Add the item back to the list
+        iIndArray.Append( EVmbxDetailsOfLastMessageInd );
+        iArray.AppendL( detailsPtr );
+        }
+
+    CleanupStack::PopAndDestroy( detailsText );
+    CleanupStack::PopAndDestroy( resourceText );
+    VMBLOGSTRING( "VMBX: CVmContainer::\
+    UpdateLastMessageDetailsInListBoxL: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::CallVoiceMailBoxL
+// Calls the vmbx number using PhoneClient.
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*      Series 60 Customer / ETel
+*      Series 60  ETel API
+*****************************************************/
+void CVmContainer::CallVoiceMailBoxL()
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::CallVoiceMailBoxL: =>" );
+
+    if ( !iIsCallOngoing )
+        {
+        AiwCallRequestL( KVmCmdAiwVoiceCall, CAiwDialData::EAIWVoice );
+        }
+
+    VMBLOGSTRING( "VMBX: CVmContainer::CallVoiceMailBoxL: <=" );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVmContainer::CallVoiceMailBoxL
+// Calls the vmbx number using PhoneClient.
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*      Series 60 Customer / ETel
+*      Series 60  ETel API
+*****************************************************/
+void CVmContainer::CallIntVoiceMailBoxL()
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::CallVoiceMailBoxL: =>" );
+
+    if ( !iIsCallOngoing )
+        {
+        AiwCallRequestL( KVmCmdAiwVoipCall, CAiwDialData::EAIWVoiP );
+        }
+
+    VMBLOGSTRING( "VMBX: CVmContainer::CallVoiceMailBoxL: <=" );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVmContainer::HandleNotifyL
+// When user has completed an action to a vmbx number
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::HandleNotifyL( TInt /*aLine*/, const TDesC& aValue )
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::HandleNotifyL: =>" );
+    iNumber.Copy( aValue );
+    UpdateVmbxNumberInListBoxL();
+    (static_cast <CVmAppUi*>iAvkonAppUi) ->DrawCbaButtonsL();
+    iListBox->DrawNow();
+    VMBLOGSTRING( "VMBX: CVmContainer::HandleNotifyL: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::HandleAlsChangeL
+// ALS line changed
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::HandleAlsChangeL( TVmbxAlsLine /*aLine*/ )
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::HandleAlsChangeL: =>" );
+    VMBLOGSTRING( "VMBX: CVmContainer::HandleAlsChangeL: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::UpdateVmbxNumberL
+// Gets the vmbx number from SIM/SharedData and updates it in the display.
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::UpdateVmbxNumberL()
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::UpdateVmbxNumberL: =>" );
+    TInt ret ( iVmbxNumber.GetVmbxNumber( iNumber ) );
+
+    if ( ret == KErrNotFound )
+        {
+        iNumber.Zero();
+        }
+    else if ( ret != KErrNone )
+        {
+        User::LeaveIfError( ret );
+        }
+
+    UpdateVmbxNumberInListBoxL();
+    iListBox->DrawNow();
+    (static_cast <CVmAppUi*>iAvkonAppUi) ->DrawCbaButtonsL();
+    VMBLOGSTRING( "VMBX: CVmContainer::UpdateVmbxNumberL: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::HandleNotifyInt
+// Integer value keys has pressed
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::HandleNotifyInt( TUint32 aKey, TInt aValue )
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::HandleNotifyInt: =>" );
+    if ( aKey == KVmMessageCounter)
+        {
+        TRAPD( err1, UpdateNewVoiceMessagesInListBoxL() );
+        if ( err1 != KErrNone )
+            {
+            _LIT(KVmbxPanicType1,"UpdateNewVoiceMessagesInListBoxL");
+            User::Panic( KVmbxPanicType1, err1 );
+            }
+        iListBox->DrawNow();
+        }
+    else if ( aKey == KVmSummaryInfoIsSet )
+        {
+        TInt currentItem = CurrentItem();
+        if ( currentItem == EVmbxDetailsOfLastMessageInd )
+            {
+            TInt newInd = iIndArray.Find( EVmbxVoiceMailboxNumberInd );
+            if ( newInd != KErrNotFound )
+                {
+                iListBox->SetCurrentItemIndex( newInd );
+                }
+            }
+        TRAPD( err2, UpdateLastMessageDetailsInListBoxL() );
+        if ( err2 != KErrNone )
+            {
+            _LIT(KVmbxPanicType2,"UpdateLastMessageDetailsInListBoxL");
+            User::Panic( KVmbxPanicType2, err2 );
+            }
+        TRAPD( err3, iListBox->HandleItemAdditionL() );
+        if ( err3 != KErrNone )
+            {
+            _LIT(KVmbxPanicType3,"iListBox->HandleItemAdditionL");
+            User::Panic( KVmbxPanicType3, err3 );
+            }
+        }
+    else if ( aKey == KVideoMbxSupport )
+        {
+        iIsVideoSupported = aValue;
+        UpdateData( ETrue );
+        TRAP_IGNORE( UpdateListboxL() );
+        }
+    VMBLOGSTRING( "VMBX: CVmContainer::HandleNotifyInt: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::ResetVoicemailMessageCounterL
+// Resets to zero the voicemail message counter in SD
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::ResetVoicemailMessageCounterL()
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::ResetVoicemailMessageCounterL: =>" );
+
+    TInt err = iSession->Set( KVmMessageCounter, 0 );
+    if ( err != KErrNotFound )
+        {
+        VMBLOGSTRING2( "VMBX: CVmContainer::ResetVoicemailMessageCounterL: \
+        CenRep error: %d", err );
+        User::LeaveIfError( err );
+        }
+
+    UpdateNewVoiceMessagesInListBoxL();
+    iListBox->DrawNow();
+    VMBLOGSTRING( "VMBX: CVmContainer::ResetVoicemailMessageCounterL: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::IsClearIcon
+// Checks if clear icon is set
+// -----------------------------------------------------------------------------
+//
+TBool CVmContainer::IsClearIcon()
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::IsClearIcon: =>" );
+    VMBLOGSTRING( "VMBX: CVmContainer::IsClearIcon: <=" );
+    return iVmUiOpts & KVmClearIcon;
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::FillIndArray
+// Fill array with indications
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::FillIndArray()
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::FillIndArray: =>" );
+    if ( FeatureManager::FeatureSupported( KFeatureIdProtocolCdma ) )
+        {
+        //NewVoiceMessages
+        iIndArray.Append( EVmbxVoiceMessageAmountInd );
+
+        if ( iVmUiOpts & KVmMailboxNumber )
+            {
+            //VmbxNumber
+            iIndArray.Append( EVmbxVoiceMailboxNumberInd );
+            }
+
+         // Details (EVmbxDetailsOfLastMessageInd) are added dynamically in
+         // UpdateLastMessageDetailsInListBoxL, always to the end of the list
+         }
+    else
+        {
+        //VmbxNumber
+        iIndArray.Append( EVmbxVoiceMailboxNumberInd );
+        }
+
+    if ( IsVideoSupported() )
+        {
+        iIndArray.Append( EVmbxVideoMailboxNumberInd );
+        }
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
+        {
+        RArray<TUint> profileIds;
+        iVmbxNumber.GetServiceIds( profileIds );
+
+        for ( TInt i( 0 ); i < profileIds.Count(); i++ )
+            {
+            VMBLOGSTRING( "VMBX: CVmContainer::FillIndArray \
+                           Appending Voip mailbox service" );
+            iIndArray.Append( EVmbxIntCallVoiceMailboxNumberInd );
+            }
+
+        profileIds.Close();
+        }
+    VMBLOGSTRING( "VMBX: CVmContainer::FillIndArray: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::CurrentItem
+// Gets index  of the current item in listbox
+// -----------------------------------------------------------------------------
+//
+TInt CVmContainer::CurrentItem()
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::CurrentItem: =>" );
+    if ( iListBox->CurrentItemIndex() >= iIndArray.Count() )
+        {
+        VMBLOGSTRING( "VMBX: CVmContainer::CurrentItem: \
+        listbox iten not found" );
+        return KErrNotFound;
+        }
+    TInt listBoxCurrentIndex = iListBox->CurrentItemIndex();
+    VMBLOGSTRING2( "VMBX: CVmContainer::CurrentItem: listBoxCurrentIndex=%d",
+    listBoxCurrentIndex );
+    TInt currentItemIndex = iIndArray[ listBoxCurrentIndex ];
+    VMBLOGSTRING2( "VMBX: CVmContainer::CurrentItem: currentItemIndex=%d <=",
+    currentItemIndex );
+    return currentItemIndex;
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::AskTypeL
+// Ask Vmbx type.
+// -----------------------------------------------------------------------------
+//
+TInt CVmContainer::AskTypeL()
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::AskTypeL: =>" );
+    TInt type( EVmbx );
+    
+    if ( IsVideoSupported() )
+        {
+        type = iVmbxNumber.SelectTypeL( EVmbxDefine );
+        }
+    
+    VMBLOGSTRING( "VMBX: CVmContainer::AskTypeL: <=" );
+    return type;
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::IsVoIPProfilesFound
+// Check if VoIP profiles is found.
+// -----------------------------------------------------------------------------
+//
+TBool CVmContainer::IsVoIPProfilesFound()
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::IsVoIPProfilesFound" );
+
+    return iVmbxNumber.IsVoIPProfilesFound();
+   }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::QueryVideoNumberL
+// Queries for a new video mailbox number. If the query
+// is approved, the listbox is updated.
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::QueryVideoNumberL( TVmbxQueryType aQueryType )
+    {
+    if ( IsVideoSupported() )
+        {
+        TBool ret( EFalse );
+        TRAPD( queryErr, 
+            ret = iVmbxNumber.QueryVideoMbxNumberL( aQueryType, iVideoNumber ) );
+
+        if ( KErrNone == queryErr )
+            {
+            if ( ret )
+                {
+                // if the query was approved, update vmbx number
+                UpdateVmbxNumberInListBoxL();
+                (static_cast <CVmAppUi*>iAvkonAppUi) ->DrawCbaButtonsL();
+                iListBox->DrawNow();
+                }
+            }
+         else
+            {
+            VMBLOGSTRING2( "VMBX: CVmContainer::QueryVideoMbxNumberL: \
+            queryErr = %d", queryErr );
+            
+            if ( KErrAccessDenied == queryErr )
+                {
+                VMBLOGSTRING( "VMBX: CVmContainer::QueryVideoMbxNumberL: \
+                not allow to change number" );
+                }
+            else
+                {
+                User::Leave( queryErr );
+                }
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::FocusChanged
+// Indicate the requirements for control redrawing.
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::FocusChanged( TDrawNow /*aDrawNow*/ )
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::FocusChanged: =>" );
+    TInt ret1( KErrNone );
+    TInt ret2( KErrNone );
+
+    // Wwhen returned from other application to vmbx.
+    // Not necessary to update every time when focus changed.
+    if ( iUpdateData )
+        {
+        // get numbers, possible changed from Idle or General settings
+        ret1 = iVmbxNumber.GetVmbxNumber( iNumber );
+        if ( IsVideoSupported() )
+            {
+            ret2 = iVmbxNumber.GetVideoMbxNumber( iVideoNumber );
+            }
+        }
+    if ( iListBox )
+        {
+        if ( iUpdateData )
+            {
+            if ( ( ret1 == KErrNone || ret1 == KErrNotFound) &&
+                 ( ret2 == KErrNone || ret2 == KErrNotFound) )
+                {
+                TRAP_IGNORE( UpdateVmbxNumberInListBoxL() );
+                TRAP_IGNORE(
+                    ( static_cast <CVmAppUi*>iAvkonAppUi ) ->DrawCbaButtonsL() );
+                }
+            UpdateData( EFalse );
+            }
+        iListBox->SetFocus( IsFocused() );
+        }
+    iIsCallOngoing = EFalse;
+    VMBLOGSTRING( "VMBX: CVmContainer::FocusChanged: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::ConstructIconsForListboxL
+// Constructs the icons that are needed to indicate where the vmbx number
+// is stored
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::ConstructIconsForListboxL()
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::ConstructIconsForListboxL: =>" );
+    iListIcons = new (ELeave) CAknIconArray( KVmIconArraySize );
+
+    CFbsBitmap* bitmap;
+    CFbsBitmap* mask;
+
+    //Get the mbm file path
+    TFileName mbmfile( KVmMbmDrive );
+    mbmfile.Append( KDC_APP_BITMAP_DIR );
+    mbmfile.Append( KVmLibMbmFile );
+
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+
+    //empty bitmap
+    AknsUtils::CreateIconL( skin, KAknsIIDQgnPropEmpty, bitmap,mask, mbmfile,
+            EMbmVmQgn_prop_empty, EMbmVmQgn_prop_empty_mask );
+
+    CGulIcon* icon = CGulIcon::NewL( bitmap, mask );
+    iListIcons->AppendL( icon );
+
+    bitmap = NULL;
+    mask = NULL;
+
+    //sim icon
+    AknIconUtils::CreateIconL( bitmap, mask, mbmfile,
+                                EMbmVmQgn_prop_nrtyp_sim_contact,
+                                EMbmVmQgn_prop_nrtyp_sim_contact_mask );
+
+    CGulIcon* icon1 = CGulIcon::NewL( bitmap, mask );
+    iListIcons->AppendL( icon1 );
+    // Add default icons(CS, Video and VoIP) to the icon list
+    iVmbxNumber.ConstructDefaultIconsL( iListIcons );
+    VMBLOGSTRING2( "VMBX: CVmContainer::ConstructIconsForListboxL: count: %d", iListIcons->Count() );
+
+    CTextListBoxModel* model = iListBox->Model();
+    CDesCArray* items = static_cast<CDesCArray*>( model->ItemTextArray() );
+    items->Reset();
+
+    // Update listbox according new values..
+    iListBox->SetCurrentItemIndex( 0 );
+    iListBox->HandleItemAdditionL();
+    VMBLOGSTRING( "VMBX: CVmContainer::ConstructIconsForListboxL: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::CallVideoMailBoxL
+// Calls the vmbx number using PhoneClient
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::CallVideoMailBoxL()
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::CallVideoMailBoxL: =>" );
+
+    if ( !iIsCallOngoing )
+        {
+        AiwCallRequestL( KVmCmdAiwVideoCall, CAiwDialData::EAIWForcedVideo );
+        }
+
+    VMBLOGSTRING( "VMBX: CVmContainer::CallVideoMailBoxL: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::AiwCallRequestL()
+// Makes a call request to AiwProvider.
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::AiwCallRequestL( TInt aCommand, 
+                                    CAiwDialData::TCallType aCallType )
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::AiwCallRequestL: =>" );
+    TBuf<KVmbxMaxNumberLength> number;
+
+    if ( aCallType == CAiwDialData::EAIWVoice )
+        {
+        VMBLOGSTRING( "VMBX: CVmContainer::AiwCallRequestL: Type: VoiceCall" );
+        number.Copy( iNumber );
+
+        if ( !iNumber.Length() )
+            {
+            QueryNumberL( EVmbxNotDefinedQuery );
+            VMBLOGSTRING( "VMBX: CVmContainer::AiwCallRequestL: \
+                No VoiceCall number: <=" );
+            return;
+            }
+        VMBLOGSTRING( "VMBX: CVmContainer::AiwCallRequestL: \
+            VoiceCall number copied" );
+        number.Copy( iNumber );
+        }
+
+    if ( aCallType == CAiwDialData::EAIWForcedVideo )
+        {
+        if ( !iVideoNumber.Length() )
+            {
+            QueryVideoNumberL( EVmbxNotDefinedQuery );
+            VMBLOGSTRING( "VMBX: CVmContainer::AiwCallRequestL: \
+                No VideoCall number: <=" );
+            return;
+            }
+        VMBLOGSTRING( "VMBX: CVmContainer::AiwCallRequestL: \
+            VideoCall number copied" );
+        number.Copy( iVideoNumber );
+        }
+
+    TVmbxServiceInfo serviceInfo;
+    
+    if ( aCallType == CAiwDialData::EAIWVoiP)
+        {
+        VMBLOGSTRING( "VMBX: CVmContainer::AiwCallRequestL: Type: VoipCall" );
+
+        serviceInfo.iServiceId = ServiceId();
+
+        TInt error( iVmbxNumber.GetServiceInfo( serviceInfo ) );
+
+        if ( KErrNone == error )
+            {
+            number.Copy( serviceInfo.iAddress );
+            }
+
+        VMBLOGSTRING2( "VMBX: AiwCallRequestL: VoIP address error: %d", error );
+        VMBLOGSTRING2( "VMBX: AiwCallRequestL: VoIP address: %S", &number );
+        VMBLOGSTRING2( "VMBX: AiwCallRequestL: VoIP serviceId: %d", serviceInfo.iServiceId );
+        }
+
+    // Create a dial data object and push it into the cleanup stack.
+    CAiwDialDataExt* dialData = CAiwDialDataExt::NewLC();
+    
+    VMBLOGSTRING( "VMBX: CVmContainer::AiwCallRequestL: \
+        AIW dialData object created" );
+
+    // Set up dial data parameters.
+    dialData->SetPhoneNumberL( number );
+    dialData->SetCallType( aCallType );
+    dialData->SetServiceId( serviceInfo.iServiceId );
+
+    // Set up CAiwGenericParamList object.
+    CAiwGenericParamList& paramList = iServiceHandler->InParamListL();
+    dialData->FillInParamListL( paramList );
+
+    // Execute AIW menu service command.
+    iIsCallOngoing = ETrue;
+    VMBLOGSTRING( "VMBX: CVmContainer::AiwCallRequestL: Execute AIW menu \
+        service command" );
+    iServiceHandler->ExecuteMenuCmdL( aCommand,
+                                      paramList,
+                                      iServiceHandler->OutParamListL(),
+                                      0,
+                                      NULL );
+
+    // Dial data is no longer needed and can be deleted.
+    CleanupStack::PopAndDestroy( dialData );
+    VMBLOGSTRING( "VMBX: CVmContainer::AiwCallRequestL: <=" );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVmContainer::Number
+// Query for a voice mailbox number.
+// -----------------------------------------------------------------------------
+//
+const TDesC& CVmContainer::Number() const
+    {
+    return iNumber;
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::VideoNumber
+// Query for a video mailbox number.
+// -----------------------------------------------------------------------------
+//
+const TDesC& CVmContainer::VideoNumber() const
+    {
+    return iVideoNumber;
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::UpdateData
+// LisBox will be updated with data possibly changed in other application
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::UpdateData( TBool aState )
+    {
+    iUpdateData = aState;
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::ServiceId
+//
+// -----------------------------------------------------------------------------
+//
+TUint CVmContainer::ServiceId()
+    {
+    TUint serviceId( 0 );
+    TInt decrease( 0 );
+
+    RArray<TUint> profileIds;
+    iVmbxNumber.GetServiceIds( profileIds );
+
+    // Count how many items we have to decrease
+    for ( TInt i( 0 ); i < iIndArray.Count(); i++ )
+        {
+        if ( EVmbxIntCallVoiceMailboxNumberInd != iIndArray[ i ] )
+            {
+            decrease++;
+            }
+        }
+
+    serviceId = profileIds[ iListBox->CurrentItemIndex() - decrease ];
+    profileIds.Close();
+
+    VMBLOGSTRING2( "VMBX: CVmContainer::ServiceId() return %d", serviceId );    
+    return serviceId;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVmContainer::HandleServiceNotifyL
+// VoIP profile has changed
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::HandleServiceNotifyL()
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::HandleServiceNotifyL: =>" );
+
+    iServiceUpdated = ETrue;
+
+    VMBLOGSTRING( "VMBX: CVmContainer::HandleServiceNotifyL: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::AddBrandIconL
+//
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::AddBrandIconL( TUint aServiceId, TInt& aIconId )
+    {
+    // Set branding icon to context pane if available.
+    TBuf8<KVmSettingsUiBrandingIdLength> brandId( KNullDesC8 );
+
+    iVmbxNumber.BrandIdL( aServiceId, brandId );
+
+    CFbsBitmap* brandedBitmap = NULL;
+    CFbsBitmap* brandedBitmapMask = NULL;
+
+    // Get branded bitmap
+    TRAPD( err, iVmbxNumber.GetBrandedIconL(
+        brandId, brandedBitmap, brandedBitmapMask ) );
+
+    VMBLOGSTRING2( "VMBX: CVmContainer::AddBrandIconL: error: %d", err );
+
+    if ( KErrNone == err )
+        {
+        // The count of list icons(before adding branding icon to the list)
+        // must be the branded icon list id
+        aIconId = iListIcons->Count();
+        // Create new icon and add it to the icon list
+        iListIcons->AppendL(
+            CGulIcon::NewL( brandedBitmap, brandedBitmapMask ) );
+        }
+    else
+        {
+        delete brandedBitmap;
+        delete brandedBitmapMask;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::UpdateListboxL
+//
+// -----------------------------------------------------------------------------
+//
+void CVmContainer::UpdateListboxL()
+    {
+    VMBLOGSTRING( "VMBX: CVmContainer::UpdateListboxL: =>" );
+
+    iIndArray.Reset();
+    iArray.Reset();
+
+    FillIndArray();
+
+    // Set the text in the listbox
+    // First create space for the items
+    for ( TInt i = 0; i < iIndArray.Count(); i++ )
+        {
+        iArray.AppendL( KNullDesC );
+        }
+
+    // New voice messages
+    UpdateNewVoiceMessagesInListBoxL();
+
+    // Voice mailbox number
+    UpdateVmbxNumberInListBoxL();
+
+    // Details
+    UpdateLastMessageDetailsInListBoxL();
+
+    KErrNotFound == iListBox->CurrentItemIndex() ?
+        iListBox->SetCurrentItemIndex( 0 ) :
+            iListBox->SetCurrentItemIndex( iListBox->CurrentItemIndex() );
+
+    ( static_cast <CVmAppUi*>iAvkonAppUi )->DrawCbaButtonsL();
+
+    // Update listbox according new values..
+    iListBox->HandleItemAdditionL();
+    iListBox->DrawNow();
+
+    // Reset updating value
+    iServiceUpdated = EFalse;
+
+    VMBLOGSTRING( "VMBX: CVmContainer::UpdateListboxL: <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmContainer::IsServiceUpdated
+//
+// -----------------------------------------------------------------------------
+//
+TBool CVmContainer::IsServiceUpdated() const
+    {
+    return iServiceUpdated;
+    }
+
+TBool CVmContainer::IsIpVoiceMailboxServices()
+    {
+    return iVmbxNumber.IsIpVoiceMailboxServices();
+    }
+
+TBool CVmContainer::IsVideoSupported()
+    {
+    if ( iIsVideoSupported &&
+         FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/src/VmDetDlgPropertyObserver.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,137 @@
+/*
+* 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:  Publish & Subscribe property change observer implementation
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "VmDetDlgPropertyObserver.h"
+#include "VoiceMailboxAppPrivateCRKeys.h"
+#include "VmDetailsDialog.h"
+
+#include <e32property.h>
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVmDetDlgPropertyObserver::CVmDetDlgPropertyObserver
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CVmDetDlgPropertyObserver::CVmDetDlgPropertyObserver( 
+                                CVmDetailsDialog& aDetDialog )
+    : CActive( CActive::EPriorityLow ),
+      iDetDialog( aDetDialog )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVmDetDlgPropertyObserver::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CVmDetDlgPropertyObserver::ConstructL()
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CMGXPropertyObserver::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CVmDetDlgPropertyObserver* CVmDetDlgPropertyObserver::NewL( 
+                                CVmDetailsDialog& aDetDialog )
+    {
+    CVmDetDlgPropertyObserver* self = 
+                         new( ELeave ) CVmDetDlgPropertyObserver( aDetDialog );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CVmDetDlgPropertyObserver::~CVmDetDlgPropertyObserver
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CVmDetDlgPropertyObserver::~CVmDetDlgPropertyObserver()
+    {
+    if ( IsActive() )
+        {
+        Cancel();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVmDetDlgPropertyObserver::ObservePropertyChangeL
+// -----------------------------------------------------------------------------
+//
+void CVmDetDlgPropertyObserver::ObservePropertyChangeL( TUid aCategory, 
+                                                                    TUint aKey )
+    {
+    if ( IsActive() )
+        {
+        Cancel();
+        }
+    User::LeaveIfError( iProperty.Attach( aCategory, aKey ) );
+    iProperty.Subscribe( iStatus );
+    SetActive();
+    iKey = aKey;
+    }
+
+// -----------------------------------------------------------------------------
+// CVmDetDlgPropertyObserver::RunL
+// -----------------------------------------------------------------------------
+//
+void CVmDetDlgPropertyObserver::RunL()
+    {
+    TFileName fileName( KNullDesC );
+
+    if ( iKey == KVmSummaryInfoIsSet )
+        {
+        User::LeaveIfError( iProperty.Get( fileName ) );
+        }
+
+    iDetDialog.HandlePropertyNotificationEventL( fileName );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmDetDlgPropertyObserver::DoCancel
+// -----------------------------------------------------------------------------
+//
+void CVmDetDlgPropertyObserver::DoCancel()
+    {
+    iProperty.Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// CVmDetDlgPropertyObserver::RunError
+// -----------------------------------------------------------------------------
+//
+TInt CVmDetDlgPropertyObserver::RunError( TInt /*aError*/ )
+    {
+    // Return no error to prevent ui note from being displayed,
+    // nothing else can be done.
+    return KErrNone;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/src/VmDetailsDialog.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,577 @@
+/*
+* 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:  Details dialog for last message.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <bldvariant.hrh>
+#include "VmDetailsDialog.h"
+#include "VoiceMailboxAppPrivateCRKeys.h"
+#include "VmDetDlgPropertyObserver.h"
+#include <centralrepository.h>
+#include "Vm.hrh"
+#include <Vm.rsg>
+#include <AknLists.h>
+#include <AknTitle.h>
+#include <NumberGrouping.h>
+#include <NumberGroupingCRKeys.h>
+#include <StringLoader.h>
+#include "VMBLogger.h"
+
+// CONSTANTS
+const TInt KVmMaxLabelStringLength = 100;
+const TInt KVmMaxLabelFreeTextLength = 255;
+const TUint KVmDateSeparator = '/';
+const TUint KVmTimeSeparator = ':';
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVmDetailsDialog::CVmDetailsDialog
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CVmDetailsDialog::CVmDetailsDialog()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVmDetailsDialog::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CVmDetailsDialog::ConstructL()
+    {
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::ConstructL =>" );
+    CAknDialog::ConstructL( R_VMBX_DETAIL_MENUBAR );
+
+    // Central Repository handle
+    iSession = CRepository::NewL( KCRUidVoiceMailbox );
+    iObserver = CVmDetDlgPropertyObserver::NewL( *this );
+    StartObservingL();
+
+    TInt pngErr( KErrNone );
+    TInt pngSupported( 0 );
+    CRepository* repository = CRepository::NewL( KCRUidNumberGrouping );
+    pngErr = repository->Get( KNumberGrouping, pngSupported );
+    delete repository;
+
+    // create number grouping component if is supported.
+    if ( KErrNone == pngErr && pngSupported != 0 )
+        {
+        iNumberGrouping = CPNGNumberGrouping::NewL( KVmMaxLabelStringLength );
+        }
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::ConstructL <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmDetailsDialog::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CVmDetailsDialog* CVmDetailsDialog::NewL()
+    {
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::NewL =>" );
+    CVmDetailsDialog* self = new( ELeave ) CVmDetailsDialog;
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::NewL <=" );
+    return self;
+    }
+    
+// -----------------------------------------------------------------------------
+// CVmDetailsDialog::~CVmDetailsDialog
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CVmDetailsDialog::~CVmDetailsDialog()
+    {
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::~CVmDetailsDialog =>" );
+    delete iOldTitlePaneText;
+    iOldTitlePaneText = NULL;
+
+    delete iObserver;
+    delete iSession;
+    delete iNumberGrouping;
+
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::~CVmDetailsDialog <=" );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVmDetailsDialog::PreLayoutDynInitL
+// Called before the dialog is launched. Title pane is updated and listbox
+// is filled with a last message information.
+// -----------------------------------------------------------------------------
+//
+void CVmDetailsDialog::PreLayoutDynInitL()
+    {
+    // Take old title pane to variable.
+    CAknTitlePane* titlePane = 
+        static_cast< CAknTitlePane* >
+            ( iEikonEnv->AppUiFactory()->StatusPane()->ControlL(
+                TUid::Uid( EEikStatusPaneUidTitle ) ) );
+    iOldTitlePaneText = titlePane->Text()->AllocL();
+
+    // Set new title
+    HBufC* titleText = StringLoader::LoadL( R_TITLE_DETAILS );
+    titlePane->SetText( titleText ); //takes ownership
+    titleText = NULL;
+
+
+    // Get listbox pointer
+    CAknSingleHeadingStyleListBox* listbox = 
+        static_cast<CAknSingleHeadingStyleListBox*> 
+            ( Control( KVmDetailsDialog ) );
+
+    listbox->CreateScrollBarFrameL( ETrue );
+    listbox->ScrollBarFrame()->SetScrollBarVisibilityL(
+        CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
+
+    // populate array
+    MDesCArray* itemList = listbox->Model()->ItemTextArray();
+    CDesCArray* itemArray = static_cast<CDesCArray*>( itemList );
+    PopulateListboxItemsL( *itemArray );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmDetailsDialog::PopulateListboxItemsL
+// Reads message details from shared data.
+// -----------------------------------------------------------------------------
+//
+void CVmDetailsDialog::PopulateListboxItemsL( CDesCArray& aItemArray )
+    {
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::PopulateListboxItemsL =>" );
+    // To calculate the rect for the text box.
+    CAknSingleHeadingStyleListBox* listbox = 
+                   static_cast<CAknSingleHeadingStyleListBox*> 
+                       ( Control(KVmDetailsDialog) );    
+    CListBoxView* view = listbox->View();    
+    TRect itemTextRect (TPoint( view->ItemPos(0) ), TSize(view->ItemSize() ) );
+    aItemArray.Reset();
+
+    // Used variables
+    HBufC* heading = NULL;
+    HBufC* data = NULL;
+    TInt error = KErrNone;
+
+
+    // Urgency
+    heading = StringLoader::LoadLC( R_URGENCY );
+
+    TInt urgency; 
+    error = iSession->Get( KVmUrgencyLevel, urgency );
+    if ( error == KErrNone )
+        {
+        switch ( urgency )
+            {
+            case 0: // Normal
+            case 1: // Interactive
+                {
+                data = StringLoader::LoadLC( R_NORMAL );
+                break;
+                }
+            case 2: // Urgent
+                {
+                data = StringLoader::LoadLC( R_URGENT );
+                break;
+                }
+            case 3: // Emergency
+                {
+                data = StringLoader::LoadLC( R_EMERGENCY );
+                break;
+                }
+            default:
+                {
+                User::Leave( KErrNotSupported );
+                break;
+                }
+            }
+        }
+    else
+        {
+        data = KNullDesC().AllocLC();
+        }
+    
+    AppendLineL( aItemArray, heading->Des(), data->Des(), itemTextRect );
+    CleanupStack::PopAndDestroy( data );
+    CleanupStack::PopAndDestroy( heading );
+
+
+    // Date
+    heading = StringLoader::LoadLC( R_DATE );
+
+    data = HBufC::NewLC( KVmMaxLabelStringLength );
+    TPtr datePtr = data->Des();
+    if ( iSession->Get( KVmDateStamp, datePtr ) == KErrNone )
+        {
+        FormatDateStringL( datePtr );
+        }
+        
+    AppendLineL( aItemArray, heading->Des(), data->Des(), itemTextRect );
+    CleanupStack::PopAndDestroy( data );
+    CleanupStack::PopAndDestroy( heading );
+
+    // Time
+    heading = StringLoader::LoadLC( R_TIME );
+
+    data = HBufC::NewLC( KVmMaxLabelStringLength );
+    TPtr timePtr = data->Des();
+    if ( iSession->Get( KVmTimeStamp, timePtr ) == KErrNone )
+        {
+        FormatTimeStringL( timePtr );
+        }
+
+    AppendLineL( aItemArray, heading->Des(), data->Des(), itemTextRect );
+    CleanupStack::PopAndDestroy( data );
+    CleanupStack::PopAndDestroy( heading );
+
+    // Callback number
+    heading = StringLoader::LoadLC( R_CALL_BACK );
+
+    data = HBufC::NewLC( KVmMaxLabelStringLength );
+    TPtr callbackPtr = data->Des();
+    iSession->Get( KVmCallbackNumber, callbackPtr ); // ignore error
+
+    if ( iNumberGrouping )
+        {
+        iNumberGrouping->Set( callbackPtr );
+        CleanupStack::PopAndDestroy( data );
+        data = iNumberGrouping->FormattedNumber().AllocLC();
+        }
+
+    AppendLineL( aItemArray, heading->Des(), data->Des(), itemTextRect, ETrue );
+    CleanupStack::PopAndDestroy( data );
+    CleanupStack::PopAndDestroy( heading );
+
+    // Text
+    heading = StringLoader::LoadLC( R_TEXT );
+
+    data = HBufC::NewLC( KVmMaxLabelFreeTextLength );
+    TPtr textPtr = data->Des();
+    iSession->Get( KVmUserData, textPtr ); // ignore error
+
+    AppendLineL( aItemArray, heading->Des(), data->Des(), itemTextRect, ETrue );
+    CleanupStack::PopAndDestroy( data );
+    CleanupStack::PopAndDestroy( heading );
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::PopulateListboxItemsL <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmDetailsDialog::FormatDateStringL
+// Formats date string
+// -----------------------------------------------------------------------------
+//
+void CVmDetailsDialog::FormatDateStringL( TDes& aDateString )
+    {
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::FormatDateStringL =>" );
+    if ( !aDateString.Length() )
+        {
+        return;
+        }
+
+    // Check that we have two separators '/'
+    TInt indexFirst = aDateString.Locate( KVmDateSeparator );
+    TInt indexSecond = aDateString.LocateReverse( KVmDateSeparator );
+    if ( indexFirst == indexSecond ) // Also -1 is covered
+        {
+        // Incorrect date format
+        User::Leave( KErrCorrupt );
+        }
+
+    TLex lex = aDateString.Right( aDateString.Length() - indexSecond - 1 );
+    TInt year;
+    User::LeaveIfError( lex.Val( year ) );
+    
+    lex = aDateString.Mid( indexFirst + 1, indexSecond - indexFirst );
+    TInt month;
+    User::LeaveIfError( lex.Val( month ) );
+
+    lex = aDateString.Left( indexFirst );
+    TInt day;
+    User::LeaveIfError( lex.Val( day ) );
+
+    // Format date according the locale:
+    TDateTime dateTime( year, TMonth( month - 1 ), day, 0, 0, 0, 0 );
+    TTime time( dateTime );
+    HBufC* dateFormat = StringLoader::LoadLC( R_QTN_DATE_USUAL_WITH_ZERO );
+    time.FormatL( aDateString, *dateFormat );
+    CleanupStack::PopAndDestroy( dateFormat ); //dateFormatString
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::FormatDateStringL <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmDetailsDialog::FormatTimeStringL
+// Formats time string
+// -----------------------------------------------------------------------------
+//
+void CVmDetailsDialog::FormatTimeStringL( TDes& aTimeString )
+    {
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::FormatTimeStringL =>" );
+    if ( !aTimeString.Length() )
+        {
+        VMBLOGSTRING( "VMBX: CVmDetailsDialog::FormatTimeStringL: \
+        Empty time " );
+        return;
+        }
+
+    // Check that we have two separators ':'
+    TInt indexFirst = aTimeString.Locate( KVmTimeSeparator );
+    TInt indexSecond = aTimeString.LocateReverse( KVmTimeSeparator );
+    if ( indexFirst == indexSecond ) // Also -1 is covered
+        {
+        VMBLOGSTRING( "VMBX: CVmDetailsDialog::FormatTimeStringL \
+        Incorrect date format" );
+        // Incorrect date format
+        User::Leave( KErrCorrupt );
+        }
+
+    TLex lex( aTimeString.Left( indexFirst ) );
+    TInt hour;
+    User::LeaveIfError( lex.Val( hour ) );
+    
+    lex = aTimeString.Mid( indexFirst + 1, indexSecond - indexFirst );
+    TInt minute;
+    User::LeaveIfError( lex.Val( minute ) );
+    
+    lex = aTimeString.Right( aTimeString.Length() - indexSecond - 1 );
+    TInt second;
+    User::LeaveIfError( lex.Val( second ) );
+
+    // Format time according the locale:
+    TDateTime dateTime( 0, TMonth(0), 0, hour, minute, second, 0 );
+    TTime time( dateTime );
+    HBufC* timeFormat = StringLoader::LoadLC( R_QTN_TIME_USUAL_WITH_ZERO );
+    time.FormatL( aTimeString, *timeFormat );
+    CleanupStack::PopAndDestroy( timeFormat ); //dateFormatString
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::FormatTimeStringL <=" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmDetailsDialog::AppendLineL
+// Adds line to the listbox.
+// -----------------------------------------------------------------------------
+//
+void CVmDetailsDialog::AppendLineL( CDesCArray& aItemArray, 
+                                    const TDesC& aHeading, 
+                                    const TDesC& aData, 
+                                    TRect aItemTextRect,
+                                    TBool aUseMultipleLines )
+    {
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::AppendLineL =>" );
+    TBuf<1> tabChar(_L("\t"));
+    HBufC* combination = NULL;
+
+    if ( aUseMultipleLines )
+        {
+        CArrayFixFlat<TPtrC>* wrappedTexts = 
+            new (ELeave) CArrayFixFlat<TPtrC>( 2 );
+        CleanupStack::PushL( wrappedTexts );
+
+        // Layout used for CAknSingleHeadingStyleListBox 
+        // is list_single_heading_pane
+        // Layout text for list_single_heading_pane_2 (first row from No.2)
+        TAknTextLineLayout layout = 
+            AKN_LAYOUT_TEXT_List_pane_texts__single_heading__Line_2 (0 );
+        TAknLayoutText text;
+        text.LayoutText( aItemTextRect, layout );
+        TRect rect = text.TextRect();
+
+        // Wrap the long text to several lines.
+        AknTextUtils::WrapToArrayL( aData, 
+                    rect.Width() /* layout.iW */, 
+                    *AknLayoutUtils::FontFromId( layout.FontId() /* iFont */),
+                    *wrappedTexts );
+
+        if ( wrappedTexts->Count() == 0 ) // i.e. empty text
+            {
+            // For creating the first line
+            wrappedTexts->AppendL( KNullDesC() );
+            }
+
+        // Create the first line:
+        combination = HBufC::NewLC( aHeading.Length() + 
+                                    tabChar.Length() + 
+                                    wrappedTexts->At( 0 ).Length() );
+
+        TPtr comPtr = combination->Des();
+
+        comPtr.Append( aHeading );
+        comPtr.Append( tabChar );
+        comPtr.Append( wrappedTexts->At( 0 ) );
+        
+        aItemArray.AppendL( comPtr );
+        
+        CleanupStack::PopAndDestroy( combination );
+        combination = NULL;
+
+        // Create the other lines
+        for ( TInt i = 1 ; i < wrappedTexts->Count() ; i++ )
+            {
+            // combination is created without the header.
+            combination = HBufC::NewLC( tabChar.Length() + 
+                                    wrappedTexts->At( i ).Length() );
+
+            comPtr.Set( combination->Des() );
+
+            comPtr.Append( tabChar );
+            comPtr.Append( wrappedTexts->At( i ) );
+
+            aItemArray.AppendL( comPtr );
+
+            CleanupStack::PopAndDestroy( combination );
+            combination = NULL;
+            }
+        CleanupStack::PopAndDestroy( wrappedTexts );
+        }
+    else
+        {
+        // Create combination to one line in listbox.
+        combination = HBufC::NewLC( aHeading.Length() + 
+                                        tabChar.Length() + 
+                                        aData.Length() );
+
+        TPtr comPtr = combination->Des();
+        
+        comPtr.Append( aHeading );
+        comPtr.Append( tabChar );
+        comPtr.Append( aData );
+        
+        aItemArray.AppendL( comPtr );
+        
+        CleanupStack::PopAndDestroy( combination );
+        }
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::AppendLineL =>" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmDetailsDialog::OfferKeyEventL
+// Called when a key is pressed.
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CVmDetailsDialog::OfferKeyEventL( const TKeyEvent& aKeyEvent, 
+                                             TEventCode aType )
+    {
+    // Special case: exiting with escape key
+    if ( aKeyEvent.iCode == EKeyEscape )
+        {
+        SetOldTitleL();
+        return CAknDialog::OfferKeyEventL( aKeyEvent, aType );
+        }
+
+    TKeyResponse res = EKeyWasNotConsumed;
+    res = Control(KVmDetailsDialog)->OfferKeyEventL( aKeyEvent, aType );
+    if (res != EKeyWasNotConsumed) 
+        {
+        return res;
+        }
+    
+    res = CAknDialog::OfferKeyEventL( aKeyEvent, aType );
+    return res;
+    }
+
+// -----------------------------------------------------------------------------
+// CVmDetailsDialog::OkToExitL
+// Called when softkeys are pressed.
+// -----------------------------------------------------------------------------
+//
+TBool CVmDetailsDialog::OkToExitL( TInt aButtonId )
+    {
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::OkToExitL =>" );
+    TBool retVal( EFalse );
+    // Translate the button presses into commands
+    if ( aButtonId == EAknSoftkeyBack )
+        { 
+        // terminate the diallog.
+        SetOldTitleL();
+        retVal = ETrue;
+        }
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::OkToExitL <=" );
+    return retVal;
+    }
+
+// -----------------------------------------------------------------------------
+// CVmDetailsDialog::SetOldTitleL
+// Saves the old title text.
+// -----------------------------------------------------------------------------
+//
+void CVmDetailsDialog::SetOldTitleL()
+    {
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::SetOldTitleL =>" );
+    if ( !iOldTitlePaneText )
+        {
+        VMBLOGSTRING( "VMBX: CVmDetailsDialog::SetOldTitleL: already set" );
+        return; // already set
+        }
+
+    CAknTitlePane* titlePane = static_cast<CAknTitlePane*> 
+        ( iEikonEnv->AppUiFactory()->StatusPane()->ControlL( 
+            TUid::Uid( EEikStatusPaneUidTitle ) ) );
+    titlePane->SetText( iOldTitlePaneText ); // takes ownership
+    iOldTitlePaneText = NULL;
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::SetOldTitleL =>" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVmDetailsDialog::HandlePropertyNotificationEventL
+// Called when key value is set.
+// -----------------------------------------------------------------------------
+//
+void CVmDetailsDialog::HandlePropertyNotificationEventL( const TDesC& aValue )
+    {
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::HandlePropertyNotificationEventL \
+    =>" );
+    StartObservingL();
+    TLex lexer( aValue );
+    TInt value = KErrNotFound;
+       User::LeaveIfError( lexer.Val( value ) );
+    if ( value == 0 ) // message is not set
+        {
+        // Exit the details dialog
+        TryExitL( EAknSoftkeyBack );
+        }
+    else // new message set
+        {
+        // Update listbox context:
+        CAknSingleHeadingStyleListBox* listbox = 
+           static_cast<CAknSingleHeadingStyleListBox*>( 
+                                               Control( KVmDetailsDialog ) );
+        MDesCArray* itemList = listbox->Model()->ItemTextArray();
+        CDesCArray* itemArray = static_cast<CDesCArray*>( itemList );
+        PopulateListboxItemsL( *itemArray );
+        listbox->HandleItemAdditionL();
+        }
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::HandlePropertyNotificationEventL \
+    <=" );
+    }
+// -----------------------------------------------------------------------------
+// CVmDetailsDialog::StartObservingL
+// Starts observing for key value changes.
+// -----------------------------------------------------------------------------
+//
+void CVmDetailsDialog::StartObservingL()
+    {
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::StartObservingL =>" );
+    iObserver->ObservePropertyChangeL( KCRUidVoiceMailbox, KVmSummaryInfoIsSet );
+    VMBLOGSTRING( "VMBX: CVmDetailsDialog::StartObservingL <=" );
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/src/VmDetailsDlgDummy.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Dummy details dialog for global implementation
+*
+*/
+
+
+// INCLUDE FILES
+#include "VmDetailsDlgDummy.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVmDetailsDialog::CVmDetailsDialog
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CVmDetailsDialog::CVmDetailsDialog()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVmDetailsDialog::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CVmDetailsDialog* CVmDetailsDialog::NewL()
+    {
+    CVmDetailsDialog* self = new( ELeave ) CVmDetailsDialog;
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVmDetailsDialog::~CVmDetailsDialog
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CVmDetailsDialog::~CVmDetailsDialog()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVmDetailsDialog::ExecuteLD
+// Dummy function
+// -----------------------------------------------------------------------------
+//
+TInt CVmDetailsDialog::ExecuteLD( TInt /* aResourceId */ )
+    {
+    delete this;
+    return 0;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/src/VmDocument.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Document for Voice mailbox application.
+*
+*/
+
+
+// INCLUDE FILES
+#include "VmDocument.h"
+#include "VmAppUi.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CVmDocument::~CVmDocument
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CVmDocument::~CVmDocument()
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CVmDocument::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------    
+//
+CVmDocument* CVmDocument::NewL( CEikApplication& aApp )  // CVmApp reference
+    {
+    return new(ELeave) CVmDocument( aApp );
+    }
+ 
+
+// -----------------------------------------------------------------------------
+// CVmDocument::CreateAppUiL
+// constructs CVmAppUi
+// -----------------------------------------------------------------------------
+//
+CEikAppUi* CVmDocument::CreateAppUiL()
+    {
+    return new(ELeave) CVmAppUi;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/src/VmQueryLauncher.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,115 @@
+/*
+* 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: Query launcher for Voice mailbox application.
+*
+*/
+
+
+// INCLUDE FILES
+#include <bldvariant.hrh>
+#include <e32std.h>
+#include <featmgr.h>
+#include "VmQueryLauncher.h"
+#include "VmContainer.h"
+#include "vmnumber.h"
+#include "VMBLogger.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can't leave
+// -----------------------------------------------------------------------------
+// CVmQueryLauncher::CVmQueryLauncher
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CVmQueryLauncher::CVmQueryLauncher( CVmContainer& aContainer, 
+                                    MVmQueryLauncher& aObserver,
+                                                    TInt aPriority )
+                        : CActive( aPriority ), iContainer( aContainer ),
+                          iObserver( aObserver )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVmQueryLauncher::~CVmQueryLauncher
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CVmQueryLauncher::~CVmQueryLauncher()
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CVmQueryLauncher::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CVmQueryLauncher* CVmQueryLauncher::NewL( CVmContainer& aContainer,
+                                 MVmQueryLauncher& aObserver, TInt aPriority)
+    {
+    CVmQueryLauncher* self = new( ELeave ) CVmQueryLauncher( aContainer,
+                                                    aObserver, aPriority );
+    CActiveScheduler::Add( self );
+    self->SetActive();
+    TRequestStatus* status = &(self->iStatus);
+
+    // The idea is to activate this object as soon as the application has
+    // been fully constructed.
+    User::RequestComplete( status, KErrNone );
+
+    return self;
+    }
+
+// ----------------------------------------------------------------------------
+// CVmQueryLauncher::RunL
+// Handles an active object's request completion event
+// ----------------------------------------------------------------------------
+//
+void CVmQueryLauncher::RunL()
+    {
+    VMBLOGSTRING( "VMBX: CVmQueryLauncher::RunL: =>" );
+    if ( iStatus == KErrNone )
+        {
+        TInt type( EVmbx );
+
+        type = iContainer.AskTypeL();
+
+        if ( type == EVmbx )         //if CS vmbx is selected
+            {
+            iContainer.QueryNumberL( EVmbxNotDefinedQuery );
+            }
+        else if ( type == EVmbxVideo )
+            {
+            iContainer.QueryVideoNumberL( EVmbxNotDefinedQuery );
+            }
+        }
+    iObserver.NumberQueryComplete();
+    VMBLOGSTRING( "VMBX: CVmQueryLauncher::RunL: <=" );
+    }
+
+// ----------------------------------------------------------------------------
+// CVmQueryLauncher::DoCancel
+// Implements cancellation of an outstanding request
+// ----------------------------------------------------------------------------
+//
+void CVmQueryLauncher::DoCancel()
+    {
+    VMBLOGSTRING( "VMBX: CVmQueryLauncher::DoCancel: =>" );
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, KErrCancel );
+    VMBLOGSTRING( "VMBX: CVmQueryLauncher::DoCancel: <=" );
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/src/vm.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,973 @@
+/*
+* 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 file contains all the resources for the module.
+ *
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME    VM  // 4 letter ID
+
+// INCLUDES
+#include <bldvariant.hrh>
+#include <data_caging_paths_strings.hrh>
+#include <AiwCommon.rh>
+#include <appinfo.rh>//svg icons
+#include <eikon.rh>
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.mbg>
+#include <avkon.loc>
+#include <vm.loc>
+#include <vm.mbg>
+#include "vm.hrh"
+
+//  CONSTANTS
+#define vm_mbm "Z:\\Resource\\Apps\\vm.mbm"
+
+// RESOURCE DEFINITIONS
+
+// -----------------------------------------------------------------------------
+//
+// RSS signature
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE { }
+
+// -----------------------------------------------------------------------------
+//
+// A document name buffer.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF { buf=""; }
+
+// -----------------------------------------------------------------------------
+//
+// Application information.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+    {
+    status_pane = r_vm_status_pane;
+    menubar = r_vm_menubar;
+    cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_vm_menubar
+// A menubar.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_vm_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_vm_menu; txt="File"; }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_vm_menu
+//    Menu items
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_vm_menu
+    {
+    items=
+        {
+        MENU_ITEM { command = EVmCmdAiwPlaceholder ; txt = ""; }
+        // populated in run-time
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_vm_status_pane
+// Status pane resource.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE STATUS_PANE_APP_MODEL r_vm_status_pane
+    {
+    panes=
+        {
+        SPANE_PANE
+            {
+            id = EEikStatusPaneUidTitle;
+            type = EAknCtTitlePane;
+            resource = r_overriden_app_name;
+            }
+#ifndef __SCALABLE_ICONS
+        ,
+        SPANE_PANE
+            {   // Context pane definition
+            id = EEikStatusPaneUidContext;
+            type = EAknCtContextPane;
+            resource = r_overriden_icon;
+            }
+#endif
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_overriden_app_name
+// Title pane for r_vm_status_pane
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TITLE_PANE r_overriden_app_name
+    {
+       txt = qtn_smsvo_title_voice_mailbox;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_overriden_icon
+// Context pane for r_vm_status_pane when no scalable icons
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CONTEXT_PANE r_overriden_icon
+    {
+        bmpfile = vm_mbm;
+        bmpid = EMbmVmQgn_menu_smsvo_cxt;
+        bmpmask = EMbmVmQgn_menu_smsvo_cxt_mask;
+    }
+// -----------------------------------------------------------------------------
+//
+// r_call_voicemail
+// Text string in the main view in a list pane for double item
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_call_voicemail
+    {
+    buf = qtn_smsvo_call_voicemail;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_number_pane_empty
+// Text string to show, when vmbx number is not defined.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_number_pane_empty
+    {
+    buf = qtn_smsvo_number_pane_empty;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_menu_call_voicemail
+// Command string in options list
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_menu_call_voicemail
+    {
+    buf = qtn_smsvo_call_voicemail_opt;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_menu_define_number
+// Command string in options list
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_menu_define_number
+    {
+    buf = qtn_smsvo_define_number;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_menu_define_video_number
+// Command string in options list
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_menu_define_video_number
+    {
+    buf = qtn_smsvi_define_number;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_menu_change_number
+// Command string in options list
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_menu_change_number
+    {
+    buf = qtn_smsvo_change_number;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_menu_exit
+// A common option in a options list for closing application.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_menu_exit
+    {
+    buf = qtn_options_exit;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_menu_help
+// Getting help via options Help selection.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_menu_help
+    {
+    buf = qtn_options_help;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_int_call_voicemail
+// Text string in the main view in a list pane for double item
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_int_call_voicemail
+    {
+    buf = qtn_voip_mailbox;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_address_pane_empty
+// Text string shown, when vmbx address is not defined.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_address_pane_empty
+    {
+    buf = qtn_voip_mailbox_empty;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_menu_define_address
+// Command string in options list    .
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_menu_define_address
+    {
+    buf = qtn_voip_define_mailbox_address;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_menu_change_address
+// Command string in options list.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_menu_change_address
+    {
+     buf = qtn_voip_change_address;
+     }
+
+// -----------------------------------------------------------------------------
+//
+// r_menu_call_int_mailbox
+// Command string in options list    .
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_menu_call_int_mailbox
+    {
+    buf = qtn_voip_call_mailbox;
+    }
+
+
+// CDMA ADDITIONS
+
+// -----------------------------------------------------------------------------
+//
+//    r_vmbx_detail_dialog
+//    Details of last message dialog.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_vmbx_detail_dialog
+    {
+    flags = EAknDialogSelectionList;
+    buttons = R_AVKON_SOFTKEYS_BACK;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtSingleHeadingListBox;
+            id = KVmDetailsDialog;
+            control= LISTBOX
+                {
+                flags = EAknListBoxViewerFlags;
+                };
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_vmbx_detail_menubar
+//    Empty. Mandatory for the dialog.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_vmbx_detail_menubar
+    {
+    titles=
+        {
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_voicemail_cleared
+// Text in infotmation note when the voicemail icon is cleared.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voicemail_cleared
+    {
+    buf = qtn_smsvo_voicemail_cleared;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_clear_icon
+// Command string in options list.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_clear_icon
+    {
+    buf = qtn_smsvo_clear_icon;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_voice_messages
+// Text string in the main view in a list pane for double item.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voice_messages
+    {
+    buf = qtn_smsvo_voice_messages;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_no_new
+// Text for number of new messages in the double listbox.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_no_new
+    {
+    buf = qtn_smsvo_no_new;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_new_messages
+// Text for new messages in the double listbox.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_new_messages
+    {
+    buf = qtn_smsvo_new_messages;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_n_new
+// Text for number of new messages in the double listbox.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_n_new
+    {
+    buf = qtn_smsvo_n_new;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_details_of_last
+// Text string in the main view in a list pane for double item;
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_details_of_last
+    {
+    buf = qtn_smsvo_details_of_last;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_title_details
+// Text string in title pane in the last message details dialog
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_title_details
+    {
+    buf = qtn_smsvo_title_details;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_urgency
+// Heading in the details view
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_urgency
+    {
+    buf = qtn_smsvo_urgency;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_emergency
+// Body text in the details view under Urgency heading
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_emergency
+    {
+    buf = qtn_smsvo_emergency;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_urgent
+// Body text in the details view under Urgency heading.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_urgent
+    {
+    buf = qtn_smsvo_urgent;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_normal
+// Body text in the details view under Urgency heading.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_normal
+    {
+    buf = qtn_smsvo_normal;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_date
+// Heading in the details view.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_date
+    {
+    buf = qtn_smsvo_date;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_time
+// Heading in the details view.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_time
+    {
+    buf = qtn_smsvo_time;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_call_back
+// Heading in the details view.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_call_back
+    {
+    buf = qtn_smsvo_call_back;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_text
+// Heading in the details view.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_text
+    {
+    buf = qtn_smsvo_text;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_mailbox_number
+// Displayed in the main view in a list pane for double item instead of
+// qtn_smsvo_call_voicemail in CDMA
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mailbox_number
+    {
+    buf = qtn_smsvo_mailbox_number;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_open_details
+// Command in Options menu command name for "Open".
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_open_details
+    {
+    buf = qtn_options_open;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_offline_not_possible_sap
+// The note that is shown when the user attempts to connect the network when
+// in SIM Access Profile mode. From rel. 2.6 onwards
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_offline_not_possible_sap
+    {
+    buf = qtn_offline_not_possible_sap;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_vm_localisable_app_info
+// Localisable app info
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE LOCALISABLE_APP_INFO r_vm_localisable_app_info
+    {
+    short_caption = qtn_apps_smsvo_grid;
+    caption_and_icon =
+    CAPTION_AND_ICON_INFO
+        {
+        caption = qtn_apps_smsvo_list;
+#ifdef __SCALABLE_ICONS
+        number_of_icons = 1;
+        icon_file = APP_BITMAP_DIR"\\vm_aif.mif";
+#else
+        number_of_icons = 2;
+        icon_file = APP_BITMAP_DIR"\\vm_aif.mbm";
+#endif
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_vmbx_select_type_list
+// Selection listbox
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE LISTBOX r_vmbx_select_type_list
+    {
+    array_id = r_vmbx_select_type_list_items;
+    flags    = EAknListBoxSelectionList;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_vmbx_select_type_list_items
+// Listbox items for "r_vmbx_select_type_list" -listbox
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_vmbx_select_type_list_items
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = "Voice mailbox";
+            },
+        LBUF
+            {
+            txt = "Internet call voice mailbox";
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_call_videomail
+// Text string in the main view in a list pane for double item
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_call_videomail
+    {
+    buf = qtn_smsvi_list_video_mailbox;
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+// r_menu_call_videomail
+// Text string in the main view in a list pane for double item
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_menu_call_videomail
+    {
+    buf = qtn_smsvi_call_videomail_opt;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_vmbx_cba_define_vo_number
+// CBA buttons when voice mailbox number not defined
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_vmbx_cba_define_vo_number
+    {
+    flags = 0;
+    buttons =
+        {
+        CBA_BUTTON {id=EAknSoftkeyOptions; txt=text_softkey_option;},
+        CBA_BUTTON {id=EAknSoftkeyExit;  txt= text_softkey_exit;},
+        CBA_BUTTON {id=EVmCbaMskDefVoMbx;  txt=qtn_msk_define_cs_vmbx_number;}
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+// r_vmbx_cba_notallow_define_vo_number
+// CBA buttons when voice mailbox number not defined
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_vmbx_cba_notallow_define_vo_number
+    {
+    flags = 0;
+    buttons = 
+        {
+        CBA_BUTTON {id=EAknSoftkeyOptions; txt=text_softkey_option;},
+        CBA_BUTTON {id=EAknSoftkeyExit; txt=text_softkey_exit;}
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_vmbx_cba_call_vo_mailbox
+// CBA buttons when voice mailbox number defined
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_vmbx_cba_call_vo_mailbox
+    {
+    flags = 0;
+    buttons =
+        {
+        CBA_BUTTON {id=EAknSoftkeyOptions; txt=text_softkey_option;},
+        CBA_BUTTON {id=EAknSoftkeyExit;  txt= text_softkey_exit;},
+        CBA_BUTTON {id=EVmCbaMskCallVoMbx; txt= qtn_msk_call_cs_vmbx;}
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_vmbx_gs_cba_define_vo_number
+// CBA buttons when voice mailbox number not defined (application opened from
+// general settings)
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_vmbx_gs_cba_define_vo_number
+    {
+    flags = 0;
+    buttons =
+        {
+        CBA_BUTTON {id=EAknSoftkeyOptions; txt=text_softkey_option;},
+        CBA_BUTTON {id=EAknSoftkeyExit;  txt= text_softkey_back;},
+        CBA_BUTTON {id=EVmCbaMskDefVoMbx;  txt=qtn_msk_define_cs_vmbx_number;}
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+// r_vmbx_gs_cba_notallow_define_vo_number
+// CBA buttons when voice mailbox number not defined
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_vmbx_gs_cba_notallow_define_vo_number
+    {
+    flags = 0;
+    buttons = 
+        {
+        CBA_BUTTON {id=EAknSoftkeyOptions; txt=text_softkey_option;},
+        CBA_BUTTON {id=EAknSoftkeyExit; txt=text_softkey_back;}
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_vmbx_gs_cba_call_vo_mailbox
+// CBA buttons when voice mailbox number defined (application opened from
+// general settings)
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_vmbx_gs_cba_call_vo_mailbox
+    {
+    flags = 0;
+    buttons =
+        {
+        CBA_BUTTON {id=EAknSoftkeyOptions; txt=text_softkey_option;},
+        CBA_BUTTON {id=EAknSoftkeyExit;  txt= text_softkey_back;},
+        CBA_BUTTON {id=EVmCbaMskCallVoMbx; txt= qtn_msk_call_cs_vmbx;}
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_vmbx_cba_define_vi_number
+// CBA buttons when video mailbox number not defined
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_vmbx_cba_define_vi_number
+    {
+    flags = 0;
+    buttons =
+        {
+        CBA_BUTTON {id=EAknSoftkeyOptions; txt=text_softkey_option;},
+        CBA_BUTTON {id=EAknSoftkeyExit;  txt= text_softkey_exit;},
+        CBA_BUTTON {id=EVmCbaMskDefViMbx;  txt=qtn_msk_define_video_mbx_number;}
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+// r_vmbx_cba_notallow_define_vi_number
+// CBA buttons when video mailbox number not defined
+//
+// -----------------------------------------------------------------------------
+//    
+RESOURCE CBA r_vmbx_cba_notallow_define_vi_number
+    {
+    flags = 0;
+    buttons = 
+        {
+        CBA_BUTTON {id=EAknSoftkeyOptions; txt=text_softkey_option;},
+        CBA_BUTTON {id=EAknSoftkeyExit; txt=text_softkey_exit;}
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_vmbx_cba_call_vi_mailbox
+// CBA buttons when video mailbox number defined
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_vmbx_cba_call_vi_mailbox
+    {
+    flags = 0;
+    buttons =
+        {
+        CBA_BUTTON {id=EAknSoftkeyOptions; txt=text_softkey_option;},
+        CBA_BUTTON {id=EAknSoftkeyExit;  txt= text_softkey_exit;},
+        CBA_BUTTON {id=EVmCbaMskCallViMbx; txt=qtn_msk_call_video_mbx;}
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_vmbx_gs_cba_define_vi_number
+// CBA buttons when video mailbox number not defined (application opened from
+// general settings)
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_vmbx_gs_cba_define_vi_number
+    {
+    flags = 0;
+    buttons =
+        {
+        CBA_BUTTON {id=EAknSoftkeyOptions; txt=text_softkey_option;},
+        CBA_BUTTON {id=EAknSoftkeyExit;  txt= text_softkey_back;},
+        CBA_BUTTON {id=EVmCbaMskDefViMbx;  txt=qtn_msk_define_video_mbx_number;}
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+// r_vmbx_gs_cba_notallow_define_vi_number
+// CBA buttons when voice mailbox number not defined
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_vmbx_gs_cba_notallow_define_vi_number
+    {
+    flags = 0;
+    buttons = 
+        {
+        CBA_BUTTON {id=EAknSoftkeyOptions; txt=text_softkey_option;},
+        CBA_BUTTON {id=EAknSoftkeyExit; txt=text_softkey_back;}
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_vmbx_gs_cba_call_vi_mailbox
+// CBA buttons when video mailbox number defined (application opened from
+// general settings)
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_vmbx_gs_cba_call_vi_mailbox
+    {
+    flags = 0;
+    buttons =
+        {
+        CBA_BUTTON {id=EAknSoftkeyOptions; txt=text_softkey_option;},
+        CBA_BUTTON {id=EAknSoftkeyExit;  txt= text_softkey_back;},
+        CBA_BUTTON {id=EVmCbaMskCallViMbx; txt=qtn_msk_call_video_mbx;}
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_vmbx_cba_define_voip_number
+// CBA buttons when voip mailbox not defined
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_vmbx_cba_define_voip_number
+    {
+    flags = 0;
+    buttons =
+        {
+        CBA_BUTTON {id=EAknSoftkeyOptions;  txt=text_softkey_option;},
+        CBA_BUTTON {id=EAknSoftkeyExit;   txt= text_softkey_exit;},
+        CBA_BUTTON {id=EVmCbaMskDefVoipMbx; txt=qtn_msk_define_voip_mbx_address;}
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_vmbx_cba_call_voip_mailbox
+// CBA buttons when voip mailbox defined
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_vmbx_cba_call_voip_mailbox
+    {
+    flags = 0;
+    buttons =
+        {
+        CBA_BUTTON {id=EAknSoftkeyOptions;   txt=text_softkey_option;},
+        CBA_BUTTON {id=EAknSoftkeyExit;    txt= text_softkey_exit;},
+        CBA_BUTTON {id=EVmCbaMskCallVoipMbx; txt=qtn_msk_call_voip_vmbx;}
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_vmbx_gs_call_voip_mailbox
+// CBA buttons when voip mailbox defined (vmbx opened from General settings)
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_vmbx_gs_call_voip_mailbox
+    {
+    flags = 0;
+    buttons =
+        {
+        CBA_BUTTON {id=EAknSoftkeyOptions;   txt=text_softkey_option;},
+        CBA_BUTTON {id=EAknSoftkeyExit;    txt= text_softkey_back;},
+        CBA_BUTTON {id=EVmCbaMskCallVoipMbx; txt=qtn_msk_call_voip_vmbx;}
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_vmbx_app_interest
+// For AIW
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AIW_INTEREST r_vmbx_app_interest
+    {
+    items=
+        {
+        // This application is interested in calling from menu.
+        AIW_CRITERIA_ITEM
+            {
+            id              = EVmCmdAiwPlaceholder ;
+            serviceCmd      = KAiwCmdCall;
+            serviceClass    = KAiwClassMenu;
+            contentType     = "*";
+            defaultProvider = 0x101F868E;
+            maxProviders    = 1;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_voip_list_mailbox_name
+// Command string in options list.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voip_list_mailbox_name
+    {
+    buf = qtn_voip_list_mailbox_name;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/src/vm_caption.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains captions for vmbx application
+ *
+*/
+
+
+//  INCLUDES
+#include <bldvariant.hrh>
+
+#include <vm.loc>
+
+#include <apcaptionfile.rh>
+
+RESOURCE CAPTION_DATA
+{
+	caption=qtn_apps_smsvo_list;
+	shortcaption=qtn_apps_smsvo_grid;
+}
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/vmbx/src/vm_reg.rss	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for Voice mailbox application.
+*
+*/
+
+
+#include <appinfo.rh>
+#include <vm.rsg>
+#include <data_caging_paths_strings.hrh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x100058F5 // Define your application UID here
+
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file = "vm";
+    localisable_resource_file = APP_RESOURCE_DIR"\\vm";
+    localisable_resource_id = R_VM_LOCALISABLE_APP_INFO;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysdef_1_4_0.dtd	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,86 @@
+ <!ELEMENT SystemDefinition (systemModel?, build?)>
+ <!ATTLIST SystemDefinition
+  name CDATA #REQUIRED
+  schema CDATA #REQUIRED>
+ <!ELEMENT systemModel (layer+)>
+ <!ELEMENT layer (logicalset* | module*)*>
+ <!ATTLIST layer
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED
+  span CDATA #IMPLIED>
+ <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalset name CDATA #REQUIRED>
+ <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalsubset name CDATA #REQUIRED>
+ <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
+ <!ATTLIST module
+  name CDATA #REQUIRED
+  level CDATA #IMPLIED>
+ <!ELEMENT component (unit* | package* | prebuilt*)*>
+ <!ATTLIST component name CDATA #REQUIRED>
+ <!ELEMENT unit EMPTY>
+ <!ATTLIST unit
+  unitID ID #REQUIRED
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  bldFile CDATA #REQUIRED
+  priority CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT package EMPTY>
+ <!ATTLIST package
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT prebuilt EMPTY>
+ <!ATTLIST prebuilt
+  name CDATA #REQUIRED
+  version CDATA #REQUIRED
+  late (Y|N) #IMPLIED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
+ <!ELEMENT unitList (unitRef+)>
+ <!ATTLIST unitList
+  name ID #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT unitRef EMPTY>
+ <!ATTLIST unitRef unit IDREF #REQUIRED>
+ <!ELEMENT targetList EMPTY>
+ <!ATTLIST targetList
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  target IDREFS #REQUIRED>
+ <!ELEMENT target EMPTY>
+ <!ATTLIST target
+  name ID #REQUIRED
+  abldTarget CDATA #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT option EMPTY>
+ <!ATTLIST option
+  name ID #REQUIRED
+  abldOption CDATA #REQUIRED
+  description CDATA #REQUIRED
+  enable (Y | N | y | n) #REQUIRED>
+ <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
+ <!ATTLIST configuration
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  filter CDATA #REQUIRED>
+ <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
+ <!ELEMENT unitListRef EMPTY>
+ <!ATTLIST unitListRef unitList IDREF #REQUIRED>
+ <!ELEMENT layerRef EMPTY>
+ <!ATTLIST layerRef layerName CDATA #REQUIRED>
+ <!ELEMENT buildLayer EMPTY>
+ <!ATTLIST buildLayer
+  command CDATA #REQUIRED
+  targetList IDREFS #IMPLIED
+  unitParallel (Y | N | y | n) #REQUIRED
+  targetParallel (Y | N | y | n) #IMPLIED>
+ <!ELEMENT specialInstructions EMPTY>
+ <!ATTLIST specialInstructions
+  name CDATA #REQUIRED
+  cwd CDATA #REQUIRED
+  command CDATA #REQUIRED>