Revision: 201017
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 14 May 2010 16:01:46 +0300
changeset 19 43824b19ee35
parent 17 f05641c183ff
child 33 837dcc42fd6a
Revision: 201017 Kit: 201019
bluetoothappprofiles/avrcp/avc/avcframe.h
bluetoothappprofiles/avrcp/mediabrowseapi/public/remconmediabrowsepanic.h
bluetoothappprofiles/avrcp/mediabrowseapi/src/remconmediabrowsetargetbase.cpp
bluetoothappprofiles/avrcp/playerinformation/src/playerapplicationsetting.cpp
bluetoothappprofiles/avrcp/playerinformation/src/playerapplicationsetting.h
bluetoothappprofiles/avrcp/remconbeareravrcp/inc/playerbitmasks.h
bluetoothappprofiles/avrcp/remconbeareravrcp/src/playerbitmasks.cpp
bluetoothengine/bteng/btbearer/inc/btpluginnotifier.h
bluetoothengine/bteng/btbearer/src/btpluginnotifier.cpp
bluetoothengine/bteng/btengconnman/inc/btengconnhandler.h
bluetoothengine/bteng/btengconnman/inc/btengpairinghandler.h
bluetoothengine/bteng/btengconnman/src/btengconnhandler.cpp
bluetoothengine/bteng/btengconnman/src/btengconnman.cpp
bluetoothengine/bteng/btengconnman/src/btengpairinghandler.cpp
bluetoothengine/bteng/btengdiscovery/inc/btengdevicesearch.h
bluetoothengine/bteng/btengdiscovery/src/btengdevicesearch.cpp
bluetoothengine/bteng/btengsettings/inc/btengsettingsnotify.h
bluetoothengine/bteng/btengsettings/src/btengsettingsnotify.cpp
bluetoothengine/bteng/bttoggle/src/bttoggle.cpp
bluetoothengine/bteng/group/bld.inf
bluetoothengine/bteng/group/btbearer.mmp
bluetoothengine/bteng/group/bteng.mmp
bluetoothengine/bteng/group/btengconnman.mmp
bluetoothengine/bteng/inc/btengactive.h
bluetoothengine/bteng/inc/btengactive.inl
bluetoothengine/bteng/inc/btengclient.h
bluetoothengine/bteng/inc/btengclientserver.h
bluetoothengine/bteng/inc/btengincpair.h
bluetoothengine/bteng/inc/btengotgpair.h
bluetoothengine/bteng/inc/btengpairbase.h
bluetoothengine/bteng/inc/btengpairman.h
bluetoothengine/bteng/inc/btengserver.h
bluetoothengine/bteng/inc/btengsrvbbconnectionmgr.h
bluetoothengine/bteng/inc/btengsrvkeywatcher.h
bluetoothengine/bteng/inc/btengsrvsettingsmgr.h
bluetoothengine/bteng/inc/btotgpairpub.inl
bluetoothengine/bteng/src/btengclient.cpp
bluetoothengine/bteng/src/btengincpair.cpp
bluetoothengine/bteng/src/btengotgpair.cpp
bluetoothengine/bteng/src/btengpairbase.cpp
bluetoothengine/bteng/src/btengpairman.cpp
bluetoothengine/bteng/src/btengserver.cpp
bluetoothengine/bteng/src/btengsrvbbconnectionmgr.cpp
bluetoothengine/bteng/src/btengsrvkeywatcher.cpp
bluetoothengine/bteng/src/btengsrvpluginmgr.cpp
bluetoothengine/bteng/src/btengsrvsession.cpp
bluetoothengine/bteng/src/btengsrvsettingsmgr.cpp
bluetoothengine/bteng/src/btengsrvstate.cpp
bluetoothengine/bthid/bthidkbdsettings/group/bld.inf
bluetoothengine/bthid/bthidkbdsettings/inc/bthidsettingcontainer.h
bluetoothengine/bthid/bthidkbdsettings/inc/bthidsettinglist.h
bluetoothengine/bthid/bthidkbdsettings/inc/bthidsettingview.h
bluetoothengine/bthid/bthidkbdsettings/inc/btkeyenumtextsettingitem.h
bluetoothengine/bthid/bthidkbdsettings/src/bthidpluginimplementationtable.cpp
bluetoothengine/bthid/bthidkbdsettings/src/bthidsettingcontainer.cpp
bluetoothengine/bthid/bthidkbdsettings/src/bthidsettingview.cpp
bluetoothengine/bthid/bthidkbdsettings/src/btkeyenumtextsettingitem.cpp
bluetoothengine/bthid/bthidkbdsettings/src/btkeysettinglist.cpp
bluetoothengine/bthid/rom/btkeyboard.iby
bluetoothengine/bthid/rom/btkeyboard_resources.iby
bluetoothengine/btmac/group/BTMonoCmdHandler.mmp
bluetoothengine/btmac/inc/atcodec/ATCodecDefs.h
bluetoothengine/btmac/src/BTMonoCmdHandler/btmcprotocol.cpp
bluetoothengine/btnotif/bmarm/Btnotifu.def
bluetoothengine/btnotif/btdevicedialogplugin/btdevicedialogplugin.pro
bluetoothengine/btnotif/btdevicedialogplugin/btdevicedialogplugin.qrc
bluetoothengine/btnotif/btdevicedialogplugin/docml/bt-device-search-dialog.docml
bluetoothengine/btnotif/btdevicedialogplugin/icons/qgn_prop_sml_bt.svg
bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialoginputwidget.h
bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialognotifwidget.h
bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialogplugin.h
bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialogpluginerrors.h
bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialogplugintrace.h
bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialogquerywidget.h
bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicesearchdialogwidget.h
bluetoothengine/btnotif/btdevicedialogplugin/rom/btdevicedialogplugin.iby
bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicedialoginputwidget.cpp
bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicedialognotifwidget.cpp
bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicedialogplugin.cpp
bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicedialogquerywidget.cpp
bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicesearchdialogwidget.cpp
bluetoothengine/btnotif/btnotifclient/bwins/btnotifclientu.def
bluetoothengine/btnotif/btnotifclient/eabi/btnotifclientu.def
bluetoothengine/btnotif/btnotifclient/group/bld.inf
bluetoothengine/btnotif/btnotifclient/group/btnotifclient.mmp
bluetoothengine/btnotif/btnotifclient/inc/btnotifclient.h
bluetoothengine/btnotif/btnotifclient/rom/btnotifclient.iby
bluetoothengine/btnotif/btnotifclient/src/btnotifclient.cpp
bluetoothengine/btnotif/btnotifsrv/inc/bluetoothnotification.h
bluetoothengine/btnotif/btnotifsrv/inc/btnotifconnection.h
bluetoothengine/btnotif/btnotifsrv/inc/btnotifconnectiontracker.h
bluetoothengine/btnotif/btnotifsrv/inc/btnotifdeviceselector.h
bluetoothengine/btnotif/btnotifsrv/inc/btnotificationmanager.h
bluetoothengine/btnotif/btnotifsrv/inc/btnotificationresult.h
bluetoothengine/btnotif/btnotifsrv/inc/btnotifpairinghelper.h
bluetoothengine/btnotif/btnotifsrv/inc/btnotifserver.h
bluetoothengine/btnotif/btnotifsrv/inc/btnotifserversecpolicy.h
bluetoothengine/btnotif/btnotifsrv/inc/btnotifsession.h
bluetoothengine/btnotif/btnotifsrv/inc/btnotifsettingstracker.h
bluetoothengine/btnotif/btnotifsrv/inc/traceconfig.h
bluetoothengine/btnotif/btnotifsrv/src/bluetoothnotification.cpp
bluetoothengine/btnotif/btnotifsrv/src/btnotifconnection.cpp
bluetoothengine/btnotif/btnotifsrv/src/btnotifconnectiontracker.cpp
bluetoothengine/btnotif/btnotifsrv/src/btnotifdeviceselector.cpp
bluetoothengine/btnotif/btnotifsrv/src/btnotificationmanager.cpp
bluetoothengine/btnotif/btnotifsrv/src/btnotifpairinghelper.cpp
bluetoothengine/btnotif/btnotifsrv/src/btnotifserver.cpp
bluetoothengine/btnotif/btnotifsrv/src/btnotifsession.cpp
bluetoothengine/btnotif/btnotifsrv/src/btnotifsettingstracker.cpp
bluetoothengine/btnotif/btnotifwrapper/data/101fd68f.rss
bluetoothengine/btnotif/btnotifwrapper/inc/btnotifwrapper.h
bluetoothengine/btnotif/btnotifwrapper/src/btnotifwrapper.cpp
bluetoothengine/btnotif/btnotifwrapper/src/btnotifwrapperproxy.cpp
bluetoothengine/btnotif/bwins/Btnotifu.def
bluetoothengine/btnotif/data/BTNotif.rss
bluetoothengine/btnotif/eabi/BTNotifu.DEF
bluetoothengine/btnotif/ecom/101FD68F.rss
bluetoothengine/btnotif/ecom/BtnotifWrapper.cpp
bluetoothengine/btnotif/ecom/BtnotifWrapper.mmp
bluetoothengine/btnotif/group/BTNotif.mmp
bluetoothengine/btnotif/group/bld.inf
bluetoothengine/btnotif/group/btnotif_icons_dc.mk
bluetoothengine/btnotif/group/btnotifsrv.mmp
bluetoothengine/btnotif/group/btnotifwrapper.mmp
bluetoothengine/btnotif/inc/BTNGenericInfoNotifier.h
bluetoothengine/btnotif/inc/BTNGenericQueryNotifier.h
bluetoothengine/btnotif/inc/bluetoothdevicedialogs.h
bluetoothengine/btnotif/inc/bluetoothtrace.h
bluetoothengine/btnotif/inc/btNotifDebug.h
bluetoothengine/btnotif/inc/btnauthnotifier.h
bluetoothengine/btnotif/inc/btnenterpriseitsecurityinfonotifier.h
bluetoothengine/btnotif/inc/btninqnotifier.h
bluetoothengine/btnotif/inc/btninqui.h
bluetoothengine/btnotif/inc/btnobexpinnotifier.h
bluetoothengine/btnotif/inc/btnotif.hrh
bluetoothengine/btnotif/inc/btnotifactive.h
bluetoothengine/btnotif/inc/btnotifactive.inl
bluetoothengine/btnotif/inc/btnotifclientserver.h
bluetoothengine/btnotif/inc/btnotifier.h
bluetoothengine/btnotif/inc/btnotiflock.h
bluetoothengine/btnotif/inc/btnotiflock.inl
bluetoothengine/btnotif/inc/btnotifnameutils.h
bluetoothengine/btnotif/inc/btnotifpanic.h
bluetoothengine/btnotif/inc/btnotifuiutil.h
bluetoothengine/btnotif/inc/btnpaireddevsettnotifier.h
bluetoothengine/btnotif/inc/btnpairnotifier.h
bluetoothengine/btnotif/inc/btnpbappinnotifier.h
bluetoothengine/btnotif/inc/btnpinnotifier.h
bluetoothengine/btnotif/inc/btnpwrnotifier.h
bluetoothengine/btnotif/inc/btnssppasskeyentrynotifier.h
bluetoothengine/btnotif/inc/btnumcmpnotifier.h
bluetoothengine/btnotif/inc/btuserconfnotifier.h
bluetoothengine/btnotif/inc/devui_const.h
bluetoothengine/btnotif/loc/btnotif.loc
bluetoothengine/btnotif/rom/Btnotif.iby
bluetoothengine/btnotif/rom/BtnotifResources.iby
bluetoothengine/btnotif/src/BTNAuthNotifier.cpp
bluetoothengine/btnotif/src/BTNGenericInfoNotifier.cpp
bluetoothengine/btnotif/src/BTNGenericQueryNotifier.cpp
bluetoothengine/btnotif/src/BTNInqNotifier.cpp
bluetoothengine/btnotif/src/BTNInqUI.cpp
bluetoothengine/btnotif/src/BTNInquiAO.cpp
bluetoothengine/btnotif/src/BTNMain.cpp
bluetoothengine/btnotif/src/BTNObexPinNotifier.cpp
bluetoothengine/btnotif/src/BTNPBAPPinNotifier.cpp
bluetoothengine/btnotif/src/BTNPinNotifier.cpp
bluetoothengine/btnotif/src/BTNPwrNotifier.cpp
bluetoothengine/btnotif/src/BTNotifier.cpp
bluetoothengine/btnotif/src/btnenterpriseitsecurityinfonotifier.cpp
bluetoothengine/btnotif/src/btnotifactive.cpp
bluetoothengine/btnotif/src/btnotifnameutils.cpp
bluetoothengine/btnotif/src/btnotifuiutil.cpp
bluetoothengine/btnotif/src/btnpaireddevsettnotifier.cpp
bluetoothengine/btnotif/src/btnpairnotifier.cpp
bluetoothengine/btnotif/src/btnssppasskeyentrynotifier.cpp
bluetoothengine/btnotif/src/btnumcmpnotifier.cpp
bluetoothengine/btnotif/src/btuserconfnotifier.cpp
bluetoothengine/btnotif/tsrc/BtNotifApiTest/Bmarm/BtNotifApiTestU.DEF
bluetoothengine/btnotif/tsrc/BtNotifApiTest/Bwins/BtNotifApiTestU.DEF
bluetoothengine/btnotif/tsrc/BtNotifApiTest/EABI/BtNotifApiTestU.def
bluetoothengine/btnotif/tsrc/BtNotifApiTest/conf/ui_BtNotifApiTest.cfg
bluetoothengine/btnotif/tsrc/BtNotifApiTest/group/BtNotifApiTest.mmp
bluetoothengine/btnotif/tsrc/BtNotifApiTest/group/BtNotifApiTest.pkg
bluetoothengine/btnotif/tsrc/BtNotifApiTest/group/BtNotifApiTest_phone.pkg
bluetoothengine/btnotif/tsrc/BtNotifApiTest/group/bld.inf
bluetoothengine/btnotif/tsrc/BtNotifApiTest/group/build_sis.bat
bluetoothengine/btnotif/tsrc/BtNotifApiTest/group/build_sis_phone.bat
bluetoothengine/btnotif/tsrc/BtNotifApiTest/inc/BtEngDevManObserver.h
bluetoothengine/btnotif/tsrc/BtNotifApiTest/inc/BtNotifApiTest.h
bluetoothengine/btnotif/tsrc/BtNotifApiTest/inc/BtSettingsObserver.h
bluetoothengine/btnotif/tsrc/BtNotifApiTest/init/BtNotifApiTest.ini
bluetoothengine/btnotif/tsrc/BtNotifApiTest/init/BtNotifApiTest_phone.ini
bluetoothengine/btnotif/tsrc/BtNotifApiTest/src/BtEngDevManObserver.cpp
bluetoothengine/btnotif/tsrc/BtNotifApiTest/src/BtNotifApiTest.cpp
bluetoothengine/btnotif/tsrc/BtNotifApiTest/src/BtNotifApiTestBlocks.cpp
bluetoothengine/btnotif/tsrc/BtNotifApiTest/src/BtSettingsObserver.cpp
bluetoothengine/btserviceutil/bwins/btserviceutilu.def
bluetoothengine/btserviceutil/eabi/btserviceutilu.def
bluetoothengine/btserviceutil/export/advancedevdiscoverer.h
bluetoothengine/btserviceutil/export/btdevextension.h
bluetoothengine/btserviceutil/export/btdevrepository.h
bluetoothengine/btserviceutil/export/btsimpleactive.h
bluetoothengine/btserviceutil/export/devdiscoveryobserver.h
bluetoothengine/btserviceutil/group/bld.inf
bluetoothengine/btserviceutil/group/btserviceutil.mmp
bluetoothengine/btserviceutil/inc/advancedevdiscovererimpl.h
bluetoothengine/btserviceutil/inc/basicdevdiscoverer.h
bluetoothengine/btserviceutil/inc/btdevrepositoryimpl.h
bluetoothengine/btserviceutil/inc/btserviceutilconsts.h
bluetoothengine/btserviceutil/rom/btserviceutil.iby
bluetoothengine/btserviceutil/src/advancebtdevdiscoverer.cpp
bluetoothengine/btserviceutil/src/advancedevdiscovererimpl.cpp
bluetoothengine/btserviceutil/src/basicdevdiscoverer.cpp
bluetoothengine/btserviceutil/src/btdevextension.cpp
bluetoothengine/btserviceutil/src/btdevrepository.cpp
bluetoothengine/btserviceutil/src/btdevrepositoryimpl.cpp
bluetoothengine/btserviceutil/src/btsimpleactive.cpp
bluetoothengine/btui/Ecom/data/1020742B.rss
bluetoothengine/btui/Ecom/data/BtuiViewResources.rss
bluetoothengine/btui/Ecom/group/BtuiPlugin.mmp
bluetoothengine/btui/Ecom/group/bld.inf
bluetoothengine/btui/Ecom/inc/BTUIActive.h
bluetoothengine/btui/Ecom/inc/BTUIBlockedDevicesView.h
bluetoothengine/btui/Ecom/inc/BTUIDeviceContainer.h
bluetoothengine/btui/Ecom/inc/BTUIKeyWatcher.h
bluetoothengine/btui/Ecom/inc/BTUIListedDevicesView.h
bluetoothengine/btui/Ecom/inc/BTUIMainContainer.h
bluetoothengine/btui/Ecom/inc/BTUIMainView.h
bluetoothengine/btui/Ecom/inc/BTUIPairedDevicesView.h
bluetoothengine/btui/Ecom/inc/BTUIRegistryWatcher.h
bluetoothengine/btui/Ecom/inc/BTUIViewsCommonUtils.h
bluetoothengine/btui/Ecom/inc/bluetoothuiutil.h
bluetoothengine/btui/Ecom/inc/bluetoothuiutil.inl
bluetoothengine/btui/Ecom/inc/btuipluginman.h
bluetoothengine/btui/Ecom/src/BTUIActive.cpp
bluetoothengine/btui/Ecom/src/BTUIBlockedDevicesView.cpp
bluetoothengine/btui/Ecom/src/BTUIDeviceContainer.cpp
bluetoothengine/btui/Ecom/src/BTUIKeyWatcher.cpp
bluetoothengine/btui/Ecom/src/BTUIMainContainer.cpp
bluetoothengine/btui/Ecom/src/BTUIMainView.cpp
bluetoothengine/btui/Ecom/src/BTUINonSap.cpp
bluetoothengine/btui/Ecom/src/BTUIPairedDevicesView.cpp
bluetoothengine/btui/Ecom/src/BTUIRegistryWatcher.cpp
bluetoothengine/btui/Ecom/src/BTUISap.cpp
bluetoothengine/btui/Ecom/src/BTUIViewsCommonUtils.cpp
bluetoothengine/btui/Ecom/src/BtuiPluginImplementationTable.cpp
bluetoothengine/btui/Ecom/src/btuipluginman.cpp
bluetoothengine/btui/aif/BTUI_caption.rss
bluetoothengine/btui/aif/BTUIaif.rss
bluetoothengine/btui/btcpplugin/btcpplugin.cpp
bluetoothengine/btui/btcpplugin/btcpplugin.h
bluetoothengine/btui/btcpplugin/btcpplugin.pro
bluetoothengine/btui/btcpplugin/btcpplugin.qrc
bluetoothengine/btui/btcpplugin/btcpuibaseview.cpp
bluetoothengine/btui/btcpplugin/btcpuibaseview.h
bluetoothengine/btui/btcpplugin/btcpuimainview.cpp
bluetoothengine/btui/btcpplugin/btcpuimainview.h
bluetoothengine/btui/btcpplugin/btcpuisearchview.cpp
bluetoothengine/btui/btcpplugin/btcpuisearchview.h
bluetoothengine/btui/btcpplugin/btcpuisettingitem.cpp
bluetoothengine/btui/btcpplugin/btcpuisettingitem.h
bluetoothengine/btui/btcpplugin/docml/bt-main-view.docml
bluetoothengine/btui/btcpplugin/docml/bt-search-view.docml
bluetoothengine/btui/btcpplugin/icons/qgn_frwidget_add_friend_photo.svg
bluetoothengine/btui/btcpplugin/icons/qgn_graf_blid_det_circle.svg
bluetoothengine/btui/btcpplugin/icons/qgn_graf_blid_time.svg
bluetoothengine/btui/btcpplugin/icons/qgn_indi_bt_blocked.svg
bluetoothengine/btui/btcpplugin/icons/qgn_indi_bt_paired_add.svg
bluetoothengine/btui/btcpplugin/icons/qgn_indi_bt_trusted_add.svg
bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_audio.svg
bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_blocked_tab3.svg
bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_car_kit.svg
bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_carkit.svg
bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_computer.svg
bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_connected.svg
bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_headset.svg
bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_keyboard.svg
bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_misc.svg
bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_mouse.svg
bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_phone.svg
bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_printer.svg
bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_unknown.svg
bluetoothengine/btui/btui.pro
bluetoothengine/btui/btuidelegate/btabstractdelegate.cpp
bluetoothengine/btui/btuidelegate/btabstractdelegate.h
bluetoothengine/btui/btuidelegate/btdelegateconsts.h
bluetoothengine/btui/btuidelegate/btdelegatedevname.cpp
bluetoothengine/btui/btuidelegate/btdelegatedevname.h
bluetoothengine/btui/btuidelegate/btdelegatefactory.cpp
bluetoothengine/btui/btuidelegate/btdelegatefactory.h
bluetoothengine/btui/btuidelegate/btdelegatepower.cpp
bluetoothengine/btui/btuidelegate/btdelegatepower.h
bluetoothengine/btui/btuidelegate/btdelegatevisibility.cpp
bluetoothengine/btui/btuidelegate/btdelegatevisibility.h
bluetoothengine/btui/btuidelegate/btuidelegate.pro
bluetoothengine/btui/btuimodel/activewrapper.cpp
bluetoothengine/btui/btuimodel/activewrapper.h
bluetoothengine/btui/btuimodel/btdevicedata.cpp
bluetoothengine/btui/btuimodel/btdevicedata.h
bluetoothengine/btui/btuimodel/btlocalsetting.cpp
bluetoothengine/btui/btuimodel/btlocalsetting.h
bluetoothengine/btui/btuimodel/btuimodel.cpp
bluetoothengine/btui/btuimodel/btuimodel.h
bluetoothengine/btui/btuimodel/btuimodel.pro
bluetoothengine/btui/btuimodel/btuimodelutil.h
bluetoothengine/btui/bwins/btuidelegateu.def
bluetoothengine/btui/bwins/btuimodelu.def
bluetoothengine/btui/data/BTUI.rss
bluetoothengine/btui/data/Btui_reg.rss
bluetoothengine/btui/devmodel/BWINS/btdevmodelU.DEF
bluetoothengine/btui/devmodel/eabi/btdevmodelu.DEF
bluetoothengine/btui/devmodel/group/bld.inf
bluetoothengine/btui/devmodel/group/btdevmodel.mmp
bluetoothengine/btui/devmodel/inc/btblockedmodel.h
bluetoothengine/btui/devmodel/inc/btdevmodel.h
bluetoothengine/btui/devmodel/inc/btdevmodelbase.h
bluetoothengine/btui/devmodel/inc/btpairedmodel.h
bluetoothengine/btui/devmodel/inc/btregistryobserver.h
bluetoothengine/btui/devmodel/src/btblockedmodel.cpp
bluetoothengine/btui/devmodel/src/btdevice.cpp
bluetoothengine/btui/devmodel/src/btdevmodel.cpp
bluetoothengine/btui/devmodel/src/btdevmodelbase.cpp
bluetoothengine/btui/devmodel/src/btpairedmodel.cpp
bluetoothengine/btui/devmodel/src/btregistryobserver.cpp
bluetoothengine/btui/eabi/btuidelegateu.def
bluetoothengine/btui/eabi/btuimodelu.def
bluetoothengine/btui/group/BTUI.mmp
bluetoothengine/btui/group/bld.inf
bluetoothengine/btui/group/btui_Icons_aif_bitmaps_dc.mk
bluetoothengine/btui/group/btui_Icons_aif_scalable_dc.mk
bluetoothengine/btui/group/btui_icons_dc.mk
bluetoothengine/btui/help/data/xhtml.zip
bluetoothengine/btui/help/group/bld.inf
bluetoothengine/btui/help/inc/bt.hlp.hrh
bluetoothengine/btui/help/rom/btuihelps_variant.iby
bluetoothengine/btui/inc/BTUIApp.h
bluetoothengine/btui/inc/BTUIAppUi.h
bluetoothengine/btui/inc/BTUIDocument.h
bluetoothengine/btui/inc/BtuiPluginInterface.h
bluetoothengine/btui/inc/BtuiPluginInterface.inl
bluetoothengine/btui/inc/bluetoothtrace.h
bluetoothengine/btui/inc/bluetoothuitrace.h
bluetoothengine/btui/inc/btqtconstants.h
bluetoothengine/btui/inc/btui.h
bluetoothengine/btui/inc/btui.hrh
bluetoothengine/btui/inc/debug.h
bluetoothengine/btui/inc/debugconfig.h
bluetoothengine/btui/inc/prjconfig.h
bluetoothengine/btui/inc/traceconfig.h
bluetoothengine/btui/loc/btui.loc
bluetoothengine/btui/rom/BtuiResources.iby
bluetoothengine/btui/rom/btui.iby
bluetoothengine/btui/src/BTUIApp.cpp
bluetoothengine/btui/src/BTUIAppUi.cpp
bluetoothengine/btui/src/BTUIDocument.cpp
bluetoothengine/group/bld.inf
btservices_plat/bluetooth_engine_connection_management_api/inc/btengconnman.h
btservices_plat/bluetooth_secondary_display_notification_api/group/bld.inf
cbsatplugin/atmisccmdplugin/rom/atmisccmdplugin.iby
layers.sysdef.xml
package_definition.xml
sysdef_1_4_0.dtd
sysdef_1_5_1.dtd
--- a/bluetoothappprofiles/avrcp/avc/avcframe.h	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothappprofiles/avrcp/avc/avcframe.h	Fri May 14 16:01:46 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -512,26 +512,26 @@
 // Factory pattern stuff - these are useful to do donkey work,
 // but have existing clients treat them as the base class
 
-class CAVCVendorDependentResponse
+class CAVCVendorDependentResponse			// codescanner::missingcclass
 	{
 public:
 	IMPORT_C static CAVCFrame* NewL(TUint aVendorId);
 	};
 
-class CAVCPassthroughCommand
+class CAVCPassthroughCommand				// codescanner::missingcclass
 	{
 public:
 	};
 
 // likely not have newl because dont allocate on parse pattern
-class CAVCVendorDependentCommand
+class CAVCVendorDependentCommand			// codescanner::missingcclass
 	{
 public:
 	IMPORT_C static TPtrC8 GetPayloadAndVID(const CAVCFrame& aFrame, TUint& aVID);
 	};
 	
 // likely not have newl because dont allocate on parse pattern
-class CAVCVendorUniquePassthroughCommand
+class CAVCVendorUniquePassthroughCommand	// codescanner::missingcclass
 	{
 public:
 	IMPORT_C static TPtrC8 GetPayloadAndVID(const CAVCFrame& aFrame, TUint& aVID);
--- a/bluetoothappprofiles/avrcp/mediabrowseapi/public/remconmediabrowsepanic.h	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothappprofiles/avrcp/mediabrowseapi/public/remconmediabrowsepanic.h	Fri May 14 16:01:46 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -39,6 +39,7 @@
 	ESearchResultWithoutRequest = 6,
 	/** The value of the media library state cookie must not be zero. */
 	EZeroMediaLibraryStateCookie = 7,
+	EUnexpectedNullMemberField = 8,
 	};
 
 class MediaBrowsePanic
--- a/bluetoothappprofiles/avrcp/mediabrowseapi/src/remconmediabrowsetargetbase.cpp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothappprofiles/avrcp/mediabrowseapi/src/remconmediabrowsetargetbase.cpp	Fri May 14 16:01:46 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -73,12 +73,16 @@
 	{
 	}
 
-CRemConMediaBrowseTargetBase::~CRemConMediaBrowseTargetBase()
+CRemConMediaBrowseTargetBase::~CRemConMediaBrowseTargetBase()		// codescanner::destructor
 	{
 	iMediaAttributeIds.Close();
 	iNullArray.Close();
 	iOutBuf.Close();
 	iSearchString.Close();
+
+	// iGetPathResponse, iGiaResponse and iGflResponse are instantiated in CRemConMediaBrowseTargetBase::BaseConstructL() and
+	// so should have the same lifetime as this CRemConMediaBrowseTargetBase instance
+	__ASSERT_DEBUG(iGetPathResponse && iGiaResponse && iGflResponse, MediaBrowsePanic::Panic(EUnexpectedNullMemberField));
 	iGetPathResponse->Close();
 	iGiaResponse->Close();
 	iGflResponse->Close();
--- a/bluetoothappprofiles/avrcp/playerinformation/src/playerapplicationsetting.cpp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothappprofiles/avrcp/playerinformation/src/playerapplicationsetting.cpp	Fri May 14 16:01:46 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -30,7 +30,7 @@
 
 CPlayerApplicationSettings* CPlayerApplicationSettings::NewL( TUint aAttributeID,
 		TDesC8& 						aAttributeText,
-		RArray<TUint> 					aValues,
+		const RArray<TUint>& 			aValues,
 		RArray<TPtrC8>&					aValueTexts,
 		TUint 							aInitialValue )
 	{
@@ -55,7 +55,7 @@
 
 void CPlayerApplicationSettings::ConstructL(TUint aAttributeID,
 		TDesC8& 						aAttributeText,
-		RArray<TUint> 					aValues,
+		const RArray<TUint>& 			aValues,
 		RArray<TPtrC8>&					aValueText,
 		TUint 							aInitialValue )
 	{
--- a/bluetoothappprofiles/avrcp/playerinformation/src/playerapplicationsetting.h	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothappprofiles/avrcp/playerinformation/src/playerapplicationsetting.h	Fri May 14 16:01:46 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -42,7 +42,7 @@
 	*/
 	static CPlayerApplicationSettings* NewL( TUint aAttributeID,
 		TDesC8& 						aAttributeText,
-		RArray<TUint> 					aValues,
+		const RArray<TUint>& 			aValues,
 		RArray<TPtrC8>&					aValueTexts,
 		TUint 							aInitialValue );
 	
@@ -65,7 +65,7 @@
 
 	void ConstructL(TUint aAttributeID,
 		TDesC8& 						aAttributeText,
-		RArray<TUint> 					aValues,
+		const RArray<TUint>& 			aValues,
 		RArray<TPtrC8>&					aValueText,
 		TUint 							aInitialValue );
 
--- a/bluetoothappprofiles/avrcp/remconbeareravrcp/inc/playerbitmasks.h	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothappprofiles/avrcp/remconbeareravrcp/inc/playerbitmasks.h	Fri May 14 16:01:46 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -176,11 +176,11 @@
 	
 	inline const TDesC8& FeatureBitmask() const;
 
-	void SetCoreApiFeatures(RArray<TUint> aOperation);
-	void SetAbsoluteVolumeApiFeatures(RArray<TUint> aOperation);
-	void SetGroupNavigationApiFeatures(RArray<TUint> aOperation);
-	void SetNowPlayingApiFeatures(RArray<TUint> aOperation);
-	void SetMediaBrowseApiFeatures(RArray<TUint> aOperation);
+	void SetCoreApiFeatures(const RArray<TUint>& aOperation);
+	void SetAbsoluteVolumeApiFeatures(const RArray<TUint>& aOperation);
+	void SetGroupNavigationApiFeatures(const RArray<TUint>& aOperation);
+	void SetNowPlayingApiFeatures(const RArray<TUint>& aOperation);
+	void SetMediaBrowseApiFeatures(const RArray<TUint>& aOperation);
 
 private:
 	void SetCoreApiFeatures();
--- a/bluetoothappprofiles/avrcp/remconbeareravrcp/src/playerbitmasks.cpp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothappprofiles/avrcp/remconbeareravrcp/src/playerbitmasks.cpp	Fri May 14 16:01:46 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -33,7 +33,7 @@
 	iFeatureBitmask.Copy(aFeatureBitmask.FeatureBitmask());
 	}
 
-void TPlayerFeatureBitmask::SetCoreApiFeatures(RArray<TUint> aOperation)
+void TPlayerFeatureBitmask::SetCoreApiFeatures(const RArray<TUint>& aOperation)
 	{
 	if(aOperation.Count() > 0)
 		{
@@ -282,7 +282,7 @@
 	iFeatureBitmask[EF5ByteOffset]|= (1<<EF5BitOffset);
 	}
 
-void TPlayerFeatureBitmask::SetAbsoluteVolumeApiFeatures(RArray<TUint> aOperation)
+void TPlayerFeatureBitmask::SetAbsoluteVolumeApiFeatures(const RArray<TUint>& aOperation)
 	{
 	if(aOperation.Count())
 		{
@@ -290,7 +290,7 @@
 		}
 	}
 
-void TPlayerFeatureBitmask::SetGroupNavigationApiFeatures(RArray<TUint> aOperation)
+void TPlayerFeatureBitmask::SetGroupNavigationApiFeatures(const RArray<TUint>& aOperation)
 	{
 	if(aOperation.Count())
 		{
@@ -299,7 +299,7 @@
 		}
 	}
 
-void TPlayerFeatureBitmask::SetNowPlayingApiFeatures(RArray<TUint> aOperation)
+void TPlayerFeatureBitmask::SetNowPlayingApiFeatures(const RArray<TUint>& aOperation)
 	{
 	if(aOperation.Count())
 		{
@@ -313,7 +313,7 @@
 		}
 	}
 
-void TPlayerFeatureBitmask::SetMediaBrowseApiFeatures(RArray<TUint> aOperation)
+void TPlayerFeatureBitmask::SetMediaBrowseApiFeatures(const RArray<TUint>& aOperation)
 	{
 	if(aOperation.Count())
 		{
--- a/bluetoothengine/bteng/btbearer/inc/btpluginnotifier.h	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/btbearer/inc/btpluginnotifier.h	Fri May 14 16:01:46 2010 +0300
@@ -89,6 +89,11 @@
      * @since S60 v3.2
      */
     void SubscribeL();
+    
+    /**
+     * Handles service load/unload when BT power changes.
+     */
+    void HandleBtPowerChanged( TBTPowerStateValue aPower );
 
 // from base class CActive
 
--- a/bluetoothengine/bteng/btbearer/src/btpluginnotifier.cpp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/btbearer/src/btpluginnotifier.cpp	Fri May 14 16:01:46 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -23,6 +23,7 @@
 #include "btpluginnotifier.h"
 #include "debug.h"
 #include <btfeaturescfg.h>
+#include <btnotifclient.h>
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -68,9 +69,9 @@
         TRACE_INFO( ( _L( "Turning BT on" ) ) )
         TInt err = settings->SetPowerState( EBTPowerOn );
         TRACE_INFO( ( _L( "SetPowerState returned %d" ), err ) )
-        if( !err )
+        if ( !err )
             {
-            iHandler.NotifyBearerStatus( ELocodBearerBT, power );
+            HandleBtPowerChanged( EBTPowerOn );
             }
         }
     else
@@ -129,6 +130,30 @@
     SetActive();
     }
 
+// ---------------------------------------------------------------------------
+// Handles power state change. Inform Locod. In addition, if BT is on, start
+// btnotifier server.
+// ---------------------------------------------------------------------------
+//
+void CBTPluginNotifier::HandleBtPowerChanged( TBTPowerStateValue aPower )
+    {
+    TRACE_FUNC_ARG( ( _L( " to %d" ), aPower ) )
+    TInt err (KErrNone );
+    if ( aPower == EBTPowerOn )
+        {
+        // Start BT notifier server by creating a session with it:
+        RBTNotifier btnotif;
+        err = btnotif.Connect();
+        TRACE_INFO( ( _L( "start bt notifier server %d" ), err ) )
+        // btnotif server manages its lifecycle. no need
+        // to keep this session:
+        btnotif.Close();
+        }
+    if ( !err )
+        {
+        iHandler.NotifyBearerStatus( ELocodBearerBT, aPower );
+        }
+    }
 
 // ---------------------------------------------------------------------------
 // From class CActive.
@@ -162,9 +187,12 @@
         case EKeyInt:
             {
             TRACE_INFO( ( _L( "[CBTPluginNotifier::RunL2 %d]" ), status ) )
-            TInt newValue = 1;
-            iSession->Get( iId, newValue );
-            iHandler.NotifyBearerStatus( ELocodBearerBT, newValue );
+            TInt newValue = EBTPowerOff;
+            TInt err = iSession->Get( iId, newValue );
+            if ( !err )
+                {
+                HandleBtPowerChanged( static_cast<TBTPowerStateValue>( newValue ) );
+                }
             }
             break;
         default:
--- a/bluetoothengine/bteng/btengconnman/inc/btengconnhandler.h	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/btengconnman/inc/btengconnhandler.h	Fri May 14 16:01:46 2010 +0300
@@ -146,18 +146,7 @@
      * @since S60 v3.2
      * @return ?description
      */
-    TInt CancelNotifyConnectionEvents();
-
-    /**
-     * Set a pairing observer in BTEngine.
-     *
-     * @since S60 v3.2
-     * @param aAddr The address of the remote device that is being paired.
-     * @param aActivate If ETrue, the observer will be activated, otherwise
-     *                  the observer will be removed.
-     * @return KErrNone on success, otherwise a system-wide error code.
-     */
-    static TInt SetPairingObserver( const TBTDevAddr& aAddr, TBool aActivate );
+    void CancelNotifyConnectionEvents();
 
     /**
      * ?description
@@ -166,22 +155,6 @@
      * @return ?description
      */
     inline TInt PrepareDiscovery();
-
-
-    /**
-     * Pair a device
-     *
-     * @since S60 v5.1
-     * @param aAddr the address of the device to pair with
-     * @param aDeviceClass the device class of the device to pair with
-     * @return KErrNone if this request has been accepted; an error situation otherwise.
-     */
-    TInt StartPairing( const TBTDevAddr& aAddr, const TBTDeviceClass& aDeviceClass );
-
-    /**
-     * cancel the outstanding pairing request.
-     */
-    void CancelPairing();
     
 private:
 // from base class MBTEngActiveObserver
@@ -192,15 +165,22 @@
      *
      * @since S60 v3.2
      */
-    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aId, TInt aStatus );
+    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aStatus );
 
     /**
+     * Callback for handling cancelation of an outstanding request.
+     *
+     * @param aId The ID that identifies the outstanding request.
+     */
+    virtual void CancelRequest( TInt aRequestId );
+    
+    /**
      * From MBTEngActiveObserver.
      * Handles an error during processing of connection status event.
      *
      * @since S60 v3.2
      */
-    virtual void HandleError( CBTEngActive* aActive, TInt aId, TInt aError );
+    virtual void HandleError( CBTEngActive* aActive, TInt aError );
 
 private:
 
@@ -222,16 +202,6 @@
      * Client-server package to which the event result is copied.
      */
     TBTEngEventPkg iEventPkg;
-
-    /**
-     * Address of the remote device to pair with.
-     */
-    TBTDevAddrPckgBuf iPairAddr;
-    
-    /**
-     * The CoD of the remote device to pair with.
-     */
-    TUint32 iPairDevCod;
     
     /**
      * Session with BTEng server side.
@@ -243,12 +213,6 @@
      * Own.
      */
     CBTEngActive* iConnEventActive;
-
-    /**
-     * The actual active object for pairing a device.
-     * Own.
-     */
-    CBTEngActive* iPairActive;
     
     /**
      * Reference to receiver of connection events.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/bteng/btengconnman/inc/btengpairinghandler.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,155 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Bluetooth Engine API for connection management functionality.
+*
+*/
+
+#ifndef BTENGPAIRINGHANDLER_H
+#define BTENGPAIRINGHANDLER_H
+
+#include <btnotifclient.h>
+#include <btmanclient.h>
+
+#include "btengactive.h"
+
+class CBTEngConnMan;
+class MBTEngConnObserver;
+
+
+/**
+ *  ?one_line_short_description
+ *
+ *  ?more_complete_description
+ *
+ *  @lib ?library
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CBTEngPairingHandler ) : public CBase, public MBTEngActiveObserver
+    {
+
+public:
+
+    /**
+     * Two-phase constructor
+     */
+    static CBTEngPairingHandler* NewL( MBTEngConnObserver* aObserver, 
+                                        CBTEngConnMan* aParent );
+
+    /**
+     * Destructor
+     */
+    virtual ~CBTEngPairingHandler();
+
+    /**
+     * ?description
+     *
+     * @since S60 v3.2
+     * @param ?arg1 ?description
+     * @param ?arg2 ?description
+     * @return ?description
+     */
+    void StartPairingL( const TBTDevAddr& aAddr, TBTDeviceClass& aDeviceClass );
+
+    /**
+     * ?description
+     *
+     * @since S60 v3.2
+     * @param ?arg1 ?description
+     * @param ?arg2 ?description
+     * @return ?description
+     */
+    void CancelPairing();   
+
+// from base class MBTEngActiveObserver
+
+    /**
+     * From MBTEngActiveObserver.
+     * ?description
+     *
+     * @since S60 v3.2
+     * @param ?arg1 ?description
+     */
+    virtual void RequestCompletedL( CBTEngActive* aActive, 
+                                    TInt aStatus );
+
+    /**
+     * Callback for handling cancelation of an outstanding request.
+     *
+     * @param aId The ID that identifies the outstanding request.
+     */
+    virtual void CancelRequest( TInt aRequestId );
+    
+    /**
+     * From MBTEngActiveObserver.
+     * ?description
+     *
+     * @since S60 v3.2
+     * @param ?arg1 ?description
+     */
+    virtual void HandleError( CBTEngActive* aActive, 
+                                    TInt aError );
+
+private:
+
+    /**
+     * C++ default constructor
+     */
+    CBTEngPairingHandler( MBTEngConnObserver* aObserver, 
+                           CBTEngConnMan* aParent );
+
+    /**
+     * Symbian 2nd-phase constructor
+     */
+    void ConstructL();
+
+private: // data
+
+    /**
+     * the address of the remote device to be paired.
+     */
+    TBTDevAddrPckgBuf iAddr;
+    
+    /**
+     * the class of device value of the remote device to be paired.
+     */
+    TBTDeviceClass iCod; 
+
+    /**
+     * the session to notifier which handles the actual pairing operation.
+     * Own.
+     */
+    RBTNotifier iBtNotifier;
+
+    /**
+     * Active object for pairing request
+     * Own.
+     */
+    CBTEngActive* iActive;
+
+    /**
+     * the observer that receives the result of pairing operation.
+     * Not own.
+     */
+    MBTEngConnObserver* iObserver;
+
+    /**
+     * ?description_of_pointer_member
+     * Not own.
+     */
+    CBTEngConnMan* iParent;
+
+    };
+
+
+#endif // BTENGPAIRINGHANDLER_H
--- a/bluetoothengine/bteng/btengconnman/src/btengconnhandler.cpp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/btengconnman/src/btengconnhandler.cpp	Fri May 14 16:01:46 2010 +0300
@@ -83,7 +83,6 @@
     {
     TRACE_FUNC_ENTRY
     CancelNotifyConnectionEvents();
-    CancelPairing();
     iBTEng.Close();
     }
 
@@ -146,128 +145,52 @@
 // ?implementation_description
 // ---------------------------------------------------------------------------
 //
-TInt CBTEngConnHandler::CancelNotifyConnectionEvents()
-    {
-    TRACE_FUNC_ENTRY
-    TInt err = KErrNone;
-    if( iConnEventActive && iConnEventActive->IsActive() )
-        {
-        err = iBTEng.CancelNotifyConnectionEvents();
-        iConnEventActive->CancelRequest();
-        }
-    delete iConnEventActive;
-    iConnEventActive = NULL;
-    return err;
-    }
-
-// -----------------------------------------------------------------------------
-// Request server side to activate/deactivate a pair observer
-// -----------------------------------------------------------------------------
-//
-TInt CBTEngConnHandler::SetPairingObserver( const TBTDevAddr& aAddr, 
-    TBool aActivate )
-    {
-    RBTEng bteng;
-    TInt err = bteng.Connect();
-    if ( !err )
-        {
-        err = bteng.SetPairingObserver( aAddr, aActivate );
-        }
-    bteng.Close();
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-// Request BTEng to pair the device
-// ---------------------------------------------------------------------------
-//
-TInt CBTEngConnHandler::StartPairing( const TBTDevAddr& aAddr, 
-    const TBTDeviceClass& aDeviceClass )
+void CBTEngConnHandler::CancelNotifyConnectionEvents()
     {
     TRACE_FUNC_ENTRY
-    TInt err( KErrNone );
-    if( iPairActive && iPairActive->IsActive() )
-        {
-        err = KErrServerBusy;
-        }
-    
-    if( !iPairActive )
-        {
-            // Use a higher prioritty than normal, because we want 
-            // to be notified fast (e.g. to update the UI).
-        TRAP( err, iPairActive = CBTEngActive::NewL( *this, EPairDeviceId, 
-                                                  CActive::EPriorityUserInput ) );
-        }
-    if ( !err )
-        {
-        iPairAddr() = aAddr;
-        iPairDevCod = aDeviceClass.DeviceClass();
-        iBTEng.PairDevice( iPairAddr, iPairDevCod, iPairActive->RequestStatus() );
-        iPairActive->GoActive();
-        }
-    TRACE_FUNC_EXIT
-    return err;
+    delete iConnEventActive;
+    iConnEventActive = NULL;
     }
 
 // ---------------------------------------------------------------------------
-// Cancel any outstanding operation, free resources.
-// ---------------------------------------------------------------------------
-//
-void CBTEngConnHandler::CancelPairing()
-    {
-    TRACE_FUNC_ENTRY
-    if( iPairActive && iPairActive->IsActive() )
-        {
-        iBTEng.CancelPairDevice();
-        }
-    delete iPairActive;
-    iPairActive = NULL;
-    TRACE_FUNC_EXIT
-    }
-
-
-// ---------------------------------------------------------------------------
 // From class MBTEngActiveObserver.
 // Called by the active object when a change in connection status has occured.
 // ---------------------------------------------------------------------------
 //
-void CBTEngConnHandler::RequestCompletedL( CBTEngActive* aActive, TInt aId, 
+void CBTEngConnHandler::RequestCompletedL( CBTEngActive* aActive, 
     TInt aStatus )
     {
-    TRACE_FUNC_ARG( ( _L( "ID: %d status: %d" ), aId, aStatus ) )
-
+    TRACE_FUNC_ARG( ( _L( "ID: %d status: %d" ), aActive->RequestId(), aStatus ) )
     (void) aActive;
-    switch ( aId )
-        {
-        case EConnectionEventId:
-            {
-            HandleConnectionEvent( aStatus );
-            break;
-            }
-        case EPairDeviceId:
-            {
-            if ( iObserver )
-                {
-                iObserver->PairingComplete( iPairAddr(), aStatus );
-                }
-            }
-        }
-
+    ASSERT( aActive->RequestId() == EConnectionEventId );
+    HandleConnectionEvent( aStatus );
     TRACE_FUNC_EXIT
     }
 
+// ---------------------------------------------------------------------------
+// From class MBTEngActiveObserver.
+// Handles cancelation of an outstanding request
+// ---------------------------------------------------------------------------
+//
+void CBTEngConnHandler::CancelRequest( TInt aRequestId )
+    {
+    TRACE_FUNC_ARG( ( _L( "reqID %d" ), aRequestId ) )
+    ASSERT( aRequestId == EConnectionEventId );
+    ( void ) aRequestId;
+    iBTEng.CancelNotifyConnectionEvents();
+    TRACE_FUNC_EXIT 
+    }
 
 // ---------------------------------------------------------------------------
 // From class MBTEngActiveObserver.
 // Called when RequestCompletedL/RunL leaves.
 // ---------------------------------------------------------------------------
 //
-void CBTEngConnHandler::HandleError( CBTEngActive* aActive, TInt aId, TInt aError )
+void CBTEngConnHandler::HandleError( CBTEngActive* aActive, TInt aError )
     {
     TRACE_FUNC_ARG( ( _L( "error: %d" ), aError ) )
         // Should any info be passed to the client??
     (void) aActive;
-    (void) aId;
     (void) aError;
     }
 
--- a/bluetoothengine/bteng/btengconnman/src/btengconnman.cpp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/btengconnman/src/btengconnman.cpp	Fri May 14 16:01:46 2010 +0300
@@ -23,6 +23,7 @@
 
 #include "btengconnman.h"
 #include "btengconnhandler.h"
+#include "btengpairinghandler.h"
 #include "debug.h"
 
 // ======== MEMBER FUNCTIONS ========
@@ -92,6 +93,7 @@
     {
     TRACE_FUNC_ENTRY
     delete iConnHandler;
+    delete iPairingHandler;
     }
 
 
@@ -224,10 +226,21 @@
 EXPORT_C TInt CBTEngConnMan::PairDevice( const TBTDevAddr& aAddr, TBTDeviceClass aDeviceClass )
     {
     TRACE_FUNC_ENTRY
-    return  iConnHandler->StartPairing( aAddr, aDeviceClass );
+    TInt err = KErrNone;
+    if( !iPairingHandler )
+        {
+        TRAP( err, iPairingHandler = CBTEngPairingHandler::NewL( iObserver, this ) );
+        }
+    if( !err )
+        {
+        iPairingHandler->CancelPairing();
+
+        TRAP( err, iPairingHandler->StartPairingL( aAddr, aDeviceClass ) );
+        }
+    TRACE_FUNC_RES( ( _L( "result: %d" ), err ) )
+    return err;
     }
 
-
 // ---------------------------------------------------------------------------
 // Cancels an ongoing pairing.
 // ---------------------------------------------------------------------------
@@ -235,21 +248,25 @@
 EXPORT_C void CBTEngConnMan::CancelPairDevice()
     {
     TRACE_FUNC_ENTRY
-    if( iConnHandler )
+    if( iPairingHandler )
         {
-        iConnHandler->CancelPairing();
+        iPairingHandler->CancelPairing();
+        delete iPairingHandler;
+        iPairingHandler = NULL;
         }
     }
 
 
 // ---------------------------------------------------------------------------
 // Tell BTEng to start observing the status of an ongoing pairing.
+// Deprecated since Symbian^4.
 // ---------------------------------------------------------------------------
 //
 EXPORT_C TInt CBTEngConnMan::StartPairingObserver( const TBTDevAddr& aAddr )
     {
     TRACE_FUNC_ENTRY
-    return CBTEngConnHandler::SetPairingObserver( aAddr, ETrue );
+    (void) aAddr;
+    return KErrNone;
     }
 
 
@@ -264,13 +281,14 @@
     }
 
 // ---------------------------------------------------------------------------
-// ?implementation_description
+// Deprecated since Symbian^4.
 // ---------------------------------------------------------------------------
 //
 EXPORT_C TInt CBTEngConnMan::StopPairingObserver( const TBTDevAddr& aAddr )
     {
     TRACE_FUNC_ENTRY
-    return CBTEngConnHandler::SetPairingObserver( aAddr, EFalse );
+    (void) aAddr;
+    return KErrNone;
     }
 
 // ---------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/bteng/btengconnman/src/btengpairinghandler.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,152 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of pairing a Bluetooth device.
+*
+*/
+#include "btengpairinghandler.h"
+#include "btengconnman.h"
+#include "btengactive.h"
+#include "debug.h"
+
+const TInt KPairingRequestId = 60;
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// C++ default constructor
+// ---------------------------------------------------------------------------
+//
+CBTEngPairingHandler::CBTEngPairingHandler( MBTEngConnObserver* aObserver, 
+    CBTEngConnMan* aParent )
+:   iObserver( aObserver ),
+    iParent( aParent )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Symbian 2nd-phase constructor
+// ---------------------------------------------------------------------------
+//
+void CBTEngPairingHandler::ConstructL()
+    {
+    ASSERT( iObserver );
+    iActive = CBTEngActive::NewL( *this, KPairingRequestId, 
+                                   CActive::EPriorityStandard );
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CBTEngPairingHandler* CBTEngPairingHandler::NewL( MBTEngConnObserver* aObserver, 
+    CBTEngConnMan* aParent )
+    {
+    CBTEngPairingHandler* self = new( ELeave ) CBTEngPairingHandler( aObserver, 
+                                                                      aParent );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBTEngPairingHandler::~CBTEngPairingHandler()
+    {
+    delete iActive;
+    iBtNotifier.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//
+void CBTEngPairingHandler::StartPairingL( const TBTDevAddr& aAddr, 
+        TBTDeviceClass& aDeviceClass  )
+    {
+    TRACE_FUNC_ENTRY
+    if ( !iBtNotifier.Handle() ) 
+        {
+        User::LeaveIfError( iBtNotifier.Connect() );
+        }
+    iAddr() = aAddr;
+    iCod = aDeviceClass;
+    iBtNotifier.PairDevice( iAddr, iCod.DeviceClass(), iActive->RequestStatus() );
+    iActive->GoActive();
+    TRACE_FUNC_EXIT
+    }
+
+// ---------------------------------------------------------------------------
+// Cancel a pairing request.
+// ---------------------------------------------------------------------------
+//
+void CBTEngPairingHandler::CancelPairing()
+    {
+    TRACE_FUNC_ENTRY
+    if( iActive->IsActive() )
+        {
+        iBtNotifier.CancelPairDevice();
+        iActive->Cancel();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBTEngActiveObserver.
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//
+void CBTEngPairingHandler::RequestCompletedL( CBTEngActive* aActive, 
+    TInt aStatus )
+    {
+    TRACE_FUNC_ARG( ( _L( "status: %d" ), aStatus ) )
+    ASSERT( aActive->RequestId() != 0 );
+    (void) aActive;
+    // Pairing completes, inform client.
+    iObserver->PairingComplete( iAddr(), aStatus );
+    TRACE_FUNC_EXIT
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBTEngActiveObserver.
+// Handles cancelation of an outstanding request
+// ---------------------------------------------------------------------------
+//
+void CBTEngPairingHandler::CancelRequest( TInt aRequestId )
+    {
+    TRACE_FUNC_ARG( ( _L( "reqID %d" ), aRequestId ) );
+    if ( aRequestId == KPairingRequestId )
+        {
+        iBtNotifier.CancelPairDevice();
+        }
+    TRACE_FUNC_EXIT 
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBTEngActiveObserver.
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//
+void CBTEngPairingHandler::HandleError( CBTEngActive* aActive, 
+    TInt aError )
+    {
+    // Our RunL can actually not leave, so we should never reach here.
+    (void) aActive;
+    (void) aError;
+    }
+
--- a/bluetoothengine/bteng/btengdiscovery/inc/btengdevicesearch.h	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/btengdiscovery/inc/btengdevicesearch.h	Fri May 14 16:01:46 2010 +0300
@@ -89,16 +89,23 @@
      * @since S60 v3.2
      * @param ?arg1 ?description
      */
-    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aId, 
+    virtual void RequestCompletedL( CBTEngActive* aActive, 
                                      TInt aStatus );
-
+    
+    /**
+     * Callback for handling cancelation of an outstanding request.
+     *
+     * @param aId The ID that identifies the outstanding request.
+     */
+    virtual void CancelRequest( TInt aRequestId );
+    
     /**
      * Callback to notify that an error has occurred in RunL.
      *
      * @since S60 v3.2
      * @param ?arg1 ?description
      */
-    virtual void HandleError( CBTEngActive* aActive, TInt aId, TInt aError );
+    virtual void HandleError( CBTEngActive* aActive, TInt aError );
 
 private:
 
--- a/bluetoothengine/bteng/btengdiscovery/src/btengdevicesearch.cpp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/btengdiscovery/src/btengdevicesearch.cpp	Fri May 14 16:01:46 2010 +0300
@@ -72,11 +72,6 @@
 //
 CBTEngDeviceSearch::~CBTEngDeviceSearch()
     {
-    if( iNotifier.Handle()&& iActive->IsActive())
-       {
-       iNotifier.CancelNotifier( KDeviceSelectionNotifierUid );
-       iActive->CancelRequest();
-       }
     delete iActive;
     iNotifier.Close();
     iHostResolver.Close();
@@ -132,20 +127,17 @@
     TRACE_FUNC_ENTRY
     if( iActive->IsActive() && iClientReq == EDeviceSearch)
         {
+        iActive->Cancel();
         if (iActive->RequestId() == KDevSearchAoReqId)
             {
-            iNotifier.CancelNotifier( KDeviceSelectionNotifierUid );
-            iActive->CancelRequest();
             iNotifier.Close();
             NotifyClient(KErrAbort);
             }
         else if (iActive->RequestId() == KDevEirServiceListAoReqId)
             {
-            iHostResolver.Cancel();
             iHostResolver.Close();
             }
         }
-    
     TRACE_FUNC_EXIT
     }
 
@@ -182,7 +174,7 @@
     TRACE_FUNC_ENTRY
     if( iActive->IsActive() && iClientReq == EGetDeviceEir)
         {
-        iHostResolver.Cancel();
+        iActive->Cancel();
         iHostResolver.Close();
         }
     TRACE_FUNC_EXIT
@@ -193,16 +185,16 @@
 // Callback to notify that an outstanding request has completed.
 // ---------------------------------------------------------------------------
 //
-void CBTEngDeviceSearch::RequestCompletedL( CBTEngActive* aActive, TInt aId, 
+void CBTEngDeviceSearch::RequestCompletedL( CBTEngActive* aActive, 
     TInt aStatus )
     {
     TRACE_FUNC_ARG( ( _L( "status: %d") , aStatus ) )
     (void) aActive;
-    if ( aId == KDevSearchAoReqId )
+    if ( aActive->RequestId() == KDevSearchAoReqId )
         {
         HandleDeviceSelectionResultL(aStatus);
         }
-    else if (aId == KDevEirServiceListAoReqId)
+    else if ( aActive->RequestId() == KDevEirServiceListAoReqId )
         {
         HandleDeviceEirDataResult( aStatus );
         }
@@ -211,15 +203,33 @@
 
 // ---------------------------------------------------------------------------
 // From class MBTEngActiveObserver.
+// Handles cancelation of an outstanding request
+// ---------------------------------------------------------------------------
+//
+void CBTEngDeviceSearch::CancelRequest( TInt aRequestId )
+    {
+    TRACE_FUNC_ARG( ( _L( "reqID %d" ), aRequestId ) )
+    if ( aRequestId == KDevSearchAoReqId )
+        {
+        iNotifier.CancelNotifier( KDeviceSelectionNotifierUid );
+        }
+    else if ( aRequestId == KDevEirServiceListAoReqId )
+        {
+        iHostResolver.Cancel();
+        }
+    TRACE_FUNC_EXIT 
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBTEngActiveObserver.
 // Callback to notify that an error has occurred in RunL.
 // ---------------------------------------------------------------------------
 //
-void CBTEngDeviceSearch::HandleError( CBTEngActive* aActive, TInt aId, 
+void CBTEngDeviceSearch::HandleError( CBTEngActive* aActive, 
     TInt aError )
     {
     TRACE_FUNC_ARG( ( _L( "error: %d") , aError ) )
     (void) aActive;
-    (void) aId;
     iNotifier.Close();
     iHostResolver.Close();
     NotifyClient(aError);
--- a/bluetoothengine/bteng/btengsettings/inc/btengsettingsnotify.h	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/btengsettings/inc/btengsettingsnotify.h	Fri May 14 16:01:46 2010 +0300
@@ -78,17 +78,24 @@
      * @since S60 v3.2
      * @param ?arg1 ?description
      */
-    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aId, 
+    virtual void RequestCompletedL( CBTEngActive* aActive, 
                                      TInt aStatus );
 
     /**
+     * Callback for handling cancelation of an outstanding request.
+     *
+     * @param aId The ID that identifies the outstanding request.
+     */
+    virtual void CancelRequest( TInt aRequestId );
+    
+    /**
      * From MBTEngActiveObserver.
      * Handle an error in the setting change handling.
      *
      * @since S60 v3.2
      * @param ?arg1 ?description
      */
-    virtual void HandleError( CBTEngActive* aActive, TInt aId, TInt aError );
+    virtual void HandleError( CBTEngActive* aActive, TInt aError );
 
 private:
 
--- a/bluetoothengine/bteng/btengsettings/src/btengsettingsnotify.cpp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/btengsettings/src/btengsettingsnotify.cpp	Fri May 14 16:01:46 2010 +0300
@@ -90,22 +90,11 @@
 //
 CBTEngSettingsNotify::~CBTEngSettingsNotify()
     {
-    if ( iPowerKeyCenRep )
-        {
-        iPowerKeyCenRep->NotifyCancel( KBTPowerState );
-        }
-    delete iPowerKeyWatcher;     // Will call Cancel()
+    delete iPowerKeyWatcher;
     delete iPowerKeyCenRep;
-    if ( iVisiKeyCenRep )
-        {
-   	    iVisiKeyCenRep->NotifyCancel( KBTDiscoverable );
-   	    }
-    delete iVisiKeyWatcher;   // Will call Cancel()
+    delete iVisiKeyWatcher;
     delete iVisiKeyCenRep;
-    if( iBTeng.Handle() )
-        {
-        iBTeng.Close();
-        }
+    iBTeng.Close();
     }
 
 	
@@ -138,12 +127,12 @@
 // Handles notification of a setting change, and informs our observer.
 // ---------------------------------------------------------------------------
 //
-void CBTEngSettingsNotify::RequestCompletedL( CBTEngActive* aActive, TInt aId, 
+void CBTEngSettingsNotify::RequestCompletedL( CBTEngActive* aActive, 
     TInt aStatus )
     {
-    TRACE_FUNC_ARG( ( _L( "Id(%d), status(%d)" ), aId, aStatus ) )
+    TRACE_FUNC_ARG( ( _L( "Id(%d), status(%d)" ), aActive->RequestId(), aStatus ) )
 
-    if( aId == KPowerKeyReqId && aStatus == KBTPowerState )
+    if( aActive->RequestId() == KPowerKeyReqId && aStatus == KBTPowerState )
         {
         iPowerKeyCenRep->NotifyRequest( KBTPowerState, 
                                          iPowerKeyWatcher->RequestStatus() );
@@ -155,7 +144,7 @@
             iObserver->PowerStateChanged( (TBTPowerStateValue) value );
             }
         }
-    else if( aId == KVisibilityKeyReqId && aStatus == KBTDiscoverable )
+    else if( aActive->RequestId() == KVisibilityKeyReqId && aStatus == KBTDiscoverable )
         {
         iVisiKeyCenRep->NotifyRequest( KBTDiscoverable, 
                                         iVisiKeyWatcher->RequestStatus() );
@@ -172,23 +161,42 @@
             // Coudl be a repository-wide reset (KInvalidNotificationId),
             // or an invalid key ID. Anyway we know the ID of the active
             // object, so we can just reset the watcher.
-        HandleError( aActive, aId, aStatus );
+        HandleError( aActive, aStatus );
         }
     TRACE_FUNC_EXIT
     }
 
+// ---------------------------------------------------------------------------
+// From class MBTEngActiveObserver.
+// Handles cancelation of an outstanding request
+// ---------------------------------------------------------------------------
+//
+void CBTEngSettingsNotify::CancelRequest( TInt aRequestId )
+    {
+    TRACE_FUNC_ARG( ( _L( "reqID %d" ), aRequestId ) )
+
+    if( aRequestId == KPowerKeyReqId )
+        {
+        iPowerKeyCenRep->NotifyCancel( KBTPowerState );
+        }
+    else if( aRequestId == KVisibilityKeyReqId )
+        {
+        iVisiKeyCenRep->NotifyCancel( KBTDiscoverable );
+        }
+    TRACE_FUNC_EXIT 
+    }
 
 // ---------------------------------------------------------------------------
 // From class MBTEngCenRepNotify.
 // Handles error situation by just re-ordering notification from CenRep.
 // ---------------------------------------------------------------------------
 //
-void CBTEngSettingsNotify::HandleError( CBTEngActive* aActive, TInt aId, 
+void CBTEngSettingsNotify::HandleError( CBTEngActive* aActive,
     TInt aError )
     {
-    TRACE_FUNC_ARG( ( _L( "Id(%d), status(%d)" ), aId, aError ) )
+    TRACE_FUNC_ARG( ( _L( "Id(%d), status(%d)" ), aActive->RequestId(), aError ) )
     (void) aError;
-    if( aId == KPowerKeyReqId )
+    if( aActive->RequestId() == KPowerKeyReqId )
         {
         delete iPowerKeyCenRep;
         iPowerKeyCenRep = NULL;
@@ -201,7 +209,7 @@
             aActive->GoActive();
             }
         }
-    else if( aId == KVisibilityKeyReqId )
+    else if( aActive->RequestId() == KVisibilityKeyReqId )
         {
         delete iVisiKeyCenRep;
         iVisiKeyCenRep = NULL;
--- a/bluetoothengine/bteng/bttoggle/src/bttoggle.cpp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/bttoggle/src/bttoggle.cpp	Fri May 14 16:01:46 2010 +0300
@@ -360,7 +360,8 @@
 //
 TInt CBTToggle::RunError(TInt aError)
     {	  
-    TRACE_INFO((_L("[BTENG][BTTOGGLE] RunError %d"), aError ))	
+    TRACE_INFO((_L("[BTENG][BTTOGGLE] RunError %d"), aError ))
+    (void) aError;
     iActiveNotifier = ENoneQuery;
     CActiveScheduler::Stop();
     return KErrNone;
--- a/bluetoothengine/bteng/group/bld.inf	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/group/bld.inf	Fri May 14 16:01:46 2010 +0300
@@ -26,8 +26,8 @@
 PRJ_EXPORTS
 ../inc/btengprivatecrkeys.h                 |../../inc/btengprivatecrkeys.h
 ../inc/btengprivatepskeys.h                 |../../inc/btengprivatepskeys.h
-../inc/btotgpairpub.inl                     |../../inc/btotgpairpub.inl
 ../inc/btengutil.h                          |../../inc/btengutil.h
+
 ../rom/bteng.iby                            CORE_MW_LAYER_IBY_EXPORT_PATH(bteng.iby)
 ../data/10204DA9.xml                        z:/private/2000B187/10204DA9.xml
 
--- a/bluetoothengine/bteng/group/btbearer.mmp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/group/btbearer.mmp	Fri May 14 16:01:46 2010 +0300
@@ -37,7 +37,7 @@
 TARGET                  btbearer.rsc
 END // RESOURCE
 
-USERINCLUDE             ../inc
+USERINCLUDE             ../inc ../../inc
 USERINCLUDE             ../btbearer/inc
 
 MW_LAYER_SYSTEMINCLUDE
@@ -49,4 +49,5 @@
 LIBRARY                 centralrepository.lib
 LIBRARY                 btengsettings.lib
 LIBRARY                 btfeatures.lib
+LIBRARY                 btnotifclient.lib
 DEBUGLIBRARY            flogger.lib             // File logging services
--- a/bluetoothengine/bteng/group/bteng.mmp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/group/bteng.mmp	Fri May 14 16:01:46 2010 +0300
@@ -35,10 +35,6 @@
 SOURCE                  btengsrvbbconnectionmgr.cpp
 SOURCE                  btengsdpdbhandler.cpp
 SOURCE                  btengsrvkeywatcher.cpp
-SOURCE                  btengpairman.cpp
-SOURCE                  btengpairbase.cpp
-SOURCE                  btengincpair.cpp 
-SOURCE                  btengotgpair.cpp
 SOURCE                  btengsrvsettingsmgr.cpp
 START RESOURCE          ../data/btengsdp.rss
 HEADER
--- a/bluetoothengine/bteng/group/btengconnman.mmp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/group/btengconnman.mmp	Fri May 14 16:01:46 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -29,17 +29,19 @@
 SOURCEPATH              ../btengconnman/src
 SOURCE                  btengconnman.cpp
 SOURCE                  btengconnhandler.cpp
+SOURCE                  btengpairinghandler.cpp
 SOURCEPATH              ../src
 SOURCE                  btengclient.cpp
 
 USERINCLUDE             ../inc
 USERINCLUDE             ../btengconnman/inc
+SYSTEMINCLUDE           ../../inc
 MW_LAYER_SYSTEMINCLUDE
 
 LIBRARY                 euser.lib
 LIBRARY                 btdevice.lib
 LIBRARY                 bluetooth.lib
-LIBRARY                 esock.lib
+LIBRARY                 btnotifclient.lib
 LIBRARY                 featmgr.lib
 LIBRARY                 centralrepository.lib               // Central Repository
 DEBUGLIBRARY            flogger.lib
--- a/bluetoothengine/bteng/inc/btengactive.h	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/inc/btengactive.h	Fri May 14 16:01:46 2010 +0300
@@ -40,7 +40,6 @@
  */
 class MBTEngActiveObserver
     {
-
 public:
 
     /**
@@ -48,25 +47,27 @@
      *
      * @since S60 v3.2
      * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
      * @param aStatus The status of the completed request.
      */
-    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aId, 
-                                    TInt aStatus ) = 0;
+    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aStatus ) = 0;
+
+    /**
+     * Callback for handling cancelation of an outstanding request.
+     *
+     * @since Symbian^4
+     * @param aId The ID that identifies the outstanding request.
+     */
+    virtual void CancelRequest( TInt aRequestId ) = 0;
 
     /**
      * Callback to notify that an error has occurred in RunL.
      *
      * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
-     * @param aStatus The status of the completed request.
+     * @param aError The error occurred in RunL.
      */
-    virtual void HandleError( CBTEngActive* aActive, TInt aId, 
-                                    TInt aError ) = 0;
-
+    virtual void HandleError( CBTEngActive* aActive, TInt aError ) = 0;
     };
 
-
 /**
  *  Class CBTEngActive
  *
@@ -122,13 +123,6 @@
     inline void GoActive();
 
     /**
-     * Cancel an outstanding request.
-     *
-     * @since S60 v3.2
-     */
-    inline void CancelRequest();
-
-    /**
      * Get a reference to the active object request status.
      *
      * @since S60 v3.2
@@ -136,6 +130,7 @@
      */
     TRequestStatus& RequestStatus();
 
+private:
 // from base class CActive
 
     /**
--- a/bluetoothengine/bteng/inc/btengactive.inl	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/inc/btengactive.inl	Fri May 14 16:01:46 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -73,10 +73,9 @@
 //
 inline void CBTEngActive::DoCancel()
     {
+    iObserver.CancelRequest( iRequestId );
     }
 
-
-
 // -----------------------------------------------------------------------------
 // Get the identifier of this instance.
 // -----------------------------------------------------------------------------
@@ -106,17 +105,6 @@
     SetActive();
     }
 
-
-// -----------------------------------------------------------------------------
-// Cancel an outstanding request.
-// -----------------------------------------------------------------------------
-//
-inline void CBTEngActive::CancelRequest()
-    {
-    Cancel();
-    }
-
-
 // -----------------------------------------------------------------------------
 // Get a reference to the active object request status.
 // -----------------------------------------------------------------------------
@@ -126,7 +114,6 @@
     return iStatus;
     }
 
-
 // ---------------------------------------------------------------------------
 // From class CActive.
 // Called by the active scheduler when the request has been completed.
@@ -134,7 +121,7 @@
 //
 inline void CBTEngActive::RunL()
     {
-    iObserver.RequestCompletedL( this, iRequestId, iStatus.Int() );
+    iObserver.RequestCompletedL( this, iStatus.Int() );
     }
 
 
@@ -145,6 +132,6 @@
 //
 inline TInt CBTEngActive::RunError( TInt aError )
     {
-    iObserver.HandleError( this, iRequestId, aError );
+    iObserver.HandleError( this, aError );
     return KErrNone;
     }
--- a/bluetoothengine/bteng/inc/btengclient.h	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/inc/btengclient.h	Fri May 14 16:01:46 2010 +0300
@@ -158,17 +158,6 @@
      * @return ?description
      */
     TInt CancelNotifyConnectionEvents();
-    
-    /**
-     * Set a pairing observer in BTEngine.
-     *
-     * @since S60 v3.2
-     * @param aAddr The address of the remote device that is being paired.
-     * @param aActivate If ETrue, the observer will be activated, otherwise
-     *                  the observer will be removed.
-     * @return KErrNone on success, otherwise a system-wide error code.
-     */
-    TInt SetPairingObserver( const TBTDevAddr& aAddr, TBool aActivate );
 
     /**
      * ?description
@@ -178,21 +167,6 @@
      */
     TInt PrepareDiscovery();
     
-    /**
-     * Pair a device.
-     * @param aAddr The address of the remote device to be paired.
-     * @param aDeviceClass the CoD of the device to be paired.
-     * @param aStatus contains the pair result at request completion.
-     */
-    void PairDevice( const TBTDevAddrPckgBuf& aAddr, 
-                     const TUint32& aDeviceClass, 
-                     TRequestStatus& aStatus  );
-    
-    /**
-     * Cancels an outstanding pair request
-     */
-    void CancelPairDevice();
-    
     };
 
 
--- a/bluetoothengine/bteng/inc/btengclientserver.h	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/inc/btengclientserver.h	Fri May 14 16:01:46 2010 +0300
@@ -55,9 +55,6 @@
     EBTEngNotifyConnectionEvents,       // 41
     EBTEngCancelEventNotifier,          // 42
     EBTEngPrepareDiscovery,             // 43
-    EBTEngSetPairingObserver,           // 44
-    EBTEngPairDevice,                   // 45
-    EBTEngCancelPairDevice,             // 46
     };
 
 /**  TBTDevAddr class size */
--- a/bluetoothengine/bteng/inc/btengincpair.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,182 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 Pairing handler definition
-*
-*/
-
-
-#ifndef BTENGINCPAIR_H_
-#define BTENGINCPAIR_H_
-
-#include <bt_sock.h>
-#include "btengpairbase.h"
-
-/**
- *  Class CBTEngIncPair
- *
- *  Handles an incoming pairing.
- *
- *  @since S60 S60 v5.1
- */
-NONSHARABLE_CLASS( CBTEngIncPair ) : public CBTEngPairBase
-    {
-public:
-
-    /**
-     * Two-phase constructor
-     * @param aParent the owner of this observer
-     * @param aAddr the remote device this observer is targeted to
-     */
-    static CBTEngIncPair* NewL( CBTEngPairMan& aParent, 
-            const TBTDevAddr& aAddr);
-
-    /**
-     * Destructor
-     */
-    ~CBTEngIncPair();
-    
-    
-private: // From CBTEngPairBase
-    
-    /**
-     * Start observing the result of pairing which was originated from
-     * the remote device.
-     * @param the address of the remote device to be paired
-     * @return KErrNone if this request is accepted; otherwise an error code
-     */
-    TInt ObserveIncomingPair( const TBTDevAddr& aAddr );
-
-    /**
-     * Start an outgoing pairing with the remote device.
-     * @param the address of the remote device to be paired
-     * @return KErrNone if this request is accepted; otherwise an error code
-     */
-    void HandleOutgoingPairL( const TBTDevAddr& aAddr, TUint aCod );
-
-    /**
-     * Cancels pairing handling with the specified device
-     * @param aAddr the address of the device the pairing is with
-     */
-    void StopPairHandling( const TBTDevAddr& aAddr );
-    
-    /**
-     * Handle a pairing result with the remote device which this is for.
-     * Must be specialized by subclass.
-     *
-     * @param aResult The status code of the pairing or authentication result.
-     */
-    void DoHandlePairServerResult( TInt aResult );
-    
-    /**
-     * Handles event of registry new paired event with the remote 
-     * device this is for.
-     * @aType the type of authentication with the device.
-     */
-    void DoHandleRegistryNewPairedEvent( const TBTNamelessDevice& aDev );
-    
-private: // from base class MBTEngActiveObserver
-
-    /**
-     * From MBTEngActiveObserver.
-     * Callback to notify that an outstanding request has completed.
-     *
-     * @since S60 v5.1
-     * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
-     * @param aStatus The status of the completed request.
-     */
-    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aId, TInt aStatus );
-
-    /**
-     * From MBTEngActiveObserver.
-     * Callback to notify that an error has occurred in RunL.
-     *
-     * @since S60 v5.1
-     * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
-     * @param aStatus The status of the completed request.
-     */
-    virtual void HandleError( CBTEngActive* aActive, TInt aId, TInt aError );
-    
-private:
-    
-    /**
-     * C++ default constructor
-     */
-    CBTEngIncPair(CBTEngPairMan& aParent, const TBTDevAddr& aAddr);
-    
-    /**
-     * 2nd phase constructor.
-     */
-    void ConstructL();
-    
-    /**
-     * Start monitoring physical link events if it hasn't yet.
-     *
-     * @since S60 v5.1
-     * 
-     */
-    void MonitorPhysicalLink();
-    
-    /**
-     * Opens physical link adaptor with the device.
-     * 
-     * @since S60 v5.1
-     * @return KErrNone if the physical link exists.
-     * 
-     */
-    TInt OpenPhysicalLinkAdaptor();
-    
-    /**
-     * Cancel all outstanding requests.
-     *
-     * @since S60 v5.1
-     */
-    void CancelPlaNotification();
-    
-    /**
-     * Handle a physical link event.
-     *
-     * @since S60 v5.1
-     * @param aResult The status code of the event.
-     */
-    void HandlePhysicalLinkResultL( TInt aResult );
-
-private:
-    
-    /**
-     * Package buffer for retrieving physical link events.
-     */
-    TBTBasebandEvent iBbEvent;
-
-    /**
-     * Subsession with the socket server for 
-     * getting physical link event notifications.
-     */
-    RBTPhysicalLinkAdapter iPla;
-    
-    /**
-     * iPairingOkTimer is activated if the link goes down.
-     * If it expires it means the pairing process has failed, 
-     * then the error popup will be shown.
-     * If the pairing process ends correctly, DoHandleRegistryNewPairedEvent 
-     * will be called and it will cancel the timer. 
-     * iActivePairingOk is the active object associated to the timer.  
-     */
-    RTimer iPairingOkTimer;
-    CBTEngActive* iActivePairingOk;
-    TBool iUserAwarePairing;
-    };
-
-#endif /*BTENGINCPAIR_H_*/
--- a/bluetoothengine/bteng/inc/btengotgpair.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Helper class for performing pairing (i.e. bonding) 
-*                with another device.
-*
-*/
-
-#ifndef BTENGOTGPAIR_H_
-#define BTENGOTGPAIR_H_
-
-#include <bttypes.h>
-#include <bluetooth/pairing.h>
-#include <e32property.h>
-#include "btengpairbase.h"
-#include "btengprivatepskeys.h"
-
-/**
- *  Perform a outgoing pair with a BT device.
- *
- *  @lib ?library
- *  @since S60 v5.1
- */
-NONSHARABLE_CLASS( CBTEngOtgPair ) : public CBTEngPairBase
-    {
-
-public:
-
-    /**
-     * Two-phase constructor
-     * @param aParent the owner of this object
-     * @param aAddr the remote device this observer is targeted to
-     */
-    static CBTEngPairBase* NewL( CBTEngPairMan& aParent, 
-            const TBTDevAddr& aAddr );
-
-    /**
-     * Destructor
-     */
-    ~CBTEngOtgPair();
-    
-private: // From CBTEngPairBase
-    
-    /**
-     * Start observing the result of pairing which was originated from
-     * the remote device.
-     * @param the address of the remote device to be paired
-     * @return KErrNone if this request is accepted; otherwise an error code
-     */
-    TInt ObserveIncomingPair( const TBTDevAddr& aAddr );
-
-    /**
-     * Start an outgoing pairing with the remote device.
-     * @param the address of the remote device to be paired
-     * @return KErrNone if this request is accepted; otherwise an error code
-     */
-    void HandleOutgoingPairL( const TBTDevAddr& aAddr, TUint aCod );
-    
-    /**
-     * Cancel any outstanding pairing operation.
-     */
-    void CancelOutgoingPair();
-
-    /**
-     * Cancels pairing handling with the specified device
-     * @param aAddr the address of the device the pairing is with
-     */
-    void StopPairHandling( const TBTDevAddr& aAddr );
-    
-    /**
-     * Handle a pairing result with the remote device which this is for.
-     * Must be specialized by subclass.
-     *
-     * @param aResult The status code of the pairing or authentication result.
-     */
-    void DoHandlePairServerResult( TInt aResult );
-    
-    /**
-     * Handles registry new paired event for the remote 
-     * device this is pairing with.
-     * @aType the type of authentication with the device.
-     */
-    void DoHandleRegistryNewPairedEvent( const TBTNamelessDevice& aDev );
-    
-private: // from base class MBTEngActiveObserver
-
-    /**
-     * From MBTEngActiveObserver.
-     * Callback to notify that an outstanding request has completed.
-     *
-     * @since S60 v5.1
-     * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
-     * @param aStatus The status of the completed request.
-     */
-    void RequestCompletedL( CBTEngActive* aActive, TInt aId, TInt aStatus );
-
-    /**
-     * From MBTEngActiveObserver.
-     * Callback to notify that an error has occurred in RunL.
-     *
-     * @since S60 v5.1
-     * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
-     * @param aStatus The status of the completed request.
-     */
-    void HandleError( CBTEngActive* aActive, TInt aId, TInt aError );
-
-private:
-
-    /**
-     * C++ default constructor
-     */
-    CBTEngOtgPair( CBTEngPairMan& aParent, const TBTDevAddr& aAddr );
-
-    /**
-     * Symbian 2nd-phase constructor
-     */
-    void ConstructL();
-    
-    /**
-     * Starts an actual pair operation.
-     */
-    void DoPairingL();
-    
-    /**
-     * Cancel any outstanding pairing operation.
-     */
-    void DoCancelOutgoingPair();
-    
-private: // data
-	
-    /**
-     * Socket address of the remote device to pair with.
-     */	
-	TBTSockAddr iSockAddr;
-	
-	/**
-	 * The CoD of the device to be paired
-	 */
-	TUint32 iCod;
-
-    /**
-     * Dedicated bonding session to the pairing server.
-     */
-    RBluetoothDedicatedBondingInitiator iBondingSession;
-    
-    /**
-     * socket for creating L2CAP link with the remote device.
-     */
-    RSocket iSocket;
-	
-    /**
-     * Timer for recovery from Repeated Attempts
-     */
-    RTimer iTimer;
-    
-    /**
-     * used for getting and setting outgoing pair state
-     */
-    RProperty iOutgoProperty;
-    
-    /**
-     * the current pairing mode this class is in
-     */
-    TBTOutgoingPairMode iPairMode;
-    
-    };
-
-
-#endif // BTENGOTGPAIR_H_
--- a/bluetoothengine/bteng/inc/btengpairbase.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,200 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  the base class of pairing handling
-*
-*/
-
-
-#ifndef BTENGPAIRBASE_H_
-#define BTENGPAIRBASE_H_
-
-#include <e32base.h>
-#include <bttypes.h>
-#include <btnotif.h>
-#include "btengactive.h"
-
-class CBTEngPairMan;
-
-/**  Identification for asynchronous operations */
-enum TPairBaseActiveRequestId
-    {
-    EDevicePairUserNotification = 1
-    };
-
-/**
- *  Class CBTEngPairBase
- *
- *  The base class for pairing handling. 
- *  When the pairing has completed (successfully or unsuccessfully), the user
- *  is informed of the result
- *
- *  @since S60 S60 v5.1
- */
-NONSHARABLE_CLASS( CBTEngPairBase ) : public CBase, public MBTEngActiveObserver
-    {
-public:
-    
-    /**
-     * Destructor
-     */
-    virtual ~CBTEngPairBase();
-    
-    /**
-     * Handle a pairing result from the pairing server.
-     *
-     * @param aAddr the address of the remote device which the result is for.
-     * @param aResult The status code of the pairing or authentication result.
-     */
-    void HandlePairServerResult( const TBTDevAddr& aAddr, TInt aResult );
-    
-    /**
-     * Handles event of new paired device event in registry.
-     * @param aDev the remote device which the pair is with.
-     */
-    void HandleRegistryNewPairedEvent( const TBTNamelessDevice& aDev );
-    
-    /**
-     * Start observing the result of the pairing originated by
-     * the remote device.
-     * Must be specialized by subclass.
-     * @param the address of the remote device to be paired
-     * @return KErrNone if this request is accepted; otherwise an error code
-     */
-    virtual TInt ObserveIncomingPair( const TBTDevAddr& aAddr ) = 0;
-
-    /**
-     * Start an outgoing pairing with the remote device.
-     * Must be specialized by subclass.
-     * @param the address of the remote device to be paired
-     * @return KErrNone if this request is accepted; otherwise an error code
-     */
-    virtual void HandleOutgoingPairL( const TBTDevAddr& aAddr, TUint aCod ) = 0;
-    
-    /**
-     * Cancel the outstanding pairing operation.
-     */
-    virtual void CancelOutgoingPair();
-
-    /**
-     * Cancels pairing handling with the specified device
-     * @param aAddr the address of the device the pairing is with
-     */
-    virtual void StopPairHandling( const TBTDevAddr& aAddr ) = 0;
-    
-protected:
-    
-    /**
-     * Handle a pairing result with the remote device which this is for.
-     * Must be specialized by subclass.
-     *
-     * @param aResult The status code of the pairing or authentication result.
-     */
-    virtual void DoHandlePairServerResult( TInt aResult ) = 0;
-    
-    /**
-     * Handles event of registry new paired event with the remote 
-     * device this is for.
-     * Must be specialized by subclass.
-     * @aType the type of authentication with the device.
-     */
-    virtual void DoHandleRegistryNewPairedEvent( const TBTNamelessDevice& aDev ) = 0;
-    
-protected:
-    
-    /**
-     * C++ default constructor
-     */
-    CBTEngPairBase(CBTEngPairMan& aParent, const TBTDevAddr& aAddr);
-    
-    /**
-     * Symbian 2nd-phase constructor
-     */
-    void BaseConstructL();
-
-    /**
-     * Cancels notifying user about the pairing result.
-     */
-    void CancelNotifier();
-    
-    /**
-     * Show the pairing result and ask the user to authorize the device if
-     * pair succeeded.
-     *
-     * @since S60 v5.1
-     */
-    void ShowPairingNoteAndAuthorizeQuery();    
-    
-    /**
-     * Invalidate the pair result flag of this 
-     */
-    void UnSetPairResult();
-    
-    /**
-     * Sets the pair result and validate pair result flag
-     */
-    void SetPairResult( TInt aResult );
-    
-    /**
-     * Tells if the pair result has been set.
-     * @ETrue if the result has been set.
-     */
-    TBool IsPairResultSet();
-    
-    /**
-     * Tells if this is notifying user the pairing result.
-     * @return ETrue if this is is notifying user the pairing result
-     */
-    TBool IsNotifyingPairResult();
-    
-protected:
-
-    /**
-     * Address of the remote device we are trying to pair.
-     */
-    TBTDevAddr iAddr;
-    
-    /**
-     * Contains the final result of pairing with the remote device
-     */
-    TInt iPairResult;
-    
-    /**
-     * Pair result flag, ETrue if iPairResult is been set.
-     */
-    TBool iPairResultSet;
-    
-    /**
-     * Reference to the owner of this object.
-     */
-    CBTEngPairMan& iParent;
-
-    /**
-     * Package buffer for passing parameters to authorization notifier.
-     */
-    TBTPairedDeviceSettingParamsPckg iAuthoPckg;
-
-    /**
-     * Session with the notifier server.
-     * Own.
-     */
-    RNotifier iNotifier;
-    
-    /**
-     * Active object helper for asynchronous operations.
-     * Own.
-     */
-    CBTEngActive* iActive;
-    };
-
-#endif /*BTENGPAIRBASE_H_*/
--- a/bluetoothengine/bteng/inc/btengpairman.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,355 +0,0 @@
-/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Pairing manager header definition
-*
-*/
-
-#ifndef BTENGPAIRMANAGER_H_
-#define BTENGPAIRMANAGER_H_
-
-#include <bttypes.h>
-#include <bt_sock.h>
-#include <bluetooth/pairing.h>
-#include "btengactive.h"
-#include "btengconstants.h"
-
-class CBTEngPairBase;
-class CBTEngServer;
-
-/**
- *  Class CBTEngPairMan
- *
- *  This class manages pairing with BT devices.
- *  The responsibility of handling incoming and outgoing pairings is
- *  delegated to CBTEngIncPair and CBTEngOtgPair respectively.
- *
- *  @since S60 S60 v5.1
- */
-NONSHARABLE_CLASS( CBTEngPairMan ) : public CBase, public MBTEngActiveObserver
-    {
-public:
-
-    /**
-     * Two-phase constructor
-     */
-    static CBTEngPairMan* NewL( CBTEngServer& aServer );
-
-    /**
-     * Destructor
-     */
-    ~CBTEngPairMan();
-
-    /**
-     * Cancels an outstanding pairing request.
-     */
-    void CancelOutgoingPair();    
-    
-    /**
-     * Process commands relevant to pairing
-     */
-    void ProcessCommandL( const RMessage2& aMessage );
-    
-    /**
-     * Handle a change in BTRegistry remote device table.
-     *
-     * @since S60 v5.1
-     */
-    void RemoteRegistryChangeDetected();
-
-    /**
-     * Gets the instance of pairing server.
-     * @return the server instance. NULL if dedicated bonding is unavailable.
-     */
-    RBluetoothPairingServer* PairingServer();
-    
-    /**
-     * gets the reference of socket server session
-     */
-    RSocketServ& SocketServ();
-    
-    /**
-     * gets the reference of registry session.
-     */
-    RBTRegServ& BTRegServ();
-    
-    /**
-     *  Transfer responsiblity to the specified object.
-     *  @param aPairer the object to which the responsibility is transfered.
-     */
-    void RenewPairer( CBTEngPairBase* aPairer );
-    
-    /**
-     * Be notified when handling of an outgoing pair has been completed.
-     * @param aErr the result of pairing
-     * 
-     */
-    void OutgoingPairCompleted( TInt aErr );
-    
-    /**
-     * Be informed that a session will be closed.
-     *
-     * @since Symbian^3
-     * @param aSession the session to be cloased.
-     */
-    void SessionClosed(CSession2* aSession );
-    
-    /**
-     * Unpair a device via registry
-     */
-    void UnpairDevice( const TBTDevAddr& aAddr );
-    
-    /**
-     * Add the bit indicating the device is user-aware Just worked paired to
-     * UI cookie.
-     */
-    TInt AddUiCookieJustWorksPaired( const TBTNamelessDevice& aDev );
-    
-    /**
-     * Update a nameless device in registry
-     */
-    TInt UpdateRegDevice( const TBTNamelessDevice& aDev );
-    
-    
-    /**
-     * Returns the service (limited to services managed in bteng scope)
-     * level connection status of the specified device.
-     *
-     * @param aAddr the address of the device
-     * @return one of TBTEngConnectionStatus enums
-     */
-    TBTEngConnectionStatus IsDeviceConnected( const TBTDevAddr& aAddr );
-    
-private: // from base class MBTEngActiveObserver
-
-    /**
-     * From MBTEngActiveObserver.
-     * Callback to notify that an outstanding request has completed.
-     *
-     * @since S60 v5.1
-     * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
-     * @param aStatus The status of the completed request.
-     */
-    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aId, TInt aStatus );
-
-    /**
-     * From MBTEngActiveObserver.
-     * Callback to notify that an error has occurred in RunL.
-     *
-     * @since S60 v5.1
-     * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
-     * @param aStatus The status of the completed request.
-     */
-    virtual void HandleError( CBTEngActive* aActive, TInt aId, TInt aError );
-
-private:
-    
-    /**
-     * C++ default constructor
-     */
-    CBTEngPairMan( CBTEngServer& aServer );
-    
-    /**
-     * Symbian 2nd-phase constructor
-     */
-    void ConstructL();
-
-    /**
-     * Initialiases the paired devices list
-     */
-    void InitPairedDevicesList();
-
-    /**
-     * Initialises the paired devices list (second stage)
-     */
-    void DoInitPairedDevicesList();
-
-    /**
-     * Activate / deactivate a pair observer
-     */
-    TInt SetPairObserver(const TBTDevAddr& aAddr, TBool aActivate);
-    
-    /**
-     * Pair a BT device.
-     */
-    void PairDeviceL( const TBTDevAddr& aAddr, TUint32 aCod );
-    
-    /**
-     * Cancel all subscribes to pairng server
-     */
-    void CancelSubscribe();
-    
-    /**
-     * subscribe to receive SSP pairing result from pairing server
-     */
-    void SubscribeSspPairingResult();
-    
-    /**
-     * Subscribe to receive authentication result from pairing server
-     */
-    void SubscribeAuthenticateResult();
-
-    /**
-     * Handle a pairing result from the pairing server.
-     *
-     * @since S60 v5.1
-     * @param aResult The status code of the authentication result.
-     */
-    void HandlePairingResultL( const TBTDevAddr& aAddr, TInt aResult );
-    
-    /**
-     * Creates a registry view which shall contain all paired devices.
-     */    
-    void CreatePairedDevicesView( TInt aReqId );
-    
-    /**
-     * retrieves paired devices from registry.
-     */
-    void GetPairedDevices( TInt aReqId );
-    
-    /**
-     * handles the completion of paired device view creation
-     */
-    void HandleCreatePairedDevicesViewCompletedL( TInt aStatus, TInt aReqId );
-    
-    /**
-     * handles the completion of getting paired devices
-     */
-    void HandleGetPairedDevicesCompletedL( TInt aStatus, TInt aReqId );
-    
-    /**
-     * Copy the paired devices to internal array storage.
-     */
-    void UpdatePairedDeviceListL();
-    
-    /**
-     * Checks if any devices have been paired or unpaired. For each new paired device,
-     * the pair event will be delegated to corresponding pair observer if it exists;
-     * otherwise create a new pair observer for this pair event.
-     */
-    void CheckPairEventL();
-    
-private:
-
-    /**
-     * Owner of this class.
-     * Not owned.
-     */
-    CBTEngServer& iServer;
-    
-    /**
-     * Registry sub session for remote device db
-     */
-    RBTRegistry iBTRegistry;
-    
-    /**
-     * contains the list of all paired devices.
-     * Using heap here to make efficient array swap.
-     */
-    RArray<TBTNamelessDevice>* iPairedDevices;
-    
-    /**
-     * temporary instance to retrieve paired devices.
-     */
-    CBTRegistryResponse* iPairedDevicesResp;
-    
-    /**
-     * the counter of not handled registry events.
-     */
-    TInt iNotHandledRegEventCounter;
-    
-    /**
-     * Session with the pairing server.
-     * Allocate it in heap to ease the handling for 
-     * situation of unavailable dedicated pairing service.
-     * 
-     * own.
-     */
-    RBluetoothPairingServer* iPairingServ;
-
-    /**
-     * Subsession with the pairing server for 
-     * getting the simple pairing result.
-     * own
-     */
-    RBluetoothPairingResult iPairingResult;
-
-    /**
-     * Subsession with the pairing server for 
-     * getting the authentication result.
-     * own
-     */
-    RBluetoothAuthenticationResult iAuthenResult;
-
-    /**
-     * the address with which a simple pairing has been performed
-     */
-    TBTDevAddr iSimplePairingRemote;
-
-    /**
-     * the address with which an authentication has been performed
-     */
-    TBTDevAddr iAuthenticateRemote;
-    
-    /**
-     * Active object helper for receiving simple pairing results.
-     * Own.
-     */
-    CBTEngActive* iSSPResultActive;
-
-    /**
-     * Active object helper for receiving authentication results.
-     * Own.
-     */
-    CBTEngActive* iAuthenResultActive;
-
-    /**
-     * AO for registry operations
-     */
-    CBTEngActive* iRegistryActive;
-    
-    /**
-     * pair hanlder at the time.
-     * Own.
-     */
-    CBTEngPairBase* iPairer;
-    
-    /**
-     * Client-server message for power change requests.
-     */
-    RMessage2 iMessage;
-
-    /**
-     * AO for local address updates.
-     */
-    CBTEngActive* iLocalAddrActive;
-
-    /**
-     * Provides access to the BT local device address.
-     */
-    RProperty iPropertyLocalAddr;
-
-    /**
-     * Records whether or not this CBTEngPairMan has ever been involed in a pairing operaton.
-     */
-    TBool iPairingOperationAttempted;
-
-    /**
-     * Counter of unhandled paired device view initialisation requests.
-     */
-    TInt iNotHandledInitEventCounter;
-    };
-
-#endif /*BTENGPAIRMANAGER_H_*/
--- a/bluetoothengine/bteng/inc/btengserver.h	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/inc/btengserver.h	Fri May 14 16:01:46 2010 +0300
@@ -32,7 +32,6 @@
 class CBTEngSrvBBConnMgr;
 class CBTEngSrvKeyWatcher;
 class CBTEngSdpDbHandler;
-class CBTEngPairMan;
 class CPolicyServer;
 class TEComResolverParams;
 class CImplementationInformation;
@@ -150,14 +149,6 @@
     inline CBTEngSrvBBConnMgr* BasebandConnectionManager() const
             { return iBBConnMgr; }
 
-    /**
-     * Getter for pairing manager. Ownership is not transferred.
-     *
-     * @since Symbian^3
-     * @return Pointer to instance of baseband connection manager.
-     */
-    inline CBTEngPairMan* PairManager() const
-            { return iPairMan; }
 
     /**
      * Getter for socket server session.
@@ -170,16 +161,6 @@
             { return  iSocketServ; }
 
     /**
-     * Getter for registry server session.
-     * This handle can be used for creating subsessions.
-     *
-     * @since Symbian^3
-     * @return Reference to session with the registry server.
-     */
-    inline RBTRegServ& RegistrServer()
-            { return iBTRegServ; }
-
-    /**
      * Set Bluetooth on or off
      *
      * @since S60 v3.2
@@ -405,11 +386,6 @@
      * Callback for expiry of Simple Pairing debug mode.
      */
     TDeltaTimerEntry iDebugModeCallBack;
-
-    /**
-     * Pairing manager.
-     */
-    CBTEngPairMan* iPairMan;
     
     /**
     * Socket Server instance for this and other classes to access Bluetooth socket APIs.
@@ -417,11 +393,6 @@
     RSocketServ iSocketServ;
 
     /**
-    * Registry Server instance for bteng to access Bluetooth registry APIs.
-    */      
-    RBTRegServ iBTRegServ;
-
-    /**
      * Our state machine for handling power on/off.
      * Own.
      */
--- a/bluetoothengine/bteng/inc/btengsrvbbconnectionmgr.h	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/inc/btengsrvbbconnectionmgr.h	Fri May 14 16:01:46 2010 +0300
@@ -149,22 +149,27 @@
      *
      * @since S60 v3.2
      * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
      * @param aStatus The status of the completed request.
      */
-    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aId, 
+    virtual void RequestCompletedL( CBTEngActive* aActive,
                                      TInt aStatus );
 
     /**
+     * Callback for handling cancelation of an outstanding request.
+     *
+     * @param aId The ID that identifies the outstanding request.
+     */
+    virtual void CancelRequest( TInt aRequestId );
+    
+    /**
      * From MBTEngActiveObserver.
      * Callback to notify that an error has occurred in RunL.
      *
      * @since S60 v3.2
      * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
      * @param aStatus The status of the completed request.
      */
-    virtual void HandleError( CBTEngActive* aActive, TInt aId, 
+    virtual void HandleError( CBTEngActive* aActive,
                                TInt aError );
 
 private:
--- a/bluetoothengine/bteng/inc/btengsrvkeywatcher.h	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/inc/btengsrvkeywatcher.h	Fri May 14 16:01:46 2010 +0300
@@ -60,17 +60,24 @@
      * @since S60 v3.2
      * @param ?arg1 ?description
      */
-    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aId, 
+    virtual void RequestCompletedL( CBTEngActive* aActive, 
                                      TInt aStatus );
 
     /**
+     * Callback for handling cancelation of an outstanding request.
+     *
+     * @param aId The ID that identifies the outstanding request.
+     */
+    virtual void CancelRequest( TInt aRequestId );
+    
+    /**
      * From MBTEngActiveObserver.
      * Notification that a key value has changed.
      *
      * @since S60 v3.2
      * @param ?arg1 ?description
      */
-    virtual void HandleError( CBTEngActive* aActive, TInt aId, TInt aError );
+    virtual void HandleError( CBTEngActive* aActive, TInt aError );
 
 private:
 
@@ -142,11 +149,6 @@
     RProperty iSspDebugModeKey;
     
     /**
-     * Property containing the BT registry change monitoring key
-     */
-    RProperty iBtRegistryKey;
-    
-    /**
      * Session with the central repository for BT SAP mode setting.
      * We load/unload BT SAP plugin.
      * Own.
@@ -208,12 +210,6 @@
     CBTEngActive* iSspDebugModeWatcher;
 
     /**
-     * Active object for subscribing to BT registry property changes.
-     * Own.
-     */
-    CBTEngActive* iBtRegistryWatcher;
-
-    /**
      * Pointer to our parent.
      * Not own.
      */
--- a/bluetoothengine/bteng/inc/btengsrvsettingsmgr.h	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/inc/btengsrvsettingsmgr.h	Fri May 14 16:01:46 2010 +0300
@@ -112,12 +112,13 @@
     void StopBTStackL();
 
     /**
-     * Update the central repository key for Bluetooth power state.
+     * Handles a power event that HW power is going to turn off or
+     * has been changed turned on.
      *
-     * @since Symbian^3
-     * @param aValue The new Bluetooth power state.
+     * @since Symbian^4
+     * @param aValue The new Bluetooth HW power state.
      */
-    void UpdateCenRepPowerKeyL( TBTPowerState aValue );
+    void HandleHwPowerChangeL( TBTPowerState aValue );
 
     /**
     * ?description
@@ -199,21 +200,26 @@
      *
      * @since Symbian^3
      * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
      * @param aStatus The status of the completed request.
      */
-    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aId, TInt aStatus );
-
+    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aStatus );
+    
+    /**
+     * Callback for handling cancelation of an outstanding request.
+     *
+     * @param aId The ID that identifies the outstanding request.
+     */
+    virtual void CancelRequest( TInt aRequestId );
+    
     /**
      * From MBTEngActiveObserver.
      * Callback to notify that an error has occurred in RunL.
      *
      * @since Symbian^3
      * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
      * @param aStatus The status of the completed request.
      */
-    virtual void HandleError( CBTEngActive* aActive, TInt aId, TInt aError );
+    virtual void HandleError( CBTEngActive* aActive, TInt aError );
 
 private:
 
@@ -245,7 +251,7 @@
      * @param aTemporary Indicates if this is about a tempororary state change.
      */
     void CheckTemporaryPowerStateL( TBTPowerState& aCurrentState,
-                                     TBTPowerState aNewState, TBool aTemporary );
+                                     TBTPowerState aNewState, TBool aTemporary );  
 
 private: // data
 
--- a/bluetoothengine/bteng/inc/btotgpairpub.inl	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 getting/setting outgoing pair status
-*               from/to P&S KBTOutgoingPairing from btengprivatepskeys.h.
-*
-*/
-
-#include "btengprivatepskeys.h"
-#include <e32property.h>
-
-// ----------------------------------------------------------
-// Get outgoing pair status from PS
-// ----------------------------------------------------------
-//
-inline void OutgoPairingProperty(RProperty& aProperty, 
-        TBTDevAddr& aAddr, TBTOutgoingPairMode& aMode)
-    {
-    TBuf8<sizeof( TBTOutgoingPairProperty )> propDes;
-    TInt err = aProperty.Get( propDes );
-    if ( !err && propDes.Length() == sizeof( TBTOutgoingPairProperty ) )
-        {
-        TBTOutgoingPairProperty prop;
-        TPckgC<TBTOutgoingPairProperty> tmpPckg( prop );
-        tmpPckg.Set( propDes );
-        aAddr = tmpPckg().iAddr;
-        aMode = tmpPckg().iMode;
-        }
-    else
-        {
-        aMode = EBTOutgoingPairNone;
-        }
-    }
-
-// ----------------------------------------------------------
-// Get outgoing pair status from PS
-// ----------------------------------------------------------
-//
-inline void OutgoPairingProperty(TBTDevAddr& aAddr, TBTOutgoingPairMode& aMode)
-    {
-    RProperty property;
-    TInt err = property.Attach( 
-                KPSUidBluetoothEnginePrivateCategory, KBTOutgoingPairing );
-    if ( !err )
-        {
-        OutgoPairingProperty( property, aAddr, aMode );
-        }
-    else
-        {
-        aMode = EBTOutgoingPairNone;
-        }
-    property.Close();
-    }
-
-// ----------------------------------------------------------
-// Tells if another outgoing pairing is ongoing with a device
-// other than the specified one.
-// ----------------------------------------------------------
-//
-inline TBool OtherOutgoPairing( const TBTDevAddr& aAddr )
-    {
-    TBTDevAddr outpaddr;
-    TBTOutgoingPairMode mode;
-    OutgoPairingProperty( outpaddr, mode );
-    return mode != EBTOutgoingPairNone && outpaddr != aAddr;
-    }
-
-// ----------------------------------------------------------
-// Gets the status of outgoing pair with the specified device.
-// ----------------------------------------------------------
-//
-inline TBTOutgoingPairMode OutgoPairingMode(
-        RProperty& aProperty, const TBTDevAddr& aAddr )
-    {
-    TBTDevAddr addr;
-    TBTOutgoingPairMode mode;
-    OutgoPairingProperty(aProperty, addr, mode );
-    return ( addr == aAddr ) ? mode : EBTOutgoingPairNone;
-    }
-
-// ----------------------------------------------------------
-// Gets the status of outgoing pair with the specified device.
-// ----------------------------------------------------------
-//
-inline TBTOutgoingPairMode OutgoPairingMode(const TBTDevAddr& aAddr)
-    {
-    TBTDevAddr addr;
-    TBTOutgoingPairMode mode;
-    OutgoPairingProperty( addr, mode );
-    return ( addr == aAddr ) ? mode : EBTOutgoingPairNone;
-    }
-
-// ----------------------------------------------------------
-// publish outgoing pairing status to PS
-// ----------------------------------------------------------
-//
-inline void SetOutgoPairProperty(RProperty& aProperty, 
-        const TBTDevAddr& aAddr,
-        TBTOutgoingPairMode aMode )
-    {
-    if ( aMode == EBTOutgoingPairNone )
-        {
-        (void) aProperty.Set( KNullDesC8 );
-        return;
-        }
-    TPckgBuf<TBTOutgoingPairProperty> tmpPckg;
-    tmpPckg().iAddr = aAddr;
-    tmpPckg().iMode = aMode;
-    (void) aProperty.Set( tmpPckg );
-    }
-
-// ----------------------------------------------------------
-// Locally instantiate a RProperty and Set Outgoing Pair Property
-// ----------------------------------------------------------
-//
-inline void SetOutgoPairProperty(const TBTDevAddr& aAddr,
-        TBTOutgoingPairMode aMode )
-    {
-    RProperty property;
-    TInt err = property.Attach( 
-                KPSUidBluetoothEnginePrivateCategory, KBTOutgoingPairing );
-    if ( !err )
-        {
-        SetOutgoPairProperty( property, aAddr, aMode );
-        }
-    property.Close();
-    }
--- a/bluetoothengine/bteng/src/btengclient.cpp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/src/btengclient.cpp	Fri May 14 16:01:46 2010 +0300
@@ -255,17 +255,6 @@
 
 
 // ---------------------------------------------------------------------------
-// Set a pairing observer in BTEngine.
-// ---------------------------------------------------------------------------
-//
-TInt RBTEng::SetPairingObserver( const TBTDevAddr& aAddr, TBool aActivate )
-    {
-    TBTDevAddrPckgBuf addrPkg( aAddr );
-    return SendReceive( EBTEngSetPairingObserver, TIpcArgs( &addrPkg, aActivate ) );
-    }
-
-
-// ---------------------------------------------------------------------------
 // ?implementation_description
 // ---------------------------------------------------------------------------
 //
@@ -273,22 +262,3 @@
     {
     return SendReceive( EBTEngPrepareDiscovery, TIpcArgs() );
     }
-
-// ---------------------------------------------------------------------------
-// Start to pair a device in BTEngine.
-// ---------------------------------------------------------------------------
-//
-void RBTEng::PairDevice( const TBTDevAddrPckgBuf& aAddr, 
-        const TUint32& aDeviceClass, TRequestStatus& aStatus  )
-    {
-    SendReceive( EBTEngPairDevice, TIpcArgs( &aAddr, aDeviceClass ), aStatus );    
-    }
-
-// ---------------------------------------------------------------------------
-// cancel pairing request
-// ---------------------------------------------------------------------------
-//
-void RBTEng::CancelPairDevice( )
-    {
-    (void) SendReceive( EBTEngCancelPairDevice);        
-    }
--- a/bluetoothengine/bteng/src/btengincpair.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,362 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  BT determines pairing status 
-*
-*/
-
-#include "btengincpair.h"
-#include "btengpairman.h"
-#include "btengotgpair.h"
-#include "btengconstants.h"
-#include "debug.h"
-
-const TInt KBTEngWaitingForPairingOkDelay = 500000; // 0.5s
-
-enum TPairingStageId
-    {
-    /**
-     * is monitoring physical link status
-     */
-    EPhysicalLinkNotify = EDevicePairUserNotification + 1,
-    EWaitingForPairingOk,
-    };
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-// C++ default constructor
-// ---------------------------------------------------------------------------
-//
-CBTEngIncPair::CBTEngIncPair( CBTEngPairMan& aParent, 
-    const TBTDevAddr& aAddr) : CBTEngPairBase( aParent, aAddr )
-    {
-    }
-
-// ---------------------------------------------------------------------------
-// 2nd phase constructor
-// ---------------------------------------------------------------------------
-//
-void CBTEngIncPair::ConstructL()
-    {
-    BaseConstructL();
-    iActivePairingOk = CBTEngActive::NewL(*this, EWaitingForPairingOk, CActive::EPriorityStandard);
-    User::LeaveIfError( iPairingOkTimer.CreateLocal() );
-    }
-
-// ---------------------------------------------------------------------------
-// NewL
-// ---------------------------------------------------------------------------
-//
-CBTEngIncPair* CBTEngIncPair::NewL( CBTEngPairMan& aParent, 
-    const TBTDevAddr& aAddr)
-    {
-    CBTEngIncPair* self = new (ELeave) CBTEngIncPair(aParent, aAddr);
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------------------------
-//
-CBTEngIncPair::~CBTEngIncPair()
-    {
-    TRACE_FUNC_ENTRY
-    // Cancel all outstanding requests
-    CancelPlaNotification();
-    iPla.Close();
-    iPairingOkTimer.Cancel();
-    iPairingOkTimer.Close();
-    if(iActivePairingOk)
-        {
-        iActivePairingOk->CancelRequest();
-        delete iActivePairingOk;
-        }
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// Accept this message only if the specified device is the same as this is
-// dealing with.
-// ---------------------------------------------------------------------------
-//
-TInt CBTEngIncPair::ObserveIncomingPair( const TBTDevAddr& aAddr )
-    {
-    TInt err( KErrServerBusy );
-    if ( iAddr == aAddr )
-        {
-        err = KErrNone;
-        iUserAwarePairing = ETrue; // This function is called by a notifier, which means the UI has been involved
-        // Therefore we can display it in the paired devices list
-        if ( !iActive->IsActive() && !OpenPhysicalLinkAdaptor() )
-            {
-            // If we are observing physical link, or showing user a note,
-            // we won't interrupt it.
-            UnSetPairResult();
-            MonitorPhysicalLink();
-            }
-        }
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-// Assign the responsibility of outgoing pair handling to CBTEngOtgPair
-// ---------------------------------------------------------------------------
-//
-void CBTEngIncPair::HandleOutgoingPairL( const TBTDevAddr& aAddr, TUint aCod )
-    {
-    TRACE_FUNC_ENTRY
-    // Outgoing pairing always takes highest priority:
-    CBTEngPairBase* pairer = CBTEngOtgPair::NewL( iParent, aAddr );
-    pairer->HandleOutgoingPairL( aAddr, aCod );
-    iParent.RenewPairer( pairer );
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// Accept this message only if the specified device is the same as this is
-// dealing with.
-// ---------------------------------------------------------------------------
-//
-void CBTEngIncPair::StopPairHandling( const TBTDevAddr& aAddr )
-    {
-    if ( aAddr == iAddr )
-        {
-        TRACE_FUNC_ENTRY
-        iParent.RenewPairer( NULL );
-        TRACE_FUNC_EXIT
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Notify user if pairing failed.
-// ---------------------------------------------------------------------------
-//
-void CBTEngIncPair::DoHandlePairServerResult( TInt aResult )
-    {
-    CancelPlaNotification();
-    // For a successful pairing, we need wait for registry table change.
-    if( aResult != KErrNone && aResult != KHCIErrorBase )
-        {
-        // Pair failure situation.
-        SetPairResult( aResult );
-        ShowPairingNoteAndAuthorizeQuery();
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Kill this if the linkkey type indicates OBEX authentication.
-// Otherwise notify user the pair result.
-// ---------------------------------------------------------------------------
-//
-void CBTEngIncPair::DoHandleRegistryNewPairedEvent( const TBTNamelessDevice& aDev )
-    {
-    TRACE_FUNC_ENTRY
-    
-    // First of all cancel the iPairingOkTimer timer, if active
-    if (iActivePairingOk->IsActive())
-        {
-        iPairingOkTimer.Cancel();
-        iActivePairingOk->CancelRequest();
-        UnSetPairResult();  // we might have set it before (if the link went down) so we want to reset it.   
-        }
-    if (aDev.LinkKeyType() == ELinkKeyUnauthenticatedNonUpgradable && !iUserAwarePairing)
-		{
-		// If an application uses btengconnman API to connect a service of 
-		// this device and JW pairing occurred as part of security enforcement,
-		// it shall be a user aware pairing, and we shall add this device in paired
-		// view. In this way, user is able to disconnect the device from our UI.
-		// Otherwise the link key has been created by a device without IO requesting 
-		// a service connection with phone. We won't take any action (e.g. remove 
-		// link key) in this case. As the result, this device can't be seen in our UI, 
-		// however other applications are still freely to use its services.
-		TRACE_INFO(_L("[BTEng]: CBTEngIncPair: JW pairing with no IO device" ) )
-		TBTEngConnectionStatus status = iParent.IsDeviceConnected( aDev.Address() );
-		if ( status == EBTEngConnecting || status == EBTEngConnected )
-			{
-			// the return error is ingore as we can not have other proper 
-			// exception handling option:
-			(void) iParent.AddUiCookieJustWorksPaired( aDev );
-			}
-		iParent.RenewPairer( NULL );
-		}
-    else if (aDev.LinkKeyType() == ELinkKeyUnauthenticatedUpgradable && !iUserAwarePairing)
-		{
-		// The linkkey has been created  by an incoming OBEX service request
-		// which resulted a pairing event received from pair server.
-		TRACE_INFO(_L("[BTEng]: CBTEngIncPair: JW pairing with IO device" ) )
-		iParent.RenewPairer( NULL );
-		}
-    else
-		{
-		if (aDev.LinkKeyType() == ELinkKeyUnauthenticatedNonUpgradable || aDev.LinkKeyType() == ELinkKeyUnauthenticatedUpgradable)
-			{
-			// The user was involved in the pairing, so display in the paired devices list
-			(void) iParent.AddUiCookieJustWorksPaired(aDev);
-			}
-		TRACE_INFO(_L("[BTEng]: CBTEngIncPair: Non-JW pairing"))
-		// Other pairing model than Just Works:
-		CancelPlaNotification();
-		SetPairResult( KErrNone );
-		ShowPairingNoteAndAuthorizeQuery();
-		}
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// From class MBTEngActiveObserver.
-// ---------------------------------------------------------------------------
-//
-void CBTEngIncPair::RequestCompletedL( CBTEngActive* /*aActive*/, TInt aId, TInt aStatus )
-    {
-    TRACE_FUNC_ARG( ( _L( "aId: %d, aStatus: %d"), aId, aStatus ) )
-        // Check which request completed.
-    switch( aId )
-        {
-        case EPhysicalLinkNotify:
-            {
-                // Check if the link has disconnected.
-            HandlePhysicalLinkResultL( aStatus );
-            break;
-            }
-        case EDevicePairUserNotification:
-            {
-                // the user has been informed of the result, kill this:
-            TRACE_INFO(_L("[BTENG]:CBTEngIncPair authorization notifier completed") )
-            iParent.RenewPairer( NULL );
-            break;
-            }
-        case EWaitingForPairingOk:
-            {
-            // pairing failed, inform user:
-            if (iPairResult == KErrNone)
-                {
-                // iPairResult must have been set as an error. if it's not it means somewhere else
-                // it has been reset. But we need to have it set to an error as we are notifying 
-                // the "unable to pair" message.
-                SetPairResult(KErrGeneral);
-                }
-            ShowPairingNoteAndAuthorizeQuery();
-            break;
-            }    
-        default:
-                // Should not be possible, but no need for handling.
-            TRACE_INFO( (_L("[BTEng]: CBTEngIncPair::RequestCompletedL unhandled event!!") ) )
-            break;
-        }
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// From class MBTEngActiveObserver.
-// Handles a leave in RequestCompleted by simply self-destructing.
-// ---------------------------------------------------------------------------
-//
-void CBTEngIncPair::HandleError( CBTEngActive* aActive, TInt aId, TInt aError )
-    {
-    TRACE_FUNC_ARG( ( _L( "request id: %d, error: %d" ), aId, aError ) )
-    (void) aActive;
-    (void) aId;
-    (void) aError;
-        // Our error handling is to just stop observing. 
-        // Nothing critical to be preserved herer, the user 
-        // just won't get any notification of pairing result.
-    iParent.RenewPairer( NULL );
-    }
-
-// ---------------------------------------------------------------------------
-// Subscribe to physical link notifications. 
-// physical link must exist when calling this function.
-// ---------------------------------------------------------------------------
-//
-void CBTEngIncPair::MonitorPhysicalLink()
-    {
-    TRACE_FUNC_ENTRY
-    iActive->SetRequestId( EPhysicalLinkNotify );
-        // Subscribe to disconnect and error events.
-    iPla.NotifyNextBasebandChangeEvent( iBbEvent, 
-                            iActive->RequestStatus(), 
-                            ENotifyPhysicalLinkDown | ENotifyPhysicalLinkError );
-    iActive->GoActive();
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// Opens the adaptor if physical link exists.
-// ---------------------------------------------------------------------------
-//
-TInt CBTEngIncPair::OpenPhysicalLinkAdaptor()
-    {
-    TRACE_FUNC_ENTRY
-    TInt err ( KErrNone );
-    if( !iPla.IsOpen() )
-        {
-            // Try to open the adapter in case it failed earlier.
-            // This can happen for outgoing dedicated bonding with 
-            // non-SSP device, as the PIN dialog can be kept open even 
-            // though the link has dropped because of a time-out.
-        err = iPla.Open( iParent.SocketServ(), iAddr );
-        }
-    TRACE_INFO( (_L("[BTEng]: CBTEngIncPair::HasPhysicalLink ? %d"), iPla.IsOpen() ) )
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-// Cancel outstanding physical link notification
-// ---------------------------------------------------------------------------
-//
-void CBTEngIncPair::CancelPlaNotification()
-    {
-    TRACE_FUNC_ENTRY
-    if( iActive && iActive->IsActive() && 
-            iActive->RequestId() == EPhysicalLinkNotify )
-        {
-        // cancel Baseband monitor
-        iPla.CancelNextBasebandChangeEventNotifier();
-        iActive->Cancel();
-        }
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// Handle a physical link event. Notify pair failed if physical link is down.
-// ---------------------------------------------------------------------------
-//
-void CBTEngIncPair::HandlePhysicalLinkResultL( TInt aResult )
-    {
-    TRACE_FUNC_ARG( ( _L( " BBEvent 0x%08X, code %d"), 
-                            iBbEvent().EventType(), iBbEvent().SymbianErrorCode() ) )
-        // Check if the connection is still alive.
-    TBool physicalLinkDown = 
-        ( iBbEvent().EventType() == ENotifyPhysicalLinkDown | ENotifyPhysicalLinkError );
-
-    if( aResult || physicalLinkDown )
-        {
-        // link went down. It might be because of pairing failed or the remote device disconnected the
-        // physical link after a successful pairing.
-        // we wait for 0.5 secs before notifying the "unable to pair" message as, if the pair is 
-        // successful, we manage it to show the right confirmation message.
-        SetPairResult( (aResult == 0) ? KErrGeneral : aResult );
-        iPairingOkTimer.After(iActivePairingOk->iStatus, KBTEngWaitingForPairingOkDelay);
-        iActivePairingOk->GoActive();
-        }
-    else
-        {
-        // Uninteresting event, re-subscribe.
-        MonitorPhysicalLink();
-        }
-    TRACE_FUNC_EXIT
-    }
--- a/bluetoothengine/bteng/src/btengotgpair.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,368 +0,0 @@
-/*
-* 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:  Helper class for performing pairing (i.e. bonding) 
-*                with another device.
-*
-*/
-
-#include "btengotgpair.h"
-#include <btengconstants.h>
-#include "btengpairman.h"
-#include "btotgpairpub.inl"
-#include "debug.h"
-
-enum TPairingStageId
-    {
-    /**
-     * no pairing operation ongoing
-     */
-    ENoBonding = 0,
-    
-    /**
-     * pair with dedicated bonding method
-     */
-    EDedicatedBonding = EDevicePairUserNotification + 1,
-    
-    /**
-     * pair with general bonding by establishing L2CAP connection.
-     */
-    EGeneralBonding,  
-    
-    /**
-     * delaying next pairing request for a while
-     */
-    EGeneralBondingRetryTimer,
-    
-    /**
-     * The last pairing retry
-     */
-    EGeneralBondingRetry
-    };
-
-/**  SDP PSM (used for pairing) */
-const TInt KSDPPSM = 0x0001;
-
-// Delay time to void Repeated Attempts on pairing
-const TInt KBTEngGeneralBondingRetryDelayMicroSeconds = 5000000; // 5.0s
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-// C++ default constructor
-// ---------------------------------------------------------------------------
-//
-CBTEngOtgPair::CBTEngOtgPair( CBTEngPairMan& aParent, const TBTDevAddr& aAddr)
-    :  CBTEngPairBase( aParent, aAddr )
-    {
-    }
-
-// ---------------------------------------------------------------------------
-// Symbian 2nd-phase constructor
-// ---------------------------------------------------------------------------
-//
-void CBTEngOtgPair::ConstructL()
-    {
-    TRACE_FUNC_ENTRY
-    BaseConstructL();
-    User::LeaveIfError( iOutgoProperty.Attach( KPSUidBluetoothEnginePrivateCategory, 
-            KBTOutgoingPairing ) );
-    User::LeaveIfError( iTimer.CreateLocal() );
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// NewL
-// ---------------------------------------------------------------------------
-//
-CBTEngPairBase* CBTEngOtgPair::NewL( CBTEngPairMan& aParent, 
-        const TBTDevAddr& aAddr )
-    {
-    CBTEngOtgPair* self = new( ELeave ) CBTEngOtgPair( aParent, aAddr );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------------------------
-//
-CBTEngOtgPair::~CBTEngOtgPair()
-    {
-    TRACE_FUNC_ENTRY
-    SetOutgoPairProperty( iOutgoProperty, TBTDevAddr(), EBTOutgoingPairNone );
-    CancelNotifier();
-    DoCancelOutgoingPair();
-    iBondingSession.Close();
-    iSocket.Close();
-    iTimer.Close();
-    iOutgoProperty.Close();
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// Simply deny the request as this is handing outgoing pairing
-// ---------------------------------------------------------------------------
-//
-TInt CBTEngOtgPair::ObserveIncomingPair( const TBTDevAddr& /*aAddr*/ )
-    {
-    return KErrServerBusy;
-    }
-
-// ---------------------------------------------------------------------------
-// Accept the request only this device is not busy with another pairing request.
-// ---------------------------------------------------------------------------
-//
-void CBTEngOtgPair::HandleOutgoingPairL( const TBTDevAddr& aAddr, TUint aCod )
-    {
-    TRACE_FUNC_ARG( ( _L(" cod 0x%08x"), aCod ) )
-    if ( iActive->IsActive() || aAddr != iAddr )
-        {
-        // we don't allow another pairing request.
-        User::Leave( KErrServerBusy );
-        }
-    
-    iAddr = aAddr;
-    iCod = aCod;
-    UnSetPairResult();
-    iParent.UnpairDevice( iAddr );
-    TBTDeviceClass decls( iCod );
-    if ( decls.MajorDeviceClass() == EMajorDeviceAV && 
-            decls.MinorDeviceClass() != EMinorDeviceAVHandsfree )
-        {
-        // If the devie is a headset, set to 0000 pin auto pairing
-        iPairMode = EBTOutgoingHeadsetAutoPairing;
-        }
-    else
-        {
-        iPairMode = EBTOutgoingNoneHeadsetPairing;
-        }
-    SetOutgoPairProperty( iOutgoProperty, iAddr, iPairMode );
-    DoPairingL();
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// Cancels an outstanding pair request by self-destruct
-// ---------------------------------------------------------------------------
-//
-void CBTEngOtgPair::CancelOutgoingPair()
-    {
-    TRACE_FUNC_ENTRY
-    iParent.RenewPairer( NULL );
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// Abort pairing handling, request the owner to destroy this.
-// ---------------------------------------------------------------------------
-//
-void CBTEngOtgPair::StopPairHandling( const TBTDevAddr& aAddr )
-    {
-    if ( aAddr == iAddr )
-        {
-        TRACE_FUNC_ENTRY
-        iParent.OutgoingPairCompleted( KErrCancel );
-        iParent.RenewPairer( NULL );
-        TRACE_FUNC_EXIT
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Pairing result will be received when pairing operation completes.
-// ---------------------------------------------------------------------------
-//
-void CBTEngOtgPair::DoHandlePairServerResult( TInt aResult )
-    {
-	if (aResult == (KHCIErrorBase-EPairingNotAllowed))
-		{
-		// if EPairingNotAllowed is recieved then any further pairing attempts will fail
-		// so don't attampt to pair
-        iPairMode = EBTOutgoingPairNone;
-		}
-    }
-
-// ---------------------------------------------------------------------------
-// Cancels possible outstanding pairing and notify user pair success.
-// ---------------------------------------------------------------------------
-//
-void CBTEngOtgPair::DoHandleRegistryNewPairedEvent( const TBTNamelessDevice& aDev )
-    {
-    TRACE_FUNC_ENTRY
-    if ( !IsNotifyingPairResult() )
-        {
-        TInt err( KErrNone );
-        // If pairing was performed using Just Works mode, we set a 
-        // UICookie to indicate that the device is successfully 
-        // bonded so that this device will be listed in paired device view of
-        // bluetooth application:
-        if ( aDev.LinkKeyType() == ELinkKeyUnauthenticatedNonUpgradable )
-            {
-            TRACE_INFO( ( _L( "[BTENG] CBTEngOtgPair, Just Works pairing" ) ) );
-            err = iParent.AddUiCookieJustWorksPaired( aDev );
-            }
-        DoCancelOutgoingPair();
-        SetPairResult( err ? err : KErrNone );
-        ShowPairingNoteAndAuthorizeQuery();
-        }
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// From class MBTEngActiveObserver.
-// Based on the result code, decides the next operation, either try pairing 
-// with another mode, or complete pair request.
-// ---------------------------------------------------------------------------
-//
-void CBTEngOtgPair::RequestCompletedL( CBTEngActive* aActive, TInt aId, 
-    TInt aStatus )
-    {
-    TRACE_FUNC_ARG( ( _L( "reqid %d, status: %d, pair mode %d " ), aId, aStatus, iPairMode ) )
-    (void) aActive;
-    (void) aId;
- 
-    if ( aId == EDevicePairUserNotification)
-        {
-        // user notification completes:
-        iParent.OutgoingPairCompleted( aStatus ? aStatus : iPairResult );
-        iParent.RenewPairer( NULL );
-        return;
-        }
-    
-    if( aId == EDedicatedBonding && 
-				( aStatus == KErrRemoteDeviceIndicatedNoBonding || 
-					( aStatus && iPairMode != EBTOutgoingNoneHeadsetPairing && iPairMode != EBTOutgoingPairNone ) )   )
-        {
-        // try general pairing if the remote doesn't have dedicated bonding, or
-        // pairing fails with a headset.
-        DoPairingL();
-        }
-    else if ( aStatus && iPairMode == EBTOutgoingHeadsetAutoPairing )
-        {
-        iPairMode = EBTOutgoingHeadsetManualPairing;
-        // auto pairing with headset failed, try to pair again with manual pin:
-        ( void ) SetOutgoPairProperty( iOutgoProperty, iAddr, iPairMode );
-        TRACE_INFO( _L( " auto pairing failed, switch to manual pairing") );     
-        DoPairingL();
-        }
-    else if ( aStatus && aId == EGeneralBonding && 
-              iPairMode == EBTOutgoingHeadsetManualPairing )
-        {
-        // pairing headset with manual pin failed, wait for a while and try again:
-        iActive->SetRequestId( EGeneralBondingRetryTimer );
-        iTimer.After( iActive->iStatus, KBTEngGeneralBondingRetryDelayMicroSeconds );
-        iActive->GoActive();
-        }
-    else if( aId == EGeneralBondingRetryTimer )
-        {
-        // try to pair headset again with manual pin again:
-        DoPairingL();
-        }
-    else if ( aStatus )
-        {
-        // we only starts showing note if pairing failed.
-        // For a successful pair, we must wait until registry has been updated.
-        if ( !IsPairResultSet() )
-            {
-            SetPairResult( aStatus );
-            }
-        if ( aStatus )
-            {
-            ShowPairingNoteAndAuthorizeQuery();
-            }
-        }
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// From class MBTEngActiveObserver.
-// Handles a leave in RequestCompleted by self-destructing.
-// ---------------------------------------------------------------------------
-//
-void CBTEngOtgPair::HandleError( CBTEngActive* aActive, TInt aId, 
-    TInt aError )
-    {
-    TRACE_FUNC_ARG( ( _L( "error: %d" ), aError ) )
-    // Our RunL can actually not leave, so we should never reach here.
-    (void) aActive;
-    (void) aId;
-    iParent.OutgoingPairCompleted( aError );
-    iParent.RenewPairer( NULL );
-    }
-
-// ---------------------------------------------------------------------------
-// decide the next state and issue pair request
-// ---------------------------------------------------------------------------
-//
-void CBTEngOtgPair::DoPairingL()
-    {
-    TRACE_FUNC_ENTRY
-    TPairingStageId currentMode = ( TPairingStageId ) iActive->RequestId();
-    ASSERT( !iActive->IsActive() );
-    TPairingStageId nextMode( EGeneralBonding );
-    
-    // if running BTv2.0 stack, dedicated bonding method 
-    // is not available.
-    if ( currentMode == ENoBonding && iParent.PairingServer() != NULL )
-        {
-        nextMode = EDedicatedBonding;
-        }
-    else if(currentMode == EGeneralBondingRetryTimer)
-        {
-        nextMode = EGeneralBondingRetry;
-        }
-    
-    TRACE_INFO( ( _L( "[BTENG] CBTEngOtgPair::DoPairingL: bonding mode: pre %d, next %d"), currentMode, nextMode ) );
-    
-    iActive->SetRequestId( nextMode );
-    if ( nextMode == EDedicatedBonding )
-        {
-        iBondingSession.Start( *iParent.PairingServer(), iAddr, iActive->RequestStatus() );          
-        }
-    else
-        {
-        TBTServiceSecurity sec;
-        sec.SetAuthentication( ETrue );
-        iSockAddr.SetBTAddr( iAddr );
-        iSockAddr.SetPort(KSDPPSM);
-        iSockAddr.SetSecurity( sec );    
-        iSocket.Close();
-        User::LeaveIfError( iSocket.Open( iParent.SocketServ(), KL2CAPDesC ) );
-        iSocket.Connect( iSockAddr, iActive->RequestStatus() );
-        }
-    iActive->GoActive();
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// Make sure no outstanding pairing request is existing
-// ---------------------------------------------------------------------------
-//
-void CBTEngOtgPair::DoCancelOutgoingPair()
-    {
-    TRACE_FUNC_ENTRY
-    if( iActive->IsActive() )
-        {
-        iBondingSession.Close();
-        if( iSocket.SubSessionHandle() )
-            {
-            iSocket.CancelConnect();
-            iSocket.Close();
-            }
-        iTimer.Cancel();
-        iActive->CancelRequest();
-        }
-    TRACE_FUNC_EXIT
-    }
--- a/bluetoothengine/bteng/src/btengpairbase.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,176 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  the base class of pairing handling 
-*
-*/
-
-#include "btengpairman.h"
-#include "btengpairbase.h"
-#include "debug.h"
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-// C++ default constructor
-// ---------------------------------------------------------------------------
-//
-CBTEngPairBase::CBTEngPairBase( CBTEngPairMan& aParent, const TBTDevAddr& aAddr)
-    : iAddr( aAddr ), iParent( aParent )
-    {
-    }
-
-// ---------------------------------------------------------------------------
-// Symbian 2nd-phase constructor
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairBase::BaseConstructL( )
-    {
-    iActive = CBTEngActive::NewL(*this, 0, CActive::EPriorityStandard);  
-    TRACE_BDADDR( iAddr );
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------------------------
-//
-CBTEngPairBase::~CBTEngPairBase()
-    {
-    CancelNotifier();
-    iNotifier.Close();
-    delete iActive;
-    }
-
-// ---------------------------------------------------------------------------
-// Message passes through only if the result is for the same device this 
-// object is for.
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairBase::HandlePairServerResult( const TBTDevAddr& aAddr, TInt aResult )
-    {
-    if ( aAddr == iAddr )
-        {
-        TRACE_FUNC_ENTRY
-        DoHandlePairServerResult( aResult );
-        TRACE_FUNC_EXIT
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Message passes through only if the result is for the same device this 
-// object is for.
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairBase::HandleRegistryNewPairedEvent( const TBTNamelessDevice& aDev )
-    {
-    if ( aDev.Address() == iAddr )
-        {
-        TRACE_FUNC_ENTRY
-        DoHandleRegistryNewPairedEvent( aDev );
-        TRACE_FUNC_EXIT
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Default impl of virtual function. do nothing
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairBase::CancelOutgoingPair()
-    {
-    }
-
-// ---------------------------------------------------------------------------
-// Cancel outstanding notifier
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairBase::CancelNotifier()
-    {
-    if( iActive && iActive->IsActive() && 
-        iActive->RequestId() == EDevicePairUserNotification )
-        {
-        TRACE_FUNC_ENTRY
-        iNotifier.CancelNotifier( KBTPairedDeviceSettingNotifierUid );
-        iActive->Cancel();
-        TRACE_FUNC_EXIT
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Show the pairing result and ask the user to authorize the device.
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairBase::ShowPairingNoteAndAuthorizeQuery()
-    {
-    TRACE_FUNC_ENTRY
-    if ( iActive->IsActive() )
-        {
-        // In profress of showing note, won't interrupt it:
-        return;
-        }
-    TInt err ( KErrNone );
-    if (!iNotifier.Handle())
-        {
-        err = iNotifier.Connect();
-        }
-    if ( !err )
-        {
-        // Inform the user of the pairing status.
-        iActive->SetRequestId( EDevicePairUserNotification );
-        iAuthoPckg().iPairingStatus = iPairResult;
-        iAuthoPckg().iRemoteAddr = iAddr;
-        iNotifier.StartNotifierAndGetResponse( iActive->RequestStatus(), 
-            KBTPairedDeviceSettingNotifierUid, 
-            iAuthoPckg, iAuthoPckg ); 
-        iActive->GoActive();
-        }
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// Invalidate iPairResultSet
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairBase::UnSetPairResult()
-    {
-    iPairResultSet = EFalse;
-    }
-
-// ---------------------------------------------------------------------------
-// Save the result and validate the flag
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairBase::SetPairResult( TInt aResult )
-    {
-    iPairResult = aResult;
-    iPairResultSet = ETrue;
-    }
-
-// ---------------------------------------------------------------------------
-// Returns the flag
-// ---------------------------------------------------------------------------
-//
-TBool CBTEngPairBase::IsPairResultSet()
-    {
-    return iPairResultSet;
-    }
-
-// ---------------------------------------------------------------------------
-// check AO validity and its request information
-// ---------------------------------------------------------------------------
-//
-TBool CBTEngPairBase::IsNotifyingPairResult()
-    {
-    return iActive && iActive->IsActive() && 
-        iActive->RequestId() == EDevicePairUserNotification ;
-    }
-
--- a/bluetoothengine/bteng/src/btengpairman.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,916 +0,0 @@
-/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Pairing result receiver in Bluetooth engine subsystem
-*
-*/
-
-#include "btengpairman.h"
-#include "btengserver.h"
-#include "btengsrvsession.h"
-#include "btengotgpair.h"
-#include "btengincpair.h"
-#include "btengclientserver.h"
-#include "debug.h"
-#include <e32property.h>
-
-/**  Identification for active object */
-enum TPairManActiveRequestId
-    {
-    ESimplePairingResult,
-    EAuthenticationResult,
-    ERegistryInitiatePairedDevicesView,
-    ERegistryPairedDevicesNewView,
-    ERegistryInitiatePairedDevicesList,
-    ERegistryGetPairedDevices,
-    ERegistryGetLocalAddress,
-    };
-
-/**  The message argument which holds the Bluetooth address. */
-const TInt KBTEngAddrSlot = 0;
-
-// ---------------------------------------------------------------------------
-// Tells if two TBTNamelessDevice instances are for the same remote device
-// ---------------------------------------------------------------------------
-//
-TBool CompareDeviceByAddress( const TBTNamelessDevice& aDevA, const TBTNamelessDevice& aDevB )
-    {
-    return aDevA.Address() == aDevB.Address();
-    }
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-// C++ default constructor
-// ---------------------------------------------------------------------------
-//
-CBTEngPairMan::CBTEngPairMan( CBTEngServer& aServer )
-    : iServer( aServer )
-    {
-    }
-
-// ---------------------------------------------------------------------------
-// Symbian 2nd-phase constructor
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::ConstructL()
-    {
-    TRACE_FUNC_ENTRY
-        // Connect to pairing server for authentication & simple pairing 
-        // results directly from the BT stack.
-        // Pairing server doesn't exist if we run BT 2.0 stack:
-    iPairingServ = new (ELeave) RBluetoothPairingServer;
-    TInt err = iPairingServ->Connect();
-    if ( err)
-        {
-        delete iPairingServ;
-        iPairingServ = NULL;
-        }
-    else
-        {
-        User::LeaveIfError( iPairingResult.Open( *iPairingServ ) );
-        User::LeaveIfError( iAuthenResult.Open( *iPairingServ ) );
-        iSSPResultActive = CBTEngActive::NewL( *this, ESimplePairingResult, CActive::EPriorityStandard );
-        iAuthenResultActive = CBTEngActive::NewL( *this, EAuthenticationResult, CActive::EPriorityStandard );        
-        }
-
-    // RProperty for accessing the local device address
-    User::LeaveIfError( iPropertyLocalAddr.Attach(KPropertyUidBluetoothCategory, KPropertyKeyBluetoothGetLocalDeviceAddress) );
-
-    // connect to registry
-    User::LeaveIfError( iBTRegistry.Open( BTRegServ() ) );    
-    iRegistryActive = CBTEngActive::NewL( *this, ERegistryInitiatePairedDevicesView, CActive::EPriorityStandard );
-    iPairedDevices = new (ELeave) RArray<TBTNamelessDevice>; 
-
-    // Initialise paired devices list
-    iLocalAddrActive = CBTEngActive::NewL( *this, ERegistryGetLocalAddress, CActive::EPriorityStandard );
-    InitPairedDevicesList();
- 
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// NewL
-// ---------------------------------------------------------------------------
-//
-CBTEngPairMan* CBTEngPairMan::NewL( CBTEngServer& aServer )
-    {
-    CBTEngPairMan* self = NULL;
-    self = new  CBTEngPairMan( aServer );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------------------------
-//
-CBTEngPairMan::~CBTEngPairMan()
-    {
-    TRACE_FUNC_ENTRY
-    CancelSubscribe();
-    delete iSSPResultActive;
-    delete iAuthenResultActive;
-    delete iRegistryActive;
-    delete iPairedDevicesResp;
-    delete iPairer;
-    if ( iPairedDevices )
-        {
-        iPairedDevices->Close();
-        delete iPairedDevices;
-        }
-    iBTRegistry.Close();
-    iPairingResult.Close();
-    iAuthenResult.Close();
-    if ( iPairingServ )
-        {
-        iPairingServ->Close();
-        delete iPairingServ;
-        }
-    if ( !iMessage.IsNull() )
-        {
-        iMessage.Complete( KErrCancel );
-        }
-    iPropertyLocalAddr.Cancel();
-    iPropertyLocalAddr.Close();
-    delete iLocalAddrActive;
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// Initialises the paired devices list.
-// If the local address is not available from the P&S key 
-// KPropertyKeyBluetoothGetLocalDeviceAddress, then the list may need to be 
-// updated once the H/W is switched on. This is so that any registry update 
-// from a restore operation can be included in the list, without mistaking the 
-// new devices for new pairings.
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::InitPairedDevicesList()
-    {
-    TRACE_FUNC_ENTRY
-
-    // Check that we have the Bluetooth local address. If we don't then initialise anyway, but subscribe for an update.
-    // This allows us to refresh our paired devices list to include updates made to the remote devices table of the 
-    // Bluetooth registry from a restore operation. We need to include these devices without mistaking them for new 
-    // pairings. We look solely at the P&S key for the address to avoid the condition whereby the address has been
-    // entered into the reigstry but the Bluetooth Manager server has not begun the restore process yet. The signalling
-    // of the P&S key will cause Bluetooth Manager to update the registry with any restored devices before fulfilling
-    // any further requests.
-
-    // Subscribe to local address property in case we need an update.
-    iPropertyLocalAddr.Subscribe( iLocalAddrActive->iStatus );
-    iLocalAddrActive->SetRequestId( ERegistryGetLocalAddress );
-    iLocalAddrActive->GoActive();
-
-    // Attempt to read address from P&S key.
-    TBuf8<KBTDevAddrSize> btAddrDes;
-    TInt err = iPropertyLocalAddr.Get( btAddrDes );
-
-    // Is the P&S key defined yet? (if not, stack not up yet)
-    if ( err == KErrNone )
-        {
-        // P&S key defined, is local address set? (if not, H/W not initialised yet)
-        if ( btAddrDes.Length() == KBTDevAddrSize )
-            {
-            TBTDevAddr btAddr = btAddrDes;
-
-            if ( btAddr != TBTDevAddr() )
-                {
-                // Non-zero local address is available.
-                iPropertyLocalAddr.Cancel();
-                iLocalAddrActive->CancelRequest();
-                }
-            }
-        }
-
-    // Perform initialisation of the paired devices list.
-    DoInitPairedDevicesList();
-
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// Initialises the paired devices list (second stage)
-// This method performs the actual initialisation, now that the local BT H/W
-// address had been made available.
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::DoInitPairedDevicesList()
-    {
-    TRACE_FUNC_ENTRY
-
-    if ( !iRegistryActive->IsActive() )
-        {
-        // Start to get the list of all paired devices.
-        CreatePairedDevicesView( ERegistryInitiatePairedDevicesView );
-        }
-    else
-        {
-        iNotHandledInitEventCounter++;
-        }
-
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// Handles pairing related commands from BTEng clients.
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::ProcessCommandL( const RMessage2& aMessage )
-    {
-    TRACE_FUNC_ENTRY
-    TInt opcode = aMessage.Function();
-    TBTDevAddrPckgBuf addrPkg;
-    switch( opcode )
-        {
-        case EBTEngSetPairingObserver:
-            {
-            aMessage.ReadL( KBTEngAddrSlot, addrPkg );
-            SetPairObserver( addrPkg(), aMessage.Int1() );
-            break;
-            }
-        case EBTEngPairDevice:
-            {
-            if ( !iMessage.IsNull() )
-                {
-                User::Leave( KErrServerBusy );
-                }
-            TBTDevAddrPckgBuf addrPkg;
-            aMessage.ReadL( KBTEngAddrSlot, addrPkg );
-            PairDeviceL( addrPkg(), aMessage.Int1() );
-            iMessage = RMessage2( aMessage );
-            break;
-            }
-        case EBTEngCancelPairDevice:
-            {
-            // Only the client who requested pairing can cancel it:
-            if ( !iMessage.IsNull() && aMessage.Session() == iMessage.Session() )
-                {
-                iPairer->CancelOutgoingPair();
-                iMessage.Complete( KErrCancel );
-                }
-            break;
-            }
-        default:
-            {
-            TRACE_INFO( ( _L( "CBTEngPairMan ProcessCommandL: bad request (%d)" ), 
-                           aMessage.Function() ) )
-            User::Leave( KErrArgument );
-            }
-        }
-    TRACE_FUNC_EXIT    
-    }
-
-// ---------------------------------------------------------------------------
-// Handle a change in BTRegistry remote devices table.
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::RemoteRegistryChangeDetected()
-    {
-    if ( !iRegistryActive->IsActive() )
-        {
-        CreatePairedDevicesView( ERegistryPairedDevicesNewView );
-        }
-    else
-        {
-        iNotHandledRegEventCounter++;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Returns the RBluetoothPairingServer instance.
-// ---------------------------------------------------------------------------
-//
-RBluetoothPairingServer* CBTEngPairMan::PairingServer()
-    {
-    return iPairingServ;
-    }
-
-// ---------------------------------------------------------------------------
-// Access the reference of RSockServ
-// ---------------------------------------------------------------------------
-//
-RSocketServ& CBTEngPairMan::SocketServ()
-    {
-    return iServer.SocketServer();
-    }
-
-// ---------------------------------------------------------------------------
-// Access the reference of RBTRegSrv
-// ---------------------------------------------------------------------------
-//
-RBTRegServ& CBTEngPairMan::BTRegServ()
-    {
-    return iServer.RegistrServer();
-    }
-
-// ---------------------------------------------------------------------------
-// Deletes the current pairing handler and transfer the responsibility
-// to the specified.
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::RenewPairer( CBTEngPairBase* aPairer )
-    {
-    delete iPairer;
-    iPairer = aPairer;
-    }
-
-// ---------------------------------------------------------------------------
-// Find the session who requested this and completes its request.
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::OutgoingPairCompleted( TInt aErr )
-    {
-    TRACE_FUNC_ENTRY
-    // the meaning of KHCIErrorBase equals KErrNone. Hide this specific BT stack
-	// detail from clients:
-    if ( aErr == KHCIErrorBase )
-        {
-        aErr = KErrNone;
-        }
-    // we must complete client's pairing request:
-    if ( !iMessage.IsNull()  )
-        {
-        iMessage.Complete( aErr );
-        }
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// A session will be ended, completes the pending request for this session.
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::SessionClosed( CSession2* aSession )
-    {
-    TRACE_FUNC_ARG( ( _L( " session %x"), aSession ) )
-    if ( !iMessage.IsNull() && iMessage.Session() == aSession )
-        {
-        iMessage.Complete( KErrCancel );
-        }
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// Unpair the device from registry
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::UnpairDevice( const TBTDevAddr& aAddr )
-    {
-    TRACE_FUNC_ENTRY
-    TIdentityRelation<TBTNamelessDevice> addrComp( CompareDeviceByAddress );
-    TBTNamelessDevice dev;
-    dev.SetAddress( aAddr );
-    // only do unpairing if the we have a link key with it.
-    TInt index = iPairedDevices->Find( dev, addrComp );
-    if ( index > KErrNotFound )
-        {
-        dev = (*iPairedDevices)[index];
-        
-        TRequestStatus status( KRequestPending );
-        // Unpair the device in registry (synchronously)
-        iBTRegistry.UnpairDevice( dev.Address(), status );
-        User::WaitForRequest( status );
-        TRACE_INFO( ( _L( "Delete link key, res %d"), status.Int() ) )
-        
-        if ( status == KErrNone )
-            {
-            TBTDeviceSecurity security = dev.GlobalSecurity();
-            // Clear trust setting so that correct icon will be shown in ui applications.
-            security.SetNoAuthenticate(EFalse );
-            security.SetNoAuthorise(EFalse );
-            dev.SetGlobalSecurity(security);
-            dev.DeleteLinkKey();
-            if ( dev.IsValidUiCookie() && 
-                 ( dev.UiCookie() & EBTUiCookieJustWorksPaired ) )
-                {
-                // Remove the UI cookie bit for Just Works pairing.
-                TInt32 cookie = dev.UiCookie() & ~EBTUiCookieJustWorksPaired;
-                dev.SetUiCookie( cookie );
-                TRACE_INFO( ( _L( "UI cookie %x cleared"), EBTUiCookieJustWorksPaired ) );
-                }
-            // modify the device in registry synchronously
-            // status.Int() could be -1 if the device is not in registry 
-            // which is totally fine for us.
-            (void) UpdateRegDevice( dev );
-            }
-        }
-    TRACE_FUNC_EXIT
-    }
-
-TInt CBTEngPairMan::AddUiCookieJustWorksPaired( const TBTNamelessDevice& aDev )
-    {
-	TRACE_FUNC_ENTRY
-    TInt err( KErrNone );
-    // There might be UI cookies used by other applications,
-    // we should not overwrite them. 
-    TInt32 cookie = aDev.IsValidUiCookie() ? aDev.UiCookie() : EBTUiCookieUndefined;
-    if ( !( cookie & EBTUiCookieJustWorksPaired ) )
-        {
-        // Only update the cookie if the wanted one is not in registry yet
-        // to keep minimal operations with registry.
-        TBTNamelessDevice dev = aDev;		
-        cookie |= EBTUiCookieJustWorksPaired;
-        dev.SetUiCookie( cookie );
-        err = UpdateRegDevice( dev );
-        TRACE_INFO( ( _L( "[BTENG] CBTEngOtgPair write Ui cookie ret %d"), err ) );
-        }
-    TRACE_FUNC_EXIT
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-// update a nameless device in registry
-// ---------------------------------------------------------------------------
-//
-TInt CBTEngPairMan::UpdateRegDevice( const TBTNamelessDevice& aDev )
-    {
-    TRequestStatus status( KRequestPending );
-    // update the device in registry synchronously
-    iBTRegistry.ModifyDevice( aDev, status );
-    User::WaitForRequest( status );
-    TRACE_INFO( ( _L( "UpdateRegDevice, ret %d"), status.Int() ) )
-    return status.Int();
-    }
-
-// ---------------------------------------------------------------------------
-// Ask server class the connection status of the specified device
-// ---------------------------------------------------------------------------
-//
-TBTEngConnectionStatus CBTEngPairMan::IsDeviceConnected( const TBTDevAddr& aAddr )
-    {
-    return iServer.IsDeviceConnected( aAddr );
-    }
-
-// ---------------------------------------------------------------------------
-// From class MBTEngActiveObserver.
-// Checks if there is an authentication result.
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::RequestCompletedL( CBTEngActive* /*aActive*/, TInt aId, TInt aStatus )
-    {
-    TRACE_FUNC_ARG( ( _L( "aId: %d, aStatus: %d"), aId, aStatus ) )
-        // Check which request completed.
-    switch( aId )
-        {
-        case ESimplePairingResult:
-            {
-            TBTDevAddr tmpAddr = iSimplePairingRemote;
-            if (aStatus != KErrServerTerminated)
-                {
-                SubscribeSspPairingResult();
-                }
-            HandlePairingResultL( tmpAddr, aStatus );
-            break;
-            }
-        case EAuthenticationResult:
-            {
-            TBTDevAddr tmpAddr = iAuthenticateRemote;
-            if (aStatus != KErrServerTerminated)
-                {
-                SubscribeAuthenticateResult();
-                }
-            HandlePairingResultL( tmpAddr, aStatus );
-            break;
-            }
-        case ERegistryInitiatePairedDevicesView:
-        case ERegistryPairedDevicesNewView:
-            {
-            HandleCreatePairedDevicesViewCompletedL( aStatus, aId );
-            break;
-            }
-        case ERegistryInitiatePairedDevicesList:
-            {			
-			if (iSSPResultActive && iAuthenResultActive)
-				{
-				SubscribeSspPairingResult();
-				SubscribeAuthenticateResult();
-				}
-            HandleGetPairedDevicesCompletedL( aStatus, aId );
-            break;
-            }
-        case ERegistryGetPairedDevices:    
-            {
-            HandleGetPairedDevicesCompletedL( aStatus, aId );
-            break;
-            }
-        case ERegistryGetLocalAddress:
-            {
-            // Refresh paired devices list to include any restored devices.
-            DoInitPairedDevicesList();
-            break;
-            }
-        default:
-                // Should not be possible, but no need for handling.
-            TRACE_INFO( (_L("[BTEng]: CBTEngPairMan::RequestCompletedL unhandled event!!") ) )
-            break;
-        }
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// From class MBTEngActiveObserver.
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::HandleError( CBTEngActive* aActive, TInt aId, TInt aError )
-    {
-    TRACE_FUNC_ARG( ( _L( "request id: %d, error: %d" ), aId, aError ) )
-    (void) aActive;
-    (void) aError;
-    if ( aId == ERegistryInitiatePairedDevicesList || 
-         aId == ERegistryGetPairedDevices )
-        {// leave happened in registry operation, delete registry response:
-        delete iPairedDevicesResp;
-        iPairedDevicesResp = NULL;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Activate or deactivate a pairing handler
-// ---------------------------------------------------------------------------
-//
-TInt CBTEngPairMan::SetPairObserver(const TBTDevAddr& aAddr, TBool aActivate)
-    {
-    TRACE_FUNC_ARG( ( _L( "%d" ), aActivate ) )
-    TRACE_BDADDR( aAddr )
-    iPairingOperationAttempted = ETrue;
-    TInt err( KErrNone );
-    if ( !aActivate )
-        {
-        if ( iPairer )
-            {
-            iPairer->StopPairHandling( aAddr );
-            }
-        return err;
-        }
-    
-    if ( !iPairer)
-        {
-        // This is an incoming pair, unpair it from registry and 
-        // create the handler:
-        UnpairDevice( aAddr );
-        TRAP( err, iPairer = CBTEngIncPair::NewL( *this, aAddr ));     
-        }
-    if ( iPairer)
-        {
-        // let the handler decide what to do:
-        err = iPairer->ObserveIncomingPair( aAddr );        
-        }    
-    TRACE_FUNC_EXIT
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-// Delegates the request to current pair handler
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::PairDeviceL( const TBTDevAddr& aAddr, TUint32 aCod )
-    {
-    iPairingOperationAttempted = ETrue;
-    if ( !iPairer)
-        {
-        // no existing pair handling, create one:
-        iPairer = CBTEngOtgPair::NewL( *this, aAddr );
-        }
-    // let pair handler decide what to do:
-    iPairer->HandleOutgoingPairL( aAddr, aCod );
-    }
-
-// ---------------------------------------------------------------------------
-// cancel Subscribings to simple pairing result and authentication result from
-// Pairing Server
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::CancelSubscribe()
-    {
-    TRACE_FUNC_ENTRY
-    if( iSSPResultActive && iSSPResultActive->IsActive() )
-        {
-            // Cancel listening Simple pairing result
-        iPairingResult.CancelSimplePairingResult();
-        iSSPResultActive->Cancel();
-        }
-    if( iAuthenResultActive && iAuthenResultActive->IsActive() )
-        {
-            // Cancel listening authentication result
-        iAuthenResult.CancelAuthenticationResult();
-        iAuthenResultActive->Cancel();
-        }
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// Subscribes to simple pairing result from Pairing Server (if not already 
-// subscribed).
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::SubscribeSspPairingResult()
-    {
-    TRACE_FUNC_ENTRY
-    if ( !iSSPResultActive->IsActive() )
-        {
-        iPairingResult.SimplePairingResult( iSimplePairingRemote, iSSPResultActive->RequestStatus() );
-        iSSPResultActive->GoActive();
-        }
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// Subscribes to authentication result from Pairing Server (if not already
-// subscribed).
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::SubscribeAuthenticateResult()
-    {
-    TRACE_FUNC_ENTRY
-    if ( !iAuthenResultActive->IsActive() )
-        {
-        // Subscribe authentication result (which requires pairing for unpaired devices)
-        iAuthenResult.AuthenticationResult( iAuthenticateRemote, iAuthenResultActive->RequestStatus() );
-        iAuthenResultActive->GoActive();
-        }
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// Handle a pairing result from the pairing server.
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::HandlePairingResultL( const TBTDevAddr& aAddr, TInt aResult )
-    {
-    TRACE_FUNC_ARG( (_L("result %d"), aResult ) )
-    TRACE_BDADDR( aAddr );
-    if ( !iPairer && ( aResult == KErrNone || aResult == KHCIErrorBase ) )
-        {
-        // we only create new handler if incoming pairing succeeds.
-        // Pairing failure could be caused by user local cancellation, as the  
-        // result, the handler was destroyed by notifier. We shall not
-        // instantiate the handler again.
-        // If a pairing failed due to other reasons than user local cancelling,
-        // it will be catched by the already started handler 
-        // (except Just Works pairing - no handler for it at all until we receive
-        // registry change event. Thus if incoming JWs pairing failed, no user
-        // notification will be shown.)
-        TBTNamelessDevice dev;
-        dev.SetAddress( aAddr );
-        TIdentityRelation<TBTNamelessDevice> addrComp( CompareDeviceByAddress );
-        TInt index = iPairedDevices->Find( dev, addrComp );
-        
-        // If the device is not found in the old paired device list, it is a new
-        // paired device:
-        if ( index == KErrNotFound)
-            {
-            // No handler yet, create incoming pairing handler:
-            iPairer = CBTEngIncPair::NewL( *this, aAddr );
-            }
-        }
-    if ( iPairer )
-        {
-        iPairer->HandlePairServerResult( aAddr, aResult );
-        }  
-
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// issue creating a bonded devices view
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::CreatePairedDevicesView( TInt aReqId )
-    {
-    TRACE_FUNC_ENTRY
-    if ( aReqId == ERegistryInitiatePairedDevicesView )
-        {
-        iNotHandledInitEventCounter = 0;
-        }
-    else
-        {
-        iNotHandledRegEventCounter = 0;
-        }
-    TBTRegistrySearch searchPattern;
-    searchPattern.FindBonded();
-    iRegistryActive->SetRequestId( aReqId );
-    iBTRegistry.CreateView( searchPattern, iRegistryActive->iStatus );
-    iRegistryActive->GoActive();
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// gets the paired devices from the view created by CreatePairedDevicesView
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::GetPairedDevices( TInt aReqId )
-    {
-    TRACE_FUNC_ENTRY
-    delete iPairedDevicesResp;
-    iPairedDevicesResp = NULL;
-    TRAP_IGNORE( iPairedDevicesResp = CBTRegistryResponse::NewL( iBTRegistry ) );
-    if ( iPairedDevicesResp )
-        {
-        iRegistryActive->SetRequestId( aReqId );
-        iPairedDevicesResp->Start( iRegistryActive->iStatus );
-        iRegistryActive->GoActive();
-        }
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// re-create a paired device view if registry was changed during the previous
-// operation. otherwise if the view is not empty, get the paired devices.
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::HandleCreatePairedDevicesViewCompletedL( TInt aStatus, TInt aReqId )
-    {
-    TRACE_FUNC_ENTRY
-
-    if ( aReqId == ERegistryInitiatePairedDevicesView )
-        {// Initialization phase, list paired devices if there are any.
-        if ( iNotHandledInitEventCounter )
-            {
-            // Reinitialisaton detected, create paired device view again:
-            (void) iBTRegistry.CloseView();
-            CreatePairedDevicesView( ERegistryInitiatePairedDevicesView );
-            }
-        else if ( aStatus > KErrNone )
-            {
-            GetPairedDevices( ERegistryInitiatePairedDevicesList );
-            }
-        else
-            {//no paired device, close the view.
-            (void) iBTRegistry.CloseView();
-            }
-        }
-    else
-        {
-        if ( iNotHandledInitEventCounter )
-            {
-            // We need to reinitialise but we may be pairing.
-            // This situation is not expected to arise, as reinitialisation means
-            // that the H/W was only just switched on.
-            // If we have ever started to take part in a pairing, then prioritise that
-            // pairing.
-            (void) iBTRegistry.CloseView();
-            if ( iPairingOperationAttempted )
-                {
-                iNotHandledInitEventCounter = 0;
-                CreatePairedDevicesView( ERegistryPairedDevicesNewView );
-                }
-            else
-                {
-                CreatePairedDevicesView( ERegistryInitiatePairedDevicesView );
-                }
-            }
-        else if (iNotHandledRegEventCounter)
-            { // more registry change detected, create paired device view again:
-            (void) iBTRegistry.CloseView();
-            CreatePairedDevicesView( ERegistryPairedDevicesNewView );
-            }          
-        else if ( aStatus > KErrNone )
-            { // paired device available, get them:
-            GetPairedDevices( ERegistryGetPairedDevices );
-            }
-        else
-            {
-            // No paired devices in registry, empty local db:
-            (void) iBTRegistry.CloseView();
-            iPairedDevices->Reset();
-            }
-        }
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// update paired device list. if registry was changed, create a new view.
-// otherwise check for new pairing event.
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::HandleGetPairedDevicesCompletedL( TInt /*aStatus*/, TInt aReqId )
-    {
-    TRACE_FUNC_ENTRY
-    (void) iBTRegistry.CloseView();
-    if ( aReqId == ERegistryInitiatePairedDevicesList )
-        {
-        if ( iNotHandledInitEventCounter )
-            {
-            // Reinitialisation required, create paired device view again:
-            CreatePairedDevicesView( ERegistryInitiatePairedDevicesView );
-            }
-        else
-            {
-            // We completed the initialisation of paired device list, 
-            // move all paired devices to the array:
-            UpdatePairedDeviceListL();
-            }
-        }
-    else
-        {
-        if (iNotHandledInitEventCounter)
-            {
-            // We need to reinitialise but we may be pairing.
-            // This situation is not expected to arise, as reinitialisation means
-            // that the H/W was only just switched on.
-            // If we have ever started to take part in a pairing, then prioritise that
-            // pairing.
-            if ( iPairingOperationAttempted )
-                {
-                iNotHandledInitEventCounter = 0;
-                CreatePairedDevicesView( ERegistryPairedDevicesNewView );
-                }
-            else
-                {
-                CreatePairedDevicesView( ERegistryInitiatePairedDevicesView );
-                }		
-            }     
-        else if (iNotHandledRegEventCounter)
-            { // more registry change detected, create paired device view again:
-            CreatePairedDevicesView( ERegistryPairedDevicesNewView );
-            }
-        else if ( aReqId == ERegistryGetPairedDevices)
-           {
-            // no more registry change detected, find new pairings:
-            CheckPairEventL();
-           }
-        }
-
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// copy the nameless devices to local array
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::UpdatePairedDeviceListL()
-    {
-    TRACE_FUNC_ENTRY
-    iPairedDevices->Reset();
-    for ( TInt i = 0; i < iPairedDevicesResp->Results().Count(); i++ )
-        {
-        TRACE_BDADDR( iPairedDevicesResp->Results()[i]->BDAddr() );
-        TRACE_INFO((_L("[BTENG]\t linkkeytype %d"), 
-                iPairedDevicesResp->Results()[i]->LinkKeyType()))
-        iPairedDevices->AppendL( iPairedDevicesResp->Results()[i]->AsNamelessDevice() );
-        }
-    delete iPairedDevicesResp;
-    iPairedDevicesResp = NULL;
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// find new paired devices. for each, delegate the information to
-// current pair handler.
-// ---------------------------------------------------------------------------
-//
-void CBTEngPairMan::CheckPairEventL()
-    {
-    TRACE_FUNC_ENTRY
-    RArray<TBTNamelessDevice>* pairedDevicesOld;
-    pairedDevicesOld = iPairedDevices;
-    CleanupStack::PushL( pairedDevicesOld );
-    CleanupClosePushL( *pairedDevicesOld );
-    iPairedDevices = NULL;
-    iPairedDevices = new (ELeave) RArray<TBTNamelessDevice>;
-    UpdatePairedDeviceListL();
-    
-    TIdentityRelation<TBTNamelessDevice> addrComp( CompareDeviceByAddress );
-    for ( TInt i = 0; i < iPairedDevices->Count(); i++ )
-        {
-        TBTNamelessDevice& dev = (*iPairedDevices)[i];        
-        TInt index = pairedDevicesOld->Find( dev, addrComp );
- 
-        // If the device is not found in the old paired device list or
-        // the link key type has been changed from 
-        // ELinkKeyUnauthenticatedUpgradable, the device is a new 
-        // paired device:
-        TBool newPaired = dev.LinkKeyType() != ELinkKeyUnauthenticatedUpgradable && 
-             ( index == KErrNotFound  || 
-                 ( index > KErrNotFound &&
-                 dev.LinkKeyType() != (*pairedDevicesOld)[index].LinkKeyType() ) );
-        TRACE_BDADDR( dev.Address() );
-        if ( newPaired && !iPairer)
-            {
-            iPairingOperationAttempted = ETrue;
-            iPairer = CBTEngIncPair::NewL( *this, dev.Address() );
-            }
-        if ( newPaired && iPairer )
-            {
-            // Ask pair handler to decide what to do:
-            iPairer->HandleRegistryNewPairedEvent( dev );
-            }
-        }
-    // Free old paired device list resource:
-    CleanupStack::PopAndDestroy( 2 );
-    TRACE_FUNC_EXIT
-    }
-
--- a/bluetoothengine/bteng/src/btengserver.cpp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/src/btengserver.cpp	Fri May 14 16:01:46 2010 +0300
@@ -37,7 +37,6 @@
 #include "btengsecpolicy.h"
 #include "btengprivatepskeys.h"
 #include "btengplugin.h"
-#include "btengpairman.h"
 #include "debug.h"
 
 /**  Bluetooth Engine server thread name */
@@ -167,8 +166,7 @@
     iPluginMgr = CBTEngSrvPluginMgr::NewL( this );
     iBBConnMgr = CBTEngSrvBBConnMgr::NewL( this, iSocketServ );
 
-    User::LeaveIfError( iBTRegServ.Connect() );
-    iPairMan = CBTEngPairMan::NewL( *this );
+    iSdpDbHandler = NULL;
 
     TCallBack idleCb( IdleTimerCallBack, this );
     iIdleCallBack.Set( idleCb );
@@ -219,15 +217,16 @@
     RProperty::Delete( KPSUidBluetoothEnginePrivateCategory, KBTTurnBTOffQueryOn );
     RProperty::Delete( KPSUidBluetoothEnginePrivateCategory, KBTNotifierLocks );
     delete iTimer;
-    delete iSdpDbHandler;
+    if ( iSdpDbHandler )
+        {
+        delete iSdpDbHandler;
+        }
     delete iWatcher;
     delete iSettingsMgr;
     delete iPluginMgr;
     delete iBBConnMgr;
     delete iServerState;
-    delete iPairMan;
     iSocketServ.Close();
-    iBTRegServ.Close();
     }
 
 // ---------------------------------------------------------------------------
@@ -315,7 +314,6 @@
 	TRACE_INFO( ( _L( "[CBTEngServer]\t iSessionCount %d"), iSessionCount ))
     iSessionCount--;
 	iSettingsMgr->SessionClosed( aSession );
-	iPairMan->SessionClosed( aSession );
     if( aAutoOff )
         {
         TRAP_IGNORE( SetPowerStateL( EBTOff, ETrue ) );
--- a/bluetoothengine/bteng/src/btengsrvbbconnectionmgr.cpp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/src/btengsrvbbconnectionmgr.cpp	Fri May 14 16:01:46 2010 +0300
@@ -92,15 +92,13 @@
 //
 CBTEngSrvBBConnMgr::~CBTEngSrvBBConnMgr()
     {
-    Unsubscribe();
+	delete iLinkCountWatcher;
+	delete iWlanWatcher;    
 	iLinkCountProperty.Close();
     iWlanStatusProperty.Close();
-	delete iLinkCountWatcher;
-	delete iWlanWatcher;
 	delete iPhyLinks;
     }
 
-
 // ---------------------------------------------------------------------------
 // Start listening to the relevant properties.
 // ---------------------------------------------------------------------------
@@ -126,19 +124,10 @@
 //
 void CBTEngSrvBBConnMgr::Unsubscribe()
     {
-    if( iLinkCountWatcher->IsActive() )
-        {
-        iLinkCountProperty.Cancel();
-        iLinkCountWatcher->CancelRequest();
-        }
-	if( iWlanWatcher && iWlanWatcher->IsActive() )
-	    {
-	    iWlanStatusProperty.Cancel();
-	    iWlanWatcher->CancelRequest();
-	    }
+    iLinkCountWatcher->Cancel();
+    iWlanWatcher->Cancel();
     }
 
-
 // ---------------------------------------------------------------------------
 // ?implementation_description
 // ---------------------------------------------------------------------------
@@ -364,22 +353,20 @@
 // ?implementation_description
 // ---------------------------------------------------------------------------
 //
-void CBTEngSrvBBConnMgr::RequestCompletedL( CBTEngActive* aActive, TInt aId, 
+void CBTEngSrvBBConnMgr::RequestCompletedL( CBTEngActive* aActive,
     TInt aStatus )
     {
-    TRACE_FUNC_ARG( ( _L( "id: %d; status: %d" ), aId, aStatus ) )
-    ASSERT( aId == KBTEngSrvBBConnId || aId == KBTEngSrvWlanStatusId );
-    (void) aActive;
-    (void) aId;
+    TRACE_FUNC_ARG( ( _L( "id: %d; status: %d" ), aActive->RequestId(), aStatus ) )
+    ASSERT( aActive->RequestId() == KBTEngSrvBBConnId || aActive->RequestId() == KBTEngSrvWlanStatusId );
     if( aStatus != KErrPermissionDenied )
         {
-            // Ignore any other errors.
-            // First subscribe again, so that we don't miss any updates.
-            Subscribe();
+        // Ignore any other errors.
+        // First subscribe again, so that we don't miss any updates.
+        Subscribe();
         }
     (void) ManageTopology( EFalse );    // Ignore result; nothing to do 
                                         // about it here.
-    if( aId == KBTEngSrvBBConnId )
+    if( aActive->RequestId() == KBTEngSrvBBConnId )
         {
         TRACE_INFO( ( _L( "[BTENG] PHY count key changed, update UI connection status" ) ) )
         iServer->SettingsManager()->SetUiIndicatorsL();
@@ -387,6 +374,24 @@
     TRACE_FUNC_EXIT
     }
 
+// ---------------------------------------------------------------------------
+// From class MBTEngActiveObserver.
+// Handles cancelation of an outstanding request
+// ---------------------------------------------------------------------------
+//
+void CBTEngSrvBBConnMgr::CancelRequest( TInt aRequestId )
+    {
+    TRACE_FUNC_ARG( ( _L( "reqID %d" ), aRequestId ) );
+    if ( aRequestId == KBTEngSrvBBConnId )
+        {
+        iLinkCountProperty.Cancel();
+        }
+    else if ( aRequestId == KBTEngSrvWlanStatusId )
+        {
+        iWlanStatusProperty.Cancel();
+        }
+    TRACE_FUNC_EXIT
+    }
 
 // ---------------------------------------------------------------------------
 // From class MBTEngActiveObserver.
@@ -394,12 +399,11 @@
 // RunL cannot actually leave.
 // ---------------------------------------------------------------------------
 //
-void CBTEngSrvBBConnMgr::HandleError( CBTEngActive* aActive, TInt aId, 
+void CBTEngSrvBBConnMgr::HandleError( CBTEngActive* aActive,  
     TInt aError )
     {
-    TRACE_FUNC_ARG( ( _L( "id: %d; status: %d" ), aId, aError ) )
+    TRACE_FUNC_ARG( ( _L( "id: %d; status: %d" ), aActive->RequestId(), aError ) )
     (void) aActive;
-    (void) aId;
     (void) aError;
     }
 
--- a/bluetoothengine/bteng/src/btengsrvkeywatcher.cpp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/src/btengsrvkeywatcher.cpp	Fri May 14 16:01:46 2010 +0300
@@ -27,7 +27,6 @@
 #include "btengserver.h"
 #include "btengsrvpluginmgr.h"
 #include "btengsrvsettingsmgr.h"
-#include "btengpairman.h"
 #include "btengprivatepskeys.h"
 #include "btengprivatecrkeys.h"
 #include "debug.h"
@@ -48,8 +47,7 @@
 const TInt KBTEngSapWatcher = 22;
 /**  Identification for active object */
 const TInt KBTEngAddrWatcher = 23;
-/**  Identification for active object */
-const TInt KBTEngRegistryWatcher = 24;
+
 /**  Identification for active object */
 const TInt KBTEngSspDebugWatcher = 25;
 /**  Buffer size for BT device address as stored in CenRep */
@@ -129,16 +127,6 @@
         iEmergencyCallKey.Subscribe( iEmergencyCallWatcher->RequestStatus() );
         iEmergencyCallWatcher->GoActive();
         }
-
-    err = iBtRegistryKey.Attach( KPropertyUidBluetoothCategory, KPropertyKeyBluetoothGetRegistryTableChange );
-    if( !err )
-        {
-        iBtRegistryWatcher = CBTEngActive::NewL( *this, KBTEngRegistryWatcher, 
-                                                 CActive::EPriorityStandard );
-        iBtRegistryKey.Subscribe( iBtRegistryWatcher->RequestStatus() );
-        iBtRegistryWatcher->GoActive();
-        }
-
     err = iSspDebugModeKey.Attach( KPSUidBluetoothTestingMode, KBTSspDebugmode );
     if( !err )
         {
@@ -192,75 +180,32 @@
 //
 CBTEngSrvKeyWatcher::~CBTEngSrvKeyWatcher()
     {
-    if( iDutModeKey.Handle() )
-        {
-        iDutModeKey.Cancel();
-        }
     delete iDutModeWatcher;
     iDutModeKey.Close();
 
 #ifdef RD_REMOTELOCK
-    if( iPhoneLockKey.Handle() )
-        {
-        iPhoneLockKey.Cancel();
-        }
     delete iPhoneLockWatcher;
     iPhoneLockKey.Close();
 #endif  //RD_REMOTELOCK
 
-    if( iSystemStateKey.Handle() )
-        {
-        iSystemStateKey.Cancel();
-        }
     delete iSystemStateWatcher;
-    iSystemStateKey.Close();    
-     
-    if( iBtConnectionKey.Handle() )
-        {
-        iBtConnectionKey.Cancel();
-        }
+    iSystemStateKey.Close();
+
     delete iBtConnectionWatcher;
     iBtConnectionKey.Close();
-    
-    if( iBtScanningKey.Handle() )
-        {
-        iBtScanningKey.Cancel();
-        }
+
     delete iBtScanningWatcher;
     iBtScanningKey.Close();
 
-    if( iEmergencyCallKey.Handle() )
-        {
-        iEmergencyCallKey.Cancel();
-        }
     delete iEmergencyCallWatcher;
     iEmergencyCallKey.Close();
-    
-    if( iSspDebugModeKey.Handle() )
-        {
-        iSspDebugModeKey.Cancel();
-        }
+
     delete iSspDebugModeWatcher;
     iSspDebugModeKey.Close();
 
-    if( iBtRegistryKey.Handle() )
-    	{
-    	iBtRegistryKey.Cancel();
-    	}
-    delete iBtRegistryWatcher;
-    iBtRegistryKey.Close();
-
-    if( iSapKeyCenRep )
-        {
-        iSapKeyCenRep->NotifyCancel( KBTSapEnabled );
-        }
     delete iSapModeWatcher;
     delete iSapKeyCenRep;
 
-    if( iBdaddrKey.Handle() )
-        {
-        iBdaddrKey.Cancel();
-        }
     delete iBdaddrWatcher;
     iBdaddrKey.Close();
     }
@@ -271,13 +216,13 @@
 // Processes a changed key value.
 // ---------------------------------------------------------------------------
 //
-void CBTEngSrvKeyWatcher::RequestCompletedL( CBTEngActive* aActive, TInt aId, 
+void CBTEngSrvKeyWatcher::RequestCompletedL( CBTEngActive* aActive, 
     TInt aStatus )
     {
     TRACE_FUNC_ARG( ( _L( "status %d" ), aStatus ) )
     ASSERT( aStatus != KErrPermissionDenied );
     TInt val = 0;
-    switch( aId )
+    switch( aActive->RequestId() )
         {
         case KBTEngDutWatcher:
             {
@@ -360,22 +305,6 @@
                 }
             break;
             }
-        case KBTEngRegistryWatcher:
-        	{
-            TRACE_INFO( ( _L( "BT Registry key changed" ) ) )
-            TInt myChangedTable;
-
-			iBtRegistryKey.Subscribe( aActive->RequestStatus() );
-			aActive->GoActive();
-
-            TInt err = iBtRegistryKey.Get( myChangedTable );
-            if( !err && myChangedTable == KRegistryChangeRemoteTable )
-            	{
-            	TRACE_INFO( ( _L("BT Remote registry key changed") ) )
-            	iServer->PairManager()->RemoteRegistryChangeDetected();
-            	}
-        	break;
-        	}    
         case KBTEngSapWatcher:
             {
             TRACE_INFO( ( _L( "SAP mode key changed" ) ) )
@@ -428,7 +357,7 @@
             break;
         default:
             {
-            TRACE_INFO( ( _L( "[BTENG]\t wrong key notification! id=%d" ), aId ) )
+            TRACE_INFO( ( _L( "[BTENG]\t wrong key notification! id=%d" ), aActive->RequestId() ) )
             }
             break;
 
@@ -436,6 +365,73 @@
     TRACE_FUNC_EXIT
     }
 
+// ---------------------------------------------------------------------------
+// From class MBTEngActiveObserver.
+// Handles cancelation of an outstanding request
+// ---------------------------------------------------------------------------
+//
+void CBTEngSrvKeyWatcher::CancelRequest( TInt aRequestId )
+    {
+    TRACE_FUNC_ARG( ( _L( "reqID %d" ), aRequestId ) )
+    switch( aRequestId )
+        {
+        case KBTEngDutWatcher:
+            {
+            iDutModeKey.Cancel();
+            break;
+            }
+        case KBTEngLockWatcher:
+            {
+            iPhoneLockKey.Cancel();
+            break;
+            }
+        case KBTEngSysWatcher:
+            {
+            iSystemStateKey.Cancel();
+            break;
+            }
+        case KBTEngBtConnectionWatcher:
+            {
+            iBtConnectionKey.Cancel();
+            break;
+            }
+                    
+        case KBTEngScanningWatcher:
+            {
+            iBtScanningKey.Cancel();
+            break;
+            }
+            
+        case KBTEngEmergencyWatcher:
+            {
+            iEmergencyCallKey.Cancel();
+            break;
+            }
+            
+        case KBTEngSspDebugWatcher:
+            {
+            iSspDebugModeKey.Cancel();
+            break;
+            }   
+        case KBTEngSapWatcher:
+            {
+            iSapKeyCenRep->NotifyCancel( KBTSapEnabled );
+            break;
+            }
+            
+        case KBTEngAddrWatcher:
+            {
+            iBdaddrKey.Cancel();
+            break;
+            }
+        default:
+            {
+            TRACE_INFO( ( _L( "[BTENG]\t wrong key notification! id=%d" ), aRequestId ) )
+            break;
+            }
+        }
+    TRACE_FUNC_EXIT 
+    }
 
 // ---------------------------------------------------------------------------
 // From class MBTEngActiveObserver.
@@ -443,14 +439,14 @@
 // the subscriptions are active.
 // ---------------------------------------------------------------------------
 //
-void CBTEngSrvKeyWatcher::HandleError( CBTEngActive* aActive, TInt aId, 
+void CBTEngSrvKeyWatcher::HandleError( CBTEngActive* aActive, 
     TInt aError )
     {
     TRACE_FUNC_ARG( ( _L( "status %d" ), aError ) )
     (void) aError;
     if( !aActive->IsActive() )
         {
-        switch( aId )
+        switch( aActive->RequestId() )
             {
             case KBTEngDutWatcher:
                 {
@@ -483,7 +479,7 @@
                 break;
             default:
                 {
-                TRACE_INFO( ( _L( "[BTENG]\t wrong key notification! id=%d" ), aId ) )
+                TRACE_INFO( ( _L( "[BTENG]\t wrong key notification! id=%d" ), aActive->RequestId() ) )
                 }
                 return; // we don't want to go active without subscribing
             }
--- a/bluetoothengine/bteng/src/btengsrvpluginmgr.cpp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/src/btengsrvpluginmgr.cpp	Fri May 14 16:01:46 2010 +0300
@@ -83,6 +83,7 @@
     {
     iPluginInfoArray.Close();
     iPluginArray.ResetAndDestroy();
+    REComSession::FinalClose();
     }
 
 
--- a/bluetoothengine/bteng/src/btengsrvsession.cpp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/src/btengsrvsession.cpp	Fri May 14 16:01:46 2010 +0300
@@ -21,7 +21,6 @@
 #include "btengsrvsession.h"
 #include "btengserver.h"
 #include "btengsrvbbconnectionmgr.h"
-#include "btengpairman.h"
 #include "btengsrvsettingsmgr.h"
 #include "btengclientserver.h"
 #include "debug.h"
@@ -158,7 +157,6 @@
     if( !aMessage.IsNull() &&
         ( err || 
           ( aMessage.Function() != EBTEngNotifyConnectionEvents && 
-            aMessage.Function() != EBTEngPairDevice &&
             aMessage.Function() != EBTEngSetPowerState ) ) )
         {
             // Return the error code to the client.
@@ -258,25 +256,6 @@
             Server()->BasebandConnectionManager()->ManageTopology( ETrue );
             }
             break;
-        case EBTEngSetPairingObserver:
-            {
-            CheckPowerOnL();
-            // Simply forward it to the pairing manager
-            Server()->PairManager()->ProcessCommandL( aMessage );
-            break;
-            }
-        case EBTEngPairDevice:
-            {
-            CheckPowerOnL();
-            // Simply forward it to the pairing manager
-            Server()->PairManager()->ProcessCommandL( aMessage );
-            break;
-            }
-        case EBTEngCancelPairDevice:
-            {
-            Server()->PairManager()->ProcessCommandL( aMessage );
-            break;
-            }
         default:
             {
             TRACE_INFO( ( _L( "[BTENG]\t DispatchMessageL: bad request (%d)" ), aMessage.Function() ) )
--- a/bluetoothengine/bteng/src/btengsrvsettingsmgr.cpp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/src/btengsrvsettingsmgr.cpp	Fri May 14 16:01:46 2010 +0300
@@ -23,8 +23,7 @@
 #include <centralrepository.h>
 #include <featmgr.h>
 #include <AknSmallIndicator.h>
-#include <avkon.hrh>
-
+//#include <avkon.hrh>
 #include "btengserver.h"
 #include "btengsrvpluginmgr.h"
 #include "btengsrvbbconnectionmgr.h"
@@ -93,11 +92,6 @@
 //
 CBTEngSrvSettingsMgr::~CBTEngSrvSettingsMgr()
     {
-    if( iActive && iActive->IsActive() )
-        {
-        // Cancel the outstanding request.
-        iPowerMgr.Cancel();
-        }
     delete iActive;  
     iPowerMgr.Close();
     }
@@ -184,11 +178,11 @@
         if ( currentState == aState )
             {
             // Make sure that the CenRep key is in sync.
-            // During boot-up, the pwoer is set from the CenRep key, so we could 
+            // During boot-up, the power is set from the CenRep key, so we could 
             // end up out-of-sync.
             TRACE_INFO( ( _L( "SetPowerStateL: currentState == aState" ) ) )
-            UpdateCenRepPowerKeyL( aState );
-            } 
+            HandleHwPowerChangeL( aState );
+            }
         return;
         }
     if ( aState == EBTOn )
@@ -318,21 +312,20 @@
 
 
 // ---------------------------------------------------------------------------
-// Update the power state CenRep key.
+// Update the power state CenRep key, and start BTNotif server if BT is on.
 // ---------------------------------------------------------------------------
 //
-void CBTEngSrvSettingsMgr::UpdateCenRepPowerKeyL( TBTPowerState aState )
+void CBTEngSrvSettingsMgr::HandleHwPowerChangeL( TBTPowerState aState )
     {
     TRACE_FUNC_ENTRY
     CRepository* cenrep = CRepository::NewLC( KCRUidBluetoothPowerState );
     // TBTPowerState power state type is inverted from TBTPowerStateValue...
-    TBTPowerStateValue power = (TBTPowerStateValue) !aState;
+    TBTPowerStateValue power = ( aState == EBTOn ) ? EBTPowerOn : EBTPowerOff;
     User::LeaveIfError( cenrep->Set( KBTPowerState, (TInt) power ) );
     CleanupStack::PopAndDestroy( cenrep );
     TRACE_FUNC_EXIT
     }
 
-
 // ---------------------------------------------------------------------------
 // ?implementation_description
 // ---------------------------------------------------------------------------
@@ -654,9 +647,9 @@
 // Callback to notify that an outstanding request has completed.
 // ---------------------------------------------------------------------------
 //
-void CBTEngSrvSettingsMgr::RequestCompletedL( CBTEngActive* aActive, TInt aId, TInt aStatus )
+void CBTEngSrvSettingsMgr::RequestCompletedL( CBTEngActive* aActive, TInt aStatus )
     {
-    __ASSERT_ALWAYS( aId == KBTEngSettingsActive, PanicServer( EBTEngPanicCorrupt ) );
+    __ASSERT_ALWAYS( aActive->RequestId() == KBTEngSettingsActive, PanicServer( EBTEngPanicCorrupt ) );
     TRACE_FUNC_ENTRY
     (void) aActive;
     if ( aStatus != KErrNone && aStatus != KErrAlreadyExists && aStatus != KErrCancel )
@@ -664,7 +657,6 @@
         // Something went wrong, so we turn BT off again.
         SetPowerStateL( EBTOff, EFalse );
         }
-    
     if ( !iMessage.IsNull())
         {
         iMessage.Complete( aStatus );
@@ -672,16 +664,29 @@
     TRACE_FUNC_EXIT
     }
 
+// ---------------------------------------------------------------------------
+// From class MBTEngActiveObserver.
+// Handles cancelation of an outstanding request
+// ---------------------------------------------------------------------------
+//
+void CBTEngSrvSettingsMgr::CancelRequest( TInt aRequestId )
+    {
+    TRACE_FUNC_ARG( ( _L( "reqID %d" ), aRequestId ) );
+    if ( aRequestId == KBTEngSettingsActive )
+        {
+        iPowerMgr.Cancel();
+        }
+    TRACE_FUNC_EXIT 
+    }
 
 // ---------------------------------------------------------------------------
 // From class MBTEngActiveObserver.
 // Callback to notify that an error has occurred in RunL.
 // ---------------------------------------------------------------------------
 //
-void CBTEngSrvSettingsMgr::HandleError( CBTEngActive* aActive, TInt aId, TInt aError )
+void CBTEngSrvSettingsMgr::HandleError( CBTEngActive* aActive, TInt aError )
     {
     (void) aActive;
-    (void) aId;
     if ( !iMessage.IsNull())
         {
         iMessage.Complete( aError );
@@ -729,10 +734,11 @@
     
     if( powerState == EBTPowerOff )
         {
-        SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOff );
-        SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateOff );
-        SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOff );
-        SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateOff );
+        // To be migrated
+        //SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOff );
+        //SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateOff );
+        //SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOff );
+        //SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateOff );
         }
     else
         {
@@ -748,56 +754,59 @@
             {
              if ( connecting ) // BT connecting and hidden
                 {
-                SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOff );
-                SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateAnimate );
+                // To be migrated to QT
+                //SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOff );
+                //SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateAnimate );
                 }
             else if ( phys > 0 ) // BT connection active and hidden     
                 {
-                SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOff );
-                SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateOn );
+                //SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOff );
+                //SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateOn );
                 }
             else  // BT connection not active and hidden
                 {
-                SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOn );
-                SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateOff );
+                //SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOn );
+                //SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateOff );
                 }
-            SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOff );
-            SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateOff );
+            //SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOff );
+            //SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateOff );
             }           
         else if( visibilityMode == EBTVisibilityModeGeneral || visibilityMode == EBTVisibilityModeTemporary )
             {     
             if ( connecting ) // BT connecting and visible
                 {
-                SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOff );
-                SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateAnimate );
+                //SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOff );
+                //SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateAnimate );
                 }
             else if ( phys > 0 ) // BT connection active and visible 
                 {
-                SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOff );
-                SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateOn );
+                //SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOff );
+                //SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateOn );
                 }
             else  // BT connection not active and visible
                 {
-                SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOn );
-                SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateOff );
+                //SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOn );
+                //SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateOff );
                 }
-            SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOff );
-            SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateOff );
+            //SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOff );
+            //SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateOff );
             }
         }
     TRACE_FUNC_EXIT
     }
 
-
 // ---------------------------------------------------------------------------
 // ?implementation_description
 // ---------------------------------------------------------------------------
 //
 void CBTEngSrvSettingsMgr::SetIndicatorStateL( const TInt aIndicator, const TInt aState )
     {
-    CAknSmallIndicator* indicator = CAknSmallIndicator::NewLC( TUid::Uid( aIndicator ) );
-    indicator->SetIndicatorStateL( aState );
-    CleanupStack::PopAndDestroy( indicator ); //indicator
+    // To be migrated to QT
+    (void) aIndicator;
+    (void) aState;
+    //CAknSmallIndicator* indicator = CAknSmallIndicator::NewLC( TUid::Uid( aIndicator ) );
+    //indicator->SetIndicatorStateL( aState );
+    //CleanupStack::PopAndDestroy( indicator ); //indicator
     }
 
 
@@ -886,3 +895,4 @@
         }
     TRACE_FUNC_EXIT 
     }
+
--- a/bluetoothengine/bteng/src/btengsrvstate.cpp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bteng/src/btengsrvstate.cpp	Fri May 14 16:01:46 2010 +0300
@@ -108,7 +108,7 @@
         // Power off, starting state is to disconnect the plug-ins
         iState = EDisconnectPlugins;
         iOperation = EPowerOff;
-        iServer->SettingsManager()->UpdateCenRepPowerKeyL( EBTOff );
+        iServer->SettingsManager()->HandleHwPowerChangeL( EBTOff );
         iServer->SettingsManager()->SetUiIndicatorsL();
         }
     ChangeState();
@@ -212,7 +212,7 @@
             {
             if( iOperation == EPowerOn )
                 {
-                iServer->SettingsManager()->UpdateCenRepPowerKeyL( EBTOn );
+                iServer->SettingsManager()->HandleHwPowerChangeL( EBTOn );
                 iServer->SettingsManager()->SetUiIndicatorsL();
                 }
             iOperation = ESrvOpIdle;
--- a/bluetoothengine/bthid/bthidkbdsettings/group/bld.inf	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bthid/bthidkbdsettings/group/bld.inf	Fri May 14 16:01:46 2010 +0300
@@ -21,17 +21,7 @@
 
 PRJ_EXPORTS
 
-PRJ_EXTENSIONS
-START EXTENSION s60/mifconv
-OPTION TARGETFILE btkeyboard.mif
-OPTION TARGETFILE btkeyboard_aif.mif
-OPTION HEADERFILE btkeyboard.mbg
-OPTION SOURCEDIR ../aif
-OPTION SOURCES -c8,8 qgn_wka_cxt
-END
-
 PRJ_MMPFILES
 bthidsettings.mmp
-bthidkbdsettings.mmp
 
 
--- a/bluetoothengine/bthid/bthidkbdsettings/inc/bthidsettingcontainer.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 setting container class.
- *
-*/
-
-#ifndef BTHIDSETTINGCONTAINER_H
-#define BTHIDSETTINGCONTAINER_H
-
-/**
- *  CBTHidSettingContainer  
- *  container control class.
- */
-class CBTHidSettingContainer : public CCoeControl, public MCoeControlObserver
-    {
-public:
-    // Constructors and destructor
-
-    /**
-     * EPOC default constructor.
-     * @param aRect Frame rectangle for container.
-     */
-    void ConstructL(const TRect& aRect);
-
-    /**
-     * Constructs common parts of the container.
-     * @param aRect control's rect.
-     */
-    void BaseConstructL(const TRect& aRect);
-
-    /**
-     * Destructor.
-     */
-    ~CBTHidSettingContainer();
-
-private:
-    // Functions from base classes
-
-    /**
-     * From CCoeControl,Draw.
-     */
-    void Draw(const TRect& aRect) const;
-
-    /**
-     * From CCoeControl
-     */
-    void HandleResourceChange(TInt aType);
-
-    /**
-     * From CoeControl,SizeChanged.
-     */
-    void SizeChanged();
-
-    /**
-     * From CoeControl,CountComponentControls.
-     */
-    TInt CountComponentControls() const;
-
-    /**
-     * From CCoeControl,ComponentControl.
-     */
-    CCoeControl* ComponentControl(TInt aIndex) const;
-
-    /**
-     * From MCoeControlObserver
-     */
-    void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType);
-
-    /**
-     * Pass skin information if needed.
-     */
-    TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
-
-    /**
-     * From CCoeControl
-     */
-    void GetHelpContext(TCoeHelpContext& aContext) const;
-
-private:
-    //data
-    CAknsBasicBackgroundControlContext* iBackGround; //for skins support
-
-
-    };
-
-#endif // BTHIDSETTINGCONTAINER_H
-// End of File
--- a/bluetoothengine/bthid/bthidkbdsettings/inc/bthidsettinglist.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 settings list class.
- *
-*/
-
-
-#ifndef __BTHIDSETTINGLIST_H__
-#define __BTHIDSETTINGLIST_H__
-
-#include <aknsettingitemlist.h>
-
-class CBtHidSettings;
-class CBtHidSettingView;
-
-class CBTKeySettingList : public CAknSettingItemList
-    {
-public:
-    CBTKeySettingList(CBtHidSettings& aSettings,
-            CBtHidSettingView* aBtHidSettingView);
-
-    CAknSettingItem* CreateSettingItemL(TInt identifier);
-
-    // handles the listbox events
-    virtual void HandleListBoxEventL(CEikListBox* aListBox,
-            TListBoxEvent aEventType);
-
-    void EditCurrentItemL(TInt aCommand);
-
-private:
-    void SizeChanged();
-
-private:
-    // From CCoeControl
-
-private:
-    /*! A reference to the BtHidSettings object */
-    CBtHidSettings& iSettings;
-
-    /*! Temporary layout code variable */
-    TInt iLayoutCode;
-
-    CBtHidSettingView* iBtHidSettingView;
-    };
-
-#endif
-
--- a/bluetoothengine/bthid/bthidkbdsettings/inc/bthidsettingview.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,169 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 the setting view for keyboard device.
- *
-*/
-
-
-#ifndef BTHIDSETTINGVIEW_H
-#define BTHIDSETTINGVIEW_H
-
-// INCLUDES
-
-#include <aknview.h>        // AVKON components
-#include <akncontext.h>
-#include <eikmenup.h>       // Menu pane definitions
-#include <ConeResLoader.h>
-#include <btdevice.h>
-#include "BtuiPluginInterface.h"
-#include "bthidsettings.h"
-#include "bthidsettinglist.h"
-#include "bthidcenrepwatcher.h"
-// FORWARD DECLARATIONS
-class CBTHidSettingContainer;
-class CBTKeySettingList;
-#include "bthidsettings.h"
-#include "layoutmgr.h"
-#include "hidlayoutids.h"
-// CONSTANTS
-_LIT(KFileDrive,"z:");
-_LIT(KResourceFileName, "BthidResource.rsc");
-
-// CLASS DECLARATION
-
-/**
- * Main view of the application. Handles view activation, 
- * deactivation, commands and dynamic options menus.
- */
-class CBtHidSettingView : public CBtuiPluginInterface,
-        public MBtHidCenRepObserver
-    {
-public:
-    // Constructors and destructor
-
-    /**
-     * ECOM implementation instantiation function of 
-     * interface "CBtuiPluginInterface", to be used by BtuiPairedView.
-     */
-    static CBtHidSettingView* NewBtuiPluginL( /* TAny* aAppUi */);
-
-    /**
-     * Destructor.
-     */
-    virtual ~CBtHidSettingView();
-
-protected:
-
-    /**
-     * C++ default constructor.
-     */
-    CBtHidSettingView(/* CAknViewAppUi* aAppUi */);
-
-    /**
-     * Symbian 2nd phase constructor.
-     */
-    void ConstructL();
-
-public:
-    // Functions from base classes
-
-    /**
-     * From CAknView Returns view id.
-     * @param None.
-     * @return View id.
-     */
-    TUid Id() const;
-
-    /**
-     * From CAknView Handles user commands.
-     * @param aCommand A command id.        
-     * @return None.
-     */
-    void HandleCommandL(TInt aCommand);
-    void CenRepDataChanged(TUid& aUid, TUint32 aKey);
-
-private:
-    // Functions from base classes
-
-    /**
-     * From CAknView Activates view.
-     * @param aPrevViewId Id of previous view.
-     * @param aCustomMessageId Custom message id.
-     * @param aCustomMessage Custom message.
-     * @return None.
-     */
-    void DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId,
-            const TDesC8& aCustomMessage);
-
-    /**
-     * From CAknView Deactivates view.        
-     * @param None.
-     * @return None.
-     */
-    void DoDeactivate();
-
-    /**
-     * From CAknView Dynamically initialises options menu.
-     * @param aResourceId Id identifying the menu pane to initialise.
-     * @param aMenuPane The in-memory representation of the menu pane.
-     * @return None.
-     */
-    void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
-
-public:
-    // New functions
-
-
-private:
-
-    /**
-     * Creates List Box
-     */
-    void CreateSettingListL();
-    THidKeyboardLayoutId CurrentLayoutL() const;
-
-    void SetNavipaneTextL(const TDesC8& aDeviceName);
-
-public:
-    void SetCurrentLayoutL(THidKeyboardLayoutId aLayoutValue);
-
-private:
-    // Data
-    CBTHidSettingContainer* iContainer;
-    CBtHidSettings* iSettings; // Settings handler class
-    CBTKeySettingList* iSettingList; // The settings-list list view
-
-    //CIdle*                          iIdle;              	// Idle time class (for doing operation delayed)
-    TVwsViewId iPrevViewId; // Previous view of GS app.
-    TInt iResourceFileFlag; // Flag for eikon env.
-    CEikonEnv* iEikEnv;
-
-    /*! The Layout Manager Server session */
-    RLayoutManager iLayoutSession;
-
-    /*! The last keyboard layout selected by the user */
-    THidKeyboardLayoutId iLastSelectedLayout;
-    TBool iIsNokiaKeyboard;
-    /**
-     * Needed when creating navipane text
-     * Own this pointer
-     */
-    CAknNavigationDecorator* iNaviDecorator;
-    CAknContextPane* iContextPane;
-    CBtHidCenRepWatcher* iCenRepWatcher;
-
-    };
-
-#endif // BTHIDSETTINGVIEW_H
-// End of File
--- a/bluetoothengine/bthid/bthidkbdsettings/inc/btkeyenumtextsettingitem.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 the setting view for keyboard device.
- *
-*/
-
-
-#ifndef __BTKEYENUMTEXTSETTINGITEM_H__
-#define __BTKEYENUMTEXTSETTINGITEM_H__
-
-#include <aknsettingitemlist.h>
-
-class CBtHidSettings;
-class CBtHidSettingView;
-
-class CBTKeyEnumTextSettingItem : public CAknEnumeratedTextPopupSettingItem
-    {
-public:
-
-    /*!
-     Constructs this object
-     */
-    CBTKeyEnumTextSettingItem(TInt aResourceId, TInt& aValue,
-            CBtHidSettings& aSettings, CBtHidSettingView* aBtHidSettingView);
-
-    /*!
-     Destroy the object and release all memory objects
-     */
-    ~CBTKeyEnumTextSettingItem();
-
-public:
-    // from CAknSettingItem
-    void HandleSettingPageEventL(CAknSettingPage *aSettingPage,
-            TAknSettingPageEvent aEventType);
-
-private:
-    CBtHidSettings& iSettings;
-    CBtHidSettingView* iBtHidSettingView;
-    };
-
-#endif // __BTKEYENUMTEXTSETTINGITEM_H__
--- a/bluetoothengine/bthid/bthidkbdsettings/src/bthidpluginimplementationtable.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*        ECOM proxy table for this plugin
-*
-*/
-
-
-// System includes
-//
-#include <e32std.h>
-#include <ecom/implementationproxy.h>
-
-// User includes
-//
-#include "bthidsettingview.h"
-#include "hiduids.h"
-
-// Constants
-//
-const TImplementationProxy KBtHidPluginImplementationTable[] =
-    {
-        // UPDATE THIS - Uid for plugin implementation:
-
-        //This impl is for BtuiPluginInterface.
-        IMPLEMENTATION_PROXY_ENTRY( KBDSETTINGS_UIPLUGIN_IMP,	CBtHidSettingView::NewBtuiPluginL ),
-    };
-
-
-// ---------------------------------------------------------------------------
-// ImplementationGroupProxy
-// Gate/factory function
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
-    {
-    aTableCount = sizeof(KBtHidPluginImplementationTable)
-                  / sizeof(TImplementationProxy);
-    return KBtHidPluginImplementationTable;
-    }
--- a/bluetoothengine/bthid/bthidkbdsettings/src/bthidsettingcontainer.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 the implementation of setting container class
-*
-*/
-
-
-// INCLUDE FILES
-#include <AknUtils.h>  // for font
-#include <AknsDrawUtils.h>// skin
-#include <AknsBasicBackgroundControlContext.h> //skin
-#include <BthidResource.rsg>
-#include "bthidsettingcontainer.h"
-#ifdef __SERIES60_HELP
-#include <hlplch.h>
-#include <csxhelp/bt.hlp.hrh> // The bt hrh info is needed, for help launching
-#endif
-#include "btui.h"
-#include "debug.h"
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CBTHidSettingContainer::ConstructL(const TRect& aRect)
-// EPOC two phased constructor
-// ---------------------------------------------------------
-//
-void CBTHidSettingContainer::ConstructL(const TRect& aRect)
-    {
-    CreateWindowL(); //makes the control a window-owning control
-    BaseConstructL( aRect );
-    }
-
-// ---------------------------------------------------------
-// CBTHidBaseContainer::BaseConstructL()
-// ---------------------------------------------------------
-//
-void CBTHidSettingContainer::BaseConstructL( const TRect& aRect )
-    {
-    SetRect(aRect);
-    iBackGround = CAknsBasicBackgroundControlContext::NewL( KAknsIIDQsnBgAreaMain, Rect(), EFalse );
-    ActivateL();
-    }
-
-
-// Destructor
-CBTHidSettingContainer::~CBTHidSettingContainer()
-    {
-    delete iBackGround;
-    }
-
-
-// ---------------------------------------------------------------------------
-// CBTHidSettingContainer::SizeChanged
-// called by framwork when the view size is changed
-//
-// ---------------------------------------------------------------------------
-//
-void CBTHidSettingContainer::SizeChanged()
-    {
-    TRACE_INFO( (_L("[BTHID]\t CBTHidBaseContainer::SizeChanged(); Width %d Height %d "),Rect().Height(), Rect().Width()));
-
-    //Handle SizeChanged for Skin
-    TRect parentRect(Rect());
-    if (iBackGround)
-        iBackGround->SetRect(parentRect);
-    }
-
-// ---------------------------------------------------------------------------
-// CBTHidSettingContainer::CountComponentControls
-//
-//
-// ---------------------------------------------------------------------------
-//
-TInt CBTHidSettingContainer::CountComponentControls() const
-    {
-    return 0;
-    }
-
-// ---------------------------------------------------------------------------
-// CBTHidSettingContainer::ComponentControl
-//
-//
-// ---------------------------------------------------------------------------
-//
-CCoeControl* CBTHidSettingContainer::ComponentControl(TInt /*aIndex*/) const
-    {
-    return NULL;
-    }
-
-void CBTHidSettingContainer::HandleControlEventL(CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
-    {
-    // TODO: Add your control event handler code here
-    }
-
-// ---------------------------------------------------------
-// CBTHidBaseContainer::HandleResourceChange
-// ---------------------------------------------------------
-//
-
-void CBTHidSettingContainer::HandleResourceChange( TInt aType )
-    {
-
-    //Handle change in layout orientation
-    if (aType == KEikDynamicLayoutVariantSwitch)
-        {
-
-        //TRect rect = iAvkonAppUi->ClientRect();
-        // The line above provides to big rectangle in the bottom causing cba's overdrawn by by blank area.
-        // Correct way to do this is below.
-        TRect mainPaneRect;
-        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-        SetRect(mainPaneRect);
-        DrawNow();
-        }
-
-    else
-        {
-        CCoeControl::HandleResourceChange(aType);
-        }
-    }
-
-// ---------------------------------------------------------
-// CBTHidBaseContainer::Draw(const TRect& aRect) const
-// ---------------------------------------------------------
-//
-void CBTHidSettingContainer::Draw(const TRect& aRect) const
-    {
-    TRACE_FUNC(_L("[BTHID]\t CBTHidSettingContainer::Draw()"));
-    TRgb color;
-
-    CWindowGc& gc = SystemGc();
-
-    // draw background
-    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
-
-    // get skin text color
-    AknsUtils::GetCachedColor( skin, color , KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6);
-    gc.SetPenColor( color );
-
-    MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
-    AknsDrawUtils::Background( skin, cc, this, gc, aRect );
-    }
-
-// ---------------------------------------------------------
-// CBTHidBaseContainer::MopSupplyObject()
-// Pass skin information if needed.
-// ---------------------------------------------------------
-//
-TTypeUid::Ptr CBTHidSettingContainer::MopSupplyObject(TTypeUid aId)
-    {
-    if(aId.iUid == MAknsControlContext::ETypeId && iBackGround)
-        {
-        return MAknsControlContext::SupplyMopObject( aId, iBackGround);
-        }
-
-    return CCoeControl::MopSupplyObject( aId );
-    }
-
-#ifdef __SERIES60_HELP
-
-// ---------------------------------------------------------
-// From CCoeControl
-// CBTHidSettingContainer::GetHelpContext
-// ---------------------------------------------------------
-//
-void CBTHidSettingContainer::GetHelpContext(TCoeHelpContext& aContext) const
-    {
-    TRACE_FUNC_ENTRY
-
-    aContext.iMajor = KBtuiUid3;
-    aContext.iContext = KBTKEYBOARD_HLP_SETTINGS;
-    }
-
-#else
-
-// ---------------------------------------------------------
-// From CCoeControl
-// CBTHidSettingContainer::GetHelpContext
-// ---------------------------------------------------------
-//
-void CBTHidSettingContainer::GetHelpContext(TCoeHelpContext& /*aContext*/) const
-    {
-    TRACE_FUNC_ENTRY    
-    }
-
-#endif
-// End of File
--- a/bluetoothengine/bthid/bthidkbdsettings/src/bthidsettingview.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,436 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 the implementation of setting view class
-*
-*/
-
-#include <aknViewAppUi.h>
-#include <avkon.hrh>
-#include <eiklabel.h>
-#include <akntitle.h>
-#include <StringLoader.h>
-#include <hlplch.h>                   // Help launcher
-#include <aknradiobuttonsettingpage.h>
-#include <bautils.h>
-#include <BthidResource.rsg>
-#include <csxhelp/bt.hlp.hrh>           // Help IDs
-#include <aknnavide.h>
-#include <akncontext.h>
-#include "bthidsettingview.h"
-#include "bthidsettingcontainer.h"
-#include "bthidsettings.h"
-#include "bthidsettinglist.h"
-#include "btkeyboard.hrh"
-#include <btkeyboard.mbg>
-#include "btengprivatecrkeys.h"
-#include "layoutmgr.h"
-#include "hidlayoutids.h"
-#include "debug.h"
-
-const TUid KBtHidSettingViewId =
-    {
-        0x2001E30B
-    }
-    ; // UID of HID device setting view.
-// ---------------------------------------------------------
-// CBtHidSettingView::NewNewGsPluginL
-// Two phased constructor
-// ---------------------------------------------------------
-//
-CBtHidSettingView* CBtHidSettingView::NewBtuiPluginL()
-    {
-    //TRACE_FUNC(_L("[BTHID]\t CBtHidSettingView::NewBtuiPluginL(), BEGIN"));
-
-    CBtHidSettingView* self = new (ELeave) CBtHidSettingView();
-
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop();
-
-    //TRACE_INFO( (_L("[BTHID]\t CBtHidSettingView[0x%08x]::NewBtuiPluginL, END"),self) );
-
-    return self;
-    }
-
-
-// ----------------------------------------------------
-// CBtHidSettingView::CBtHidSettingView
-// default constructor
-// ----------------------------------------------------
-//
-CBtHidSettingView::CBtHidSettingView()
-    {}
-
-// ----------------------------------------------------
-// CBtHidSettingView::ConstructL
-// ----------------------------------------------------
-//
-void CBtHidSettingView::ConstructL()
-    {
-    TRACE_INFO( (_L("[BTHID]\t CBtHidSettingView[0x%08x]:ConstructL(), BEGIN"),this) );
-
-    User::LeaveIfError(iLayoutSession.Connect());
-
-    // Check to see what type of layout code the layout manager will return
-    // us. (i.e nokia or standard)
-    // This is used to know which settings page to display.
-    TBool ignore;
-    TRACE_INFO(_L("[BTHID]\t CBtHidMainView::ConstructL(), get layout info..."));
-    User::LeaveIfError(iLayoutSession.GetDeviceInfo(iIsNokiaKeyboard, ignore));
-
-    iEikEnv = CEikonEnv::Static();
-    TFileName filename;
-    filename += KFileDrive;
-    filename += KDC_RESOURCE_FILES_DIR;
-    filename += KResourceFileName;
-    BaflUtils::NearestLanguageFile( iEikEnv->FsSession(), filename );
-    iResourceFileFlag=iEikEnv->AddResourceFileL(filename);
-    BaseConstructL( R_BTKEYBOARD_SETTING_VIEW );
-
-    CEikStatusPane *sp = ((CAknAppUi*)iEikonEnv->EikAppUi())->StatusPane();
-    // Fetch pointer to the default title pane control
-    iContextPane = (CAknContextPane *)sp->ControlL(TUid::Uid(EEikStatusPaneUidContext));
-
-    iSettings = CBtHidSettings::NewL();
-
-    TRACE_INFO( (_L("[BTHID]\t CBtHidSettingView[0x%08x]:ConstructL(), END"),this) );
-    }
-// ----------------------------------------------------
-// CBtHidSettingView::~CBtHidSettingView()
-// Destructor
-// Frees reserved resources
-// ----------------------------------------------------
-//
-CBtHidSettingView::~CBtHidSettingView()
-    {
-    TRACE_INFO( (_L("[BTHID]\t CBtHidSettingView[0x%08x]::~CBtHidSettingView()"), this) );
-    iLayoutSession.Close();
-
-    delete iNaviDecorator;
-    iEikEnv->DeleteResourceFile(iResourceFileFlag);
-
-    if ( iSettingList )
-        {
-        AppUi()->RemoveFromStack( (CCoeControl*) iSettingList );
-        delete iSettingList;
-        }
-    if ( iContainer )
-        {
-        AppUi()->RemoveFromStack(iContainer );
-        delete iContainer;
-        }
-    if( iCenRepWatcher )
-        delete iCenRepWatcher;
-
-    if (iSettings )
-        delete iSettings;
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------
-// TUid CBtHidSettingView::Id
-// ---------------------------------------------------------
-//
-TUid CBtHidSettingView::Id() const
-    {
-    TUid id = KBtHidSettingViewId;    //view id
-    return id;
-    }
-
-// ----------------------------------------------------
-// CBtHidSettingView::HandleCommandL(TInt aCommand)
-// takes care of command handling
-// ----------------------------------------------------
-//
-void CBtHidSettingView::HandleCommandL(TInt aCommand)
-    {
-    TRACE_INFO( (_L("[BTHID]\t CBtHidSettingView[0x%08x]::HandleCommandL(%d)"),this, aCommand) );
-    switch ( aCommand )
-        {
-        case EEikCmdExit:           // fall-through, handled similarily
-        case EAknSoftkeyExit:       // fall-through, handled similarily
-        //case EBTKeyCmdExit:
-            {
-            AppUi()->HandleCommandL( EEikCmdExit);
-            }
-        case EAknSoftkeyChange:
-        case EBTKeyCmdAppChange:
-            {
-            if( iSettingList )
-                {
-                iCenRepWatcher->DisableNotifications();
-                iSettingList->EditCurrentItemL( aCommand );
-                iCenRepWatcher->EnableNotifications();
-                }
-            break;
-            }
-        case EAknSoftkeyBack:
-            {
-            AppUi()->ActivateLocalViewL( iPrevViewId.iViewUid );
-            break;
-            }
-
-#ifdef __SERIES60_HELP
-        case EBTKeyCmdAppHelp:
-            {
-            HlpLauncher::LaunchHelpApplicationL(
-                    iEikEnv->WsSession(), AppUi()->AppHelpContextL());
-            break;
-            }
-
-#endif
-        default:
-            {
-            AppUi()->HandleCommandL( aCommand );
-            break;
-            }
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// CBtHidSettingView::DoActivateL()
-// ---------------------------------------------------------------------------
-//
-void CBtHidSettingView::DoActivateL( const TVwsViewId& aPrevViewId,
-                                     TUid aCustomMessageId,
-                                     const TDesC8& aCustomMessage )
-    {
-    TRACE_INFO( (_L("[BTHID]\t CBtHidSettingView[0x%08x]::DoActivateL, BEGIN"),this) );
-    iPrevViewId = aPrevViewId;
-    (void) aCustomMessageId;
-
-    // Setup the title
-    HBufC* title;
-    title = iCoeEnv->AllocReadResourceLC(R_BTKEYBOARD_SETTINGS_STATUS_PANE_TITLE);
-
-    CEikStatusPane* statusPane = StatusPane();
-    CAknTitlePane* titlePane;
-    titlePane = (CAknTitlePane*) statusPane->ControlL(TUid::Uid(EEikStatusPaneUidTitle));
-    titlePane->SetTextL(title->Des());
-    CleanupStack::PopAndDestroy(); // title
-    title = NULL;
-
-    TRACE_INFO( (_L("[BTHID]\t CBtHidSettingView[0x%08x]::DoActivateL(), Creating container..."),this) );
-    iContainer = new (ELeave) CBTHidSettingContainer;
-    iContainer->SetMopParent(this);
-    iContainer->ConstructL( ClientRect());
-    iContainer->MakeVisible( ETrue );
-    iContainer->ActivateL();
-    AppUi()->AddToStackL(iContainer);
-
-    CreateSettingListL();
-    iCenRepWatcher = CBtHidCenRepWatcher::NewL( KCRUidBTEngPrivateSettings, *this ); // create listener for cenrep events.
-    SetNavipaneTextL(aCustomMessage);
-
-    TRACE_INFO((_L("[BTHID]\t CBtHidSettingView[0x%08x]::DoActivateL, END"),this) );
-    }
-
-
-// ---------------------------------------------------------------------------
-// CBtHidSettingView::DoDeactivate
-//
-// Deactivate the settings view.
-// ---------------------------------------------------------------------------
-//
-void CBtHidSettingView::DoDeactivate()
-    {
-    TRACE_INFO( (_L("[BTHID]\t CBtHidSettingView[0x%08x]::DoDeactivate, BEGIN"),this) );
-    if ( iSettingList )
-        {
-        AppUi()->RemoveFromStack( (CCoeControl*) iSettingList );
-        delete iSettingList;
-        iSettingList = NULL;
-        }
-    if( iContainer )
-        {
-        iContainer->MakeVisible(EFalse);
-        AppUi()->RemoveFromStack( iContainer );
-        delete iContainer;
-        iContainer = NULL;
-        }
-
-    if (iNaviDecorator)
-        {
-        delete iNaviDecorator;
-        iNaviDecorator = NULL;
-        }
-    iLastSelectedLayout = iSettings->LoadLayoutSetting();
-    iLayoutSession.SetLayout(iLastSelectedLayout);
-    delete iCenRepWatcher;
-    iCenRepWatcher = NULL;
-    TRACE_FUNC_EXIT
-    }
-
-// ----------------------------------------------------
-// CBtHidSettingView::DynInitMenuPaneL
-// ----------------------------------------------------
-//
-void CBtHidSettingView::DynInitMenuPaneL(
-    TInt aResourceId, CEikMenuPane* aMenuPane)
-    {
-    if (aResourceId == R_BTKEYBOARD_SETTING_MENU )
-        {
-        aMenuPane->SetItemDimmed(EBTKeyCmdAppChange, ETrue); 
-        }
-    
-    
-    }
-
-// ----------------------------------------------------
-// CBtHidSettingView::CreateSettingListL
-// ----------------------------------------------------
-//
-void CBtHidSettingView::CreateSettingListL()
-    {
-    TRACE_INFO( (_L("[BTHID]\t CBtHidSettingView[0x%08x]::CreateSettingListL, BEGIN"),this) );
-
-    TInt resourceId = R_BTKEYBOARD_STANDARD_SETTING_LIST;
-
-    TBool foundLayout;
-    User::LeaveIfError(iLayoutSession.GetDeviceInfo(iIsNokiaKeyboard, foundLayout));
-
-    if(iIsNokiaKeyboard)
-        {
-        resourceId = R_BTKEYBOARD_NOKIA_SETTING_LIST;
-        }
-    else
-        {
-        resourceId = R_BTKEYBOARD_STANDARD_SETTING_LIST;
-        }
-
-    TInt layoutCode;
-    if ( !foundLayout )
-        {
-        //No layout found, find an appropriate one.
-        layoutCode = CurrentLayoutL();
-        SetCurrentLayoutL(static_cast<THidKeyboardLayoutId>(layoutCode));
-        }
-    else
-        {
-        //Layout found, load it as default
-        iLayoutSession.GetLayout(layoutCode);
-        SetCurrentLayoutL(static_cast<THidKeyboardLayoutId>(layoutCode));
-        }
-
-    if ( iSettingList )
-        {
-        AppUi()->RemoveFromStack( (CCoeControl*) iSettingList );
-        }
-    delete iSettingList;
-    iSettingList = NULL;
-
-    iSettingList = new (ELeave) CBTKeySettingList( *iSettings, this);
-    iSettingList->SetMopParent(this);
-    iSettingList->ConstructFromResourceL(resourceId);
-    AppUi()->AddToStackL( (CCoeControl*) iSettingList );
-    iSettingList->MakeVisible(ETrue);
-    iSettingList->SetRect(ClientRect());
-    iSettingList->ActivateL();
-    iSettingList->DrawNow();
-    TRACE_INFO( (_L("[BTHID]\t CBtHidSettingView[0x%08x]::CreateSettingListL, END"),this) );
-    }
-
-// ----------------------------------------------------
-// CBtHidSettingView::SetCurrentLayoutL
-// ----------------------------------------------------
-//
-void CBtHidSettingView::SetCurrentLayoutL(THidKeyboardLayoutId aLayoutValue)
-    {
-    // Ask the layout manager to change layout.
-    // Use the leaving version so we the user can't confirm a selection
-    // if an error occurs.
-    iLayoutSession.SetLayoutL(aLayoutValue);
-
-    iSettings->SaveLayoutSettingL( aLayoutValue );
-    }
-
-THidKeyboardLayoutId CBtHidSettingView::CurrentLayoutL() const
-    {
-    // Ask the layout manager for the current layout.
-    // Use the leaving version.
-    TInt layoutCode = iLayoutSession.GetLayoutL();
-
-    // Convert the Int to the enum.
-    THidKeyboardLayoutId layoutID =
-        static_cast<THidKeyboardLayoutId>(layoutCode);
-
-    // If we believe this to be a Nokia keyboard then the layout settings
-    // page will contain the list of Nokia Su8 items.
-    // Conversly if we think this is a Standard keyboard the layout settings
-    // page will contain the list of Standard layouts.
-    // We must pass a valid value to the Settings page or it will panic.
-    // Validate the code from the Layout Manager before returning it.
-    if ( iIsNokiaKeyboard )
-        {
-        CLayoutUtils::ValidateNokiaSU8Layout(layoutID);
-        }
-    else
-        {
-        CLayoutUtils::ValidateStandardLayout(layoutID);
-        }
-
-    return layoutID;
-    }
-
-void CBtHidSettingView::SetNavipaneTextL(const TDesC8& aDeviceName)
-    {
-    TRACE_INFO(_L("[BTHID]\t CBtHidSettingView::SetNavipaneTextL Start"));
-    CEikStatusPane* sp =
-        iEikonEnv->AppUiFactory()->StatusPane();
-
-    CAknNavigationControlContainer* np =
-        static_cast<CAknNavigationControlContainer*>(
-            sp->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) );
-
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-
-    TInt blank(1);
-    if (aDeviceName.Length()>0 )
-        {
-        HBufC* stringHolder = HBufC::NewLC(aDeviceName.Length() + blank);
-        stringHolder->Des().Copy(aDeviceName);
-        stringHolder->Des().Append(_L(" "));
-        iNaviDecorator = np->CreateNavigationLabelL( *stringHolder );
-        np->PushL( *iNaviDecorator );
-        sp->DrawNow();
-        CleanupStack::PopAndDestroy(stringHolder);  // stringHolder
-        }
-    else
-        {
-        HBufC* temp = HBufC::NewLC(aDeviceName.Length());
-        temp->Des().Copy(aDeviceName);
-        iNaviDecorator = np->CreateNavigationLabelL( *temp );
-        np->PushL( *iNaviDecorator );
-        sp->DrawNow();
-        CleanupStack::PopAndDestroy(temp);  // temp
-        }
-    TRACE_INFO(_L("[BTHID]\t CBtHidSettingView::SetNavipaneTextL End"));
-    }
-// ----------------------------------------------------
-// CBtHidSettingView::CenRepDataChanged
-// ----------------------------------------------------
-//
-void CBtHidSettingView::CenRepDataChanged(TUid& aUid, TUint32 aKey)
-    {
-    // just recreate the setting list
-    TRACE_INFO((_L("[BTHID]\t CBtHidSettingView[0x%08x]::CenRepDataChanged"),this));
-    (void) aUid;
-    if ( aKey == KBtHidKeyboardLayout )
-        {
-        TRAPD( err, CreateSettingListL());
-        err = err;
-        }
-    }
-// End of File
--- a/bluetoothengine/bthid/bthidkbdsettings/src/btkeyenumtextsettingitem.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
-* 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:  
-*
-*/
-
-
-#include "btkeyenumtextsettingitem.h"
-#include "btkeyboard.hrh"
-#include "bthidsettingview.h"
-#include "bthidsettings.h"
-#include "debug.h"
-
-//-----------------------------------------------------------------------------
-// CBTKeyEnumTextSettingItem::CBTKeyEnumTextSettingItem
-//-----------------------------------------------------------------------------
-//
-CBTKeyEnumTextSettingItem::CBTKeyEnumTextSettingItem(
-    TInt aResourceId, TInt& aValue, CBtHidSettings& aSettings, CBtHidSettingView* aBtHidSettingView) :
-        CAknEnumeratedTextPopupSettingItem ( aResourceId, aValue ),
-        iSettings(aSettings),
-        iBtHidSettingView(aBtHidSettingView)
-    {}
-
-
-//-----------------------------------------------------------------------------
-// CBTKeyEnumTextSettingItem::~CBTKeyEnumTextSettingItem
-//-----------------------------------------------------------------------------
-//
-CBTKeyEnumTextSettingItem::~CBTKeyEnumTextSettingItem()
-    {}
-
-//-----------------------------------------------------------------------------
-// CBTKeyEnumTextSettingItem::HandleSettingPageEventL
-//-----------------------------------------------------------------------------
-//
-void CBTKeyEnumTextSettingItem::HandleSettingPageEventL(
-    CAknSettingPage *aSettingPage, TAknSettingPageEvent aEventType)
-    {
-    switch( aEventType )
-        {
-        case EEventSettingOked:
-            {
-            TRACE_INFO(_L("[BTHID]\t CBTKeyEnumTextSettingItem::HandleSettingPageEventL: OK"));
-            // Get the new index and new value
-            TInt newIndex = QueryValue()->CurrentValueIndex();
-            TInt newValue = EnumeratedTextArray()->At(newIndex)->EnumerationValue();
-
-            // Reset the index to the initial value, so if we leave when
-            // trying to use the new value and the user then selects cancel
-            // the setting item won't set the new value on the display.
-            QueryValue()->SetCurrentValueIndex(IndexFromValue(InternalValue()));
-
-            switch ( Identifier() )
-                {
-                case EBTKeySettingLayout:
-                    {
-                    THidKeyboardLayoutId newLayout =
-                        static_cast<THidKeyboardLayoutId>(newValue);
-                    iSettings.SaveLayoutSettingL(newLayout);
-                    iBtHidSettingView->SetCurrentLayoutL(newLayout);
-                    }
-                break;
-
-                default:
-                break;
-                }
-
-            // We have finished using the new value. Set the index to the new
-            // value so the UI is updated when this function exits
-            QueryValue()->SetCurrentValueIndex(newIndex);
-
-            // store the setting page internal value to the external variable
-            StoreL();
-            break;
-            }
-        case EEventSettingCancelled:
-            {
-            TRACE_INFO(_L("[BTHID]\t CBTKeyEnumTextSettingItem::HandleSettingPageEventL: Cancel"));
-            // Reset the index to the initial value
-            QueryValue()->SetCurrentValueIndex(IndexFromValue(InternalValue()));
-            break;
-            }
-        case EEventSettingChanged:
-            {
-            TRACE_INFO(_L("[BTHID]\t CBTKeyEnumTextSettingItem::HandleSettingPageEventL: Changed"));
-            // Flow through
-            }
-        default:
-            {
-            //do nothing
-            break;
-            }
-        }
-    // call the base class handler to take care of other event types
-    CAknSettingItem::HandleSettingPageEventL(aSettingPage, aEventType);
-    }
-
-
--- a/bluetoothengine/bthid/bthidkbdsettings/src/btkeysettinglist.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/*
-* 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:  
-*
-*/
-
-
-#include "bthidsettingview.h"
-#include "bthidsettings.h"
-#include "bthidsettinglist.h"
-#include "btkeyenumtextsettingitem.h"
-#include "btkeyboard.hrh"
-
-//-----------------------------------------------------------------------------
-// CBTKeySettingList::CBTKeySettingList
-//-----------------------------------------------------------------------------
-//
-CBTKeySettingList::CBTKeySettingList(CBtHidSettings& aSettings, CBtHidSettingView* aBtHidSettingView):
-    CAknSettingItemList(), iSettings(aSettings), iBtHidSettingView(aBtHidSettingView)
-    {
-    }
-
-//-----------------------------------------------------------------------------
-// CBTKeySettingList::CreateSettingItemL
-//-----------------------------------------------------------------------------
-//
-CAknSettingItem* CBTKeySettingList::CreateSettingItemL( TInt aIdentifier )
-    {
-    CAknSettingItem* settingItem = 0;
-    switch ( aIdentifier )
-        {
-        case EBTKeySettingLayout:
-            iLayoutCode = iSettings.LoadLayoutSetting();
-            settingItem = new (ELeave) CBTKeyEnumTextSettingItem(
-                                            aIdentifier, iLayoutCode, iSettings, iBtHidSettingView);
-            break;      
-        default:
-            break;
-        }
-
-    return settingItem;
-    }
-
-//-----------------------------------------------------------------------------
-// CBTKeySettingList::HandleListBoxEventL
-//-----------------------------------------------------------------------------
-//
-void CBTKeySettingList::HandleListBoxEventL(
-            CEikListBox* aListBox, TListBoxEvent aEventType)
-    {
-        // call the base classes handler to handle this event.
-    CAknSettingItemList::HandleListBoxEventL(aListBox, aEventType);
-    
-    // store the values from all setting items to their external variables
-    StoreSettingsL();
-    }
-
-//-----------------------------------------------------------------------------
-// CBTKeySettingList::SizeChanged
-//-----------------------------------------------------------------------------
-//
-void CBTKeySettingList::SizeChanged()
-    {
-    if ( ListBox() ) 
-        {
-        ListBox()->SetRect(Rect());
-        }
-    }
-
-//-----------------------------------------------------------------------------
-// CBTKeySettingList::EditCurrentItemL
-//-----------------------------------------------------------------------------
-//
-void CBTKeySettingList::EditCurrentItemL( TInt aCommand )
-    {
-    if ( ListBox() )
-        {
-        TInt index = ListBox()->CurrentItemIndex();
-        EditItemL(index, EBTKeyCmdAppChange == aCommand);
-        StoreSettingsL();        
-        }
-    }    
-//End of file   
--- a/bluetoothengine/bthid/rom/btkeyboard.iby	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bthid/rom/btkeyboard.iby	Fri May 14 16:01:46 2010 +0300
@@ -38,7 +38,6 @@
 ECOM_PLUGIN(hidkeyboard.dll, hidkeyboard.rsc)
 ECOM_PLUGIN(hidmouse.dll, hidmouse.rsc)
 ECOM_PLUGIN(kbdlayout.dll, kbdlayout.rsc)
-ECOM_PLUGIN(bthidkbdsettings.dll, bthidkbdsettings.rsc)
 ECOM_PLUGIN(bthidengplugin.dll, bthidengplugin.rsc)
 
 data=DATAZ_\APP_BITMAP_DIR\BTMouseBitMaps.mbm     APP_BITMAP_DIR\BTMouseBitMaps.mbm
--- a/bluetoothengine/bthid/rom/btkeyboard_resources.iby	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/bthid/rom/btkeyboard_resources.iby	Fri May 14 16:01:46 2010 +0300
@@ -20,7 +20,6 @@
 #ifndef BTKEYBOARD_RESOURCES_IBY
 #define BTKEYBOARD_RESOURCES_IBY
 
-data=DATAZ_\RESOURCE_FILES_DIR\BthidResource.rsc	RESOURCE_FILES_DIR\BthidResource.rsc
 data=DATAZ_\APP_RESOURCE_DIR\PaintCursor.rsc	    APP_RESOURCE_DIR\PaintCursor.rsc
 #endif //BTKEYBOARD_RESOURCES_IBY
 
--- a/bluetoothengine/btmac/group/BTMonoCmdHandler.mmp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/btmac/group/BTMonoCmdHandler.mmp	Fri May 14 16:01:46 2010 +0300
@@ -69,6 +69,7 @@
 LIBRARY	customapi.lib
 LIBRARY bluetooth.lib
 LIBRARY atextclient.lib
+LIBRARY charconv.lib
 
 LIBRARY mmfdevsound.lib 
 LIBRARY telephonyservice.lib
--- a/bluetoothengine/btmac/inc/atcodec/ATCodecDefs.h	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/btmac/inc/atcodec/ATCodecDefs.h	Fri May 14 16:01:46 2010 +0300
@@ -141,14 +141,14 @@
     {EATCIEV,   EATUnsolicitedResult, 2, KIntList2},
     {EATCREG, EATReadResult,          2, KIntList2},
     {EATCREG, EATUnsolicitedResult,   2, KIntList1},
-    {EATCGSN, EATReadResult,          1, KStrList1},
-    {EATCSQ, EATReadResult,						2, KIntList2},
-    {EATCIMI, EATReadResult,					1, KStrList1},
-    {EATCGMI, EATReadResult,					1, KStrList1},
-    {EATCGMM, EATReadResult,					1, KStrList1},
-    {EATCGMR, EATReadResult,					1, KStrList1},
-    {EATCOLP, EATReadResult,					1, KIntList1},
-    {EATCOLP, EATUnsolicitedResult,		2, KDQStrIntList2},    
+    {EATCGSN, EATActionResult,        1, KStrList1},
+    {EATCSQ,  EATActionResult,	      2, KIntList2},
+    {EATCIMI, EATActionResult,        1, KStrList1},
+    {EATCGMI, EATActionResult,        1, KStrList1},
+    {EATCGMM, EATActionResult,        1, KStrList1},
+    {EATCGMR, EATActionResult,        1, KStrList1},
+    {EATCOLP, EATReadResult,          1, KIntList1},
+    {EATCOLP, EATUnsolicitedResult,   2, KDQStrIntList2},    
     };
 
 const TInt KResultCodeParamTableSize = (sizeof(KResultCodeParamTable) / sizeof(SResultCodeParamDef));
--- a/bluetoothengine/btmac/src/BTMonoCmdHandler/btmcprotocol.cpp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/btmac/src/BTMonoCmdHandler/btmcprotocol.cpp	Fri May 14 16:01:46 2010 +0300
@@ -290,7 +290,7 @@
        		{
        		TBuf8<RMobilePhone::KIMSISize> buf;
        		buf.Copy(iId);
-            CATResult* cimi = CATResult::NewLC(EATCIMI, EATReadResult, TATParam(buf));
+            CATResult* cimi = CATResult::NewLC(EATCIMI, EATActionResult, TATParam(buf));
             SendResponseL(*cimi);
 	        CleanupStack::PopAndDestroy(cimi);
 	        CATResult* ok = CATResult::NewLC(EATOK);
@@ -789,56 +789,7 @@
                     break;  
                 };
             break;  
-            }
-        case EATCSQ:
-            {
-            TRACE_INFO(_L("Requesting Signal strength"));
-            LEAVE_IF_ERROR(params.Append(TATParam(iPhoneStatus->GetRssiStrength())))
-            LEAVE_IF_ERROR(params.Append(TATParam(KBerUnknown)))
-            code = CATResult::NewL(EATCSQ, EATReadResult, &params);
-            TRACE_INFO(_L("done"));
-            break;
-            }
-
-        case EATCGSN:
-            {
-            TBuf8<RMobilePhone::KPhoneSerialNumberSize> buf;
-            buf.Copy(iIdentity.iSerialNumber);
-            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
-            code = CATResult::NewL(EATCGSN, EATReadResult, &params);
-            break;
-            }
-        case EATCGMI:
-            {
-            TBuf8<RMobilePhone::KPhoneManufacturerIdSize> buf;
-            buf.Copy(iIdentity.iManufacturer);
-            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
-            code = CATResult::NewL(EATCGMI, EATReadResult, &params);
-            break;
-            }
-        case EATCGMM:
-            {
-            TBuf8<RMobilePhone::KPhoneModelIdSize> buf;
-            buf.Copy(iIdentity.iModel);
-            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
-            code = CATResult::NewL(EATCGMM, EATReadResult, &params);
-            break;      
-            }
-        case EATCGMR:
-            {
-            TBuf8<RMobilePhone::KPhoneRevisionIdSize> buf;
-            buf.Copy(iIdentity.iRevision);
-            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
-            code = CATResult::NewL(EATCGMR, EATReadResult, &params);
-            break;      
-            }
-        case EATCIMI:
-            {
-            iEtelQuery->SetServiceId(KQueryIMSI);
-            iPhone.GetSubscriberId(iEtelQuery->iStatus, iId);
-            iEtelQuery->GoActive();
-            break;
-            }
+            }        
         case EATCOLP:
             {
             LEAVE_IF_ERROR(params.Append(TATParam(TInt(iProtocolStatus->iOutgoingCallNotif))))
@@ -1040,7 +991,11 @@
 void CBtmcProtocol::HandleActionCommandL(const CATCommand& aCmd)
     {
     TRACE_FUNC
-    
+    RATResultPtrArray resarr;
+    ATObjArrayCleanupResetAndDestroyPushL(resarr);    
+    CATResult* code = NULL;
+    RATParamArray params;
+    CleanupClosePushL(params);
     switch (aCmd.Id())
         {
         case EATCNUM:
@@ -1054,33 +1009,71 @@
             iCallStatus->HandleClccL();
             break;
             }
+        case EATCSQ:
+            {
+            TRACE_INFO(_L("Requesting Signal strength"));
+            LEAVE_IF_ERROR(params.Append(TATParam(iPhoneStatus->GetRssiStrength())))
+            LEAVE_IF_ERROR(params.Append(TATParam(KBerUnknown)))
+            code = CATResult::NewL(EATCSQ, EATActionResult, &params);
+            TRACE_INFO(_L("done"));
+            break;
+            }
+        case EATCGMI:
+            {
+            TBuf8<RMobilePhone::KPhoneManufacturerIdSize> buf;
+            buf.Copy(iIdentity.iManufacturer);
+            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
+            code = CATResult::NewL(EATCGMI, EATActionResult, &params);
+            break;
+            }
+        case EATCGMM:
+            {
+            TBuf8<RMobilePhone::KPhoneModelIdSize> buf;
+            buf.Copy(iIdentity.iModel);
+            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
+            code = CATResult::NewL(EATCGMM, EATActionResult, &params);
+            break;      
+            }
+        case EATCGMR:
+            {
+            TBuf8<RMobilePhone::KPhoneRevisionIdSize> buf;
+            buf.Copy(iIdentity.iRevision);
+            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
+            code = CATResult::NewL(EATCGMR, EATActionResult, &params);
+            break;      
+            }
+        case EATCIMI:
+            {
+            iEtelQuery->SetServiceId(KQueryIMSI);
+            iPhone.GetSubscriberId(iEtelQuery->iStatus, iId);
+            iEtelQuery->GoActive();
+            break;
+            }
         case EATCGSN:
             {
-            CATResult* code = NULL;
-            RATResultPtrArray resarr;
-            ATObjArrayCleanupResetAndDestroyPushL(resarr);              
-            RATParamArray params;
-            CleanupClosePushL(params);
             TBuf8<RMobilePhone::KPhoneSerialNumberSize> buf;
             buf.Copy(iIdentity.iSerialNumber);
             LEAVE_IF_ERROR(params.Append(TATParam(buf)))
             code = CATResult::NewL(EATCGSN, EATActionResult, &params);
-            CleanupStack::PopAndDestroy(&params);
-            CleanupStack::PushL(code);
-            resarr.AppendL(code);
-            CleanupStack::Pop(code);
-            CATResult* ok = CATResult::NewL(EATOK);
-            CleanupStack::PushL(ok);
-            resarr.AppendL(ok);
-            CleanupStack::Pop(ok);
-            SendResponseL(resarr);
-            CleanupStack::PopAndDestroy(&resarr);
-            CmdHandlingCompletedL();
             break;
             }
         default:
             LEAVE(KErrNotSupported);
+        }    
+    CleanupStack::PopAndDestroy(&params);
+    if (code)
+        {
+        CleanupStack::PushL(code);
+        resarr.AppendL(code);
+        CleanupStack::Pop(code);
+        CATResult* ok = CATResult::NewL(EATOK);
+        CleanupStack::PushL(ok);
+        resarr.AppendL(ok);
+        CleanupStack::Pop(ok);
+        SendResponseL(resarr);
+        CmdHandlingCompletedL();
         }
+    CleanupStack::PopAndDestroy(&resarr);
     }
 
 void CBtmcProtocol::DoSendProtocolDataL()
--- a/bluetoothengine/btnotif/bmarm/Btnotifu.def	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	NotifierArray__Fv @ 1 NONAME R3UNUSED ; NotifierArray(void)
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/btdevicedialogplugin.pro	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,64 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  Global confirmation query notification plugin
+#
+
+TEMPLATE = lib
+TARGET = btdevicedialogplugin
+CONFIG += hb plugin
+INCLUDEPATH += . ../inc
+DEPENDPATH += .
+DESTDIR = $${HB_BUILD_DIR}/plugins/devicedialogs
+
+MOC_DIR = moc
+OBJECTS_DIR = obj
+
+# dependencies
+HEADERS += inc/btdevicedialoginputwidget.h \
+    inc/btdevicedialogquerywidget.h \
+    inc/btdevicedialognotifwidget.h \
+    inc/btdevicedialogpluginerrors.h \
+    inc/btdevicedialogplugin.h \
+    inc/btdevicesearchdialogwidget.h \
+    inc/btdevicedialogplugintrace.h
+    
+SOURCES += src/btdevicedialogplugin.cpp \
+    src/btdevicedialoginputwidget.cpp \
+    src/btdevicedialogquerywidget.cpp \
+    src/btdevicedialognotifwidget.cpp \
+    src/btdevicesearchdialogwidget.cpp 
+
+RESOURCES += btdevicedialogplugin.qrc
+    
+symbian: { 
+    SYMBIAN_PLATFORMS = WINSCW ARMV5
+    TARGET.EPOCALLOWDLLDATA = 1
+    TARGET.CAPABILITY = CAP_GENERAL_DLL
+    TARGET.UID3 = 0x2002E6DF
+    hblib.sources = Hb.dll
+    hblib.path = \sys\bin
+    hblib.depends = "(0xEEF9EA38), 1, 0, 0, {\"Hb\"}"
+    pluginstub.sources = btdevicedialogplugin.dll
+    pluginstub.path = /resource/plugins/devicedialogs
+    DEPLOYMENT += pluginstub
+}
+!local { 
+    target.path = $${HB_PLUGINS_DIR}/devicedialogs
+    INSTALLS += target
+}
+
+BLD_INF_RULES.prj_exports += \
+  "$${LITERAL_HASH}include <platform_paths.hrh>" \
+  	"rom/btdevicedialogplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(btdevicedialogplugin.iby)" \
+    "qmakepluginstubs/btdevicedialogplugin.qtplugin /epoc32/data/z/pluginstub/btdevicedialogplugin.qtplugin"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/btdevicedialogplugin.qrc	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,6 @@
+<RCC>
+    <qresource prefix="/">
+        <file>docml/bt-device-search-dialog.docml</file>
+        <file>icons/qgn_prop_sml_bt.svg</file>
+    </qresource>
+</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/docml/bt-device-search-dialog.docml	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.8">
+
+    <widget name="dialog" type="HbDialog">
+        <widget name="heading" role="HbDialog:headingWidget" type="HbLabel">
+            <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+        </widget>
+        <widget name="container" role="HbDialog:contentWidget" type="HbWidget">
+            <widget name="listView" type="HbListView">
+                <widget name="listItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem">
+                    <string name="state" value="normal"/>
+                </widget>
+                <sizehint height="47.7612un" type="PREFERRED" width="35.8209un"/>
+                <enums name="verticalScrollBarPolicy" value="ScrollBarAsNeeded"/>
+            </widget>
+            <widget name="container_1" type="HbWidget">
+                <widget name="viewBy" type="HbPushButton">
+                    <string name="text" value="View by"/>
+                </widget>
+                <widget name="stop" type="HbPushButton">
+                    <string name="text" value="Stop"/>
+                </widget>
+                <widget name="retry" type="HbPushButton">
+                    <string name="text" value="Retry"/>
+                </widget>
+                <real name="z" value="0"/>
+                <sizehint height="10un" type="PREFERRED" width="27un"/>
+                <layout spacing="0.5un" type="grid">
+                    <griditem column="0" itemname="viewBy" row="0"/>
+                    <griditem column="1" itemname="stop" row="0"/>
+                    <griditem column="2" itemname="retry" row="0"/>
+                </layout>
+            </widget>
+            <layout type="grid">
+                <griditem column="0" itemname="listView" row="0"/>
+                <griditem column="0" itemname="container_1" row="1"/>
+            </layout>
+        </widget>
+    </widget>
+    <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+        <dummydata objectName="listView" section="#common" value="0"/>
+    </metadata>
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/icons/qgn_prop_sml_bt.svg	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg width="84" height="58" viewBox="0.346 2.404 84 58">
+<linearGradient id="_11" gradientUnits="userSpaceOnUse" x1="35.53" y1="8.58" x2="15.86" y2="37.39">
+<stop stop-color="#A2C2DD" offset="0.1"/>
+<stop stop-color="#6C83BB" offset="0.71"/>
+<stop stop-color="#003D6D" offset="0.99"/>
+</linearGradient>
+<path fill="url(#_11)" d="M28.073,11.521c-8.63,3.226-17.035,9.366-17.035,15.963c0.214,4.914,3.531,10.465,8.251,12.718 l-0.479-3.623c0,0-0.724-0.627-0.81-0.883c-0.188-0.759-0.284-1.486-0.284-2.174c0-5.745,6.096-9.069,11.15-11.158 c0.009,0.183,0.051,0.972,0.051,0.972l17.664-11.233L27.767,6.535C27.767,6.535,28.046,11.074,28.073,11.521z"/>
+<linearGradient id="_12" gradientUnits="userSpaceOnUse" x1="26.18" y1="29.3" x2="18.46" y2="24.18">
+<stop stop-color="#E6EEF4" offset="0"/>
+<stop stop-color="#4A9900" offset="0.44"/>
+<stop stop-color="#0E4E58" offset="0.94"/>
+</linearGradient>
+<path fill="url(#_12)" d="M18.157,37.349c-3.745-9.36,6.649-13.8,12.099-15.924c-0.684-1.658-0.453-1.881-1.138-3.54 C16.947,22.626,12.446,29.557,18.157,37.349"/>
+<path fill="#17594C" d="M18.486,36.793c-4.707-2.647-7.327-6.673-7.02-9.781c-0.262,4.508,3.185,10.516,7.391,12.587L18.486,36.793z "/>
+<linearGradient id="_13" gradientUnits="userSpaceOnUse" x1="22.02" y1="1.34" x2="28.89" y2="21.43">
+<stop stop-color="#DCE8E4" offset="0"/>
+<stop stop-color="#43910A" offset="1"/>
+</linearGradient>
+<path fill="url(#_13)" d="M18.486,36.793C3.938,28.536,13.99,17.055,28.438,11.75l-0.291-4.737l17.599,5.209L29.237,22.72 l-0.243-4.601C17.948,22.426,11.835,29.852,18.486,36.793z"/>
+<linearGradient id="_14" gradientUnits="userSpaceOnUse" x1="44.66" y1="11.55" x2="57.38" y2="37.94">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#A2C2DD" offset="0.35"/>
+<stop stop-color="#6C83BB" offset="0.7"/>
+<stop stop-color="#003D6D" offset="1"/>
+</linearGradient>
+<path fill="url(#_14)" d="M34.267,13.541l4.54-2.407c-0.029,0.018,5.495-2.224,10.221-0.995 c4.566,1.189,7.303,3.673,9.93,7.732c2.629,4.055,3.246,11.162,1.51,14.948c-1.74,3.786-3.346,5.118-4.619,6.318L34.267,13.541z"/>
+<radialGradient id="_15" gradientUnits="userSpaceOnUse" cx="34.06" cy="16.69" r="22.73">
+<stop stop-color="#FFFFFF" offset="0.05"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</radialGradient>
+<path fill="url(#_15)" d="M57.314,29.195c0.453,9.102-6.096,16.178-14.625,15.811c-8.535-0.366-15.818-8.057-16.269-17.161 c-0.453-9.101,6.097-16.182,14.628-15.815C49.582,12.405,56.863,20.094,57.314,29.195z"/>
+<linearGradient id="_16" gradientUnits="userSpaceOnUse" x1="55.94" y1="38.63" x2="63.33" y2="53.19">
+<stop stop-color="#A2C2DD" offset="0.1"/>
+<stop stop-color="#6C83BB" offset="0.71"/>
+<stop stop-color="#003D6D" offset="0.99"/>
+</linearGradient>
+<path fill="url(#_16)" d="M61.177,17.654c-0.096,0.239,0.225,0.462,0.225,0.462c4.405,2.811,7.194,6.907,6.558,10.752 c-0.598,4.594-5.178,8.876-11.973,11.272c-0.04-0.772-0.247-4.722-0.247-4.722l-17.22,11.052l0.428,3.709l18.586,5.84l-0.076-3.953 c0,0-0.034-0.178-0.067-0.352c2.115-0.857,16.265-7.052,16.265-19.208c0-6.525-2.87-11.621-11.938-15.011 C61.717,17.496,61.305,17.334,61.177,17.654z M73.385,29.575l-0.004-0.033C73.382,29.546,73.385,29.568,73.385,29.575z"/>
+<linearGradient id="_17" gradientUnits="userSpaceOnUse" x1="69.57" y1="42.52" x2="59.03" y2="35.34">
+<stop stop-color="#E6EEF4" offset="0"/>
+<stop stop-color="#2F8E9A" offset="0.44"/>
+<stop stop-color="#003D6D" offset="0.94"/>
+</linearGradient>
+<path fill="url(#_17)" d="M72.268,26.715c0,0-16.184,20.426-16.186,20.426c0.002,0,0.82,4.387,0.82,4.387 C57.377,51.393,78.113,43.305,72.268,26.715z"/>
+<linearGradient id="_18" gradientUnits="userSpaceOnUse" x1="37.66" y1="46.77" x2="64.66" y2="57.61">
+<stop stop-color="#E6EEF4" offset="0"/>
+<stop stop-color="#2F8E9A" offset="0.44"/>
+<stop stop-color="#003D6D" offset="0.94"/>
+</linearGradient>
+<polygon fill="url(#_18)" points="57.107,52.074 57.174,55.54 39.269,49.915 38.892,46.647 "/>
+<linearGradient id="_19" gradientUnits="userSpaceOnUse" x1="48.25" y1="18.94" x2="71.38" y2="74.51">
+<stop stop-color="#E6EEF4" offset="0"/>
+<stop stop-color="#2F8E9A" offset="0.44"/>
+<stop stop-color="#003D6D" offset="0.94"/>
+</linearGradient>
+<path fill="url(#_19)" d="M61.594,17.824c20.027,7.488,11.043,25.286-5.373,29.831l0.887,4.419l-18.216-5.427l16.53-10.608 l0.24,4.602C68.314,36.398,73.684,25.779,61.594,17.824z"/>
+<linearGradient id="_20" gradientUnits="userSpaceOnUse" x1="32.78" y1="17.21" x2="51.02" y2="38.71">
+<stop stop-color="#E6EEF4" offset="0"/>
+<stop stop-color="#4A9900" offset="0.44"/>
+<stop stop-color="#0E4E58" offset="0.94"/>
+</linearGradient>
+<path fill="url(#_20)" d="M51.607,23.322l-11.484-9.805l-0.003,2.292c0,0-0.011,6.183-0.016,9.391l-5.984-5.037l-1.376,1.735 c0,0,2.93,2.427,6.589,5.549c-3.659,2.103-7.395,4.359-7.395,4.359l1.377,2.122l6.789-4.013c0.006,3.718,0.019,11.683,0.019,11.683 l11.484-6.576l-8.197-7.001L51.607,23.322z M42.482,18.439c1.766,1.508,3.668,3.132,5.047,4.31 c-0.754,0.432-2.664,1.526-5.058,2.899C42.476,23.42,42.48,20.708,42.482,18.439z M42.482,37.342 c-0.002-2.271-0.006-4.983-0.01-7.209c2.396,2.043,4.305,3.672,5.057,4.316C46.15,35.243,44.247,36.328,42.482,37.342z"/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialoginputwidget.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  BtDeviceDialogWidget class declaration.
+*
+*/
+
+
+#ifndef BTDEVICEDIALOGINPUTWIDGET_H
+#define BTDEVICEDIALOGINPUTWIDGET_H
+
+#include <QVariantMap>
+
+#include <hbdevicedialoginterface.h>
+#include <hbdevicedialog.h>
+#include <hbinputdialog.h>
+
+/*!
+    \class BtDeviceDialogInputWidget
+    \brief Widget class with properties setting. 
+
+    BtDeviceDialogInputWidget, inherited from HbInputDialog, 
+    implements interface HbDeviceDialogInterface. The Q_Properties
+    here are interfaces for caller of HbDeviceDialog to configue
+    what to be shown in the widget. 
+    
+ */
+class BtDeviceDialogInputWidget :
+    public QObject, public HbDeviceDialogInterface
+{
+    Q_OBJECT
+
+public:
+    BtDeviceDialogInputWidget(const QVariantMap &parameters);
+    
+    // From base class HbDeviceDialogInterface
+    virtual bool setDeviceDialogParameters(const QVariantMap &parameters);
+    virtual int deviceDialogError() const;
+    virtual void closeDeviceDialog(bool byClient);
+    virtual HbDialog *deviceDialogWidget() const;
+    virtual QObject *signalSender() const;
+    
+signals: 
+    // Required by the framework
+    void deviceDialogClosed();
+    void deviceDialogData(QVariantMap data);
+
+public slots:
+    void inputClosed(HbAction *action);
+    
+private:
+    void processParam(const QVariantMap &parameters);
+    bool constructInputDialog(const QVariantMap &parameters);
+    void resetProperties();
+
+private:
+    Q_DISABLE_COPY(BtDeviceDialogInputWidget)
+
+    int mLastError;
+    int mSendAction;
+    bool mShowEventReceived;
+    HbInputDialog *mInputDialog;
+};
+
+#endif // BTDEVICEDIALOGINPUTWIDGET_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialognotifwidget.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  BtDeviceDialogWidget class declaration.
+*
+*/
+
+
+#ifndef BTDEVICEDIALOGNOTIFWIDGET_H
+#define BTDEVICEDIALOGNOTIFWIDGET_H
+
+#include <QVariantMap>
+
+#include <hbdevicedialoginterface.h>
+#include <hbdevicedialog.h>
+#include <hbnotificationdialog.h>
+
+/*!
+    \class BtDeviceDialogQueryWidget
+    \brief Widget class with properties setting. 
+
+    BtDeviceDialogQueryWidget, inherited from HbNotificationDialog, 
+    implements interface HbDeviceDialogInterface. The Q_Properties
+    here are interfaces for caller of HbDeviceDialog to configue
+    what to be shown in the widget. 
+    
+ */
+class BtDeviceDialogNotifWidget :
+    public HbNotificationDialog, public HbDeviceDialogInterface
+{
+    Q_OBJECT
+    
+public:
+    BtDeviceDialogNotifWidget(const QVariantMap &parameters);
+    
+    // From base class HbDeviceDialogInterface
+    virtual bool setDeviceDialogParameters(const QVariantMap &parameters);
+    virtual int deviceDialogError() const;
+    virtual void closeDeviceDialog(bool byClient);
+    virtual HbDialog *deviceDialogWidget() const;
+
+signals: 
+    // Required by the framework
+    void deviceDialogClosed();
+    
+private:
+    void processParam(const QVariantMap &parameters);
+    bool constructQueryDialog(const QVariantMap &parameters);
+    void resetProperties();
+        
+    // From base HbInputDialog, reimplement and emit signals. 
+    void hideEvent(QHideEvent *event);
+    void showEvent(QShowEvent *event);
+
+private:
+    Q_DISABLE_COPY(BtDeviceDialogNotifWidget)
+
+    int mLastError;
+    int mSendAction;
+    bool mShowEventReceived;
+};
+
+#endif // BTDEVICEDIALOGNOTIFWIDGET_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialogplugin.h	Fri May 14 16:01:46 2010 +0300
@@ -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:  BtDeviceDialogPlugin class declaration.
+*
+*/
+
+
+#ifndef BTDEVICEDIALOGPLUGIN_P_H
+#define BTDEVICEDIALOGPLUGIN_P_H
+
+#include <QObject>
+#include <QVariantMap>
+
+#include <hbdevicedialogplugin.h>
+
+// Forward declarations
+class BtDeviceDialogPluginPrivate;
+
+/*!
+    \class BtDeviceDialogPlugin
+    \brief Device dialog widget plugin providing generic input dialog.
+
+    BtDeviceDialogPlugin implements interface HbDeviceDialogPlugin and
+    creates device dialog widget, which allows user's input. 
+    Currently this plugin implements only one dialog type, identified by
+    "com.nokia.hb.btdevicedialog/1.0".
+    
+    ToDo: create widget base on dialog types when multiple dialog types available.
+ */
+class BtDeviceDialogPlugin : public HbDeviceDialogPlugin
+{
+    Q_OBJECT
+
+public:
+    friend class BtDeviceDialogPluginPrivate;
+
+    BtDeviceDialogPlugin();
+    ~BtDeviceDialogPlugin();
+    
+    // from base HbDeviceDialogPluginInterface
+    virtual HbDeviceDialogInterface *createDeviceDialog(const QString &deviceDialogType,
+        const QVariantMap &parameters);
+    
+    // from base HbDeviceDialogPlugin
+    virtual bool accessAllowed(const QString &deviceDialogType,
+        const QVariantMap &parameters, const QVariantMap &securityInfo) const;
+    virtual bool deviceDialogInfo(const QString &deviceDialogType,
+        const QVariantMap &parameters, DeviceDialogInfo *info) const;
+    virtual QStringList deviceDialogTypes() const;
+    virtual PluginFlags pluginFlags() const;
+    virtual int error() const;
+
+private: 
+    HbDeviceDialogInterface *checkDialogType( const QVariantMap &parameters );
+    
+private:
+    Q_DISABLE_COPY(BtDeviceDialogPlugin)
+    BtDeviceDialogPluginPrivate *d;
+};
+
+#endif // BTDEVICEDIALOGPLUGIN_P_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialogpluginerrors.h	Fri May 14 16:01:46 2010 +0300
@@ -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:  Plugin error constants
+*
+*/
+
+#ifndef BTDEVICEDIALOGPLUGINERRORS_H
+#define BTDEVICEDIALOGPLUGINERRORS_H
+
+#include <hbdevicedialog.h>
+
+// No error
+const int NoError = 0;
+// Illegal parameter error
+const int ParameterError = HbDeviceDialog::PluginErrors + 1;
+// Unknown device dialog error
+const int UnknownDeviceDialogError = HbDeviceDialog::PluginErrors + 2;
+
+#endif // BTDEVICEDIALOGPLUGINERRORS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialogplugintrace.h	Fri May 14 16:01:46 2010 +0300
@@ -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:  Tracing macros
+*
+*/
+
+#ifndef BTDEVICEDIALOGPLUGINTRACE_H
+#define BTDEVICEDIALOGPLUGINTRACE_H
+
+#include <QDebug>   // QDebug
+#include <QtGlobal> // qDebug()
+
+
+#ifdef ENABLE_TRACE_OUTPUT
+    #define INSTALL_MESSAGE_HANDLER HbDeviceDialogMessageHandler::installMessageHandler(QString(TRACE_OUTPUT_FILE), TRACE_OUTPUT_FILE_REQUIRED);
+    #define UNINSTALL_MESSAGE_HANDLER HbDeviceDialogMessageHandler::uninstallMessageHandler();
+    #define TRACE_UNUSED(name)
+    #define TRACE_STATIC_ENTRY qDebug() << __PRETTY_FUNCTION__ << "entry";
+    #define TRACE_STATIC_ENTRY_ARGS(args) qDebug() << __PRETTY_FUNCTION__ << "entry," << args;
+    #define TRACE_ENTRY qDebug() << __PRETTY_FUNCTION__ << "this" << (void *)this << "entry";
+    #define TRACE_ENTRY_ARGS(args) qDebug() << __PRETTY_FUNCTION__ << "this" << (void *)this << "entry," << args;
+    #define TRACE_EXIT qDebug() << __PRETTY_FUNCTION__ << "exit";
+    #define TRACE_EXIT_ARGS(args) qDebug() << __PRETTY_FUNCTION__ << "exit," << args;
+    #define TRACE(args) qDebug() << __PRETTY_FUNCTION__ << args;
+#else
+    #define INSTALL_MESSAGE_HANDLER
+    #define UNINSTALL_MESSAGE_HANDLER
+    #define TRACE_UNUSED(name) Q_UNUSED(name)
+    #define TRACE_STATIC_ENTRY
+    #define TRACE_STATIC_ENTRY_ARGS(args)
+    #define TRACE_ENTRY
+    #define TRACE_ENTRY_ARGS(args)
+    #define TRACE_EXIT
+    #define TRACE_EXIT_ARGS(args)
+    #define TRACE(args)
+#endif // ENABLE_TRACE_OUTPUT
+
+#endif // BTDEVICEDIALOGPLUGINTRACE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialogquerywidget.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  BtDeviceDialogWidget class declaration.
+*
+*/
+
+
+#ifndef BTDEVICEDIALOGQUERYWIDGET_H
+#define BTDEVICEDIALOGQUERYWIDGET_H
+
+#include <QVariantMap>
+
+#include <hbdevicedialoginterface.h>
+#include <hbdevicedialog.h>
+#include <hbmessagebox.h>
+
+/*!
+    \class BtDeviceDialogQueryWidget
+    \brief Widget class with properties setting. 
+
+    BtDeviceDialogQueryWidget, inherited from HbMessageBox, 
+    implements interface HbDeviceDialogInterface. The Q_Properties
+    here are interfaces for caller of HbDeviceDialog to configue
+    what to be shown in the widget. 
+    
+ */
+class BtDeviceDialogQueryWidget :
+    public QObject, public HbDeviceDialogInterface
+{
+    Q_OBJECT
+    
+public:
+    BtDeviceDialogQueryWidget(HbMessageBox::MessageBoxType type, const QVariantMap &parameters);
+    
+    // From base class HbDeviceDialogInterface
+    virtual bool setDeviceDialogParameters(const QVariantMap &parameters);
+    virtual int deviceDialogError() const;
+    virtual void closeDeviceDialog(bool byClient);
+    virtual HbDialog *deviceDialogWidget() const;
+    virtual QObject *signalSender() const;
+    
+signals: 
+    // Required by the framework
+    void deviceDialogClosed();
+    void deviceDialogData(QVariantMap data);
+
+public slots:
+    void messageBoxClosed(HbAction*);
+    
+private:
+    void processParam(const QVariantMap &parameters);
+    bool constructQueryDialog(const QVariantMap &parameters);
+    void resetProperties();
+        
+private:
+    Q_DISABLE_COPY(BtDeviceDialogQueryWidget)
+
+    int mLastError;
+    int mSendAction;
+    bool mShowEventReceived;
+    
+    HbMessageBox *mMessageBox;
+};
+
+#endif // BTDEVICEDIALOGQUERYWIDGET_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicesearchdialogwidget.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+
+
+#ifndef BTDEVICESEARCHDIALOGWIDGET_H
+#define BTDEVICESEARCHDIALOGWIDGET_H
+
+#include <QObject>
+#include <QVariantMap>
+#include <hbdialog.h>
+#include <hbdevicedialoginterface.h>
+#include <hbpopup.h>
+#include <hbdocumentloader.h>
+#include <qstandarditemmodel.h>
+#include <hbradiobuttonlist.h>
+#include <hblistwidget.h>
+
+
+struct device
+    {
+    QString mDeviceName;
+    QString mDeviceType;
+    int     mDeviceIdx;
+    };
+
+class BTDeviceSearchDialogWidget : public HbDialog,
+                                public HbDeviceDialogInterface
+    {
+    Q_OBJECT
+    
+public:
+    BTDeviceSearchDialogWidget(const QVariantMap &parameters);
+    ~BTDeviceSearchDialogWidget();
+    
+public: // from HbDeviceDialogInterface
+    bool setDeviceDialogParameters(const QVariantMap &parameters);
+    int deviceDialogError() const;
+    void closeDeviceDialog(bool byClient);
+    HbPopup *deviceDialogWidget() const;
+    
+public slots:
+    void stopClicked();
+    void retryClicked();
+//    void viewByClicked();
+    void deviceSelected(const QModelIndex& modelIndex);
+//    void viewByItemSelected(int index);
+    
+private:
+    bool constructDialog(const QVariantMap &parameters);
+    void hideEvent(QHideEvent *event);
+    void showEvent(QShowEvent *event);
+    void appendToDeviceList(const QString deviceName);
+    bool appendToDeviceTypeList(const QString deviceType);
+    QIcon icon();
+    
+signals:
+    void deviceDialogClosed();
+    void deviceDialogData(QVariantMap  data);
+    
+private:
+    HbDocumentLoader *mLoader;
+    
+    /**
+     * 
+     * item model for content list view.
+     */
+    
+    QStandardItemModel* mContentItemModel;
+    HbDialog*           mViewByDialog;
+    HbRadioButtonList*  mRbl;
+    QList<QString>      mDeviceTypeList;
+    QList<device>       mDeviceList;
+    HbListView*         mListView;
+    bool                mViewByChosen;
+    QList<device>       mDeviceLstOfType;
+    int                 mDeviceLstIdx;
+    int                 mSelectedType;
+    int                 mDeviceDialogData;
+    
+    Q_DISABLE_COPY(BTDeviceSearchDialogWidget)
+    };
+
+#endif /* BTDEVICESEARCHDIALOGWIDGET_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/rom/btdevicedialogplugin.iby	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Image description file for project btdevicedialogplugin
+*
+*/
+
+
+#ifndef BTDEVICEDIALOGPLUGIN_IBY
+#define BTDEVICEDIALOGPLUGIN_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+#ifdef __BT
+file=ABI_DIR/BUILD_DIR/btdevicedialogplugin.dll SHARED_LIB_DIR/btdevicedialogplugin.dll
+data=/epoc32/data/z/pluginstub/btdevicedialogplugin.qtplugin   resource/plugins/devicedialogs/btdevicedialogplugin.qtplugin
+#endif // __BT
+
+#endif // BTDEVICEDIALOGPLUGIN_IBY
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicedialoginputwidget.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,201 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  BtDeviceDialogWidget class implementation.
+*
+*/
+
+
+#include "btdevicedialoginputwidget.h"
+#include "btdevicedialogplugintrace.h"
+#include <bluetoothdevicedialogs.h>
+#include <hbaction.h>
+#include <hbdialog.h>
+#include "btdevicedialogpluginerrors.h"
+
+/*!
+    class Constructor
+ */
+BtDeviceDialogInputWidget::BtDeviceDialogInputWidget(
+        const QVariantMap &parameters)
+{
+    TRACE_ENTRY
+    // set properties
+    mLastError = NoError;
+    mShowEventReceived = false;
+    mInputDialog = new HbInputDialog();
+    
+    resetProperties();
+    constructInputDialog(parameters);
+    TRACE_EXIT
+}
+
+/*!
+    Set parameters, implementation of interface
+    Invoked when HbDeviceDialog::update calls.
+ */
+bool BtDeviceDialogInputWidget::setDeviceDialogParameters(
+    const QVariantMap &parameters)
+{
+    TRACE_ENTRY
+    mLastError = NoError;
+    processParam(parameters);
+    TRACE_EXIT
+    return true;
+}
+
+/*!
+    Get error, implementation of interface
+ */
+int BtDeviceDialogInputWidget::deviceDialogError() const
+{
+    TRACE_ENTRY
+    TRACE_EXIT
+    return mLastError;
+}
+
+/*!
+    Close notification, implementation of interface
+ */ 
+void BtDeviceDialogInputWidget::closeDeviceDialog(bool byClient)
+{
+    TRACE_ENTRY
+    Q_UNUSED(byClient);
+    // Closed by client or internally by server -> no action to be transmitted.
+    mSendAction = false;
+    mInputDialog->close();
+    // If show event has been received, close is signalled from hide event. If not,
+    // hide event does not come and close is signalled from here.
+    if (!mShowEventReceived) {
+        emit deviceDialogClosed();
+    }
+    TRACE_EXIT
+}
+
+/*!
+    Return display widget, implementation of interface
+ */
+HbDialog *BtDeviceDialogInputWidget::deviceDialogWidget() const
+{
+    TRACE_ENTRY
+    TRACE_EXIT
+    return mInputDialog;
+}
+
+QObject *BtDeviceDialogInputWidget::signalSender() const
+{
+    return const_cast<BtDeviceDialogInputWidget*>(this);
+}     
+
+/*!
+    Construct display widget
+ */
+bool BtDeviceDialogInputWidget::constructInputDialog(const QVariantMap &parameters)
+{
+    TRACE_ENTRY
+    // analyze the parameters to compose the properties of the widget
+    processParam(parameters);
+    connect(mInputDialog, SIGNAL(finished(HbAction*)), this, SLOT(inputClosed(HbAction*)));
+    
+    TRACE_EXIT
+    return true;
+}
+
+/*!
+    Take parameter values and generate relevant property of this widget
+ */
+void BtDeviceDialogInputWidget::processParam(const QVariantMap &parameters)
+{
+    TRACE_ENTRY
+
+    QString keyStr, prompt;
+    keyStr.setNum( TBluetoothDialogParams::EResource );
+    // Validate if the resource item exists.
+    QVariantMap::const_iterator i = parameters.constFind( keyStr );
+    // item of ResourceId is not found, can't continue.
+    if ( i == parameters.constEnd() ) {
+        mLastError = UnknownDeviceDialogError;
+        return;
+    }
+
+    QVariant param = parameters.value( keyStr );
+    if ( param.toInt() == EPinInput ) {
+        prompt = QString( tr( "Passcode for device %1:" ) );
+    }
+    else {
+        mLastError = ParameterError;
+        return;
+    }
+    
+    // check if minLength of passcode required
+    keyStr.setNum( TBluetoothDeviceDialog::EAdditionalDesc );
+    i = parameters.constFind( keyStr );
+    // Mini Length required, update prompt
+    // ToDo: use Validator to check input length. 
+    if ( i != parameters.constEnd() ) {
+        prompt = QString( tr( "Enter %1 digit passcode for device %2:" ) );
+        param = parameters.value( keyStr );
+    }
+    
+    // replace % with the miniLength and device name
+    int repls = prompt.count( QString( "%" ) );
+    if ( repls > 1 ) {
+        prompt = prompt.arg( param.toString() );
+    }
+    if ( repls > 0 ) {
+        QVariant name = parameters.value( QString::number( TBluetoothDeviceDialog::EDeviceName ) );
+        prompt = prompt.arg( name.toString() );
+    }
+    // set property value to this dialog widget
+    mInputDialog->setPromptText( prompt );
+    TRACE_EXIT
+}
+
+/*!
+    Reset properties to default values
+ */
+void BtDeviceDialogInputWidget::resetProperties()
+{
+    TRACE_ENTRY
+    // set to default values
+    mInputDialog->setModal(true);
+    mInputDialog->setTimeout(HbDialog::NoTimeout);
+    mInputDialog->setDismissPolicy(HbDialog::NoDismiss);
+    mSendAction = true;
+    // Todo: clean the Validator
+    TRACE_EXIT
+    return;
+}
+
+void BtDeviceDialogInputWidget::inputClosed(HbAction *action)
+{
+    QVariantMap data;
+    
+    HbInputDialog *dlg=static_cast<HbInputDialog*>(sender());
+    if(dlg->actions().first() == action) {
+        //Ok
+        QVariant result( dlg->value().toString().toUtf8() );
+        data.insert( QString( "result" ), QVariant(true));
+        data.insert( QString( "input" ), result );
+   } 
+    else if(dlg->actions().at(1) == action) {
+        //Cancel
+        data.insert( QString( "result" ), QVariant(false));
+    }
+
+    emit deviceDialogData(data);
+    emit deviceDialogClosed();
+    mSendAction = false;
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicedialognotifwidget.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,176 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  BtDeviceDialogWidget class implementation.
+*
+*/
+
+
+#include "btdevicedialognotifwidget.h"
+#include "btdevicedialogplugintrace.h"
+#include <bluetoothdevicedialogs.h>
+#include <hbaction.h>
+#include <hbdialog.h>
+#include "btdevicedialogpluginerrors.h"
+
+/*!
+    class Constructor
+ */
+BtDeviceDialogNotifWidget::BtDeviceDialogNotifWidget( const QVariantMap &parameters )
+{
+    TRACE_ENTRY
+    // set properties
+    mLastError = NoError;
+    mShowEventReceived = false;
+    resetProperties();
+    constructQueryDialog(parameters);
+    TRACE_EXIT
+}
+
+/*!
+    Set parameters, implementation of interface
+    Invoked when HbDeviceDialog::update calls.
+ */
+bool BtDeviceDialogNotifWidget::setDeviceDialogParameters(
+    const QVariantMap &parameters)
+{
+    TRACE_ENTRY
+    mLastError = NoError;
+    processParam(parameters);
+    TRACE_EXIT
+    return true;
+}
+
+/*!
+    Get error, implementation of interface
+ */
+int BtDeviceDialogNotifWidget::deviceDialogError() const
+{
+    TRACE_ENTRY
+    TRACE_EXIT
+    return mLastError;
+}
+
+/*!
+    Close notification, implementation of interface
+ */ 
+void BtDeviceDialogNotifWidget::closeDeviceDialog(bool byClient)
+{
+    TRACE_ENTRY
+    Q_UNUSED(byClient);
+    // Closed by client or internally by server -> no action to be transmitted.
+    mSendAction = false;
+    close();
+    // If show event has been received, close is signalled from hide event. If not,
+    // hide event does not come and close is signalled from here.
+    if (!mShowEventReceived) {
+        emit deviceDialogClosed();
+    }
+    TRACE_EXIT
+}
+
+/*!
+    Return display widget, implementation of interface
+ */
+HbDialog *BtDeviceDialogNotifWidget::deviceDialogWidget() const
+{
+    TRACE_ENTRY
+    TRACE_EXIT
+    return const_cast<BtDeviceDialogNotifWidget*>(this);
+}
+
+/*!
+    Construct display widget
+ */
+bool BtDeviceDialogNotifWidget::constructQueryDialog(const QVariantMap &parameters)
+{
+    TRACE_ENTRY
+    // analyze the parameters to compose the properties of the message box widget 
+    processParam(parameters);
+ 
+    TRACE_EXIT
+    return true;
+}
+
+/*!
+    Take parameter values and generate relevant property of this widget
+ */
+void BtDeviceDialogNotifWidget::processParam(const QVariantMap &parameters)
+{
+    TRACE_ENTRY
+    QString keyStr, prompt;
+    keyStr.setNum( TBluetoothDialogParams::EResource );
+    // Validate if the resource item exists.
+    QVariantMap::const_iterator i = parameters.constFind( keyStr );
+    // item of ResourceId is not found, can't continue.
+    if ( i == parameters.constEnd() ) {
+        mLastError = UnknownDeviceDialogError;
+        return;
+    }
+
+    QVariant param = parameters.value( keyStr );
+    int key = param.toInt();
+    switch ( key ) {
+        // Note dialogs
+        case EPairingSuccess:
+            prompt = QString( tr( "Pairing with %1 complete" ) );
+            break;
+        case EPairingFailure:
+            prompt = QString( tr( "Unable to pair with %1" ) );
+            break;            
+        case EVisibilityTimeout:
+            prompt = QString( tr( "Phone is not detectable in searches made by other devices" ) );
+            break;
+        default:
+            mLastError = ParameterError;
+            break;
+    }
+    // Could use QChar with ReplacementCharacter?
+    int repls = prompt.count( QString( "%" ) );
+    if ( repls > 0 ) {
+        QVariant name = parameters.value( QString::number( TBluetoothDeviceDialog::EDeviceName ) );
+        prompt = prompt.arg( name.toString() );
+    }
+    // set property value to this dialog widget
+    HbNotificationDialog::setTitle( prompt );
+    TRACE_EXIT
+}
+
+/*!
+    Reset properties to default values
+ */
+void BtDeviceDialogNotifWidget::resetProperties()
+{
+    TRACE_ENTRY
+    mSendAction = true;
+    TRACE_EXIT
+    return;
+}
+
+/*!
+    Widget is about to hide. Closing effect has ended.
+ */
+void BtDeviceDialogNotifWidget::hideEvent(QHideEvent *event)
+{
+    HbNotificationDialog::hideEvent(event);
+    emit deviceDialogClosed();
+}
+
+/*!
+    Widget is about to show
+ */
+void BtDeviceDialogNotifWidget::showEvent(QShowEvent *event)
+{
+    HbNotificationDialog::showEvent(event);
+    mShowEventReceived = true;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicedialogplugin.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,217 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  BtDeviceDialogPlugin class implementation.
+*
+*/
+
+
+#include "btdevicedialogplugin.h"
+#include "btdevicedialogplugintrace.h"
+#include <bluetoothdevicedialogs.h>
+#include <QtPlugin>
+#include <hbdevicedialog.h>
+#include "btdevicedialoginputwidget.h"
+#include "btdevicedialogquerywidget.h"
+#include "btdevicedialognotifwidget.h"
+
+#include "btdevicedialogpluginerrors.h"
+#include "btdevicesearchdialogwidget.h"
+
+Q_EXPORT_PLUGIN2(btdevicedialogplugin, BtDeviceDialogPlugin)
+
+// This plugin implements one device dialog type
+static const struct {
+    const char *mTypeString;
+} noteInfos[] = {
+    {"com.nokia.hb.btdevicedialog/1.0"}
+};
+
+class BtDeviceDialogPluginPrivate
+{
+public:
+    BtDeviceDialogPluginPrivate();
+public:
+    int mError;
+};
+/*! 
+    BtDeviceDialogPluginPrivate Constructor
+ */
+BtDeviceDialogPluginPrivate::BtDeviceDialogPluginPrivate()
+{
+    mError = NoError;
+}
+
+/*! 
+    BtDeviceDialogPlugin Constructor
+ */
+BtDeviceDialogPlugin::BtDeviceDialogPlugin()
+{
+    d = new BtDeviceDialogPluginPrivate;
+}
+
+/*!
+    Destructor
+ */
+BtDeviceDialogPlugin::~BtDeviceDialogPlugin()
+{
+    delete d;
+}
+
+/*! 
+    Check if client is allowed to use device dialog widget
+ */
+bool BtDeviceDialogPlugin::accessAllowed(const QString &deviceDialogType,
+    const QVariantMap &parameters, const QVariantMap &securityInfo) const
+{
+    Q_UNUSED(deviceDialogType)
+    Q_UNUSED(parameters)
+    Q_UNUSED(securityInfo)
+
+    // This plugin doesn't perform operations that may compromise security.
+    // All clients are allowed to use.
+    return true;
+}
+
+/*! 
+    From interface class.
+    Use the dialog type in the parameter to create widget.    
+ */
+HbDeviceDialogInterface *BtDeviceDialogPlugin::createDeviceDialog(
+    const QString &deviceDialogType, const QVariantMap &parameters)
+{
+    d->mError = NoError;
+
+    int i;
+    // verify that requested dialog type is supported
+    const int numTypes = sizeof(noteInfos) / sizeof(noteInfos[0]);
+    for(i = 0; i < numTypes; i++) {
+        if (noteInfos[i].mTypeString == deviceDialogType) {
+            break;
+        }
+    }
+    // dialog type was found
+    if (i < numTypes) {
+        return checkDialogType( parameters );
+    } 
+    else {
+        // unknown dialog type, return error
+        d->mError = UnknownDeviceDialogError;
+        return 0;
+    }
+}
+
+/*! 
+    Return information of device dialog the plugin creates
+    Currently only supporting 1 device dialog type, so no need to check the type.
+ */
+bool BtDeviceDialogPlugin::deviceDialogInfo(const QString &deviceDialogType,
+    const QVariantMap &parameters, DeviceDialogInfo *info) const
+{
+    Q_UNUSED(parameters)
+    Q_UNUSED(deviceDialogType)
+    // set return values
+    info->group = GenericDeviceDialogGroup;
+    info->flags = NoDeviceDialogFlags;
+    info->priority = DefaultPriority;
+    return true;
+}
+
+/*! 
+    Return device dialog types this plugin implements
+    Function will work fine (unchanged) when new dialogs are added.
+ */
+QStringList BtDeviceDialogPlugin::deviceDialogTypes() const
+{
+    QStringList types;
+    // read supported types from noteInfos
+    const int numTypes = sizeof(noteInfos) / sizeof(noteInfos[0]);
+    for(int i = 0; i < numTypes; i++) {
+        types.append(noteInfos[i].mTypeString);
+    }
+    return types;
+}
+
+/*! 
+    Return plugin flags
+ */
+HbDeviceDialogPlugin::PluginFlags BtDeviceDialogPlugin::pluginFlags() const
+{
+    return NoPluginFlags;
+}
+
+/*! 
+    Return last error
+ */
+int BtDeviceDialogPlugin::error() const
+{
+    return d->mError;
+}
+
+/*!
+    Check the device dialog type to decide which widget to be used. 
+    And create the specified widget.
+ */
+HbDeviceDialogInterface *BtDeviceDialogPlugin::checkDialogType( const QVariantMap &parameters )
+{
+    // Construct the key of EDialogType
+    QString keyStr;
+    keyStr.setNum( TBluetoothDialogParams::EDialogType );
+    // Find the const iterator with key EDialogType
+    QVariantMap::const_iterator i = parameters.constFind( keyStr );
+
+    // item with key EDialogType is not found
+    if ( i == parameters.constEnd() ) {
+        d->mError = UnknownDeviceDialogError;
+        return NULL;
+    }
+    
+    // item with key EDialogType is found
+    // generate specified widget based on the dialog type value.
+    HbDeviceDialogInterface *deviceDialog = NULL;
+    switch ( i.value().toInt() ) {
+        case TBluetoothDialogParams::ENote:
+            deviceDialog =
+                new BtDeviceDialogQueryWidget(HbMessageBox::MessageTypeInformation, parameters);
+            break;
+        case TBluetoothDialogParams::EQuery:
+            deviceDialog =
+                new BtDeviceDialogQueryWidget(HbMessageBox::MessageTypeQuestion, parameters);
+            break;
+        case TBluetoothDialogParams::EInput:
+            deviceDialog = new BtDeviceDialogInputWidget(parameters);
+            break;
+        case TBluetoothDialogParams::EDeviceSearch:
+            deviceDialog = new BTDeviceSearchDialogWidget(parameters);
+            break;
+        case TBluetoothDialogParams::EGlobalNotif:
+            deviceDialog = new BtDeviceDialogNotifWidget(parameters);
+            break;
+        default:
+            d->mError = UnknownDeviceDialogError;
+            break;
+    }
+    if ( deviceDialog ) {
+        // verify no error has occurred
+        d->mError = deviceDialog->deviceDialogError();
+        if ( d->mError ) {
+            // Do not continue if an error occurred
+            delete deviceDialog;
+            deviceDialog = NULL;
+        }
+        else {
+            d->mError = UnknownDeviceDialogError;
+        }
+    }
+    return deviceDialog;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicedialogquerywidget.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,215 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  BtDeviceDialogWidget class implementation.
+*
+*/
+
+
+#include "btdevicedialogquerywidget.h"
+#include "btdevicedialogplugintrace.h"
+#include <bluetoothdevicedialogs.h>
+#include <hbaction.h>
+#include <hbdialog.h>
+#include "btdevicedialogpluginerrors.h"
+
+/*!
+    class Constructor
+ */
+BtDeviceDialogQueryWidget::BtDeviceDialogQueryWidget(
+        HbMessageBox::MessageBoxType type, const QVariantMap &parameters)
+{
+    TRACE_ENTRY
+    // set properties
+    mLastError = NoError;
+    mShowEventReceived = false;
+    mMessageBox = new HbMessageBox(type);
+    
+    resetProperties();
+    constructQueryDialog(parameters);
+    TRACE_EXIT
+}
+
+/*!
+    Set parameters, implementation of interface
+    Invoked when HbDeviceDialog::update calls.
+ */
+bool BtDeviceDialogQueryWidget::setDeviceDialogParameters(
+    const QVariantMap &parameters)
+{
+    TRACE_ENTRY
+    mLastError = NoError;
+    processParam(parameters);
+    TRACE_EXIT
+    return true;
+}
+
+/*!
+    Get error, implementation of interface
+ */
+int BtDeviceDialogQueryWidget::deviceDialogError() const
+{
+    TRACE_ENTRY
+    TRACE_EXIT
+    return mLastError;
+}
+
+/*!
+    Close notification, implementation of interface
+ */ 
+void BtDeviceDialogQueryWidget::closeDeviceDialog(bool byClient)
+{
+    TRACE_ENTRY
+    Q_UNUSED(byClient);
+    // Closed by client or internally by server -> no action to be transmitted.
+    mSendAction = false;
+    mMessageBox->close();
+    // If show event has been received, close is signalled from hide event. If not,
+    // hide event does not come and close is signalled from here.
+    if (!mShowEventReceived) {
+        emit deviceDialogClosed();
+    }
+    TRACE_EXIT
+}
+
+/*!
+    Return display widget, implementation of interface
+ */
+HbDialog *BtDeviceDialogQueryWidget::deviceDialogWidget() const
+{
+    TRACE_ENTRY
+    TRACE_EXIT
+    return mMessageBox;
+}
+
+QObject *BtDeviceDialogQueryWidget::signalSender() const
+{
+    return const_cast<BtDeviceDialogQueryWidget*>(this);
+}        
+
+/*!
+    Construct display widget
+ */
+bool BtDeviceDialogQueryWidget::constructQueryDialog(const QVariantMap &parameters)
+{
+    TRACE_ENTRY
+    // analyze the parameters to compose the properties of the message box widget 
+    processParam(parameters);
+ 
+    connect(mMessageBox, SIGNAL(finished(HbAction*)), this, SLOT(messageBoxClosed(HbAction*)));
+    
+    TRACE_EXIT
+    return true;
+}
+
+/*!
+    Take parameter values and generate relevant property of this widget
+ */
+void BtDeviceDialogQueryWidget::processParam(const QVariantMap &parameters)
+{
+    TRACE_ENTRY
+    QString keyStr, prompt;
+    keyStr.setNum( TBluetoothDialogParams::EResource );
+    // Validate if the resource item exists.
+    QVariantMap::const_iterator i = parameters.constFind( keyStr );
+    // item of ResourceId is not found, can't continue.
+    if ( i == parameters.constEnd() ) {
+        mLastError = UnknownDeviceDialogError;
+        return;
+    }
+
+    QVariant param = parameters.value( keyStr );
+    int key = param.toInt();
+    switch ( key ) {
+        // Query dialogs:
+        case EAuthorization:
+            prompt = QString( tr( "Accept connection request from:\n%1" ) );
+            break;
+        case EIncomingPairing:
+            prompt = QString( tr( "Device '%1' is trying to pair with you. Allow pairing?" ) );
+            break;
+        case ENumericComparison:
+            prompt = QString( tr( "Does this code match the one on %1?\n\n%2" ) );
+            break;
+        case EPasskeyDisplay:
+            prompt = QString( tr( "Enter on %1:\n\n%2" ) );
+            break;
+        case ESetTrusted:
+            prompt = QString( tr( "Authorise this device to make connections automatically?" ) );
+            break;
+        case EBlockUnpairedDevice:
+            prompt = QString( tr( "Do you want to block all future connection attempts from device %1?" ) );
+            break;
+        case EBlockPairedDevice:
+            prompt = QString( tr( "Do you want to block all future connection attempts from paired device %1? \nThis will delete your pairing with the device." ) );
+            break;
+        // Note dialogs, but not Notification dialogs
+        // Input dialogs
+        case EPinInput:
+        case EObexPasskeyInput:
+        // NULL parameters
+        case ENoResource:
+        case EUnusedResource:
+        default:
+            mLastError = ParameterError;
+            break;
+    }
+    // Could use QChar with ReplacementCharacter?
+    int repls = prompt.count( QString( "%" ) );
+    if ( repls > 0 ) {
+        QVariant name = parameters.value( QString::number( TBluetoothDeviceDialog::EDeviceName ) );
+        prompt = prompt.arg( name.toString() );
+        if ( repls > 1 ) {
+            QVariant addval = parameters.value( QString::number( TBluetoothDeviceDialog::EAdditionalDesc ) );
+            prompt = prompt.arg( addval.toString() );
+        }
+    }
+    // set property value to this dialog widget
+    mMessageBox->setText( prompt );
+    TRACE_EXIT
+}
+
+/*!
+    Reset properties to default values
+ */
+void BtDeviceDialogQueryWidget::resetProperties()
+{
+    TRACE_ENTRY
+    // set to default values
+    mMessageBox->setModal(true);
+    mMessageBox->setTimeout(HbDialog::NoTimeout);
+    mMessageBox->setDismissPolicy(HbDialog::NoDismiss);
+    mSendAction = true;
+    TRACE_EXIT
+    return;
+}
+
+
+void BtDeviceDialogQueryWidget::messageBoxClosed(HbAction* action)
+{
+    QVariantMap data;
+    
+    HbMessageBox *dlg=static_cast<HbMessageBox*>(sender());
+    if(dlg->actions().first() == action) {
+        //Yes
+        data.insert( QString( "result" ), QVariant(true));
+    } 
+    else if(dlg->actions().at(1) == action) {
+        //No
+        data.insert( QString( "result" ), QVariant(false));
+    }
+    
+    emit deviceDialogData(data);
+    emit deviceDialogClosed();
+    mSendAction = false;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicesearchdialogwidget.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,359 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+
+
+#include "btdevicesearchdialogwidget.h"
+#include <hblabel.h>
+#include <hblistview.h>
+#include <hbtoolbar.h>
+#include <hbpushbutton.h>
+#include <qstandarditemmodel.h>
+
+const char* DOCML_BTDEV_SEARCH_DIALOG = ":/docml/bt-device-search-dialog.docml";
+
+
+BTDeviceSearchDialogWidget::BTDeviceSearchDialogWidget(const QVariantMap &parameters)
+:HbDialog()
+    {
+    mDeviceLstIdx = 0;
+    mViewByChosen = false;
+    mSelectedType = 0;
+    mDeviceDialogData = 0;
+    constructDialog(parameters);
+    }
+
+BTDeviceSearchDialogWidget::~BTDeviceSearchDialogWidget()
+    {
+    delete mLoader;
+    mLoader = NULL;
+    delete mContentItemModel;
+    mContentItemModel = NULL;
+ //   delete mRbl;
+ //   delete mViewByDialog;
+    }
+
+bool BTDeviceSearchDialogWidget::setDeviceDialogParameters(const QVariantMap &parameters)
+    {
+    device newDevice;
+
+   // newDevice.mDeviceName = parameters.value("deviceName").toString();
+    newDevice.mDeviceName = parameters.value(parameters.keys().at(0)).toString();
+    
+ //   newDevice.mDeviceType = parameters.value("deviceType").toString();
+    newDevice.mDeviceIdx = mDeviceLstIdx;
+    
+    mDeviceList.append(newDevice);
+    mDeviceLstIdx++;
+    
+
+    QStringList info;
+ //   if(!mViewByChosen)
+        {
+        info.append(newDevice.mDeviceName);
+   //     info.append(newDevice.mDeviceType);
+        QStandardItem* listitem = new QStandardItem();
+        listitem->setData(info, Qt::DisplayRole);
+    
+        listitem->setIcon(icon());
+    
+        mContentItemModel->appendRow(listitem);
+        }
+ /*   else
+        {
+        if(mDeviceTypeList[mSelectedType] == newDevice.mDeviceType)
+            {
+            info.append(newDevice.mDeviceName);
+            info.append(newDevice.mDeviceType);
+            QStandardItem* listitem = new QStandardItem();
+            listitem->setData(info, Qt::DisplayRole);
+
+            listitem->setIcon(icon(newDevice.mDeviceType));
+
+            mContentItemModel->appendRow(listitem);
+            }
+        }*/
+                
+    return true;
+    }
+
+int BTDeviceSearchDialogWidget::deviceDialogError() const
+    {
+    return 0;
+    }
+
+void BTDeviceSearchDialogWidget::closeDeviceDialog(bool byClient)
+    {
+    Q_UNUSED(byClient);
+    this->close();
+    }
+
+HbPopup* BTDeviceSearchDialogWidget::deviceDialogWidget() const
+    {
+    return const_cast<BTDeviceSearchDialogWidget*>(this);
+    }
+
+bool BTDeviceSearchDialogWidget::constructDialog(const QVariantMap &parameters)
+    {
+    (void) parameters;
+    mLoader = new HbDocumentLoader();
+    bool ok = false;
+    
+    mLoader->load(DOCML_BTDEV_SEARCH_DIALOG, &ok);
+    if(ok)
+        {
+        HbLabel* label = qobject_cast<HbLabel*>(mLoader->findWidget("heading"));
+        if(label)
+            {
+            label->setTextWrapping(Hb::TextWordWrap);
+            label->setAlignment(Qt::AlignHCenter);
+            label->setPlainText("Bluetooth - Found devices");
+            }
+        this->setHeadingWidget(label);
+        this->setFrameType(HbDialog::Strong);
+        this->setBackgroundFaded(false);
+
+        HbPushButton* viewBy = qobject_cast<HbPushButton*>(mLoader->findWidget("viewBy"));
+        HbPushButton* stop = qobject_cast<HbPushButton*>(mLoader->findWidget("stop"));
+        HbPushButton* retry = qobject_cast<HbPushButton*>(mLoader->findWidget("retry"));
+        
+        mListView = qobject_cast<HbListView*>(mLoader->findWidget("listView"));
+        mListView->setSelectionMode(HbAbstractItemView::SingleSelection);
+
+        mContentItemModel = new QStandardItemModel(this);
+        mListView->setModel(mContentItemModel);//, prototype);
+
+        connect(mListView, SIGNAL(activated(QModelIndex)), this, SLOT(deviceSelected(QModelIndex)));
+        connect(stop, SIGNAL(clicked()), this, SLOT(stopClicked()));
+        connect(retry, SIGNAL(clicked()), this, SLOT(retryClicked()));
+        connect(viewBy, SIGNAL(clicked()), this, SLOT(viewByClicked()));
+        
+        QGraphicsWidget *widget = mLoader->findWidget(QString("container"));
+        this->setContentWidget(widget);
+        }
+    else
+        {
+
+        }
+
+    this->setBackgroundFaded(false);
+    setDismissPolicy(HbPopup::TapOutside);
+    setTimeout(HbPopup::NoTimeout);
+    
+ /*   mViewByDialog = new HbDialog();
+    mRbl = new HbRadioButtonList(mViewByDialog);
+    connect(mRbl, SIGNAL(itemSelected(int)), this, SLOT(viewByItemSelected(int)));*/
+    
+    return true;
+    }
+
+void BTDeviceSearchDialogWidget::hideEvent(QHideEvent *event)
+    {
+    HbDialog::hideEvent(event);
+    if(mDeviceDialogData == 0)
+        {
+        QVariantMap val;
+        QVariant index(-1);
+        val.insert("selectedindex",index);
+        emit deviceDialogData(val);    
+        }
+    emit deviceDialogClosed();
+    }
+
+void BTDeviceSearchDialogWidget::showEvent(QShowEvent *event)
+    {
+    HbDialog::showEvent(event);
+    }
+
+void BTDeviceSearchDialogWidget::stopClicked()
+    {
+    QVariantMap val;
+    QVariant index("Stop");
+    val.insert("Stop",index); 
+    emit deviceDialogData(val);
+    }
+
+void BTDeviceSearchDialogWidget::retryClicked()
+    {
+    QVariantMap val;
+    QVariant index("Retry");
+    val.insert("Retry",index); 
+    emit deviceDialogData(val);
+    delete mContentItemModel;
+    mContentItemModel = new QStandardItemModel(this);
+    mListView->setModel(mContentItemModel);
+    }
+
+//void BTDeviceSearchDialogWidget::viewByClicked()
+//    {
+/*    mViewByDialog->setDismissPolicy(HbPopup::NoDismiss);
+    mViewByDialog->setTimeout(HbPopup::NoTimeout);
+
+    bool foundEntry = false;
+    QStringList st;
+    st << "All";
+    mDeviceTypeList.clear();
+    for(int i = 0; i < mDeviceList.count(); i++)
+        {
+        for(int j = 0; j < mDeviceTypeList.count(); j++)
+            {
+            if(mDeviceTypeList[j] == mDeviceList[i].mDeviceType)
+                {
+                foundEntry = true;
+                break;
+                }
+            }
+        if(!foundEntry)
+            {
+            mDeviceTypeList.append(mDeviceList[i].mDeviceType);
+            }
+        foundEntry = false;
+        }
+    
+    for(int k = 0; k < mDeviceTypeList.count(); k++)
+        {
+        st << mDeviceTypeList[k];
+        }
+    
+    mRbl->setItems(st);
+    mViewByDialog->setContentWidget(mRbl);
+    mViewByDialog->setMaximumHeight(300);
+    mViewByDialog->setMaximumWidth(500);
+
+    mViewByDialog->show();*/
+ //   }
+
+void BTDeviceSearchDialogWidget::deviceSelected(const QModelIndex& modelIndex)
+    {
+    int row = 0;
+    
+ /*   if(mViewByChosen)
+        {
+        row = mDeviceLstOfType[modelIndex.row()].mDeviceIdx;
+        }
+    
+    else*/
+        {
+        row = modelIndex.row();
+        }
+    
+    QVariantMap val;
+    QVariant index(row);
+    val.insert("selectedindex",index);
+    emit deviceDialogData(val);
+    mDeviceDialogData = 1;//flag is to say that device dialog data is emitted required when we cancel the dialog
+    //emit deviceDialogClosed();
+    this->close();
+    }
+
+//void BTDeviceSearchDialogWidget::viewByItemSelected(int index)
+  //  {
+    //  (void) index;
+ /*   if(index == 0)
+        {
+        //Option 'All' selected    
+        mViewByDialog->close();
+        delete mContentItemModel;
+        mContentItemModel = new QStandardItemModel(this);
+        mListView->setModel(mContentItemModel);
+        mViewByChosen = false;
+
+        for(int i = 0; i < mDeviceList.count(); i++)
+            {        
+            QStandardItem* listitem = new QStandardItem();
+                
+            QStringList info;
+            info << mDeviceList[i].mDeviceName << mDeviceList[i].mDeviceType ;
+            listitem->setData(info, Qt::DisplayRole);
+    
+            //listitem->setIcon(icon(mDeviceList[i].mDeviceType));
+    
+            mContentItemModel->appendRow(listitem);
+            }
+        }
+    else
+        {
+        index--;
+        mSelectedType = index;
+        mViewByDialog->close();
+        
+        delete mContentItemModel;
+        mContentItemModel = new QStandardItemModel(this);
+        mListView->setModel(mContentItemModel);
+    
+        mDeviceLstOfType.clear();
+        for(int i = 0; i < mDeviceList.count(); i++)
+            {
+            if(mDeviceList[i].mDeviceType == mDeviceTypeList[index])
+                {
+                mDeviceLstOfType.append(mDeviceList[i]);
+            
+                QStandardItem* listitem = new QStandardItem();
+                
+                QStringList info;
+                info << mDeviceList[i].mDeviceName << mDeviceTypeList[index];
+                listitem->setData(info, Qt::DisplayRole);
+        
+                //listitem->setIcon(icon(mDeviceTypeList[index]));
+        
+                mContentItemModel->appendRow(listitem);
+                }
+            }
+        mViewByChosen = true;
+        }*/
+ //   }
+
+QIcon BTDeviceSearchDialogWidget::icon()
+    {
+ /*   if(deviceType == "Audio")
+        {
+        return (QIcon(QString(":/icons/qgn_prop_bt_audio.svg")));
+        }
+    else if(deviceType == "Car-kit")
+        {
+        return (QIcon(QString(":/icons/qgn_prop_bt_car_kit.svg")));
+        }
+    else if(deviceType == "Computer")
+        {
+        return (QIcon(QString(":/icons/qgn_prop_bt_computer.svg")));
+        }
+    else if(deviceType == "Headset")
+        {
+        return (QIcon(QString(":/icons/qgn_prop_bt_headset.svg")));
+        }
+    else if(deviceType == "Keyboard")
+        {
+        return (QIcon(QString(":/icons/qgn_prop_bt_keyboard.svg")));
+        }
+    else if(deviceType == "Mouse")
+        {
+        return (QIcon(QString(":/icons/qgn_prop_bt_mouse.svg")));
+        }
+    else if(deviceType == "Phone")
+        {
+        return (QIcon(QString(":/icons/qgn_prop_bt_phone.svg")));
+        }
+    else if(deviceType == "Printer")
+        {
+        return (QIcon(QString(":/icons/qgn_prop_bt_printer.svg")));
+        }
+    else
+        {
+        return (QIcon(QString(":/icons/qgn_prop_bt_unknown.svg")));
+        }*/
+    return QIcon(QString(":/icons/qgn_prop_sml_bt.svg"));
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifclient/bwins/btnotifclientu.def	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,11 @@
+EXPORTS
+	??0RBTNotifier@@QAE@XZ @ 1 NONAME ; RBTNotifier::RBTNotifier(void)
+	?CancelNotifier@RBTNotifier@@QAEHVTUid@@@Z @ 2 NONAME ; int RBTNotifier::CancelNotifier(class TUid)
+	?Connect@RBTNotifier@@QAEHXZ @ 3 NONAME ; int RBTNotifier::Connect(void)
+	?StartNotifier@RBTNotifier@@QAEHVTUid@@ABVTDesC8@@@Z @ 4 NONAME ; int RBTNotifier::StartNotifier(class TUid, class TDesC8 const &)
+	?StartNotifierAndGetResponse@RBTNotifier@@QAEXAAVTRequestStatus@@VTUid@@ABVTDesC8@@AAVTDes8@@@Z @ 5 NONAME ; void RBTNotifier::StartNotifierAndGetResponse(class TRequestStatus &, class TUid, class TDesC8 const &, class TDes8 &)
+	?UpdateNotifier@RBTNotifier@@QAEHVTUid@@ABVTDesC8@@AAVTDes8@@@Z @ 6 NONAME ; int RBTNotifier::UpdateNotifier(class TUid, class TDesC8 const &, class TDes8 &)
+	?Version@RBTNotifier@@QAE?AVTVersion@@XZ @ 7 NONAME ; class TVersion RBTNotifier::Version(void)
+	?CancelPairDevice@RBTNotifier@@QAEXXZ @ 8 NONAME ; void RBTNotifier::CancelPairDevice(void)
+	?PairDevice@RBTNotifier@@QAEXABV?$TPckgBuf@VTBTDevAddr@@@@JAAVTRequestStatus@@@Z @ 9 NONAME ; void RBTNotifier::PairDevice(class TPckgBuf<class TBTDevAddr> const &, long, class TRequestStatus &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifclient/eabi/btnotifclientu.def	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,12 @@
+EXPORTS
+	_ZN11RBTNotifier13StartNotifierE4TUidRK6TDesC8 @ 1 NONAME
+	_ZN11RBTNotifier14CancelNotifierE4TUid @ 2 NONAME
+	_ZN11RBTNotifier14UpdateNotifierE4TUidRK6TDesC8R5TDes8 @ 3 NONAME
+	_ZN11RBTNotifier27StartNotifierAndGetResponseER14TRequestStatus4TUidRK6TDesC8R5TDes8 @ 4 NONAME
+	_ZN11RBTNotifier7ConnectEv @ 5 NONAME
+	_ZN11RBTNotifier7VersionEv @ 6 NONAME
+	_ZN11RBTNotifierC1Ev @ 7 NONAME
+	_ZN11RBTNotifierC2Ev @ 8 NONAME
+	_ZN11RBTNotifier10PairDeviceERK8TPckgBufI10TBTDevAddrElR14TRequestStatus @ 9 NONAME
+	_ZN11RBTNotifier16CancelPairDeviceEv @ 10 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifclient/group/bld.inf	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,40 @@
+/*
+* ============================================================================
+*  Name        : bld.inf
+*  Part of     : bluetoothengine / bluetoothengine
+*  Description : Build information file for bluetoothengine subsystem
+*  Version     : %version: 1 %
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.1.1
+*/
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/btnotifclient.h  |../../../inc/btnotifclient.h
+../rom/btnotifclient.iby  CORE_MW_LAYER_IBY_EXPORT_PATH(btnotifclient.iby)
+PRJ_MMPFILES
+
+btnotifclient.mmp
+
+PRJ_TESTMMPFILES
+
+../tsrc/btnotifclienttest/group/btnotifclienttest.mmp
+
+PRJ_TESTEXPORTS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifclient/group/btnotifclient.mmp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,43 @@
+/*
+* ============================================================================
+*  Name        : btnotifclient.mmp
+*  Part of     : bluetoothengine / btnotifclient
+*  Description : Project definition file for project btnotifclient
+*  Version     : %version: 1 %
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.1
+*/
+
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+TARGET                  btnotifclient.dll
+TARGETTYPE              DLL
+UID                     0x1000008d 0x20026FF6
+
+CAPABILITY              CAP_GENERAL_DLL
+VENDORID                VID_DEFAULT
+
+SOURCEPATH              ../src
+SOURCE                  btnotifclient.cpp
+
+USERINCLUDE             ../inc
+
+MW_LAYER_SYSTEMINCLUDE
+
+SYSTEMINCLUDE           ../../inc
+
+LIBRARY                 euser.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifclient/inc/btnotifclient.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,179 @@
+/*
+* ============================================================================
+*  Name        : btnotifclient.h
+*  Part of     : bluetoothengine / btnotifclient
+*  Description : Session class for client-server interaction with btnotifserver.
+*
+*  Copyright © 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef RBTNOTIFCLIENT_H
+#define RBTNOTIFCLIENT_H
+
+#include <e32base.h>
+#include <btmanclient.h>
+
+/**
+ *  A handle to a session with the Bluetooth notifier server for showing
+ *  Bluetooth-related notifications to the user.
+ *
+ *  ?more_complete_description
+ *  @code
+ *   ?good_class_usage_example(s)
+ *  @endcode
+ *
+ *  @lib ?library
+ *  @since Symbian^4
+ */
+NONSHARABLE_CLASS( RBTNotifier ) : public RSessionBase
+    {
+public:
+
+    /**
+     * Constructor.
+     *
+     * @since Symbian^4
+     */
+    IMPORT_C RBTNotifier();
+    
+    /**
+     * Connect to the Bluetooth notifier server.
+     *
+     * @since Symbian^4
+     * @return KErrNone, if successful. Otherwise one of 
+     *         the system-wide error codes.
+     */
+    IMPORT_C TInt Connect();
+
+    /**
+     * Get the version information about the client.
+     *
+     * @since Symbian^4
+     * @return The version of the client-server interface implemented by this client.
+     */
+    IMPORT_C TVersion Version();
+
+    /**
+     * Requests the extended notifier server to start the notifier
+     * identified by the specified UID. The request is synchronous; 
+     * the call returns when the request is complete.
+     *
+     * @since Symbian^4
+     * @param aNotifierUid The UID identifying the notifier. This is 
+     *        the same UID as used with RNotifier for the same purpose.
+     * @param aBuffer Data that can be passed to the notifier; the format and 
+     *        meaning of this depends on the notifier.
+     * @return KErrNone, if successful; KErrNotFound, if there 
+     *         is no notifier matching the specified UID; otherwise 
+     *         one of the other system-wide error codes.
+     */
+    IMPORT_C TInt StartNotifier( TUid aNotifierUid, const TDesC8& aBuffer );
+
+    /**
+     * Requests the extended notifier server to start the notifier 
+     * identified by the specified UID. This is an asynchronous request.
+     *
+     * @since Symbian^4
+     * @param aRs The request status. On request completion, contains KErrNone, 
+     *        if successful; KErrNotFound, if there is no notifier matching the 
+     *        specified UID; KErrCancel, if the notifier was cancelled through 
+     *        RBTNotifier::CancelNotifier; otherwise, one of the other system 
+     *        wide error codes.
+     * @param aNotifierUid The UID identifying the notifier. This is 
+     *        the same UID as used with RNotifier for the same purpose.
+     * @param aBuffer Data that can be passed to the notifier; the format and 
+     *        meaning of this depends on the notifier.
+     * @param aResponse Response data from the notifier; the format and meaning 
+     *        of this depends on the notifier.
+     */
+    IMPORT_C void StartNotifierAndGetResponse( TRequestStatus& aRs, 
+                TUid aNotifierUid, const TDesC8& aBuffer, TDes8& aResponse );
+
+    /**
+     * Requests the Bluetooth notifier server to cancel the notifier 
+     * identified by the specified UID. The request is synchronous; 
+     * the call returns when the request is complete.
+     *
+     * @since Symbian^4
+     * @param aNotifierUid The UID identifying the notifier. This is 
+     *        the same UID as used with RNotifier for the same purpose.
+     * @return KErrNone, if successful; KErrNotFound, if there 
+     *         is no notifier matching the specified UID; otherwise 
+     *         one of the other system-wide error codes.
+     */
+    IMPORT_C TInt CancelNotifier( TUid aNotifierUid );
+
+    /**
+     * Requests the Bluetooth notifier server to update the active
+     * notifier identified by the specified UID, with the data supplied.
+     * The request is synchronous; the call returns when the request is complete.
+     *
+     * @since Symbian^4
+     * @param aNotifierUid The UID identifying the notifier. This is 
+     *        the same UID as used with RNotifier for the same purpose.
+     * @param aBuffer Data that can be passed to the notifier; the format and 
+     *        meaning of this depends on the notifier.
+     * @param aResponse Response data from the notifier; the format and meaning 
+     *        of this depends on the notifier.
+     * @return KErrNone, if successful; KErrNotFound, if there 
+     *         is no notifier matching the specified UID; otherwise 
+     *         one of the other system-wide error codes.
+     */
+    IMPORT_C TInt UpdateNotifier( TUid aNotifierUid, 
+                const TDesC8& aBuffer, TDes8& aResponse );
+
+    /**
+     * Requests the Bluetooth notifier server to pair with the device 
+     * specified by the given Bluetooth device address.
+     * The request is asynchronous; Use CancelPairing() to cancel
+     * an outstanding pairing request.
+     *
+     * @since Symbian^4
+     * @param aAddr The address of the remote device to perform pairing with.
+     * @param aDeviceClass the CoD of the remote device.
+     * @param aStatus The request status. On request completion, contains KErrNone, 
+     *        if successful; KErrCancel, if the notifier was cancelled through 
+     *        RBTNotifier::CancelPair; otherwise, one of the other system 
+     *        wide error codes.
+     */
+    IMPORT_C void PairDevice( const TBTDevAddrPckgBuf& aAddr, TInt32 aDeviceClass,
+                TRequestStatus& aStatus );
+    
+    /**
+     * Requests the Bluetooth notifier server to cancel the current pairing 
+     * request. The request is synchronous; 
+     * the call returns when the request is complete.
+     * 
+     * If this request is issued when the Bluetooth
+     * notifier server has completed pairing with the device, the pairing 
+     * will not be un-done. That is, the device will not be unpaired. 
+     *
+     * @since Symbian^4
+     */
+    IMPORT_C void CancelPairDevice();
+
+private:
+
+private: // data
+
+    /**
+     * ?description_of_member
+     */
+//    ?type ?member_name;
+
+    };
+
+#endif // RBTNOTIFCLIENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifclient/rom/btnotifclient.iby	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Image description file for project btnotif
+*
+*/
+
+
+#ifndef BTNOTIFCLIENT_IBY
+#define BTNOTIFCLIENT_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+#ifdef __BT
+
+file=ABI_DIR/BUILD_DIR/btnotifclient.dll SHARED_LIB_DIR/btnotifclient.dll
+
+#endif // __BT
+
+#endif // BTNOTIFCLIENT_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifclient/src/btnotifclient.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,167 @@
+/*
+* ============================================================================
+*  Name        : btnotifclient.cpp
+*  Part of     : bluetoothengine / btnotifclient
+*  Description : Session class for client-server interaction with btnotifserver.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.1
+*/
+
+#include "btnotifclient.h"
+#include "btnotifclientserver.h"
+
+
+// ---------------------------------------------------------------------------
+// start btnotif server from client.
+// ---------------------------------------------------------------------------
+//
+TInt StartBTNotifSrv()
+    {
+    const TUidType serverUid( KNullUid, KNullUid, KBTNotifServerUid3 );
+        // Create a new server process. Simultaneous launching of two processes 
+        // should be detected when the second one attempts to create the server 
+        // object, failing with KErrAlreadyExists.
+    RProcess server;
+    TInt err = server.Create( KBTNotifServerName, KNullDesC, serverUid );
+    if( err != KErrNone )
+        {
+        return err;
+        }
+    TRequestStatus status;
+    server.Rendezvous( status );
+    if( status != KRequestPending )
+        {
+        server.Kill( KErrCancel );  // Abort startup
+        }
+    else
+        {
+        server.Resume();
+        }
+    User::WaitForRequest( status ); // Wait for start or death
+    err = status.Int();
+    if( server.ExitType() == EExitPanic )
+        {
+        // The server actually panicked; inform the client.
+        err = KErrDied;
+        }
+    server.Close();
+    return err;
+    }
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C RBTNotifier::RBTNotifier()
+:   RSessionBase()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Return the client-server version number we implement.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TVersion RBTNotifier::Version()
+    {
+    return TVersion( KBTNotifServerVersionMajor, KBTNotifServerVersionMinor, 
+                KBTNotifServerVersionBuild );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Connect to the notifier server. Start the server if necessary.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RBTNotifier::Connect()
+    {
+    TInt err = CreateSession( KBTNotifServerName, Version() );
+    if( err == KErrNotFound || err == KErrServerTerminated )
+        {
+        err = StartBTNotifSrv();
+        if( err == KErrNone || err == KErrAlreadyExists )
+            {
+            err = CreateSession( KBTNotifServerName, Version() );
+            }
+        }
+    return err;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Start the specified notifier, synchronous call.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RBTNotifier::StartNotifier( TUid aNotifierUid, const TDesC8& aBuffer )
+    {
+    return SendReceive( EBTNotifStartSyncNotifier,
+                TIpcArgs( (TInt) aNotifierUid.iUid, &aBuffer ) );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Start the specified notifier, asynchronous call.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void RBTNotifier::StartNotifierAndGetResponse( TRequestStatus& aRs,
+    TUid aNotifierUid, const TDesC8& aBuffer, TDes8& aResponse )
+    {
+    SendReceive( EBTNotifStartAsyncNotifier,
+                TIpcArgs( (TInt) aNotifierUid.iUid, &aBuffer, &aResponse ), aRs );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Cancel the specified notifier.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RBTNotifier::CancelNotifier( TUid aNotifierUid )
+    {
+    return SendReceive( EBTNotifCancelNotifier, TIpcArgs( (TInt) aNotifierUid.iUid ) );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Update the specified notifier, synchronous call.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RBTNotifier::UpdateNotifier( TUid aNotifierUid, 
+    const TDesC8& aBuffer, TDes8& aResponse )
+    {
+    return SendReceive( EBTNotifUpdateNotifier,
+                TIpcArgs( (TInt) aNotifierUid.iUid, &aBuffer, &aResponse ) );
+    }
+
+// ---------------------------------------------------------------------------
+// Issue a pairing request. asynchronous call.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void RBTNotifier::PairDevice( const TBTDevAddrPckgBuf& aDevice, 
+    TInt32 aDeviceClass, TRequestStatus& aStatus )
+    {
+    SendReceive( EBTEngPairDevice,
+                TIpcArgs( (TInt) EBTEngPairDevice, &aDevice, aDeviceClass ), aStatus );
+    }
+
+// ---------------------------------------------------------------------------
+// Cancel an ongoing pair request.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void RBTNotifier::CancelPairDevice()
+    {
+    (void) SendReceive( EBTEngCancelPairDevice );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/inc/bluetoothnotification.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,262 @@
+/*
+* ============================================================================
+*  Name        : bluetoothnotification.h
+*  Part of     : bluetoothengine / btnotif
+*  Description : Class for managing an actual user notification or query.
+*                It hides UI framework-specifics in a private class.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef BLUETOOTHNOTIFICATION_H
+#define BLUETOOTHNOTIFICATION_H
+
+#include <e32base.h>
+#include <hb/hbcore/hbdevicedialogsymbian.h>
+#include "bluetoothdevicedialogs.h"
+#include "btnotificationresult.h"
+#include "bluetoothtrace.h"
+
+class CBTNotificationManager;
+class CHbSymbianVariantMap;
+
+/**
+ *  CBluetoothNotification manages and controls notifications.
+ *  
+ *  @since Symbian^4
+ */
+NONSHARABLE_CLASS( CBluetoothNotification ) : public CBase,
+                                              public MHbDeviceDialogObserver
+    {
+
+
+public:
+
+    /**
+     * Two-phased constructor.
+     * @param aManager Reference to the notification manager.
+     * @param aObserver Reference to our observer.
+     */
+    static CBluetoothNotification* NewL( CBTNotificationManager* aManager );
+
+    /**
+    * Destructor.
+    */
+    virtual ~CBluetoothNotification();
+
+    /**
+     * Sets the receiver of callbacks.
+     *
+     * @since Symbian^4
+     * @param aObserver Pointer to the callback interface.
+     */
+    inline void SetObserver( MBTNotificationResult* aObserver )
+        { iObserver = aObserver; }
+
+    /**
+     * Clears the receiver of callbacks.
+     *
+     * @since Symbian^4
+     */
+    inline void RemoveObserver()
+        { iObserver = NULL; }
+
+    /**
+     * Reset the notification.
+     *
+     * @since Symbian^4
+     */
+    void Reset();
+
+    /**
+     * Getter for the notification type.
+     *
+     * @since Symbian^4
+     * @return Notification type.
+     */
+    inline TBluetoothDialogParams::TBTDialogType NotificationType()
+        { return iType; }
+
+    /**
+     * Getter for the resource id.
+     *
+     * @since Symbian^4
+     * @return Resource identifier.
+     */
+    inline TBTDialogResourceId ResourceId()
+        { return iResourceId; }
+
+    inline CHbSymbianVariantMap* Data()
+         { return iNotificationData; }
+    
+    /**
+     * Sets the type of notification (query, note, etc).
+     *
+     * @since Symbian^4
+     * @param aType The type of the notification.
+     * @param aResourceId The id of the resource to be shown.
+     * @return Error code
+     */
+    inline void SetNotificationType( TBluetoothDialogParams::TBTDialogType aType,
+                TBTDialogResourceId aResourceId )
+            { iType = aType; iResourceId = aResourceId; }
+
+    /**
+     * Sets the data to be shown to the user.
+     *
+     * @since Symbian^4
+     * @param aType Identifies the type of data parameter to be set.
+     * @param aData Additional descriptor data to be shown in the dialog.
+     * @return Error code
+     */
+    TInt SetData( TInt aDataType, const TDesC& aData );
+
+    /**
+     * Sets the data to be shown to the user.
+     *
+     * @since Symbian^4
+     * @param aType Identifies the type of data parameter to be set.
+     * @param aData Additional integer data to be shown in the dialog.
+     * @return Error code
+     */
+    TInt SetData( TInt aDataType, TInt aData );
+
+    /**
+     * Updates the data to be shown to the user.
+     *
+     * @since Symbian^4
+     * @param ?arg1 ?description
+     * @return Error code
+     */
+    TInt Update( const TDesC& aData =KNullDesC );
+
+    /**
+     * Show the notification, which means that it 
+     * is added to the queue.
+     *
+     * @since Symbian^4
+     * @param ?arg1 ?description
+     * @return Error code
+     */
+    TInt Show();
+
+    /**
+     * Stop showing the notification.
+     *
+     * @since Symbian^4
+     * @param ?arg1 ?description
+     * @return Error code
+     */
+    TInt Close();
+
+
+private:
+
+    CBluetoothNotification( CBTNotificationManager* aManager );
+
+    void ConstructL();
+    
+    /**
+     * Sets the data to be shown to the user, leaves on error.
+     *
+     * @since Symbian^4
+     * @param aType Identifies the type of data parameter to be set.
+     * @param aData Additional descriptor data to be shown in the dialog.
+     */
+    void SetDataL( TInt aType, const TDesC& aData );
+
+    /**
+     * Sets the data to be shown to the user, leaves on error.
+     *
+     * @since Symbian^4
+     * @param aType Identifies the type of data parameter to be set.
+     * @param aData Additional integer data to be shown in the dialog.
+     */
+    void SetDataL( TInt aType, TInt aData );
+    
+    /**
+     * From MHbDeviceDialogObserver.
+     * This callback is called when data is received from a device dialog.
+     *
+     * @since Symbian^4
+     * @param aData contains data from the dialog plugin.
+     */
+    virtual void DataReceived( CHbSymbianVariantMap& aData );
+
+    /**
+     * From MHbDeviceDialogObserver.
+     * This callback is called when a device dialog is closed. Any data sent by
+     * the dialog is indicated by the dataReceived() callback. If no observer is
+     * set in CHbDeviceDialog::Show the latest data can be retrieved with
+     * CHbDeviceDialog::receivedData().
+     *
+     * @since Symbian^4
+     * @param aCompletionCode gives the result of the dialog completion. Code can be
+     *                        either Symbian error code or device dialog error code.
+     */
+    virtual void DeviceDialogClosed( TInt aCompletionCode );
+
+#ifdef BLUETOOTHTRACE_ENABLED
+    void debugHbSymbianVariantMap( CHbSymbianVariantMap& aData);
+#endif // BLUETOOTHTRACE_ENABLED
+
+private: // data
+
+    /**
+     * The type of notification currently showing.
+     */
+    TBluetoothDialogParams::TBTDialogType iType;
+
+    /**
+     * The id of the resource (string identifier)
+     * of the currently showing notification.
+     */
+    TBTDialogResourceId iResourceId;
+
+    /**
+     * Reference to the queue manager.
+     * Not own.
+     */
+    CBTNotificationManager* iManager;
+
+    /**
+     * Reference to the receiver of the results.
+     * Not own.
+     */
+    MBTNotificationResult* iObserver;
+    
+    /**
+     * The data to be shown to the user in a device dialog.
+     * Own.
+     */
+    CHbSymbianVariantMap* iNotificationData;
+
+    /**
+     * Buffer for receiving return data from the notifier.
+     */
+    CHbSymbianVariantMap* iReturnData;
+
+    /**
+     * Session object with the notification server.
+     * Own.
+     */
+    CHbDeviceDialogSymbian *iDialog;
+    
+    BTUNITTESTHOOK
+
+    };
+
+#endif // BLUETOOTHNOTIFICATION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/inc/btnotifconnection.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,490 @@
+/*
+* ============================================================================
+*  Name        : btnotifconnection.h
+*  Part of     : bluetoothengine / btnotif
+*  Description : Class for observing events of a single connection, and for 
+*                managing any user notifications related to the connection.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef BTNOTIFCONNECTION_H
+#define BTNOTIFCONNECTION_H
+
+#include <bt_sock.h>
+#include <btservices/btsimpleactive.h>
+#include <btengdevman.h>
+#include <btengconstants.h>
+
+#include "bluetoothnotification.h"
+
+#include "bluetoothtrace.h"
+
+class CBTNotifConnectionTracker;
+class CBTNotifPairingHelper;
+
+/**
+ * Utility function for getting the name of a device to display.
+ *
+ * @since Symbian^4
+ * @param aName On return, will hold the device name to display.
+ * @param aDevice Data dtructure holding the device record.
+ */
+void GetDeviceNameL( TBTDeviceName& aName, const CBTDevice& aDevice );
+
+
+/**
+ *  CBTNotifConnection handles the connection information and operations 
+ *  related to remote devices.
+ *  
+ *  @since Symbian^4
+ */
+NONSHARABLE_CLASS( CBTNotifConnection ) : public CBase,
+                                          public MBTNotificationResult,
+                                          public MBtSimpleActiveObserver,
+                                          public MBTEngDevManObserver
+    {
+
+public:
+
+    /**  Enumeration for the current active operation. */
+    enum TOperation
+        {
+        EIdle,
+        EAuthorizing,
+        EPairing,
+        EBonding,
+        EAdditionalNotes,   // Marks the queries and notes which follow
+                            // notifier requests, but are done after completing
+                            // the actual notifier message
+        EBlocking,
+        EInternalOperations,    // Marks internal operations such as registry update.
+        EReadingRegistry,
+        EUpdatingRegistry
+        };
+
+    /**  Array of BT profiles. */
+    typedef RArray<TBTProfile> RBTProfileArray;
+
+    /**
+     * Two-phased constructor.
+     * @param aAddr Address of the remote device for this connection.
+     * @param aTracker Pointer to our parent
+     */
+    static CBTNotifConnection* NewLC( const TBTDevAddr& aAddr, 
+                CBTNotifConnectionTracker* aTracker );
+
+    /**
+    * Destructor.
+    */
+    virtual ~CBTNotifConnection();
+
+    /**
+     * Get the address of the remote device for this connection.
+     *
+     * @since Symbian^4
+     * @return The BD_ADDR.
+     */
+    inline const TBTDevAddr& Address() const
+        { return iAddr; }
+
+    /**
+     * Get the device record of the remote device for this connection.
+     *
+     * @since Symbian^4
+     * @return The CBTDevice device record.
+     */
+    inline CBTDevice* BTDevice() const
+        { return iDevice; }
+
+    /**
+     * Get the current operation for this connection.
+     *
+     * @since Symbian^4
+     * @param aProfile The profile identifying the service.
+     */
+    inline CBTNotifConnection::TOperation CurrentOperation() const
+        { return iCurrentOp; }
+
+    /**
+     * Checks if we have any outstanding request, and handle the next
+     * in line. Also checks the link state, and informs the tracker
+     * if we have finished processing and the link is down.
+     *  
+     * @since Symbian^4
+     */
+    void CheckNextOperationL();
+
+    /**
+     * Completes the first outstanding client request and removes 
+     * it from the queue.
+     *  
+     * @since Symbian^4
+     * @param aReason The reason code to complete the message with.
+     * @param aReply Data to write back to the client.
+     */
+    void CompleteClientRequest( TInt aReason, const TDesC8& aReply );
+
+    /**
+     * Distinguish the type request of this connection and queue it
+     * or handle it.
+     *  
+     * @since Symbian^4
+     * @param aParams The parameters for this request from the client.
+     * @param aMessage The message from the client.
+     */
+    void HandleNotifierRequestL( const TDesC8& aParams, const RMessage2& aMessage );
+
+    /**
+     * Update an outstanding request for this connection.
+     *  
+     * @since Symbian^4
+     * @param aParams The parameters of the original request from the client.
+     * @param aMessage The update message from the client.
+     */
+    void HandleNotifierUpdateL( const TDesC8& aParams, const RMessage2& aMessage );
+
+    /**
+     * Cancel an outstanding request for this connection.
+     *  
+     * @since Symbian^4
+     * @param aMessage The message from the client. (Temp! find better way!)
+     */
+    void CancelNotifierRequestL( const RMessage2& aMessage );
+
+    /**
+     * Start a bonding operation with the remote device.
+     *
+     * @since Symbian^4
+     * @param aMessage The message from the client.
+     */
+    void StartBondingL( const RMessage2& aMessage );
+
+    /**
+     * Cancel an ongoing bonding operation with the remote device.
+     *
+     * @since Symbian^4
+     */
+    void CancelBondingL();
+
+    /**
+     * The pairing handler has completed a pairing operation. If this was part 
+     * of a bonding procedure then this will complete the client request.
+     *
+     * @since Symbian^4
+     */
+    void PairingCompleted();
+
+    /**
+     * Process a new pairing result, and determine if we need to show
+     * anything to the user.
+     *
+     * @since Symbian^4
+     * @param aError Result of the pairing operation.
+     */
+    void PairingResult( TInt aError );
+
+    /**
+     * A service-level connection has been made with the device 
+     * observed by this instance. The appropriate notification 
+     * will be shown to the user.
+     *
+     * @since Symbian^4
+     * @param aProfile The profile identifying the service.
+     */
+    void ServiceConnectedL( TBTProfile aProfile );
+
+    /**
+     * A service-level connection has disconnected from the device 
+     * observed by this instance. The appropriate notification 
+     * will be shown to the user.
+     *
+     * @since Symbian^4
+     * @param aProfile The profile identifying the service.
+     */
+    void ServiceDisconnectedL( TBTProfile aProfile );
+
+    /**
+     * Ask the user if he/she wants to block future connection requests.
+     *
+     * @since Symbian^4
+     */
+    void LaunchBlockingQueryL();
+
+    /**
+     * Modify the record for the remote device in BTRegistry, with the 
+     * changes already made in the local record.
+     *
+     * @since Symbian^4
+     */
+    void UpdateRegistryEntryL();
+    
+    /**
+     * Modify the record for the remote device in BTRegistry, if 
+     * aTrusted == true, then update trusted status after reading device 
+     * info from registry
+     *
+     * @since Symbian^4
+     */
+     void UpdateRegistryEntryL(TBool aTrusted);
+    
+// from base class MBTNotificationResult
+
+    /**
+     * From MBTNotificationResult.
+     * Handle an intermediate result from a user query.
+     * This ffunction is called if the user query passes information
+     * back before it has finished i.e. is dismissed. The final acceptance/
+     * denial of a query is passed back in MBRNotificationClosed.
+     *
+     * @since Symbian^4
+     * @param aData the returned data. The actual format 
+     *              is dependent on the actual notifier.
+     */
+    virtual void MBRDataReceived( CHbSymbianVariantMap & aData );
+
+    /**
+     * From MBTNotificationResult.
+     * The notification is finished. The resulting data (e.g. user input or
+     * acceptance/denial of the query) is passed back here.
+     *
+     * @since Symbian^4
+     * @param aErr KErrNone or one of the system-wide error codes.
+     * @param aData the returned data. The actual format 
+     *              is dependent on the actual notifier.
+     */
+    virtual void MBRNotificationClosed( TInt aError, const TDesC8& aData );
+
+// from base class MBtSimpleActiveObserver
+
+    /**
+     * From MBtSimpleActiveObserver.
+     * Callback to notify that an outstanding request has completed.
+     *
+     * @since Symbian^4
+     * @param aActive The active object helper that completed this request.
+     * @param aStatus The status of the completed request.
+     */
+    virtual void RequestCompletedL( CBtSimpleActive* aActive, TInt aStatus );
+
+    /**
+     * From MBtSimpleActiveObserver.
+     * Callback for handling cancelation of an outstanding request.
+     *
+     * @since Symbian^4
+     * @param aId The ID that identifies the outstanding request.
+     */
+    virtual void CancelRequest( TInt aRequestId );
+
+    /**
+     * Callback to notify that an error has occurred in RunL.
+     *
+     * @param aActive Pointer to the active object that completed.
+     * @param sError The error occured in RunL
+     */
+    virtual void HandleError( CBtSimpleActive* aActive, 
+                                        TInt aError );
+    
+// from base class MBTEngDevmanObserver
+
+    /**
+     * From MBTEngDevManObserver.
+     * Indicates to the caller that adding, deleting or modifying a device 
+     * has completed.
+     * When this function is called, new commands can be issued to the 
+     * CBTEngDevMan API immediately.
+     *
+     * @since  S60 v3.2
+     * @param  aErr Status information, if there is an error.
+     */
+    virtual void HandleDevManComplete( TInt aErr );
+    
+    /**
+     * From MBTEngDevManObserver.
+     * Indicates to the caller that getting a device from registry
+     * has completed.
+     *
+     * @param aErr Status information, if there is an error.
+     * @param aDeviceArray Array of devices that match the given criteria 
+     *                     (the array provided by the caller).
+     */
+    virtual void HandleGetDevicesComplete( 
+            TInt err, CBTDeviceArray* deviceArray );
+
+private:
+
+    /**
+     * C++ default constructor.
+     */
+    CBTNotifConnection( const TBTDevAddr& aAddr,
+                CBTNotifConnectionTracker* aTracker );
+
+    /**
+     * Symbian 2nd-phase constructor.
+     */
+    void ConstructL();
+
+    /**
+     * Get a notification and configure it according to the current operation.
+     *
+     * @since Symbian^4
+     * @param aType The notification type.
+     * @param aResourceId Identifier for the resource to display.
+     */
+    void PrepareNotificationL( TBluetoothDialogParams::TBTDialogType aType,
+                TBTDialogResourceId aResourceId );
+
+    /**
+     * Handle the result from a notification that is finished.
+     *
+     * @since Symbian^4
+     * @param aErr KErrNone or one of the system-wide error codes.
+     * @param aData The returned data. The actual format 
+     *              is dependent on the actual notifier.
+     */
+    void NotificationClosedL( TInt aError, const TDesC8& aData );
+
+    /**
+     * Handle a request for authorization of this connection.
+     *
+     * @since Symbian^4
+     * @param aParams The parameters for this request from the client.
+     */
+    void HandleAuthorizationReqL( const TDesC8& aParams );
+
+    /**
+     * Process the user input and complete the outstanding authorization request.
+     *
+     * @since Symbian^4
+     * @param aError The result off the notification.
+     * @param aData The data returned from the notification dialog.
+     */
+    void CompleteAuthorizationReqL( TInt aError, const TDesC8& aData );
+
+    /**
+     * Process the user input for blocking a device.
+     *
+     * @since Symbian^4
+     * @param aError The result off the notification.
+     * @param aData The data returned from the notification dialog.
+     */
+    void CompleteBlockingReqL( TInt aError, const TDesC8& aData );
+    
+    /**
+     * Fetch device from registry
+     *
+     * @since Symbian^4
+     * @param addr BT address of device to fetch from registry
+     */
+    void GetDeviceFromRegistry( const TBTDevAddr &addr );
+
+private: // data
+
+    /**
+     * The current operation we are carrying out.
+     */
+    TOperation iCurrentOp;
+
+    /**
+     * Address of the remote device, identifying this connection.
+     */
+    TBTDevAddr iAddr;
+
+    /**
+     * Package to receive updates of the physical link state.
+     */
+    TBTBasebandEvent iBasebandEvent;
+
+    /**
+     * Queue of handles (identifier) of client messages we have been requested to work on.
+     */
+    RArray<TInt> iMsgHandleQ;
+
+    /**
+     * Array of accepted profile connections (as known here).
+     */
+    RBTProfileArray iAcceptedConnections;
+
+    /**
+     * Array of rejected profile connections (as known here).
+     */
+    RBTProfileArray iDeniedConnections;
+
+    /**
+     * Handle to observe and control the baseband connection.
+     */
+    RBTPhysicalLinkAdapter iPhyLink;
+
+    /**
+     * Subsession with BT registry.
+     */
+    RBTRegistry iRegistry;
+
+    /**
+     * Details of the remote device.
+     * Own.
+     */
+    CBTDevice* iDevice;
+
+    /**
+     * Details of the remote device as retrieved from BT registry.
+     * Own.
+     */
+    CBTRegistryResponse* iRegistryResponse;
+
+    /**
+     * helper for modifying registry.
+     * Own.
+     */
+    CBTEngDevMan* iDevMan;
+
+    /**
+     * Active object helper for observing physical link changes.
+     * Own.
+     */
+    CBtSimpleActive* iPhyActive;
+
+    /**
+     * Active object helper for observing BT registry changes.
+     * Own.
+     */
+    CBtSimpleActive* iRegActive;
+
+    /**
+     * Helper class for processing pairing-related operations.
+     * Own.
+     */
+    CBTNotifPairingHelper* iPairingHelper;
+
+    /**
+     * Pointer to an outstanding user interaction.
+     * Not own.
+     */
+    CBluetoothNotification* iNotification;
+
+    /**
+     * Pointer to our parent.
+     * Not own.
+     */
+    CBTNotifConnectionTracker* iTracker;
+    
+    CBTDeviceArray* iRegDevArray;  // used for retrieving devices from registry
+
+    BTUNITTESTHOOK
+
+    };
+
+#endif // BTNOTIFCONNECTION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/inc/btnotifconnectiontracker.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,396 @@
+/*
+* ============================================================================
+*  Name        : btnotifconnectiontracker.h
+*  Part of     : bluetoothengine / btnotif
+*  Description : Bluetooth connection tracker and manager.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef BTNOTIFCONNECTIONTRACKER_H
+#define BTNOTIFCONNECTIONTRACKER_H
+
+
+#include <e32property.h>
+#include <btmanclient.h>
+#include <bluetooth/pairing.h>
+#include <btengconnman.h>
+#include <btservices/btsimpleactive.h>
+#include "btnotifserver.h"
+
+class CBTNotifConnection;
+class CBTNotificationManager;
+class CbtnotifConnectionTrackerTest;
+
+
+
+/**
+ *  CBTNotifConnectionTracker keeps track of remote device connections
+ *  
+ *  @since Symbian^4
+ */
+NONSHARABLE_CLASS( CBTNotifConnectionTracker ) : public CBase,
+                                                 public MBluetoothPhysicalLinksNotifier,
+                                                 public MBTEngConnObserver,
+                                                 public MBtSimpleActiveObserver
+    {
+
+public:
+
+    /**
+     * Two-phased constructor.
+     * @param aServer Pointer to our parent
+     */
+    static CBTNotifConnectionTracker* NewL( CBTNotifServer* aServer );
+
+    /**
+     * Destructor.
+     */
+    virtual ~CBTNotifConnectionTracker();
+
+    /**
+     * Get a pointer to the btnotif server object.
+     *
+     * @since Symbian^4
+     * @return The server.
+     */
+    inline CBTNotifServer* Server() const
+        { return iServer; }
+
+    /**
+     * Get a pointer to the notification manager.
+     * This handle can be used for queueing notifications.
+     *
+     * @since Symbian^4
+     * @return The notification manager.
+     */
+    inline CBTNotificationManager* NotificationManager() const
+        { return iServer->NotificationManager(); }
+
+    /**
+     * Get the shared handle to BT registry server.
+     * This handle can be used for creating subsessions.
+     *
+     * @since Symbian^4
+     * @return Session with BT registry server.
+     */
+    inline RBTRegServ& RegistryServerSession()
+        { return iBTRegistrySession; }
+
+    /**
+     * Get the handle to the socket server.
+     * This handle can be used for creating subsessions.
+     *
+     * @since Symbian^4
+     * @return Session with the socket server.
+     */
+    inline RSocketServ& SocketServerSession()
+        { return iSockServ; }
+
+    /**
+     * Get the handle to the Bluetooth pairing server.
+     * This handle can be used for creating subsessions.
+     *
+     * @since Symbian^4
+     * @return Session with the socket server or NULL.
+     */
+    inline RBluetoothPairingServer* PairingServerSession()
+        { return iPairingServ; }
+
+    /**
+     * Processes a message from a notifier client related to connections.
+     *
+     * @since Symbian^4
+     * @param aMessage The message containing the details of the client request.
+     */
+    void DispatchNotifierMessageL( const RMessage2& aMessage );
+
+    /**
+     * Handle a request related to pairing.
+     *
+     * @since Symbian^4
+     * @param aUid The UID of the notification request.
+     */
+    void HandleBondingRequestL( const RMessage2& aMessage );
+
+    /**
+     * Handle a change in the number of physical connections.
+     * This also handles the case where a connection monitor has finished
+     * its processing, and is now ready for removal.
+     *
+     * @since Symbian^4
+     */
+    void HandleLinkCountChangeL();
+
+    /**
+     * Check repeated connection attempts, and record rejected/accepted queries.
+     *
+     * @since Symbian^4
+     * @param aDevice The details of the remote device for this query.
+     * @param aAccepted ETrue if the user accepted the request, EFalse if rejected.
+     * @return ETrue if the user should be queried for blocking this device,
+     *         EFalse if no query should be launched by the caller.
+     */
+    TBool UpdateBlockingHistoryL( const CBTDevice* aDevice, TBool aAccepted );
+
+// from base class MBluetoothPhysicalLinksNotifier
+    /** Notification of a requested connection coming up.
+     * If no error is reported, then that connection is ready for use.
+     * 
+     * @since Symbian^4
+     * @param aErr the returned error
+    */
+    virtual void HandleCreateConnectionCompleteL( TInt aErr );
+
+    /** Notification of a requested disconnection having taken place.
+     * If no error is reported, then that connection has been closed.
+     * 
+     * @since Symbian^4
+     * @param aErr the returned error
+    */
+    virtual void HandleDisconnectCompleteL( TInt aErr );
+
+    /** Notification that all existing connections have been torn down.
+     * If no error is reported, then there are no Bluetooth connections existing.
+     * 
+     * @since Symbian^4
+     * @param aErr the returned error
+    */
+    virtual void HandleDisconnectAllCompleteL( TInt aErr );
+
+// from base class MBTEngConnObserver
+
+    /**
+     * From MBTEngConnObserver.
+     * Indicates to the caller that a service-level connection has completed.
+     * This function is called for both incoming and outgoing connections. 
+     * This function is also called when an outgoing connection request fails, 
+     * e.g. with error code KErrCouldNotConnect.
+     * When this function is called, new commands can be issued to the 
+     * CBTEngConnMan API immediately.
+     *
+     * @since  S60 v3.2
+     * @param  aAddr The address of the remote device.
+     * @param  aErr Status information of the connection. KErrNone if the
+     *              connection succeeded, otherwise the error code with 
+     *              which the outgoing connection failed. KErrAlreadyExists 
+     *              is returned if there already is an existing connection 
+     *              for the selected profile(s), or otherwise e.g. 
+     *              KErrCouldNotConnect or KErrDisconnected for indicating 
+     *              connection problems.
+     * @param  aConflicts If there already is a connection for the selected 
+     *                    profile(s) of an outgoing connection request (the 
+     *                    selection is performed by BTEng), then this array 
+     *                    contains the bluetooth device addresses of the 
+     *                    remote devices for those connections.
+     */
+    virtual void ConnectComplete( TBTDevAddr& aAddr, TInt aErr, 
+                                   RBTDevAddrArray* aConflicts = NULL );
+
+    /**
+     * From MBTEngConnObserver.
+     * Indicates to the caller that a service-level connection has disconnected.
+     * When this function is called, new commands can be issued to the 
+     * CBTEngConnMan API immediately.
+     *
+     * @since  S60 v3.2
+     * @param  aAddr The address of the remote device.
+     * @param  aErr The error code with which the disconnection occured. 
+     *              KErrNone for a normal disconnection, 
+     *              or e.g. KErrDisconnected if the connection was lost.
+     */
+    virtual void DisconnectComplete( TBTDevAddr& aAddr, TInt aErr );
+
+// from base class MBtSimpleActiveObserver
+
+    /**
+     * From MBtSimpleActiveObserver.
+     * Callback to notify that an outstanding request has completed.
+     *
+     * @since Symbian^4
+     * @param aActive The active object helper that completed this request.
+     * @param aStatus The status of the completed request.
+     */
+    virtual void RequestCompletedL( CBtSimpleActive* aActive, TInt aStatus );
+
+    /**
+     * From MBtSimpleActiveObserver.
+     * Callback for handling cancelation of an outstanding request.
+     *
+     * @since Symbian^4
+     * @param aId The ID that identifies the outstanding request.
+     */
+    virtual void CancelRequest( TInt aRequestId );
+    
+    /**
+     * Callback to notify that an error has occurred in RunL.
+     *
+     * @param aActive Pointer to the active object that completed.
+     * @param sError The error occured in RunL
+     */
+    virtual void HandleError( CBtSimpleActive* aActive,
+                                        TInt aError );
+    
+private:
+
+    CBTNotifConnectionTracker( CBTNotifServer* aServer );
+
+    void ConstructL();
+
+    /**
+     * Parse a client message and find the correct connection handler
+     * for  dispatching a request.
+     * The parsed client message may be a request that is being served,
+     * in case a cancel request has come in. The opcode identifies the
+     * client message that is currently being dispatched.
+     *
+     * @since Symbian^4
+     * @param aOpcode The opcode of the original request.
+     * @param aMessage The client message to parse.
+     * @param aBuffer On return this contains the parameters read from the message.
+     * @return The connection that is identified by the address in the
+     *         message, or NULL if none found.
+     */
+    CBTNotifConnection* FindConnectionFromMessageL( TInt aOpcode, 
+                const RMessage2& aMessage, TDes8& aBuffer );
+
+    /**
+     * Parse the Bluetooth address from a request for some notification.
+     *
+     * @since Symbian^4
+     * @param aUid The UID of the notification request.
+     * @param aParamsBuf Descriptor containing the parameter read from the
+     *        client message.
+     * @return Bluetooth address parsed from the descriptor.
+     */
+    TBTDevAddr ParseAddressL( TInt aUid, const TDesC8& aParamsBuf ) const;
+
+    /**
+     * Find the handler of a specific connection.
+     *
+     * @since Symbian^4
+     * @param aAddr The remote device address identifying the connection.
+     * @return Connnection handler or NULL;
+     */
+    CBTNotifConnection* FindConnectionHandler( const TBTDevAddr& aAddr ) const;
+
+    /**
+     * Record and check the time between connection attempts.
+     *
+     * @since Symbian^4
+     * @param aAccepted ETrue if the user accepted the request, EFalse if rejected.
+     * @return EFalse if the attempt followed the previous attempt too fast,
+     *         otherwise ETrue.
+     */
+    TBool RecordConnectionAttempts( TBool aAccepted );
+
+private: // data
+
+    /**
+     * PubSub key for tracking the number of connections.
+     */
+    RProperty iLinkCount;
+
+// ToDo: remove this when registry notifications API is available!!
+    /**
+     * PubSub key for tracking registry changes.
+     */
+    RProperty iRegistryChange;
+
+    /**
+     * Helper active object for observing the link count.
+     * Own.
+     */
+    CBtSimpleActive* iRegistryActive;
+// End ToDo
+
+    /**
+     * Array of pointers to observers of individual connections.
+     */
+    RPointerArray<CBTNotifConnection> iConnArray;
+//    RHashMap<TBTDevAddr,CBTNotifConnection*> iConnArray;
+
+    /**
+     * Time of the last denied connection attempt.
+     */
+    TInt64 iLastReject;
+
+    /**
+     * Array of device addresses that the user has denied access.
+     */
+    RArray<TBTDevAddr> iDeniedRequests;
+
+    /**
+     * Single session with BTRegistry, to be used for subsessions.
+     */
+    RBTRegServ iBTRegistrySession;
+
+    /**
+     * Single session with the socket server, to be used for subsessions.
+     */
+    RSocketServ iSockServ;
+
+    /**
+     * Address placeholder for receiving secure simple pairing results.
+     */
+    TBTDevAddr iSspResultAddr;
+
+    /**
+     * Session with pairing server for receiving secure simple pairing results.
+     */
+    RBluetoothPairingResult iSspResultSession;
+
+    /**
+     * Single session with the pairing server, to be used for subsessions.
+     * Own.
+     */
+    RBluetoothPairingServer* iPairingServ;
+
+    /**
+     * Object for managing the piconet.
+     * Own.
+     */
+    CBTEngConnMan* iConnMan;
+
+    /**
+     * Object for managing the piconet.
+     * Own.
+     */
+    CBluetoothPhysicalLinks* iPhyLinks;
+
+    /**
+     * Helper active object for observing the link count.
+     * Own.
+     */
+    CBtSimpleActive* iLinkCountActive;
+
+    /**
+     * Helper active object for receiving secure simple pairing results.
+     * Own.
+     */
+    CBtSimpleActive* iSspResultActive;
+
+    /**
+     * Reference to our parent the server class.
+     * Not own.
+     */
+    CBTNotifServer* iServer;
+
+    BTUNITTESTHOOK
+
+    };
+
+#endif // BTNOTIFCONNECTIONTRACKER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/inc/btnotifdeviceselector.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,171 @@
+/*
+* ============================================================================
+*  Name        : btnotifdeviceselector.h
+*  Part of     : BTProximity / BTProximity
+*  Description : Class for tracking Bluetooth settings, and also for 
+*                handling notes unrelated to specific connection.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef BTNOTIFDEVICESELECTOR_H
+#define BTNOTIFDEVICESELECTOR_H
+
+
+#include <e32base.h>
+#include <btengsettings.h>
+#include <btservices/devdiscoveryobserver.h>
+#include "bluetoothnotification.h"
+
+class CBTNotifServer;
+class CAdvanceDevDiscoverer;
+class CBtDevExtension;
+
+/**
+ *  ?one_line_short_description
+ *  ?more_complete_description
+ *
+ *  @code
+ *   ?good_class_usage_example(s)
+ *  @endcode
+ *
+ *  @lib ?library
+ *  @since S60 ?S60_version *** for example, S60 v3.0
+ */
+NONSHARABLE_CLASS( CBTNotifDeviceSelector ) : 
+        public CBase,
+        public MBTNotificationResult,
+        public MDevDiscoveryObserver
+    {
+
+public:
+
+    /**
+     * Two-phased constructor.
+     * @param aServer Pointer to our parent
+     */
+    static CBTNotifDeviceSelector* NewL( CBTNotifServer& aServer );
+
+    /**
+    * Destructor.
+    */
+    virtual ~CBTNotifDeviceSelector();
+
+    /**
+     * Processes a message from a notifier client related to settings.
+     *
+     * @since Symbian^4
+     * @param aMessage The message containing the details of the client request.
+     */
+    void DispatchNotifierMessageL( const RMessage2& aMessage );
+
+    /**
+     * Cancels an oustanding message from a notifier client related to settings.
+     *
+     * @since Symbian^4
+     * @param aMessage The message containing the details of the original client request.
+     */
+    void CancelNotifierMessageL( const RMessage2& aMessage );
+
+private:
+// from base class MBTNotificationResult
+
+    /**
+     * From MBTNotificationResult.
+     * Handle an intermediate result from a user query.
+     * This ffunction is called if the user query passes information
+     * back before it has finished i.e. is dismissed. The final acceptance/
+     * denial of a query is passed back in MBRNotificationClosed.
+     *
+     * @since Symbian^4
+     * @param aData the returned data. The actual format 
+     *              is dependent on the actual notifier.
+     */
+    virtual void MBRDataReceived( CHbSymbianVariantMap& aData );
+
+    /**
+     * From MBTNotificationResult.
+     * The notification is finished. The resulting data (e.g. user input or
+     * acceptance/denial of the query) is passed back here.
+     *
+     * @since Symbian^4
+     * @param aErr KErrNone or one of the system-wide error codes.
+     * @param aData the returned data. The actual format 
+     *              is dependent on the actual notifier.
+     */
+    virtual void MBRNotificationClosed( TInt aError, const TDesC8& aData );
+    
+    // From MDevDiscoveryObserver
+    
+    /**
+     * Callback to notify that a device has been found.
+     *
+     * @param aAddr the inquiry address that contains the inquiry information
+     *  of the found device.
+     * @param aName the Bluetooth device name of the found device
+     */
+    virtual void HandleNextDiscoveryResultL( 
+            const TInquirySockAddr& aAddr, const TDesC& aName );
+    
+    /**
+     * Callback to notify that the device search has completed.
+     *
+     * @param aErr the error code of device search result.
+     */
+    virtual void HandleDiscoveryCompleted( TInt aErr );
+    
+private:
+
+    CBTNotifDeviceSelector( CBTNotifServer& aServer );
+
+    void ConstructL();
+    
+    void PrepareNotificationL( 
+            TBluetoothDialogParams::TBTDialogType aType,
+            TBTDialogResourceId aResourceId );
+    
+private: // data    
+
+    /**
+     * Reference to our parent the server class.
+     * Not own.
+     */
+    CBTNotifServer& iServer;
+    
+    /**
+     * Pointer to an outstanding user interaction.
+     * Not own.
+     */
+    CBluetoothNotification* iNotification;
+    
+    /**
+     * device inquiry handler:
+     */
+    CAdvanceDevDiscoverer* iDiscoverer;
+    
+    /**
+     * do not own the elements in the array.
+     */
+    RPointerArray<CBtDevExtension> iDevices;
+    
+    /**
+     * The message for a pending device selection request from a RNotifier client.
+     */
+    RMessage2 iMessage;
+    
+    };
+
+#endif // BTNOTIFDEVICESELECTOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/inc/btnotificationmanager.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,145 @@
+/*
+* ============================================================================
+*  Name        : btnotificationmanager.h
+*  Part of     : bluetoothengine / btnotif
+*  Description : Class for managing user notification and query objects, and for serializing access to the notification server.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef BTNOTIFICATIONMANAGER_H
+#define BTNOTIFICATIONMANAGER_H
+
+
+#include <e32base.h>
+
+class CBTNotifServer;
+class CBluetoothNotification;
+
+/**
+ *  CBTNotificationManager manages Bt Notifications
+ *  
+ *  @since Symbian^4
+ */
+NONSHARABLE_CLASS( CBTNotificationManager ) : public CBase
+    {
+
+public:
+
+    /**  Enumeration for the priority of the notification. */
+    enum TNotificationPriority
+        {
+        EPriorityLow,
+        EPriorityStandard,
+        EPriorityHigh
+        };
+
+    /**
+     * Two-phased constructor.
+     * @param aServer Pointer to our parent
+     */
+    static CBTNotificationManager* NewL( const CBTNotifServer* aServer );
+
+    /**
+    * Destructor.
+    */
+    virtual ~CBTNotificationManager();
+
+    CBluetoothNotification* GetNotification();
+
+    void ReleaseNotification( CBluetoothNotification* aNotification );
+
+    /**
+     * Add a notification to the queue of notifications scheduled to be 
+     * shown. Notifications are serialized, to avoid overlapping notes.
+     * The queue is managed on priority of each notification.
+     *
+     * @since Symbian^4
+     * @param aNotification The notification to be added.
+     * @param aPriority The priority of the notification. EPriorityHigh means 
+     *                  that the note is put to the front of the queue.
+     *                  EPriorityStandard means that it is appended to the end,
+     *                  and should be used for most notes. EPriorityLow is not 
+     *                  used yet.
+     * @return Error code.
+     */
+    TInt QueueNotification( CBluetoothNotification* aNotification, 
+                TNotificationPriority aPriority = EPriorityStandard );
+
+private:
+
+    CBTNotificationManager( const CBTNotifServer* aServer );
+
+    void ConstructL();
+
+    /**
+     * Process the notification queue and launch the next notification.
+     *
+     * @since Symbian^4
+     */
+    void ProcessNotificationQueueL();
+
+    /**
+     * Process the notification queue and launch the next notification.
+     *
+     * @since Symbian^4
+     */
+    void CleanupUnusedQueueL();
+
+    /**
+     * Create and queue an idle timer if there are no outstanding notifications,
+     * otherwise cancel the idle timer.
+     *
+     * @since Symbian^4
+     */
+    void CheckIdle();
+
+    /**
+     * Callback function for asynchronous processing of 
+     * queued notification requests.
+     *
+     * @since Symbian^4
+     * @param aPtr Pointer to notification manager instance.
+     */
+    static TInt AsyncCallback( TAny* aPtr );
+
+private: // data
+
+    /**
+     * The queue of notifications to be shown to the user.
+     */
+    RPointerArray<CBluetoothNotification> iNotificationQ;
+
+    /**
+     * The queue of spare notifications.
+     */
+    RPointerArray<CBluetoothNotification> iUnusedQ;
+
+    /**
+     * Callback for asynchronous processing.
+     * Own.
+     */
+    CAsyncCallBack* iAsyncCb;
+    
+    /**
+     * Pointer to our parent.
+     * Not own.
+     */
+    const CBTNotifServer* iServer;
+
+    };
+
+#endif // BTNOTIFICATIONMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/inc/btnotificationresult.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,66 @@
+/*
+* ============================================================================
+*  Name        : btnotificationresult.h
+*  Part of     : bluetoothengine / btnotif
+*  Description : Abstract interface for receiving the result of a user query.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef BTNOTIFICATIONRESULT_H
+#define BTNOTIFICATIONRESULT_H
+
+class CHbSymbianVariantMap;
+
+/**
+ *  MBTNotificationResult returns the result from a user query.
+ *
+ *
+ *  @since Symbian^4
+ */
+class MBTNotificationResult
+    {
+
+public:
+
+    /**
+     * Handle an intermediate result from a user query.
+     * This function is called if the user query passes information
+     * back before it has finished i.e. is dismissed. The final acceptance/
+     * denial of a query is passed back in MBRNotificationClosed.
+     *
+     * @since Symbian^4
+     * @param aData the returned data. The actual format 
+     *              is dependent on the actual notifier.
+     */
+    virtual void MBRDataReceived( CHbSymbianVariantMap& aData ) = 0;
+
+    
+    /**
+     * The notification is finished. The resulting data (e.g. user input or
+     * acceptance/denial of the query) is passed back here.
+     *
+     * @since Symbian^4
+     * @param aErr KErrNone or one of the system-wide error codes.
+     * @param aData the returned data. The actual format 
+     *              is dependent on the actual notifier.
+     */
+    virtual void MBRNotificationClosed( TInt aError, const TDesC8& aData ) = 0;
+
+    };
+
+
+#endif // BTNOTIFICATIONRESULT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/inc/btnotifpairinghelper.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,471 @@
+/*
+* ============================================================================
+*  Name        : btnotifpairinghelper.h
+*  Part of     : bluetoothengine / btnotif
+*  Description : Helper class for processing pairing requests and results, as extended functionality for CBTNotifConnection.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef BTNOTIFPAIRINGHELPER_H
+#define BTNOTIFPAIRINGHELPER_H
+
+#include <e32base.h>
+#include <btmanclient.h>
+#include <bluetooth/pairing.h>
+#include <btservices/btsimpleactive.h>
+
+#include "bluetoothnotification.h"
+#include "bluetoothtrace.h"
+
+class CBTNotifConnection;
+class CBTNotifConnectionTracker;
+class CBTDevice;
+
+
+/**
+ *  Helper class for performing pairing-related operations.
+ *  
+ *  This class is constructed only when there is a pairing-related event,
+ *  and destructed after completion. Pairing-related events are bonding
+ *  (outgoing bonding request from an application), pairing notifiers
+ *  (PIN input i.e. legacy pairing, numeric comparison and passkey display),
+ *  and Just Works pairing completion.
+ *  
+ *  The structure of operations is as follows: each event is initiated through
+ *  StartXxL() operation, and finished with CompleteXxL(), there is also a
+ *  CancelXxL() operation where needed. In addition there are the base class virtual
+ *  functions, a few helper functions and HandleAuthenticationCompleteL, which
+ *  processes a baseband authentication result. The same structure applies to
+ *  suboperations, such as StartTrustedQueryL and CompleteTrustedQueryL.
+ *  
+ *  For bonding, there is StartBondingL, CompleteBondingL() CancelBondingL();
+ *  for pairing notifiers there is StartPairingNotifierL(),
+ *  CancelPairingNotifierL(), CompletePairingNotifierL() and also
+ *  UpdatePairingNotifierL(). For Just Works processing, there is
+ *  StartJustWorksProcessingL(), CancelJustWorksProcessingL() and
+ *  CompleteJustWorksProcessingL().
+ *  
+ *  The design of this class is focussed on structure and maintainability first.
+ *  Duplicate (state) information is kept to a minimum. And memory usage comes
+ *  before processing. Pairing is an infrequent operation, and this class is
+ *  only instantiated when there is pairing-related processing, so extreme
+ *  focus on memory or processing efficiency would have relatively little effect.
+ *  
+ *  @since Symbian^4
+ */
+NONSHARABLE_CLASS( CBTNotifPairingHelper ) : public CBase,
+                                             public MBTNotificationResult,
+                                             public MBtSimpleActiveObserver
+    {
+
+public:
+
+    /**  Enumeration identifying the stage of the pairing operation. */
+    enum TPairingOp
+        {
+        EIdle,
+        EAcceptPairing,
+        ELegacyPairing,
+        ESspPairing,
+        EJustWorksPairing,
+        EAutoPairing,
+        EPostPairingOperations, // Marks the queries and notes which follow
+                                // the real pairing input from the user.
+        EDedicatedBonding,
+        EUnpairing,
+        EAwaitingPairingResult,
+        EShowPairingSuccess,
+        EShowPairingFailure,
+        EQueryTrust,
+        EBlocking,
+        EPairingCancelled
+        };
+
+    /**
+     * Two-phased constructor.
+     * @param aConnection Pointer to the parent.
+     * @param aDevice Pointer to information of the remote device.
+     * aParam aTracker Pointer to the connection tracker.
+     */
+    static CBTNotifPairingHelper* NewL( CBTNotifConnection* aConnection, 
+                CBTNotifConnectionTracker* aTracker );
+
+    /**
+    * Destructor.
+    */
+    virtual ~CBTNotifPairingHelper();
+
+    /**
+     * Get the address of the remote device for this connection.
+     *
+     * @since Symbian^4
+     * @param aProfile The profile identifying the service.
+     */
+    inline CBTNotifPairingHelper::TPairingOp CurrentOperation() const
+        { return iOperation; }
+
+    /**
+     * The baseband authentication has completed, handle the result.
+     *
+     * @since Symbian^4
+     * @param aError The result of the authentication procedure.
+     */    
+    void HandleAuthenticationCompleteL( TInt aError );
+
+    /**
+     * Start a bonding operation with the remote device.
+     *
+     * @since Symbian^4
+     * @param aMessage The handle of the message from the client.
+     */
+    void StartBondingL( TInt aHandle );
+
+    /**
+     * Cancel an ongoing bonding operation with the remote device.
+     *
+     * @since Symbian^4
+     */
+    void CancelBondingL();
+
+    /**
+     * Handle a notifier request for pairing with the remote device
+     * of this connection.
+     *
+     * @since Symbian^4
+     * @param aUid The UID of the notifier for this pairing request.
+     * @param aParams The parameters for this request from the client.
+     */    
+    void StartPairingNotifierL( TInt aUid, const TDesC8& aParams );
+
+    /**
+     * Update an outstanding request for this connection.
+     *  
+     * @since Symbian^4
+     * @param aUid The UID of the notifier for this update.
+     * @param aParams The updated parameters for this request from the client.
+     */
+    void UpdatePairingNotifierL( TInt aUid, const TDesC8& aParams );
+
+    /**
+     * Cancel an outstanding request for this connection.
+     *  
+     * @since Symbian^4
+     * @param aUid The UID of the notifier for this pairing request.
+     */
+    void CancelPairingNotifierL( TInt aUid );
+
+    /**
+     * Start the processing of a completed Just Works pairing.
+     * This needs special attention, as this class is not notified
+     * other than by observing the registry, and the user is not
+     * notified otherwise either (which is the point of this association
+     * model). It needs to be verified that the pairing is related to
+     * a service access, as dedicated bonding should not be possible
+     * (for devices that do not have any IO capabilities).
+     *
+     * @since Symbian^4
+     * @param aMessage The handle of the message from the client.
+     */
+    void StartJustWorksProcessingL();
+
+    /**
+     * Cancel the processing of a completed Just Works pairing.
+     *
+     * @since Symbian^4
+     */
+    void CancelJustWorksProcessingL();
+
+// from base class MBTNotificationResult
+
+    /**
+     * From MBTNotificationResult.
+     * Handle an intermediate result from a user query.
+     * This function is called if the user query passes information
+     * back before it has finished i.e. is dismissed. The final acceptance/
+     * denial of a query is passed back in MBRNotificationClosed.
+     *
+     * @since Symbian^4
+     * @param aData the returned data. The actual format 
+     *              is dependent on the actual notifier.
+     */
+    virtual void MBRDataReceived( CHbSymbianVariantMap& aData );
+
+    /**
+     * From MBTNotificationResult.
+     * The notification is finished. The resulting data (e.g. user input or
+     * acceptance/denial of the query) is passed back here.
+     *
+     * @since Symbian^4
+     * @param aErr KErrNone or one of the system-wide error codes.
+     * @param aData the returned data. The actual format 
+     *              is dependent on the actual notifier.
+     */
+    virtual void MBRNotificationClosed( TInt aError, const TDesC8& aData );
+
+// from base class MBtSimpleActiveObserver
+
+    /**
+     * From MBtSimpleActiveObserver.
+     * Callback to notify that an outstanding request has completed.
+     *
+     * @since Symbian^4
+     * @param aActive The active object helper that completed this request.
+     * @param aStatus The status of the completed request.
+     */
+    virtual void RequestCompletedL( CBtSimpleActive* aActive, TInt aStatus );
+
+    /**
+     * From MBtSimpleActiveObserver.
+     * Callback for handling cancelation of an outstanding request.
+     *
+     * @since Symbian^4
+     * @param aId The ID that identifies the outstanding request.
+     */
+    virtual void CancelRequest( TInt aRequestId );
+
+    /**
+     * Callback to notify that an error has occurred in RunL.
+     *
+     * @param aActive Pointer to the active object that completed.
+     * @param aError The error occurred in RunL.
+     */
+    virtual void HandleError( CBtSimpleActive* aActive, TInt aError );
+    
+private:
+
+    /**
+     * C++ default constructor.
+     */
+    CBTNotifPairingHelper( CBTNotifConnection* aConnection,
+                CBTNotifConnectionTracker* aTracker );
+
+    /**
+     * Symbian 2nd-phase constructor.
+     */
+    void ConstructL();
+
+    /**
+     * Process the user input and complete the outstanding pairing request.
+     *
+     * @since Symbian^4
+     * @param aError The result off the notification.
+     * @param aResult The user response; ETrue if the user accepted the query,
+     *                otherwise EFalse.
+     * @param aData The data returned from the notification dialog.
+     */
+    void CompletePairingNotifierL( TInt aError, TBool aResult, const TDesC8& aData );
+
+    /**
+     * Completes a bonding operation.
+     *
+     * @since Symbian^4
+     * @param aError The result of the bonding attempt.
+     */
+    void CompleteBondingL( TInt aError );
+
+    /**
+     * Completes a bonding operation.
+     *
+     * @since Symbian^4
+     * @param aError The result of the bonding attempt.
+     */
+    void CompleteJustWorksProcessingL( TInt aError );
+
+    /**
+     * Ask the user to allow incoming pairing.
+     *
+     * @since Symbian^4
+     */
+    void StartAcceptPairingQueryL();
+
+    /**
+     * Process the user input and for accepting an incoming pairing and
+     * continue with the outstanding pairing request.
+     *
+     * @since Symbian^4
+     * @param aError The result of the notification.
+     * @param aResult The user response; ETrue if the user accepted the query,
+     *                otherwise EFalse.
+     */
+    void CompleteAcceptPairingQueryL( TInt aError, TBool aResult );
+
+    /**
+     * Ask the user to set the device as trusted.
+     *
+     * @since Symbian^4
+     * @param aData The data returned from the notification dialog.
+     */
+    void StartTrustedQueryL();
+
+    /**
+     * Process the user input for setting the device as trusted.
+     *
+     * @since Symbian^4
+     * @param aError The result of the notification.
+     * @param aResult The user response; ETrue if the user accepted the query,
+     *                otherwise EFalse.
+     */
+    void CompleteTrustedQueryL( TInt aError, TBool aResult );
+
+    /**
+     * Parse the parameters of a request for pairing.
+     * This function also returns values to use for dialog config, and sets
+     * the operation state member variable (iOperation).
+     *
+     * @since Symbian^4
+     * @param aLocallyInitiated On return, will be set to ETrue if the pairing 
+     *                          was initiated by us.
+     * @param aNumVal On return, this descriptor will contain a number to use in
+     *                the pairing dialog. The meaning depends on the type of pairing.
+     * @param aDialogType On return, will contain the dialog type.
+     * @param aResourceId On return, will contain the resource id.
+     */
+    void ParseNotifierReqParamsL( TBool& aLocallyInitiated, TDes& aNumVal,
+                TBluetoothDialogParams::TBTDialogType& aDialogType,
+                TBTDialogResourceId& aResourceId );
+
+    /**
+     * Parse the parameters of a request for pairing using pin query.
+     *
+     * @since Symbian^4
+     * @param aLocallyInitiated On return, will be set to ETrue if the pairing 
+     *                          was initiated by us.
+     * @param aNumVal On return, this will contain the minimum passcode length.
+     */
+    void ParsePinCodeReqParamsL( TBool& aLocallyInitiated, TUint& aNumVal );
+
+    /**
+     * Parse the parameters of a request for pairing using numeric comparison.
+     *
+     * @since Symbian^4
+     * @param aLocallyInitiated On return, will be set to ETrue if the pairing 
+     *                          was initiated by us.
+     * @param aNumVal On return, this descriptor will contain the passkey to 
+     *                show to the user.
+     */
+    void ParseNumericCompReqParamsL( TBool& aLocallyInitiated, TDes& aNumVal );
+
+    /**
+     * Parse the parameters of a request for pairing using passkey display.
+     *
+     * @since Symbian^4
+     * @param aLocallyInitiated On return, will be set to ETrue if the pairing 
+     *                          was initiated by us.
+     * @param aNumVal On return, this descriptor will contain the passkey to 
+     *                show to the user.
+     */
+    void ParsePasskeyDisplayReqParamsL( TBool& aLocallyInitiated, TDes& aNumVal );
+
+    /**
+     * Check if we can guess the PIN and complete the notifier without 
+     * user interaction.
+     *
+     * @since Symbian^4
+     * @param aLocallyInitiated ETrue if we initiated the pairing, otherwise EFalse.
+     * @param aNumVal The minimum lenght of the passcode.
+     */
+    void CheckAutoPairingL( TBool aLocallyInitiated, const TDesC& aNumVal );
+
+    /**
+     * Get a notification and configure it according to the current operation.
+     *
+     * @since Symbian^4
+     * @param aType The notification type.
+     * @param aResourceId Identifier for the resource to display.
+     */
+    void PrepareNotificationL( TBluetoothDialogParams::TBTDialogType aType,
+                TBTDialogResourceId aResourceId );
+
+    /**
+     * Handle the result from a notification that is finished.
+     *
+     * @since Symbian^4
+     * @param aErr KErrNone or one of the system-wide error codes.
+     * @param aData The returned data. The actual format 
+     *              is dependent on the actual notifier.
+     */
+    void NotificationClosedL( TInt aError, const TDesC8& aData );
+
+private: // data
+
+    /**
+     * Identifier for the current operation.
+     */
+    TPairingOp iOperation;
+
+    /**
+     * UID of the notifier pairing dialog request.
+     */
+    TInt iNotifierUid;
+
+    /**
+     * Handle to the client message for dedicated bonding. Also serves as flag 
+     * indicating that we are performing dedicated bonding.
+     */
+    TInt iDedicatedBonding;
+
+    /**
+     * Subsession with pairing server for dedicated bonding.
+     */
+    RBluetoothDedicatedBondingInitiator iBondingSession;
+
+    /**
+     * Handle for general bonding.
+     */
+    RBTPhysicalLinkAdapter iBondingSocket;
+
+    /**
+     * Buffer containing the parameters of the client message.
+     * Own.
+     */
+    HBufC8* iParams;
+
+    /**
+     * Active object helper for outgoing bonding.
+     * Own.
+     */
+    CBtSimpleActive* iBondingActive;
+
+    /**
+     * Pointer to the data record of the remote device.
+     * Not own.
+     */
+    CBTDevice* iDevice;
+
+    /**
+     * Pointer to an outstanding user interaction.
+     * Not own.
+     */
+    CBluetoothNotification* iNotification;
+
+    /**
+     * Pointer to the class that we are helping.
+     * Not own.
+     */
+    CBTNotifConnection* iConnection;
+
+    /**
+     * Pointer to our grandparent.
+     * Not own.
+     */
+    CBTNotifConnectionTracker* iTracker;
+
+    BTUNITTESTHOOK
+
+    };
+
+#endif // BTNOTIFPAIRINGHELPER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/inc/btnotifserver.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,289 @@
+/*
+* ============================================================================
+*  Name        : btnotifserver.h
+*  Part of     : bluetoothengine / btnotif
+*  Description : Server class for handling commands from clients, and the 
+*                central class in btnotif thread.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef BTNOTIFSERVER_H
+#define BTNOTIFSERVER_H
+
+
+#include <e32base.h>
+#include <btengsettings.h>
+
+#include "bluetoothtrace.h"
+
+class CBTNotifConnectionTracker;
+class CBTNotifSettingsTracker;
+class CBTNotificationManager;
+class CBTNotifDeviceSelector;
+class CBtDevRepository;
+
+class CbtnotifServerTest; // ToDo: shall be refactored under compile flag?
+
+/**
+ * Utility function for panicking the server.
+ *
+ * @since Symbian^4
+ * @param aReason The panic reason code.
+ */
+void PanicServer( TInt aReason );
+
+/**
+ * Utility function for panicking the server.
+ *
+ * @since Symbian^4
+ * @param aMessage The handle to the client side.
+ * @param aReason The panic reason code.
+ */
+void PanicClient( const RMessage2& aMessage, TInt aReason );
+
+/**  BTNotif panic codes */
+enum TBTNotifServerPanic
+    {
+    EBTNotifPanicUnknown,
+    EBTNotifPanicCorrupt,
+    EBTNotifPanicMissing,
+    EBTNotifPanicNullMember,
+    EBTNotifPanicBadState,
+    EBTNotifPanicBadArgument,
+    EBTNotifPanicBadResult
+    };
+
+/**  Convenience macro for indicating unimplemented events */
+#define NOTIF_NOTIMPL 
+//{ __ASSERT_ALWAYS( 1, PanicServer( EBTNotifPanicNotImplemented ) ); }
+/**  Convenience macro for indicating unhandled events */
+#define NOTIF_NOTHANDLED( cond ) 
+//{ __ASSERT_ALWAYS( cond, PanicServer( EBTNotifPanicNotHandled ) ); }
+
+
+/**
+ * CBTNotifServer handles notifications and also maintains state information related to 
+ * the local device as well as remote devices.
+ *
+ *  @since Symbian^4
+ */
+NONSHARABLE_CLASS( CBTNotifServer ) : public CPolicyServer
+    {
+
+public:
+
+    /**
+     * Two-phased constructor.
+     */
+    static CBTNotifServer* NewLC();
+
+    /**
+    * Destructor.
+    */
+    virtual ~CBTNotifServer();
+
+    /**
+     * Called when the BT power state changes.
+     *
+     * @since Symbian^4
+     * @param aState The new BT power state.
+     */
+    void HandlePowerStateChangeL( TBTPowerStateValue aState );
+
+    /**
+     * Called by a session during creation, to keep track of the number
+     * of active sessions.
+     *
+     * @since Symbian^4
+     */
+    void AddSession();
+
+    /**
+     * Called by a session during destruction, to keep track of the number
+     * of active sessions.
+     *
+     * @since Symbian^4
+     */
+    void RemoveSession();
+
+    /**
+     * Returns a handle to the settings tracker.
+     *
+     * @since Symbian^4
+     * @param Pointer to the settings tracker.
+     */
+    inline CBTNotifSettingsTracker* SettingsTracker() const
+        { return iSettingsTracker; }
+
+    /**
+     * Returns a handle to the connection tracker.
+     *
+     * @since Symbian^4
+     * @param Pointer to the connection tracker.
+     */
+    inline CBTNotifConnectionTracker* ConnectionTracker() const
+        { return iConnectionTracker; }
+
+    /**
+     * Returns a handle to the notification manager.
+     *
+     * @since Symbian^4
+     * @param Pointer to the notification manager.
+     */
+    inline CBTNotificationManager* NotificationManager() const
+        { return iNotificationMgr; }
+
+    CBtDevRepository& DevRepository();
+    
+    CBTNotifDeviceSelector& DeviceSelectorL();
+    
+    /**
+     * Searches for a specific client message from a message handle
+     * on all active sessions, and complete the message with the 
+     * specified reason code.
+     *
+     * @since Symbian^4
+     * @param aHandle The handle identifying the message.
+     * @param aReply Data to write back to the client.
+     * @return KErrNone on success; KErrNotFound if the message is not found.
+     */
+    TInt CompleteMessage( TInt aHandle, TInt aReason, const TDesC8& aReply );
+
+    /**
+     * Searches for and returns a specific client message from a message 
+     * handle on all active sessions.
+     *
+     * @since Symbian^4
+     * @param aHandle The handle identifying the message.
+     * @return Pointer to the message, NULL if not found.
+     */
+    const RMessage2* FindMessageFromHandle( TInt aHandle );
+
+    /**
+     * Searches for and returns a specific client message from a message 
+     * UID on all active sessions.
+     * The use of this method assumes that there can be only one message
+     * outstanding for a specific UID. This is enforced by RNotifier backend.
+     *
+     * @since Symbian^4
+     * @param aUid The UID identifying the message.
+     * @return Pointer to the message, NULL if not found.
+     */
+    const RMessage2* FindMessageFromUid( TInt aUid );
+
+// from base class CPolicyServer
+
+    /**
+     * From CPolicyServer.
+     * Creates and returns a server-side session object.
+     *
+     * @since Symbian^4
+     * @param aVersion The version information supplied by the client.
+     * @param aMessage Represents the details of the client request that 
+     *                 is requesting the creation of the session.
+     * @return A pointer to the newly created server-side session object.
+     */
+    virtual CSession2* NewSessionL( const TVersion& aVersion, const RMessage2& aMessage ) const;
+
+private:
+
+    CBTNotifServer();
+
+    void ConstructL();
+
+    /**
+     * Asynchronous second-phase constructor. This function is called asynchronously
+     * from ConstructL, to facilitate short initial construction, and allow construction
+     * of e.g. session to BTEngine. So in fact this is a third-phase constructor.
+     *
+     * @since Symbian^4
+     */
+    void AsyncConstructL();
+
+    void CheckIdle( TBTPowerStateValue aState );
+    
+    /**
+     * Callback function for asynchronous construction.
+     *
+     * @since Symbian^4
+     * @param aPtr Pointer to server instance.
+     */
+    static TInt AsyncConstructCb( TAny* aPtr );
+
+    static TInt ShutdownTimeout( TAny* aPtr );
+    
+private: // data
+
+    /**
+     * Counter for the number of active sessions.
+     */
+    TInt iSessionCount;
+
+    /**
+     * Helper class for tracking settings.
+     * Own.
+     */
+    CBTNotifSettingsTracker* iSettingsTracker;
+
+    /**
+     * Helper class for tracking connections.
+     * Own.
+     */
+    CBTNotifConnectionTracker* iConnectionTracker;
+
+    /**
+     * Helper class for managing the actual notifications.
+     * Own.
+     */
+    CBTNotificationManager* iNotificationMgr;
+
+    /**
+     * Remote device repository.
+     * Singleton in btnotifsrv. This is useful
+     * for getting the correct name for displaying in UI
+     * without the need getting the device everytime
+     * when a name is needed.
+     * Pairing handling also needs this repository to drive
+     * the logic flow.
+     */
+    CBtDevRepository* iDevRep;
+    
+    /**
+     * Helper class for device searching and selection.
+     * Own.
+     */
+    CBTNotifDeviceSelector* iDevSelector;
+    
+    /**
+     * Callback for asynchronous processing.
+     * Own.
+     */
+    CAsyncCallBack* iAsyncCb;
+
+    /**
+     * Timer for various timeouts.
+     * Own.
+     */
+    CDeltaTimer* iTimer;
+    
+    TDeltaTimerEntry iShutdownTimerEntry;
+    
+    BTUNITTESTHOOK
+
+    };
+
+#endif // BTNOTIFSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/inc/btnotifserversecpolicy.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,67 @@
+/*
+* ============================================================================
+*  Name        : btnotifserversecpolicy.h
+*  Part of     : bluetoothengine / btnotif       *** Info from the SWAD
+*  Description : Security policy for btnotif client-server interface.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef BTNOTIFSRVSECPOLICY_H
+#define BTNOTIFSRVSECPOLICY_H
+
+/**  Number of ranges in btnotif security policy */
+const TInt KBTNotifRangeCount = 4;
+
+/**  Ranges of btnotif command opcodes */
+const TInt KBTNotifRanges[ KBTNotifRangeCount ] = 
+    {
+    0,  // Range 0: 0 - EBTNotifMinValue (Out of range)
+    10, // Range 1: All commands requiring no access control
+    30, // Range 2: All commands requiring local services
+        // More ranges may be added here
+    50  // Range 3: Out of range
+    };
+
+/**  Mapping of ranges to policies */
+const TUint8 KBTNotifElementsIndex[ KBTNotifRangeCount ] = 
+    {
+    CPolicyServer::ENotSupported,   // applies to 0th range (out of range)
+    CPolicyServer::EAlwaysPass,     // no policy for the 1st range
+    0,                              // policy 0 applies to 2nd range
+    CPolicyServer::ENotSupported    // applies to xth range(out of range)
+    };
+
+/**  BTEng security policies, applied on a range of commands */
+const CPolicyServer::TPolicyElement KBTNotifPolicyElements[] = 
+    {
+        { _INIT_SECURITY_POLICY_C1( ECapabilityLocalServices ), 
+          CPolicyServer::EFailClient
+        } //policy 0, for now on all operations
+        // More policies may be added here
+    };
+
+/**  BTNotif security policy package (combining all the above) */
+const CPolicyServer::TPolicy KBTNotifServerPolicy = 
+    {
+    CPolicyServer::EAlwaysPass, // Connection attempts may pass
+    KBTNotifRangeCount,         // Number of ranges
+    KBTNotifRanges,             // Array of ranges
+    KBTNotifElementsIndex,      // Mapping of ranges to policies
+    KBTNotifPolicyElements      // Array of policies
+    };
+
+#endif // BTNOTIFSRVSECPOLICY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/inc/btnotifsession.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,130 @@
+/*
+* ============================================================================
+*  Name        : btnotifsession.h
+*  Part of     : bluetoothengine / btnotif
+*  Description : Session class for handling commands from clients.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef BTNOTIFSESSION_H
+#define BTNOTIFSESSION_H
+
+#include "btnotifserver.h"
+
+/**
+ *  CBTNotifSession maintains a session with a client.
+ *
+ *  @since Symbian^4
+ */
+NONSHARABLE_CLASS( CBTNotifSession ) : public CSession2
+    {
+
+public:
+
+    /**
+     * Two-phased constructor.
+     */
+    static CBTNotifSession* NewL();
+
+    /**
+    * Destructor.
+    */
+    virtual ~CBTNotifSession();
+
+// from base class CSession2
+
+    /**
+     * From CSession2.
+     * Receives a message from a client.
+     *
+     * @since Symbian^4
+     * @param aMessage The message containing the details of the client request.
+     */
+    virtual void ServiceL( const RMessage2& aMessage );
+
+    /**
+     * From CSession2.
+     * Completes construction of the session.
+     *
+     * @since Symbian^4
+     */
+    virtual void CreateL();
+
+    /**
+     * Complete a client message from a message handle.
+     *
+     * @since Symbian^4
+     * @param aHandle The handle identifying the message.
+     * @param aReason The reason code to complete the message with.
+     * @param aReply Data to write back to the client.
+     * @return KErrNone on success; KErrNotFound if the message is not found.
+     */
+    TInt CompleteMessage( TInt aHandle, TInt aReason, const TDesC8& aReply );
+
+    /**
+     * Find a message identified by an RMessage2 handle.
+     *
+     * @since Symbian^4
+     * @param aHandle The handle identifying the message.
+     * @return The message.
+     */
+    const RMessage2* FindMessageFromHandle( TInt aHandle ) const;
+
+    /**
+     * Find a message identified by an RNotifier notifier UID.
+     *
+     * @since Symbian^4
+     * @param aUid The UID identifying the message.
+     * @return The message.
+     */
+    const RMessage2* FindMessageFromUid( TInt aUid ) const;
+
+private:
+
+    CBTNotifSession();
+
+    void ConstructL();
+
+    /**
+     * Returns a handle to our server.
+     *
+     * @since Symbian^4
+     * @param Pointer to our server.
+     */
+    inline CBTNotifServer* Server() const
+        { return (CBTNotifServer*) CSession2::Server(); }
+
+    /**
+     * Processes a message from a client.
+     *
+     * @since Symbian^4
+     * @param aMessage The message containing the details of the client request.
+     */
+    void DispatchMessageL( const RMessage2& aMessage );
+
+private: // data
+
+    /**
+     * Array of messages currently being processed.
+     */
+    RArray<RMessage2> iMessageQ;
+
+    BTUNITTESTHOOK
+
+    };
+
+#endif // BTNOTIFSESSION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/inc/btnotifsettingstracker.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,172 @@
+/*
+* ============================================================================
+*  Name        : btnotifsettingstracker.h
+*  Part of     : BTProximity / BTProximity
+*  Description : Class for tracking Bluetooth settings, and also for 
+*                handling notes unrelated to specific connection.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef BTNOTIFSETTINGSTRACKER_H
+#define BTNOTIFSETTINGSTRACKER_H
+
+
+#include <e32base.h>
+#include <btengsettings.h>
+
+#include "bluetoothnotification.h"
+
+class CBTNotifServer;
+
+/**
+ * CBTNotifSettingsTracker keeps track of local device settings
+ * 
+ * @since Symbian^4
+ */
+NONSHARABLE_CLASS( CBTNotifSettingsTracker ) : public CBase,
+                                               public MBTEngSettingsObserver,
+                                               public MBTNotificationResult
+    {
+
+public:
+
+    /**
+     * Two-phased constructor.
+     * @param aServer Pointer to our parent
+     */
+    static CBTNotifSettingsTracker* NewL( CBTNotifServer* aServer );
+
+    /**
+    * Destructor.
+    */
+    virtual ~CBTNotifSettingsTracker();
+
+    /**
+     * Return the current power state
+     *
+     * @since Symbian^4
+     * @return The current power state.
+     */
+    inline TBTPowerStateValue GetPowerState() const
+        { return iPowerState; }
+
+    /**
+     * Processes a message from a notifier client related to settings.
+     *
+     * @since Symbian^4
+     * @param aMessage The message containing the details of the client request.
+     */
+    void DispatchNotifierMessageL( const RMessage2& aMessage );
+
+    /**
+     * Cancels an oustanding message from a notifier client related to settings.
+     *
+     * @since Symbian^4
+     * @param aMessage The message containing the details of the original client request.
+     */
+    void CancelNotifierMessageL( const RMessage2& aMessage );
+
+// from base class MBTEngSettingsObserver
+
+    /**
+     * From MBTEngSettingsObserver.
+     * Provides notification of changes in the power state 
+     * of the Bluetooth hardware.
+     *
+     * @since Symbian^4
+     * @param aState EBTPowerOff if the BT hardware has been turned off, 
+     *               EBTPowerOn if it has been turned off.
+     */
+    virtual void PowerStateChanged( TBTPowerStateValue aState );
+
+    /**
+     * From MBTEngSettingsObserver.
+     * Provides notification of changes in the discoverability 
+     * mode of the Bluetooth hardware.
+     *
+     * @since Symbian^4
+     * @param aState EBTDiscModeHidden if the BT hardware is in hidden mode, 
+     *               EBTDiscModeGeneral if it is in visible mode.
+     */
+    virtual void VisibilityModeChanged( TBTVisibilityMode aState );
+
+// from base class MBTNotificationResult
+
+    /**
+     * From MBTNotificationResult.
+     * Handle an intermediate result from a user query.
+     * This ffunction is called if the user query passes information
+     * back before it has finished i.e. is dismissed. The final acceptance/
+     * denial of a query is passed back in MBRNotificationClosed.
+     *
+     * @since Symbian^4
+     * @param aData the returned data. The actual format 
+     *              is dependent on the actual notifier.
+     */
+    virtual void MBRDataReceived( CHbSymbianVariantMap& aData );
+
+    /**
+     * From MBTNotificationResult.
+     * The notification is finished. The resulting data (e.g. user input or
+     * acceptance/denial of the query) is passed back here.
+     *
+     * @since Symbian^4
+     * @param aErr KErrNone or one of the system-wide error codes.
+     * @param aData the returned data. The actual format 
+     *              is dependent on the actual notifier.
+     */
+    virtual void MBRNotificationClosed( TInt aError, const TDesC8& aData );
+
+private:
+
+    CBTNotifSettingsTracker( CBTNotifServer* aServer );
+
+    void ConstructL();
+
+private: // data
+
+    /**
+     * Local copy of current power state.
+     */
+    TBTPowerStateValue iPowerState;
+
+    /**
+     * Local copy of current visibility mode.
+     */
+    TBTVisibilityMode iVisibilityMode;
+
+    /**
+     * ?description_of_pointer_member
+     * Own.
+     */
+    CBTEngSettings* iSettings;
+
+    /**
+     * Pointer to an outstanding user interaction.
+     * Not own.
+     */
+    CBluetoothNotification* iNotification;
+
+    /**
+     * Reference to our parent the server class.
+     * Not own.
+     */
+    CBTNotifServer* iServer;
+
+    };
+
+#endif // BTNOTIFSETTINGSTRACKER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/inc/traceconfig.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,126 @@
+/*
+* ============================================================================
+*  Name        : traceconfig_template.h
+*  Part of     : BluetoothUI / bluetoothuimodel       *** Info from the SWAD
+*  Description : Configuration of debug tracing in btnotif
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+#ifndef BLUETOOTHTRACECONFIG_H
+#define BLUETOOTHTRACECONFIG_H
+
+/*
+Sample usage:
+    void testTracing() 
+    {
+        BOstrace0( TRACE_FATAL, TNAME_DEVLIST_1, "BOstrace0" );
+        BOstrace1( TRACE_IMPORTANT, TNAME_DEVLIST_2, "BOstrace1 %d", 123 );
+        _LIT(String, "\"Symbian Descriptor\"");
+        TPtrC ptr(String);
+        TBuf<20> buf(ptr);
+        BOstraceExt1( TRACE_NORMAL, TNAME_DEVLIST_3, "BOstraceExt1 %S",  &ptr);
+        BOstraceExt2( TRACE_API, TNAME_DEVLIST_4, "BOstraceExt2 %d %S", 456, &ptr );
+        BOstraceExt3( TRACE_FLOW, TNAME_DEVLIST, "BOstraceExt3 0x%x %d %S", 128, 256, &ptr );
+        BOstraceExt4( TRACE_DETAILED, TNAME_DEVL_5IST, "BOstraceExt4 0x%x %d %S %S", 128, 256, &ptr, &buf );
+        BOstraceExt5( TRACE_DEBUG, TNAME_DEVLIST_6, "BOstraceExt5 0x%x %d %S %S, %b", 128, 256, &ptr, &buf, 512 );
+        BOstraceFunctionEntry0( TNAME_DEVLIST_7 );
+        BOstraceFunctionEntry1( TNAME_DEVLIST_8, 0x00abcdef );
+        BOstraceFunctionEntryExt(TNAME_DEVLIST_9, 0xdeadbeef, 123);
+        BOstraceFunctionExit0( TNAME_DEVLIST_9 );
+        BOstraceFunctionExit1( TNAME_DEVLIST_10, 0x00beebee );
+        BOstraceFunctionExitExt(TNAME_DEVLIST_11, 0x00badbed, -1);
+        BOstraceEventStart0( TNAME_DEVLIST_12, "BOstraceEventStart0" );
+        BOstraceEventStart1( TNAME_DEVLIST_13, "BOstraceEventStart1", 789 );
+        BOstraceEventStop( TNAME_DEVLIST_14, "BOstraceEventStop" );
+        BOstraceState0( TNAME_DEVLIST_15, "connection state", 1 );
+        BOstraceState1( TNAME_DEVLIST_16, "audio state", 2, 0xdeadbeef );
+        BtTraceBlock( 
+                for (int i = 0; i < 5; ++i) { 
+                    BOstrace1( TRACE_IMPORTANT, TNAME_DEVLIST_, "BtTraceBlock counter(1-5): %d", i+1 );
+                });
+        QString str("\"Qt String\"");
+        BtTraceQString0( TRACE_NORMAL, TNAME_DEVLIST_17, str);
+        BtTraceQString1( TRACE_NORMAL, TNAME_DEVLIST_18, "additional text;", str);
+        TBTDevAddr addr;
+        addr.SetReadable(_L("0060576ff376"));
+        BtTraceBtAddr0( TRACE_NORMAL, TNAME_DEVLIST_19, addr );
+        BtTraceBtAddr1( TRACE_NORMAL, TNAME_DEVLIST_20, "additional trace;", addr );
+    }
+
+ */
+
+// At early development phase, tracing is activated 
+#ifdef _DEBUG
+#define BLUETOOTHTRACE_ENABLED
+#endif //_DEBUG
+
+/*
+ * Tracing media configuration
+ */  
+#ifdef BLUETOOTHTRACE_ENABLED
+    #ifdef __WINS__
+    #define BLUETOOTHTRACE_MEDIA_FILE
+    #else 
+    // RDEBUG is used for tracing output before we migrate to OST tracing.
+    #define BLUETOOTHTRACE_MEDIA_RDEBUG
+    // #define BLUETOOTHTRACE_MEDIA_OST 
+    #endif // __WINS__
+#endif //BLUETOOTHTRACE_ENABLED
+
+/*
+ * Configuration of tracing to file
+ */
+#ifdef BLUETOOTHTRACE_MEDIA_FILE
+
+_LIT( KLogFile, "btenglog.txt" );
+_LIT( KLogDir, "bt" );
+
+#endif //BLUETOOTHTRACE_MEDIA_FILE
+
+/*
+ * Configuration of tracing using RDebug
+ */
+#ifdef BLUETOOTHTRACE_MEDIA_RDEBUG
+
+#endif //BLUETOOTHTRACE_MEDIA_RDEBUG
+
+/*
+ * Configuration of tracing using OST
+ */
+#ifndef BLUETOOTHTRACE_MEDIA_OST
+
+/**
+ * Group-mapping aligning with OST groups.
+ * The purpose of using groups is to ease migrating tracing from legacy logging to OST.
+ */
+#define TRACE_FATAL       "[FATAL]"
+#define TRACE_IMPORTANT   "[IMPTT]"
+#define TRACE_NORMAL      "[NORML]"
+#define TRACE_API         "[ API ]"
+#define TRACE_FLOW        "[FLOW ]"
+#define TRACE_STATE       "[STATE]"
+#define TRACE_DETAILED    "[DETLD]"
+#define TRACE_DEBUG       "[DEBUG]"
+#define TRACE_PERFORMANCE "[PFMAN]"
+
+/**
+ * Component Identifier to be written into traces:
+ */
+_LIT(KComponentName, "[BtNotif]");
+
+#endif //BLUETOOTHTRACE_MEDIA_OST
+
+#endif // BLUETOOTHTRACECONFIG_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/src/bluetoothnotification.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,440 @@
+/*
+* ============================================================================
+*  Name        : bluetoothnotification.cpp
+*  Part of     : bluetoothengine / btnotif
+*  Description : Class for managing an actual user notification or query.
+*                It hides UI framework-specifics in a private class.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.1
+*/
+
+#include "bluetoothnotification.h"
+#include <hb/hbcore/hbsymbianvariant.h>
+#include "btnotificationmanager.h"
+#include "btnotifserver.h"
+#include "bluetoothtrace.h"
+#include <utf.h>  // for debugging
+
+/**  Identifier of Bluetooth device dialog plug-in. */
+_LIT( KBTDevDialogId, "com.nokia.hb.btdevicedialog/1.0" );
+/**  Key name of result. */
+_LIT( KBTDevDialogResult, "result" );
+_LIT( KBTDevDialogInput, "input" );
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// C++ default constructor
+// ---------------------------------------------------------------------------
+//
+CBluetoothNotification::CBluetoothNotification( CBTNotificationManager* aManager )
+:   iManager( aManager )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Symbian 2nd-phase constructor
+// ---------------------------------------------------------------------------
+//
+void CBluetoothNotification::ConstructL()
+    {
+    iNotificationData = CHbSymbianVariantMap::NewL();
+    iDialog = CHbDeviceDialogSymbian::NewL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewL.
+// ---------------------------------------------------------------------------
+//
+CBluetoothNotification* CBluetoothNotification::NewL( 
+    CBTNotificationManager* aManager )
+    {
+	BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    CBluetoothNotification* self = new( ELeave ) CBluetoothNotification( aManager );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+	BOstraceFunctionExit0( DUMMY_DEVLIST );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBluetoothNotification::~CBluetoothNotification()
+{
+    BOstraceFunctionEntry1( DUMMY_DEVLIST, this );
+    delete iDialog;
+    delete iNotificationData;
+    delete iReturnData;
+	BOstraceFunctionExit1( DUMMY_DEVLIST, this )
+}
+
+
+// ---------------------------------------------------------------------------
+// Resets the notification, clean all the internals.
+// ---------------------------------------------------------------------------
+//
+void CBluetoothNotification::Reset()
+    {
+	BOstraceFunctionEntry1( DUMMY_DEVLIST, this );
+    iType = TBluetoothDialogParams::EInvalidDialog;
+    iResourceId = ENoResource;
+    iObserver = NULL;
+    iDialog->Cancel();
+    iDialog->SetObserver( NULL );   // Not interested in a callback anymore.
+    delete iNotificationData;
+    iNotificationData = NULL;
+    iNotificationData = CHbSymbianVariantMap::NewL();
+    delete iReturnData;
+    iReturnData = NULL;
+    iReturnData = CHbSymbianVariantMap::NewL();
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Sets the data to be shown to the user.
+// ---------------------------------------------------------------------------
+//
+TInt CBluetoothNotification::SetData( TInt aDataType, const TDesC& aData )
+    {
+    TRAPD( err, SetDataL( aDataType, aData ) );
+    return (int) err;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Sets the data to be shown to the user.
+// ---------------------------------------------------------------------------
+//
+TInt CBluetoothNotification::SetData( TInt aDataType, TInt aData )
+    {
+    TRAPD( err, SetDataL( aDataType, aData ) );
+    return (int) err;
+    }
+
+// ---------------------------------------------------------------------------
+// Updates the data to be shown to the user.
+// ---------------------------------------------------------------------------
+//
+TInt CBluetoothNotification::Update( const TDesC& aData )
+    {
+    BOstraceFunctionEntry1( DUMMY_DEVLIST, this );
+    (void) aData;
+    int ret = iDialog->Update( *iNotificationData );
+    delete iNotificationData;
+    iNotificationData = NULL;
+    iNotificationData = CHbSymbianVariantMap::NewL();
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    return ret;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Show the notification, which means that it is added to the queue.
+// ---------------------------------------------------------------------------
+//
+TInt CBluetoothNotification::Show()
+    {
+	BOstraceFunctionEntry1( DUMMY_DEVLIST, this );
+    TRAPD( err, SetDataL( TBluetoothDialogParams::EDialogType, iType ) );
+    if( !err )
+        {
+        TRAP( err, SetDataL( TBluetoothDialogParams::EResource, iResourceId ) );
+        }
+    delete iReturnData;
+    iReturnData = NULL;
+    if( !err )
+        {
+        TRAP( err, iReturnData = CHbSymbianVariantMap::NewL() );
+        }
+    if( !err )
+        {
+        err = iDialog->Show( KBTDevDialogId(), *iNotificationData, this );
+        }
+    delete iNotificationData;
+    iNotificationData = NULL;
+    iNotificationData = CHbSymbianVariantMap::NewL();
+    
+    const TInt KPluginErr = CHbDeviceDialogSymbian::EPluginErrors + 1;
+    if( err == KPluginErr )
+        {
+        err = KErrNotFound;
+        }
+	BOstraceFunctionExitExt( DUMMY_DEVLIST, this, err );
+    return err;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Stop showing the notification.
+// ---------------------------------------------------------------------------
+//
+TInt CBluetoothNotification::Close()
+    {
+    BOstraceFunctionEntry1( DUMMY_DEVLIST, this );
+    iDialog->Cancel();
+    iManager->ReleaseNotification( this );
+	BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    return KErrNone;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Sets the data to be shown to the user.
+// ---------------------------------------------------------------------------
+//
+void CBluetoothNotification::SetDataL( TInt aType, const TDesC& aData )
+    {
+    BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, aType );
+    TBuf16<6> key;
+    TInt err = 0;
+    CHbSymbianVariant* value = NULL;
+    switch( aType )
+        {
+        case TBluetoothDialogParams::EAddress:
+        case TBluetoothDeviceDialog::EDeviceName:
+        case TBluetoothDeviceDialog::EAdditionalDesc:
+        case TBluetoothDialogParams::EDialogTitle:
+            key.Num(aType);
+            value = CHbSymbianVariant::NewL( (TAny*) &aData, CHbSymbianVariant::EDes );
+			BtTraceBlock( 
+                    TBuf<32> buf;
+                    switch (aType) {
+                        case TBluetoothDialogParams::EAddress:
+                            _LIT(KAddress,"EAddress");
+                            buf.Append(KAddress); 
+                            break;
+                        case TBluetoothDeviceDialog::EDeviceName:
+                            _LIT(KDeviceName,"EDeviceName");
+                            buf.Append(KDeviceName); 
+                            break;
+                        case TBluetoothDeviceDialog::EAdditionalDesc:
+                            _LIT(KAdditionalDesc,"EAdditionalDesc");
+                            buf.Append(KAdditionalDesc); 
+                            break;
+                    }
+                    TPtrC p(buf);
+                    TPtrC16 *ptr = (TPtrC16 *)value->Data();
+                    BOstraceExt2( TRACE_DEBUG, DUMMY_DEVLIST, "SetData [%S] = [%S]", &p, ptr);
+                    );
+            err = iNotificationData->Add( key, value );   // Takes ownership of value
+            if ( err )
+                {
+                // Note: need a proper exception handling. 
+                // NOTIF_NOTHANDLED( err )
+                }
+            break;
+        case TBluetoothDialogParams::EResource:
+        case TBluetoothDeviceDialog::EDeviceClass:
+        case TBluetoothDeviceDialog::EAdditionalInt:
+            PanicServer( EBTNotifPanicBadArgument );
+            break;
+        case TBluetoothDialogParams::ENoParams:
+        case TBluetoothDeviceDialog::ENoParams:
+        default:
+            break;
+        }
+		BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Sets the data to be shown to the user.
+// ---------------------------------------------------------------------------
+//
+void CBluetoothNotification::SetDataL( TInt aType, TInt aData )
+    {
+    BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, aType );
+    TBuf<6> key;
+    TInt err = 0;
+    CHbSymbianVariant* value = NULL;
+    switch( aType )
+        {
+        case TBluetoothDialogParams::EDialogType:
+        case TBluetoothDialogParams::EResource:
+        case TBluetoothDialogParams::EDialogTitle:
+        case TBluetoothDeviceDialog::EDeviceClass:
+        case TBluetoothDeviceDialog::EAdditionalInt:
+            key.Num(aType);
+            value = CHbSymbianVariant::NewL( (TAny*) &aData, CHbSymbianVariant::EInt );
+			BtTraceBlock( 
+                    TBuf<32> buf;
+                    switch (aType) {
+                        case TBluetoothDialogParams::EDialogType:
+                            buf = _L("EDialogType"); 
+                            break;
+                        case TBluetoothDialogParams::EResource:
+                            buf = _L("EResource");
+                            break;
+                        case TBluetoothDeviceDialog::EDeviceClass:
+                            buf = _L("EDeviceClass");
+                            break;
+                        case TBluetoothDeviceDialog::EAdditionalInt:
+                            buf = _L("EAdditionalInt");
+                            break;
+                    }
+                    TPtrC p(buf);
+                    TInt *intPtr = (TInt *)value->Data();
+                    BOstraceExt2( TRACE_DEBUG, DUMMY_DEVLIST, "SetData [%S] = [%d]", &p, *intPtr);
+                    );
+			err = iNotificationData->Add( key, value );   // Takes ownership of value
+	         if ( err )
+	             {
+                 // need a proper exception handling.
+                 //NOTIF_NOTHANDLED( !err )
+	             }
+            
+            break;
+        case TBluetoothDialogParams::EAddress:
+        case TBluetoothDeviceDialog::EDeviceName:
+            PanicServer( EBTNotifPanicBadArgument );
+            break;
+        case TBluetoothDialogParams::ENoParams:
+        case TBluetoothDeviceDialog::ENoParams:
+        default:
+            break;
+        }
+		BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MHbDeviceDialogObserver.
+// Callback called when data is received from a device dialog.
+// ---------------------------------------------------------------------------
+//
+void CBluetoothNotification::DataReceived( CHbSymbianVariantMap& aData )
+    {
+    BOstraceFunctionEntry1( DUMMY_DEVLIST, this );
+    BtTraceBlock( debugHbSymbianVariantMap(aData); );
+    for( TInt i = 0; i < aData.Keys().MdcaCount(); i++ )
+        {
+        TPtrC key( aData.Keys().MdcaPoint( i ).Ptr(), aData.Keys().MdcaPoint( i ).Length() );
+        const CHbSymbianVariant* valueRef = aData.Get( key );
+        CHbSymbianVariant* value = CHbSymbianVariant::NewL( valueRef->Data(), valueRef->Type() );
+        TInt err = iReturnData->Add( key, value );
+        NOTIF_NOTHANDLED( !err )
+        }
+    iObserver->MBRDataReceived( aData );
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+#ifdef BLUETOOTHTRACE_ENABLED
+
+void CBluetoothNotification::debugHbSymbianVariantMap( CHbSymbianVariantMap& aData)
+    {
+    for( TInt i = 0; i < aData.Keys().MdcaCount(); i++ )
+        {
+        TBuf<128> buf;
+        TPtrC key( aData.Keys().MdcaPoint( i ).Ptr(), aData.Keys().MdcaPoint( i ).Length() );
+        buf = key;
+        buf.Append(_L(" = "));
+        const CHbSymbianVariant* value = aData.Get( key );
+        TBuf<16> nbr;
+        TBuf<32> newBuf;
+        switch (value->Type()) {
+            case CHbSymbianVariant::EInt :
+                buf.Append(_L("[EInt] ")); 
+                nbr.Num(*((TInt*)value->Data()));
+                buf.Append(nbr);
+                break;
+            case  CHbSymbianVariant::EBool :
+                buf.Append(_L("[EBool] ")); 
+                buf.Append(*((TBool*)value->Data()) ? _L("True") : _L("False"));
+                break;
+            case CHbSymbianVariant::EUint :
+                buf.Append( _L("[EUint] ")); 
+                nbr.Num(*((TUint*)value->Data()));
+                buf.Append(nbr);
+                break;
+            case CHbSymbianVariant::EReal  :
+                buf.Append(_L("[EReal] ")); 
+                nbr.Num(*((TReal*)value->Data()));
+                buf.Append(nbr);
+                break;
+            case CHbSymbianVariant::EDes :  // TDesC
+                buf.Append(_L("[EDes] ")); 
+                buf.Append(*((TPtrC16 *)value->Data()));
+                break;
+            case CHbSymbianVariant::EBinary :  // TDesC8
+                buf.Append(_L("[EBinary] ")); 
+                // the following function caused problems when converting this function to 
+                // a trace function in bluetoothtrace.h
+                CnvUtfConverter::ConvertToUnicodeFromUtf8(newBuf,*((TPtrC8 *)value->Data()) );
+                buf.Append(newBuf);
+                break;
+            case CHbSymbianVariant::EChar  : // a TChar
+                buf.Append(_L("[EChar] ")); 
+                buf.Append(*((TChar *)value->Data()));
+                break;
+            case CHbSymbianVariant::ERect  : // a TRect
+            case CHbSymbianVariant::EPoint : // a TPoint
+            case CHbSymbianVariant::ESize  : // a TSize
+            case CHbSymbianVariant::EDesArray : //  a MDesCArray
+                break;
+            default:
+                break;
+            }
+        TPtrC p(buf);
+        BOstraceExt1( TRACE_DEBUG, DUMMY_DEVLIST, "HbSymbianVariantMap [%S]", &p);
+        }
+    }
+#endif // BLUETOOTHTRACE_ENABLED
+// ---------------------------------------------------------------------------
+// From class MHbDeviceDialogObserver.
+// Callback called when a device dialog is closed.
+// ---------------------------------------------------------------------------
+//
+void CBluetoothNotification::DeviceDialogClosed( TInt aCompletionCode )
+    {
+    BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, aCompletionCode );
+    TPckg<TBool> result( EFalse );
+    TPtrC8 resultPtr( result );
+    const CHbSymbianVariant* value = iReturnData->Get( KBTDevDialogResult );
+    if( value && value->IsValid() )
+        {
+        result() = *value->Value<TBool>();
+        }
+    RBuf8 resultBuf;
+    value = iReturnData->Get( KBTDevDialogInput );
+    if( value && value->IsValid() )
+        {
+        HBufC8* data = value->Value<HBufC8>();
+        if( !resultBuf.Create( data->Length() + result.Length() ) )
+            {
+            resultBuf = *data;
+            resultBuf.Insert( 0, result );
+            resultPtr.Set( resultBuf );
+            }
+        }
+    if( iObserver )
+        {
+        if( aCompletionCode == CHbDeviceDialogSymbian::ECancelledError )
+            {
+            aCompletionCode = KErrCancel;
+            }
+        iObserver->MBRNotificationClosed( aCompletionCode, resultPtr );
+        }
+    iManager->ReleaseNotification( this );
+    // Note that we might get deleted after releasing ourselves.
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/src/btnotifconnection.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,964 @@
+/*
+* ============================================================================
+*  Name        : btnotifconnection.cpp
+*  Part of     : bluetoothengine / btnotif
+*  Description : Class for observing events of a single connection, and for 
+*                managing any user notifications related to the connection.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.1
+*/
+
+#include "btnotifconnection.h"
+#include <btextnotifiers.h>
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <btextnotifierspartner.h>
+#endif
+
+#include "btnotifconnectiontracker.h"
+#include "btnotifpairinghelper.h"
+#include "btnotificationmanager.h"
+#include "btnotifclientserver.h"
+#include "bluetoothtrace.h"
+
+/**  Id for the baseband connection watcher active object. */
+const TInt KConnectionWatcher = 40;
+/**  Id for the registry watcher active object. */
+const TInt KRegistryWatcher = 41;
+/**  Id for the active object for updating the registry. */
+const TInt KRegistryRetriever = 42;
+/**  Event mask for subscribing to baseband connection events  
+ * (need to check if these are appropriate). */
+const TInt KBbEventMask = ENotifyAnyRole | ENotifyAuthenticationComplete |
+    ENotifyPhysicalLinkUp | ENotifyPhysicalLinkDown | ENotifyPhysicalLinkError;
+
+
+// ======== LOCAL FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Decide the device name to display from the device information, and 
+// converts the name if necessary.
+// ---------------------------------------------------------------------------
+//
+void GetDeviceNameL( TBTDeviceName& aName, const CBTDevice& aDevice )
+    {
+    if( aDevice.IsValidFriendlyName() )
+        {
+        aName.Copy( aDevice.FriendlyName() );
+        }
+    else
+        {
+        aName.Zero();
+        if( aDevice.IsValidDeviceName() )
+            {
+            aName = BTDeviceNameConverter::ToUnicodeL( aDevice.DeviceName() );
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// Compare 2 device records device pairing has succeeded.
+// aDev2 is the updated device record, aDev1 is the previous record.
+// ---------------------------------------------------------------------------
+//
+TBool CheckRegistryPairedStatus( const CBTDevice* aOrig, const CBTDevice* aNew )
+    {
+    TBool result = EFalse;
+    // Use the device class to check that this has any valid information.
+    if( aOrig->AsNamelessDevice().IsValidDeviceClass() &&
+        !( aOrig->IsValidPaired() && aOrig->IsPaired() ) ||
+        aOrig->LinkKeyType() == ELinkKeyUnauthenticatedUpgradable )
+        {
+        // Only consider the result if the original device is not marked as paired.
+        if( aNew->IsValidPaired() && aNew->IsPaired() && aNew->IsValidLinkKey() && 
+            aNew->LinkKeyType() != ELinkKeyUnauthenticatedUpgradable )
+            {
+            // The new device record has valid pairing information, so
+            // this device is now paired.
+            result = ETrue;
+            }
+        }
+    return result;
+    }
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// C++ default constructor
+// ---------------------------------------------------------------------------
+//
+CBTNotifConnection::CBTNotifConnection(  const TBTDevAddr& aAddr,
+    CBTNotifConnectionTracker* aTracker )
+:   iAddr( aAddr ),
+    iTracker( aTracker )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Symbian 2nd-phase constructor
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::ConstructL()
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    iDevice = CBTDevice::NewL( iAddr );
+    iPhyActive = CBtSimpleActive::NewL(*this, KConnectionWatcher );
+    iRegActive = CBtSimpleActive::NewL( *this, KRegistryRetriever );
+    // ToDo: need to check if this succeeds if a connection is 
+    // being created, in case of outgoing pairing.
+    User::LeaveIfError( iPhyLink.Open( iTracker->SocketServerSession(), iAddr ) );
+    // Subscribe to events.
+    iBasebandEvent.FillZ(); // To be sure that we are not reading false events.
+    iPhyLink.NotifyNextBasebandChangeEvent( iBasebandEvent,
+                iPhyActive->RequestStatus(), KBbEventMask );
+    iPhyActive->GoActive();
+    // Get the details from BT registry
+    TBTRegistrySearch pattern;
+    pattern.FindAddress( iAddr );
+    User::LeaveIfError( iRegistry.Open( iTracker->RegistryServerSession() ) );
+    iRegistry.CreateView( pattern, iRegActive->RequestStatus() );
+    iRegActive->GoActive();
+    iCurrentOp = EReadingRegistry;
+    iRegDevArray  = new CBTDeviceArray(1);  // only 1 entry ever used
+    // ToDo: more initialization needed?
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewLC.
+// ---------------------------------------------------------------------------
+//
+CBTNotifConnection* CBTNotifConnection::NewLC( const TBTDevAddr& aAddr,
+    CBTNotifConnectionTracker* aTracker )
+    {
+    CBTNotifConnection* self = new( ELeave ) CBTNotifConnection( aAddr, aTracker );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBTNotifConnection::~CBTNotifConnection()
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    if( iNotification )
+        {
+        // Clear the notification callback, we cannot receive them anymore.
+        iNotification->RemoveObserver();
+        iNotification->Close(); // Also dequeues the notification from the queue.
+        iNotification = NULL;
+        }
+    delete iRegActive;
+    delete iRegistryResponse;
+    iRegistry.Close();
+    delete iDevMan;
+
+    delete iPhyActive;
+    iPhyLink.Close();
+    delete iDevice;
+    delete iPairingHelper;
+
+    while( iMsgHandleQ.Count() )
+        {
+        CompleteClientRequest( KErrDisconnected, KNullDesC8 );
+        }
+    iMsgHandleQ.Close();
+    iAcceptedConnections.Close();
+    iDeniedConnections.Close();
+    iRegDevArray->ResetAndDestroy(); 
+    delete iRegDevArray;
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Check what to do next.
+// This function should be called whenever we may be ready for the next
+// request/action, which is from any callback function i.e. 
+// MBAORequestCompletedL, MBRNotificationClosed, HandleNotifierRequestL and
+// CancelNotifierRequestL.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::CheckNextOperationL()
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    if( iCurrentOp == EIdle )
+        {
+        // Check the link state, to see if it has gone down already.
+        TUint32 linkState = 0;
+        TInt err = iPhyLink.PhysicalLinkState( linkState );
+        TBool linkDown = linkState & ENotifyPhysicalLinkDown;
+        if( ( !err && linkDown ) || err == KErrDisconnected )
+            {
+            // The link state tells us that the link is down,
+            // inform the connection tracker the we are done.
+            iTracker->HandleLinkCountChangeL();
+            // Note that we may be deleted now!
+            }
+        else if( iMsgHandleQ.Count() )
+            {
+            // Get the next request and handle it.
+            // ToDo: differentiate between notifier and pairing message!
+            const RMessage2* message = iTracker->Server()->FindMessageFromHandle( iMsgHandleQ[0] );
+            NOTIF_NOTHANDLED( message )
+            TInt opcode = message->Function();
+            if( opcode <= EBTNotifUpdateNotifier )
+                {
+                TBuf8<0x250> paramsBuf;    // Size needs to be long enough to read all possible parameter sizes.
+                message->ReadL( EBTNotifSrvParamSlot, paramsBuf );
+                HandleNotifierRequestL( paramsBuf, *message );
+                }
+            else
+                {
+                iMsgHandleQ.Remove( 0 );
+                StartBondingL( *message );
+                }
+            }
+        }
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Complete the first outstanding client request and removes it from the queue.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::CompleteClientRequest( TInt aReason, const TDesC8& aReply )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    NOTIF_NOTHANDLED( iMsgHandleQ.Count() )
+    TInt err = iTracker->Server()->CompleteMessage( iMsgHandleQ[0], aReason, aReply );
+    NOTIF_NOTHANDLED( !err )
+    iMsgHandleQ.Remove( 0 );
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Distinguish a request and pass to corresponding handle.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::HandleNotifierRequestL( const TDesC8& aParams,
+    const RMessage2& aMessage )
+    {
+    BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, aMessage.Int0() );
+    if( !iMsgHandleQ.Count() || iMsgHandleQ[0] != aMessage.Handle() )
+        {
+        // If we are processing a queued request, we of course don't queue 
+        // it again. In that case we are handling the first request from the queue.
+        iMsgHandleQ.AppendL( aMessage.Handle() );
+        }
+    if( iCurrentOp == EIdle || iCurrentOp == EBonding )
+        {
+        // ToDo: check non-pairing operation when bonding
+        TInt uid = aMessage.Int0();
+        if( uid == KBTManAuthNotifierUid.iUid )
+            {
+            HandleAuthorizationReqL( aParams );
+            }
+        else if( uid == KBTManPinNotifierUid.iUid ||
+                 uid == KBTPinCodeEntryNotifierUid.iUid ||
+                 uid == KBTNumericComparisonNotifierUid.iUid ||
+                 uid == KBTPasskeyDisplayNotifierUid.iUid )
+            {
+            if( !iPairingHelper )
+                {
+                BOstrace0( TRACE_NORMAL, DUMMY_DEVLIST, 
+                        "[BTNOTIF]\t CBTNotifConnection::HandleNotifierRequestL: creating CBTNotifPairingHelper");
+                iPairingHelper = CBTNotifPairingHelper::NewL( this, iTracker );
+                }
+            if( iCurrentOp != EBonding  )
+                {
+                iCurrentOp = EPairing;
+                }
+            iPairingHelper->StartPairingNotifierL( uid, aParams );
+            }
+        // We may be done with the current request, proceed to the next one
+        CheckNextOperationL();
+        }
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Update a notifier, update the outstanding dialog if the notifier request 
+// is currently being served.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::HandleNotifierUpdateL( const TDesC8& aParams,
+    const RMessage2& aMessage )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    NOTIF_NOTHANDLED( iCurrentOp != EIdle )
+    (void) aParams;
+    TBuf8<0x250> paramsBuf;    // Size needs to be long enough to read all possible sizes.
+    aMessage.ReadL( EBTNotifSrvParamSlot, paramsBuf );
+    TInt uid = aMessage.Int0();
+    if( uid == KBTManAuthNotifierUid.iUid )
+        {
+        TBTNotifierUpdateParams params;
+        TPckgC<TBTNotifierUpdateParams> paramsPckg( params );
+        paramsPckg.Set( paramsBuf );
+        // The result means result of conversion to unicode
+        if( !paramsPckg().iResult )
+            {
+            // Only update locally, registry will update us with the same info later on.
+            iDevice->SetDeviceNameL( BTDeviceNameConverter::ToUTF8L( paramsPckg().iName ) );
+            if( iNotification )
+                {
+                // Update the dialog with the new name. It is up to the dialog to 
+                // determine the validity (in case another dialog is shown).
+                //iNotification->Update(  )
+                }
+            }
+        }
+    else if( iPairingHelper && ( uid == KBTPinCodeEntryNotifierUid.iUid ||
+             uid == KBTNumericComparisonNotifierUid.iUid ||
+             uid == KBTPasskeyDisplayNotifierUid.iUid ) )
+        {
+        // Just forward to pairing helper
+        iPairingHelper->UpdatePairingNotifierL( uid, paramsBuf );
+        }
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Cancel a request, dismiss the outstanding dialog if the notifier request 
+// is currently being served.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::CancelNotifierRequestL( const RMessage2& aMessage )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    NOTIF_NOTHANDLED( iCurrentOp != EIdle )
+    TInt pos = iMsgHandleQ.Find( aMessage.Handle() );
+    if( pos > KErrNotFound )
+        {
+        // We have queued the message, remove it from the queue.
+        iMsgHandleQ.Remove( pos );
+        // We use the supplied handle to remove it, as it may not be
+        // the first in the queue.
+        TInt err = iTracker->Server()->CompleteMessage( aMessage.Handle(), KErrCancel, KNullDesC8 );
+        NOTIF_NOTHANDLED( !err )
+        if( pos == 0 )
+            {
+            // There could be the case that we are still post-processing
+            // the previous request (e.g. blocking query), then the next
+            // notification is not yet started but the first in the queue.
+            // We can see that from the current operation type.
+            if( iNotification && iCurrentOp < EAdditionalNotes )
+                {
+                // Cancel the user query
+                // This will also unregister us from the notification.
+                TInt err = iNotification->Close();
+                NOTIF_NOTHANDLED( !err )
+                iNotification = NULL;
+                iCurrentOp = EIdle;
+                }
+            if( iPairingHelper )
+                {
+                // The pairing helper calls back PairingCompleted and sets state.
+                iPairingHelper->CancelPairingNotifierL( aMessage.Int0() );
+                // The pairing helper may have now been deleted.
+                }
+            }
+        }
+    // We may be done with the current request, proceed to the next one
+    CheckNextOperationL();
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Start a bonding operation with the remote device.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::StartBondingL( const RMessage2& aMessage )
+    {
+    BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, aMessage.Function() );
+    if( iCurrentOp == EIdle || iCurrentOp > EInternalOperations )
+        {
+        __ASSERT_ALWAYS( !iPairingHelper, PanicServer( EBTNotifPanicBadState ) );
+        iPairingHelper = CBTNotifPairingHelper::NewL( this, iTracker );
+        // The pairingg helper stored the handle, not in our queue here.
+        // This is because bonding will generate a pairing notifier request, which 
+        // will be completed first. The bookkeeping gets complicated if we have to
+        // re-order the queue here.
+        iPairingHelper->StartBondingL( aMessage.Handle() );
+        iCurrentOp = EBonding;
+        }
+    else if( iCurrentOp == EPairing || iCurrentOp == EBonding )
+        {
+        // We only do one pairing at the time.
+        User::Leave( KErrInUse );
+        }
+    else
+        {
+        // We only store it here if it is not handled immediately.
+        iMsgHandleQ.AppendL( aMessage.Handle() );
+        }
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Cancel an ongoing bonding operation with the remote device.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::CancelBondingL()
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    if( iPairingHelper )
+        {
+        iPairingHelper->CancelBondingL();
+        }
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// The pairing handler has completed a pairing operation.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::PairingCompleted()
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    __ASSERT_ALWAYS( iPairingHelper, PanicServer( EBTNotifPanicNullMember ) );
+    if( iPairingHelper->CurrentOperation() == CBTNotifPairingHelper::EIdle )
+        {
+        // We are still idle. Remove the pairing helper
+        delete iPairingHelper;
+        iPairingHelper = NULL;
+        }
+    if( iCurrentOp == EPairing || iCurrentOp == EBonding )
+        {
+        iCurrentOp = EIdle;
+        TRAP_IGNORE( CheckNextOperationL() );
+        }
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Process a new pairing result, and determine if we need to show 
+// anything to the user.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::PairingResult( TInt aError )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    if( !iPairingHelper )
+        {
+        TRAP_IGNORE( iPairingHelper = CBTNotifPairingHelper::NewL( this, iTracker ) );
+        }
+    if( iPairingHelper )
+        {
+        iPairingHelper->HandleAuthenticationCompleteL( aError );
+        }
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Process the new service-level connection, and determine if we need to
+// show anything to the user.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::ServiceConnectedL( TBTProfile aProfile )
+    {
+    (void) aProfile;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Process the new service-level disconnection, and determine if we need to
+// show anything to the user.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::ServiceDisconnectedL( TBTProfile aProfile )
+    {
+    (void) aProfile;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Ask the user if he/she wants to block future connection requests. 
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::LaunchBlockingQueryL()
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    iCurrentOp = EBlocking;
+    TBTDialogResourceId resourceId = EBlockUnpairedDevice;
+    if( iDevice->IsValidPaired() && iDevice->IsPaired() &&
+        iDevice->LinkKeyType() != ELinkKeyUnauthenticatedUpgradable )
+        {
+        resourceId = EBlockPairedDevice;
+        }
+    PrepareNotificationL( TBluetoothDialogParams::EQuery, resourceId );
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Modify the record for the remote device in BTRegistry, with the changes 
+// already made in the local record.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::UpdateRegistryEntryL()
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    // We use CBTEngDevMan here. We could use the registry API directly, however,
+    // using this convenience API makes the registry processing much simpler.
+    if( !iDevMan )
+        {
+        iDevMan = CBTEngDevMan::NewL( this );
+        }
+    iDevMan->ModifyDevice( *iDevice );
+    if( iCurrentOp == EIdle ||
+        ( ( iCurrentOp == EPairing || iCurrentOp == EBonding ) &&
+          iPairingHelper->CurrentOperation() == CBTNotifPairingHelper::EIdle ) )
+        {
+        // To make sure that we don't get deleted while updating.
+        iCurrentOp = EUpdatingRegistry;
+        }
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+// ---------------------------------------------------------------------------
+// Modify the record for the remote device in BTRegistry, if aTrusted == true, then
+// update trusted status after reading device info from registry
+//
+// ---------------------------------------------------------------------------
+
+void CBTNotifConnection::UpdateRegistryEntryL( TBool aTrusted )
+    {
+    BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, aTrusted );
+    if (!aTrusted) {
+        UpdateRegistryEntryL();
+        return;
+        }
+    // We use CBTEngDevMan here. We could use the registry API directly, however,
+    // using this convenience API makes the registry processing much simpler.
+    if( !iDevMan )
+        {
+        iDevMan = CBTEngDevMan::NewL( this );
+        }
+    // first read device info from registry, to make sure we have up-to-date local info
+    iCurrentOp = EReadingRegistry;
+    GetDeviceFromRegistry( iDevice->BDAddr() );
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBTNotificationResult.
+// Handle a result from a user query.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::MBRDataReceived( CHbSymbianVariantMap & aData )
+    {
+    (void) aData;
+    NOTIF_NOTIMPL
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBTNotificationResult.
+// The notification is finished.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::MBRNotificationClosed( TInt aError, const TDesC8& aData )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    // ToDo: call leaving function from here!
+    __ASSERT_ALWAYS( iCurrentOp != EIdle, PanicServer( EBTNotifPanicBadState ) );
+    // First unregister from the notification, so we can already get the next one.
+    iNotification->RemoveObserver();
+    iNotification = NULL;
+    TRAP_IGNORE( NotificationClosedL( aError, aData ) );
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBtSimpleActiveObserver.
+// Handle the active object completion.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::RequestCompletedL( CBtSimpleActive* aActive,
+    TInt aStatus )
+    {
+    BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, aActive->RequestId() );
+    switch( aActive->RequestId() )
+        {
+        case KRegistryRetriever:
+            {
+            BOstrace0( TRACE_NORMAL, DUMMY_DEVLIST,  
+                    "[BTNOTIF]\t CBTNotifConnection::MBAORequestCompletedL: KRegistryRetriever" );
+            if( !iRegistryResponse )
+                {
+                // We have just created the view, now get the results.
+                // There can only be one result, as the address is unique.
+                // (note: how about LE random addresses?)
+                // Or then we have tried to re-open an existing view, so we get KErrInuse.
+                // We anyway just get the results.
+                __ASSERT_ALWAYS( aStatus < 2, PanicServer( EBTNotifPanicCorrupt ) );
+                iRegistryResponse = CBTRegistryResponse::NewL( iRegistry );
+                iRegistryResponse->Start( iRegActive->RequestStatus() );
+                iRegActive->GoActive();
+                }
+            else
+                {
+                if( !aStatus )
+                    {
+                    // There can be only one result.
+                    __ASSERT_ALWAYS( iRegistryResponse->Results().Count() == 1, PanicServer( EBTNotifPanicCorrupt ) );
+                    CBTDevice* regDevice = iRegistryResponse->Results()[0];
+                    TBool paired = CheckRegistryPairedStatus( iDevice, regDevice );
+                    iDevice->UpdateL( *regDevice );
+                    if( paired )
+                        {
+                        __ASSERT_ALWAYS( iPairingHelper, PanicServer( EBTNotifPanicNullMember ) );
+                        iPairingHelper->HandleAuthenticationCompleteL( KErrNone );
+                        }
+                    }
+                // ToDo: error handling of registry response result?
+                delete iRegistryResponse;
+                iRegistryResponse = NULL;
+                }
+            if( iCurrentOp == EReadingRegistry && !iRegActive->IsActive() )
+                {
+                // If this is part of the sequence of operations, we are done.
+                // Otherwise we just update with the latest info from registry,
+                // and then we don't interrupt or change the state.
+                iCurrentOp = EIdle;
+                }
+            }
+            // ToDo: start registry watching (preferably using registry API when this is available)
+           break;
+       case KRegistryWatcher:
+           {
+           BOstrace0( TRACE_NORMAL, DUMMY_DEVLIST,  
+                   "[BTNOTIF]\t CBTNotifConnection::MBAORequestCompletedL: KRegistryWatcher" );
+           NOTIF_NOTHANDLED( !aStatus )
+           // Ignore updates while we are already retrieving.
+           if( !iRegActive->IsActive() )
+               {
+               // Refresh our information with the latest from registry
+               iRegActive->SetRequestId( KRegistryRetriever );
+               TBTRegistrySearch pattern;
+               pattern.FindAddress( iAddr );
+               iRegistry.CreateView( pattern, iRegActive->RequestStatus() );
+               iRegActive->GoActive();
+               }
+           }
+           break;
+        case KConnectionWatcher:
+            {
+            BOstrace0( TRACE_NORMAL, DUMMY_DEVLIST, 
+                    "[BTNOTIF]\t CBTNotifConnection::MBAORequestCompletedL: KConnectionWatcher" );
+            TUint32 event = iBasebandEvent().EventType();
+            // First subscribe to the next event notification.
+            // This will overwrite iBasebandEvent().EventType() with KBbEventMask
+            iPhyLink.NotifyNextBasebandChangeEvent( iBasebandEvent,
+                        iPhyActive->RequestStatus(), KBbEventMask );
+            iPhyActive->GoActive();
+            // Link down and link error are handled in CheckNextOperationL below.
+            // ToDo: handle events!
+            if( event & ( ENotifyPhysicalLinkDown | ENotifyPhysicalLinkError ) )
+                {
+                // We re-use the error code to store the indication that the 
+                // link has disconnected. This will only be overridden by next 
+                // event, which can only be a connection up event.
+                iBasebandEvent().SetErrorCode( KErrDisconnected );
+                }
+            if( iPairingHelper )
+                {
+                if( event & ( ENotifyPhysicalLinkDown | ENotifyPhysicalLinkError |
+                    ENotifyAuthenticationComplete ) )
+                    {
+                    // Results interesting for pairing result processing.
+                    iPairingHelper->HandleAuthenticationCompleteL( iBasebandEvent().SymbianErrorCode() );
+                    }
+                else if( event & ENotifyPhysicalLinkUp &&
+                        iPairingHelper->CurrentOperation() == CBTNotifPairingHelper::EDedicatedBonding )
+                    {
+                    iPairingHelper->StartBondingL( 0 );
+                    }
+                }
+            }
+            break;
+        default:
+            PanicServer( EBTNotifPanicBadState );
+            break;
+        }
+    // We may be done with the current request, proceed to the next one
+    CheckNextOperationL();
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBtSimpleActiveObserver.
+// Cancel and clean up all requests related to the active object.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::CancelRequest( TInt aRequestId )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    if ( aRequestId == KConnectionWatcher )
+        {
+        iPhyLink.CancelNextBasebandChangeEventNotifier();
+        }
+    else if ( aRequestId == KRegistryWatcher && iRegistryResponse )
+        {
+        iRegistryResponse->Cancel();
+        }
+    else if ( aRequestId == KRegistryRetriever )
+        {
+        iRegistry.CancelRequest( iRegActive->RequestStatus());
+        }    
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBtSimpleActiveObserver.
+// 
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::HandleError( CBtSimpleActive* aActive, 
+        TInt aError )
+    {
+    (void) aActive;
+    (void) aError;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBTEngDevmanObserver.
+// Registry modification has completed.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::HandleDevManComplete( TInt aErr )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    (void) aErr;
+    NOTIF_NOTHANDLED( !aErr )
+    if( iCurrentOp == EUpdatingRegistry )
+        {
+        // To make sure that we don't get deleted while updating.
+        iCurrentOp = EIdle;
+        }
+    // Refresh is done separately, we will get notified through 
+    // the registry watcher of the change.
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBTEngDevmanObserver.
+// Callback for getting a device from the registry
+//
+// Currently only used in context of setting device to trusted
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::HandleGetDevicesComplete( 
+        TInt err, CBTDeviceArray* deviceArray ) 
+    {
+    BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, err );
+    // err is not used here very much, -1 could be returned if there is no device in registry,
+    // but this case is covered by examing mRegDevArray.
+    if (!err && (iCurrentOp == EReadingRegistry) ) {
+        CBTDevice* dev (0);
+        if ( deviceArray->Count() ) {
+            dev = deviceArray->At( 0 );
+            }
+        if ( dev ) {
+            iDevice = dev->CopyL();
+            }
+        // Set device to trusted
+        // Copy the existing security settings.
+        TBTDeviceSecurity sec( iDevice->GlobalSecurity().SecurityValue(),
+                      iDevice->GlobalSecurity().PasskeyMinLength() );
+        sec.SetNoAuthorise( ETrue );  // new value:  set device as trusted
+        iDevice->SetGlobalSecurity( sec );
+        iDevMan->ModifyDevice( *iDevice );   // write trusted (& paired) status to registry
+        // To make sure that we don't get deleted while updating.
+        iCurrentOp = EUpdatingRegistry;
+        }
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+// ---------------------------------------------------------------------------
+// Retrieves device from registry based on BT address parameter
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::GetDeviceFromRegistry( const TBTDevAddr &addr )
+{
+    BOstraceFunctionEntry1( DUMMY_DEVLIST, this );
+    TBTRegistrySearch searchPattern;
+    searchPattern.FindAddress( addr );
+    // and get this device from registry
+    iRegDevArray->ResetAndDestroy();
+    iDevMan->GetDevices(searchPattern, iRegDevArray);
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+}
+
+// ---------------------------------------------------------------------------
+// Get and configure a notification.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::PrepareNotificationL( TBluetoothDialogParams::TBTDialogType aType,
+    TBTDialogResourceId aResourceId )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    iNotification = iTracker->NotificationManager()->GetNotification();
+    User::LeaveIfNull( iNotification ); // For OOM exception, leaves with KErrNoMemory
+    iNotification->SetObserver( this );
+    iNotification->SetNotificationType( aType, aResourceId );
+    // Set the address of the remote device
+    TBuf<KBTDevAddrSize> addr;
+    addr.Copy( iAddr.Des() );
+    TInt err = iNotification->SetData( TBluetoothDialogParams::EAddress, addr );
+    NOTIF_NOTHANDLED( !err )
+    // Set the name of the remote device
+    TBTDeviceName name;
+    GetDeviceNameL( name, *iDevice );
+    // ToDo: handle leave in name conversion!
+    err = iNotification->SetData( (TInt) TBluetoothDeviceDialog::EDeviceName, name );
+    NOTIF_NOTHANDLED( !err )
+    // Queue the notification for displaying to the user
+    err = iTracker->NotificationManager()->QueueNotification( iNotification );
+    NOTIF_NOTHANDLED( !err )
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// The notification is finished, handle the result.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::NotificationClosedL( TInt aError, const TDesC8& aData )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    switch( iCurrentOp )
+        {
+        case EAuthorizing:
+            CompleteAuthorizationReqL( aError, aData );
+            break;
+        case EBlocking:
+            CompleteBlockingReqL( aError, aData );
+            break;
+        default:
+            NOTIF_NOTIMPL
+            break;
+        }
+    // We may be done with the current request, proceed to the next one
+    CheckNextOperationL();
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Handle a request for authorization of this connection.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::HandleAuthorizationReqL( const TDesC8& aParams )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    __ASSERT_ALWAYS( iCurrentOp == EIdle, PanicServer( EBTNotifPanicBadState ) );
+    __ASSERT_ALWAYS( !iNotification, PanicServer( EBTNotifPanicCorrupt ) );
+    TBTAuthorisationParams params;
+    TPckgC<TBTAuthorisationParams> paramsPckg( params );
+    paramsPckg.Set( aParams );
+    iCurrentOp = EAuthorizing;
+    // The name in the parameter package is the latest one, retrieved from 
+    // the remote device during this connection.
+    if( paramsPckg().iName.Length() )
+        {
+        // Update the local device record. No need to update the registry,
+        // that will be done by the stack, and we will receive the update 
+        // information when that has completed.
+        iDevice->SetDeviceNameL( BTDeviceNameConverter::ToUTF8L( paramsPckg().iName ) );
+        }
+    PrepareNotificationL( TBluetoothDialogParams::EQuery, EAuthorization );
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Process the user input and complete the outstanding authorization request. 
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::CompleteAuthorizationReqL( TInt aError, const TDesC8& aData )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    // Set our state to idle for now. This may get changed if the user just chose 
+    // to block, or if we have a pending request.
+    iCurrentOp = EIdle;
+    if( !aError )
+        {
+        TPckgC<TBool> result( EFalse );
+        result.Set( aData );
+        TBool proceed = iTracker->UpdateBlockingHistoryL( iDevice, result() );
+        if( result() == EFalse && proceed )
+            {
+            // The user denied the connection, ask to block the device.
+            LaunchBlockingQueryL();
+            }
+        CompleteClientRequest( KErrNone, aData );
+        }
+    else
+        {
+        CompleteClientRequest( aError, KNullDesC8 );
+        }
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Process the user input for blocking a device.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnection::CompleteBlockingReqL( TInt aError, const TDesC8& aData )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    TPckgC<TBool> result( EFalse );
+    result.Set( KNullDesC8 );    // to test!
+    result.Set( aData );
+    iCurrentOp = EIdle; // May get changed if we have a pending request.
+    if( !aError && result() )
+        {
+        // The user accepted to block this device.
+        TBTDeviceSecurity sec;  // use default values when setting as banned.
+        sec.SetBanned( ETrue );
+        iDevice->SetGlobalSecurity( sec );
+        if( iDevice->IsValidPaired() && iDevice->IsPaired() )
+            {
+            // Deleting the link key will also set the device as unpaired.
+            iDevice->DeleteLinkKey();
+            }
+        UpdateRegistryEntryL();
+        }
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/src/btnotifconnectiontracker.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,721 @@
+/*
+* ============================================================================
+*  Name        : btnotifconnectiontracker.cpp
+*  Part of     : bluetoothengine / btnotif
+*  Description : Bluetooth connection tracker and manager.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.1
+*/
+
+#include "btnotifconnectiontracker.h"
+#include <btextnotifiers.h>
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <btextnotifierspartner.h>
+#endif
+
+#include "btnotifconnection.h"
+#include "btnotifsession.h"
+#include "btnotifclientserver.h"
+#include "bluetoothtrace.h"
+
+/**  Id for the link key watcher active object. */
+const TInt KLinkCountWatcher = 30;
+/**  Id for the pairing result watcher active object. */
+const TInt KSspResultWatcher = 31;
+/**  Id for the registry watcher active object (TEMP!). */
+const TInt KRegistryWatcher = 41;
+/**  Time window for determining if there are too many requests. */
+#ifndef __WINS__
+#define KDENYTHRESHOLD TTimeIntervalSeconds(3)
+#else   //__WINS__
+#define KDENYTHRESHOLD TTimeIntervalSeconds(5)
+#endif  //__WINS__
+
+
+// ======== LOCAL FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Checks if the notifier is one launched by the security manager of the
+// protocol stack. These notifiers need to be served unless really not possible.
+// ---------------------------------------------------------------------------
+//
+TBool IsStackSecmanNotifier( TInt aUid )
+    {
+    TBool result = EFalse;
+    if( aUid == KBTManAuthNotifierUid.iUid || aUid == KBTManPinNotifierUid.iUid ||
+        aUid == KBTPinCodeEntryNotifierUid.iUid || aUid == KBTNumericComparisonNotifierUid.iUid ||
+        aUid == KBTPasskeyDisplayNotifierUid.iUid )
+        {
+        result = ETrue;
+        }
+    return result;
+    }
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// C++ default constructor
+// ---------------------------------------------------------------------------
+//
+CBTNotifConnectionTracker::CBTNotifConnectionTracker( CBTNotifServer* aServer )
+:   iServer( aServer )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Symbian 2nd-phase constructor
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnectionTracker::ConstructL()
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    // Start watching the number of baseband links.
+    TInt err = iLinkCount.Attach( KPropertyUidBluetoothCategory,
+                KPropertyKeyBluetoothGetPHYCount );
+    // There is not much point to continue if we can't attach to
+    // the link count key.
+    User::LeaveIfError( err );
+    iLinkCountActive = CBtSimpleActive::NewL( *this, KLinkCountWatcher );
+    iLinkCount.Subscribe( iLinkCountActive->RequestStatus() );
+    iLinkCountActive->GoActive();
+    // Open a handle to the registry server
+    User::LeaveIfError( iBTRegistrySession.Connect() );
+    // Open a handle to the socket server
+    User::LeaveIfError( iSockServ.Connect() );
+    iPairingServ = new( ELeave ) RBluetoothPairingServer();
+    if( iPairingServ->Connect() )
+        {
+        // Delete in case of error - there is no good other way to keep track.
+        delete iPairingServ;
+        iPairingServ = NULL;
+        }
+    else
+        {
+        iSspResultActive = CBtSimpleActive::NewL( *this, KSspResultWatcher );
+        User::LeaveIfError( iSspResultSession.Open( *iPairingServ ) );
+        iSspResultSession.SimplePairingResult( iSspResultAddr, iSspResultActive->RequestStatus() );
+        iSspResultActive->GoActive();
+        }
+    iConnMan = CBTEngConnMan::NewL( this );
+    iPhyLinks = CBluetoothPhysicalLinks::NewL( *this, iSockServ );
+// ToDo: remove this when registry notifications API is available!!
+    err = iRegistryChange.Attach( KPropertyUidBluetoothCategory, KPropertyKeyBluetoothRegistryTableChange );
+    User::LeaveIfError( err );
+    iRegistryActive = CBtSimpleActive::NewL( *this, KRegistryWatcher );
+    iRegistryChange.Subscribe( iRegistryActive->RequestStatus() );
+    iRegistryActive->GoActive();
+// End ToDo
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewL.
+// ---------------------------------------------------------------------------
+//
+CBTNotifConnectionTracker* CBTNotifConnectionTracker::NewL( CBTNotifServer* aServer )
+    {
+    CBTNotifConnectionTracker* self = new( ELeave ) CBTNotifConnectionTracker( aServer );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBTNotifConnectionTracker::~CBTNotifConnectionTracker()
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    iConnArray.ResetAndDestroy();
+    iConnArray.Close();
+    iDeniedRequests.Close();
+    delete iLinkCountActive;
+    iLinkCount.Close();
+    
+    delete iConnMan;
+    delete iPhyLinks;
+    iSockServ.Close();
+    delete iSspResultActive;
+    iSspResultSession.Close();
+    if( iPairingServ )
+        {
+        iPairingServ->Close();
+        delete iPairingServ;
+        }
+    delete iRegistryActive;
+    iRegistryChange.Close();
+    iBTRegistrySession.Close();
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+// ---------------------------------------------------------------------------
+// Process a client message related to notifiers.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnectionTracker::DispatchNotifierMessageL( const RMessage2& aMessage )
+    {
+    BOstraceFunctionEntryExt ( DUMMY_LIST, this, aMessage.Function() );
+    TInt opcode = aMessage.Function();
+    TInt uid = aMessage.Int0();
+    const RMessage2* message = &aMessage;
+    // Use a pointer to the original message, so that we don't duplicate it.
+    // Then we avoid any bookkeeping for keeping them in sync.
+    if( opcode == EBTNotifCancelNotifier )
+        {
+        // We only accept a cancel message from the same session as the original
+        // request (this is enforced by the RNotifier backend). So we use the
+        // session of the cancel request (if this would change, the same way as
+        // for updates can be followed).
+        // We need to find the original request to identify the handler of the 
+        // connection; the uid points to the original request.
+        message = ( (CBTNotifSession *) aMessage.Session() )->FindMessageFromUid( uid );
+        }
+    else if( opcode == EBTNotifUpdateNotifier )
+        {
+        // We accept a update messages from any client, although in practice,
+        // they will all come from the same session (through RNotifier).
+        // We need to find the original request to identify the handler of the 
+        // connection (the uid points to the original request). Through the 
+        // server, we get it from any session.
+        message = iServer->FindMessageFromUid( uid );
+        }
+    if( !message )
+        {
+        // It's hard to continue if we don't know where to route the message.
+        User::Leave( KErrDisconnected );
+        }
+    TBuf8<0x250> paramsBuf;    // Size needs to be long enough to read all possible parameter sizes.
+    CBTNotifConnection* connection = FindConnectionFromMessageL( opcode, *message, paramsBuf );
+    if( !connection )
+        {
+        User::Leave( KErrDisconnected );
+        }
+    switch( opcode )
+        {
+        case EBTNotifStartSyncNotifier:
+        case EBTNotifStartAsyncNotifier:
+            connection->HandleNotifierRequestL( paramsBuf, aMessage );
+            break;
+        case EBTNotifUpdateNotifier:
+            connection->HandleNotifierUpdateL( paramsBuf, aMessage );
+            break;
+        case EBTNotifCancelNotifier:
+            // Complete the cancel message already here, so that the caller can
+            // continue, and the next operation can close sessions with the caller.
+            aMessage.Complete( KErrNone );
+            connection->CancelNotifierRequestL( *message );
+            break;
+        default:
+            break;
+        }
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Handle a request related to pairing.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnectionTracker::HandleBondingRequestL( const RMessage2& aMessage )
+    {
+    BOstraceFunctionEntryExt ( DUMMY_LIST, this, aMessage.Function() );
+    // Bonding is an infrequently occurring operation, so we don't waste memory
+    // to keep a copy of the parameters. Instead we read them again when needed.
+    TPckgBuf<TBTDevAddr> addrBuf;
+    TInt opcode = aMessage.Function();
+    if( opcode == EBTEngPairDevice )
+        {
+        aMessage.ReadL( EBTNotifSrvParamSlot, addrBuf );
+        }
+    else if( opcode == EBTEngCancelPairDevice )
+        {
+        const RMessage2* message =
+                ( (CBTNotifSession *) aMessage.Session() )->FindMessageFromUid( EBTEngPairDevice );
+        message->ReadL( EBTNotifSrvParamSlot, addrBuf );
+        }
+    BtTraceBtAddr1( TRACE_DEBUG, DUMMY_LIST, "CBTNotifConnectionTracker::HandleBondingRequestL() addr=", addrBuf() );
+	TInt err = KErrNotFound;
+	CBTNotifConnection* connection = FindConnectionHandler( addrBuf() );
+    if( opcode == EBTEngPairDevice )
+        {
+        if( !connection )
+            {
+            // Create a connection first, then tell it to bond.
+            err = iPhyLinks->CreateConnection( addrBuf() );
+            connection = CBTNotifConnection::NewLC( addrBuf(), this );
+            iConnArray.AppendL( connection );
+            CleanupStack::Pop( connection );
+            }
+        else
+            {
+            // There is an existing connection. Care must be taken, the connection
+            // _should_ be disconnect first if this device is already paired, so that
+            // we are sure that we don't mix up the state of the connection.
+            RBTPhysicalLinkAdapter link;
+            err = link.Open( iSockServ, addrBuf() );
+            TUint32 linkState = 0;
+            if( !err )
+                {
+                err = link.PhysicalLinkState( linkState );
+                }
+            if( !err && linkState & ( ENotifyAuthenticationComplete | ENotifyEncryptionChangeOn ) )
+                {
+                // For now, we just reject the request.
+                err = KErrAlreadyExists;
+                }
+            link.Close();
+            }
+        if( !err )
+            {
+            // Start bonding immediately so that the connection object is in the right state.
+            connection->StartBondingL( aMessage );
+            }
+        }
+    else if( opcode == EBTEngCancelPairDevice && connection )
+        {
+        connection->CancelBondingL();
+        err = KErrNone;
+        aMessage.Complete( err );
+        }
+	// KErrNotFound is returned for a request to cancel pairing that has no connection.
+    if( err )
+        {
+        aMessage.Complete( err );
+        }
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Handle a change in the number of connections.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnectionTracker::HandleLinkCountChangeL()
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    TInt linkCount = 0;
+    User::LeaveIfError( iLinkCount.Get( linkCount ) );
+    if( linkCount )
+        {
+        RBTDevAddrArray links;
+        CleanupClosePushL( links );
+        User::LeaveIfError( iPhyLinks->Enumerate( links, 10 ) );
+        __ASSERT_ALWAYS( links.Count(), PanicServer( EBTNotifPanicBadState ) );
+        for( TInt i = iConnArray.Count() -1; i >= 0 ; i-- )
+            {
+            // Loop backwards, as we may remove entries from the array.
+
+            // First check the existing connections, and 
+            // remove disconnected links
+            TBTDevAddr addr = iConnArray[i]->Address();
+            TInt pos = links.Find( addr );
+            if( pos > KErrNotFound )
+                {
+                // The link we know is still connected,
+                // remove the watceher from the array.
+                links.Remove( pos );
+                // ToDo: see comment below!
+                }
+            else if( iConnArray[i]->CurrentOperation() == CBTNotifConnection::EIdle )
+                {
+                // This link is no more connected and idle, remove.
+                CBTNotifConnection* connection = iConnArray[i];
+                iConnArray.Remove( i ); // Does not delete the object.
+                delete connection;
+                }
+            // else we wait for the link to complete its operations.
+            }
+        // Now we have an array with only the new connections.
+        // Add new watchers.
+        for( TInt i = 0; i < links.Count(); i++ )
+            {
+            CBTNotifConnection* connection = CBTNotifConnection::NewLC( links[i], this );
+            iConnArray.AppendL( connection );
+            CleanupStack::Pop( connection );
+            }
+        // Close the links RBTDevAddrArray, needed before going out of scope.
+        CleanupStack::PopAndDestroy();
+        }
+    else
+        {
+        for( TInt i = iConnArray.Count() -1; i >= 0 ; i-- )
+            {
+            if( iConnArray[i]->CurrentOperation() == CBTNotifConnection::EIdle )
+                {
+                // This link is now idle, so we can remove it safely.
+                CBTNotifConnection* connection = iConnArray[i];
+                iConnArray.Remove( i ); // Does not delete the object.
+                delete connection;
+                }
+            }
+        if( !iConnArray.Count() )
+            {
+            // The array is idle, clean up the array resources.
+            iConnArray.Reset();
+            }
+        }
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Check if this device has been denied a connection already before.
+// Also check if a previous connection attempt has just been rejected.
+// ---------------------------------------------------------------------------
+//
+TBool CBTNotifConnectionTracker::UpdateBlockingHistoryL( const CBTDevice* aDevice, 
+    TBool aAccepted )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    __ASSERT_ALWAYS( aDevice, PanicServer( EBTNotifPanicBadArgument ) );
+    // Check the time since the previous event.
+    TBool result = RecordConnectionAttempts( aAccepted );
+    TInt pos = iDeniedRequests.Find( aDevice->BDAddr() );
+    if( !aAccepted )
+        {
+        if( pos == KErrNotFound )
+            {
+            // The user denied the request from a new device, record the device address.
+            if( aDevice->IsValidPaired() && aDevice->IsPaired() )
+                //[MCL]: && iDevice->LinkKeyType() != ELinkKeyUnauthenticatedUpgradable )
+                {
+                // Paired devices are allowed one time rejection without a prompt for blocking.
+                result = EFalse;
+                }
+            iDeniedRequests.AppendL( aDevice->BDAddr() );
+            }
+        // Nothing needed here if the address is already in the array.
+        }
+    else if( pos > KErrNotFound )
+        {
+        // The user accepted a request, and it was from a device he/she 
+        // previously rejected. Clear the history for this device from the array.
+        iDeniedRequests.Remove( pos );
+        }
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    return result;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBluetoothPhysicalLinksNotifier.
+// Handle baseband connection completion.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnectionTracker::HandleCreateConnectionCompleteL( TInt aErr )
+    {
+    BOstraceFunctionEntryExt ( DUMMY_LIST, this, aErr );
+	// We only connect links for starting outgoing bonding.
+	const RMessage2* message = iServer->FindMessageFromUid( (TInt) EBTEngPairDevice );
+	if( message )
+		{
+        TPckgBuf<TBTDevAddr> addrBuf;
+        message->ReadL( EBTNotifSrvParamSlot, addrBuf );
+        CBTNotifConnection* connection = FindConnectionHandler( addrBuf() );
+        __ASSERT_ALWAYS( connection, PanicServer( EBTNotifPanicBadState ) );
+        if( !aErr && connection->CurrentOperation() == CBTNotifConnection::EIdle )
+            {
+			TRAP( aErr, connection->StartBondingL( *message ) );
+			}
+        if( aErr && connection->CurrentOperation() == CBTNotifConnection::EBonding )
+            {
+            connection->PairingResult( aErr );  // Launch error note
+            }
+		}
+	BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBluetoothPhysicalLinksNotifier.
+// Handle baseband disconnection.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnectionTracker::HandleDisconnectCompleteL( TInt aErr )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+	// We only disconnect links for starting outgoing bonding.
+	const RMessage2* message = iServer->FindMessageFromUid( (TInt) EBTEngPairDevice );
+	if( message )
+		{
+        TPckgBuf<TBTDevAddr> addrBuf;
+        message->ReadL( EBTNotifSrvParamSlot, addrBuf );
+		if( !aErr )
+			{
+			aErr = iPhyLinks->CreateConnection( addrBuf() );
+			}
+		if( aErr )
+			{
+			iServer->CompleteMessage( message->Handle(), aErr, KNullDesC8 );
+            CBTNotifConnection* connection = FindConnectionHandler( addrBuf() );
+            __ASSERT_ALWAYS( connection, PanicServer( EBTNotifPanicBadState ) );
+            connection->PairingResult( aErr );  // Launch error note
+			}
+    	}
+	BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBluetoothPhysicalLinksNotifier.
+// Handle disconnection of all links.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnectionTracker::HandleDisconnectAllCompleteL( TInt aErr )
+    {
+    (void) aErr;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBTEngConnObserver.
+// Handle service-level connection completion.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnectionTracker::ConnectComplete( TBTDevAddr& aAddr, 
+    TInt aErr, RBTDevAddrArray* aConflicts )
+    {
+    (void) aAddr;
+    (void) aErr;
+    (void) aConflicts;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBTEngConnObserver.
+// Handle service-level disconnection.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnectionTracker::DisconnectComplete( TBTDevAddr& aAddr, TInt aErr )
+    {
+    (void) aAddr;
+    (void) aErr;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBtSimpleActiveObserver.
+// Handle the active object completion.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnectionTracker::RequestCompletedL( CBtSimpleActive* aActive,
+    TInt aStatus )
+    {
+    BOstraceFunctionEntryExt ( DUMMY_LIST, this, aActive->RequestId() );
+    BOstraceExt2( TRACE_DEBUG, DUMMY_DEVLIST, 
+            "CBTNotifConnectionTracker::MBAORequestCompletedL() requestid=%d status=%d", 
+            aActive->RequestId(), aStatus);
+    if( aActive->RequestId() == KLinkCountWatcher )
+        {
+        iLinkCount.Subscribe( aActive->RequestStatus() );
+        aActive->GoActive();
+        if( !aStatus )
+            {
+            // HandleLinkCountChangeL();
+            }
+        }
+// ToDo: remove this when registry notifications API is available!!
+    else if( aActive->RequestId() == KRegistryWatcher )
+        {
+        // BTRegistry notifies of a change. Check which one.
+        iRegistryChange.Subscribe( aActive->RequestStatus() );
+        aActive->GoActive();
+        TInt tableChanged = 0;
+        if( !aStatus && !iRegistryChange.Get( tableChanged ) &&
+            tableChanged == KRegistryChangeRemoteTable )
+            {
+            // A record for a remote device has changed. Tell all 
+            // connections to update their record.
+            for( TInt i = 0; i < iConnArray.Count(); i++ )
+                {
+                // Reuse the functionality in the connection
+                if( iConnArray[i]->CurrentOperation() < CBTNotifConnection::EReadingRegistry )
+                    {
+                    iConnArray[i]->RequestCompletedL( aActive, aStatus );
+                    }
+                }
+            }
+        }
+// End ToDo
+    else if( aActive->RequestId() == KSspResultWatcher )
+        {
+        iSspResultSession.SimplePairingResult( iSspResultAddr, iSspResultActive->RequestStatus() );
+        iSspResultActive->GoActive();
+        CBTNotifConnection* connection = FindConnectionHandler( iSspResultAddr );
+        // ToDo: how to handle a result of a link that already disconnected? 
+        if( connection )
+            {
+            connection->PairingResult( aStatus );
+            }
+        }
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBtSimpleActiveObserver.
+// Cancel and clean up all requests related to the active object.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnectionTracker::CancelRequest( TInt aRequestId )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    if( aRequestId == KLinkCountWatcher )
+        {
+        iLinkCount.Cancel();
+        }
+    else if( aRequestId == KSspResultWatcher )
+        {
+        iSspResultSession.CancelSimplePairingResult();
+        }
+    else if ( aRequestId == KRegistryWatcher )
+        {
+        iRegistryChange.Cancel();
+        }
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBtSimpleActiveObserver.
+// 
+// ---------------------------------------------------------------------------
+//
+void CBTNotifConnectionTracker::HandleError( CBtSimpleActive* aActive, 
+        TInt aError )
+    {
+    (void) aActive;
+    (void) aError;
+    }
+
+// ---------------------------------------------------------------------------
+// Parse the details from a client message and find the associated handler.
+// ---------------------------------------------------------------------------
+//
+CBTNotifConnection* CBTNotifConnectionTracker::FindConnectionFromMessageL(
+    TInt aOpcode, const RMessage2& aMessage, TDes8& aBuffer )
+    {
+    BOstraceFunctionEntry1( DUMMY_DEVLIST, this );
+    TInt uid = aMessage.Int0();
+    aMessage.ReadL( EBTNotifSrvParamSlot, aBuffer );
+    TBTDevAddr addr = ParseAddressL( uid, aBuffer );
+    // If this is a 
+    CBTNotifConnection* connection = FindConnectionHandler( addr );
+    if( !connection && IsStackSecmanNotifier( uid ) &&
+        ( aOpcode == EBTNotifStartAsyncNotifier || aOpcode == EBTNotifStartSyncNotifier ) )
+        {
+        // A notifier from stack. This happens if e.g. the pairing
+        // request comes in before the link count changes (like security
+        // mode 3). Create the handler and queue the request.
+        // And note that 
+        connection = CBTNotifConnection::NewLC( addr, this );
+        iConnArray.AppendL( connection );
+        CleanupStack::Pop( connection );
+        }
+    BOstraceFunctionExitExt( DUMMY_DEVLIST, this, connection );
+    return connection;
+    }
+
+
+// ---------------------------------------------------------------------------
+// read the address from a client message.
+// ---------------------------------------------------------------------------
+//
+TBTDevAddr CBTNotifConnectionTracker::ParseAddressL( TInt aUid,
+    const TDesC8& aParamsBuf ) const
+    {
+    BOstraceFunctionEntry1( DUMMY_DEVLIST, this );
+    TBTDevAddr addr;
+    if( IsStackSecmanNotifier( aUid ) )
+        {
+        // For all these, the address is the first data member,
+        // so can be read using the TBTNotifierParams data structure.
+        TBTNotifierParams params;
+        TPckgC<TBTNotifierParams> paramsPckg( params );
+        paramsPckg.Set( aParamsBuf );
+        addr = paramsPckg().iBDAddr;
+        }
+    //else if(  ) other notifier types
+    BOstraceFunctionExitExt( DUMMY_DEVLIST, this, &addr );  
+    return addr;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Find a specific connection.
+// ---------------------------------------------------------------------------
+//
+CBTNotifConnection* CBTNotifConnectionTracker::FindConnectionHandler(
+    const TBTDevAddr& aAddr ) const
+    {
+    BOstraceFunctionEntry1( DUMMY_DEVLIST, this );
+    CBTNotifConnection* conn = NULL;
+    if( aAddr != TBTDevAddr() )
+        {
+        // This may be replaced by RArray::Find with appropriate key
+        for( TInt i = 0; i < iConnArray.Count(); i++ )
+            {
+            if( iConnArray[i]->Address() == aAddr )
+                {
+                conn = iConnArray[i];
+                break;
+                }
+            }
+        }
+    BOstraceFunctionExitExt( DUMMY_DEVLIST, this, conn );
+    return conn;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Record and check the time between connection attempts.
+// ---------------------------------------------------------------------------
+//
+TBool CBTNotifConnectionTracker::RecordConnectionAttempts( TBool aAccepted )
+    {
+    BOstraceFunctionEntry1( DUMMY_DEVLIST, this );
+    TBool result = ETrue;
+    TTime now( 0 );
+    if( !aAccepted )
+        {
+        now.UniversalTime();
+        if( iLastReject )
+            {
+            // Check the time between denied connections, that it does not go too fast.
+            TTimeIntervalSeconds prev( 0 );
+            if( !now.SecondsFrom( TTime( iLastReject ), prev ) )
+                {
+                if( prev <= KDENYTHRESHOLD )
+                    {
+                    // We are getting the requests too fast. Present the user with
+                    // an option to turn BT off.
+                    //iServer->SettingsTracker()->SetPower( EFalse );
+                    result = EFalse;
+                    }
+                }
+            }
+        }
+    // Record the current timestamp.
+    // It is reset in case the user accepted the request.
+    iLastReject = now.Int64();
+    BOstraceFunctionExitExt( DUMMY_DEVLIST, this, result );
+    return result;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/src/btnotifdeviceselector.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,262 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include <btextnotifiers.h>
+#include <btservices/advancedevdiscoverer.h>
+#include <btservices/btdevextension.h>
+#include <hb/hbcore/hbdevicedialogsymbian.h>
+#include <hb/hbcore/hbsymbianvariant.h>
+#include "btnotifdeviceselector.h"
+
+#include "btnotifserver.h"
+#include "btnotificationmanager.h"
+#include "btnotifclientserver.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// C++ default constructor
+// ---------------------------------------------------------------------------
+//
+CBTNotifDeviceSelector::CBTNotifDeviceSelector( CBTNotifServer& aServer )
+:   iServer( aServer )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Symbian 2nd-phase constructor
+// ---------------------------------------------------------------------------
+//
+void CBTNotifDeviceSelector::ConstructL()
+    {
+    iDiscoverer = CAdvanceDevDiscoverer::NewL( iServer.DevRepository(), *this );
+    }
+
+// ---------------------------------------------------------------------------
+// NewL.
+// ---------------------------------------------------------------------------
+//
+CBTNotifDeviceSelector* CBTNotifDeviceSelector::NewL( CBTNotifServer& aServer )
+    {
+    CBTNotifDeviceSelector* self = new( ELeave ) CBTNotifDeviceSelector( aServer );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBTNotifDeviceSelector::~CBTNotifDeviceSelector()
+    {
+    if( iNotification )
+        {
+        // Clear the notification callback, we cannot receive them anymore.
+        iNotification->RemoveObserver();
+        iNotification->Close(); // Also dequeues the notification from the queue.
+        iNotification = NULL;
+        }
+    iDevices.ResetAndDestroy();
+    iDevices.Close();
+    delete iDiscoverer;
+    }
+
+// ---------------------------------------------------------------------------
+// Process a client message related to notifiers.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifDeviceSelector::DispatchNotifierMessageL( const RMessage2& aMessage )
+    {
+    BOstraceFunctionEntryExt ( DUMMY_LIST, this, aMessage.Function() );
+    TInt opcode = aMessage.Function();
+    TInt uid = aMessage.Int0();
+    switch ( opcode ) 
+        {
+        case EBTNotifCancelNotifier:
+            {
+            // We only accept a cancel message from the same session as the original
+            // request (this is enforced by the RNotifier backend).
+            TInt err( KErrNotFound );
+            if ( !iMessage.IsNull() && opcode == iMessage.Function() && 
+                    aMessage.Session() == iMessage.Session() )
+                {
+                iMessage.Complete( KErrCancel );
+                err = KErrNone;
+                }
+            aMessage.Complete( err );
+            break;
+            }
+        case EBTNotifUpdateNotifier:
+            {
+            // not handling so far
+            break;
+            }
+        case EBTNotifStartSyncNotifier:
+            {
+            // synch version of device searching is not supported:
+            aMessage.Complete( KErrNotSupported );
+            break;
+            }
+        case EBTNotifStartAsyncNotifier:
+            {
+            if ( !iMessage.IsNull() )
+                {
+                aMessage.Complete( KErrServerBusy );
+                return;
+                }
+            PrepareNotificationL(TBluetoothDialogParams::EDeviceSearch, ENoResource);
+            iDevices.ResetAndDestroy();
+            iDiscoverer->DiscoverDeviceL();
+            iMessage = aMessage;
+            break;
+            }
+        default:
+            {
+            aMessage.Complete( KErrNotSupported );
+            }
+        }
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Cancels an outstanding client message related to notifiers.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifDeviceSelector::CancelNotifierMessageL( const RMessage2& aMessage )
+    {
+    (void) aMessage;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBTNotificationResult.
+// Handle a result from a user query.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifDeviceSelector::MBRDataReceived( CHbSymbianVariantMap& aData )
+    {
+    TInt err = KErrCancel;
+//    const CHbSymbianVariant* value = aData.Get(_L("selectedindex"));
+    if(aData.Keys().MdcaPoint(0).Compare(_L("selectedindex"))==KErrNone)
+        {
+        TInt val = *(static_cast<TInt*>(aData.Get(_L("selectedindex"))->Data()));
+        BOstrace1( TRACE_DEBUG, TNAME_DEVLIST_2, "MBRDataReceived, val %d", val );
+
+        if ( !iMessage.IsNull() )
+            {
+           // TInt sel = val;// - TBluetoothDialogParams::EDialogExt;
+            TBTDeviceResponseParamsPckg devParams;    
+            if (  val > -1 && val < iDevices.Count() )
+                {
+                devParams().SetDeviceAddress( iDevices[val]->Addr() );
+                err = iMessage.Write( EBTNotifSrvReplySlot, devParams );
+                }
+            iMessage.Complete( err );
+            }
+        
+        iDiscoverer->CancelDiscovery();
+        }
+    else if(aData.Keys().MdcaPoint(0).Compare(_L("Stop"))==KErrNone)
+        {
+         iDiscoverer->CancelDiscovery();
+        }
+    else if(aData.Keys().MdcaPoint(0).Compare(_L("Retry"))==KErrNone)
+        {
+        iDiscoverer->CancelDiscovery();
+        iDevices.ResetAndDestroy();
+        delete iDiscoverer;
+        iDiscoverer = NULL;
+        iDiscoverer = CAdvanceDevDiscoverer::NewL( iServer.DevRepository(), *this );
+        iDiscoverer->DiscoverDeviceL();    
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBTNotificationResult.
+// The notification is finished.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifDeviceSelector::MBRNotificationClosed( TInt aError, const TDesC8& aData  )
+    {
+    (void) aError;
+    (void) aData;
+    iNotification->RemoveObserver();
+    iNotification = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// HandleNextDiscoveryResultL
+// ---------------------------------------------------------------------------
+//
+void CBTNotifDeviceSelector::HandleNextDiscoveryResultL( 
+        const TInquirySockAddr& aAddr, const TDesC& aName )
+    {
+    // Todo: look for this device in repository before creating it.
+    CBtDevExtension* devext = CBtDevExtension::NewLC( aAddr, aName );
+    iDevices.AppendL( devext );
+    CleanupStack::Pop( devext );
+    CHbSymbianVariantMap* map = iNotification->Data();
+    TBuf<8> keyStr;
+    CHbSymbianVariant* devEntry;
+
+    keyStr.Num( TBluetoothDialogParams::EDialogExt + iDevices.Count() - 1 );
+    devEntry = CHbSymbianVariant::NewL( (TAny*) &(devext->Alias()), 
+            CHbSymbianVariant::EDes );
+    map->Add( keyStr, devEntry );
+    iNotification->Update();
+    }
+
+// ---------------------------------------------------------------------------
+// HandleDiscoveryCompleted
+// ---------------------------------------------------------------------------
+//
+void CBTNotifDeviceSelector::HandleDiscoveryCompleted( TInt aErr )
+    {
+    (void) aErr;
+    // todo: update dialog
+    }
+
+// ---------------------------------------------------------------------------
+// Get and configure a notification.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifDeviceSelector::PrepareNotificationL(
+    TBluetoothDialogParams::TBTDialogType aType,
+    TBTDialogResourceId aResourceId )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    iNotification = iServer.NotificationManager()->GetNotification();
+    User::LeaveIfNull( iNotification ); // For OOM exception, leaves with KErrNoMemory
+    iNotification->SetObserver( this );
+    iNotification->SetNotificationType( aType, aResourceId );
+
+    /*
+    _LIT(KTitleValue, "BT Search");
+    TPtrC ptr;
+    ptr.Set( KTitleValue );
+    iNotification->SetData( TBluetoothDialogParams::EDialogTitle, ptr );
+    */
+    
+    /*err = */ iServer.NotificationManager()->QueueNotification( iNotification );
+    //NOTIF_NOTHANDLED( !err )
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/src/btnotificationmanager.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,202 @@
+/*
+* ============================================================================
+*  Name        : btnotificationmanager.cpp
+*  Part of     : bluetoothengine / btnotif
+*  Description : Class for managing user notification and query objects, and for serializing access to the notification server.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.1
+*/
+
+#include "btnotificationmanager.h"
+#include "btnotifserver.h"
+
+#include "bluetoothnotification.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// C++ default constructor
+// ---------------------------------------------------------------------------
+//
+CBTNotificationManager::CBTNotificationManager( const CBTNotifServer* aServer )
+:   iServer( aServer )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Symbian 2nd-phase constructor
+// ---------------------------------------------------------------------------
+//
+void CBTNotificationManager::ConstructL()
+    {
+    iAsyncCb = new( ELeave ) CAsyncCallBack( iServer->Priority() );
+    TCallBack cb( AsyncCallback, this );
+    iAsyncCb->Set( cb );
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewL.
+// ---------------------------------------------------------------------------
+//
+CBTNotificationManager* CBTNotificationManager::NewL( const CBTNotifServer* aServer )
+    {
+    CBTNotificationManager* self = new( ELeave ) CBTNotificationManager( aServer );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBTNotificationManager::~CBTNotificationManager()
+    {
+    iNotificationQ.ResetAndDestroy();
+    iNotificationQ.Close();
+    iUnusedQ.ResetAndDestroy();
+    iUnusedQ.Close();
+    delete iAsyncCb;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Get a new notification
+// ---------------------------------------------------------------------------
+//
+CBluetoothNotification* CBTNotificationManager::GetNotification()
+    {
+    CBluetoothNotification* notification = NULL;
+    if( iUnusedQ.Count() )
+        {
+        // Re-use the first idle notification.
+        notification = iUnusedQ[0];
+        iUnusedQ.Remove( 0 );
+        }
+    else
+        {
+        TRAP_IGNORE( notification = CBluetoothNotification::NewL( this ) );
+        }
+    if( notification )
+        {
+        if( iNotificationQ.Append( notification ) )
+            {
+            // In case the appending fails, we just delete the notification.
+            // Otherwise we cannot keep track of it anymore.
+            delete notification;
+            notification = NULL;
+            }
+        }
+    return notification;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Release the notification
+// ---------------------------------------------------------------------------
+//
+void CBTNotificationManager::ReleaseNotification( CBluetoothNotification* aNotification )
+    {
+    __ASSERT_ALWAYS( aNotification, PanicServer( EBTNotifPanicBadArgument ) );
+    TInt pos = iNotificationQ.Find( aNotification );
+    __ASSERT_ALWAYS( pos > KErrNotFound, PanicServer( EBTNotifPanicMissing ) );
+    // ToDo: Cancel outstanding notification!
+    iNotificationQ.Remove( pos );
+    TInt err = iUnusedQ.Append( aNotification );
+    aNotification->Reset();  // Clean up notification's resources
+    if( err )
+        {
+        // Just delete the notification.
+        delete aNotification;
+        }
+    if( !iAsyncCb->IsActive() )
+        {
+        if( !iNotificationQ.Count() )
+            {
+            // Set the priority so that this is the last scheduled active object to execute.
+            iAsyncCb->SetPriority( CActive::EPriorityIdle );
+            }
+        iAsyncCb->CallBack();
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// Queue the notification with given priority
+// ---------------------------------------------------------------------------
+//
+TInt CBTNotificationManager::QueueNotification( CBluetoothNotification* aNotification,
+    TNotificationPriority aPriority )
+    {
+    TInt pos = iNotificationQ.Find( aNotification );
+    __ASSERT_ALWAYS( pos > KErrNotFound, PanicServer( EBTNotifPanicMissing ) );
+    if( aPriority == EPriorityHigh && pos != 0 )
+        {
+        // ToDo:  Move the note to the front of the queue
+        }
+    if( !iAsyncCb->IsActive() )
+        {
+		if( iAsyncCb->Priority() != iServer->Priority() )
+			{
+			// Reset priority back to original value
+			// We first check the current priority, otherwise CActive will do an
+			// unnecessary removal and adding of the callback from the active scheduler. 
+			iAsyncCb->SetPriority( iServer->Priority() );
+			}
+        iAsyncCb->CallBack();
+        }
+    return KErrNone;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Process the notification queue and launch the next notification.
+// ---------------------------------------------------------------------------
+//
+void CBTNotificationManager::ProcessNotificationQueueL()
+    {
+    if( iNotificationQ.Count() )
+        {
+        TInt err = iNotificationQ[0]->Show();
+        // If the note is already showing, it will return KErrAlreadyExists
+        (void) err; // ToDo: add error handling!!
+        NOTIF_NOTHANDLED( !err || err == KErrAlreadyExists || err == KErrNotFound )
+        }
+    else
+        {
+        // No outstanding notifications, and unused notifications.
+        // Clean up the unused notifications.
+        iUnusedQ.ResetAndDestroy();
+        iNotificationQ.Reset(); // the queue is empty, reset it.
+        // Also clean up any resources.
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// Callback for asynchronous processing of queued notification requests.
+// ---------------------------------------------------------------------------
+//
+TInt CBTNotificationManager::AsyncCallback( TAny* aPtr )
+    {
+    TRAPD( err, ( (CBTNotificationManager*) aPtr )->ProcessNotificationQueueL() );
+    return err;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/src/btnotifpairinghelper.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,958 @@
+/*
+* ============================================================================
+*  Name        : btnotifpairinghelper.cpp
+*  Part of     : bluetoothengine / btnotif
+*  Description : Helper class for processing pairing requests and results, as extended functionality for CBTNotifConnection.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.1
+*/
+
+#include "btnotifpairinghelper.h"
+#include <bt_sock.h>
+#include <btextnotifiers.h>
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <btextnotifierspartner.h>
+#endif
+
+#include "btnotifconnection.h"
+#include "btnotifconnectiontracker.h"
+#include "btnotificationmanager.h"
+#include "btnotifserver.h"
+#include "bluetoothtrace.h"
+
+/**  Id for the active object for a dedicated bonding session. */
+const TInt KDedicatedBonding = 50;
+/**  Length of the default PIN. */
+const TInt KDefaultPinLength = 4;
+/**  Default PIN character. */
+const TText8 KDefaultPinValue = '0';
+/**  Format syntax for numeric comparison value. */
+_LIT( KNumCompFormat, "%06u" );
+/**  Format syntax for passkey display value. */
+_LIT( KPassKeyFormat, "%06u" );
+
+
+// ======== LOCAL FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+/*?type ?function_name( ?arg_type ?arg,
+                      ?arg_type ?arg )
+    {
+    }
+*/
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// C++ default constructor.
+// ---------------------------------------------------------------------------
+//
+CBTNotifPairingHelper::CBTNotifPairingHelper( CBTNotifConnection* aConnection,
+    CBTNotifConnectionTracker* aTracker )
+:   iConnection( aConnection ),
+    iTracker( aTracker )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Symbian 2nd-phase constructor.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::ConstructL()
+    {
+    if( iConnection )
+        {
+        iDevice = iConnection->BTDevice();
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CBTNotifPairingHelper* CBTNotifPairingHelper::NewL( CBTNotifConnection* aConnection,
+    CBTNotifConnectionTracker* aTracker )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    CBTNotifPairingHelper* self = new( ELeave ) CBTNotifPairingHelper( aConnection, aTracker );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CBTNotifPairingHelper::~CBTNotifPairingHelper()
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    if( iNotification )
+        {
+        // Clear the notification callback, we cannot receive them anymore.
+        iNotification->RemoveObserver();
+        iNotification->Close(); // Also dequeues the notification from the queue.
+        iNotification = NULL;
+        }
+    delete iParams;
+    if( iBondingActive )
+        {
+        iBondingActive->Cancel();   // Will close subsession;
+        }
+    delete iBondingActive;
+    iBondingSession.Close();
+    iBondingSocket.Close();
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Handle the authentication result from the baseband. Show the result in a note.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::HandleAuthenticationCompleteL( TInt aError )
+    {
+    BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, aError );
+    if( iOperation == EDedicatedBonding || iOperation == EAwaitingPairingResult ||
+        iOperation == EAutoPairing )
+        {
+        // Default case (aError == 0): Success, we are now paired.
+        TBTDialogResourceId resourceId = EPairingSuccess;
+        TBool autoPairing = ( iOperation == EAutoPairing ); // Remember the autopairing state
+        iOperation = EShowPairingSuccess;
+        if( aError && aError != KHCIErrorBase )
+            {
+            // Authentication failure, means pairing failed.
+            resourceId = EPairingFailure;
+            iOperation = EShowPairingFailure;
+            // Communicate the error now that we still remember it.
+            if( iDedicatedBonding )
+                {
+                if( autoPairing && aError == KHCIErrorBase - EAuthenticationFailure )
+                    {
+                    BOstrace0( TRACE_NORMAL, DUMMY_DEVLIST, 
+                            "[BTNOTIF]\t CBTNotifPairingHelper::HandleAuthenticationCompleteL: Autopairing failed, we need to try again.");
+                    // Autopairing failed, we need to try again.
+                    iOperation = EAutoPairing;  // Reset back
+                    resourceId = ENoResource;
+                    }
+                CompleteBondingL( aError );
+                }
+            }
+        if( resourceId )
+            {
+            // Inform the user of the result.
+            BOstrace0( TRACE_NORMAL, DUMMY_DEVLIST,  
+                    "[BTNOTIF]\t CBTNotifPairingHelper::HandleAuthenticationCompleteL: pairing successful, inform user" );
+            PrepareNotificationL( TBluetoothDialogParams::EGlobalNotif, resourceId );
+            // MBRNotificationClosed will be called from this, which will 
+            // check the next stage.
+            }
+        }
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Start a bonding operation with the remote device.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::StartBondingL( TInt aHandle )
+    {
+    BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, aHandle );
+    __ASSERT_ALWAYS( iOperation == EIdle || iOperation == EDedicatedBonding
+                || iOperation == EAutoPairing, PanicServer( EBTNotifPanicBadState ) );
+    if( !iBondingActive )
+        {
+        iBondingActive = CBtSimpleActive::NewL( *this, KDedicatedBonding );
+        }
+    if( aHandle )
+        {
+        iDedicatedBonding = aHandle;
+        }
+    if( iOperation == EIdle )
+        {
+        iOperation = EDedicatedBonding;
+        }
+    if( iOperation == EDedicatedBonding && iTracker->PairingServerSession() )
+        {
+        if( !iBondingActive->IsActive() )
+            {
+            BtTraceBtAddr1( TRACE_DEBUG,DUMMY_LIST,"CBTNotifPairingHelper::StartBondingL()",iDevice->BDAddr() );
+            iBondingSession.Start( *iTracker->PairingServerSession(),
+                        iDevice->BDAddr(), iBondingActive->RequestStatus() );
+            iBondingActive->GoActive();
+            }
+        }
+    else
+        {
+        // We are doing autopairing (or the unlikely situation that the pairing server is unavailable)
+        CompleteBondingL( KErrServerTerminated );
+        }
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this);
+    }
+
+
+// ---------------------------------------------------------------------------
+// Cancel an ongoing bonding operation with the remote device.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::CancelBondingL()
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    if( iDedicatedBonding )
+        {
+        CompleteBondingL( KErrCancel ); // Closes sessions
+        if( iNotification )
+            {
+            // Cancel the outstanding user query
+            // This will also unregister us from the notification.
+            TInt err = iNotification->Close();
+            NOTIF_NOTHANDLED( !err )
+            iNotification = NULL;
+            }
+        if( iNotifierUid )
+            {
+            // Also finish up the notifier processing.
+            CompletePairingNotifierL( KErrCancel, EFalse, KNullDesC8 );
+            }
+        iOperation = EIdle;
+        iConnection->PairingCompleted();   // This may delete us.
+        }
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Handle a notifier request for pairing with the remote device of this connection.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::StartPairingNotifierL( TInt aUid, const TDesC8& aParams )
+    {
+    BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, aUid );
+    if( iDevice->GlobalSecurity().Banned() && !iDedicatedBonding )
+        {
+        // ToDo: should this case actually be ignored, and presume that
+        // the caller will take care of unblocking the device?
+        iOperation = EIdle;
+        User::Leave( KErrAccessDenied );
+        }
+    // Store the parameters locally, we need them later again.
+    delete iParams;
+    iParams = NULL;
+    iParams = HBufC8::NewL( aParams.Length() );
+    *iParams = aParams;
+    iNotifierUid = aUid;
+
+    if( iDevice->IsValidPaired() && iDevice->IsPaired() )
+        {
+        // The device is still paired, we unpair it first.
+        // Deleting the link key will set the device as unpaired.
+        iDevice->DeleteLinkKey();
+        iOperation = EUnpairing;    // So that parent state does not get changed.
+        iConnection->UpdateRegistryEntryL();
+        // Note that this will only be done before trying autopairing, so
+        // it not interfere with a second attempt;
+        }
+    // Update the device name
+    TBTPasskeyDisplayParams params; // Enough for reading the base class type parameter
+    TPckgC<TBTPasskeyDisplayParams> paramsPckg( params );
+    paramsPckg.Set( *iParams );
+    if( paramsPckg().DeviceName().Length() )
+        {
+        // The name in the parameter package is the latest one, retrieved from 
+        // the remote device during this connection. Update locally.
+        iDevice->SetDeviceNameL( BTDeviceNameConverter::ToUTF8L( paramsPckg().DeviceName() ) );
+        }
+
+    TBool locallyInitiated = EFalse;
+    TBuf<8> numVal;
+    TBluetoothDialogParams::TBTDialogType dialog = TBluetoothDialogParams::EInvalidDialog;
+    TBTDialogResourceId resource = ENoResource;
+    // Read the notifier parameters (sets iOperation as well)
+    ParseNotifierReqParamsL( locallyInitiated, numVal, dialog, resource );
+    // If this is an incoming pairing, we first ask the user to accept it.
+    if( !locallyInitiated && !iDedicatedBonding )
+        {
+        // Ignore the initatior if we initiated bonding.
+        StartAcceptPairingQueryL(); // Overrides iOperation
+        }
+    else
+        {
+        __ASSERT_ALWAYS( resource != ENoResource, PanicServer( EBTNotifPanicBadState ) );
+        CheckAutoPairingL( locallyInitiated, numVal );
+        // CheckAutoPairingL sets 
+        if( iOperation != EAutoPairing )
+            {
+            PrepareNotificationL( dialog, resource );
+            if( numVal.Length() )
+                {
+                TInt err = iNotification->SetData( TBluetoothDeviceDialog::EAdditionalDesc, numVal );
+                NOTIF_NOTHANDLED( !err )
+                }
+            }
+        }
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Update a notifier, update the outstanding dialog if the notifier request 
+// is currently being served.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::UpdatePairingNotifierL( TInt aUid, const TDesC8& aParams )
+    {
+    (void) aUid;
+    TBTNotifierUpdateParams2 params;    // Enough for reading the base class type parameter
+    TPckgC<TBTNotifierUpdateParams2> paramsPckg( params );
+    paramsPckg.Set( aParams );
+    if( paramsPckg().Type() == TBTNotifierUpdateParams2::EPasskeyDisplay )
+        {
+        // Paskey display update - keypress on remote device.
+        }
+    else
+        {
+        // name update
+        TBTDeviceNameUpdateParams nameUpdate;
+        TPckgC<TBTDeviceNameUpdateParams> nameUpdatePckg( nameUpdate );
+        nameUpdatePckg.Set( aParams );
+        // The result means result of conversion to unicode
+        if( !nameUpdatePckg().Result() )
+            {
+            // Only update locally, registry will update us with the same info later on.
+            iDevice->SetDeviceNameL( BTDeviceNameConverter::ToUTF8L( nameUpdatePckg().DeviceName() ) );
+            if( iNotification )
+                {
+                // Update the dialog with the new name. It is up to the dialog to 
+                // determine the validity (in case another dialog is shown).
+                //iNotification->Update(  )
+                }
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// Cancel a request, dismiss the outstanding dialog if the notifier request 
+// is currently being served.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::CancelPairingNotifierL( TInt aUid )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    // ToDo: we need to check that the UID and the outstanding notification
+    // type are matching?
+    if( iOperation > EIdle && iOperation < EPostPairingOperations && aUid == iNotifierUid &&
+        ( aUid == KBTPinCodeEntryNotifierUid.iUid ||
+          aUid == KBTNumericComparisonNotifierUid.iUid ||
+          aUid == KBTPasskeyDisplayNotifierUid.iUid ) )
+        {
+        if( iNotification )
+            {
+            // Cancel the user query
+            // This will also unregister us from the notification.
+            TInt err = iNotification->Close();
+            NOTIF_NOTHANDLED( !err )
+            iNotification = NULL;
+            }
+        iOperation = EIdle;
+        iNotifierUid = 0;
+        // We do not call pairing completed from here, our parent will
+        // check our status by itself, and may delete us.
+
+        // Any bonding requester needs to be informed though.
+        CancelBondingL();
+        }
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::StartJustWorksProcessingL()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::CancelJustWorksProcessingL()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBTNotificationResult.
+// Handle a result from a user query.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::MBRDataReceived( CHbSymbianVariantMap& aData )
+    {
+    (void) aData;
+    NOTIF_NOTIMPL
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBTNotificationResult.
+// The notification is finished.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::MBRNotificationClosed( TInt aError, const TDesC8& aData )
+    {
+    BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, aError );
+    // First unregister from the notification, so we can already get the next one.
+    iNotification->RemoveObserver();
+    iNotification = NULL;
+    TRAP_IGNORE( NotificationClosedL( aError, aData ) );
+    if( iOperation == EIdle )
+        {
+        // Any error has been communicated already.
+        iConnection->PairingCompleted();   // This may delete us.
+        }
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBtSimpleActiveObserver.
+// Handle the active object completion.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::RequestCompletedL( CBtSimpleActive* aActive,
+    TInt aStatus )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    switch( aActive->RequestId() )
+        {
+        case KDedicatedBonding:
+            {
+            if( iDedicatedBonding )
+                {
+                // If the result hasn't been processed already.
+                HandleAuthenticationCompleteL( aStatus );
+                }
+            }
+            break;
+        default:
+            NOTIF_NOTIMPL
+            break;
+        }
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBtSimpleActiveObserver.
+// Cancel and clean up all requests related to the active object.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::CancelRequest( TInt aRequestId )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    switch( aRequestId )
+        {
+        case KDedicatedBonding:
+            iBondingSession.Close();
+            break;
+        default:
+            NOTIF_NOTIMPL
+            break;
+        }
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBtSimpleActiveObserver.
+// 
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::HandleError( CBtSimpleActive* aActive, 
+        TInt aError )
+    {
+    (void) aActive;
+    (void) aError;
+    }
+
+// ---------------------------------------------------------------------------
+// Process the user input and complete the outstanding pairing request.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::CompletePairingNotifierL( TInt aError, TBool aResult,
+    const TDesC8& aData )
+    {
+    BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, aError );
+    TInt err = aError;
+    TPtrC8 resultData;
+    if( !err )
+        {
+        // The returned data is the entered passkey.
+        TBool proceed = iTracker->UpdateBlockingHistoryL( iDevice, aResult );
+        if( iOperation == ESspPairing && iNotifierUid == KBTNumericComparisonNotifierUid.iUid )
+            {
+            // Numeric comparison needs the boolean result passed back.
+            TPckgBuf<TBool> userAcceptance( aResult );
+            resultData.Set( userAcceptance );
+            }
+        if( aResult )
+            {
+            if( iOperation == ELegacyPairing || iOperation == EAutoPairing )
+                {
+                // Check the passkey entered by the user.
+                // The length of the returned data equals the number of characters
+                // entered by the user.
+                TBTPinCode pinCode;
+                pinCode().iLength = aData.Length();
+                TUint minLen = 0;
+                TBool locallyInitiated = EFalse; // Not used here.
+                ParsePinCodeReqParamsL( locallyInitiated, minLen );
+                if( aData.Length() >= minLen )
+                    {
+                    // Check that the length of the passkey meets the minimum 
+                    // required pin code length
+                    for( TInt i = 0; i < aData.Length(); i++ )
+                        {
+                        pinCode().iPIN[i] = aData[i];
+                        }
+                    resultData.Set( pinCode );
+                    }
+                else
+                    {
+                    // PIN wasn't long enough. This should be handled by the dialog though.
+                    err = KErrCompletion;
+                    }
+                }
+            // Now we just wait for the result to come in.
+            if( iOperation != EAutoPairing )
+                {
+                iOperation = EAwaitingPairingResult; 
+                }
+            }
+        else
+            {
+            err = KErrCancel;
+            TBool locallyInitiated = EFalse;    // Needed below
+            TBuf<8> numVal;     // Not needed here.
+            TBluetoothDialogParams::TBTDialogType type = TBluetoothDialogParams::EInvalidDialog;
+            TBTDialogResourceId resource = ENoResource; // Resources and type are not needed here.
+            // Check the notifier parameters
+            ParseNotifierReqParamsL( locallyInitiated, numVal, type, resource );
+            if( proceed && locallyInitiated && !iDedicatedBonding )
+                {
+                // The user denied the connection, ask to block the device.
+                // This is only for pairing (and not bonding) initiated by us,
+                // as the user already gets the opportunity to block when
+                // rejecting an incoming pairing request.
+                // This case may be for someone requesting to access a service
+                // which requires authentication by us, but not by the remote device.
+                iConnection->LaunchBlockingQueryL();
+                // For incoming pairing, blocking is asked after rejecting the 
+                // pairing request. This is done in CompleteAcceptPairingQueryL
+                }
+            CompleteBondingL( err );    // Notify the client if there was a bonding request.
+            }
+        }
+    iNotifierUid = 0;   // Clean up notifier data
+    delete iParams;
+    iParams = NULL;
+    if( err )
+        {
+        iOperation = EIdle; // We are done now.
+        }
+    // Complete the message with the result, and result data if any.
+    iConnection->CompleteClientRequest( err, resultData );
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Completes a bonding operation.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::CompleteBondingL( TInt aError )
+    {
+    BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, aError );
+    if( iDedicatedBonding )
+        {
+        if( iBondingActive )
+            {
+            iBondingActive->Cancel();   // Will close subsession;
+            }
+        iBondingSession.Close();    // In case not active
+        iBondingSocket.Close();
+        }
+    // Determine if we try another time.
+    if( ( iOperation == EAutoPairing && aError == KHCIErrorBase - EAuthenticationFailure ) ||
+        ( iDedicatedBonding && iOperation == EAwaitingPairingResult &&
+          aError == KErrRemoteDeviceIndicatedNoBonding ) ||
+        aError == KErrServerTerminated )
+        {
+        // The cases are: 2) autopairing with a headset that has a non-default passkey
+        // 2) SSP dedicated bonding with a device that does not allow that.
+        // 3) the pairing server is unavailable (unlikely)
+        // Then we try another time, requesting authentication on a 
+        // RBTPhysicialLinkAdapter
+        BOstrace0( TRACE_NORMAL, DUMMY_DEVLIST,  
+                "[BTNOTIF]\t CBTNotifPairingHelper::CompleteBondingL: trying another time." );
+        TInt err = iBondingSocket.Open( iTracker->SocketServerSession(), iConnection->Address() );
+        TUint32 linkState = 0;
+        if( !err )
+            {
+            err = iBondingSocket.PhysicalLinkState( linkState );
+            }
+        if( !err && linkState & ENotifyPhysicalLinkUp )
+            {
+            err = iBondingSocket.Authenticate();
+            // Now wait for the dialog and then the link state notification
+            }
+        else
+            {
+            // We need to wait for the link to come up. We wait until our
+            // parent calls us again.
+            iBondingSocket.Close();
+            }
+        if( err )
+            {
+            // Cannot continue, show the result to the user.
+            BOstrace0( TRACE_NORMAL, DUMMY_DEVLIST,  
+                    "[BTNOTIF]\t CBTNotifPairingHelper::HandleAuthenticationCompleteL: pairing failed, complete message." );
+            iOperation = EShowPairingFailure;
+            PrepareNotificationL( TBluetoothDialogParams::ENote, EPairingFailure );
+            }
+        }
+    if( iDedicatedBonding && iOperation != EAutoPairing )
+        {
+        BOstrace0( TRACE_NORMAL, DUMMY_DEVLIST,      
+                "[BTNOTIF]\t CBTNotifPairingHelper::CompleteBondingL: complete message." );
+        TInt err = iTracker->Server()->CompleteMessage( iDedicatedBonding, aError, KNullDesC8 );
+        NOTIF_NOTHANDLED( !err )
+        iDedicatedBonding = 0;
+        }
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::CompleteJustWorksProcessingL( TInt aError )
+    {
+    (void) aError;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Ask the user to allow incoming pairing.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::StartAcceptPairingQueryL()
+    {
+    iOperation = EAcceptPairing;
+    PrepareNotificationL( TBluetoothDialogParams::EQuery, EIncomingPairing );
+    // if rejected, the client message is completed in CompleteAcceptPairingQueryL
+    }
+
+
+// ---------------------------------------------------------------------------
+// The user was asked to accept an incoming pairing. Process and proceed. 
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::CompleteAcceptPairingQueryL( TInt aError, TBool aResult )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    // Set our state to idle for now. This may get changed if the user just chose 
+    // to block, or if we have a pending request.
+    iOperation = EIdle;
+    TInt err = aError;
+    if( !err )
+        {
+        TBool proceed = iTracker->UpdateBlockingHistoryL( iDevice, aResult );
+        if( aResult )
+            {
+            // User accepted, continue to show pairing query.
+            // Minimum lenght does not apply, should only be set on outgoing pairing
+            TBool locallyInitiated = EFalse;
+            TBuf<8> numVal;
+            TBluetoothDialogParams::TBTDialogType dialog = TBluetoothDialogParams::EInvalidDialog;
+            TBTDialogResourceId resource = ENoResource;
+            // Read the notifier parameters
+            ParseNotifierReqParamsL( locallyInitiated, numVal, dialog, resource );
+            __ASSERT_ALWAYS( resource != ENoResource, PanicServer( EBTNotifPanicBadState ) );
+            PrepareNotificationL( dialog, resource );
+            if( numVal.Length() )
+                {
+                TInt err = iNotification->SetData( TBluetoothDeviceDialog::EAdditionalDesc, numVal );
+                NOTIF_NOTHANDLED( !err )
+                }
+            }
+        else
+            {
+            err = KErrCancel;
+            if( proceed )
+                {
+                // The user denied the connection, ask to block the device.
+                iConnection->LaunchBlockingQueryL();
+                }
+            }
+        }
+    if( err )
+        {
+        // The user denied the connection, or something else prevented completion.
+        CompletePairingNotifierL( err, EFalse, KNullDesC8 );
+        }
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Launch a dialog for setting the device as trusted.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::StartTrustedQueryL()
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    // Assume that the registry update has come through by now.
+    iOperation = EQueryTrust;
+    PrepareNotificationL( TBluetoothDialogParams::EQuery, ESetTrusted );
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Process the user input for setting the device as trusted.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::CompleteTrustedQueryL( TInt aError, TBool aResult )
+    {
+    BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, aError );
+    BOstraceExt2( TRACE_DEBUG, DUMMY_DEVLIST, 
+            "CBTNotifPairingHelper::CompleteTrustedQueryL() err=%d result=%d", aError, aResult );
+    iOperation = EIdle; // We are done with pairing now.
+    if( !aError && aResult )
+        {
+        // need to update pairing info from registry before writing trusted status
+        iConnection->UpdateRegistryEntryL(true);
+        }
+    CompleteBondingL( KErrNone );   // Notify the client if there was a bonding request.
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Parse the parameters of a request for pairing.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::ParseNotifierReqParamsL( TBool& aLocallyInitiated,
+    TDes& aNumVal, TBluetoothDialogParams::TBTDialogType& aDialogType,
+    TBTDialogResourceId& aResourceId )
+    {
+    // Determine the notifier type by the length of the parameter buffer
+    if( iNotifierUid == KBTPinCodeEntryNotifierUid.iUid )
+        {
+        aNumVal.Zero();
+        TUint minLen = 0;
+        ParsePinCodeReqParamsL( aLocallyInitiated, minLen );
+        if( minLen )
+            {
+            // Don't set zero to this buffer, the buffer length serves for this.
+            aNumVal.Num( minLen );
+            }
+        aDialogType = TBluetoothDialogParams::EInput;
+        aResourceId = EPinInput;
+        if( iOperation != EAutoPairing )
+            {
+            iOperation = ELegacyPairing;
+            }
+        }
+    else if( iNotifierUid == KBTNumericComparisonNotifierUid.iUid )
+        {
+        ParseNumericCompReqParamsL( aLocallyInitiated, aNumVal );
+        aDialogType = TBluetoothDialogParams::EQuery;
+        aResourceId = ENumericComparison;
+        iOperation = ESspPairing;
+        }
+    else if( iNotifierUid == KBTPasskeyDisplayNotifierUid.iUid )
+        {
+        ParsePasskeyDisplayReqParamsL( aLocallyInitiated, aNumVal );
+        aDialogType = TBluetoothDialogParams::EQuery;
+        aResourceId = EPasskeyDisplay;
+        iOperation = ESspPairing;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// Parse the parameters of a request for pairing using pin query.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::ParsePinCodeReqParamsL( TBool& aLocallyInitiated,
+    TUint& aNumVal )
+    {
+    TBTPinCodeEntryNotifierParams params;
+    TPckgC<TBTPinCodeEntryNotifierParams> paramsPckg( params );
+    paramsPckg.Set( *iParams );
+    aLocallyInitiated = paramsPckg().LocallyInitiated();
+    aNumVal = paramsPckg().PinCodeMinLength();
+    }
+
+
+// ---------------------------------------------------------------------------
+// Parse the parameters of a request for pairing using numeric comparison.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::ParseNumericCompReqParamsL( TBool& aLocallyInitiated,
+    TDes& aNumVal )
+    {
+    TBTNumericComparisonParams params;
+    TPckgC<TBTNumericComparisonParams> paramsPckg( params );
+    paramsPckg.Set( *iParams );
+    aLocallyInitiated = paramsPckg().LocallyInitiated();
+    TBTNumericComparisonParams::TComparisonScenario scenario =
+                paramsPckg().ComparisonScenario();
+    aNumVal.Format( KNumCompFormat, paramsPckg().NumericalValue() );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Parse the parameters of a request for pairing using passkey display.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::ParsePasskeyDisplayReqParamsL( TBool& aLocallyInitiated,
+    TDes& aNumVal )
+    {
+    TBTPasskeyDisplayParams params;
+    TPckgC<TBTPasskeyDisplayParams> paramsPckg( params );
+    paramsPckg.Set( *iParams );
+    aLocallyInitiated = paramsPckg().LocallyInitiated();
+    aNumVal.Format( KPassKeyFormat, paramsPckg().NumericalValue() );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Check if we can guess the PIN and complete the notifier without user interaction.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::CheckAutoPairingL( TBool aLocallyInitiated, const TDesC& aNumVal )
+    {
+    TUint minLen = 0;
+    if( aNumVal.Length() )
+        {
+        ParsePinCodeReqParamsL( aLocallyInitiated, minLen );
+        }
+    // ToDo: Add support for NFC OOB pairing
+    if( iDedicatedBonding && iOperation == ELegacyPairing &&
+        iDevice->DeviceClass().MajorDeviceClass() == EMajorDeviceAV &&
+        iDevice->DeviceClass().MinorDeviceClass() != EMinorDeviceAVHandsfree &&
+        minLen <= KDefaultPinLength )
+        {
+        // Outgoing bonding with headset and no passkey requirement => AutomatedPairing
+        // Complete message with 0000 and return.
+        iOperation = EAutoPairing;
+        TBuf8<KDefaultPinLength + sizeof( TPckgBuf<TBool> )> defaultPin( KDefaultPinLength );
+        for( TInt i = 0; i < KDefaultPinLength; i++ )
+            {
+            defaultPin[i] = KDefaultPinValue;
+            }
+        // Complete the pairing through the function dedicated to that.
+        CompletePairingNotifierL( KErrNone, ETrue, defaultPin );
+        }
+    else if( iOperation == EAutoPairing )
+        {
+        iOperation = ELegacyPairing;    // Reset the autopairing status
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// Get and configure a notification.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::PrepareNotificationL( TBluetoothDialogParams::TBTDialogType aType,
+    TBTDialogResourceId aResourceId )
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    __ASSERT_ALWAYS( iOperation != EIdle || aType == TBluetoothDialogParams::ENote, PanicServer( EBTNotifPanicBadState ) );
+    iNotification = iTracker->NotificationManager()->GetNotification();
+    User::LeaveIfNull( iNotification ); // For OOM exception, leaves with KErrNoMemory
+    iNotification->SetObserver( this );
+    iNotification->SetNotificationType( aType, aResourceId );
+    TBTDeviceName name;
+    GetDeviceNameL( name, *iDevice );
+    TInt err = iNotification->SetData( TBluetoothDeviceDialog::EDeviceName, name );
+    NOTIF_NOTHANDLED( !err )
+    // Re-use name buffer for 16-bit descriptor representation of remote address.
+    iConnection->Address().GetReadable( name );
+    err = iNotification->SetData( TBluetoothDialogParams::EAddress, name );
+    NOTIF_NOTHANDLED( !err )
+    err = iNotification->SetData( (TInt) TBluetoothDeviceDialog::EDeviceClass,
+                iDevice->DeviceClass().DeviceClass() );
+    err = iTracker->NotificationManager()->QueueNotification( iNotification );
+    NOTIF_NOTHANDLED( !err )
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+
+// ---------------------------------------------------------------------------
+// The notification is finished, handle the result.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifPairingHelper::NotificationClosedL( TInt aError, const TDesC8& aData )
+    {
+    BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, aError );
+    // Read the result.
+    TPckgC<TBool> result( EFalse );
+    result.Set( aData.Ptr(), result.Length() ); // Read the part containing the result
+    // Set a pointer descriptor to capture the remaining data, if any.
+    TPtrC8 dataPtr( aData.Mid( result.Length() ) );
+    switch( iOperation )
+        {
+        case EAcceptPairing:
+            CompleteAcceptPairingQueryL( aError, result() );
+            break;
+        case ELegacyPairing:
+        case ESspPairing:
+            CompletePairingNotifierL( aError, result(), dataPtr );
+            break;
+        case EQueryTrust:
+            CompleteTrustedQueryL( aError, result() );
+            break;
+        case EShowPairingSuccess:
+            StartTrustedQueryL();
+            break;
+        case EShowPairingFailure:
+            // Pairing failure, we are done.
+            iOperation = EIdle;
+            break;
+        default:
+            NOTIF_NOTIMPL
+            break;
+        }
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/src/btnotifserver.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,370 @@
+/*
+* ============================================================================
+*  Name        : btnotifserver.cpp
+*  Part of     : bluetoothengine / btnotif
+*  Description : Server class for handling commands from clients, and the 
+*                central class in btnotif thread.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.1
+*/
+
+#include "btnotifserver.h"
+#include <btservices/btdevrepository.h>
+#include "btnotifsession.h"
+#include "btnotifconnectiontracker.h"
+#include "btnotifsettingstracker.h"
+#include "btnotificationmanager.h"
+#include "btnotifdeviceselector.h"
+#include "btnotifserversecpolicy.h"
+#include "btnotifclientserver.h"
+
+/**  Panic category */
+_LIT( KBTNotifPanic, "BTNotif panic" );
+
+/**  Timeout (10 sec) for shutting down the server 
+ * (when BT power is off and no clients connected). */
+const TInt KBTNtoifShutdownTimeout = 10 * 1000 * 1000;
+
+// ======== LOCAL FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Start the server.
+// ---------------------------------------------------------------------------
+//
+static void RunServerL()
+    {
+    BOstraceFunctionEntry0( DUMMY_DEVLIST );
+    
+    (void) User::RenameThread( KBTNotifServerName );
+    // Create and install the active scheduler for this thread.
+    CActiveScheduler* scheduler = new( ELeave ) CActiveScheduler();
+    CleanupStack::PushL( scheduler );
+    CActiveScheduler::Install( scheduler );
+    // create the server (and leave it on the cleanup stack)
+    CBTNotifServer* notifServer = CBTNotifServer::NewLC();
+    // Initialisation complete, now signal the client
+    RProcess::Rendezvous( KErrNone );
+        // The server is now up and running.
+    BOstrace0( TRACE_NORMAL, DUMMY_DEVLIST, "[BTNOTIF]\t BTNotif server now up and running" );
+    // The active scheduler runs during the lifetime of this thread.
+    CActiveScheduler::Start();
+    // Stopping the active scheduler means terminating the thread.
+    // Cleanup the server and scheduler.
+    CleanupStack::PopAndDestroy( notifServer );
+    CleanupStack::PopAndDestroy( scheduler );
+    BOstraceFunctionExit0( DUMMY_DEVLIST );
+    }
+
+// ---------------------------------------------------------------------------
+// Panic the server.
+// ---------------------------------------------------------------------------
+//
+void PanicServer( TInt aReason )
+    {
+    User::Panic( KBTNotifPanic, aReason );
+    }
+
+// ---------------------------------------------------------------------------
+// Panic the client through the client-side message.
+// ---------------------------------------------------------------------------
+//
+void PanicClient( const RMessage2& aMessage, TInt aReason )
+    {
+    aMessage.Panic( KBTNotifPanic, aReason );
+    }
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// C++ default constructor
+// ---------------------------------------------------------------------------
+//
+CBTNotifServer::CBTNotifServer()
+:   CPolicyServer( EPriorityUserInput, KBTNotifServerPolicy )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Symbian 2nd-phase constructor
+// ---------------------------------------------------------------------------
+//
+void CBTNotifServer::ConstructL()
+    {
+    // Add the server to the active scheduler (from CServer2):
+    StartL( KBTNotifServerName );
+    iAsyncCb = new( ELeave ) CAsyncCallBack( EPriorityHigh );
+    TCallBack cb( AsyncConstructCb, this );
+    iAsyncCb->Set( cb );
+    iAsyncCb->CallBack();
+    }
+
+// ---------------------------------------------------------------------------
+// Asynchronous 3rd-phase constructor
+// ---------------------------------------------------------------------------
+//
+void CBTNotifServer::AsyncConstructL()
+    {
+    iSettingsTracker = CBTNotifSettingsTracker::NewL( this );
+    if( iSettingsTracker->GetPowerState() == EBTPowerOn )
+        {
+        iConnectionTracker = CBTNotifConnectionTracker::NewL( this );
+        }
+    iNotificationMgr = CBTNotificationManager::NewL( this );
+    
+    iTimer = CDeltaTimer::NewL(CActive::EPriorityLow);
+    TCallBack shutdownCb( ShutdownTimeout, this );
+    iShutdownTimerEntry.Set( shutdownCb );
+    // The server class does not handle any registry events.
+    // Classes that want to receive these events must register
+    // via observer interface.
+    iDevRep = CBtDevRepository::NewL();
+    }
+
+// ---------------------------------------------------------------------------
+// Callback for asynchronous construction.
+// ---------------------------------------------------------------------------
+//
+TInt CBTNotifServer::AsyncConstructCb( TAny* aPtr )
+    {
+    TRAPD( err, ( (CBTNotifServer*) aPtr )->AsyncConstructL() );
+    return err;
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewLC.
+// ---------------------------------------------------------------------------
+//
+CBTNotifServer* CBTNotifServer::NewLC()
+    {
+    CBTNotifServer* self = new( ELeave ) CBTNotifServer();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBTNotifServer::~CBTNotifServer()
+    {
+    delete iDevSelector;
+    delete iSettingsTracker;
+    delete iConnectionTracker;
+    delete iNotificationMgr;
+    delete iAsyncCb;
+    delete iTimer;
+    delete iDevRep;
+    }
+
+// ---------------------------------------------------------------------------
+// Handle a change in BT power state.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifServer::HandlePowerStateChangeL( TBTPowerStateValue aState )
+    {
+    if( aState && !iConnectionTracker )
+        {
+        // only construct tracker if it is not available yet
+        iConnectionTracker = CBTNotifConnectionTracker::NewL( this );
+        }
+    else
+        {
+        delete iConnectionTracker;
+        iConnectionTracker = NULL;
+        }
+    CheckIdle( aState );
+    }
+
+// ---------------------------------------------------------------------------
+// Increase the session count.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifServer::AddSession()
+    {
+    ++iSessionCount;
+    iTimer->Remove( iShutdownTimerEntry );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Decrease the session count.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifServer::RemoveSession()
+    {
+    if ( iSessionCount > 0 )
+        {
+        // session counter can't be less than 0
+        --iSessionCount;
+        }
+    CheckIdle( iSettingsTracker->GetPowerState() );
+    }
+
+// ---------------------------------------------------------------------------
+// get the singleton instance of device repository
+// ---------------------------------------------------------------------------
+//
+CBtDevRepository& CBTNotifServer::DevRepository()
+    {
+    return *iDevRep;
+    }
+
+// ---------------------------------------------------------------------------
+// get the singleton instance of device search notifier
+// ---------------------------------------------------------------------------
+//
+CBTNotifDeviceSelector& CBTNotifServer::DeviceSelectorL()
+    {
+    if ( ! iDevSelector )
+        {
+        iDevSelector = CBTNotifDeviceSelector::NewL( *this );
+        }
+    return *iDevSelector;
+    }
+
+// ---------------------------------------------------------------------------
+// Searches for a client message from a message handle and completes it.
+// ---------------------------------------------------------------------------
+//
+TInt CBTNotifServer::CompleteMessage( TInt aHandle, TInt aReason, const TDesC8& aReply )
+    {
+    TInt err = KErrNotFound;
+    iSessionIter.SetToFirst();
+    CBTNotifSession* session = NULL;
+    while( ( session = (CBTNotifSession*) iSessionIter++ ) != NULL )
+        {
+        err = session->CompleteMessage( aHandle, aReason, aReply );
+        if( err != KErrNotFound )
+            {
+            // Found the correct session, and message, and completed it.
+            break;
+            }
+        }
+    return err;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Searches for a client message from a message handle and returns it.
+// ---------------------------------------------------------------------------
+//
+const RMessage2* CBTNotifServer::FindMessageFromHandle( TInt aHandle )
+    {
+    const RMessage2* message = NULL;
+    iSessionIter.SetToFirst();
+    CBTNotifSession* session = NULL;
+    while( ( session = (CBTNotifSession*) iSessionIter++ ) != NULL )
+        {
+        message = session->FindMessageFromHandle( aHandle );
+        if( message )
+            {
+            // Found the correct session and message to return.
+            break;
+            }
+        }
+    return message;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Searches for a client message from a message handle and returns it.
+// ---------------------------------------------------------------------------
+//
+const RMessage2* CBTNotifServer::FindMessageFromUid( TInt aUid )
+    {
+    const RMessage2* message = NULL;
+    iSessionIter.SetToFirst();
+    CBTNotifSession* session = NULL;
+    while( ( session = (CBTNotifSession*) iSessionIter++ ) != NULL )
+        {
+        message = session->FindMessageFromUid( aUid );
+        if( message )
+            {
+            // Found the correct session and message to return.
+            break;
+            }
+        }
+    return message;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class CPolicyServer.
+// Create a new session object.
+// ---------------------------------------------------------------------------
+//
+CSession2* CBTNotifServer::NewSessionL( const TVersion& aVersion, 
+    const RMessage2& aMessage ) const
+    {
+    (void) aMessage;
+    // Compare our version with client-side version, CServer2 requires that 
+    // we leave if they are not compatible. 
+    TVersion srvVersion( KBTNotifServerVersionMajor, KBTNotifServerVersionMinor, 
+                          KBTNotifServerVersionBuild );
+
+    if( !User::QueryVersionSupported( aVersion, srvVersion ) )
+        {
+        // EFalse is returned if our version is not less than or 
+        // equal to the client version.
+        User::Leave( KErrNotSupported );
+        }
+    return CBTNotifSession::NewL();
+    }
+
+void CBTNotifServer::CheckIdle( TBTPowerStateValue aState )
+    {
+    // In special scenarios, we do not have to remove the timer and queue it 
+    // again, but these scenarios rarely happen in end-user use cases. 
+    iTimer->Remove( iShutdownTimerEntry );
+    if ( iSessionCount == 0 && aState == EBTPowerOff )
+        {
+        // BT power is off, start the shutdown timer.
+        TTimeIntervalMicroSeconds32 interval = KBTNtoifShutdownTimeout;
+        iTimer->Queue( interval, iShutdownTimerEntry );
+        }
+    }
+
+TInt CBTNotifServer::ShutdownTimeout( TAny* aPtr )
+    {
+    (void) aPtr;
+    CActiveScheduler::Stop();
+    return KErrNone;    
+    }
+
+// ======== GLOBAL FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Main function of the executable.
+// ---------------------------------------------------------------------------
+//
+GLDEF_C TInt E32Main()
+    {
+    __UHEAP_MARK;
+    CTrapCleanup* cleanup = CTrapCleanup::New();
+    TInt err = KErrNoMemory;
+    if ( cleanup )
+        {
+        TRAP( err, RunServerL() );
+        delete cleanup;
+        }
+    __UHEAP_MARKEND;
+    return err;
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/src/btnotifsession.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,304 @@
+/*
+* ============================================================================
+*  Name        : btnotifsession.cpp
+*  Part of     : bluetoothengine / btnotif
+*  Description : Session class for handling commands from clients.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.1
+*/
+
+#include "btnotifsession.h"
+#include <btextnotifiers.h>
+#include "btnotifclientserver.h"
+#include "btnotifsettingstracker.h"
+#include "btnotifconnectiontracker.h"
+#include "btnotifdeviceselector.h"
+
+
+// ======== LOCAL FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Start the server.
+// ---------------------------------------------------------------------------
+//
+void LeaveIfNullL( const TAny* aPtr, TInt aLeaveCode )
+    {
+    if( aPtr == NULL )
+        {
+        User::Leave( aLeaveCode );
+        }
+    }
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// C++ default constructor
+// ---------------------------------------------------------------------------
+//
+CBTNotifSession::CBTNotifSession()
+:   CSession2()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Symbian 2nd-phase constructor
+// ---------------------------------------------------------------------------
+//
+void CBTNotifSession::ConstructL()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// NewL.
+// ---------------------------------------------------------------------------
+//
+CBTNotifSession* CBTNotifSession::NewL()
+    {
+    CBTNotifSession* self = new( ELeave ) CBTNotifSession();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBTNotifSession::~CBTNotifSession()
+    {
+    for( TInt i = 0; i < iMessageQ.Count(); i++ )
+        {
+        // Complete all outstanding messages with error code
+        iMessageQ[i].Complete( KErrSessionClosed );
+        }
+    iMessageQ.Close();  // Cleans up all message objects.
+    Server()->RemoveSession();
+    }
+
+// ---------------------------------------------------------------------------
+// From class CSession2.
+// Receives a message from a client.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifSession::ServiceL( const RMessage2& aMessage )
+    {
+    TInt opCode = aMessage.Function();
+    if ( opCode == EBTNotifCancelNotifier || 
+         opCode == EBTNotifStartSyncNotifier ||
+         opCode == EBTNotifStartAsyncNotifier ||
+         opCode == EBTNotifUpdateNotifier )
+        {
+        TInt uid = aMessage.Int0();
+        if( uid == KDeviceSelectionNotifierUid.iUid )
+            {
+            // Note for implementers:
+            // message queue is not used in this notifier handling (due
+            // to its drawbacks for exception handlings in various situations). 
+            // implementations using message queue will be migrated step
+            // by step.
+        
+            TRAPD( err, {
+                CBTNotifDeviceSelector& selector = Server()->DeviceSelectorL();
+                selector.DispatchNotifierMessageL( aMessage ); }
+                );
+            if ( err )
+                {
+                aMessage.Complete( err );
+                }
+            // deviceselector takes the ownership of aMessage.
+            return;
+            }
+        }
+
+    // Messages are completed by message handlers, not here.
+    // Queue the message already so that handlers can find it from the queue.
+    iMessageQ.AppendL( aMessage );
+    // The position is assumed to not change during the execution of this function.
+    TInt handle = aMessage.Handle();    // Store the handle for de-queueing
+    TRAPD( err, DispatchMessageL( aMessage ) );
+    if( err || ( aMessage.IsNull() && FindMessageFromHandle( handle ) ) )
+        {
+        // If the message has been completed by now (handle is null and the message 
+        // still in the queue), we remove it again from the queue. Otherwise it 
+        // will be completed by the handling handler when it has handled the handling.
+        for( TInt i = 0; i < iMessageQ.Count(); i++ )
+            {
+            // This may be replaced by RArray::Find with appropriate key
+            if( iMessageQ[i].Handle() == handle )
+                {
+                iMessageQ.Remove( i );
+                }
+            }
+        }
+    if( err && !aMessage.IsNull() )
+        {
+        aMessage.Complete( err );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class CSession2.
+// Completes construction of the session.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifSession::CreateL()
+    {
+    Server()->AddSession();
+    }
+
+// ---------------------------------------------------------------------------
+// Complete a client message from a message handle with given data.
+// If a zero-length descriptor is passed, no data will be written back.
+// ---------------------------------------------------------------------------
+//
+TInt CBTNotifSession::CompleteMessage( TInt aHandle, TInt aReason, const TDesC8& aReply )
+    {
+    TInt err = KErrNotFound;
+    // This may be replaced by RArray::Find with appropriate key
+    for( TInt i = 0; i < iMessageQ.Count(); i++ )
+        {
+        if( iMessageQ[i].Handle() == aHandle )
+            {
+            err = KErrNone;
+            if( aReply.Length() )
+                {
+                // For now, assume a fixed index for the result.
+                // Change this if a the client can pass more arguments!
+                // ToDo: replace with constant!
+                err = iMessageQ[i].Write( EBTNotifSrvReplySlot, aReply );
+                // Should the result be passed back to the calller,
+                // or used to complete the message?
+                }
+            iMessageQ[i].Complete( aReason );
+            iMessageQ.Remove( i );
+            break;
+            }
+        }
+    return err;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Find a client message from an RMessage2 handle.
+// ---------------------------------------------------------------------------
+//
+const RMessage2* CBTNotifSession::FindMessageFromHandle( TInt aHandle ) const
+    {
+    // This may be replaced by RArray::Find with appropriate key
+    for( TInt i = 0; i < iMessageQ.Count(); i++ )
+        {
+        if( iMessageQ[i].Handle() == aHandle )
+            {
+            return &iMessageQ[i];
+            }
+        }
+    return NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Process a client message.
+// The processing here relies on RNotifier backend server for queueing 
+// notifiers on the same channel. Therefore pairing (SSP and legacy) and 
+// authorization notifiers arrive in order, not simultaneously, even if 
+// they use arrive on different session instances.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifSession::DispatchMessageL( const RMessage2& aMessage )
+    {
+    BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, aMessage.Function() );
+    CBTNotifSettingsTracker* settTracker = Server()->SettingsTracker();
+    CBTNotifConnectionTracker* connTracker = Server()->ConnectionTracker();
+    LeaveIfNullL( settTracker, KErrNotReady );
+    TInt opcode = aMessage.Function();
+    if( opcode < EBTNotifMinValue )
+        {
+        User::Leave( KErrArgument );
+        }
+    switch( opcode )
+        {
+        case EBTNotifCancelNotifier:
+        case EBTNotifStartSyncNotifier:
+        case EBTNotifStartAsyncNotifier:
+        case EBTNotifUpdateNotifier:
+            {
+            // All these messages get the same treatment: forward 
+            // to settings and connection tracker, who will deal with it appropriately.
+            // First the settings tracker handles the message.
+            settTracker->DispatchNotifierMessageL( aMessage );
+            if( connTracker && !aMessage.IsNull() )
+                {
+                // Pass it on to the connection tracker, if it hasn't been completed yet.
+                connTracker->DispatchNotifierMessageL( aMessage );
+                }
+            else
+                {
+                // Power is off, can't do this now.
+                LeaveIfNullL( connTracker, KErrNotReady );
+                }
+            if( opcode != EBTNotifStartAsyncNotifier && !aMessage.IsNull() )
+                {
+                // Nobody has yet completed the message, and it is a synchronous
+                // one so we'll do it here to allow the notifier to keep on going.
+                aMessage.Complete( KErrNone );
+                }
+            }
+            break;
+        case EBTEngPrepareDiscovery:
+            {
+            // This is functionality only related to existing connections.
+            // Can't do when power is off though.
+            LeaveIfNullL( connTracker, KErrNotReady );
+            //connTracker->HandlePairingRequestL( aMessage );
+            }
+            break;
+        case EBTEngPairDevice:
+        case EBTEngCancelPairDevice:
+            {
+            // This is functionality only related to connections.
+            // Can't do when power is off though.
+            LeaveIfNullL( connTracker, KErrNotReady );
+            connTracker->HandleBondingRequestL( aMessage );
+            }
+            break;
+        default:
+            // Communicate result back.
+            User::Leave( KErrNotSupported );
+            break;
+        }
+    BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Find a client message from an RNotifier UID.
+// ---------------------------------------------------------------------------
+//
+const RMessage2* CBTNotifSession::FindMessageFromUid( TInt aUid ) const
+    {
+    // This may be replaced by RArray::Find with appropriate key
+    for( TInt i = 0; i < iMessageQ.Count(); i++ )
+        {
+        if( iMessageQ[i].Int0() == aUid )
+            {
+            return &iMessageQ[i];
+            }
+        }
+    return NULL;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifsrv/src/btnotifsettingstracker.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,166 @@
+/*
+* ============================================================================
+*  Name        : btnotifsettingstracker.cpp
+*  Part of     : BTProximity / BTProximity
+*  Description : Class for tracking Bluetooth settings, and also for handling notes unrelated to specific connection.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.1
+*/
+
+#include "btnotifsettingstracker.h"
+#include <btserversdkcrkeys.h>
+
+#include "btnotifserver.h"
+#include "btnotificationmanager.h"
+#include "btnotifclientserver.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// C++ default constructor
+// ---------------------------------------------------------------------------
+//
+CBTNotifSettingsTracker::CBTNotifSettingsTracker( CBTNotifServer* aServer )
+:   iServer( aServer )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Symbian 2nd-phase constructor
+// ---------------------------------------------------------------------------
+//
+void CBTNotifSettingsTracker::ConstructL()
+    {
+    iSettings = CBTEngSettings::NewL( this );
+    User::LeaveIfError( iSettings->GetPowerState( iPowerState ) );
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewL.
+// ---------------------------------------------------------------------------
+//
+CBTNotifSettingsTracker* CBTNotifSettingsTracker::NewL( CBTNotifServer* aServer )
+    {
+    CBTNotifSettingsTracker* self = new( ELeave ) CBTNotifSettingsTracker( aServer );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBTNotifSettingsTracker::~CBTNotifSettingsTracker()
+    {
+    if( iNotification )
+        {
+        // Clear the notification callback, we cannot receive them anymore.
+        iNotification->RemoveObserver();
+        iNotification->Close(); // Also dequeues the notification from the queue.
+        iNotification = NULL;
+        }
+    delete iSettings;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Process a client message related to notifiers.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifSettingsTracker::DispatchNotifierMessageL( const RMessage2& aMessage )
+    {
+    TUid uid = TUid::Uid( aMessage.Int0() );
+    (void) uid;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Cancels an outstanding client message related to notifiers.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifSettingsTracker::CancelNotifierMessageL( const RMessage2& aMessage )
+    {
+    (void) aMessage;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBTEngSettingsObserver.
+// Handle a power status change.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifSettingsTracker::PowerStateChanged( TBTPowerStateValue aState )
+    {
+    iPowerState = aState;
+    TRAP_IGNORE( iServer->HandlePowerStateChangeL( aState ) );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBTEngSettingsObserver.
+// Handle a visibility mode change.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifSettingsTracker::VisibilityModeChanged( TBTVisibilityMode aState )
+    {
+    if( iVisibilityMode == EBTVisibilityModeTemporary && 
+            aState == EBTVisibilityModeHidden && iPowerState == EBTPowerOn )
+        {
+        // Timeout expired, launch a note.
+        // Note that we get the power state change before this one, when powering
+		// off and setting visibility mode to hidden automatically.
+        NOTIF_NOTHANDLED( !iNotification )
+        iNotification = iServer->NotificationManager()->GetNotification();
+        if ( iNotification )
+            {
+            iNotification->SetObserver( this );
+            iNotification->SetNotificationType( TBluetoothDeviceDialog::ENote, EVisibilityTimeout );
+            iServer->NotificationManager()->QueueNotification( iNotification );
+            }
+        }
+    iVisibilityMode = aState;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBTNotificationResult.
+// Handle a result from a user query.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifSettingsTracker::MBRDataReceived( CHbSymbianVariantMap& aData )
+    {
+    (void) aData;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBTNotificationResult.
+// The notification is finished.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifSettingsTracker::MBRNotificationClosed( TInt aError, const TDesC8& aData  )
+    {
+    (void) aError;
+    (void) aData;
+    iNotification->RemoveObserver();
+    iNotification = NULL;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifwrapper/data/101fd68f.rss	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* ============================================================================
+*  Name        : 101fd68f.rss
+*  Part of     : bluetoothengine / btnotifwrapper
+*  Description : Resource definitions for project btnotifwrapper
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.1
+*/
+
+#include <uikon.hrh>
+#include <ecom/registryinfov2.rh>
+
+// ---------------------------------------------------------------------------
+// ecomInfo
+// ECOM registration info
+// ---------------------------------------------------------------------------
+//
+RESOURCE REGISTRY_INFO ecomInfo
+    {
+    resource_format_version = RESOURCE_FORMAT_VERSION_2;
+    dll_uid = 0x101FD68F;
+    interfaces =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KUikonUidPluginInterfaceNotifiers;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x20026FEE;
+                    version_no = 2;
+                    display_name = "BTNOTIFPLUGINWRAPPER vQT";
+                    default_data = "BTNOTIFPLUGIN vQT";
+                    opaque_data = "";
+                    }
+                };
+            }
+        };
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifwrapper/inc/btnotifwrapper.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,267 @@
+/*
+* ============================================================================
+*  Name        : btnotifwrapper.h
+*  Part of     : bluetoothengine / btnotif
+*  Description : Wrapper for Bluetooth Notifiers
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef BTNOTIFWRAPPER_H
+#define BTNOTIFWRAPPER_H
+
+
+#include <eiknotapi.h>
+#include <btnotifclient.h>
+#include <btservices/btsimpleactive.h>
+
+class CBTNotifWrapperUnitTester;
+
+/**
+ * Function for creating the array of notifiers supported by this plug-in.
+ * The main purpose for declaring it here is to allow it to be used
+ * by the test module.
+ *
+ * @since Symbian^4
+ * @return Array of notifiers.
+ */
+CArrayPtr<MEikSrvNotifierBase2>* CreateNotifierArrayL();
+
+/**
+ *  RNotif plugin implementation providing the client API for BTNotif 
+ *
+ *  @since Symbian^4
+ */
+NONSHARABLE_CLASS( CBTNotifWrapper ) : public CBase,
+                                       public MEikSrvNotifierBase2,
+                                       public MBtSimpleActiveObserver
+    {
+
+public:
+
+    /**
+     * Two-phased constructor.
+     */
+    static CBTNotifWrapper* NewLC( const TUid& aUid, const TUid& aChannel );
+
+    /**
+    * Destructor.
+    */
+    virtual ~CBTNotifWrapper();
+
+private:
+    
+// from base class MEikSrvNotifierBase2
+
+    /**
+     * From MEikSrvNotifierBase2.
+     * Frees all resources owned by this notifier.
+     *
+     * @since Symbian^4
+     */
+    virtual void Release();
+
+    /**
+     * From MEikSrvNotifierBase2.
+     * Performs any initialisation that this notifier may require.
+     * As a minimum, the function should return a TNotifierInfo instance 
+     * describing the notifier parameters.
+     *
+     * @since Symbian^4
+     * @return Describes the parameters of the notifier.
+     */
+    virtual TNotifierInfo RegisterL();
+
+    /**
+     * From MEikSrvNotifierBase2.
+     * Gets the notifier parameters.
+     *
+     * @since Symbian^4
+     * @return Describes the parameters of the notifier.
+     */
+    virtual TNotifierInfo Info() const;
+
+    /**
+     * From MEikSrvNotifierBase2.
+     *  This is called as a result of a client-side call to 
+     *  RNotifier::StartNotifier(), which the client uses to 
+     *  start a notifier from which it does not expect a response.
+     *
+     * @since Symbian^4
+     * @param aBuffer Data that can be passed from the client-side. The format 
+     *                and meaning of any data is implementation dependent.
+     * @return A pointer descriptor representing data that may be returned. 
+     *         The format and meaning of any data is implementation dependent.
+     */
+    virtual TPtrC8 StartL(const TDesC8& aBuffer);
+
+    /**
+     * From MEikSrvNotifierBase2.
+     *  This is called as a result of a client-side call to the asynchronous 
+     *  function RNotifier::StartNotifierAndGetResponse(). This means that the 
+     *  client is waiting, asynchronously, for the notifier to tell the 
+     *  client that it has finished its work.
+     *
+     * @since Symbian^4
+     * @param aBuffer Data that can be passed from the client-side. The format 
+     *                and meaning of any data is implementation dependent.
+     * @param aReplySlot Identifies which message argument to use for the reply.
+     *                   This message argument will refer to a modifiable 
+     *                   descriptor, a TDes8 type, into which data can be 
+     *                   returned. The format and meaning of any returned data 
+     *                   is implementation dependent.
+     * @param aMessage Encapsulates a client request.
+     */
+    virtual void StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
+
+    /**
+     * From MEikSrvNotifierBase2.
+     * Cancels an active notifier.
+     * This is called as a result of a client-side call to RNotifier::CancelNotifier().
+     *
+     * @since Symbian^4
+     */
+    virtual void Cancel();
+
+    /**
+     * From MEikSrvNotifierBase2.
+     * Updates a currently active notifier with new data.
+     * This is called as a result of a client-side call 
+     * to RNotifier::UpdateNotifier().
+     *
+     * @since Symbian^4
+     * @param aBuffer Data that can be passed from the client-side. The format 
+     *                and meaning of any data is implementation dependent.
+     * @return A pointer descriptor representing data that may be returned. 
+     *         The format and meaning of any data is implementation dependent.
+     */
+    virtual TPtrC8 UpdateL(const TDesC8& aBuffer);
+
+    /**
+     * From MEikSrvNotifierBase2.
+     * Updates a currently active notifier with new data.
+     * This is called as a result of a client-side call to the asynchronous 
+     * function RNotifier::UpdateNotifierAndGetResponse().
+     *
+     * @since Symbian^4
+     * @param aBuffer Data that can be passed from the client-side. The format 
+     *                and meaning of any data is implementation dependent.
+     * @param aReplySlot Identifies which message argument to use for the reply.
+     *                   This message argument will refer to a modifiable 
+     *                   descriptor, a TDes8 type, into which data can be 
+     *                   returned. The format and meaning of any returned data
+     *                   is implementation dependent.
+     * @param aMessage Encapsulates a client request.
+     */
+    virtual void UpdateL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
+
+// from base class MBtSimpleActiveObserver
+
+    /**
+     * Callback to notify that an outstanding request has completed.
+     *
+     * @since Symbian^4
+     * @param aActive Pointer to the active object that completed.
+     * @param aStatus The status of the completed request.
+     */
+    virtual void RequestCompletedL( CBtSimpleActive* aActive, TInt aStatus );
+
+    /**
+     * Callback for handling cancelation of an outstanding request.
+     *
+     * @since Symbian^4
+     * @param aId The ID that identifies the outstanding request.
+     */
+    virtual void CancelRequest( TInt aRequestId );
+
+    /**
+     * Callback to notify that an error has occurred in RunL.
+     *
+     * @since Symbian^4
+     * @param aActive Pointer to the active object that completed.
+     * @param aError The error occurred in RunL.
+     */
+    virtual void HandleError( CBtSimpleActive* aActive, TInt aError );
+    
+private:
+
+    CBTNotifWrapper( const TUid& aUid, const TUid& aChannel );
+
+    void ConstructL();
+
+    /**
+     * Check if this notifier is a synchronous or asunchronous notifier.
+     *
+     * @since Symbian^4
+     * @return ETrue is the notifier is synchronous, EFalse if asyncrhonous.
+     */
+    TBool IsSync() const;
+
+private: // data
+
+    /**
+     * The UID identifying the notifier.
+     */
+    TUid iUid;
+
+    /**
+     * The channel of the notifier.
+     */
+    TUid iChannel;
+
+    /**
+     * The replyslot for the result.
+     */
+    TInt iReplySlot;
+
+    /**
+     * Session with the BT notifier server.
+     */
+    RBTNotifier iBTNotif;
+
+    /**
+     * The client-side message containing the current request.
+     */
+    RMessagePtr2 iMessage;
+
+    /**
+     * Buffer containing a copy of the notifier parameters, for async notifiers.
+     * Own.
+     */
+    HBufC8* iParamsBuf;
+
+    /**
+     * Modifiable pointer descriptor for getting the response back.
+     */
+    TPtr8 iResponsePtr;
+
+    /**
+     * Buffer for receiving the response from the BT notifier server.
+     * Own.
+     */
+    HBufC8* iResponseBuf;
+
+    /**
+     * Active object helper class.
+     * Own.
+     */
+    CBtSimpleActive* iActive;
+
+    friend class CBTNotifWrapperUnitTester;
+    
+    };
+
+#endif // BTNOTIFWRAPPER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifwrapper/src/btnotifwrapper.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,315 @@
+/*
+* ============================================================================
+*  Name        : btnotifwrapper.cpp
+*  Part of     : bluetoothengine / btnotif
+*  Description : Wrapper for Bluetooth Notifiers
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.1
+*/
+
+#include "btnotifwrapper.h"
+#include <btnotif.h>
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <btextnotifierspartner.h>
+#endif
+
+/**  Identifier of the active object. */
+const TInt KWrapperActive = 10;
+
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+CBTNotifWrapper::CBTNotifWrapper( const TUid& aUid, const TUid& aChannel )
+:   MEikSrvNotifierBase2(),
+    iUid( aUid ),
+    iChannel( aChannel ),
+    iResponsePtr( NULL, 0 )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+void CBTNotifWrapper::ConstructL()
+    {
+    // lazy initialization: members are created and destroyed when needed.
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+CBTNotifWrapper* CBTNotifWrapper::NewLC( const TUid& aUid, const TUid& aChannel )
+    {
+    CBTNotifWrapper* self = new( ELeave ) CBTNotifWrapper( aUid, aChannel );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+CBTNotifWrapper::~CBTNotifWrapper()
+    {
+    Cancel();   // Cleans up buffers
+    delete iActive;
+    iBTNotif.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MEikSrvNotifierBase2.
+// Frees all the resources i.e. destruct ourselves.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifWrapper::Release()
+    {
+    delete this;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MEikSrvNotifierBase2.
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//
+MEikSrvNotifierBase2::TNotifierInfo CBTNotifWrapper::RegisterL()
+    {
+    return Info();
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MEikSrvNotifierBase2.
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//
+MEikSrvNotifierBase2::TNotifierInfo CBTNotifWrapper::Info() const
+    {
+    MEikSrvNotifierBase2::TNotifierInfo info;
+    info.iUid = iUid;
+    info.iChannel = iChannel;
+    info.iPriority = MEikSrvNotifierBase2::ENotifierPriorityVHigh;
+    return info;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MEikSrvNotifierBase2.
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//
+TPtrC8 CBTNotifWrapper::StartL(const TDesC8& aBuffer)
+    {
+    if( !IsSync() )
+        {
+        // due to the charasteristics of Bluetooth and UI operations,
+        // most of Bluetooth notifiers do not support synchronous version.
+        User::Leave( KErrNotSupported );
+        }
+    // Call notifier server and get response.
+    if( !iBTNotif.Handle() )
+        {
+        User::LeaveIfError( iBTNotif.Connect() );
+        }
+    User::LeaveIfError( iBTNotif.StartNotifier( iUid, aBuffer ) );
+    iBTNotif.Close();
+    return KNullDesC8();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MEikSrvNotifierBase2.
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//
+void CBTNotifWrapper::StartL(const TDesC8& aBuffer, TInt aReplySlot, 
+    const RMessagePtr2& aMessage)
+    {
+    if( !iMessage.IsNull() )
+        {
+        aMessage.Complete( KErrAlreadyExists );
+        return;
+        }
+
+    // Call notifier server and get response.
+    if( !iBTNotif.Handle() )
+        {
+        User::LeaveIfError( iBTNotif.Connect() );
+        }
+    if( !iActive )
+        {
+        iActive = CBtSimpleActive::NewL( *this, KWrapperActive );
+        }
+
+    // We need to store the parameters locally, as aBuffer is destroyed after
+    // returning from this call. We do it on the heap, so we do not permanently
+    // consume memory for the buffer.
+
+    iParamsBuf = HBufC8::NewL( aBuffer.Size() );
+    *iParamsBuf = aBuffer;
+
+    TInt len = aMessage.GetDesMaxLength( aReplySlot );
+    iResponseBuf = HBufC8::NewL( len );
+    // Copy in the response, to get the right buffer size.
+    iResponsePtr.Set( iResponseBuf->Des() );
+    aMessage.ReadL( aReplySlot, iResponsePtr );
+
+    iBTNotif.StartNotifierAndGetResponse( iActive->RequestStatus(),
+                iUid, *iParamsBuf, iResponsePtr );
+    iActive->GoActive();
+    // record the request
+    iReplySlot = aReplySlot;
+    iMessage = aMessage;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MEikSrvNotifierBase2.
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//
+void CBTNotifWrapper::Cancel()
+    {
+    // Call notifier server to cancel.
+    if( iActive  )
+        {
+        iActive->Cancel(); 
+        }
+    if( !iMessage.IsNull() )
+        {
+        iMessage.Complete( KErrCancel );
+        }
+    iReplySlot = 0;
+    delete iParamsBuf;
+    iParamsBuf = NULL;
+    delete iResponseBuf;
+    iResponseBuf = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MEikSrvNotifierBase2.
+// Synchronous notifier update.
+// ---------------------------------------------------------------------------
+//
+TPtrC8 CBTNotifWrapper::UpdateL(const TDesC8& aBuffer)
+    {
+    // Call notifier server and get response.
+    TBuf8<256> response;
+    if( !iBTNotif.Handle() )
+        {
+        User::LeaveIfError( iBTNotif.Connect() );
+        }
+    User::LeaveIfError( iBTNotif.UpdateNotifier( iUid, aBuffer, response ) );
+    return response;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MEikSrvNotifierBase2.
+// Asynchronous notifier update.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifWrapper::UpdateL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
+    {
+    (void) aReplySlot;
+    (void) aBuffer;
+    if( iMessage.IsNull() )
+        {
+        // There is no outstanding request, can't relate this to anything.
+        aMessage.Complete( KErrNotFound );
+        return;
+        }
+    // Call notifier server and get response.
+    // Async updates are just for updating parameters, so they are still 
+    // done synchronously between here and btnotif, as they don't 
+    // require any user feedback or other response with
+    // asynchronous/long cycles.
+    TPtrC8 response = UpdateL( aBuffer );
+    aMessage.WriteL( aReplySlot, response );
+    aMessage.Complete( KErrNone );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBtSimpleActiveObserver.
+// Callback to notify that an outstanding request has completed.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifWrapper::RequestCompletedL( CBtSimpleActive* aActive, TInt aStatus )
+    {
+    ASSERT( aActive->RequestId() == KWrapperActive );
+    (void) aActive;
+    if( !iMessage.IsNull() )
+        {
+        TInt err( aStatus );
+        if( !aStatus )
+            {
+            // for testing:
+            //TPckgBuf<TBTDeviceResponseParams> response;
+            //response.Copy( *iResponseBuf );
+            //response().BDAddr();
+            err = iMessage.Write( iReplySlot, *iResponseBuf );
+            }
+        iMessage.Complete( err );
+        }
+    // Clean up after usage.
+    iBTNotif.Close();
+    delete iParamsBuf;
+    iParamsBuf = NULL;
+    delete iResponseBuf;
+    iResponseBuf = NULL;
+    delete iActive;
+    iActive = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MBtSimpleActiveObserver.
+// Cancel and clean up all requests related to the active object.
+// ---------------------------------------------------------------------------
+//
+void CBTNotifWrapper::CancelRequest( TInt aRequestId )
+    {
+    ASSERT( aRequestId == KWrapperActive );
+    (void) aRequestId;
+    iBTNotif.CancelNotifier( iUid );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBtSimpleActiveObserver.
+// 
+// ---------------------------------------------------------------------------
+//
+void CBTNotifWrapper::HandleError( CBtSimpleActive* aActive, 
+        TInt aError )
+    {
+    // RequestCompletedL() is not leavable.
+    (void) aActive;
+    (void) aError;
+    }
+
+// ---------------------------------------------------------------------------
+// Check if this is a synchronous notifier or not.
+// ---------------------------------------------------------------------------
+//
+TBool CBTNotifWrapper::IsSync() const
+    {
+    return ( iUid == KBTGenericInfoNotifierUid );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/btnotifwrapper/src/btnotifwrapperproxy.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,126 @@
+/*
+* ============================================================================
+*  Name        : btnotifwrapperproxy.cpp
+*  Part of     : bluetoothengine / btnotifwrapper
+*  Description : ECOM plug-in entry implementation.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.1
+*/
+
+
+#include <ecom/implementationproxy.h>
+#include <btmanclient.h>
+#include <btextnotifiers.h>
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <btextnotifierspartner.h>
+#endif
+#include <btnotifierapi.h>
+//#include <networking/panuiinterfaces.h>
+
+#include "btnotifwrapper.h"
+
+/**  Granularity for constructing the array of notifiers */
+const TInt KBTNotifWrapperArraySize = 11;
+/** Channel for discovery notifiers */
+const TUid KBTDiscoveryChannel = { 0x00000601 };
+/** Channel for authentication and authorisation notifiers */
+const TUid KBTAuthChannel = {0x00000602};
+/** Channel for OBEX passkey notifiers */
+//const TUid KBTObexAuthChannel = {0x00000603};
+/** Channel for power mode query */
+//const TUid KBTPowerModeChannel = {0x00000605};
+/** Channel for query notifiers */
+//const TUid KBTQueryChannel = {0x00000606};
+/** Channel for power mode query */
+//const TUid KBTInfoChannel = {0x00000610};
+
+
+// ======== LOCAL FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+void CreateAndAppendNotifierLC( CArrayPtr<MEikSrvNotifierBase2>& aArray,
+    const TUid& aUid, const TUid& aChannel )
+    {
+    CBTNotifWrapper* notifier = CBTNotifWrapper::NewLC( aUid, aChannel );
+    aArray.AppendL( notifier );
+    }
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+CArrayPtr<MEikSrvNotifierBase2>* CreateNotifierArrayL()
+    {
+    CArrayPtrFlat<MEikSrvNotifierBase2>* notifiers = 
+        new( ELeave ) CArrayPtrFlat<MEikSrvNotifierBase2>( KBTNotifWrapperArraySize );
+    CleanupStack::PushL( notifiers );
+    // Create all the notifiers:
+    // Connection authorization notifier
+    CreateAndAppendNotifierLC( *notifiers, KBTManAuthNotifierUid, KBTAuthChannel );
+    // Old and new PIN notifiers
+    CreateAndAppendNotifierLC( *notifiers, KBTManPinNotifierUid, KBTAuthChannel );
+    CreateAndAppendNotifierLC( *notifiers, KBTPinCodeEntryNotifierUid, KBTAuthChannel );
+    // Secure simple pairing notifiers
+    CreateAndAppendNotifierLC( *notifiers, KBTNumericComparisonNotifierUid, KBTAuthChannel );
+    CreateAndAppendNotifierLC( *notifiers, KBTPasskeyDisplayNotifierUid, KBTAuthChannel );
+    
+    CreateAndAppendNotifierLC( *notifiers, KDeviceSelectionNotifierUid, KBTDiscoveryChannel );
+
+    /*
+     * Other notifiers to be migrated:
+     * 
+     * existing stack notifiers:
+     * CreateAndAppendNotifierL( aArray, KPbapAuthNotifierUid, KBTObexPINChannel );
+     * 
+     * S60 SDK API:
+     * CreateAndAppendNotifierL( aArray, KPowerModeSettingNotifierUid, KBTPowerModeChannel );
+     *
+     * S60-defined platform:
+     * CreateAndAppendNotifierL( aArray, KBTObexPasskeyQueryNotifierUid, KBTObexPINChannel );
+     * CreateAndAppendNotifierL( aArray, KBTGenericInfoNotifierUid, KBTInfoChannel );
+     * CreateAndAppendNotifierL( aArray, KBTGenericQueryNotifierUid, KBTQueryChannel );
+     * 
+     * new (PAN-related):
+     * CreateAndAppendNotifierL( aArray, KBTPanDeviceSelectionNotifierUid, KBTDiscoveryChannel );
+     * CreateAndAppendNotifierL( aArray, KBTPanNapUplinkAuthorisationNotifierUid, KBTAuthChannel );
+     */
+    CleanupStack::Pop( notifiers->Count() + 1, notifiers );  // Each notifier + notifier array itself
+    return notifiers;
+    }
+
+// ---------------------------------------------------------------------------
+// ECOM entry point.
+// ---------------------------------------------------------------------------
+//
+const TImplementationProxy ImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY( 0x20026FEE, CreateNotifierArrayL )
+    };
+
+// ======== GLOBAL FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// ECOM factory method.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
+    {
+    aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
+    return ImplementationTable;
+    }
--- a/bluetoothengine/btnotif/bwins/Btnotifu.def	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?NotifierArray@@YAPAV?$CArrayPtr@VMEikSrvNotifierBase2@@@@XZ @ 1 NONAME ; class CArrayPtr<class MEikSrvNotifierBase2> * __cdecl NotifierArray(void)
-
--- a/bluetoothengine/btnotif/data/BTNotif.rss	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,754 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, 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 BTNotif.
-*
-*/
-
-
-NAME BNOT
-
-#include <eikon.rsg>
-
-#include <eikon.rh>
-
-#include <avkon.rsg>
-#include <avkon.rh>
-#include <avkon.mbg>
-#include <avkon.loc>
-#include <btnotif.loc>
-#include "btnotif.hrh"
-
-RESOURCE RSS_SIGNATURE { }
-
-RESOURCE TBUF { buf=""; }
-
-// === ICONS =================================================================
-
-//----------------------------------------------------
-// Icon array for BTNOTIF
-//----------------------------------------------------
-//
-RESOURCE AKN_ICON_ARRAY r_btnotif_icons
-    {
-    //This resource is removed because of skinable icon change. The title is still staying here
-	//to prevent intruducing BC break.
-    }
-
-// === TITLES AND PROMPTS ====================================================
-
-//----------------------------------------------------
-// Titles for popup windows
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_search_devs_popup_title { buf = qtn_bt_searching_found; }
-
-RESOURCE TBUF r_bt_found_devs_popup_title { buf = qtn_bt_devices_found; }
-
-RESOURCE TBUF r_bt_last_seen_devs_popup_title { buf = qtn_bt_last_seen_devices; }
-
-RESOURCE TBUF r_bt_last_used_devs_popup_title { buf = qtn_bt_last_used_devices; }
-
-//----------------------------------------------------
-// Fixed list items
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_more_devices_item { buf = qtn_bt_more_devices; }
-
-//----------------------------------------------------
-// Prompts for queries
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_passkey_prompt { buf = qtn_bt_enter_pk_for_conn; }
-
-RESOURCE TBUF r_bt_dialog_def_name { buf = qtn_bt_dialog_def_name; }
-
-RESOURCE TBUF r_bt_authorisation_name { buf = qtn_bt_accept_conn_request; }
-
-RESOURCE TBUF r_bt_receive_message { buf = qtn_bt_receive_message; }
-
-RESOURCE TBUF r_bt_receive_message_paired { buf = qtn_bt_receive_message_paired; }
-
-RESOURCE TBUF r_bt_no_devices_found { buf =qtn_bt_no_devices_found; }
-//same text than in r_bt_try_again_query	
-
-RESOURCE TBUF r_bt_power_is_off { buf = qtn_bt_is_off; }
-//same text than in R_BT_POWER_IS_OFF_QUERY
-
-RESOURCE TBUF r_bt_activate_in_offline { buf= qtn_bt_activate_in_offline; }
-//same text than in R_BT_ACTIVATE_IN_OFFLINE_QUERY
-
-RESOURCE TBUF r_bt_is_hidden_java 		{ buf=qtn_bt_is_hidden_java; }
-
-RESOURCE TBUF r_bt_is_off_java 			{ buf=qtn_bt_is_off_java; }
-
-RESOURCE TBUF r_bt_is_hidden_java_appname 		{ buf=qtn_bt_is_hidden_java_appname; }
-
-RESOURCE TBUF r_bt_is_off_java_appname 			{ buf=qtn_bt_is_off_java_appname; }
-
-RESOURCE TBUF r_bt_turn_bt_off                         { buf = qtn_bt_dos_query; }
-
-RESOURCE TBUF r_bt_switch_off_anyway { buf= qtn_bt_switch_off_anyway; }
-
-//----------------------------------------------------
-// Headers of the r_bt_is_hidden_java and r_bt_is_off_java queries
-//----------------------------------------------------
-RESOURCE TBUF r_bt_is_off_java_header 	{ buf=qtn_bt_is_off_java_header ; }
-
-RESOURCE TBUF r_bt_is_hidden_java_header 	{ buf=qtn_bt_is_hidden_java_header ; }
-
-//----------------------------------------------------
-// Prompts for global notes
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_audio_accessory_prompt { buf = qtn_bt_audio_accessory; }
-
-RESOURCE TBUF r_bt_audio_handset_prompt { buf = qtn_bt_audio_handset; }
-
-RESOURCE TBUF r_bt_conf_connected_prompt { buf = qtn_bt_conf_connected; }
-
-RESOURCE TBUF r_bt_conf_disconnected_prompt { buf = qtn_bt_conf_disconnected; }
-
-RESOURCE TBUF r_bt_conn_closed_prompt { buf = qtn_bt_conn_closed; }
-
-RESOURCE TBUF r_bt_device_not_avail { buf = qtn_bt_device_not_avail; }
-
-RESOURCE TBUF r_bt_offline_disabled { buf = qtn_bt_offline_disabled; }
-//text of R_BT_BUSY
-RESOURCE TBUF r_bt_busy_text {	buf =qtn_bt_busy;	}
-
-RESOURCE TBUF r_ir_not_supported {	buf =qtn_ir_not_supported;	}
-
-
-//----------------------------------------------------
-// Default name array for BTNotif
-// These names are used if no name is received in inquiry.
-// Note! The order must match enum TBTDefaultDevNameArrayIndexes
-// defined in BTNInqUi.cpp.
-//----------------------------------------------------
-//
-RESOURCE ARRAY r_bt_default_device_names
-    {
-    items = {
-        LBUF { txt=qtn_bt_computer; },
-        LBUF { txt=qtn_bt_phone; },
-        LBUF { txt=qtn_bt_audio; },
-        LBUF { txt=qtn_bt_keyboard; },
-        LBUF { txt=qtn_bt_mouse; },
-        LBUF { txt=qtn_bt_printer; },
-        LBUF { txt=qtn_bt_carkit; },
-        LBUF { txt=qtn_bt_dialog_def_name; }
-        };
-    }
-
-
-// === SOFTKEYS ==============================================================
-
-//----------------------------------------------------
-// Softkeys for "Searching devices" wait note
-//----------------------------------------------------
-//
-RESOURCE CBA r_bt_softkeys_empty_cancel
-    {
-    buttons =
-        {
-        CBA_BUTTON {txt="";},
-        CBA_BUTTON {id=EAknSoftkeyCancel; txt = text_softkey_cancel; }
-        };
-    }
-
-
-//----------------------------------------------------
-// Softkeys for found devices popup list
-//----------------------------------------------------
-//
-RESOURCE CBA r_bt_softkeys_select_stop
-    {
-    buttons =
-        {
-        CBA_BUTTON {id=EAknSoftkeySelect; txt = text_softkey_select;},
-        CBA_BUTTON {id=EAknSoftkeyCancel; txt = qtn_bt_softkey_stop; },
-        CBA_BUTTON {id=EAknSoftkeySelect; txt = text_softkey_select;}       
-        };
-    }
-
-// === QUERIES ===============================================================
-
-//----------------------------------------------------
-// PIN request query
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_enter_passkey_query
-    {
-    flags   = EGeneralQueryFlags | EEikDialogFlagVirtualInput ;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
-    items   =
-        {        
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_DATA_QUERY
-                {
-                layout  = EDataLayout;
-                control = EDWIN
-                    {
-                    maxlength = KBTPassKeyMaxLength;
-                    default_input_mode = EAknEditorNumericInputMode;
-                    flags     = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
-                    avkon_flags = EAknEditorFlagLatinInputModesOnly;
-                    };
-                };
-            }
-        }; 
-    }
-
-//----------------------------------------------------
-// OBEX PIN request query
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_obex_passkey_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_DATA_QUERY
-                {
-                layout  = EDataLayout;
-                label   = qtn_bt_enter_obex_pcode;
-                control = EDWIN
-                    {
-                    maxlength = KBTPassKeyMaxLength;
-                    default_input_mode = EAknEditorNumericInputMode;
-                    flags     = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
-                    };
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// Query for accepting incoming connections
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_authorisation_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout    = EConfirmationQueryLayout;
-                animation = R_QGN_NOTE_QUERY_ANIM;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// If device search has been unsuccessful, the new
-// search is asked with this query from user.
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_try_again_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout    = EConfirmationQueryLayout;
-                label     = qtn_bt_no_devices_found;
-                animation = R_QGN_NOTE_QUERY_ANIM;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// Ask BT power mode setting from user
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_power_is_off_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout    = EConfirmationQueryLayout;
-                label     = qtn_bt_is_off;
-                animation = R_QGN_NOTE_QUERY_ANIM;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// Ask BT power mode setting from user in offline mode
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_activate_in_offline_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout    = EConfirmationQueryLayout;
-                label     = qtn_bt_activate_in_offline;
-                animation = R_QGN_NOTE_QUERY_ANIM;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// Inform user that data receiving failed because of low memory.
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_memlo_memory_low_data_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout    = EConfirmationQueryLayout;
-                label     = qtn_memlo_memory_low_data;
-                animation = R_QGN_NOTE_ERROR_ANIM;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// Inform user that data receiving to MMC failed because of low memory.
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_memlo_mmc_memory_low_data_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout    = EConfirmationQueryLayout;
-                label     = qtn_memlo_mmc_memory_low_data;
-                animation = R_QGN_NOTE_ERROR_ANIM;
-                };
-            }
-        };
-    }
-
-RESOURCE DIALOG r_bt_passkey_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_CANCEL;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout    = EConfirmationQueryLayout;
-                animation = R_QGN_NOTE_QUERY_ANIM;
-                };
-            }
-        };
-    }
-
-// === NOTES =================================================================
-
-//----------------------------------------------------
-// Wait note right after bluetooth device search
-// has been launched.
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_searching_devices_note
-    {
-    flags   = EAknWaitNoteFlags | EEikDialogFlagWait;
-    buttons = r_bt_softkeys_empty_cancel;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtNote;
-            id      = EBTNotifSearchingDevicesNote;
-            control = AVKON_NOTE
-                {
-                layout          = EWaitLayout;
-                singular_label  = qtn_bt_searching;
-                animation       = R_QGN_GRAF_WAIT_BAR_ANIM;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// Information note when maximum number of connections
-// is reached and new one could not be created.
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_busy_note
-    {
-    flags   = EAknInformationNoteFlags;
-    buttons = R_AVKON_SOFTKEYS_EMPTY;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtNote;
-            id      = EBTNotifBtBusyNote;
-            control = AVKON_NOTE
-                {
-                layout          = EGeneralLayout;
-                singular_label  = qtn_bt_busy;
-                animation       = R_QGN_NOTE_INFO_ANIM;
-                };
-            }
-        };
-    }
-
-
-// === ANIMATIONS ============================================================
-
-//----------------------------------------------------
-// Animation for r_bt_searching_devices_popuplist
-//----------------------------------------------------
-//
-RESOURCE BMPANIM_DATA r_bt_animation_for_popuplist
-    {
-    frameinterval   = 200;
-    playmode        = EAknBitmapAnimationPlayModeCycle;
-    bmpfile         = btnotif_bitmap_file_data_caging;
-    frames          = r_bt_animation_for_popuplist_images;
-    }
-
-//----------------------------------------------------
-// Image frames for r_bt_animation_for_popuplist_images
-//----------------------------------------------------
-//
-RESOURCE ARRAY r_bt_animation_for_popuplist_images
-    {
-    items=
-        {
-        BMPANIM_FRAME {bmpid=EMbmBtnotifQgn_note_bt_popup_2;  maskid=EMbmBtnotifQgn_note_bt_popup_2_mask; },
-        BMPANIM_FRAME {bmpid=EMbmBtnotifQgn_note_bt_popup;    maskid=EMbmBtnotifQgn_note_bt_popup_mask;   },
-        BMPANIM_FRAME {bmpid=EMbmBtnotifQgn_note_bt_popup_3;  maskid=EMbmBtnotifQgn_note_bt_popup_3_mask; },
-        BMPANIM_FRAME {bmpid=EMbmBtnotifQgn_note_bt_popup;    maskid=EMbmBtnotifQgn_note_bt_popup_mask;   }
-        };
-    }
-
-//---------------------------------------------------------------
-// Prompts for Remote SIM Access Profile notes
-//----------------------------------------------------------------
-RESOURCE TBUF r_bt_enter_sap_note   	    	{ buf = qtn_bt_wait_sap_entering; }
-
-RESOURCE TBUF r_bt_enter_sap_succeed_note 		{ buf = qtn_bt_sap_entering_succeeded; }
-
-RESOURCE TBUF r_bt_enter_sap_failed_note 		{ buf = qtn_bt_sap_entering_failed; }
-
-RESOURCE TBUF r_bt_min_passkey_prompt 			{ buf = qtn_bt_enter_pk_sap; }
-
-//----------------------------------------------------
-// Data query "Enter Bluetooth name for your phone"
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_enter_local_name_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_DATA_QUERY
-                {
-                layout  = EDataLayout;
-                label   = qtn_enter_bt_name;
-                control = EDWIN
-                    {
-                    flags     = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
-                    maxlength = KBTUIMaxNameLength;
-                    };
-                };
-            }
-        };
-    }
-// ---------------------------------------------------
-//
-// r_bt_generic_message_query 
-//
-// This is the query blanket used by Generic Message queries.
-// They are java power and java visibility at the time
-// of this writing, but probably in the future there will be
-// others.
-// ---------------------------------------------------
-//
-RESOURCE DIALOG r_bt_generic_message_query 
-    {
-    flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
-    buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
-    items=
-        {
-		DLG_LINE 
-	        {
-            type = EAknCtPopupHeadingPane;
-            id = EAknMessageQueryHeaderId;
-            control = AVKON_HEADING
-                {
-                };
-            },
-        DLG_LINE
-            {
-            type = EAknCtMessageQuery;
-            id = EAknMessageQueryContentId;
-            control = AVKON_MESSAGE_QUERY
-                {
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// r_bt_generic_query
-//
-// This is the blanket for all the generic yes/no queries, which
-// do NOT use message query. This is not only used by CBTNGenericQueryNotifier
-// but other notifiers such as PinNotifier use also this.
-//
-// NOTE: There is no blanket for empty genric message.
-// It is just based on empty CAknInformationNote.
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_generic_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout    = EConfirmationQueryLayout;
-                animation = R_QGN_NOTE_QUERY_ANIM;
-                };
-            }
-        };
-    }    
-       
-//----------------------------------------------------
-// Information note that will be shown when temp 
-// visibility expire.
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_hidden_from_others_note			
-	{ 
-		buf = qtn_bt_hidden_from_others; 
-	}
-//----------------------------------------------------
-// Block devices related items
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_block_device_header	
-	{
-		buf = qtn_bt_block_device_header;
-	}
-	
-//----------------------------------------------------	
-// Blocking question asked, when the
-// user is asked about blocking a non-paired device.
-//----------------------------------------------------	
-//
-RESOURCE TBUF r_bt_block_device_nohelp
-	{
-		buf= qtn_bt_block_all_conn_attempts;
-	}
-
-//----------------------------------------------------	
-// Blocking question asked, when the
-// user is asked about blocking a paired device.
-//----------------------------------------------------	
-//
-RESOURCE TBUF r_bt_block_paired_device_nohelp
-	{
-		buf= qtn_bt_block_paired_device;
-	}
-	
-//----------------------------------------------------
-// Query for incoming pairing request
-//----------------------------------------------------
-RESOURCE TBUF r_bt_accept_pairing_request
-	{
-		buf=qtn_bt_accept_pairing_request;
-	}
-
-//----------------------------------------------------
-// Information note that will be shown when temp 
-// visibility expire.
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_no_device_discovery_voip			{ buf = qtn_bt_no_device_discovery_voip; }
-
-//----------------------------------------------------
-// Information note that will be shown if SIM card
-// is not available while trying SAP connection.
-//----------------------------------------------------
-//
-
-RESOURCE TBUF r_bt_sap_no_sim_note                       { buf = qtn_bt_sap_no_sim; }
-                                                               
-//----------------------------------------------------
-// Information note when maximum number of connections
-// is reached and new one could not be created.
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_turn_bt_off_note
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout    = EConfirmationQueryLayout;
-                animation = R_QGN_NOTE_QUERY_ANIM;
-                label     = qtn_bt_dos_query;
-                };
-            }
-        };
-    }
-  
-   
-//---------------------------------------------------
-// Title for search filter        
-//---------------------------------------------------
-RESOURCE TBUF r_bt_search_filter_popup_title { buf = qtn_bt_search_for; }    
-
-//----------------------------------------------------
-//List item text in search filter
-//----------------------------------------------------
-RESOURCE TBUF r_bt_search_for_all { buf = qtn_bt_search_for_all; }
-RESOURCE TBUF r_bt_search_for_phone { buf = qtn_bt_search_for_phone; }
-RESOURCE TBUF r_bt_search_for_computer { buf = qtn_bt_search_for_computer; }
-RESOURCE TBUF r_bt_search_for_audio { buf = qtn_bt_search_for_audio; }
-RESOURCE TBUF r_bt_search_for_input { buf = qtn_bt_search_for_input; }    
-
-//------------------------------------------------------------
-// query for unblocking selected blocked device
-//------------------------------------------------------------
-RESOURCE DIALOG r_bt_unblock_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout    = EConfirmationLayout;
-                animation = R_QGN_NOTE_QUERY_ANIM;
-                };
-            }
-        };
-    }
-
-RESOURCE TBUF r_bt_unblock_device 		{ buf = qtn_bt_unblock_device; }
-
-//----------------------------------------------------
-// Information note for AVRCP 1.3 Battery low info
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_accessory_low 		{ buf = qtn_bt_accessory_low; }
-RESOURCE TBUF r_bt_accessory_critical 	{ buf = qtn_bt_accessory_critical; }
-RESOURCE TBUF r_bt_permanently_on        { buf = qtn_bt_permanently_on; }
-RESOURCE TBUF r_bt_switched_on        { buf = qtn_bt_switched_on; }
-RESOURCE TBUF r_bt_switched_off        { buf = qtn_bt_switched_off; }
-
-//----------------------------------------------------
-// SSP NumericComparison and PasskeyEntry
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_ssp_passkey_comparison_prompt    { buf = qtn_bt_simple_passkey_comparison; }
-RESOURCE TBUF r_bt_ssp_passkey_entry    { buf = qtn_bt_simple_passkey_entry; }
-
-//----------------------------------------------------
-// Confirmation note "Pairing successfully done with %U"
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_succesfully_paired_prompt { buf = qtn_bt_succesfully_paired; }
-
-//----------------------------------------------------
-// Error notes of SSP 
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_pairing_failed_prompt { buf = qtn_bt_pairing_failed; }
-RESOURCE TBUF r_bt_ssp_busy { buf = qtn_bt_simple_busy; }
-
-//-----------------------------------------------------------------------------
-// Confirmation note "Authorise this device to make connections automatically?"
-//-----------------------------------------------------------------------------
-//
-RESOURCE TBUF r_bt_authorization_prompt { buf = qtn_bt_authorisation_query; }
-
-// End of File
--- a/bluetoothengine/btnotif/eabi/BTNotifu.DEF	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	_Z13NotifierArrayv @ 1 NONAME
-	
--- a/bluetoothengine/btnotif/ecom/101FD68F.rss	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  This file specifies the interface and implementation information
-*                 for BTnotif Ecom Plugins.
-*
-*/
-
-
-#include <ecom/registryinfo.rh>
-#include <uikon.hrh>
-
-#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
-#include <uiklaf/private/pluginuid.hrh>
-#endif
-
-RESOURCE REGISTRY_INFO theInfo
-{
-	dll_uid = 0x101FD68F;
-	interfaces =
-	{
-	INTERFACE_INFO
-		{
-		interface_uid = KUikonUidPluginInterfaceNotifiers;
-		implementations =
-				{
-				IMPLEMENTATION_INFO
-					{
-					implementation_uid = 0x101FD690;
-					version_no = 1;
-					display_name = "TTNOTIFY2V2 Plugin 1";
-					default_data = "TTNOTIFY2V2";
-					opaque_data	 = "0";
-					}
-				};
-		}
-	};
-}
--- a/bluetoothengine/btnotif/ecom/BtnotifWrapper.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,223 +0,0 @@
-/*
-* 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:  Methods for BT notifier Ecom Plugins entry point
-*
-*/
-
-
-#include <implementationproxy.h>
-#include <AknNotifierWrapper.h> // link against aknnotifierwrapper.lib
-#include <btmanclient.h>
-#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
-#include <btextnotifiers.h>  	// define btninqnotifer uid
-#else
-#include <btextnotifiers.h>  	// define btninqnotifer uid
-#include <btextnotifierspartner.h>  	// define btninqnotifer uid
-#endif
-#include <btnotif.h>			// notifier id for power mode setting 
-
-// @todo remove this declaration once both stack and UI layers are in codeline
-const TUid KBTUserConfirmationNotifierUidCopyForWrapper={0x2002E224};
-
-
-const TInt KMaxSynchReplyBufLength = 256;  //what should be?
-
-const TUid KBTInquiryChannel            = {0x00000601}; // Channel for inquiry notifier
-const TUid KBTAuthorisationChannel      = {0x00000602}; // Channel for authorisation notifier
-const TUid KBTAuthenticationChannel     = {0x00000603}; // Channel for PIN query notifier
-const TUid KBTObexPINChannel            = {0x00000605}; // Channel for OBEX PIN notifier
-const TUid KBTPowerModeChannel          = {0x00000606}; // Channel for power mode notifier
-const TUid KBTPairedDeviceSettingChannel  = {0x00000610}; // Channel for Visibility timeout notifier
-
-const TInt KBTInquiryPriority 			= MEikSrvNotifierBase2::ENotifierPriorityVHigh;
-const TInt KBTAuthorisationPriority 	= MEikSrvNotifierBase2::ENotifierPriorityVHigh;
-const TInt KBTAuthenticationPriority 	= MEikSrvNotifierBase2::ENotifierPriorityVHigh;
-const TInt KBTObexPinPriority 			= MEikSrvNotifierBase2::ENotifierPriorityVHigh;
-const TInt KBTPowerModePriority 		= MEikSrvNotifierBase2::ENotifierPriorityVHigh;
-const TInt KBTGenericInfoNotifierPriority = MEikSrvNotifierBase2::ENotifierPriorityHigh;
-const TInt KBTGenericQueryNotifierPriority = MEikSrvNotifierBase2::ENotifierPriorityHigh;
-const TInt KBTNumericComparisonPriority     = MEikSrvNotifierBase2::ENotifierPriorityVHigh;  // for SSP
-const TInt KBTPasskeyEntryNotifierPriority = MEikSrvNotifierBase2::ENotifierPriorityVHigh;   // for SSP
-const TInt KBTUserConfirmationNotifierPriority = MEikSrvNotifierBase2::ENotifierPriorityVHigh;   // for SSP
-const TInt KBTPairedDeviceSettingPriority = MEikSrvNotifierBase2::ENotifierPriorityVHigh;   
-const TInt KBTEnterpriseItSecurityInfoNotifierPriority = MEikSrvNotifierBase2::ENotifierPriorityHigh;
-
-const TInt KBTNotifierArrayIncrement = 8;
-
-void CleanupArray(TAny* aArray)
-    {
-    CArrayPtrFlat<MEikSrvNotifierBase2>*     
-        subjects=static_cast<CArrayPtrFlat<MEikSrvNotifierBase2>*>(aArray);
-    TInt lastInd = subjects->Count()-1;
-    for (TInt i=lastInd; i >= 0; i--)
-        subjects->At(i)->Release();	    	    
-    delete subjects;
-    }
-
-CArrayPtr<MEikSrvNotifierBase2>* DoCreateNotifierArrayL()
-    {   	
-
-    CArrayPtrFlat<MEikSrvNotifierBase2>* subjects=
-        new (ELeave)CArrayPtrFlat<MEikSrvNotifierBase2>(KBTNotifierArrayIncrement);
-    
-    CleanupStack::PushL(TCleanupItem(CleanupArray, subjects));
-
-    // Create Wrappers
-
-    // Session owning notifier(if default implementation is enough)
-                                   
-    CAknCommonNotifierWrapper* master = 
-        CAknCommonNotifierWrapper::NewL( KDeviceSelectionNotifierUid,
-                                   KBTInquiryChannel,
-                                   KBTInquiryPriority,
-                                   _L("BTNotif.dll"),
-                                   KMaxSynchReplyBufLength);
-
-    CleanupStack::PushL( master );
-    subjects->AppendL( master );
-    CleanupStack::Pop( master );
-
-    // Notifiers using masters session
-    CAknNotifierWrapperLight* notif = NULL;
-    notif = new (ELeave) CAknNotifierWrapperLight(*master,
-                                                  KBTManAuthNotifierUid,
-                                                  KBTAuthorisationChannel,
-                                                  KBTAuthorisationPriority);
-    CleanupStack::PushL( notif );
-    subjects->AppendL( notif );
-    CleanupStack::Pop( notif );
-
-    notif = new (ELeave) CAknNotifierWrapperLight(*master,
-                                                  KBTPinCodeEntryNotifierUid,
-                                                  KBTAuthenticationChannel,
-                                                  KBTAuthenticationPriority);
-    CleanupStack::PushL( notif );
-    subjects->AppendL( notif );
-    CleanupStack::Pop( notif );
-
-    notif = new (ELeave) CAknNotifierWrapperLight(*master,
-                                                  KBTObexPasskeyQueryNotifierUid,
-                                                  KBTObexPINChannel,
-                                                  KBTObexPinPriority);
-    CleanupStack::PushL( notif );
-    subjects->AppendL( notif );
-    CleanupStack::Pop( notif );
-
-    notif = new (ELeave) CAknNotifierWrapperLight(*master,
-                                                  KPowerModeSettingNotifierUid,
-                                                  KBTPowerModeChannel,
-                                                  KBTPowerModePriority);
-    CleanupStack::PushL( notif );
-    subjects->AppendL( notif );
-    CleanupStack::Pop( notif );
-
-    notif = new (ELeave) CAknNotifierWrapperLight(*master,
-                                                  KBTGenericInfoNotifierUid,
-                                                  KBTGenericInfoNotifierUid,
-                                                  KBTGenericInfoNotifierPriority);
-    CleanupStack::PushL( notif );
-    subjects->AppendL( notif );
-    CleanupStack::Pop( notif );
-
-    notif = new (ELeave) CAknNotifierWrapperLight(*master,
-                                                  KBTGenericQueryNotifierUid,
-                                                  KBTGenericQueryNotifierUid,
-                                                  KBTGenericQueryNotifierPriority);
-    CleanupStack::PushL( notif );
-    subjects->AppendL( notif );
-    CleanupStack::Pop( notif );
-
-    notif = new (ELeave) CAknNotifierWrapperLight(*master,
-                                                  KPbapAuthNotifierUid,
-                                                  KBTObexPINChannel,
-                                                  KBTObexPinPriority);
-    CleanupStack::PushL( notif );
-    subjects->AppendL( notif );
-    CleanupStack::Pop( notif );
-
-    notif = new (ELeave) CAknNotifierWrapperLight(*master,
-                                                  KBTPairedDeviceSettingNotifierUid,
-                                                  KBTPairedDeviceSettingChannel,
-                                                  KBTPairedDeviceSettingPriority);
-    CleanupStack::PushL( notif );
-    subjects->AppendL( notif );
-    CleanupStack::Pop( notif );
-
-    notif = new (ELeave) CAknNotifierWrapperLight(*master,
-                                                  KBTNumericComparisonNotifierUid,
-                                                  KBTNumericComparisonNotifierUid,
-                                                  KBTNumericComparisonPriority);
-    CleanupStack::PushL( notif );
-    subjects->AppendL( notif );
-    CleanupStack::Pop( notif );
-
-    notif = new (ELeave) CAknNotifierWrapperLight(*master,
-                                                  KBTPasskeyDisplayNotifierUid,
-                                                  KBTPasskeyDisplayNotifierUid,
-                                                  KBTPasskeyEntryNotifierPriority);
-    CleanupStack::PushL( notif );
-    subjects->AppendL( notif );
-    CleanupStack::Pop( notif );
-
-    notif = new (ELeave) CAknNotifierWrapperLight(*master,
-                                                  KBTUserConfirmationNotifierUidCopyForWrapper,
-                                                  KBTUserConfirmationNotifierUidCopyForWrapper,
-                                                  KBTUserConfirmationNotifierPriority);
-    CleanupStack::PushL( notif );
-    subjects->AppendL( notif );
-    CleanupStack::Pop( notif );    
-    
-    notif = new (ELeave) CAknNotifierWrapperLight(*master,
-                                                  KBTEnterpriseItSecurityInfoNotifierUid,
-                                                  KBTEnterpriseItSecurityInfoNotifierUid,
-                                                  KBTEnterpriseItSecurityInfoNotifierPriority);
-
-    CleanupStack::PushL( notif );
-    subjects->AppendL( notif );
-    CleanupStack::Pop( notif );
-
-    CleanupStack::Pop();	// array cleanup
-    return(subjects);
-    }
-
-
-CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
-    // old Lib main entry point
-    {   	   	
-    
-    CArrayPtr<MEikSrvNotifierBase2>* array = 0;
-    TRAPD(ignore, array = DoCreateNotifierArrayL());
-    if (ignore != KErrNone) 
-    	{
-    	ignore = KErrNone;
-    	}
-    return array;
-    }
-
-const TImplementationProxy ImplementationTable[] =
-	{
-#ifdef __EABI__
-	{{0x101FD690},(TFuncPtr)NotifierArray}
-#else
-	{{0x101FD690},NotifierArray}
-#endif
-	};
-
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
-	{   	
-	
-	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy) ;
-	return ImplementationTable;
-	}
-
--- a/bluetoothengine/btnotif/ecom/BtnotifWrapper.mmp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* 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 is project specification file for the BTNotif Ecom Plugins.
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-TARGET         	btnotifwrapper.DLL
-CAPABILITY 		CAP_ECOM_PLUGIN
-TARGETTYPE 		PLUGIN 
-
-VENDORID		VID_DEFAULT
-
-UID				0x10009D8D 0x101FD68F
-
-SOURCEPATH	    .
-USERINCLUDE		../inc
-
-
-SYSTEMINCLUDE   /epoc32/include/ecom
-MW_LAYER_SYSTEMINCLUDE
-
-
-
-LANG         	SC
-SOURCE  		BtnotifWrapper.cpp 
-START RESOURCE 101FD68F.rss 
-TARGET btnotifwrapper.rsc
-END
-
-LIBRARY 		ECOM.LIB
-LIBRARY			AKNNOTIFIERWRAPPER.LIB
-LIBRARY 		EUSER.LIB
--- a/bluetoothengine/btnotif/group/BTNotif.mmp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 BTNotif.
-*
-*/
-
-#include <platform_paths.hrh>
-#include <data_caging_paths.hrh>
-
-TARGET          BTNotif.dll
-TARGETTYPE      DLL
-UID             0x101fdfae 0x10005953 
-TARGETPATH      SHARED_LIB_DIR
-
-VENDORID         VID_DEFAULT
-SOURCEPATH      ../src
-SOURCE          BTNMain.cpp
-SOURCE          BTNotifier.cpp
-SOURCE          BTNAuthNotifier.cpp
-SOURCE          BTNPinNotifier.cpp
-SOURCE          BTNInqNotifier.cpp
-SOURCE          BTNInqUI.cpp
-SOURCE          BTNInquiAO.cpp
-SOURCE          BTNObexPinNotifier.cpp
-SOURCE          BTNPwrNotifier.cpp
-SOURCE          BTNGenericInfoNotifier.cpp
-SOURCE          BTNGenericQueryNotifier.cpp
-SOURCE          BTNPBAPPinNotifier.cpp
-SOURCE          btnpaireddevsettnotifier.cpp
-SOURCE          btnssppasskeyentrynotifier.cpp
-SOURCE          btnumcmpnotifier.cpp
-SOURCE          btuserconfnotifier.cpp
-SOURCE          btnotifuiutil.cpp
-SOURCE          btnotifactive.cpp
-SOURCE          btnpairnotifier.cpp
-SOURCE          btnotifnameutils.cpp
-SOURCE          btnenterpriseitsecurityinfonotifier.cpp
-
-START RESOURCE        ../data/BTNotif.rss
-HEADER
-TARGETPATH      RESOURCE_FILES_DIR
-LANGUAGE_IDS
-END
-
-USERINCLUDE       ../inc
-SYSTEMINCLUDE     ../../inc     //for private API headers (BluetoothEngine subsystem)
-SYSTEMINCLUDE     ../../../inc  //for internal API headers (localconnectivity)
-APP_LAYER_SYSTEMINCLUDE         // Standard system include paths
-
-LIBRARY euser.lib cone.lib                  // Symbian OS framework libraries
-LIBRARY avkon.lib                           // UI library
-LIBRARY bafl.lib                            // Basic Application Framework Library
-LIBRARY bluetooth.lib                       // Bluetooth libraries
-LIBRARY btdevice.lib                        // Bluetooth library
-LIBRARY btextnotifiers.lib                  // Bluetooth library
-
-//Bteng New APIs
-LIBRARY btengdevman.lib                     //btengdevman.dll
-LIBRARY btengsettings.lib                   //btengsettings.dll
-LIBRARY btengconnman.lib                    //btengconnman.dll
-
-LIBRARY commonengine.lib                    // Series 60 common components library
-LIBRARY charconv.lib                        // Character conversion library
-LIBRARY eikcoctl.lib eiksrv.lib             // Eikon libraries
-LIBRARY eikcore.lib                         // Library for eikonEnv static functions (BringForwards)
-LIBRARY eiksrvui.lib                        // Eikon server ui (for suppressing app -key)
-LIBRARY esock.lib                           // Sockects library for host resolver
-LIBRARY AknSkins.lib                        // Skinned icons
-LIBRARY aknicon.lib
-LIBRARY aknNotifierWrapper.lib
-LIBRARY centralrepository.lib               // Central Repository
-LIBRARY	egul.lib 
-LIBRARY CdlEngine.lib AknLayout2.lib
-LIBRARY btmanclient.lib                     // reguired by TBTRegistrySearch 
-LIBRARY hlplch.lib                          // required by help callback
-
-// For cover display support:
-LIBRARY eikdlg.lib
-LIBRARY estor.lib
-LIBRARY FeatMgr.lib
-LIBRARY	efsrv.lib
-LIBRARY etul.lib
-
-DEBUGLIBRARY flogger.lib                    // File logging services
-
-//Optional for codewarrior ide
-//DOCUMENT data/BTNotif.rss
-//DOCUMENT BTNotif.loc
-
-CAPABILITY      CAP_GENERAL_DLL
-// End of File
--- a/bluetoothengine/btnotif/group/bld.inf	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/btnotif/group/bld.inf	Fri May 14 16:01:46 2010 +0300
@@ -19,33 +19,20 @@
 #include <platform_paths.hrh>
 
 PRJ_PLATFORMS
-//DEFAULT
+DEFAULT
 
 PRJ_EXPORTS
-../loc/btnotif.loc        MW_LAYER_LOC_EXPORT_PATH(btnotif.loc)
-../rom/Btnotif.iby        CORE_MW_LAYER_IBY_EXPORT_PATH(Btnotif.iby)
-../rom/BtnotifResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(BtnotifResources.iby)
-../inc/devui_const.h |../../inc/devui_const.h
 
-PRJ_EXTENSIONS
-
-START EXTENSION s60/mifconv
-OPTION TARGETFILE btnotif.mif
-OPTION HEADERFILE btnotif.mbg
-OPTION SOURCES -c8,8 qgn_note_bt_popup -c8,8 qgn_note_bt_popup_2 \
-		           -c8,8 qgn_note_bt_popup_3 -c8,8 qgn_indi_bt_blocked \
-		           -c8,8 qgn_indi_bt_signal_good_add \
-		           -c8,8 qgn_indi_bt_signal_low_add \
-		           -c8,8 qgn_indi_bt_signal_med_add
-END
-
+../rom/btnotif.iby  CORE_MW_LAYER_IBY_EXPORT_PATH(btnotif.iby)
 PRJ_MMPFILES
 
-// gnumakefile btnotif_icons_dc.mk
-
-../group/BTNotif.mmp
-../ecom/BtnotifWrapper.mmp
+btnotifsrv.mmp
+btnotifwrapper.mmp
 
 PRJ_TESTMMPFILES
 
-// End of File
+//../btnotifsrv/tsrc/btnotifsrvtest/group/btnotifsrvtest.mmp
+../btnotifsrv/tsrc/btnotifsrvtest/group/btnotifserversessiontest.mmp
+../btnotifwrapper/tsrc/btnotifwrappertest/group/btnotifwrappertest.mmp
+
+PRJ_TESTEXPORTS
--- a/bluetoothengine/btnotif/group/btnotif_icons_dc.mk	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-#
-# 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: 
-#
-
-ifeq (WINS,$(findstring WINS, $(PLATFORM)))
-ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
-else
-ZDIR=\epoc32\data\z
-endif
-
-# ----------------------------------------------------------------------------
-# TODO: Configure these
-# ----------------------------------------------------------------------------
-
-TARGETDIR=$(ZDIR)\resource\apps
-ICONTARGETFILENAME=$(TARGETDIR)\btnotif.mif
-
-HEADERDIR=\epoc32\include
-HEADERFILENAME=$(HEADERDIR)\btnotif.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, \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_note_bt_popup.bmp \
-		/c8,8 qgn_note_bt_popup_2.bmp \
-		/c8,8 qgn_note_bt_popup_3.bmp \
-		/c8,8 qgn_indi_bt_blocked.svg
-
-FREEZE : do_nothing
-
-SAVESPACE : do_nothing
-
-RELEASABLES :
-	@echo $(HEADERFILENAME)&& \
-	@echo $(ICONTARGETFILENAME)
-
-FINAL : do_nothing
-  
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/group/btnotifsrv.mmp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,64 @@
+/*
+* ============================================================================
+*  Name        : btnotifsrv.mmp
+*  Part of     : bluetoothengine / btnotif
+*  Description : Project definition file for project btnotif
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.1
+*/
+
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+TARGET                  btnotifsrv.exe
+TARGETTYPE              exe
+UID                     0x1000008d 0x20026FED
+
+CAPABILITY              CAP_SERVER NetworkControl PowerMgmt CommDD 
+VENDORID                VID_DEFAULT
+
+SOURCEPATH              ../btnotifsrv/src
+SOURCE                  btnotifserver.cpp
+SOURCE                  btnotifsession.cpp
+SOURCE                  btnotifconnectiontracker.cpp
+SOURCE                  btnotifconnection.cpp
+SOURCE                  btnotifpairinghelper.cpp
+SOURCE                  btnotifsettingstracker.cpp
+SOURCE                  btnotificationmanager.cpp
+SOURCE                  bluetoothnotification.cpp 
+SOURCE                  btnotifdeviceselector.cpp
+
+USERINCLUDE             ../btnotifsrv/inc ../inc
+
+MW_LAYER_SYSTEMINCLUDE
+
+SYSTEMINCLUDE           ../../inc
+SYSTEMINCLUDE           ../../../inc
+
+LIBRARY                 euser.lib
+LIBRARY                 esock.lib
+LIBRARY                 bluetooth.lib
+LIBRARY                 btdevice.lib
+LIBRARY                 btmanclient.lib
+LIBRARY                 btextnotifiers.lib
+LIBRARY                 btengsettings.lib
+LIBRARY                 btengconnman.lib
+LIBRARY                 btengdevman.lib
+LIBRARY                 btserviceutil.lib
+LIBRARY                 HbCore.lib
+LIBRARY                 commonengine.lib
+LIBRARY					flogger.lib
+LIBRARY					charconv.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/group/btnotifwrapper.mmp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,52 @@
+/*
+* ============================================================================
+*  Name        : btnotifwrapper.mmp
+*  Part of     : bluetoothengine / btnotifwrapper
+*  Description : Project definition file for project btnotifwrapper
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.1
+*/
+
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+TARGET                  btnotifwrapper.dll
+TARGETTYPE              PLUGIN
+UID                     0x10009D8D 0x101FD68F
+
+CAPABILITY              CAP_ECOM_PLUGIN
+VENDORID                VID_DEFAULT
+
+START RESOURCE          ../btnotifwrapper/data/101fd68f.rss
+HEADER
+TARGET                  btnotifwrapper.rsc
+END // RESOURCE
+
+SOURCEPATH              ../btnotifwrapper/src
+SOURCE                  btnotifwrapper.cpp
+SOURCE                  btnotifwrapperproxy.cpp
+
+USERINCLUDE             ../btnotifwrapper/inc ../inc
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE           ../../inc
+
+LIBRARY                 euser.lib
+LIBRARY                 ecom.lib
+LIBRARY                 eiksrv.lib
+LIBRARY                 btnotifclient.lib
+LIBRARY                 btserviceutil.lib
+
--- a/bluetoothengine/btnotif/inc/BTNGenericInfoNotifier.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 generic information notifier class.
-*
-*/
-
-
-#ifndef BTNGENERICINFONNOTIFIER_H
-#define BTNGENERICINFONNOTIFIER_H
-
-// INCLUDES
-
-#include "btnotifier.h" // Base class
-
-// FORWARD DECLARATIONS
-class CAknInformationNote;
-
-// CLASS DECLARATION
-NONSHARABLE_CLASS(CBTGenericInfoNotifier) : public CBTNotifierBase
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Two-phased constructor.
-        */
-        static CBTGenericInfoNotifier* NewL();
-
-        /**
-        * Destructor.
-        */
-        virtual ~CBTGenericInfoNotifier();
-
-    private: // Functions from base classes
-
-        /**
-        * From CBTNotifierBase Called when a notifier is first loaded 
-        * to allow any initial construction that is required.
-        * @param None.
-        * @return A structure containing priority and channel info.
-        */
-        TNotifierInfo RegisterL();
-        
-        /** From CBTNotifierBase Synchronic notifier launch.        
-        * @param aBuffer Received parameter data.
-        * @return A pointer to return value.
-        */
-        TPtrC8 StartL(const TDesC8& aBuffer );
-
-        /**
-        * From CBTNotifierBase Used in asynchronous notifier launch to 
-        * store received parameters into members variables and 
-        * make needed initializations.
-        * @param aBuffer A buffer containing received parameters
-        * @param aReturnVal The return value to be passed back.
-        * @param aMessage Should be completed when the notifier is deactivated.
-        * @return None.
-        */
-        void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
- 
-        /**
-        * From CBTNotifierBase
-        */      
-        void HandleGetDeviceCompletedL(const CBTDevice* aDev);        
-
-    private:
-    
-		/**
-        * Parse the data out of the message that is sent by the client of the notifier. 
-		* @param aBuffer A package buffer containing received parameters.
-        * @return None.
-        */
-		void ProcessParamBufferL(const TDesC8& aBuffer, TBool aSyncCall);
-		
-        /**
-        * C++ default constructor.
-        */
-        CBTGenericInfoNotifier();
-
-        /**
-         * Show Information note and complete message. 
-         */
-        void ShowNoteAndCompleteL(TBool aSyncCall);
-        
-    private:
-        RBuf	iQueryMessage;
-	    TInt 	iMessageResourceId;
-	    TSecondaryDisplayBTnotifDialogs iSecondaryDisplayCommand;
-    };
-
-#endif
-
-// End of File
--- a/bluetoothengine/btnotif/inc/BTNGenericQueryNotifier.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 Generic Query Notifier Class.
-*
-*/
-
-
-#ifndef BTNGENERICQUERYNOTIFIER_H
-#define BTNGENERICQUERYNOTIFIER_H
-
-// INCLUDES
-
-#include "btnotifier.h" // Base class
-
-// FORWARD DECLARATIONS
-
-// CLASS DECLARATION
-NONSHARABLE_CLASS(CBTGenericQueryNotifier) : public CBTNotifierBase
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Two-phased constructor.
-        */
-        static CBTGenericQueryNotifier* NewL();
-
-        /**
-        * Destructor.
-        */
-        virtual ~CBTGenericQueryNotifier();
-
-    private: // Functions from base classes
-
-        /**
-        * From CBTNotifierBase Called when a notifier is first loaded 
-        * to allow any initial construction that is required.
-        * @param None.
-        * @return A structure containing priority and channel info.
-        */
-        TNotifierInfo RegisterL();
-       
-        /** From CBTNotifierBase Synchronic notifier launch.        
-        * @param aBuffer Received parameter data.
-        * @return A pointer to return value.
-        */
-        TPtrC8 StartL(const TDesC8& aBuffer );
-                
-        /**
-        * From CBTNotifierBase Used in asynchronous notifier launch to 
-        * store received parameters into members variables and 
-        * make needed initializations.
-        * @param aBuffer A buffer containing received parameters
-        * @param aReturnVal The return value to be passed back.
-        * @param aMessage Should be completed when the notifier is deactivated.
-        * @return None.
-        */
-        void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
-
-		/**
-        * From CBTNotifierBase Updates a currently active notifier.
-        * @param aBuffer The updated data.
-        * @return A pointer to return value.
-        */
-        TPtrC8 UpdateL(const TDesC8& aBuffer);
-        
-    private:
-
-		/**
-        * Parse the data out of the message that is sent by the client of the notifier. 
-		* @param aBuffer A package buffer containing received parameters.
-        * @return None.
-        */
-		void ProcessParamBufferL(const TDesC8& aBuffer);
-		
-        /**
-        * C++ default constructor.
-        */
-        CBTGenericQueryNotifier();   
-        
-        /**
-         * Show query and complete message.
-         */
-        void ShowQueryAndCompleteL();
-                
-    private:
-    	
-        RBuf				iQueryMessage;
-		HBufC*				iQueryHeader;
-        HBufC*				iName;
-
-	    TInt 		iMessageResourceId;
-	    TSecondaryDisplayBTnotifDialogs	iSecondaryDisplayCommand;
-		TBool 		iIsMessageQuery;
-		TBool 		iIsNameQuery;
-    };
-
-#endif
-
-// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/inc/bluetoothdevicedialogs.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,177 @@
+/*
+* ============================================================================
+*  Name        : bluetoothdevicedialogs.h
+*  Part of     : bluetoothengine / btnotif
+*  Description : Data structures for passing dialog type and formatting between btnotif and the UI component showing the actual dialogs. Also defines identifiers for Bluetooth device dialogs.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef BLUETOOTHDEVICEDIALOGS_H
+#define BLUETOOTHDEVICEDIALOGS_H
+
+#include <btdevice.h>
+
+/**  Enumeration for the type of notification to be launched. */
+enum TBTDialogResourceId
+    {
+    ENoResource,
+    EAuthorization,
+    EIncomingPairing,
+    EPinInput,
+    ENumericComparison,
+    EPasskeyDisplay,
+    EObexPasskeyInput,
+    ESetTrusted,
+    EBlockUnpairedDevice,
+    EBlockPairedDevice,
+    EPairingSuccess,
+    EPairingFailure,
+    EVisibilityTimeout,
+    EUnusedResource	// The last ID
+    };
+
+
+/**
+ *  TBluetoothDialogParams contains device dialog parameters except for device name and type
+ *
+ *  @since Symbian^4
+ */
+NONSHARABLE_CLASS( TBluetoothDialogParams )
+    {
+
+public:
+
+    /**  Enumeration for the type of notification to be launched. */
+    enum TBTDialogType
+        {
+        EInvalidDialog,
+        ENote,
+        EQuery,
+        EInput,
+        EDeviceSearch,
+        EGlobalNotif
+        };
+
+    /**  Enumeration for the notification parameters data type to be configured. */
+    enum TDialogDataType
+        {
+        ENoParams,
+        EDialogType,
+        EResource,
+        EAddress,
+        EDialogTitle,
+        EDialogExt  // Id for first data type of derived class.
+        };
+
+    inline TBluetoothDialogParams();
+
+public: // data
+
+    /**
+     * Identifier for the type of notification.
+     */
+    TInt iDialogType;
+
+    /**
+     * Identifier for the resource to be shown in the dialog.
+     */
+    TInt iResourceId;
+
+    /**
+     * Address of the remote device (not used, for future extension).
+     */
+    TBTDevAddr iAddr;
+
+    /**
+     * Unused padding (not used, for future extension).
+     */
+    TUint32 iPadding;
+
+    };
+
+
+/**
+ *  TBluetoothDeviceDialog contains more device dialog parameters 
+ *  
+ *  @since Symbian^4
+ */
+NONSHARABLE_CLASS( TBluetoothDeviceDialog ) : public TBluetoothDialogParams
+    {
+
+public:
+
+    /**  Enumeration for the notification parameters data type to be configured. */
+    enum TDialogDataType
+        {
+        ENoParams = TBluetoothDialogParams::EDialogExt,
+        EDeviceName,
+        EDeviceClass,
+        EAdditionalInt,
+        EAdditionalDesc
+        };
+
+    inline TBluetoothDeviceDialog();
+
+public: // data
+
+    /**
+     * The name of the remote device.
+     */
+    TBTDeviceName iDeviceName;
+
+    /**
+     * The class of device of the remote device.
+     */
+    TInt iDeviceClass;
+
+    /**
+     * Additional data depending on the resource.
+     */
+    TInt iIntParam;
+
+    /**
+     * Additional data depending on the resource.
+     */
+    TBuf<10> iDescParam;
+
+    };
+
+
+/**  Typedef'ed pckgbuf to send dialog parameters to the notification framework. */
+typedef TPckgBuf<TBluetoothDialogParams> TBluetoothDialogParamsPckg;
+
+/**  Typedef'ed pckgbuf to send dialog parameters to the notification framework. */
+typedef TPckgBuf<TBluetoothDeviceDialog> TBluetoothDeviceDialogPckg;
+
+
+inline TBluetoothDialogParams::TBluetoothDialogParams()
+:   iDialogType( EInvalidDialog ),
+    iResourceId( ENoResource ),
+    iAddr( TBTDevAddr() ),
+    iPadding( 0 )
+    {
+    }
+
+inline TBluetoothDeviceDialog::TBluetoothDeviceDialog()
+:   iDeviceName( 0 ),
+    iDeviceClass( 0 ),
+    iIntParam( 0 )
+    {
+    }
+
+
+#endif // BLUETOOTHDEVICEDIALOGS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/inc/bluetoothtrace.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,455 @@
+/*
+* ============================================================================
+*  Name        : bluetoothtrace.h
+*  Part of     : BluetoothUI / bluetoothuimodel       *** Info from the SWAD
+*  Description : API declaration of run-time debug tracing
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef BLUETOOTHTRACE_H
+#define BLUETOOTHTRACE_H
+
+#include <e32base.h>
+#include "traceconfig.h"
+
+/*
+ * Common tracing utility definition to be used by Bluetooth projects.
+ * The configuration is loaded from traceconfig.h which shall be private for
+ * each individual project.
+ * 
+ * In this utility, a set of OST-alike tracing macros are defined. 
+ * (The purpose is to ease migration to OST in future.)
+ * 
+ * Individual project can also define new macros based on this utility in
+ * its own space.
+ * 
+ */
+
+#ifdef BLUETOOTHTRACE_ENABLED
+
+#ifdef BLUETOOTHTRACE_MEDIA_OST
+
+/**
+ * Convert own macros to OST macros when OST tracing is used.
+ * In OST tracing, aTraceName must be a unique identifier in scope of a module. 
+ * Thus many OST compiling errors may occur if the same TraceName is used in multiple
+ * tracing lines where tracing is miigrated from non-OST to OST. 
+ * The fix is to renaming the TraceName:s to be unique.
+ */
+#include <OpenSystemTrace.h>
+
+#define BOstrace0( aGroupName, aTraceName, aTraceText ) \
+    OstTrace0( aGroupName, aTraceName, aTraceText )
+
+#define BOstrace1( aGroupName, aTraceName, aTraceText, aParam ) \
+    OstTrace1( aGroupName, aTraceName, aTraceText, aParam )
+
+#define BOstraceData( aGroupName, aTraceName, aTraceText, aPtr, aLength ) \
+    OstTraceData( aGroupName, aTraceName, aTraceText, aPtr, aLength )
+
+#define BOstraceExt1( aGroupName, aTraceName, aTraceText, aParam ) \
+    OstTraceExt1( aGroupName, aTraceName, aTraceText, aParam )
+
+#define BOstraceExt2( aGroupName, aTraceName, aTraceText, aParam1, aParam2 ) \
+    OstTraceExt2( aGroupName, aTraceName, aTraceText, aParam1, aParam2 )
+
+#define BOstraceExt3( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3 ) \
+    OstTraceExt3( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3 )
+
+#define BOstraceExt4( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4 ) \
+    OstTraceExt4( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4 )
+
+#define BOstraceExt5( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4, aParam5 ) \
+    OstTraceExt5( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4, aParam5 )
+
+#define BOstraceFunctionEntry0( aTraceName ) \
+    OstTraceFunctionEntry0( aTraceName )
+
+#define BOstraceFunctionEntry1( aTraceName, aInstance ) \
+    OstTraceFunctionEntry1( aTraceName, aInstance )
+
+#define BOstraceFunctionEntryExt(aTraceName, aInstance, aArg) \
+    OstTraceFunctionEntryExt(aTraceName, aInstance, aArg)
+
+#define BOstraceFunctionExit0( aTraceName ) \ 
+    OstTraceFunctionExit0( aTraceName )
+
+#define BOstraceFunctionExit1( aTraceName, aInstance ) \
+    OstTraceFunctionExit1( aTraceName, aInstance )
+
+#define BOstraceFunctionExitExt(aTraceName, aInstance, aRetval) \
+    OstTraceFunctionExitExt(aTraceName, aInstance, aRetval)
+    
+#define BOstraceEventStart0( aTraceName, aEventName ) \
+    OstTraceEventStart0( aTraceName, aEventName )
+    
+#define BOstraceEventStart1( aTraceName, aEventName, aParam ) \
+    OstTraceEventStart1( aTraceName, aEventName, aParam )
+
+#define BOstraceEventStop( aTraceName, aEventName ) \
+    OstTraceEventStop( aTraceName, aEventName )
+
+#define BOstraceState0( aTraceName, aStateName, aNewState ) \
+    OstTraceState0( aTraceName, aStateName, aNewState )
+
+#define BOstraceState1( aTraceName, aStateName, aNewState, aInstance ) \
+    OstTraceState1( aTraceName, aStateName, aNewState, aInstance )
+    
+#else  // BLUETOOTHTRACE_MEDIA_OST
+
+#ifdef BLUETOOTHTRACE_MEDIA_FILE
+#include <flogger.h>
+#else   
+#include <e32debug.h>
+#endif
+
+/**
+ * When tracing compilation with OST is disabled, the TraceName in each OST trace line
+ * is ignored, that is, the Trace Names are not checked at compiling time, neither
+ * are they written into the specified trace output media.
+ */
+    
+/**
+ * Handlers below are used for tolerating overflow of formatting strings.
+ * to trucate rather than panic the caller.
+ */
+NONSHARABLE_CLASS( TBtTraceOflowTruncate8 ) : public TDes8Overflow
+    {
+public:
+    void Overflow( TDes8& /*aDes*/ ) {}
+    };
+
+NONSHARABLE_CLASS( TBtTraceOflowTruncate16 ) : public TDes16Overflow
+    {
+public:
+    void Overflow( TDes16& /*aDes*/ ) {}
+    };
+
+/**
+ * internal tracing implementation, do not use it out of this file.
+ */
+inline void Trace(const TDesC &trGrp, const TDesC &trTxt)
+{
+    _LIT(Format, "%S%S%S");
+    TBuf16<0x180> str; 
+    TPtrC cp(KComponentName);
+    str.Format(Format, &cp, &trGrp, &trTxt);
+#ifdef BLUETOOTHTRACE_MEDIA_FILE
+    RFileLogger::WriteFormat( KLogDir, KLogFile, EFileLoggingModeAppend, str);
+#else
+    RDebug::Print( str );
+#endif
+}
+
+/*
+ * trace with no parameters
+ */
+#define BOstrace0( aGroupName, aTraceName, aTraceText ) \
+{\
+    _LIT(TrGrp, aGroupName); _LIT(TrTxt, aTraceText); \
+    Trace( TrGrp, TrTxt ); \
+}
+
+/*
+ * trace with one 32-bit parameter
+ */
+#define BOstrace1( aGroupName, aTraceName, aTraceText, aParam ) \
+{\
+    _LIT(TrGrp, aGroupName); _LIT(TrTxt, aTraceText); \
+    TBuf<512> buf; TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(TrTxt, &overflow, aParam); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * trace with more than 32 bits of data. Not supported
+ */
+#define BOstraceData( aGroupName, aTraceName, aTraceText, aPtr, aLength ) 
+
+/*
+ * trace with one parameter that is not 32-bit integer
+ */
+#define BOstraceExt1( aGroupName, aTraceName, aTraceText, aParam ) \
+    BOstrace1( aGroupName, aTraceName, aTraceText, aParam )
+
+/*
+ * trace with two parameters.
+ */
+#define BOstraceExt2( aGroupName, aTraceName, aTraceText, aParam1, aParam2 ) \
+{\
+    _LIT(TrGrp, aGroupName); _LIT(TrTxt, aTraceText); \
+    TBuf<512> buf; TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(TrTxt, &overflow, aParam1, aParam2); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * trace with three parameters.
+ */
+#define BOstraceExt3( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3 ) \
+{\
+    _LIT(TrGrp, aGroupName); _LIT(TrTxt, aTraceText); \
+    TBuf<512> buf; TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(TrTxt, &overflow, aParam1, aParam2, aParam3); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * trace with four parameters
+ */    
+#define BOstraceExt4( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4 ) \
+{\
+    _LIT(TrGrp, aGroupName); _LIT(TrTxt, aTraceText); \
+    TBuf<512> buf; TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(TrTxt, &overflow, aParam1, aParam2, aParam3, aParam4); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * trace with five parameters
+ */   
+#define BOstraceExt5( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4, aParam5 ) \
+{\
+    _LIT(TrGrp, aGroupName); _LIT(TrTxt, aTraceText); \
+    TBuf<512> buf; TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(TrTxt, &overflow, aParam1, aParam2, aParam3, aParam4, aParam5); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * Function entry trace without extra parameters. 
+ * The trace is mapped to TRACE_API group.
+ */
+#define BOstraceFunctionEntry0( aTraceName ) \
+{\
+    _LIT(TrGrp, "[ API ]"); \
+    TPtrC8 func( (TUint8*) __PRETTY_FUNCTION__ ); \
+    _LIT(Entry, ">> "); \
+    TBuf<512> buf; buf.Copy( func ); buf.Insert(0, Entry );\
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * Function entry trace with a parameter representing the instance identifier, e.g.
+ * "this" pointer.
+ * The trace is mapped to TRACE_API group.
+ */
+#define BOstraceFunctionEntry1( aTraceName, aInstance ) \
+{\
+    _LIT(TrGrp, "[ API ]");\
+    TPtrC8 func( (TUint8*) __PRETTY_FUNCTION__ ); \
+    _LIT(Entry, ">> "); _LIT(Fmt, " 0x%X(%d)"); \
+    TBuf<512> buf; buf.Copy( func ); buf.Insert(0, Entry); \
+    TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(Fmt, &overflow, aInstance, aInstance); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * Function entry trace, which traces function parameters.
+ * The trace is mapped to TRACE_API group. 
+ */
+#define BOstraceFunctionEntryExt(aTraceName, aInstance, aArg) \
+{ \
+    _LIT(TrGrp, "[ API ]");\
+    TPtrC8 func( (TUint8*) __PRETTY_FUNCTION__ ); \
+    _LIT(Entry, ">> "); _LIT(Fmt, " 0x%X(%d) arg %d"); \
+    TBuf<512> buf; buf.Copy( func );  buf.Insert(0, Entry); \
+    TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(Fmt, &overflow, aInstance, aInstance, aArg); \
+    Trace( TrGrp, buf ); \
+}
+/*
+ * Function exit trace without extra parameters. 
+ * The trace is mapped to TRACE_API group.
+ */
+#define BOstraceFunctionExit0( aTraceName ) \
+{\
+    _LIT(TrGrp, "[ API ]"); \
+    TPtrC8 func( (TUint8*) __PRETTY_FUNCTION__ ); \
+    _LIT(Entry, "<< "); \
+    TBuf<512> buf; buf.Copy( func );  buf.Insert(0, Entry); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * Function exit trace with a parameter representing the instance identifier
+ * for example "this" pointer.
+ * The trace is mapped to TRACE_API group.
+ */
+#define BOstraceFunctionExit1( aTraceName, aInstance ) \
+{\
+    _LIT(TrGrp, "[ API ]"); \
+    TPtrC8 func( (TUint8*) __PRETTY_FUNCTION__ ); \
+    _LIT(Entry, "<< "); _LIT(Fmt, " 0x%X(%d)"); \
+    TBuf<512> buf; buf.Copy( func );  buf.Insert(0, Entry); \
+    TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(Fmt, &overflow, aInstance, aInstance); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * Function exit trace with parameters representing the instance identifier, 
+ * for example "this" pointer, and return value.
+ * The trace is mapped to TRACE_API group.
+ */
+#define BOstraceFunctionExitExt(aTraceName, aInstance, aRetval) \
+{\
+    _LIT(TrGrp, "[ API ]");\
+    TPtrC8 func( (TUint8*) __PRETTY_FUNCTION__ ); \
+    _LIT(Entry, "<< "); _LIT(Fmt, " 0x%X(%d) ret %d"); \
+    TBuf<512> buf; buf.Copy( func );  buf.Insert(0, Entry); \
+    TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(Fmt, &overflow, aInstance, aInstance, aRetval); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * Performance measurement event start trace without extra parameters. 
+ * The trace is mapped to TRACE_PERFORMANCE group.
+ */
+#define BOstraceEventStart0( aTraceName, aEventName ) \
+{\
+    _LIT(TrGrp, "[PFMAN]"); _LIT(EvName, aEventName); \
+    _LIT(Entry, "[Start] "); \
+    TBuf<512> buf(Entry); buf.Append( EvName ); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * Performance measurement event start trace with single 32-bit parameter. 
+ * The trace is mapped to TRACE_PERFORMANCE group.
+ */
+#define BOstraceEventStart1( aTraceName, aEventName, aParam ) \
+{\
+    _LIT(TrGrp, "[PFMAN]"); _LIT(EvName, aEventName); \
+    _LIT(Entry, "[Start] %S 0x%X(%d)"); \
+    TPtrC evt(EvName); TBuf<512> buf; \
+    TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(Entry, &overflow, &evt, aParam, aParam ); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * Performance measurement event end trace. 
+ * The trace is mapped to TRACE_PERFORMANCE group.
+ */
+#define BOstraceEventStop( aTraceName, aEventName ) \
+{\
+    _LIT(TrGrp, "[PFMAN]"); _LIT(EvName, aEventName); \
+    _LIT(Entry, "[Stop] "); \
+    TBuf<512> buf(Entry); buf.Append( EvName ); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * State transition event.
+ * The trace is mapped to TRACE_STATE group.
+ */
+#define BOstraceState0( aTraceName, aStateName, aNewState ) \
+{\
+    _LIT(TrGrp, "[STATE]"); _LIT(StName, aStateName); \
+    _LIT(Entry, "%S 0x%X(%d)"); \
+    TPtrC evt(StName); TBuf<512> buf; \
+    TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(Entry, &overflow, &evt, aNewState, aNewState ); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * State transition event with instance identifier.
+ * The trace is mapped to TRACE_STATE group.
+ */
+#define BOstraceState1( aTraceName, aStateName, aNewState, aInstance ) \
+{\
+    _LIT(TrGrp, "[STATE]"); _LIT(StName, aStateName); \
+    _LIT(Entry, "%S 0x%X(%d) instance=0x%X(%d)"); \
+    TPtrC evt(StName); TBuf<512> buf; \
+    TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(Entry, &overflow, &evt, aNewState, aNewState, aInstance, aInstance ); \
+    Trace( TrGrp, buf ); \
+}
+
+#endif // BLUETOOTHTRACE_MEDIA_OST
+
+// Extended tracing macros facilitating domain specific tracing needs:
+
+/*
+ * A block of source code merely for tracing purpose.
+ */
+#define BtTraceBlock( exp ) {exp}
+
+/*
+ * trace macro for BT device address printing with an additional trace text. 
+ * aParam must be TBTDevAddr type.
+ */
+#define BtTraceBtAddr1( aGroupName, aTraceName, aTraceText, aParam ) \
+{ \
+    _LIT(TrTxt, aTraceText); TPtrC p(TrTxt); \
+    TBuf<12> buf; \
+    aParam.GetReadable( buf ); TPtrC p2(buf);\
+    BOstraceExt2( aGroupName, aTraceName, "%S%S", &p, &p2 ); \
+}
+
+/*
+ * trace macro for BT device address printing with no additional trace text. 
+ * aParam must be TBTDevAddr type.
+ */
+#define BtTraceBtAddr0( aGroupName, aTraceName, aParam ) \
+{ \
+    TBuf<12> buf; aParam.GetReadable( buf ); TPtrC p(buf); \
+    BOstraceExt1( aGroupName, aTraceName, "%S", &p ); \
+}
+
+#else // BLUETOOTHTRACE_ENABLED
+
+#define BOstrace0( aGroupName, aTraceName, aTraceText )
+#define BOstrace1( aGroupName, aTraceName, aTraceText, aParam )
+#define BOstraceData( aGroupName, aTraceName, aTraceText, aPtr, aLength )
+#define BOstraceExt1( aGroupName, aTraceName, aTraceText, aParam )
+#define BOstraceExt2( aGroupName, aTraceName, aTraceText, aParam1, aParam2 )
+#define BOstraceExt3( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3 )
+#define BOstraceExt4( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4 )
+#define BOstraceExt5( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4, aParam5 )
+
+#define BOstraceFunctionEntry0( aTraceName )
+#define BOstraceFunctionEntry1( aTraceName, aInstance )
+#define BOstraceFunctionEntryExt(aTraceName, aInstance, aArg)
+#define BOstraceFunctionExit0( aTraceName )
+#define BOstraceFunctionExit1( aTraceName, aInstance )
+#define BOstraceEventStart0( aTraceName, aEventName )
+#define BOstraceEventStart1( aTraceName, aEventName, aParam )
+#define BOstraceFunctionExitExt(aTraceName, aInstance, aRetval)
+#define BOstraceEventStop( aTraceName, aEventName )
+#define BOstraceState0( aTraceName, aStateName, aNewState )
+#define BOstraceState1( aTraceName, aStateName, aNewState, aInstance )
+
+#define BtTraceBlock( exp )
+#define BtTraceBtAddr1( aGroupName, aTraceName, aTraceText, aParam )
+#define BtTraceBtAddr0( aGroupName, aTraceName, aParam )
+
+#endif // BLUETOOTHTRACE_ENABLED
+
+/*
+ * Additional general purpose definition, a hook for defining a friend class
+ * for unit testing to get access to class internals.
+ */
+#ifndef BTUNITTEST
+#define BTUNITTESTHOOK
+#endif
+
+#endif // BLUETOOTHTRACE_H
--- a/bluetoothengine/btnotif/inc/btNotifDebug.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, 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 BT Notifiers
-*
-*/
-
-
-#ifndef BTNOTIF_DEBUG_H
-#define BTNOTIF_DEBUG_H
-
-
-#ifdef _DEBUG
-
-#include <e32svr.h>
-#include <e32std.h>
-
-// ===========================================================================
-#ifdef __WINS__     // File logging for WINS
-// ===========================================================================
-#define FLOG(a)   { FPrint(a); }
-#define FTRACE(a) { a; }
-
-#include <f32file.h>
-#include <flogger.h>
-
-_LIT(KLogFile,"btnotiflog.txt");
-_LIT(KLogDirFullName,"c:\\logs\\bt\\");
-_LIT(KLogDir,"BT");
-
-// Declare the FPrint function
-inline void FPrint(const TRefByValue<const TDesC> aFmt, ...)
-    {
-    VA_LIST list;
-    VA_START(list,aFmt);
-    RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list);
-    }
-
-inline void FPrint(TRefByValue<const TDesC8> aFmt, ...)
-    {
-
-    VA_LIST list;
-    VA_START(list, aFmt);
-    TBuf8<256> buf8;
-    buf8.AppendFormatList(aFmt, list);
-
-    TBuf16<256> buf16(buf8.Length());
-    buf16.Copy(buf8);
-    RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, buf16);
-    }
-
-// ===========================================================================
-#else               // RDebug logging for target HW
-// ===========================================================================
-#define FLOG(a) { RDebug::Print(a);  }
-#define FTRACE(a) { a; }
-
-inline void FPrint(const TRefByValue<const TDesC16> 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);
-    }
-
-inline void FPrint(TRefByValue<const TDesC8> aFmt, ...)
-    {
-
-	VA_LIST list;
-	VA_START(list, aFmt);
-    TBuf8<256> buf8;
-	buf8.AppendFormatList(aFmt, list);
-
-    TBuf16<256> buf16(buf8.Length());
-    buf16.Copy(buf8);
-
-    TRefByValue<const TDesC> tmpFmt(_L("%S"));
-    RDebug::Print(tmpFmt, &buf16);
-    }
-
-#endif //__WINS__
-
-// ===========================================================================
-#else // // No loggings --> Reduced binary size
-// ===========================================================================
-#define FLOG(a)
-#define FTRACE(a)
-
-#endif // _DEBUG
-
-
-#endif // BTNOTIF_DEBUG_H
-
-// End of File
--- a/bluetoothengine/btnotif/inc/btnauthnotifier.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,166 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 authorisation notifier class.
-*
-*/
-
-
-#ifndef BTNAUTHNOTIFIER_H
-#define BTNAUTHNOTIFIER_H
-
-// INCLUDES
-
-#include "btnotifier.h" // Base class
-#include "btnotiflock.h"
-#include "btnotifactive.h"
-#include <btdevice.h>
-#include <e32property.h>
-
-// FORWARD DECLARATIONS
-
-// CLASS DECLARATION
-NONSHARABLE_CLASS(CBTAuthNotifier): public CBTNotifierBase, public MBTNotifActiveObserver
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Two-phased constructor.
-        */
-        static CBTAuthNotifier* NewL();
-
-        /**
-        * Destructor.
-        */
-        virtual ~CBTAuthNotifier();
-
-    private: // Functions from base classes
-
-        /**
-        * From CBTNotifierBase Called when a notifier is first loaded.        
-        * @param None.
-        * @return A structure containing priority and channel info.
-        */
-        TNotifierInfo   RegisterL();
-
-        /**
-        * From CBTNotifierBase Updates a currently active notifier.
-        * @param aBuffer The updated data.
-        * @return A pointer to return value.
-        */
-        TPtrC8 UpdateL(const TDesC8& aBuffer);
-
-        /**
-        * From CBTNotifierBase The notifier has been deactivated 
-        * so resources can be freed and outstanding messages completed.
-        * @param None.
-        * @return None.
-        */
-        void Cancel();
-
-        
-        /**
-        * From CBTNotifierBase Used in asynchronous notifier launch to 
-        * store received parameters into members variables and 
-        * make needed initializations.
-        * @param aBuffer A buffer containing received parameters
-        * @param aReturnVal The return value to be passed back.
-        * @param aMessage Should be completed when the notifier is deactivated.
-        * @return None.
-        */
-        void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
-
-        /**
-        * From CBTNotifierBase
-        */      
-        void HandleGetDeviceCompletedL(const CBTDevice* aDev);        
-        
-        /**
-         * From MBTNotifActiveObserver
-         * Gets called when P&S key notifies change.
-         */
-        void RequestCompletedL( CBTNotifActive* aActive, TInt aId, TInt aStatus );
-        
-        /**
-         * From MBTNotifActiveObserver
-         */
-        void HandleError( CBTNotifActive* aActive, TInt aId, TInt aError );
-        
-        /**
-         * From MBTNotifActiveObserver
-         */
-        void DoCancelRequest( CBTNotifActive* aActive, TInt aId );
-
-    private:
-
-        /** Checks if the notifier should be replied automatically and not shown to user.
-		 *
-		 *@the device
-		 *@ return TRUE if the notifier should be replied immediately yes or no, without showing query.
-		 */
-		TBool GetByPassAudioNotifier(const TBTDevAddr& aDevice,TBool& aAccept);
-		
-		/**
-		 *@param aAccepted. ETrue if user accepted the incoming audio connection. EFalse if not.
-		 *@param aDeviceAddress. The address of the device that attempted audio connection. 
-		 */
-		void MemorizeCurrentAudioAttempt(const TBool aAccept,const TBTDevAddr& aDeviceAddress);
-		
-        /**
-        * C++ default constructor.
-        */
-        CBTAuthNotifier();
-
-        /**
-         * Ask user's response for authorization query
-         */
-        void ShowAuthoQueryL();
-        
-        /**
-         * After user rejects authorization, provide user the chance to turn BT off
-         * if it is a within a threshold. Query block the device according to logic of 
-         * "second time for the same paired device". 
-         */
-        void DoRejectAuthorizationL();
-        
-        /**
-         * Subscribe to P&S Key and check its value
-         */
-        void CheckAndSubscribeNotifLocks();
-        
-    private: // Data definitions
-
-        enum TBTAuthState
-            {
-            EBTNormalAuthorisation,                     // Normal authorisation
-            EBTAutoAuthorisation,                       // Automated Authorisation
-            EBTAutoAuthorisationNotAuthorisedOnPhone,   
-            EBTObexAuthorisation,                   // Obex authorisation for non paired devices
-            EBTObexAuthForPairedDevice             // Obex authorisation for paired devices
-           
-            };
-
-    private: // Data
-
-        TBTAuthState    iAuthState;             // Authorisation state
-        TInt            iStrResourceId;
-        TSecondaryDisplayBTnotifDialogs iCoverUiDlgId;
-		TUint			iServiceUid;
-		TBool           iSuspended;
-		RProperty       iNotifLockProp;
-		CBTNotifActive* iLockActive;    
-    };
-
-#endif
-
-// End of File
--- a/bluetoothengine/btnotif/inc/btnenterpriseitsecurityinfonotifier.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 generic information notifier class.
-*
-*/
-
-#ifndef BTNENTERPRISEITSECURITYINFONNOTIFIER_H
-#define BTNENTERPRISEITSECURITYINFONNOTIFIER_H
-
-// INCLUDES
-#include "btnotifier.h" // Base class
-
-// CLASS DECLARATION
-NONSHARABLE_CLASS(CBTEnterpriseItSecurityInfoNotifier) : public CBTNotifierBase
-    {
-public:		// Constructors and destructor
-	/**
-	* Two-phased constructor.
-	*/
-	static CBTEnterpriseItSecurityInfoNotifier* NewL();
-
-	/**
-	* Destructor.
-	*/
-	virtual ~CBTEnterpriseItSecurityInfoNotifier();
-
-private:	// Functions from base classes
-	/**
-	* From CBTNotifierBase Called when a notifier is first loaded 
-	* to allow any initial construction that is required.
-	* @param None.
-	* @return A structure containing priority and channel info.
-	*/
-	TNotifierInfo RegisterL();
-	
-	/** From CBTNotifierBase Synchronic notifier launch.        
-	* @param aBuffer Received parameter data.
-	* @return A pointer to return value.
-	*/
-	TPtrC8 StartL(const TDesC8& aBuffer);
-
-	/**
-	* From CBTNotifierBase Used in asynchronous notifier launch to 
-	* store received parameters into members variables and 
-	* make needed initializations.
-	* @param aBuffer A buffer containing received parameters
-	* @param aReturnVal The return value to be passed back.
-	* @param aMessage Should be completed when the notifier is deactivated.
-	* @return None.
-	*/
-	void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
-
-	/**
-	* From CBTNotifierBase
-	*/      
-	void HandleGetDeviceCompletedL(const CBTDevice* aDev);        
-
-private:
-	/**
-	* C++ default constructor.
-	*/
-	CBTEnterpriseItSecurityInfoNotifier();
-
-	/**
-	 * Show Information note and complete message. 
-	 */
-	void ShowNoteAndCompleteL();
-    };
-
-#endif	//BTNENTERPRISEITSECURITYINFONNOTIFIER_H
-
-// End of File
--- a/bluetoothengine/btnotif/inc/btninqnotifier.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 Bluetooth device inquiry notifier class.
-*
-*/
-
-
-#ifndef BTNINQNOTIFIER_H
-#define BTNINQNOTIFIER_H
-
-// INCLUDES
-
-#include "btnotifier.h" // Base class
-#include "btninqui.h"
-#include <btextnotifiers.h> // Bluetooth notifiers API
-
-// FORWARD DECLARATIONS
-  
-// CLASS DECLARATION
-/**
-* This class is used in Bluetooth device search.
-*/
-NONSHARABLE_CLASS(CBTInqNotifier): public CBTNotifierBase, public MBTNDeviceSearchObserver
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Two-phased constructor.
-        */
-        static CBTInqNotifier* NewL();
-
-        /**
-        * Destructor.
-        */
-        virtual ~CBTInqNotifier();
-               
-        
-    private: // Functions from base classes
-        /**
-        * From CBTNotifierBase Called when a notifier is first loaded.        
-        * @param None.
-        * @return A structure containing priority and channel info.
-        */
-        TNotifierInfo RegisterL();
-
-        /**
-        * From CBTNotifierBase The notifier has been deactivated 
-        * so resources can be freed and outstanding messages completed.
-        * @param None.
-        * @return None.
-        */
-        void Cancel();
-
-        /**
-        * From CBTNotifierBase Used in asynchronous notifier launch to 
-        * store received parameters into members variables and 
-        * make needed initializations.
-        * @param aBuffer A buffer containing received parameters
-        * @param aReturnVal The return value to be passed back.
-        * @param aMessage Should be completed when the notifier is deactivated.
-        * @return None.
-        */
-        void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
-		
-        /**
-         * From MBTNDeviceSearchObserver Called when device search and selection completes.
-         * @param aErr Error code
-         * @param aDevice Response parameters to caller
-         *                  defined in epoc32\include\btextnotifiers.h
-         */
-        void NotifyDeviceSearchCompleted(TInt aErr, const TBTDeviceResponseParams& aDevice = TBTDeviceResponseParams());
-        
-    private:
-
-        /**
-        * C++ default constructor.
-        */
-        CBTInqNotifier();
-
-        void LaunchInquiryL(const TBTDeviceClass& aDesiredDevice);
-        
-    private: // Data
-
-        CBTInqUI*       iUi;                    // User interface module
-    };
-
-#endif
-
-// End of File
--- a/bluetoothengine/btnotif/inc/btninqui.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,355 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 Bluetooth device inquiry user interface class.
-*
-*/
-
-
-#ifndef BTNINQUI_H
-#define BTNINQUI_H
-
-// INCLUDES
-
-#include <btextnotifiers.h> // Bluetooth notifiers API
-#include <badesca.h>        // For array handling
-#include <AknIconArray.h>
-#include "btnotifactive.h"      // Active Object Helper class for inquiry
-#include <bt_sock.h>
-#include <btengdevman.h>
-#include "btnotifier.h"
-
-const TInt KPeriodicTimerInterval4Sec(4000000);
-
-
-// FORWARD DECLARATIONS
-
-class CAknStaticNoteDialog;
-class CAknSingleGraphicPopupMenuStyleListBox;
-class CAknPopupList;
-class CAknQueryDialog;
-class CBTInqNotifier;
-
-// CONSTANTS
-enum TSearchFlowState
-    {
-    ESearchCompleted,  // search completed for any reason, end of UI flow.
-    ESearchAgain,      // no device found, user wants to search again.
-    ESearchFirstDeviceFound, // the first device is found, show found device list.
-    };   
-
-// CLASS DECLARATION
-/**
- *  Class MBTNDeviceSearchObserver
- *
- *  Callback class to notify device searching completed. 
- */
-class MBTNDeviceSearchObserver
-    {
-public:
-
-    /**
-     * Callback to notify that the device search request has completed.
-     *
-     * @since S60 5.1
-     * @param aErr Error code
-     * @param aDevice Pckgbuf to retrieve the response from the device selection.
-     */
-    virtual void NotifyDeviceSearchCompleted(TInt aErr, 
-            const TBTDeviceResponseParams& aDevice = TBTDeviceResponseParams()) = 0;
-    };
-
-/**
-* A helper class used in Bluetooth device search.
-* This class is responsible of the UI activity.
-*/
-NONSHARABLE_CLASS(CBTInqUI) : public CBase, public MBTEngDevManObserver, public MBTNotifActiveObserver
-    {
-    public: // Constructor and destructor
-        /**
-        * C++ default constructor.
-        */
-        CBTInqUI( MBTNDeviceSearchObserver* aObserver,
-                CBTNotifUIUtil* aUtil, const TBTDeviceClass& aDesiredDevClass);
-
-        /**
-        * The 2nd phase constructor is required to do Asyncronous operations,
-        * So the readiness of the CBTInqUI is notified Asynchronously to the caller
-        */
-        void ConstructL();     
-        
-        /**
-        * Destructor.
-        */
-        virtual ~CBTInqUI();
-
-    public: // New functions
-
-        /**
-        * Cancels all inquiry activity.
-        */
-        void Cancel();
-        
-        /**
-        * Issues a device inquiry request.
-        * @param None.
-        * @return None.
-        */
-        void IssueRequestL();
-
-        /**
-         * Check if Eir device name available.
-         * @param TNameEntry    Decode it to get device name
-         * @param TBTDeviceName Device name returned
-         * @return ETrue if Eir data contains name.
-         */
-        static TBool CheckEirDeviceName( TNameEntry& aEntry, TBTDeviceName& aName );
-
-    private: // Functions from base classes
-        
-        /**
-         * From MBTNotifActiveObserver
-         */
-        void RequestCompletedL( CBTNotifActive* aActive, TInt aId, TInt aStatus );
-        
-        /**
-         * From MBTNotifActiveObserver
-         */
-        void HandleError( CBTNotifActive* aActive, TInt aId, TInt aError );
-        
-        /**
-         * From MBTNotifActiveObserver
-         */
-        void DoCancelRequest( CBTNotifActive* aActive, TInt aId );
-        
-        /**
-         * From MBTEngDevManObserver
-         */
-        void HandleGetDevicesComplete(TInt aErr,  CBTDeviceArray* aDeviceArray);
-        
-        /**
-         * From MBTEngDevManObserver
-         */
-        void HandleDevManComplete(TInt aErr);        
-
-   
-    private:
-        
-        /**
-         * Create the device search active object and prepare for search.
-         */
-        void CreateScannerL();
-        
-        /**
-        * Removes the device search active object if it still exists.
-        * @param None.
-        * @return None.
-        */
-        void RemoveScanner();
-
-        /**
-        * Retrieves paired devices from BT Registry
-        * Calls HandleGetDevicesComplete, when done
-        */
-        void RetrievePairedDevices();
-
-        /**
-        * Retrieves used devices from BT Registry
-        * Calls HandleGetDevicesComplete, when done
-        * @return None.        
-        */
-        void RetrieveUsedDevices();
-
-        /**
-        * Searches given BT Device from device array.
-        * @param aDeviceArray The device array to search in 
-        * @param aDevice The device to be searched.
-        * @return Index of the device if found.
-        */
-        TInt LookupFromDevicesArray( const CBTDeviceArray* aDeviceArray, const CBTDevice* aDevice ) const;
-        
-        /**
-        * Constructs a device popup list from resources.
-        * @param aSoftkeysResourceId Resource id for softkeys of the list.
-        * @param aTitleResourceId Resource id for the title of the list.
-        * @return None.
-        */
-        void CreatePopupListL(TInt aSoftkeysResourceId, TInt aTitleResourceId );
-
-        /**
-        * Generates a format string and adds it to iDeviceItems array.
-        * Updates friendly name of given device if one is found from registry.
-        * @param aDevice The device to be added to list.
-        * @param aSignalStrength The signal bar for RSSI
-        * @return None.
-        */
-        void UpdateDeviceListL(CBTDevice* aDevice, const TInt aSignalStrength = 0 );             
-		
-		/**
-        * Creates and adds local bitmap to icon array.
-        * @param aID Item ID of the masked bitmap to be created.
-        * @param aFilename Filename to be used to construct the item.
-        * @param aBitmapId The ID if bitmap 
-        * @param aMaskId The ID of bitmap's mask
-		* @param aIconList The icon list for BT devices listbox.
-        */
-        void CreateAndAppendIconL( const TAknsItemID& aID,
-			     				   const TDesC& aFileName,
-								   const TInt aBitmapId,
-								   const TInt aMaskId,
-								   CAknIconArray* aIconList);
-								  
-        /**
-        * Adjust array, leave 5 lastet used devices in the array and remove the rest,
-        * and then insert the paired device array to this array by used time order.
-        * In the adjusted array, the first item will be the most lately used device.
-        * @param aDevArray The bluetooth device arrary to be adjusted.
-        * @return None.
-        */
-		void AdjustDeviceArrayL( CBTDeviceArray* aDevArray);
-		
-		/**
-		* Filter for searching device
-		* @param The desired device class user selects from the filter
-		* @return User's input select/cancel
-		*/
-		void SelectSearchCategoryL();
-		
-		/**
-		* Add filtering items to search device filter
-		* @param aResourceId
-		* @return None
-		*/
-		void AddItemToSearchFilterL ( TInt aResourceId );
-
-		/**
-		* Show query to ask if unblock device
-		* @param aDevice Selected device
-		* @return Keypress value
-		*/
-		TInt QueryUnblockDeviceL(CBTDevice* aDevice);
-		
-		 /**
-         * The callback function for CPeriodic 
-         * to reset the inactivity time
-         */
-		 static TInt PeriodicTimerCallBack(TAny* /*aAny*/);
-		 
-	     void GetColorIconL( TFileName& aFilename, TAknsItemID aItemID, TInt aPic, TInt aPicmask, CAknIconArray* aIconList );
-     
-        /**
-        * Check if VoIP call is ongoing via WLAN connection.
-        * @return true if it is; false otherwise.
-        */
-        TBool IsActiveVoIPOverWLAN();
-         
-        void DoDeviceFrontListSelection();
-    
-        /**
-        * Displays previous inquiry results.
-        */
-        void DisplayDevicesFrontListL();
-        
-        /**
-         * Unblock device after unblock query.
-         * @param aIndex Parameter containing information about selected device.
-         * @return Symbian OS error code.
-         */
-        TInt UnblockDevice(TInt aIndex);
-
-        void DeviceSearchUiL();
-        
-        /**
-         * the initiator of inquiry until the first device found, or no device found, or
-         * other reasons causing inquiry stopped.
-         * @param aReason the reason of the search completion
-         */
-        TSearchFlowState InitInquiryL(TInt& aReason);
-        
-        void HandleDeviceSelectionL(CBTDevice* aDev);
-        
-        /**
-         * Adds found Bluetooth device into popup list.
-         * @param aInquiryResultRecord TNameEntry and flag, which indicates if Eir device.
-         */
-        void DeviceAvailableL( const TNameRecord& aNameRecord, const TDesC& aDevName);
-        
-        /**
-        * The inquiry has been completed.
-        * @param aError Status code of the operation.
-        * @return None.
-        */
-        void InquiryComplete( TInt aError );
-        
-        /**
-         * Inform the caller of the properties of found BTdevice, 
-         * which passes the search filter. Its name will be retrived later
-         */
-        void HandleInquiryDeviceL();
-        
-        void HandleFoundNameL();   
-        
-        /**
-         * Allow/Disallow dialer and app key presses.
-         * @param aAllow ETrue to allow  key press; EFalse to disallow.
-         */
-        void AllowDialerAndAppKeyPress( TBool aAllow );
-
-    private:  // Data
-        CBTNotifUIUtil*         iUiUtil;
-        CBTDeviceArray*         iLastSeenDevicesArray;            // Last seen devices array from BTInqNotifier
-        CBTDeviceArray*         iLastUsedDevicesArray;           // Used devices from BT registry
-        CBTDeviceArray*         iPairedDevicesArray;             // Paired devices from Bluetooth registry
-        CBTDeviceArray*         iAdjustedUsedDeviceArray;         // 5 Lately used devices + All the Paired devices 
-        CBTEngDevMan*           iDevMan;                        //Async deviceHandler
-         
-        CDesCArray*             iDefaultDeviceNamesArray;        // Default device names array
-        CEikonEnv&              iEikonEnvRef;                    // Reference to eikonenv        
-        
-        CAknPopupList*          iDevicePopupList;                // Popup list for devices        
-        CDesCArrayFlat*         iDeviceListRows;                 // Array for device list format string rows
-        CAknSingleGraphicPopupMenuStyleListBox* iDeviceListBox; // ListBox for bluetooth devices
-        CAknPopupList*          iSearchFilterPopupList;
-        
-        CBTNotifActive*         iScanner;
-		
-        TBool                   iDevicesFound;                   // Flag if any devices has been found
-        TBool                   iInquiryComplete;
-        TBool                   iBroughtForwards;                // Flag for BringForwards
-        TInt                    iInquiryStatus;                  // Error code from inquiry result
-
-        TBTRegistryQueryState     iBTRegistryQueryState;            // which registry query (if any) is in progress.
-        TBTDeviceClass            iDesiredDeviceClass;         // Device Class user selects from search filter 
-        CPeriodic* iPeriodicTimer; // the timer for reseting the user inactivity time
-        TBool                   iSystemCancel;               // Used for a trick to avoid final device list is still on show 
-                                                                // while taking out mmc during BT device discovery 
-        TBTDeviceResponseParams iDevParams;
-        TInt iHighLightedItemIndex;
-        
-        RSocketServ         iSocketServer;      // Socket server object
-        RHostResolver       iHostResolver;      // Host resolver object
-        TInquirySockAddr    iInquirySockAddr;   // Socket address record
-        TNameEntry          iEntry;             // Inquiry results record
-        TBool               iPageForName;    // Flag for inquiry name
-        RArray<TNameRecord> iDevsWithoutName;    // Devices without dev name 
-        TInt                iIndex;             // Current btdevice to inquiry its name 
-        MBTNDeviceSearchObserver* iDevSearchObserver;
-
-		TBool               iExcludePairedDevices;
-		
-
-    };
-
-#endif
-
-// End of File
--- a/bluetoothengine/btnotif/inc/btnobexpinnotifier.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 OBEX PIN query notifier class.
-*
-*/
-
-
-#ifndef BTNOBEXPINNOTIFIER_H
-#define BTNOBEXPINNOTIFIER_H
-
-// INCLUDES
-
-#include "btnotifier.h" // Base class
-
-// CLASS DECLARATION
-
-/**
-* This class is used to ask OBEX passkey from user.
-*/
-NONSHARABLE_CLASS(CBTObexPinNotifier): public CBTNotifierBase
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Two-phased constructor.
-        */
-        static CBTObexPinNotifier* NewL();
-
-        /**
-        * Destructor.
-        */
-        virtual ~CBTObexPinNotifier();
-
-    private: // Functions from base classes
-        /**
-        * From CBTNotifierBase Called when a notifier is first loaded.        
-        * @param None.
-        * @return A structure containing priority and channel info.
-        */
-        TNotifierInfo RegisterL();
-
-        /**
-        * From CBTNotifierBase Used in asynchronous notifier launch to 
-        * store received parameters into members variables and 
-        * make needed initializations.
-        * @param aBuffer A buffer containing received parameters
-        * @param aReturnVal The return value to be passed back.
-        * @param aMessage Should be completed when the notifier is deactivated.
-        * @return None.
-        */
-        void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
-               
-    private:
-
-        /**
-        * C++ default constructor.
-        */
-        CBTObexPinNotifier();      
-
-        /**
-        * Show notes to ask user's response and return to caller.
-        * @param None.
-        * @return None.
-        */
-        void ShowNoteCompleteMessageL();
-
-    private: // Data
-
-    };
-
-#endif
-
-// End of File
--- a/bluetoothengine/btnotif/inc/btnotif.hrh	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, 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 btnotif.
-*
-*/
-
-
-#ifndef BTNOTIF_HRH
-#define BTNOTIF_HRH
-
-#include <btnotif.mbg>
-
-#define KBTPassKeyMaxLength 16 // Same as KHCIPINCodeSize. Not available here direct from BT
-#define KBTUIMaxNameLength   30      // Series 60 local BT name
-
-#define btnotif_bitmap_file "Z:\\system\\data\\BTNotif.mbm"
-#define btnotif_bitmap_file_data_caging "Z:\\resource\\apps\\BTNotif.mbm"
-
-
-enum BTNotifNotes
-    {
-    EBTNotifSearchingDevicesNote = 1,
-    EBTNotifBtBusyNote,
-	EBTNotifEnterSapNote,
-	EBTNotifEnterSapSucceedNote,
-	EBTNotifEnterSapFailNote
-    };
-
-#endif
-// End of File
--- a/bluetoothengine/btnotif/inc/btnotifactive.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,191 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 active object helper class.
-*
-*/
-
-#ifndef BTNOTIFACTIVE_H
-#define BTNOTIFACTIVE_H
-
-
-#include <e32base.h>
-
-class CBTNotifActive;
-
-/**
- *  Class MBTNotifActiveObserver
- *
- *  Callback class for receiving a completed active object event.
- *  Users of CBTEngActive need to derive from this class. 
- */
-class MBTNotifActiveObserver
-    {
-
-public:
-
-    /**
-     * Callback to notify that an outstanding request has completed.
-     *
-     * @since S60 5.1
-     * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
-     * @param aStatus The status of the completed request.
-     */
-    virtual void RequestCompletedL( CBTNotifActive* aActive, TInt aId, 
-                                    TInt aStatus ) = 0;
-
-    /**
-     * Callback to notify that an error has occurred in RunL.
-     *
-     * @param aActive Pointer to the active object that had error.
-     * @param aId The ID that identifies the outstanding request.
-     * @param aStatus The status of the completed request.
-     */
-    virtual void HandleError( CBTNotifActive* aActive, TInt aId, 
-                                    TInt aError ) = 0;
-
-    /**
-     * Callback to notify that request is canceled.
-     * Active object may add specified steps here. 
-     *
-     * @param aActive Pointer to the active object that is canceled.
-     * @param aId The ID that identifies the outstanding request.
-     */
-    virtual void DoCancelRequest( CBTNotifActive* aActive, TInt aId ) = 0;
-    };
-/**
- *  Class CBTNotifActive
- */
-NONSHARABLE_CLASS( CBTNotifActive ) : public CActive
-    {
-
-public:
-    /**
-     * Two-phased constructor.
-     * @param aObserver Pointer to callback interface that receives notification
-     *                  that the request has been completed.
-     * @param aId       Request ID to identify which request is completed.
-     * @return          Pointer to the constructed CBTNotifActive object.
-     */ 
-    static CBTNotifActive* NewL( MBTNotifActiveObserver* aObserver, TInt aId, TInt aPriority );
-
-   /**
-    * Destructor.
-    */
-    virtual ~CBTNotifActive();
-
-    /**
-     * Get the request ID of this active object.
-     *
-     * @since S60 v5.1
-     * @return The request ID of this active object.
-     */
-    inline TInt RequestId();
-
-    /**
-     * Set a new request ID for this active object.
-     *
-     * @since S60 v5.1
-     * @param The new request ID of this active object.
-     */
-    inline void SetRequestId( TInt aId );
-
-    /**
-     * Activate the active object.
-     *
-     * @since S60 v5.1
-     */
-    inline void GoActive();
-
-    /**
-     * Cancel an outstanding request.
-     *
-     * @since S60 v5.1
-     */
-    inline void CancelRequest();
-
-    /**
-     * Get a reference to the active object request status.
-     *
-     * @since S60 v5.1
-     * @return Reference to the active object request status.
-     */
-    TRequestStatus& RequestStatus();
-
-// from base class CActive
-
-    /**
-     * From CActive.
-     * Called by the active scheduler when the request has been cancelled.
-     *
-     * @since S60 v5.1
-     */
-    void DoCancel();
-
-    /**
-     * From CActive.
-     * Called by the active scheduler when the request has been completed.
-     *
-     * @since S60 v5.1
-     */
-    void RunL();
-
-    /**
-     * From CActive.
-     * Called by the active scheduler when an error in RunL has occurred.
-     *
-     * @since S60 v5.1
-     */
-    TInt RunError( TInt aError );
-
-private:
-
-    /**
-     * C++ default constructor
-     *
-     * @since S60 v5.1
-     * @param aObserver Pointer to callback interface that receives notification
-     *                  that the request has been completed.
-     * @param aId ID of the request (for the client to keep track of multiple 
-     *            active objects).
-     * @param aPriority Priority of 
-     */
-    CBTNotifActive( MBTNotifActiveObserver* aObserver, TInt aId, TInt aPriority );
-
-    /**
-     * Symbian 2nd-phase constructor
-     *
-     * @since S60 v5.1
-     */
-    void ConstructL();
-
-private: // data
-
-    /**
-     * ID of the request (used only by our client).
-     */
-    TInt iRequestId;
-
-    /**
-     * Our observer.
-     * Not own.
-     */
-    MBTNotifActiveObserver* iObserver;
-
-    };
-
-#include "btnotifactive.inl"
-
-
-#endif // BTNOTIFACTIVE_H
--- a/bluetoothengine/btnotif/inc/btnotifactive.inl	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 helper class inline function definitions.
-*
-*/
-
-// -----------------------------------------------------------------------------
-// Get the identifier of this instance.
-// -----------------------------------------------------------------------------
-//
-inline TInt CBTNotifActive::RequestId()
-    {
-    return iRequestId;
-    }
-
-
-// -----------------------------------------------------------------------------
-// Set the identifier of this instance.
-// -----------------------------------------------------------------------------
-//
-inline void CBTNotifActive::SetRequestId( TInt aId )
-    {
-    iRequestId = aId;
-    }
-
-
-// -----------------------------------------------------------------------------
-// Activate the active object.
-// -----------------------------------------------------------------------------
-//
-inline void CBTNotifActive::GoActive()
-    {
-    SetActive();
-    }
-
-
-// -----------------------------------------------------------------------------
-// Cancel an outstanding request.
-// -----------------------------------------------------------------------------
-//
-inline void CBTNotifActive::CancelRequest()
-    {
-    Cancel();
-    }
-
-
-// -----------------------------------------------------------------------------
-// Get a reference to the active object request status.
-// -----------------------------------------------------------------------------
-//
-inline TRequestStatus& CBTNotifActive::RequestStatus()
-    {
-    return iStatus;
-    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btnotif/inc/btnotifclientserver.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,69 @@
+/*
+* ============================================================================
+*  Name        : btnotifclientserver.h
+*  Part of     : bluetoothengine / btnotif
+*  Description : Definitions for the btnotif client-server interface.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef BTNOTIFCLIENTSERVER_H
+#define BTNOTIFCLIENTSERVER_H
+
+/**  BTNotif server name */
+_LIT( KBTNotifServerName, "btnotifsrv" );
+
+/**  btnotifsrv Uid3 for creating the server process */
+const TUid KBTNotifServerUid3 = { 0x20026FED };
+
+/**  
+ *   BTNotif server version numbers; 
+ *   Major version number is 2 to distinguish 
+ *   from old btnotif architecture.
+ */
+const TInt KBTNotifServerVersionMajor = 2;
+const TInt KBTNotifServerVersionMinor = 0;
+const TInt KBTNotifServerVersionBuild = 0;
+
+/**  
+ *   Opcodes used in the client-server interface 
+ *   for identifying the requested command.
+ */
+enum TBTNotifServerRequest
+    {
+    EBTNotifMinValue = 9,
+    EBTNotifStartSyncNotifier,
+    EBTNotifStartAsyncNotifier,
+    EBTNotifCancelNotifier,
+    EBTNotifUpdateNotifier,
+    // Commands moved from BTEngine server.
+    EBTEngPrepareDiscovery = 43,
+    EBTEngPairDevice,
+    EBTEngCancelPairDevice,
+    };
+
+/**  
+ *   Message slots Opcodes used in the client-server interface 
+ *   for identifying the requested command.
+ */
+enum TBTNotifServerRequestSlot
+    {
+    EBTNotifSrvUidSlot,
+    EBTNotifSrvParamSlot,
+    EBTNotifSrvReplySlot
+    };
+
+#endif // T_BTNOTIFCLIENTSERVER_H
--- a/bluetoothengine/btnotif/inc/btnotifier.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,307 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 Bluetooth notifiers base class.
-*
-*/
-
-
-#ifndef BTNOTIFIERBASE_H
-#define BTNOTIFIERBASE_H
-
-// INCLUDES
-
-#include "btnotif.h"
-#include "btnotifuiutil.h"
-#include <eikenv.h>
-#include <btdevice.h>
-#include <btengdevman.h>
-
-// CONSTANTS
-
-// Literals for resource and bitmap files ( drive, directory, filename(s) )
-
-const TUid KBTInquiryChannel            = {0x00000601}; // Channel for inquiry notifier
-const TUid KBTAuthorisationChannel      = {0x00000602}; // Channel for PIN query notifier
-const TUid KBTAuthenticationChannel     = {0x00000603}; // Channel for authorisation notifier
-const TUid KBTBBEventChannel            = {0x00000604}; // Channel for baseband event notifier
-const TUid KBTObexPINChannel            = {0x00000605}; // Channel for OBEX PIN notifier
-const TUid KBTPowerModeChannel          = {0x00000606}; // Channel for power mode notifier
-const TUid KBTAudioAccessoryChannel     = {0x00000607}; // Channel for audio accessory notifier
-const TUid KBTLowMemoryChannel          = {0x00000608}; // Channel for low memory notifier
-const TUid KBTPairedDeviceSettingChannel  = {0x00000610}; 
-
-// FORWARD DECLARATIONS
-class CBTEngSettings;
-
-enum TBTRegistryQueryState
-{
-	ENoQuery=0,
-	EQueryPaired=1,
-	EQueryUsed=2,
-	ESetDeviceAuthorizeState,
-	ESetDeviceBlocked,
-	ESetDeviceUnblocked,
-};
-
-// CLASS DECLARATION
-/**
-* This class is the base class for all notifiers.
-*/
-NONSHARABLE_CLASS(CBTNotifierBase): public CBase, public MEikSrvNotifierBase2, MBTEngDevManObserver
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Destructor.
-        */
-        virtual ~CBTNotifierBase();
-
-    protected: // Constructors and destructor
-
-        /**
-        * C++ default constructor.
-        */
-        CBTNotifierBase();
-
-        /**
-        * Symbian 2nd phase constructor.
-        */
-        virtual void ConstructL();
-
-    protected: // New functions
-
-        /**
-        * Used in asynchronous notifier launch to store received parameters 
-        * into members variables and make needed initializations.        
-        * @param aBuffer A buffer containing received parameters
-        * @param aReturnVal The return value to be passed back.
-        * @param aMessage Should be completed when the notifier is deactivated.
-        * @return None.
-        */
-        virtual void GetParamsL(const TDesC8& aBuffer, 
-                                TInt aReplySlot, 
-                                const RMessagePtr2& aMessage)=0;
-
-        /**
-        * A utility function for checking whether autolock is on.
-        * @param None.
-        * @return A boolean according to autolock state.
-        */
-        TBool AutoLockOnL();
-
-        /**
-        * A utility function for setting the power status of Bluetooth.
-        * If the power is not on the user will be presented a query.
-        * @return ETrue if BT is turned on successfully; EFalse otherwise
-        */
-        TBool CheckAndSetPowerOnL();
-		
-		/**
-		* A function for setting BT name 
-		* @return ETrue if BT name is set successfully; EFalse otherwise
-		*/
-		TBool AskLocalBTNameQueryL();
-
-        /**
-		* Check if there is any existing connection to audio profiles from 
-		* the same device
-		* @return ETrue if the device is connected.
-		*/
-		TBool IsExistingConnectionToAudioL(const TBTDevAddr& aDevAddr);
-
-		/**
-		* Complete Client/Server message and Nulled the reply slot.
-		* @param aErr  Error code for client notification.
-		* @return None
-		*/
-		void CompleteMessage(TInt aErr);
-
-       /**
-        * Complete Client/Server message and Nulled the reply slot.
-        * @param aErr  Error code for client notification.
-        * @return None
-        */
-        void CompleteMessage(TInt aValueToReplySlot, TInt aErr);
-        
-       /**
-        * Complete Client/Server message and Nulled the reply slot.
-        * @param aErr  Error code for client notification.
-        * @return None
-        */
-        void CompleteMessage(const TDesC8& aDesToReplySlot, TInt aErr);
-        
-		/**
-		* Checks from central repository whether the Bluetooth friendly name 
-        * has been modified .
-		* @return ETure if the name has been modified.
-		*/
-		TBool IsLocalNameModifiedL();
-
-		/**
-		 * Get the device information from BT Registry by the given address.
-		 */
-		void GetDeviceFromRegL(const TBTDevAddr& aAddr);
-		
-		/**
-		 * virtual function to be ovewritten by sub-classes.
-		 * Will be called when Getting Device by BTEng DevMan is completed.
-		 * @param aDev the device from registry if it is not null. indicates either a failure
-		 *             or the device is not available in registry. 
-		 */
-		virtual void HandleGetDeviceCompletedL(const CBTDevice* aDev);
-
-        /**
-         * Asks the user if s/he want's to block the device in question
-         * Does not block the device. That is left to the caller.
-         * NOTE: Cannot be called while iAuthQueryDlg is active.
-         */
-        void QueryBlockDeviceL();
-
-        /**
-         * Set BTDevice's security setting to blocked and modify device
-         * @param None
-         * @return None
-         */
-        void DoBlockDevice();
-
-        /**
-         * Set BTDevice's security setting to un/authorized and modify device
-         * @param aTrust Set authorized if ETrue; otherwise, unauthorized.
-         * @return None
-         */
-        void ChangeAuthorizeState( TBool aTrust);
-
-        /**
-         * Checks if the user is queried too often, and handle the result.
-         * @return None
-         */
-        void CheckAndHandleQueryIntervalL();
-
-    private:
-        
-        void DoHandleGetDevicesCompleteL(TInt aErr, CBTDeviceArray* aDeviceArray );
-		
-    protected: // Functions from base classes
-
-        /**
-        * From MEikSrvNotifierBase2 Called when a notifier is first loaded 
-        * to allow any initial construction that is required.
-        * @param None.
-        * @return A structure containing priority and channel info.
-        */
-        virtual TNotifierInfo RegisterL()=0;
-        
-        /**
-        * From MEikSrvNotifierBase2 The notifier has been deactivated 
-        * so resources can be freed and outstanding messages completed.
-        * @param None.
-        * @return None.
-        */
-        virtual void Cancel();
-
-#ifdef __SERIES60_HELP
-		/** This is used to create TCallBack to help.
-		 * @param TCoeHelpContext. Must be instance TCoeHelpContext, or NULL.
-		 * If null this will open help about blocked devices.,
-		 * @return KErrNone
-		 */
-		static TInt LaunchHelp(TAny *TCoeHelpContext=NULL);
-#endif        
-
-    private: // Functions from base classes        
-        
-        /**
-        * From MEikSrvNotifierBase2 Called when all resources allocated 
-        * by notifiers should be freed.
-        * @param None.
-        * @return None.
-        */
-        virtual void Release();
-
-        /**
-        * From MEikSrvNotifierBase2 Return the priority a notifier takes 
-        * and the channels it acts on.
-        * @param None.
-        * @return A structure containing priority and channel info.
-        */
-        virtual TNotifierInfo Info() const;
-
-        /**
-        * From MEikSrvNotifierBase2 Synchronic notifier launch.        
-        * @param aBuffer Received parameter data.
-        * @return A pointer to return value.
-        */
-        virtual TPtrC8 StartL(const TDesC8& aBuffer);
-        
-        /**
-        * From MEikSrvNotifierBase2 Asynchronic notifier launch.
-        * @param aBuffer A buffer containing received parameters
-        * @param aReturnVal The return value to be passed back.
-        * @param aMessage Should be completed when the notifier is deactivated.
-        * @return A pointer to return value.
-        */
-        virtual void StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
-        
-        /**
-        * From MEikSrvNotifierBase2 Updates a currently active notifier.
-        * @param aBuffer The updated data.
-        * @return A pointer to return value.
-        */
-        virtual TPtrC8 UpdateL(const TDesC8& aBuffer);        
-		
-        /**
-         * From MBTEngDevManObserver
-         * Indicates to the caller that adding, deleting or modifying a device 
-         * has completed.
-         */
-        virtual void HandleDevManComplete(TInt aErr);
-        
-        /**
-         * From MBTEngDevManObserver
-         * Call back function when GetDevices() request is completed.
-         * @param aErr Status information, if there is an error.
-         * @param aDeviceArray Array of devices that match the given criteria 
-         *                     (the array provided by the calller).
-         */
-        void HandleGetDevicesComplete( TInt aErr, CBTDeviceArray* aDeviceArray );
-
-        /**
-         * Checks the timestamp since last query.
-         * @return true if too often
-         */
-        TBool CheckQueryInterval();
-
-    protected: // Data
-
-        RMessagePtr2                iMessage;               // Received message
-        TInt                        iReplySlot;             // Reply slot
-        TNotifierInfo               iInfo;                  // Notifier parameters structure
-        TBTRegistryQueryState       iBTRegistryQueryState;
-        CBTDeviceArray*             iDeviceArray;  // for getting device from registry
-        CBTDevice*                  iDevice;                // Current Bluetooth device
-        TBTDevAddr                  iBTAddr; // Gotten from PckBuffer, constant no matter how iDevice changes.
-        CBTNotifUIUtil*             iNotifUiUtil;           // Utility to show UI notes & queries
-        CBTEngSettings*             iBTEngSettings;
-        TBool                       iIsCoverUI;
-
-    private:
-        CBTEngDevMan*               iDevMan;  // for BT registry manipulation
-
-
-        
-    };
-
-#endif
-
-// End of File
--- a/bluetoothengine/btnotif/inc/btnotiflock.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,158 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 getting/setting notifier locks on BT devices
-*               from/to P&S KBTNotifierLocks from btengprivatepskeys.h.
-*
-*/
-
-#ifndef BTNOTIFIERLOCK_H
-#define BTNOTIFIERLOCK_H
-
-#include <bttypes.h>
-#include <btengprivatepskeys.h>
-
-/**
- *  BT Notifier lock identifiers 
- *  @since S60 v5.1
- */
-
-enum TBTNotifLockId
-    {
-    /**
-     * None
-     */
-    EBTNotifierLockNone = 0x00,
-    
-    /**
-     * notifier is asking or going to ask if user wants to set device trusted.
-     */
-    EBTNotiferLockPairedDeviceSetting = 0x01,
-    
-    /**
-     * notifer is asking or going to ask user if he wants to accept connection request
-     * from the device.
-     */
-    EBTNotifierLockAuthorizeConnectRequest = 0x02,
-    };
-
-/**
- * the notifier lock status on a BT device.
- * This lock mechanism uses by btui, bteng and btnotif to ensure the order of 
- * user interaction when a device is been paired.
- */
-NONSHARABLE_CLASS( TBTNotifLock)
-    {
-public:
-    
-    /**
-     * default constructor.  iAddr is initialized to zero BT address and iLocks is set to 0  
-     */
-    inline TBTNotifLock();
-    
-    /**
-     * constructor to the specified value.
-     * @param aAddr the address of the BT device this object is for.
-     * @param aLocks one or more lock identifiers
-     */
-    inline TBTNotifLock(const TBTDevAddr& aAddr, TInt aLocks);
-    
-    /**
-     * gets the target device address.
-     * @return the target device address
-     */
-    inline const TBTDevAddr& Addr() const;
-    
-    /**
-     * Gets the locks on the device.
-     */
-    inline TInt Locks() const;
-    
-    /**
-     * Gets the modifiable locks on the device
-     */
-    inline TInt& Locks();
-
-private:
-    
-    /**
-     * the BT device this object is for
-     */
-    TBTDevAddr iAddr;
-    
-    /**
-     * the lock status, logical OR of one or more TBTNotifLockId values
-     */
-    TInt iLocks;
-    };
-
-NONSHARABLE_CLASS( TBTNotifLockPublish )
-    {
-public:
-
-    /**
-     * gets from P&S KBTNotifierLocks the locks for a device.
-     * 
-     * @param aLocks contains the locks for the device at return
-     * @param aAddr the address of the device which the locks are for
-     */
-    inline static void GetNotifLocks( TInt& aLocks, const TBTDevAddr& aAddr );
-
-    /**
-     * gets from P&S KBTNotifierLocks the locks for a device.
-     * 
-     * @aProperty the property instance which has been attached to key KBTNotifierLocks. 
-     * @param aLocks contains the locks for the device at return
-     * @param aAddr the address of the device which the locks are for
-     */
-    inline static void GetNotifLocks(RProperty& aProperty, TInt& aLocks, 
-            const TBTDevAddr& aAddr );
-    
-    /**
-     * Publishes locks to P&S KBTNotifierLocks.
-     * 
-     * @param aLocks the locks to be published
-     * @param aAddr the address of the device which the locks are for
-     */
-    inline static void AddNotifLocks( TInt aLocks, const TBTDevAddr& aAddr );    
-    
-    /**
-     * Publishes locks to P&S KBTNotifierLocks.
-     * @aProperty the property instance which has been attached to key KBTNotifierLocks. 
-     * @param aLocks the locks to be published
-     * @param aAddr the address of the device which the locks are for
-     */
-    inline static void AddNotifLocks(RProperty& aProperty, TInt aLocks, 
-            const TBTDevAddr& aAddr );    
-    
-    /**
-     * Deletes locks from P&S KBTNotifierLocks.
-     * @param aLocks the locks to be deleted
-     * @param aAddr the address of the device which the locks are for     
-     */
-    inline static void DeleteNotifLocks( TInt aLocks, 
-            const TBTDevAddr& aAddr );    
-    
-    /**
-     * Deletes locks from P&S KBTNotifierLocks.
-     * @aProperty the property instance which has been attached to key KBTNotifierLocks.  
-     * @param aLocks the locks to be deleted
-     * @param aAddr the address of the device which the locks are for     
-     */
-    inline static void DeleteNotifLocks(RProperty& aProperty, TInt aLocks, 
-            const TBTDevAddr& aAddr );    
-    };
-
-#include "btnotiflock.inl"
-
-#endif // BTNOTIFIERLOCK_H
--- a/bluetoothengine/btnotif/inc/btnotiflock.inl	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,234 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 getting/setting notifier locks on BT devices
-*               from/to P&S KBTNotifierLocks from btengprivatepskeys.h.
-*
-*/
-
-#include "btengprivatepskeys.h"
-#include <e32property.h>
-
-// ----------------------------------------------------------
-// Initialize members to zero
-// ----------------------------------------------------------
-//
-inline TBTNotifLock::TBTNotifLock()
-    : iAddr(TBTDevAddr()), iLocks(EBTNotifierLockNone)
-    {
-    }
-
-// ----------------------------------------------------------
-// initialize members to the specified values
-// ----------------------------------------------------------
-//
-inline TBTNotifLock::TBTNotifLock(const TBTDevAddr& aAddr, TInt aLocks)
-    : iAddr( aAddr ), iLocks( aLocks )
-    {
-    }
-
-// ----------------------------------------------------------
-// returns the address
-// ----------------------------------------------------------
-//
-inline const TBTDevAddr& TBTNotifLock::Addr() const
-    {
-    return iAddr;
-    }
-
-// ----------------------------------------------------------
-// returns the lock as value
-// ----------------------------------------------------------
-//
-inline TInt TBTNotifLock::Locks() const
-    {
-    return iLocks;
-    }
-
-// ----------------------------------------------------------
-// returns the lock as modifiable reference
-// ----------------------------------------------------------
-//
-inline TInt& TBTNotifLock::Locks()
-    {
-    return iLocks;
-    }
-
-// ----------------------------------------------------------
-// Locally instantiate a RProperty and invoke GetNotifLocks
-// ----------------------------------------------------------
-//
-inline void TBTNotifLockPublish::GetNotifLocks( TInt& aLocks, const TBTDevAddr& aAddr )
-    {
-    RProperty property;
-    TInt err = property.Attach( 
-                KPSUidBluetoothEnginePrivateCategory, KBTNotifierLocks );
-    if ( !err )
-        {
-        GetNotifLocks( property, aLocks, aAddr );
-        }
-    property.Close();
-    }
-
-// ----------------------------------------------------------
-// Extracts from PS key and returns the lock value for
-// the specified device
-// ----------------------------------------------------------
-//
-inline void TBTNotifLockPublish::GetNotifLocks(RProperty& aProperty,
-        TInt& aLocks, const TBTDevAddr& aAddr )
-    {
-    aLocks = EBTNotifierLockNone;
-    TInt infoSize( sizeof( TBTNotifLock ) );
-    TBuf8<sizeof( TBTNotifLock ) * 8> infoDes;
-    TInt err = aProperty.Get( infoDes );
-    if ( err || infoDes.Length() < infoSize )
-        {
-        // zero length of the PS content indicates no lock set at all. 
-        return;
-        }
-    TInt infoCount = infoDes.Length() / infoSize;
-    
-    TPckgBuf<TBTNotifLock> tmpPckg;
-    for ( TInt i = 0; i < infoCount; i++ )
-        {
-        tmpPckg.Copy(infoDes.Mid( i * infoSize, infoSize ));
-        if ( tmpPckg().Addr() == aAddr )
-            {
-            // found the locks for the device, writes to client.
-            aLocks = tmpPckg().Locks();
-            return;
-            }
-        }
-    }
-
-// ----------------------------------------------------------
-// Locally instantiate a RProperty and invoke AddNotifLocks
-// ----------------------------------------------------------
-//
-inline void TBTNotifLockPublish::AddNotifLocks( TInt aLocks, const TBTDevAddr& aAddr )
-    {
-    RProperty property;
-    TInt err = property.Attach( 
-                KPSUidBluetoothEnginePrivateCategory, KBTNotifierLocks );
-    if ( !err )
-        {
-        AddNotifLocks( property, aLocks, aAddr );
-        }
-    property.Close();
-    }
-
-// ----------------------------------------------------------
-// Find the lock for the device from PS key and updates its value if
-// needed.
-// ----------------------------------------------------------
-//
-inline void TBTNotifLockPublish::AddNotifLocks( RProperty& aProperty,
-        TInt aLocks, const TBTDevAddr& aAddr )
-    {
-    TBuf8<sizeof( TBTNotifLock ) * 8> infoDes;
-    TInt infoSize( sizeof( TBTNotifLock ) );
-    TInt err = aProperty.Get( infoDes );   
-    if ( err )
-        {
-        return;
-        }
-    TInt infoCount = infoDes.Length() / infoSize;
-    TPckgBuf<TBTNotifLock> tmpPckg;
-
-    for ( TInt i = 0; i < infoCount; i++ )
-        {
-        tmpPckg.Copy(infoDes.Mid( i * infoSize, infoSize ));
-        if ( tmpPckg().Addr() == aAddr )
-            {
-            TInt newOps = tmpPckg().Locks() | aLocks;
-            // update the value only if it is really changed:
-            if ( tmpPckg().Locks() != newOps )
-                {
-                tmpPckg().Locks() = newOps;
-                infoDes.Replace( i * infoSize, infoSize, tmpPckg );
-                (void) aProperty.Set( infoDes );
-                }
-            return;
-            }
-        }
-    // no lock for the device so far, append it to the end:
-    tmpPckg() = TBTNotifLock( aAddr, aLocks );
-    if ( infoCount )
-        {
-        infoDes.Append( tmpPckg );
-        (void) aProperty.Set( infoDes );        
-        }
-    (void) aProperty.Set( tmpPckg ); 
-    }
-
-// ----------------------------------------------------------
-// Locally instantiate a RProperty and invoke DeleteNotifLocks
-// ----------------------------------------------------------
-//
-inline void TBTNotifLockPublish::DeleteNotifLocks( TInt aLocks, const TBTDevAddr& aAddr )
-    {
-    RProperty property;
-    TInt err = property.Attach( 
-                KPSUidBluetoothEnginePrivateCategory, KBTNotifierLocks );
-    if ( !err )
-        {
-        DeleteNotifLocks( property, aLocks, aAddr );
-        }
-    property.Close();
-    }
-
-// ----------------------------------------------------------
-// Find the lock for the device from PS key and updates its value if
-// needed.
-// ----------------------------------------------------------
-//
-inline void TBTNotifLockPublish::DeleteNotifLocks( RProperty& aProperty,
-        TInt aLocks, const TBTDevAddr& aAddr )
-    {
-    TBuf8<sizeof( TBTNotifLock ) * 8> infoDes;
-    TInt infoSize( sizeof( TBTNotifLock ) );
-    TInt err = aProperty.Get( infoDes );
-    if ( err || infoDes.Length() < infoSize )
-        {
-        return;
-        }
-    TInt infoCount = infoDes.Length() / infoSize;
-    TPckgBuf<TBTNotifLock> tmpPckg;
-    for ( TInt i = 0; i < infoCount; i++ )
-        {
-        tmpPckg.Copy( infoDes.Mid( i * infoSize, infoSize ) );
-        if ( tmpPckg().Addr() == aAddr )
-            {
-            TInt newOps = tmpPckg().Locks() & ~aLocks;
-            // update PS only if the value is changed:
-            if ( tmpPckg().Locks() != newOps )
-                {
-                tmpPckg().Locks() = newOps;
-                if ( tmpPckg().Locks() == 0)
-                    {
-                    // no lock for this device anymore, remove from PS:
-                    infoDes.Delete( i * infoSize, infoSize );
-                    }
-                else
-                    {
-                    // Update the lock value:
-                    infoDes.Replace( i * infoSize, infoSize, tmpPckg );
-                    }
-                (void) aProperty.Set( infoDes );
-                }
-            return;
-            }
-        }
-    }
-
--- a/bluetoothengine/btnotif/inc/btnotifnameutils.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies 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 Bluetooth notifiers base class.
- *
- */
-
-#ifndef BTNOTIFNAMEUTILS_H
-#define BTNOTIFNAMEUTILS_H
-
-#include <btdevice.h>
-
-class BtNotifNameUtils
-    {
-public:
-    static void StripDeviceName(TBTDeviceName& aDeviceName);
-    static void GetDeviceDisplayName(TBTDeviceName& aName, const CBTDevice* aDev);
-    static void GetDeviceName(TBTDeviceName& aName, const CBTDevice* aDev);
-    static void SetDeviceNameL(const TBTDeviceName& aName, CBTDevice& aDev);
-    };
-
-#endif // BTNOTIFNAMEUTILS_H
-
-
--- a/bluetoothengine/btnotif/inc/btnotifpanic.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 authorisation notifier class.
-*
-*/
-
-#ifndef BTNOTIFPANIC_H
-#define BTNOTIFPANIC_H
-
-_LIT(KBtNotifPanicName, "BtNotif Panic");
-
-enum TBtNotifPanic
-    {
-    EiDeviceNullWhenCallingGetDeviceFromRegL = 0,
-    };
-
-template <typename XAny>
-struct TBtNotifPanicCodeTypeChecker
-    {
-    inline static void Check(XAny) { }
-    };
-
-#define BTNOTIF_PANIC(CODE) \
-    TBtNotifPanicCodeTypeChecker<TBtNotifPanic>::Check(CODE), \
-    User::Panic(KBtNotifPanicName, CODE)
-
-
-#endif // BTNOTIFPANIC_H
-
--- a/bluetoothengine/btnotif/inc/btnotifuiutil.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,177 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 Bluetooth notifiers UI utility class.
-*
-*/
-
-#ifndef BTNOTIFUIUTIL_H
-#define BTNOTIFUIUTIL_H
-#include <eikenv.h>          // Eikon environment
-#include <data_caging_path_literals.hrh> 
-#include <AknQueryDialog.h>
-#include <AknWaitDialog.h>
-#include <secondarydisplay/BTnotifSecondaryDisplayAPI.h>
-
-// CONSTANTS
-// Literals for resource and bitmap files ( drive, directory, filename(s) )
-_LIT(KFileDrive,"z:");
-_LIT(KResourceFileName, "btnotif.rsc");
-
-// FORWARD DECLARATIONS
-class CEikonEnv;
-
-NONSHARABLE_CLASS( CBTNotifUIUtil ) : public CBase
-    {
-    public: // Constructors and destructor
-
-        static CBTNotifUIUtil* NewL( TBool aCoverDisplayEnabled );
-        
-        /**
-        * Destructor.
-        */
-        virtual ~CBTNotifUIUtil();
-
-    private: // Constructors and destructor
-
-        /**
-        * C++ default constructor.
-        */
-        CBTNotifUIUtil( TBool aCoverDisplayEnabled );
-
-        /**
-        * Symbian 2nd phase constructor.
-        */
-        void ConstructL();
-        
-    public:
-        /**
-        * A utility function for requesting the activation of lights.
-        * @param None.
-        * @return None.
-        */
-        void TurnLightsOn();
-        
-        /**
-         * Get the local eikon environment.
-         * @return the reference of the local Eikon Environment
-         */
-        CEikonEnv& LocalEikonEnv();
-        
-        /**
-         * Common utility for user confirmation dialog.
-         * @return the keypress value
-         */
-        TInt ShowQueryL(TInt aPromptResource, TInt aExecuteResource, 
-                TSecondaryDisplayBTnotifDialogs aDialogId, 
-                CAknQueryDialog::TTone aTone = CAknQueryDialog::ENoTone );
-        
-        /**
-         * Common utility for user confirmation dialog.
-         * @return the keypress value
-         */
-        TInt ShowQueryL(const TDesC& aPrompt, TInt aExecuteResource, 
-                TSecondaryDisplayBTnotifDialogs aDialogId, 
-                const TBTDeviceName& aDevNameInCoverUI,
-                CAknQueryDialog::TTone aTone = CAknQueryDialog::ENoTone );
-        
-        /**
-         * Common utility for user confirmation dialog.
-         * @return the keypress value
-         */
-        TInt ShowMessageQueryL(TDesC& aMessage, const TDesC& aHeader,
-                TInt aResourceId, 
-                CAknQueryDialog::TTone aTone = CAknQueryDialog::ENoTone );        
-        /**
-         * Common utility for user confirmation dialog.
-         * @return the keypress value
-         */
-        TInt ShowTextInputQueryL(TDes& aText, TInt aExecuteResource, 
-                TSecondaryDisplayBTnotifDialogs aDialogId, 
-                CAknQueryDialog::TTone aTone = CAknQueryDialog::ENoTone );        
-        
-        /**
-         * Common utility for user confirmation dialog.
-         * @return the keypress value
-         */
-        TInt ShowTextInputQueryL(TDes& aText, const TDesC& aPrompt, TInt aExecuteResource, 
-                TSecondaryDisplayBTnotifDialogs aDialogId, 
-                CAknQueryDialog::TTone aTone = CAknQueryDialog::ENoTone );        
-
-        /**
-         * Common utility for UI inforamtion note.
-         */
-        void ShowInfoNoteL( TInt aResourceId, TSecondaryDisplayBTnotifDialogs aDialogId  ); 
-        
-        /**
-         * Common utility for UI inforamtion note.
-         */
-        void ShowInfoNoteL( const TDesC& aResource, TSecondaryDisplayBTnotifDialogs aDialogId  );
-        
-        /**
-         * Common utility for Confirmation note.
-         */
-        void ShowConfirmationNoteL( TBool aWaitingDlg, const TDesC& aResource, 
-                TSecondaryDisplayBTnotifDialogs aDialogId, const TBTDeviceName& aDevNameInCoverUi );
-        
-        /**
-         * Common utility for Error note.
-         */
-        void ShowErrorNoteL( TBool aWaitingDlg, const TDesC& aResource, 
-                TSecondaryDisplayBTnotifDialogs aDialogId, TBTDeviceName aDevNameInCoverUi );
-                
-        /**
-         * Check if iYesNoDlg is NULL
-         */
-        TBool IsQueryReleased();
-
-        /**
-         * Update the dialog when UpdateL() is called by client.
-         */
-        void UpdateQueryDlgL( TDesC& aMessage );
-        
-        /**
-         * Update the message dialog when UpdateL() is called by client.
-         */
-        void UpdateMessageQueryDlgL( TDesC& aMessage );
-        
-        /**
-         * It is used for Secondary display to update. 
-         */
-        void UpdateCoverUiL( const TDesC8& aMessage );
-        
-        /**
-         * Delete the dialog, mostly used by UpdateL()
-         */
-        void DismissDialog();
-        
-        TInt ShowWaitDlgL( TInt aResourceId );
-        
-        void CompleteWaitDlgL();
-        
-    private:
-    
-        void CoverUIDisplayL( const MObjectProvider* aMop, const TBTDeviceName& aDevNameInCoverUi );    
-    
-    private: //DATA
-        CEikonEnv*          iEikEnv;    // Local eikonenv
-        TInt                iResourceFileFlag;      // Flag for eikon env.
-        CAknQueryDialog*    iQueryDlg;  // All kinds of query dialog 
-        CAknWaitDialog*     iWaitDlg;   // WaitDialog
-        TBool iCoverDisplayEnabled; // Flag that indicate cover UI featur
-        TBool               iSystemCancel; // Used to check if iEikEnv is valid. 
-        TBool               iAppKeyBlocked; // Apps key is deactivated.
-    };
-#endif //BTNOTIFUIUTIL_H
-
-
--- a/bluetoothengine/btnotif/inc/btnpaireddevsettnotifier.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 power mode setting notifier class.
-*
-*/
-
-
-#ifndef BTNPAIREDDEVSETTNOTIFIER_H
-#define BTNPAIREDDEVSETTNOTIFIER_H
-
-// INCLUDES
-#include "btnotifier.h" // Base class
-
-// FORWARD DECLARATIONS
-
-// CLASS DECLARATION
-NONSHARABLE_CLASS(CBTPairedDevSettNotifier) : public CBTNotifierBase
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Two-phased constructor.
-        */
-        static CBTPairedDevSettNotifier* NewL();
-
-        /**
-        * Destructor.
-        */
-        virtual ~CBTPairedDevSettNotifier();
-
-    private: // Functions from base classes
-
-        /**
-        * From CBTNotifierBase Called when a notifier is first loaded 
-        * to allow any initial construction that is required.
-        * @param None.
-        * @return A structure containing priority and channel info.
-        */
-        TNotifierInfo RegisterL();
-
-         /**
-        * From CBTNotifierBase The notifier has been deactivated 
-        * so resources can be freed and outstanding messages completed.
-        * @param None.
-        * @return None.
-        */
-        void Cancel();        
-
-        /**
-        * From CBTNotifierBase Used in asynchronous notifier launch to 
-        * store received parameters into members variables and 
-        * make needed initializations.
-        * @param aBuffer A buffer containing received parameters
-        * @param aReturnVal The return value to be passed back.
-        * @param aMessage Should be completed when the notifier is deactivated.
-        * @return None.
-        */
-        void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
-
-		/**
-        * From CBTNotifierBase Updates a currently active notifier.
-        * @param aBuffer The updated data.
-        * @return A pointer to return value.
-        */
-        TPtrC8 UpdateL(const TDesC8& aBuffer);
-        
- 		/**
-        * From CBTNotifierBase
-        */      
-        void HandleGetDeviceCompletedL(const CBTDevice* aDev);
-        
-    private:
-
-		/**
-        * Parse the data out of the message that is sent by the client of the notifier. 
-		* @param aBuffer A package buffer containing received parameters.
-        * @return None.
-        */
-		void ProcessParamBufferL(const TDesC8& aBuffer);
-	
-    	/**
-    	 * Query to assign the friendly name when adding it into paired device list
-    	 * if the current device name is not unique in the paired devices view.
-    	 */
-		void QueryRenameDeviceL(const CBTDevice& aDevice);
-    	
-        /**
-        * C++ default constructor.
-        */
-        CBTPairedDevSettNotifier();        
-        
-        /**
-         * Process pairing error code to show corresponding notes.
-         * @param aErr The pairing error code from HCI error.
-         * @return The resouce ID of notes
-         */
-        TInt ProcessPairingErrorCode( const TInt aErr );
-                
-    private:
-	
-        TSecondaryDisplayBTnotifDialogs	iSecondaryDisplayCommand;
-		TBool 	iIsMessageQuery;
-		TInt 	iPairingStatus; 
-		
-    };
-
-#endif //BTNPAIREDDEVSETTNOTIFIER_H
-
-// End of File
--- a/bluetoothengine/btnotif/inc/btnpairnotifier.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 pair base notifier.
-*
-*/
-
-#ifndef BTNPAIRNOTIFIER_H_
-#define BTNPAIRNOTIFIER_H_
-
-#include "btnotifier.h" // base class
-
-// CLASS DECLARATION
-/**
-* This class is used as base class for all pairing purpose notifiers
-*/
-NONSHARABLE_CLASS(CBTNPairNotifierBase) : public CBTNotifierBase
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Two-phased constructor.
-        */
-        static CBTNPairNotifierBase* NewL();  // Constructor (public)
-
-        /**
-        * Destructor.
-        */
-        virtual ~CBTNPairNotifierBase();      // Destructor
-    
-    protected: // From base class
-    
-        /**
-        * From CBTNotifierBase
-        */
-        virtual TNotifierInfo RegisterL();
-        
-        /**
-        * From CBTNotifierBase Used in asynchronous notifier launch to 
-        * store received parameters into members variables and 
-        * make needed initializations.
-        * @param aBuffer A buffer containing received parameters
-        * @param aReturnVal The return value to be passed back.
-        * @param aMessage Should be completed when the notifier is deactivated.
-        * @return None.
-        */
-        virtual void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
-        
-        virtual void UpdateL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
-        
-        /**
-        * From CBTNotifierBase Updates a currently active notifier.
-        * @param aBuffer The updated data.
-        * @return A pointer to return value.
-        */
-        virtual TPtrC8 UpdateL(const TDesC8& aBuffer);
-        
-    protected: // New functions
-
-        void ProcessParamsGetDeviceL( const TBTDevAddr& aAddr, const TBTDeviceName& aName );
-        
-        /**
-         * Check not to allow pairing attempt from banned devices,
-         */
-        TBool CheckBlockedDeviceL();
-        
-        /**
-        * Query user to accept/reject when the pairing request is initiated 
-        * from remote device.   
-        * @param None.
-        * @return ETrue if User accepted.
-        */
-        TBool AuthoriseIncomingPairingL();
-        
-        /**
-         * Generate prompt based on subclass's own needs.
-         * @param aRBuf the descriptor to which the prompt will be loaded.
-         */
-        virtual void GenerateQueryPromptL( RBuf& aRBuf );
-        
-    private:
-        /**
-        * From CBTNotifierBase Called when a notifier is first loaded 
-        * to allow any initial construction that is required.
-        * @param None.
-        * @return A structure containing priority and channel info.
-        */
-        //TNotifierInfo RegisterL();
-        
-    protected:
-        /**
-        * C++ default constructor.
-        */    
-        CBTNPairNotifierBase();
-        
-    protected: // Data
-        TBool                   iLocallyInitiated;    
-    };
-
-#endif /* BTNPAIRNOTIFIER_H */
-
--- a/bluetoothengine/btnotif/inc/btnpbappinnotifier.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 PBAP PIN query notifier class.
-*
-*/
-
-
-#ifndef BTNPBAPNOTIFIER_H
-#define BTNPBAPNOTIFIER_H
-
-// INCLUDES
-
-#include "btnotifier.h" // Base class
-
-// CLASS DECLARATION
-
-/**
-* This class is used to ask PBAP passkey from user.
-*/
-NONSHARABLE_CLASS(CBTPBAPPinNotifier): public CBTNotifierBase
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Two-phased constructor.
-        */
-        static CBTPBAPPinNotifier* NewL();
-
-        /**
-        * Destructor.
-        */
-        virtual ~CBTPBAPPinNotifier();
-
-    private: // Functions from base classes
-        /**
-        * From CBTNotifierBase Called when a notifier is first loaded.        
-        * @param None.
-        * @return A structure containing priority and channel info.
-        */
-        TNotifierInfo RegisterL();
-
-        /**
-        * From CBTNotifierBase Used in asynchronous notifier launch to 
-        * store received parameters into members variables and 
-        * make needed initializations.
-        * @param aBuffer A buffer containing received parameters
-        * @param aReturnVal The return value to be passed back.
-        * @param aMessage Should be completed when the notifier is deactivated.
-        * @return None.
-        */
-        void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
-        
-    private:
-
-        /**
-        * C++ default constructor.
-        */
-        CBTPBAPPinNotifier();        
-        
-        /**
-        * Show UI note and complete message.
-        * Ask user response and return it to caller.
-        * @param None.
-        * @return None.
-        */
-        void ShowNoteCompleteMessageL();
-        
-    private: // Data
-
-    };
-
-#endif
-
-// End of File
--- a/bluetoothengine/btnotif/inc/btnpinnotifier.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 authentication (PIN query) notifier class.
-*
-*/
-
-
-#ifndef BTNPINNOTIFIER_H
-#define BTNPINNOTIFIER_H
-
-// INCLUDES
-
-#include "btnpairnotifier.h" // Base class 
-
-class MBTEngDevManObserver;
-
-// CLASS DECLARATION
-/**
-* This class is used to ask PIN code from user.
-*/
-NONSHARABLE_CLASS(CBTPinNotifier): public CBTNPairNotifierBase
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Two-phased constructor.
-        */
-        static CBTPinNotifier* NewL();  // Constructor (public)
-
-        /**
-        * Destructor.
-        */
-        virtual ~CBTPinNotifier();      // Destructor
-
-    private:
-        /**
-        * From CBTNotifierBase Called when a notifier is first loaded 
-        * to allow any initial construction that is required.
-        * @param None.
-        * @return A structure containing priority and channel info.
-        */
-        TNotifierInfo RegisterL();
-        
-        /**
-        * From CBTNotifierBase Used in asynchronous notifier launch to 
-        * store received parameters into members variables and 
-        * make needed initializations.
-        * @param aBuffer A buffer containing received parameters
-        * @param aReturnVal The return value to be passed back.
-        * @param aMessage Should be completed when the notifier is deactivated.
-        * @return None.
-        */
-        void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage); // Get input parameters
-
-        /**
-        * From CBTNotifierBase
-        * Show queries to ask user response and return it to caller by completing message.
-        */      
-        void HandleGetDeviceCompletedL(const CBTDevice* aDev);
-        
-        /**
-        * From CBTNPairNotifierBase
-        * Generate prompt in Pin query dialog.
-        * @param aRBuf the descriptor to which the prompt will be loaded.
-        */      
-        void GenerateQueryPromptL(RBuf& aRBuf); 
-
-    private:
-
-        /**
-        * C++ default constructor.
-        */
-        CBTPinNotifier();               // Default constructor
-        
-        /**
-        * Checks and sets iPinCode to '0000', used with automated pairing for headsets.
-        */		        
-        TBool CheckAndSetAutomatedPairing();        	
-
-    private: // Data
-        TUint                   iPasskeyLength;
-    	TBTPinCode              iPinCode;
-		TBTRegistryQueryState   iBTRegistryQueryState;
-        TBool                   iLocallyInitiated;
-        TBool                   iStrongPinRequired;
-		        
-    };
-
-#endif
-
-// End of File
--- a/bluetoothengine/btnotif/inc/btnpwrnotifier.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 power mode setting notifier class.
-*
-*/
-
-
-#ifndef BTNPWRNOTIFIER_H
-#define BTNPWRNOTIFIER_H
-
-// INCLUDES
-
-#include "btnotifier.h" // Base class
-
-// FORWARD DECLARATIONS
-
-// CLASS DECLARATION
-
-/**
-* This class is used to confirm Bluetooth power status change from user.
-*/
-NONSHARABLE_CLASS(CBTPwrNotifier): public CBTNotifierBase
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Two-phased constructor.
-        */
-        static CBTPwrNotifier* NewL();
-
-        /**
-        * Destructor.
-        */
-        virtual ~CBTPwrNotifier();
-
-    private: // Functions from base classes
-
-        /**
-        * From CBTNotifierBase Called when a notifier is first loaded 
-        * to allow any initial construction that is required.
-        * @param None.
-        * @return A structure containing priority and channel info.
-        */
-        TNotifierInfo RegisterL();
-
-        /**
-        * From CBTNotifierBase Used in asynchronous notifier launch to 
-        * store received parameters into members variables and 
-        * make needed initializations.
-        * @param aBuffer A buffer containing received parameters
-        * @param aReturnVal The return value to be passed back.
-        * @param aMessage Should be completed when the notifier is deactivated.
-        * @return None.
-        */
-        void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
-
-    private:
-
-        /**
-        * C++ default constructor.
-        */
-        CBTPwrNotifier();
-        
-        /**
-        * Show Information Note and complete message.
-        * @param None.
-        * @return None.
-        */
-        void ShowNoteAndCompleteMessageL(); 
-
-    };
-
-#endif
-
-// End of File
--- a/bluetoothengine/btnotif/inc/btnssppasskeyentrynotifier.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 authentication (PIN query) notifier class.
-*
-*/
-
-
-#ifndef BTNSSPPASSKEYENTRYNOTIFIER_H_
-#define BTNSSPPASSKEYENTRYNOTIFIER_H_
-
-
-// INCLUDES
-
-#include "btnpairnotifier.h" // Base class
-
-const TInt KPassKeylength = 6; 
-// CLASS DECLARATION
-/**
-* This class is used to confirm PIN code from remote input devices. such as bluetooth keyboard.
-*/
-NONSHARABLE_CLASS(CBTSSPPasskeyEntryNotifier): public CBTNPairNotifierBase
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Two-phased constructor.
-        */
-        static CBTSSPPasskeyEntryNotifier* NewL();  // Constructor (public)
-
-        /**
-        * Destructor.
-        */
-        virtual ~CBTSSPPasskeyEntryNotifier();      // Destructor
-
-    private:
-       /**
-        * From CBTNotifierBase Called when a notifier is first loaded 
-        * to allow any initial construction that is required.
-        * @param None.
-        * @return A structure containing priority and channel info.
-        */
-        TNotifierInfo RegisterL();
-
-        /**
-        * From CBTNotifierBase Updates a currently active notifier.
-        * @param aBuffer The updated data.
-        * @return A pointer to return value.
-        */
-        TPtrC8 UpdateL(const TDesC8& aBuffer);                         
-               
-        /**
-         * From CBTNotifierBase Used in asynchronous notifier launch to 
-         * store received parameters into members variables and 
-         * make needed initializations.
-         * @param aBuffer A buffer containing received parameters
-         * @param aReturnVal The return value to be passed back.
-         * @param aMessage Should be completed when the notifier is deactivated.
-         * @return None.
-         */
-        void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage); // Get input parameters
-
-        /**
-        * From CBTNotifierBase
-        */      
-        void HandleGetDeviceCompletedL(const CBTDevice* aDev);        
-    
-        /**
-        * Generate prompt for passkey entry query.
-        * @param aRBuf the descriptor to which the prompt will be loaded.
-        */
-        void GenerateQueryPromptL( RBuf& aRBuf );
-        
-    private:
-
-        /**
-        * C++ default constructor.
-        */
-        CBTSSPPasskeyEntryNotifier();               // Default constructor
-        
-    private: // Data
-        TInt                    iAnswer;
-        TBuf<100>               iBuf;
-        TBuf<10>                iPasskey;
-    };
-#endif
-// End of File
--- a/bluetoothengine/btnotif/inc/btnumcmpnotifier.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 Numeric Comparison notifier for Secure Simle Pairing 
-*
-*/
-
-
-#ifndef BTNUMCMPNOTIFIER_H
-#define BTNUMCMPNOTIFIER_H
-
-// INCLUDES
-
-#include "btnpairnotifier.h" // Base class
-
-// CLASS DECLARATION
-/**
-* This class is used to ask user to compare passcode in two devices.
-*/
-const TInt Klength = 6; 
-const TInt KMaxPassKeyLength = 20;
-const TInt KBTDeviceShortNameLength = 7;
-
-
-NONSHARABLE_CLASS(CBTNumCmpNotifier): public CBTNPairNotifierBase
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Two-phased constructor.
-        */
-        static CBTNumCmpNotifier* NewL();  // Constructor (public)
-
-        /**
-        * Destructor.
-        */
-        virtual ~CBTNumCmpNotifier();      // Destructor
-
-    private:
-        /**
-        * From CBTNotifierBase Called when a notifier is first loaded 
-        * to allow any initial construction that is required.
-        * @param None.
-        * @return A structure containing priority and channel info.
-        */
-        TNotifierInfo RegisterL();
-
-        
-        /**
-        * From CBTNotifierBase Used in asynchronous notifier launch to 
-        * store received parameters into members variables and 
-        * make needed initializations.
-        * @param aBuffer A buffer containing received parameters
-        * @param aReturnVal The return value to be passed back.
-        * @param aMessage Should be completed when the notifier is deactivated.
-        * @return None.
-        */
-        void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage); // Get input parameters
-                                         
-        /**
-        * From CBTNotifierBase
-        * Show notes to ask user response and return to Notifier caller by completing message.
-        */      
-        void HandleGetDeviceCompletedL(const CBTDevice* aDev);        
-        
-        /**
-        * From CBTNPairNotifierBase
-        * @param aRBuf the descriptor to which the prompt will be loaded.
-        */
-        void GenerateQueryPromptL( RBuf& aRBuf );
-
-    private:
-
-        /**
-        * C++ default constructor.
-        */
-        CBTNumCmpNotifier();               // Default constructor
-		
-    private: // Data
-		TBuf<20> iPasskeyToShow;
-        
-    };
-
-#endif
-
-// End of File
--- a/bluetoothengine/btnotif/inc/btuserconfnotifier.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Declares User confirmation notifier for Secure Simle Pairing 
-*
-*/
-
-
-#ifndef BTUSERCONFNOTIFIER_H
-#define BTUSERCONFNOTIFIER_H
-
-// INCLUDES
-
-#include "btnpairnotifier.h" // Base class
-
-// These declarations are here temporarily so the submission of the notifiers and the stack do not have to be synchronised.
-// Should be removed once all submissions are in.
-
-const TUid KBTUserConfirmationNotifierUidCopy={0x2002E224};
-
-NONSHARABLE_CLASS(TBTNotifierParams2Copy)	
-	{
-public:
-	inline TBTDevAddr DeviceAddress() const { return iBDAddr; };
-	inline TPtrC DeviceName() const { return iName; };
-private:
-	TBTDevAddr		iBDAddr;
-	TBTDeviceName	iName;	
-	
-	// This data padding has been added to help prevent future binary compatibility breaks	
-	// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
-	TUint32	iPadding1; 
-	TUint32	iPadding2; 
-	};
-
-NONSHARABLE_CLASS(TBTUserConfirmationParamsCopy)
-	: public TBTNotifierParams2Copy
-	{	
-public:
-	inline TBool LocallyInitiated() const { return iLocallyInitiated; };
-private:
-	TBool				iLocallyInitiated;
-	
-	// This data padding has been added to help prevent future binary compatibility breaks	
-	// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
-	TUint32	iPadding1;
-	TUint32 iPadding2;
-	};
-
-typedef TPckgBuf<TBTUserConfirmationParamsCopy> TBTUserConfirmationParamsPckgCopy;
-
-// CLASS DECLARATION
-/**
-* This class is used to ask user to compare passcode in two devices.
-*/
-
-
-NONSHARABLE_CLASS(CBTUserConfNotifier): public CBTNPairNotifierBase
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Two-phased constructor.
-        */
-        static CBTUserConfNotifier* NewL();  // Constructor (public)
-
-        /**
-        * Destructor.
-        */
-        virtual ~CBTUserConfNotifier();      // Destructor
-
-    private:
-        /**
-        * From CBTNotifierBase Called when a notifier is first loaded 
-        * to allow any initial construction that is required.
-        * @param None.
-        * @return A structure containing priority and channel info.
-        */
-        TNotifierInfo RegisterL();
-
-        
-        /**
-        * From CBTNotifierBase Used in asynchronous notifier launch to 
-        * store received parameters into members variables and 
-        * make needed initializations.
-        * @param aBuffer A buffer containing received parameters
-        * @param aReturnVal The return value to be passed back.
-        * @param aMessage Should be completed when the notifier is deactivated.
-        * @return None.
-        */
-        void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage); // Get input parameters
-                                         
-        /**
-        * From CBTNotifierBase
-        * Show notes to ask user response and return to Notifier caller by completing message.
-        */      
-        void HandleGetDeviceCompletedL(const CBTDevice* aDev);        
-        
-    private:
-
-        /**
-        * C++ default constructor.
-        */
-        CBTUserConfNotifier();               // Default constructor
-    };
-
-#endif
-
-// End of File
--- a/bluetoothengine/btnotif/inc/devui_const.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef DEVUI_CONST_H_
-#define DEVUI_CONST_H_
-
-#include <btdevice.h>
-// Order must match the one in resources (R_BT_DEFAULT_DEVICE_NAMES)
-//
-enum TBTDefaultDevNameIndex
-    {
-    EBTDeviceNameIndexComputer = 0,
-    EBTDeviceNameIndexPhone,
-    EBTDeviceNameIndexAudio,
-    EBTDeviceNameIndexKeyboard,
-    EBTDeviceNameIndexMouse,
-    EBTDeviceNameIndexPrinter,
-    EBTDeviceNameIndexCarKit,
-    EBTDeviceNameIndexDefault
-    };
-
-// Enum for items in search filter
-enum TBTSearchFilterItem
-    {
-    EBTSearchForAll = 0,
-    EBTSearchForAudio,
-    EBTSearchForPhone,
-    EBTSearchForComputer,
-    EBTSearchForInput
-    };
-
-// Order must match the one in resources (R_BTNOTIF_ICONS)
-//
-enum TDeviceIconIndex
-    {
-    EDeviceIconComputer = 0,
-    EDeviceIconPhone,
-    EDeviceIconAudio,
-    EDeviceIconDefault,
-    EDeviceIconBlank,
-    EDeviceIconKeyboard,
-    EDeviceIconMouse,
-    EDeviceIconPrinter,
-    EDeviceIconCarkit,
-    EDeviceIconPaired, 
-    EDeviceIconBlocked,
-    EDeviceIconRssiLow, 
-    EDeviceIconRssiMed,
-    EDeviceIconRssiGood,
-    };
-
-struct TDeviceIconFormat
-    {
-    TDeviceIconIndex iIdx;
-    const TText* iFormat;
-    };
-
-// Order must match the one in TDeviceIconIndex
-//
-const TDeviceIconFormat KDeviceIconFormatTable[] =
-    {
-    {EDeviceIconComputer, _S("0\t")},  //computer
-    {EDeviceIconPhone,    _S("1\t")},  // phone
-    {EDeviceIconAudio,    _S("2\t")},  // audio
-    {EDeviceIconDefault,  _S("3\t")},  // default
-    {EDeviceIconBlank,    _S("4\t")},  // blank
-    {EDeviceIconKeyboard, _S("5\t")},  // keyboard
-    {EDeviceIconMouse,    _S("6\t")},  // mouse
-    {EDeviceIconPrinter,  _S("7\t")},  // printer
-    {EDeviceIconCarkit,   _S("8\t")},  // carkit
-    {EDeviceIconPaired,   _S("\t9")},  // paired
-    {EDeviceIconBlocked,  _S("\t10")}, // blocked
-    {EDeviceIconRssiLow,  _S("\t11")}, // RssiLow
-    {EDeviceIconRssiMed,  _S("\t12")}, // RssiMed
-    {EDeviceIconRssiGood, _S("\t13")}  // RssiGood
-    };
-
-// Total number of different device icons
-const TInt KDeviceIconCount = 
-    sizeof(KDeviceIconFormatTable) / sizeof(TDeviceIconFormat);
-
-/*
- * The classification of a device's icon and default name
- * corresponding to its major and minor device classes.
- */
-struct TDeviceRowLayout
-    {
-    TInt iMajorDevClass;
-    TInt iMinorDevClass;
-    TDeviceIconIndex iIconIndex;
-    TBTDefaultDevNameIndex iDefaultNameIndex;
-    };
-
-/*
- * Device classification mapping table.
- * 
- * Notice 1: Considering runtime searching efficiency, if certain major or minor 
- * device classes shall use the default icon and name, it is not recommended 
- * to present in this table. 
- * 
- * Notice 2: Regulated by searching algorithm, when devices carrying the same 
- * major device class may have different icons and names for different minor 
- * device classes, the unclassified minor device class must present at last 
- * among these belonging to the same major device class.
- */
-const TDeviceRowLayout KDeviceRowLayoutTable[] = 
-    {
-    {EMajorDeviceComputer,    0,                              EDeviceIconComputer, EBTDeviceNameIndexComputer },
-    {EMajorDevicePhone,       0,                              EDeviceIconPhone,    EBTDeviceNameIndexPhone }, 
-    {EMajorDeviceAudioDevice, EMinorDeviceAVCarAudio,         EDeviceIconCarkit,   EBTDeviceNameIndexCarKit }, 
-    {EMajorDeviceAudioDevice, 0,                              EDeviceIconAudio,    EBTDeviceNameIndexAudio }, 
-    {EMajorDeviceImaging,     EMinorDeviceImagingPrinter,     EDeviceIconPrinter,  EBTDeviceNameIndexPrinter }, 
-    {EMajorDevicePeripheral,  EMinorDevicePeripheralKeyboard, EDeviceIconKeyboard, EBTDeviceNameIndexKeyboard }, 
-    {EMajorDevicePeripheral,  EMinorDevicePeripheralPointer,  EDeviceIconMouse,    EBTDeviceNameIndexMouse  }, 
-    };
-
-const TInt KDeviceRowLayoutTableSize = (sizeof(KDeviceRowLayoutTable) / sizeof(TDeviceRowLayout));
-
-#endif /*DEVUI_CONST_H_*/
--- a/bluetoothengine/btnotif/loc/btnotif.loc	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,432 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 btnotif. 
-*
-*/
-
-
-// LOCALISATION STRINGS
-
-// *** TITLES (FOR POPUP WINDOWS) ***
-
-// d: Header text of the popup window for already found Bluetooth devices
-// d: while searching is still in progress. (List query)
-// d: Note! There is also an icon at right edge of the title.
-// l: heading_pane_t1/opt2
-//
-#define qtn_bt_searching_found "Searching"
-
-// d: Header text of the popup window for already found Bluetooth devices.
-// d: while searching has been completed. (List query)
-// l: heading_pane_t1
-//
-#define qtn_bt_devices_found "Devices found:"
-
-// d: Header text of the popup window for "last seen bluetooth devices". (List query)
-// l: heading_pane_t1
-//
-#define qtn_bt_last_seen_devices "Last seen devices"
-
-// d: Header text of the popup window for last used bluetooth devices. (List query)
-// l: heading_pane_t1
-//
-#define qtn_bt_last_used_devices "Bluetooth devices:"
-
-// d: List item text (with icon at left) of the popup window
-// d: for "last seen bluetooth devices". (List query)
-// l: list_single_graphic_pane_t1_cp2
-//
-#define qtn_bt_more_devices "More devices"
-
-// Generic_BTUI
-// d: Header text of the search device filer
-// l: heading_pane_t1
-// r: 5.1
-#define qtn_bt_search_for "Search for:"
-
-// d: list item text for different class of devices in search filter
-// l: list_single_graphic_pane_t1_cp2
-// r: 5.1
-#define qtn_bt_search_for_all "All devices"
-
-// d: list item text for different class of devices in search filter
-// l: list_single_graphic_pane_t1_cp2
-// r: 5.1
-#define qtn_bt_search_for_audio "Audio devices"
-
-// d: list item text for different class of devices in search filter
-// l: list_single_graphic_pane_t1_cp2
-// r: 5.1
-#define qtn_bt_search_for_phone "Phones"
-
-// d: list item text for different class of devices in search filter
-// l: list_single_graphic_pane_t1_cp2
-// r: 5.1
-#define qtn_bt_search_for_computer "Computers"
-
-// d: list item text for different class of devices in search filter
-// l: list_single_graphic_pane_t1_cp2
-// r: 5.1
-#define qtn_bt_search_for_input "Input devices"
-//End Generic_BTUI
-
-// *** SOFTKEYS ***
-
-// d: Right softkey for device search popup menu list while searching is still in progress.
-// l: control_pane_t1/opt7
-//
-#define qtn_bt_softkey_stop "Stop"
-
-
-// *** QUERIES ***
-
-// d: Confirmation query when Bluetooth needs to be activated.
-// l: popup_note_window
-//
-#define qtn_bt_is_off "Bluetooth is currently switched off. Switch on?"
-
-// d: Confirmation query when Bluetooth needs to be activated in off-line mode.
-// l: popup_note_window
-//
-#define qtn_bt_activate_in_offline "Do you want to activate bluetooth in off-line mode?"
-
-// d: Confirmation query when Bluetooth device search has met timeout and no devices has been found.
-// l: popup_note_window
-//
-#define qtn_bt_no_devices_found "No Bluetooth devices found. Try again?" 
-
-// d: Data query when pairing procedure is needed. Bluetooth passkey is entered.
-// l: popup_query_data_window
-//
-#define qtn_bt_enter_pk_for_conn "Enter passkey for: %U"
-
-// d: Heading text for qtn_bt_enter_pk_for_conn -query
-// l: popup_info_list_pane_t2/opt1
-//
-#define qtn_bt_passkey_heading "Bluetooth"
-
-// d: Confirmation query when remote Bluetooth device want's connect to us.
-// l: popup_note_window
-//
-#define qtn_bt_accept_conn_request "Accept connection request from:\n%U"
-
-// d: Confirmation query when remote Bluetooth (unpaired) device want's to send obex message to us.
-// l: popup_note_window
-//
-#define qtn_bt_receive_message "Receive Bluetooth message from: %U"
-
-// d: Confirmation query when remote Bluetooth (paired) device want's to send obex message to us.
-// l: popup_note_window
-//
-#define qtn_bt_receive_message_paired "Receive message via Bluetooth from paired device %U?"
-
-// d: Data query when obex file transfer needs it. OBEX passkey is entered.
-// l: popup_query_data_window
-//
-#define qtn_bt_enter_obex_pcode "Passcode for data transfer:"
-
-// d: This is default prompt extension for queries, notes and lists that contain Bluetooth device name.
-// d: The %U in queries are replaced with this text if no other Bluetooth device name is available.
-// l: list_single_graphic_pane_t1_cp2
-//
-#define qtn_bt_dialog_def_name "Bluetooth Device"
-
-// *** NOTES ***
-
-// d: Wait note while phone is performing Bluetooth device search/inquiry.
-// l: popup_note_wait_window
-//
-#define qtn_bt_searching "Searching for devices"
-
-// d: Information note if there is maximum number of connections and new one could not be created.
-// l: popup_note_window
-//
-#define qtn_bt_busy "Maximum amount of Bluetooth connections in use. Can't establish a new one."
-
-// d: Confirmation query when Bluetooth needs to be turned off when there os active BT connection.
-// l: popup_note_window
-//
-#define qtn_bt_switch_off_anyway "Active Bluetooth connection.\nSwitch off anyway?"
-
-
-// *** GLOBAL NOTES ***
-
-// d: Global Information note telling audio is routed to BT handsfree.
-// l: popup_note_window
-//
-#define qtn_bt_audio_accessory "Audio routed to BT handsfree"
-
-// d: Global Information note telling audio is routed to handset.
-// l: popup_note_window
-//
-#define qtn_bt_audio_handset "Audio routed to handset"
-
-// d: Global Information note for successful connection establishment.
-// l: popup_note_window
-//
-#define qtn_bt_conf_connected "Connected to %U"
-
-// d: Global Information note for successful connection close.
-// l: popup_note_window
-//
-#define qtn_bt_conf_disconnected "Disconnected from %U"
-
-// d: Global Information note telling BT connection was closed outside the phones menu.
-// l: popup_note_window
-//
-#define qtn_bt_conn_closed "Bluetooth connection to %U closed"
-
-// d: An information note when Bluetooth needs to be activated and it's disallowed in off-line mode.
-// l: popup_note_window
-//
-#define qtn_bt_offline_disabled "Bluetooth can't activated in off-line mode"
-
-// d: Global information note telling phone is entering SIM access profile mode
-// l: popup_note_window
-//
-#define qtn_bt_wait_sap_entering "Phone entering SIM access profile mode"
-
-// d: Global information note telling phone entering SIM access profile mode is succeeded
-// l: popup_note_window
-//
-#define qtn_bt_sap_entering_succeeded "Phone in SIM access profile mode"
-
-// d: Global information note telling phone entering SIM access profile mode is failed
-// l: popup_note_window
-//
-#define qtn_bt_sap_entering_failed "Unable to enter SIM access profile mode"
-
-// d: Global information note telling phone has no sim card
-// l: popup_note_window
-//
-#define qtn_bt_sap_no_sim "No SIM card in phone" 
-
-// d: Global information note telling phone bt stays switched on
-// l: popup_note_window
-//
-#define qtn_bt_permanently_on "Bluetooth switched permanently on"
-// d: Global information note telling phone bt is switched on
-// l: popup_note_window
-//
-#define qtn_bt_switched_on "Bluetooth switched on"
-
-// d: Global information note telling phone bt is switched off
-// l: popup_note_window
-//
-#define qtn_bt_switched_off "Bluetooth switched off"
-
-// *** DEFAULT BLUETOOTH DEVICE CLASS NAMES ***
-
-// The icon of each Bluetooth device shown in the UI is based on
-// Class of Device (CoD). These are defined in the "Bluetooth" UI specification.
-// Device classes and their default names are:
-
-// d: Class of Device = Computer
-// l: list_single_graphic_pane_t1_cp2
-//
-#define qtn_bt_computer "Computer"
-
-// d: Class of Device = Phone
-// l: list_single_graphic_pane_t1_cp2
-//
-#define qtn_bt_phone "Phone"
-
-// d: Class of Device = Audio/Video
-// l: list_single_graphic_pane_t1_cp2
-//
-#define qtn_bt_audio "Audio/Video"
-
-// d: Class of Device = Audio
-// l: list_single_graphic_pane_t1_cp2
-// r: 5.1
-#define qtn_bt_gen_audio "Audio"
-
-// d: Class of Device = Keyboard
-// l: list_single_graphic_pane_t1_cp2
-// r: 5.1
-#define qtn_bt_keyboard "Keyboard"
-
-// d: Class of Device = Mouse
-// l: list_single_graphic_pane_t1_cp2
-// r: 5.1
-#define qtn_bt_mouse "Mouse"
-
-// d: Class of Device = Printer
-// l: list_single_graphic_pane_t1_cp2
-// r: 5.1
-#define qtn_bt_printer "Printer"
-
-// d: Class of Device = Car kit
-// l: list_single_graphic_pane_t1_cp2
-// r: 5.1
-#define qtn_bt_carkit "Car kit"
-// d: Data query when pairing procedure is needed. Bluetooth passkey is entered.
-// l: popup_query_data_window
-// w:
-// r: 3.0
-#define qtn_bt_enter_pk_sap "Enter %0N digit passkey for %1U"
-
-// d: Data query when user has try to turn BT on  for the first time and
-// d: there is no local Bluetooth name defined yet (empty name).
-// l: popup_query_data_window
-//
-#define qtn_enter_bt_name "My Bluetooth name:"
-
-// d: Information note shows the phone's visibility has changed to hidden.
-// l: popup_note_window
-// w:
-// r: 3.1
-//
-#define qtn_bt_hidden_from_others "Phone is not detectable in searches made by other devices" 
-
-// d: Confirmation query when use refuse the incoming connection request and want to block connection
-// l: popup_note_window
-// w: 
-// r: 3.1
-#define qtn_bt_block_conn_request "Block connection request from %U?"
-
-// d: query if the bluetooth is off, when java needs it.
-// l: popup_info_list_pane_t1
-// w:
-// r: 3.2
-#define qtn_bt_is_off_java "The application you are using will not be fully functional while Bluetooth is off. \n\nDo you want to turn Bluetooth on?"
-
-// d: query if the bluetooth is off, when java needs it.
-// l: heading_pane_t1
-// w:
-// r: 3.2
-#define qtn_bt_is_off_java_header "Turn Bluetooth on?"
-
-// d: query if the bluetooth is hidden, when discoverabiliti is needed.
-// l: popup_info_list_pane_t1
-// w:
-// r: 3.2
-#define qtn_bt_is_hidden_java "Do you want to change your Bluetooth visibility setting value to 'Shown to all'? \n\nThe application you are using will not be fully functional while your Bluetooth visibility is set as 'Hidden'."
-
-// d: query header if the bluetooth is hidden, when discoverabiliti is needed.
-// l: heading_pane_t1
-// w:
-// r: 3.2
-#define qtn_bt_is_hidden_java_header "Change discoverability?"
-
-// d: When the Infrared feature is disabled in runtime, a global information note is shown to the user when Infrared reception is tried to be activated..
-// l: popup_note_window
-// w:
-// r: 3.2
-#define qtn_ir_not_supported  "Infrared not supported"
-
-// d: Confirmation query when use refuse the incoming connection request and want to block connection  >>> Isn't this a heading?
-// l: heading_pane_t1
-// w: 
-// r: 3.2
-#define qtn_bt_block_device_header "Block device?"
-
-// d: Confirmation query when use refuse the incoming connection request and want to block connection
-// l: popup_info_list_pane_t1
-// w: 
-// r: 3.2
-#define qtn_bt_block_all_conn_attempts "Do you want to block all future connection attempts from device %U?"
-
-// d: the link key to help in confirmation query when use refuse the incoming connection request and want to block connection from paired device
-// l: popup_info_list_pane_t1
-// w: 
-// r: 3.2
-#define qtn_bt_block_paired_device "Do you want to block all future connection attempts from paired device %U? \nThis will delete your pairing with the device."
-
-// d: Confirmation query when pairing is requested by the remote device
-// l: popup_note_window
-// w:
-// r: 3.2
-#define qtn_bt_accept_pairing_request "Device '%U' is trying to pair with you. Allow pairing?"
-
-// d: When VoIP call is on going over WLAN, BT device search is not allowed, a global information note is shown to the user.
-// l: popup_note_window
-// w:
-// r: 3.1
-#define qtn_bt_no_device_discovery_voip "While a VOIP call over WLAN is on-going, Bluetooth device discovery is not possible."
-
-// d: Query if the bluetooth is off, when java needs it. In this query %U will be substituted with requiring Java application's name.
-// l: popup_info_list_pane_t1
-// w:
-// r: 5.0
-#define qtn_bt_is_off_java_appname "The %U application you are using will not be fully functional while Bluetooth is off.\n\nDo you want to turn Bluetooth on?"
-
-// d: Query if the bluetooth is hidden, when discoverabiliti is needed. In this query %U will be substituted with requiring Java application's name.
-// l: popup_info_list_pane_t1
-// w:
-// r: 5.0
-#define qtn_bt_is_hidden_java_appname "The %U application you are using will not be fully functional when your visibility is set as ’Hidden? Do you want to change your Bluetooth visibility to ’Shown to all?"
-
-// d: If DOS attacked is detected, user is asked if bluetooth should be swtiched off.
-// l: popup_note_window
-// r: 5.0
-#define qtn_bt_dos_query "Switch Bluetooth off?"
-
-// d: If a blocked device is selected after searching devices starts, user is asked whether to unblock it.
-// l: popup_note_window
-// r: 5.0
-#define qtn_bt_unblock_device "%U is blocked. Do you want to unblock it?"
-
-// *** Information Notes for AVRCP1.3 *** 
-
-// d: the battery level of AVRCP1.3-supported accessory drops below "low" treshold
-// l: popup_note_window
-// r: 5.1
-#define qtn_bt_accessory_low "%U battery level low"
-
-// d: the battery level of AVRCP1.3-supported accessory drops below "critical" treshold
-// l: popup_note_window
-// r: 5.1
-#define qtn_bt_accessory_critical "%U battery level critical"
-
-// *** Query for Simple Pairing ***
-
-// d: Confirmation query when simple pairing procedure is needed. Check if Bluetooth passkeys shown in two devices match.
-// l: popup_note_window
-// d: %U contains device name, %U1 contains passkey.
-// r: 5.1
-#define qtn_bt_simple_passkey_comparison "Does this code match the one on %0U?\n\n%1U"
-
-// d: Query askes user to type the passkey code from remote input device.
-// d: %U contains device name %U1 contains passkey.
-// l: popup_note_window
-// r: 5.1
-#define qtn_bt_simple_passkey_entry "Enter on %0U:\n\n%1U"
-
-// *** Error notes for SSP ***
-
-// d: Error note if a timeout is exceeded before the user accepts or denies the query.
-// d: %U contains device name.
-// l: popup_note_window
-// r: 5.1
-#define qtn_bt_pairing_failed "Unable to pair with %U"
-
-// d: Warning note If the remote device is already in the process of pairing with another device.
-// l: popup_note_window
-// r: 5.1
-#define qtn_bt_simple_busy "Pairing failed. Remote device is pairing with another device." 
-
-// *** Notes and query for incoming authorization ***
-// d: Confirmation note shows pairing succeeded.
-// d: %U contains device name.
-// l: popup_note_window
-// r: 5.1
-#define qtn_bt_succesfully_paired "Pairing with %U complete" 
-
-// d: Confirmation query to set a Bluetooth device authorised after user has succesfully paired with the device.
-// l: popup_note_window
-//
-#define qtn_bt_authorisation_query "Authorise this device to make connections automatically?"
-
-//End
--- a/bluetoothengine/btnotif/rom/Btnotif.iby	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/btnotif/rom/Btnotif.iby	Fri May 14 16:01:46 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -11,18 +11,21 @@
 *
 * Contributors:
 *
-* Description:
+* Description:  Image description file for project btnotif
 *
 */
 
-#ifndef __BTNOTIF_IBY__
-#define __BTNOTIF_IBY__
 
-REM Bluetooth notifiers library
+#ifndef BTNOTIF_IBY
+#define BTNOTIF_IBY
+
+#include <data_caging_paths_for_iby.hrh>
 
-file=ABI_DIR\BUILD_DIR\btnotif.dll                                      SHARED_LIB_DIR\btnotif.dll
-SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,btnotif)
+#ifdef __BT
 
-ECOM_PLUGIN(btnotifwrapper.dll,101FD68F.rsc)
+file=ABI_DIR/BUILD_DIR/btnotifsrv.exe    SHARED_LIB_DIR/btnotifsrv.exe
+ECOM_PLUGIN( btnotifwrapper.dll, btnotifwrapper.rsc )
 
-#endif
+#endif // __BT
+
+#endif // BTNOTIF_IBY
--- a/bluetoothengine/btnotif/rom/BtnotifResources.iby	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef __BTNOTIFRESOURCES_IBY__
-#define __BTNOTIFRESOURCES_IBY__
-
-data=DATAZ_\RESOURCE_FILES_DIR\btnotif.rsc			RESOURCE_FILES_DIR\btnotif.rsc
-
-#endif
--- a/bluetoothengine/btnotif/src/BTNAuthNotifier.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,634 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 authorisation notifier class.
-*
-*/
-
-
-// INCLUDE FILES
-#include <BTNotif.rsg>       // Own resources
-#include "btnauthnotifier.h" // Own class definition
-#include "btNotifDebug.h"    // Debugging macros
-#include <btextnotifiers.h>
-#include <AknMediatorFacade.h> // Cover UI
-#include <secondarydisplay/BTnotifSecondaryDisplayAPI.h>
-#include <btengconstants.h>
-#include <btengsettings.h>
-#include <e32cmn.h>
-#include <btotgpairpub.inl>
-#include <btengprivatecrkeys.h>
-#include <e32property.h>
-#include <e32const.h>
-#include <e32des8.h>
-#include <e32cmn.h>
-#include <utf.h> // Unicode character conversion utilities
-#include <btengutil.h>
-#ifdef __SERIES60_HELP
-#include <hlplch.h>
-#include <csxhelp/bt.hlp.hrh> // The bt hrh info is needed, for help launching
-#endif
-#include <bluetoothuiutil.h>
-#include "btnotifnameutils.h"
-
-
-//
-// SDP UUID Constants - Short form
-// Taken from Bluetooth Profile specification v1.1
-// These are used when registering the service to
-// local SDP database and when searching the service
-// information from remote device.
-const TUint KBTSdpDun                   = 0x1103;
-const TUint KBTSdpGenericTelephony      = 0x1204;
-const TUint KBTSdpFax                   = 0x1111;
-const TUint KBTSdpObjectPush            = 0x1105;
-const TUint KBTSdpFileTransfer          = 0x1106;
-const TUint KBTSdpHeadSet               = 0x1108;
-const TUint KBTSdpGenericNetworking     = 0x1201;
-const TUint KBTSdpBasicImaging          = 0x111b;
-
-/**  Identification for active object */
-const TInt KBTNotifAuthNotifierLockReq = 10;
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------------
-// CBTAuthNotifier::NewL
-// Two-phased constructor.
-// ----------------------------------------------------------
-//
-CBTAuthNotifier* CBTAuthNotifier::NewL()
-    {
-    CBTAuthNotifier* self = new (ELeave) CBTAuthNotifier();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-
-// ----------------------------------------------------------
-// CBTAuthNotifier::CBTAuthNotifier
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// ----------------------------------------------------------
-//
-CBTAuthNotifier::CBTAuthNotifier()
-    {
-    }
-
-// ----------------------------------------------------------
-// Destructor
-// ----------------------------------------------------------
-//
-CBTAuthNotifier::~CBTAuthNotifier()
-    {
-    }
-
-// ----------------------------------------------------------
-// CBTAuthNotifier::RegisterL
-// ----------------------------------------------------------
-//
-CBTAuthNotifier::TNotifierInfo CBTAuthNotifier::RegisterL()
-    {
-    iInfo.iUid=KBTManAuthNotifierUid;
-    iInfo.iChannel=KBTAuthorisationChannel;
-    iInfo.iPriority=ENotifierPriorityVHigh;
-    return iInfo;
-    }
-
-// ----------------------------------------------------------
-// CBTAuthNotifier::GetParamsL
-// Initialize parameters and check if device is already
-// in registry. Jump to RunL as soon as possible.
-// ----------------------------------------------------------
-//
-void CBTAuthNotifier::GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::GetParamsL()"));
-
-    if( !iMessage.IsNull())
-        {
-        User::Leave(KErrInUse);
-        }
-
-    iMessage = aMessage;
-    iReplySlot = aReplySlot;
-
-    if ( AutoLockOnL() )
-        {
-        // The phone is locked, access denied.
-        // Write results back to caller and complete message.	
-	CompleteMessage(EFalse, KErrNone);	
-        return;
-        }
-    
-    TBTAuthorisationParams param;
-    TPckgC<TBTAuthorisationParams> pckg(param);
-    pckg.Set(aBuffer);
-
-    iServiceUid = pckg().iUid.iUid;  // Pick up service uid from message
-    iBTAddr = pckg().iBDAddr;
-    if ( OtherOutgoPairing( iBTAddr ) )
-        {
-        // We won't allow connection request from another device during outgoing pairing:
-        FLOG(_L("[BTNOTIF]\t CBTAuthNotifier: outgoing pair in progress, reject request from other device"));
-        CompleteMessage(KErrCancel);
-        return;
-        }	
- 	
-    // create iDevice so that the name won't be lost if the device does
-    // not exist in registry.
-    iDevice = CBTDevice::NewL( iBTAddr );
-    BtNotifNameUtils::SetDeviceNameL(pckg().iName, *iDevice);
-
-    if ( !iNotifLockProp.Handle() )
-        {
-        User::LeaveIfError( iNotifLockProp.Attach( 
-                KPSUidBluetoothEnginePrivateCategory, KBTNotifierLocks ) );
-        }
-    
-    if(!iLockActive)
-        {
-        iLockActive = CBTNotifActive::NewL( this, KBTNotifAuthNotifierLockReq, CActive::EPriorityStandard );
-        }
-
-    CheckAndSubscribeNotifLocks();
-    
-    if ( !iSuspended )
-        {
-        // Check if device is in the registry, function of notifier base  
-        GetDeviceFromRegL( iBTAddr );
-        }
-
-#ifdef _DEBUG
-    FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::GetParamsL() Executing authorisation..."));
-    TBuf<12> deviceAddressString;
-    pckg().iBDAddr.GetReadable(deviceAddressString);
-    FTRACE(FPrint(_L("[BTNOTIF]\t  BT Address: %S"), &deviceAddressString));
-    FTRACE(FPrint(_L("[BTNOTIF]\t CBTAuthNotifier::GetParamsL Service Uid: %d = 0x%X"), iServiceUid, iServiceUid ));
-#endif
-    FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::GetParamsL() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTAuthNotifier::UpdateL
-// Notifier update. Stores the received bluetooth
-// device name into registry and show it on screen.
-// ----------------------------------------------------------
-//
-TPtrC8 CBTAuthNotifier::UpdateL(const TDesC8& aBuffer)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::UpdateL()"));
-
-    TBTNotifierUpdateParams params; // Contains iName and iResult (name request)
-    TPckgC<TBTNotifierUpdateParams> pckg(params);
-    pckg.Set(aBuffer);
-
-    FTRACE(FPrint(_L("[BTNOTIF]\t CBTAuthNotifier::UpdateL - Name: '%S' length: %d"), &pckg().iName, pckg().iName.Length() ));
-
-
-    // If the device name request was successful and if new name is valid, show the new name.
-    if (pckg().iResult == KErrNone)
-        {
-        BtNotifNameUtils::SetDeviceNameL(pckg().iName, *iDevice); // Override possible previous device name
-
-        // Show new prompt for dialog if it is still on the screen
-        if ( !iDevice->IsValidFriendlyName() && iDevice->IsValidDeviceName())
-            {
-            // Create new prompt string with new device name
-            RBuf stringholder;
-            CleanupClosePushL( stringholder );
-            BluetoothUiUtil::LoadResourceAndSubstringL( 
-                    stringholder, iStrResourceId, 
-                    BTDeviceNameConverter::ToUnicodeL(iDevice->DeviceName()), 0 );
-            iNotifUiUtil->UpdateQueryDlgL( stringholder );
-            iNotifUiUtil->UpdateCoverUiL( iDevice->DeviceName() );
-            CleanupStack::PopAndDestroy();  // stringholder
-            }
-        }
-    FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::UpdateL() completed"));
-    TPtrC8 ret(KNullDesC8);
-    return (ret);
-    }
-
-// ----------------------------------------------------------
-// CBTAuthNotifier::RequestCompletedL
-// Gets called when P&S key notifies change
-// ----------------------------------------------------------
-void CBTAuthNotifier::RequestCompletedL( CBTNotifActive* aActive, TInt aId, TInt aStatus )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::RequestCompletedL()"));
-    ASSERT( aId == KBTNotifAuthNotifierLockReq );
-    (void) aActive;
-    (void) aId;
-    
-    if ( aStatus == KErrNone )
-        {
-        TBool prevSuspend = iSuspended;
-        // check the latest lock status and subscribe to further lock event:
-        CheckAndSubscribeNotifLocks();
-        if ( prevSuspend && !iSuspended )
-            {
-            // Check if device is in the registry, function of notifier base  
-            GetDeviceFromRegL( iBTAddr ); 
-            }
-        else if ( iSuspended && !(iNotifUiUtil->IsQueryReleased()) )
-            {
-            iNotifUiUtil->DismissDialog();
-            }
-        }
-    else
-        {
-        HandleError( aActive, KBTNotifAuthNotifierLockReq, iLockActive->RequestStatus().Int() );
-        }
-        
-    FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::RequestCompletedL() completed"));
-    
-    }
-
-// ----------------------------------------------------------
-// CBTAuthNotifier::HandleError
-// ----------------------------------------------------------
-void CBTAuthNotifier::HandleError( CBTNotifActive* aActive, TInt aId, TInt aError )
-    {
-    FTRACE(FPrint(_L("[BTNOTIF]\t CBTAuthNotifier::HandleError() error = %d"), aError ));
-    (void) aActive;
-    (void) aId;
-    (void) aError;
-    }
-
-// ----------------------------------------------------------
-// CBTAuthNotifier::DoCancelRequest
-// Root caller is CBTNotifActive::CancelRequest(), which calls 
-// CActive::Cancel that calls DoCancel() if request is active.
-// ----------------------------------------------------------
-void CBTAuthNotifier::DoCancelRequest( CBTNotifActive* aActive, TInt aId )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::DoCancel() >>"));
-    ASSERT( aId == KBTNotifAuthNotifierLockReq );
-    (void) aActive;
-    (void) aId;
-    
-    iNotifLockProp.Cancel();
-    FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::DoCancel() <<"));
-    }
-	
-// ----------------------------------------------------------
-// CBTAuthNotifier::Cancel
-// Not Active Object's cancel, but notifier deactivation
-// Release all own resources (member variables)
-// ----------------------------------------------------------
-//
-void CBTAuthNotifier::Cancel()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::Cancel()"));
-    
-    if (iLockActive)
-        {
-        iLockActive->CancelRequest();
-        delete iLockActive;
-        iLockActive = NULL;
-        }
-    
-    iNotifLockProp.Close();
-    
-	CBTNotifierBase::Cancel(); 
-    
-    FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::Cancel() completed"));
-    }
-   
-void CBTAuthNotifier::HandleGetDeviceCompletedL(const CBTDevice* aDev)
-	{
-	FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::HandleGetDeviceCompleted()"));	
-    (void) aDev;
-    if ( iSuspended)
-        {
-        FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::HandleGetDeviceCompleted, still suspended, wait"));
-        return;
-        }
-        
-    TBool reqAllowed = IsJustWorksPaired( iDevice->AsNamelessDevice() ) ? 
-        IsUserAwarePaired( iDevice->AsNamelessDevice() ) : ETrue ;
-    FTRACE(FPrint(_L("[BTNOTIF]\t CBTAuthNotifier, reqAllowed %d" ), reqAllowed ) );
-    if ( !reqAllowed )
-        {
-        // Do not grant access to device that is not paired in Just Works mode without
-        // user awareness, e.g. pairing due to an incoming connection request from a 
-        // headset.
-        CompleteMessage(KErrAccessDenied);
-        return;
-        }
-    
-    iStrResourceId = R_BT_AUTHORISATION_NAME;
-
-    // Select authorisation state for further use (dialogue selection)
-    switch( iServiceUid )
-        {
-        case KBTSdpObjectPush:
-        case KBTSdpBasicImaging: 
-            iAuthState = EBTObexAuthorisation;
-            iStrResourceId = R_BT_RECEIVE_MESSAGE;
-            iCoverUiDlgId = ECmdShowReceiveMessageFromDeviceDlg;
-            
-            if( IsUserAwarePaired( iDevice->AsNamelessDevice() ) )
-                {
-                iAuthState = EBTObexAuthForPairedDevice;
-                iStrResourceId = R_BT_RECEIVE_MESSAGE_PAIRED;
-                iCoverUiDlgId = ECmdShowReceiveMessageFromPairedDeviceDlg; 
-                }
-            break;
-        case KBTSdpFax:
-        case KBTSdpDun:
-        case KBTSdpFileTransfer:
-        case KBTSdpHeadSet:
-        case KBTSdpGenericTelephony:
-        case KBTSdpGenericNetworking:
-            if ( iDevice->GlobalSecurity().NoAuthorise() )
-                {
-                iAuthState = EBTAutoAuthorisation;
-                }
-            else
-                {
-                iAuthState = EBTNormalAuthorisation;
-                }
-            iCoverUiDlgId = ECmdShowAcceptConnRequestDlg;
-            break;
-        default:
-            { // check if device is authorized
-            if ( iDevice->GlobalSecurity().NoAuthorise() )
-                {
-                iAuthState = EBTAutoAuthorisation;
-                }
-            else
-                {
-                iAuthState = EBTAutoAuthorisationNotAuthorisedOnPhone;                        
-                }
-            break;
-            }
-        }
-    FTRACE(FPrint(_L("[BTNOTIF]\t CBTAuthNotifier::HandleGetDeviceComplete() Complete. iAuthState = %d"), iAuthState ));    
-    ShowAuthoQueryL();
-	}
-
-// ----------------------------------------------------------
-// CBTAuthNotifier::GetByPassAudioNotifier
-// is bypassing this audio connection query needed and if it is, will the
-// query be automatically accepted or rejected.
-//
-// This is used for bypassing the notifiers of the 2nd audio connection, so
-// the the user needs to reply to the incoming audio link only once.
-// ----------------------------------------------------------
-//    
-TBool CBTAuthNotifier::GetByPassAudioNotifier(const TBTDevAddr& aDeviceAddress,TBool& aAccept)
-	{
-	FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::GetByPassAudioNotifier()"));	
-		TBuf8<48> buf;
-		
-		RProperty::Define(KPSUidBluetoothEnginePrivateCategory,KBTAuthorInfoPerDevice, RProperty::EByteArray );
-		RProperty::Get(KPSUidBluetoothEnginePrivateCategory,KBTAuthorInfoPerDevice,buf);
-
-		if(buf.Length()>2)
-			{
-			// accept status of last attempt			
-			aAccept= (buf[0]=='1');
-
-			// last address						
-			TBuf<12> oldAddrString;
-			oldAddrString.Copy(buf.Mid(2,12));
-			TBTDevAddr lastAddress;
-			lastAddress.SetReadable(oldAddrString);
-			
-			// last time
-			TInt64 num(0);
-			TLex8 lex;			
-			lex=buf.Mid(15);	
-			TBuf<32> tmp_debug;
-			tmp_debug.Copy(buf.Mid(15));
-				
-			lex.Val( num );
-			TTime lastConnectionTime( num );
-			TTime now;			
-			now.UniversalTime();			
-
-			TBuf16<48> buf2;
-			buf2.Copy(buf);
-			
-			FTRACE(FPrint(_L("[BTNOTIF]\t CBTAuthNotifier::GetByPassAudioNotifier() Complete same_address=%d Time_ok=%d last_reply=%d"),lastAddress==aDeviceAddress,now>=lastConnectionTime && now <lastConnectionTime+ TTimeIntervalSeconds(5),aAccept));	
-			return lastAddress==aDeviceAddress && (now>=lastConnectionTime && now <lastConnectionTime+ TTimeIntervalSeconds(5) );		
-			}
-		FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::GetByPassAudioNotifier() Complete - empty key"));				
-		return EFalse;
-	}
-// ----------------------------------------------------------
-// CBTAuthNotifier::MemorizeCurrentAudioAttempt
-// Store the information about this audio connection attempt 
-// and what user replied to that. This is used by
-// GetBypassAudio Notifier.
-// ----------------------------------------------------------
-//    
-    			
-void CBTAuthNotifier::MemorizeCurrentAudioAttempt(const TBool aAccept,const TBTDevAddr& aDeviceAddress)    			
-	{
-	FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::MemorizeCurrentAudioAttempt()"));	
-	TBuf8<48> buf;
-	buf.Zero();
-	buf.AppendNum(aAccept!=EFalse);//now 0/1 only.
-	buf.Append(';');
-	
-	TBuf<12> a;
-	aDeviceAddress.GetReadable(a);
-	for(TInt t=0;t<12;t++)
-		buf.Append(a[t]);
-	buf.Append(';');		
-
-	TTime writeTime;
-	writeTime.UniversalTime();		
-	buf.AppendNum(  writeTime.Int64()  );
-	
-	RProperty::Set(KPSUidBluetoothEnginePrivateCategory,KBTAuthorInfoPerDevice,buf);
-	FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::MemorizeCurrentAudioAttempt() complete"));	
-	}
-
-
-// ----------------------------------------------------------
-// CBTAuthNotifier::ShowAuthoQueryL
-// Ask user's response on authorization query
-// ----------------------------------------------------------
-// 
-void CBTAuthNotifier::ShowAuthoQueryL()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::ShowAuthoQueryL"));
-    
-    if ( iAuthState == EBTAutoAuthorisation )
-        {
-        // device alreay set trusted now. allow connection automatically       
-        CompleteMessage(ETrue, KErrNone);        
-        FLOG(_L("[BTNOTIF]\t CBTAuthNotifier, device authorized already, allow connection automatically" ));
-        return;
-        }
-
-    TBool reply;
-    if ( GetByPassAudioNotifier(iDevice->BDAddr(),reply) )
-        {
-        FTRACE(FPrint(_L("[BTNOTIF]\t CBTAuthNotifier::ShowAuthoQueryL bypassing notifier with reply: %d"),reply));          
-        CompleteMessage(reply, KErrNone);
-        return;
-        }
-
-    // Not asking user's response if auth request is for: profile HFP/HSP/A2DP/AVRCP, and
-    // there is already existing connection to one of those profiles from the same device.
-    // 
-    TBool connectStatus = IsExistingConnectionToAudioL( iDevice->BDAddr() );  
-    // if iAuthState==EBTAutoAuthorisationNotAuthorised and device is connected it means it tries several connections
-    // so we just approve this. Also if connected & EBTAutoAuthorisation.
-    //                              
-    if(connectStatus && ( iAuthState==EBTAutoAuthorisationNotAuthorisedOnPhone))                                         
-        {
-        FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::Automatic authorisation ()"));
-        //Antomatic authorisation without asking user           
-        CompleteMessage(ETrue, KErrNone);   
-        FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::ShowAuthoQueryL() completed-"    ));     
-        return;                 
-        }
-
-    // check if we're showing bt off query
-    TInt queryValue=EBTQueryOff;
-    RProperty::Get(KPSUidBluetoothEnginePrivateCategory,KBTTurnBTOffQueryOn,queryValue);                
-    if( queryValue == EBTQueryOn )
-        {
-        CompleteMessage(KErrCancel);
-        return;
-        }
-
-    TBTDeviceName tempDeviceName; 
-    BtNotifNameUtils::GetDeviceDisplayName(tempDeviceName, iDevice);
-    RBuf stringholder;
-    CleanupClosePushL( stringholder );
-    BluetoothUiUtil::LoadResourceAndSubstringL( 
-            stringholder, iStrResourceId, tempDeviceName, 0);
-    TInt keypress = iNotifUiUtil->ShowQueryL( stringholder, R_BT_AUTHORISATION_QUERY, 
-            iCoverUiDlgId, tempDeviceName, CAknQueryDialog::EConfirmationTone );
-    CleanupStack::PopAndDestroy();  // stringholder
-    // If this notifier is cancelled by the caller, no need to perform the rest operation:
-    if ( iSuspended || iMessage.IsNull() )
-        {
-        return;
-        }
-    
-    if( keypress )  // User has accepted the dialog
-        {
-        if( iDevice && !iDevice->IsValidLinkKey() )
-            {               
-            TTime now;
-            now.UniversalTime();
-            TBuf8<32> buf;
-            buf.AppendNum(  now.Int64()  );             
-            RProperty::Set(KPSUidBluetoothEnginePrivateCategory,KBTConnectionTimeStamp,buf);                
-            }
-        
-        MemorizeCurrentAudioAttempt(ETrue,iDevice->BDAddr() );
-        CompleteMessage( ETrue, KErrNone );
-        }
-    else // User has rejected the dialog.
-        {
-        iLockActive->CancelRequest();
-        DoRejectAuthorizationL();
-        }
-    }
-
-
-// ----------------------------------------------------------
-// CBTAuthNotifier::DoRejectAuthorizationL
-// Handle query threshold and block after user rejects authorization
-// ----------------------------------------------------------
-//
-void CBTAuthNotifier::DoRejectAuthorizationL()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::DoRejectAuthorizationL()"));
-    
-    CheckAndHandleQueryIntervalL();
-    if( iMessage.IsNull() )
-        {
-        return; // No need to continue.
-        }
-
-    MemorizeCurrentAudioAttempt(EFalse,iDevice->BDAddr());
-    
-    //Logic: query block only at the second time for the same paired device
-    //       query block everytime after rejection for non-paired device.
-    if( IsPaired( iDevice->AsNamelessDevice() ) )
-        {
-        FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::DoRejectAuthorizationL() rejected a paired device."));            
-        
-        TBuf<2*KBTDevAddrSize> tmp; //2 hex digits per byte
-        RProperty::Get(KPSUidBluetoothEnginePrivateCategory, KBTBlockDevAddr, tmp);
-        TBTDevAddr priorDeviceaddress;
-        priorDeviceaddress.Reset();
-        priorDeviceaddress.SetReadable(tmp);
-        
-        if(priorDeviceaddress != iDevice->BDAddr() )                            
-            {
-            FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::DoRejectAuthorizationL() NOT the prior rejected device, no block query."));           
-            
-            // The last device was not current device,
-            // so the last device is updated to be current device.                  
-            iDevice->BDAddr().GetReadable(tmp);
-            RProperty::Set(KPSUidBluetoothEnginePrivateCategory, KBTBlockDevAddr, tmp );
-
-            // Complete message and free resources
-            CompleteMessage(EFalse, KErrNone);
-            FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::DoRejectAuthorizationL() completed"));
-            return;
-            }
-        else 
-            {
-            FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::DoRejectAuthorizationL() IS SAME as the prior rejected device."));           
-            
-            // this was 2nd time in row. Clear the key, so the question will not be made next time.
-            TBuf<2*KBTDevAddrSize> tmp;                 
-            TBTDevAddr emptyAddr;
-            emptyAddr.Reset();
-            emptyAddr.GetReadable(tmp);                 
-            RProperty::Set(KPSUidBluetoothEnginePrivateCategory, KBTBlockDevAddr, tmp );
-            }
-        }
-        
-    // Ask user to Block this device or not.
-    if( !iMessage.IsNull() )
-        {
-        QueryBlockDeviceL();
-        }
-    }
-
-// ----------------------------------------------------------
-// CBTAuthNotifier::CheckAndSubscribeNotifLocks
-// Subscribe to PS key and check key value.
-// ----------------------------------------------------------
-//
-void CBTAuthNotifier::CheckAndSubscribeNotifLocks()
-    {
-    if ( !iLockActive->IsActive() )
-        {
-        FLOG(_L("[BTNOTIF]\t CBTAuthNotifier, Subscribe Device Operation Info"));
-        iNotifLockProp.Subscribe( iLockActive->RequestStatus() );
-        iLockActive->GoActive();
-        }
-    TInt ops;
-    TBTNotifLockPublish::GetNotifLocks( iNotifLockProp, 
-            ops, iBTAddr );
-    iSuspended = ops & EBTNotiferLockPairedDeviceSetting;
-    FTRACE(FPrint(_L("[BTNOTIF]\t CBTAuthNotifier suspended ? %d"), iSuspended ));    
-    }
-
-
-// End of File
--- a/bluetoothengine/btnotif/src/BTNGenericInfoNotifier.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,262 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 visibility timeout notifier class.
-*
-*/
-
-
-// INCLUDE FILES
-
-#include <StringLoader.h>       // Localisation stringloader
-#include <BTNotif.rsg>          // Own resources
-#include "BTNGenericInfoNotifier.h"      // Own class definition
-#include "btNotifDebug.h"       // Debugging macros
-#include <secondarydisplay/BTnotifSecondaryDisplayAPI.h>
-#include <e32cmn.h>
-#include <bluetoothuiutil.h>
-#include "btnotifnameutils.h"
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------------
-// CBTGenericInfoNotifier::NewL
-// Two-phased constructor.
-// ----------------------------------------------------------
-//
-CBTGenericInfoNotifier* CBTGenericInfoNotifier::NewL()
-    {
-    CBTGenericInfoNotifier* self=new (ELeave) CBTGenericInfoNotifier();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-
-// ----------------------------------------------------------
-// CBTGenericInfoNotifier::CBTGenericInfoNotifier
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// ----------------------------------------------------------
-//
-CBTGenericInfoNotifier::CBTGenericInfoNotifier() 
-    {
-    }
-
-// ----------------------------------------------------------
-// Destructor
-// ----------------------------------------------------------
-//
-CBTGenericInfoNotifier::~CBTGenericInfoNotifier()
-    {
-    Cancel();   // Free own resources
-    iQueryMessage.Close(); 
-    }
-
-// ----------------------------------------------------------
-// CBTGenericInfoNotifier::RegisterL
-// Register notifier.
-// ----------------------------------------------------------
-//
-CBTGenericInfoNotifier::TNotifierInfo CBTGenericInfoNotifier::RegisterL()
-    {
-    iInfo.iUid=KBTGenericInfoNotifierUid;
-    iInfo.iChannel=KBTGenericInfoNotifierUid;
-    iInfo.iPriority=ENotifierPriorityHigh;
-    return iInfo;
-    }
-
-// ----------------------------------------------------------
-// CBTGenericInfoNotifier::StartL
-// Synchronic notifier launch. Contructs and shows a global
-// note when temp visibility expire, no parameters need here.
-// ----------------------------------------------------------
-//
-TPtrC8 CBTGenericInfoNotifier::StartL( const TDesC8& aBuffer )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTGenericInfoNotifier::StartL()"));
-    if( !iNotifUiUtil )
-        {
-        iNotifUiUtil = CBTNotifUIUtil::NewL( iIsCoverUI );
-        }
-    ProcessParamBufferL(aBuffer, ETrue);
-    FLOG(_L("[BTNOTIF]\t CBTGenericInfoNotifier::StartL() completed"));
-
-    TPtrC8 ret(KNullDesC8);
-    return (ret);
-    }
-
-// ----------------------------------------------------------
-// CBTGenericInfoNotifier::GetParamsL
-// Mandatory for BT Notifiers when using asynchronous launch. 
-// ----------------------------------------------------------
-//
-void CBTGenericInfoNotifier::GetParamsL(const TDesC8& aBuffer, 
-                                     TInt /*aReplySlot*/, 
-                                     const RMessagePtr2& aMessage )
-    {
-	FLOG(_L("[BTNOTIF]\t CBTGenericInfoNotifier::GetParamsL"));  
-	if (!iMessage.IsNull())
-	    {
-	    aMessage.Complete(KErrInUse);
-	    return;
-	    }
-    iMessage = aMessage;
- 	ProcessParamBufferL(aBuffer, EFalse);
-    }
-
-// ----------------------------------------------------------
-// CBTGenericInfoNotifier::ProcessParamBufferL
-// Parse the data out of the message that is sent by the
-// client of the notifier.
-// ----------------------------------------------------------
-void CBTGenericInfoNotifier::ProcessParamBufferL(const TDesC8& aBuffer, TBool aSyncCall)
-	{
-	TBTGenericInfoNotifierParams bParams;
-	TPckgC<TBTGenericInfoNotifierParams> bPckg(bParams);
-		
-	bPckg.Set( aBuffer );
-	iSecondaryDisplayCommand = ECmdBTnotifUnavailable;
-	switch (bPckg().iMessageType)
-		{
-		case EBTConnected: 			
-			iMessageResourceId= R_BT_CONF_CONNECTED_PROMPT; 
-			iSecondaryDisplayCommand=ECmdShowBtConnectedNote;
-			break;
-		case EBTDisconnected: 		
-			iMessageResourceId= R_BT_CONF_DISCONNECTED_PROMPT; 
-			iSecondaryDisplayCommand=ECmdShowBtDisconnectedNote;
-			break;
-		case EBTAudioAccessory: 	
-			iMessageResourceId= R_BT_AUDIO_ACCESSORY_PROMPT; 
-			iSecondaryDisplayCommand=ECmdShowBtAudioAccessoryNote;
-			break;
-		case EBTAudioHandset: 		
-			iMessageResourceId= R_BT_AUDIO_HANDSET_PROMPT; 
-			iSecondaryDisplayCommand=ECmdShowBtAudioHandsetNote;
-			break;
-		case EBTClosed: 			
-			iMessageResourceId= R_BT_CONN_CLOSED_PROMPT; 
-			iSecondaryDisplayCommand=ECmdShowBtDisconnectedNote;
-			break;
-		case EBTDeviceNotAvailable: 
-			iMessageResourceId= R_BT_DEVICE_NOT_AVAIL; 
-			iSecondaryDisplayCommand=ECmdShowBtDeviceNotAvailableNote;
-			break;
-		case EBTOfflineDisabled: 	
-			iMessageResourceId= R_BT_OFFLINE_DISABLED; 
-			iSecondaryDisplayCommand=ECmdShowBtOfflineDisableNote;
-			break;	
-		case EBTVisibilityTimeout: 	
-			iMessageResourceId= R_BT_HIDDEN_FROM_OTHERS_NOTE; 
-			iSecondaryDisplayCommand=ECmdShowBtHiddenFromOthersNote;
-			break;	
-		case EBTEnterSap: 			
-			iMessageResourceId= R_BT_ENTER_SAP_NOTE; 
-			iSecondaryDisplayCommand=ECmdShowBtSapEnteringNote;
-			break;
-		case EBTSapOk: 				
-			iMessageResourceId= R_BT_ENTER_SAP_SUCCEED_NOTE; 
-			iSecondaryDisplayCommand=ECmdShowBtSapEnteringSucceededNote;
-			break;
-		case EBTSapFailed: 			
-			iMessageResourceId= R_BT_ENTER_SAP_FAILED_NOTE; 
-			iSecondaryDisplayCommand=ECmdShowBtSapEnteringFailedNote;
-			break;
-		case EBTSapNoSim: 			
-			iMessageResourceId= R_BT_SAP_NO_SIM_NOTE; 
-			iSecondaryDisplayCommand=ECmdShowBtSapNoSimNote;
-			break;			
-		case EBTDeviceBusy: 
-			iMessageResourceId=R_BT_BUSY_TEXT;
-			iSecondaryDisplayCommand=ECmdShowBtBusyNote;
-			break;
-		case EIRNotSupported: 
-			iMessageResourceId=R_IR_NOT_SUPPORTED;
-			iSecondaryDisplayCommand=ECmdShowIrNotSupportedNote;
-			break;
-		case ECmdShowBtBatteryLow:
-			iMessageResourceId= R_BT_ACCESSORY_LOW;
-			iSecondaryDisplayCommand= ECmdShowBtBatteryLowNote;
-			break;
-		case ECmdShowBtBatteryCritical:
-			iMessageResourceId= R_BT_ACCESSORY_CRITICAL; 
-			iSecondaryDisplayCommand= ECmdShowBtBatteryCriticalNote;
-			break;
-        case EBTStayPowerOn:
-            iMessageResourceId= R_BT_PERMANENTLY_ON; 
-            break;
-    	case EBTSwitchedOn:
-    		iMessageResourceId= R_BT_SWITCHED_ON; 
-    		break;
-    	case EBTSwitchedOff:
-    		iMessageResourceId= R_BT_SWITCHED_OFF;
-    		break;
-		default:
-			FLOG(_L("[BTNOTIF]\t CBTGenericInfoNotifier:: Unkown messageType! ")); 
-			User::Leave(KErrNotFound);		
-		}
-    
-	// if the logic string contains substitute indicator "%U", replace it with device name:
-	HBufC* buf = StringLoader::LoadL( iMessageResourceId);
-	iQueryMessage.Assign( buf );
-	
-    TInt keyLen;
-    TInt pos = BluetoothUiUtil::GetStringSubstringKeyPos( 
-            iQueryMessage, 0, keyLen );
-    if( pos > KErrNotFound)
-		{
-		iBTAddr = TBTDevAddr( bPckg().iRemoteAddr );
-		if( !iDevice )
-		    {
-            iDevice = CBTDevice::NewL(iBTAddr);
-		    }
-	    GetDeviceFromRegL( iBTAddr );
-		}
-	else
-	    {
-	    ShowNoteAndCompleteL(aSyncCall);
-	    }
-	}
-	
-// ----------------------------------------------------------
-// CBTGenericInfoNotifier::ShowNoteAndCompleteL
-// Shows the notifier in backround 
-// ----------------------------------------------------------
-//
-void CBTGenericInfoNotifier::ShowNoteAndCompleteL(TBool aSyncCall)
-	{
-	iNotifUiUtil->ShowInfoNoteL( iQueryMessage, iSecondaryDisplayCommand );
-	if (!aSyncCall)
-		{
-        CompleteMessage(KErrNone);
-        }
-    FLOG(_L("[BTNOTIF]\t CBTGenericInfoNotifier::ShowNoteAndComplete() complete"));
-	}
-
-void CBTGenericInfoNotifier::HandleGetDeviceCompletedL(const CBTDevice* /*aDev*/)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTGenericInfoNotifier::HandleGetDeviceCompleted()"));
-    
-    TBTDeviceName name;
-    BtNotifNameUtils::GetDeviceDisplayName(name, iDevice);
-    iQueryMessage.Zero();
-    BluetoothUiUtil::LoadResourceAndSubstringL( 
-            iQueryMessage, iMessageResourceId, name, 0);      
-    
-    ShowNoteAndCompleteL(EFalse);
-
-    FLOG(_L("[BTNOTIF]\t CBTGenericInfoNotifier::HandleGetDeviceComplete() Complete"));        
-    }
-
-// End of File
--- a/bluetoothengine/btnotif/src/BTNGenericQueryNotifier.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,343 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 visibility timeout notifier class.
-*
-*/
-
-
-// INCLUDE FILES
-
-#include <StringLoader.h>       // Localisation stringloader
-#include <secondarydisplay/BTnotifSecondaryDisplayAPI.h>
-#include <e32cmn.h>
-#include <BTNotif.rsg>          // Own resources
-#include <btengsettings.h>
-#include <bluetoothuiutil.h>
-#include "BTNGenericQueryNotifier.h"      // Own class definition
-#include "btNotifDebug.h"       // Debugging macros
-
-#ifdef __SERIES60_HELP
-#include <hlplch.h>
-#include <csxhelp/bt.hlp.hrh> // The bt hrh info is needed, for help launching
-#endif
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------------
-// CBTGenericQueryNotifier::NewL
-// Two-phased constructor.
-// ----------------------------------------------------------
-//
-CBTGenericQueryNotifier* CBTGenericQueryNotifier::NewL()
-    {
-    CBTGenericQueryNotifier* self=new (ELeave) CBTGenericQueryNotifier();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-
-// ----------------------------------------------------------
-// CBTGenericQueryNotifier::CBTGenericQueryNotifier
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// ----------------------------------------------------------
-//
-CBTGenericQueryNotifier::CBTGenericQueryNotifier()
-    {	
-    }
-
-// ----------------------------------------------------------
-// Destructor
-// ----------------------------------------------------------
-//
-CBTGenericQueryNotifier::~CBTGenericQueryNotifier()
-    {
-    Cancel();   // Free own resources
-    delete iName; 
-    iQueryMessage.Close(); 
-	delete iQueryHeader;
-    }
-
-// ----------------------------------------------------------
-// CBTGenericQueryNotifier::RegisterL
-// Register notifier.
-// ----------------------------------------------------------
-//
-CBTGenericQueryNotifier::TNotifierInfo CBTGenericQueryNotifier::RegisterL()
-    {
-    iInfo.iUid=KBTGenericQueryNotifierUid;
-    iInfo.iChannel=KBTGenericQueryNotifierUid;
-    iInfo.iPriority=ENotifierPriorityHigh;
-    return iInfo;
-    }
-
-
-// ----------------------------------------------------------
-// CBTGenericQueryNotifier::StartL
-// Synchronic notifier launch. Contructs and shows a global
-// note, no parameters need here.
-// ----------------------------------------------------------
-//
-TPtrC8 CBTGenericQueryNotifier::StartL( const TDesC8& /*aBuffer*/ )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTGenericQueryNotifier::StartL()"));
-
-    TPtrC8 ret(KNullDesC8);
-    return (ret);    
-    
-    }
-
-// ----------------------------------------------------------
-// CBTGenericQueryNotifier::GetParamsL
-// Mandatory for BT Notifiers when using asynchronous launch. 
-// This notifier is synchronous so no implementation is needed.
-// ----------------------------------------------------------
-//
-void CBTGenericQueryNotifier::GetParamsL(const TDesC8& aBuffer, 
-                                     TInt aReplySlot, 
-                                     const RMessagePtr2& aMessage)
-    {
-   	FLOG(_L("[BTNOTIF]\t CBTGenericQueryNotifier::GetParamsL"));    
-
-   	if (iMessage.Handle())
-   	    {
-   	    aMessage.Complete(KErrInUse);
-   	    return;
-   	    }
-   	
-	ProcessParamBufferL(aBuffer);
-	
-    iMessage = aMessage;
-    iReplySlot = aReplySlot;
-    
-    ShowQueryAndCompleteL();
-    
-   	FLOG(_L("[BTNOTIF]\t CBTGenericQueryNotifier::GetParamsL Complete"));    
-    }
-
-// ----------------------------------------------------------
-// CBTGenericQueryNotifier::ProcessParamBufferL
-// Parse the data out of the message that is sent by the
-// client of the notifier.
-// ----------------------------------------------------------
-void CBTGenericQueryNotifier::ProcessParamBufferL(const TDesC8& aBuffer)
-	{
-	
-	TBTGenericQueryNotifierParams bParams;
-	TPckgC<TBTGenericQueryNotifierParams> bPckg(bParams);
-	bPckg.Set( aBuffer );
-
-	if( bPckg().iMessageType == EBTNameQuery )
-	    {
-	    iIsNameQuery = ETrue;
-	    return;
-	    }
-	iSecondaryDisplayCommand = ECmdBTnotifUnavailable;
-	switch (bPckg().iMessageType)
-		{
-		case EBTReceiveMessageQuery:
-			iIsMessageQuery=EFalse;
-			iMessageResourceId=R_BT_RECEIVE_MESSAGE	;	
-			iSecondaryDisplayCommand=ECmdShowReceiveMessageFromDeviceDlg; 
-			break;
-		case EBTReceiveMessagePairedQuery:
-			iIsMessageQuery=EFalse;		
-			iMessageResourceId=R_BT_RECEIVE_MESSAGE_PAIRED;
-			iSecondaryDisplayCommand= ECmdShowReceiveMessageFromPairedDeviceDlg; 
-			break;			
-		case EBTIsOffQuery:
-			iIsMessageQuery=EFalse;		
-    		iMessageResourceId=R_BT_POWER_IS_OFF ;
-			iSecondaryDisplayCommand=ECmdShowBtIsOffDlg;		
-			break;			
-		case EBTActivateOffLineQuery:
-			iIsMessageQuery=EFalse;		
-    		iMessageResourceId=R_BT_ACTIVATE_IN_OFFLINE;
-			iSecondaryDisplayCommand=ECmdShowBtActivateInOfflineDlg;		
-			break;			
-		case EBTNoDevicesFoundQuery:
-			iIsMessageQuery=EFalse;		
-			iMessageResourceId=R_BT_NO_DEVICES_FOUND;
-			break;	
-		case EBTAcceptRequestQuery:
-			iIsMessageQuery=EFalse;		
-			iMessageResourceId=R_BT_AUTHORISATION_NAME ;
-			iSecondaryDisplayCommand=ECmdShowAcceptConnRequestDlg;
-			break;		
-			
-		case EBTIsOffJavaQuery:	
-			iIsMessageQuery=ETrue; 	
-			if( bPckg().iNameExists )			
-				{
-				iMessageResourceId=R_BT_IS_OFF_JAVA_APPNAME; // when caller provide Java application name.	
-				}
-			else
-				{
-				iMessageResourceId=R_BT_IS_OFF_JAVA; //r_bt_is_hidden_java	
-				}		
-			iSecondaryDisplayCommand=ECmdShowBtBtIsOffJavaDlg;
-			iQueryHeader=StringLoader::LoadL( R_BT_IS_OFF_JAVA_HEADER);		
-			break;
-
-		case EBTIsNotShownQuery:
-			iIsMessageQuery=ETrue;			
-			if( bPckg().iNameExists )
-				{
-				iMessageResourceId=R_BT_IS_HIDDEN_JAVA_APPNAME; // when caller provide Java application name.	
-				}
-			else
-				{
-				iMessageResourceId=R_BT_IS_HIDDEN_JAVA; //r_bt_is_hidden_java	
-				}									
-			iSecondaryDisplayCommand=ECmdShowBtIsNotVisibleDlg;
-			iQueryHeader=StringLoader::LoadL( R_BT_IS_HIDDEN_JAVA_HEADER);
-			break;
-			
-		case EBTBlockConnectionQuery:
-		case EBTBlockPairedConnectionQuery:		
-			iIsMessageQuery=ETrue;		
-			if( bPckg().iMessageType == EBTBlockConnectionQuery )
-				iMessageResourceId = R_BT_BLOCK_DEVICE_NOHELP; 
-			else
-				iMessageResourceId = R_BT_BLOCK_PAIRED_DEVICE_NOHELP ; 
-				
-			iQueryHeader= StringLoader::LoadL( R_BT_BLOCK_DEVICE_HEADER );
-			break;
-			
-		case EBTSwitchOffAnyway:
-			iIsMessageQuery=EFalse;		
-			iMessageResourceId=R_BT_SWITCH_OFF_ANYWAY;
-			break;		
-					
-		default:
-			FLOG(_L("[BTNOTIF]\t CBTGenericQueryNotifier:: Unkown messageType! ")); 
- 			User::Leave(KErrNotFound);		
-		}
-	
-	// if the logic string contains substitute indicator "%U", replace it with device name:
-	//
-	HBufC* buf = StringLoader::LoadL( iMessageResourceId);
-	iQueryMessage.Assign( buf );
-
-	TInt keyLen;
-	TInt pos = BluetoothUiUtil::GetStringSubstringKeyPos( 
-	        iQueryMessage, 0, keyLen );
-	if( pos > KErrNotFound)
-		{		
-		//if no device name provided, default name will be used:
-		if( !bPckg().iNameExists )			
-			iName=StringLoader::LoadL(R_BT_DIALOG_DEF_NAME);
-		else
-			{
-			iName=HBufC::NewL(bPckg().iName.Length() );
-			iName->Des().Copy(bPckg().iName);
-			}
-		BluetoothUiUtil::LoadResourceAndSubstringL( 
-		        iQueryMessage, iMessageResourceId, *iName, 0);
-		}
-	else
-		{
-		iName=NULL;		
-		}		
-	}
-
-// ----------------------------------------------------------
-// CBTGenericQueryNotifier::UpdateL
-// Update notifier according to new data
-// ----------------------------------------------------------
-//	
-TPtrC8 CBTGenericQueryNotifier::UpdateL(const TDesC8& aBuffer)
-	{
-   	FLOG(_L("[BTNOTIF]\t CBTGenericQueryNotifier::UpdateL")); 
-	ProcessParamBufferL(aBuffer);
-	if( !iNotifUiUtil->IsQueryReleased() )
-		{
-		if(iIsMessageQuery )
-		    {
-		    iNotifUiUtil->UpdateMessageQueryDlgL(iQueryMessage);
-		    }
-		else
-		    {
-		    iNotifUiUtil->UpdateQueryDlgL(iQueryMessage);
-		    }
-		}
-   	FLOG(_L("[BTNOTIF]\t CBTGenericQueryNotifier::UpdateL complete")); 	
-
-    TPtrC8 ret(KNullDesC8);
-    return (ret);   	
-	}
-
-// ----------------------------------------------------------
-// CBTGenericQueryNotifier::ShowQueryAndCompleteL
-// Shows the notifier in backround and complete message
-// ----------------------------------------------------------
-//
-void CBTGenericQueryNotifier::ShowQueryAndCompleteL()
-	{ 
-   	FLOG(_L("[BTNOTIF]\t CBTGenericQueryNotifier::ShowQueryAndCompleteL")); 	
-	
-	// Turn lights on and deactivate apps -key
-	//
-   	iNotifUiUtil->TurnLightsOn();  	
-	if( iIsNameQuery )
-	    {
-	    TBool nameStatus = IsLocalNameModifiedL();
-	    if( !nameStatus )
-	        {
-	        (void) AskLocalBTNameQueryL();
-	        }
-        // Check if Local name is set again before turn BT on. 
-        // Turn BT on only when there is local name, since user still has chance
-        // to ignore the asking name query - like pressing End-key     
-        //             
-        TBTDeviceName localName;           
-        localName.Zero();
-        TInt err = iBTEngSettings->GetLocalName(localName);
-              
-        if (localName.Length() <= 0)
-            {   
-            err = KErrCancel;
-            }
-	    	    
-	    CompleteMessage( (!err) ? ETrue : EFalse, KErrNone );
-
-	    FLOG(_L("[BTNOTIF]\t CBTGenericQueryNotifier::ShowQueryAndCompleteL iIsNameQuery complete")); 
-	    return;
-	    }
-	
-	TInt keypress;
-    TBTDeviceName name(KNullDesC);
-    if( iName )
-	    {
-	    name.Copy( *iName );
-	    }
-    if( iIsMessageQuery	)
-		{
-		
-        keypress = iNotifUiUtil->ShowMessageQueryL(iQueryMessage, *iQueryHeader, 
-                        R_BT_GENERIC_MESSAGE_QUERY, CAknQueryDialog::EConfirmationTone );        
-		}
-	else
-    	{
-    	keypress = iNotifUiUtil->ShowQueryL( iQueryMessage, R_BT_GENERIC_QUERY, 
-    	        iSecondaryDisplayCommand, name, CAknQueryDialog::EConfirmationTone );
-    	}
-	
-   	CompleteMessage( (keypress) ? ETrue: EFalse, KErrNone );
-
-   	FLOG(_L("[BTNOTIF]\t CBTGenericQueryNotifier::ShowQueryAndCompleteL complete")); 			
-	}
-
-// End of File
--- a/bluetoothengine/btnotif/src/BTNInqNotifier.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,166 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 Bluetooth device inquiry notifier class.
-*
-*/
-
-
-// INCLUDE FILES
-#include <eikenv.h>          // Eikon environment
-
-#include "btninqnotifier.h"  // Own class definition
-#include "btNotifDebug.h"    // Debugging macros
-#include <StringLoader.h>    // Localisation stringloader
-#include <BTNotif.rsg>          // Own resources
-    
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------------
-// CBTInqNotifier::NewL
-// Two-phased constructor.
-// ----------------------------------------------------------
-//
-CBTInqNotifier* CBTInqNotifier::NewL()
-    {
-    CBTInqNotifier* self=new (ELeave) CBTInqNotifier();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-
-// ----------------------------------------------------------
-// CBTInqNotifier::CBTInqNotifier
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// ----------------------------------------------------------
-//
-CBTInqNotifier::CBTInqNotifier()
-    {
-    }
-
-// ----------------------------------------------------------
-// Destructor
-// ----------------------------------------------------------
-//
-CBTInqNotifier::~CBTInqNotifier()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTInqNotifier::~CBTInqNotifier()"));
-    delete iUi;
-    iUi = NULL;
-    FLOG(_L("[BTNOTIF]\t CBTInqNotifier::~CBTInqNotifier() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTInqNotifier::RegisterL
-// ----------------------------------------------------------
-//
-CBTInqNotifier::TNotifierInfo CBTInqNotifier::RegisterL()
-    {
-    
-    iInfo.iUid=KDeviceSelectionNotifierUid;
-    iInfo.iChannel=KBTInquiryChannel;
-    iInfo.iPriority=ENotifierPriorityVHigh; // User input level
-    return iInfo;
-    }
-
-// ----------------------------------------------------------
-// CBTInqNotifier::GetParamsL
-// Initialize parameters and launch device search.
-// ----------------------------------------------------------
-//
-void CBTInqNotifier::GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTInqNotifier::GetParamsL()"));
-
-    if( !iMessage.IsNull() )
-        {
-        aMessage.Complete(KErrInUse);
-        return;
-        }
-
-    iMessage = aMessage;
-    iReplySlot = aReplySlot;
-    
-    TBTDeviceClass cod;
-    TBTDeviceSelectionParamsPckg pckg;
-    pckg.Copy(aBuffer); 
-
-    LaunchInquiryL(pckg().DeviceClass());
-    
-    FLOG(_L("[BTNOTIF]\t CBTInqNotifier::GetParamsL() completed "));
-    }
-
-// ----------------------------------------------------------
-// CBTInqNotifier::NotifyDeviceSearchCompleted
-// Notified by InquiryUI, return to caller by completing message
-// ----------------------------------------------------------
-//
-void CBTInqNotifier::NotifyDeviceSearchCompleted(TInt aErr, const TBTDeviceResponseParams& aDevice)
-    {
-    FTRACE(FPrint( _L("[BTNOTIF]\t CBTInqNotifier::NotifyDeviceSearchCompleted aErr %d"), aErr ));
-    CompleteMessage(TBTDeviceResponseParamsPckg( aDevice ), aErr);
-    }
-
-// ----------------------------------------------------------
-// CBTInqNotifier::Cancel
-// Release all own resources (member variables)
-// ----------------------------------------------------------
-//
-void CBTInqNotifier::Cancel()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTInqNotifier::Cancel()"));
-    if( iUi )
-        {
-        iUi->Cancel();
-        delete iUi;
-        iUi = NULL;
-        }
-    CBTNotifierBase::Cancel();
-    FLOG(_L("[BTNOTIF]\t CBTInqNotifier::Cancel() completed"));
-    }
-
-// ----------------------------------------------------------
-// Ensure BT is ON; there are not too many connections; InqUi 
-// is launched successfully.
-// ----------------------------------------------------------
-//
-void CBTInqNotifier::LaunchInquiryL(const TBTDeviceClass& aDesiredDevice)
-    {
-    // Turn BT on if it is not yet.
-    if ( !CheckAndSetPowerOnL() )
-        {
-        CompleteMessage(KErrGeneral);
-        return;
-        }
-
-    TInt linkCount;
-    User::LeaveIfError(RProperty::Get(KPropertyUidBluetoothCategory, 
-            KPropertyKeyBluetoothGetPHYCount, linkCount));
-    if ( linkCount > 6 )   //support only piconet
-        {
-        iNotifUiUtil->ShowInfoNoteL( R_BT_BUSY_NOTE, ECmdBTnotifUnavailable );
-        User::Leave(KErrInUse);
-        }
-    
-    // launch Inquiry UI
-  
-    iUi = new (ELeave) CBTInqUI( this, iNotifUiUtil, aDesiredDevice);
-   
-
-    iUi->ConstructL();
-    }
-
-// End of File
--- a/bluetoothengine/btnotif/src/BTNInqUI.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1334 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 Bluetooth device inquiry user interface class.
-*
-*/
-
-
-// INCLUDE FILES
-#include <avkon.hrh>            // AVKON components
-#include <AknIconArray.h>
-#include <aknlists.h>
-#include <aknPopup.h>
-#include <avkon.mbg>
-#include <wlaninternalpskeys.h> // For WLAN state checking
-#include <ctsydomainpskeys.h>
-#include <AknNotiferAppServerApplication.h> 
-#include <barsread.h>           // Resource reader
-#include <BTNotif.rsg>          // Own resources
-#include <bt_subscribe.h>
-#include <btnotif.mbg>
-#include <devui_const.h>
-#include <btengutil.h>
-#include <bluetoothuiutil.h>
-#include "btninqui.h"           // Own class definition
-#include "btNotifDebug.h"       // Debugging macros
-#include "btnotifnameutils.h"
-
-
-const TInt KBTAllPurposeBufferLength = 266;
-const TInt KBTNotifNonPairedUsedDevicesMaxNumber= 5;
-// RSSI value range: -127dB ~ +20dB
-const TInt KRssiRangeOffset = 127 + 1;  // Offset for getting a non-zero positive value
-const TInt KMediumStrength = 53;
-const TInt KHighStrength = 82;
-const TUint32 ExcludePairedDeviceMask = 0x800000;
-const TUint32 ResetExcludePairedDeviceMask = 0xFF7FFFFF;
-_LIT(KBtnotifBmpFileName,"btnotif.mif"); //mif is target file under resource folder
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------------
-// CBTInqUI::CBTInqUI
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// ----------------------------------------------------------
-//
-CBTInqUI::CBTInqUI( MBTNDeviceSearchObserver* aObserver, 
-        CBTNotifUIUtil* aUtil, 
-        const TBTDeviceClass& aDesiredDevClass): 
-        iUiUtil (aUtil),
-        iEikonEnvRef( iUiUtil->LocalEikonEnv() ),
-        iDevicesFound (EFalse),
-        iBroughtForwards (EFalse),
-        iDesiredDeviceClass (aDesiredDevClass),
-        iSystemCancel (EFalse), 
-        iPageForName ( EFalse ),
-        iIndex (0),
-        iDevSearchObserver (aObserver)
-    {
-	iBTRegistryQueryState=ENoQuery;
-	}
-
-// ----------------------------------------------------------
-// CBTInqUI::ConstructL
-// Symbian 2nd phase constructor can leave.
-// Creates first device list (not shown yet) and initializes 
-// couple of member variables with default values.
-// ----------------------------------------------------------
-//
-void CBTInqUI::ConstructL()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::ConstructL()"));
-    
-    // Read default device names to an array
-    iDefaultDeviceNamesArray = iEikonEnvRef.ReadDesCArrayResourceL( R_BT_DEFAULT_DEVICE_NAMES );
-
-    // create the timer
-    iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityIdle);
-    
-    // Create device array
-    //
-    iDeviceListRows = new(ELeave) CDesCArrayFlat(1);
-    
-    iPairedDevicesArray = new (ELeave) CBTDeviceArray(1);
-    iLastUsedDevicesArray = new(ELeave) CBTDeviceArray(1);
-    iLastSeenDevicesArray = new(ELeave) CBTDeviceArray(1);
-	iAdjustedUsedDeviceArray = new(ELeave) CBTDeviceArray(1);	
-	
-	iDevMan=CBTEngDevMan::NewL(this);
-	
-	iExcludePairedDevices = iDesiredDeviceClass.DeviceClass() & ExcludePairedDeviceMask ? 
-                            ETrue : EFalse;	
-    if ( iExcludePairedDevices )
-        {         
-        FLOG (_L("[BTNOTIF]\t CBTInqUI::ConstrucL Excluding paired devices"));
-        iDesiredDeviceClass = iDesiredDeviceClass.DeviceClass() & ResetExcludePairedDeviceMask;
-        }
-    // Retrieve paired devices to a local array
-    RetrievePairedDevices();
-
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::ConstructL() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTInqUI::RetrieveUsedDevices- Substitute
-// ----------------------------------------------------------
-//
-void CBTInqUI::RetrieveUsedDevices()
-	{
-	FLOG(_L("[BTNOTIF]\t CBTInqUI::RetrieveUsedDevicesL()"));	
-
-	TBTRegistrySearch searchPattern;
-	searchPattern.FindAll();
-	
-    //Ignore this error. Continue device search.
-	TInt err=iDevMan->GetDevices( searchPattern, iLastUsedDevicesArray );	
-	if(err)
-	    {
-	    TRAP_IGNORE(AdjustDeviceArrayL(iAdjustedUsedDeviceArray));
-	    DoDeviceFrontListSelection();
-	    FTRACE(FPrint(_L("[BTNOTIF]\t CBTInqUI: get useddevice err %d"), err));  
-	    }
-	else
-	    {
-	    iBTRegistryQueryState=EQueryUsed;
-	    }
-	FLOG(_L("[BTNOTIF]\t CBTInqUI::RetrieveUsedDevicesL() returned"));
-	}
-	
-//---------------------------------------------------------------
-// CBTInqUI::RetrievePairedDevices
-//---------------------------------------------------------------
-void CBTInqUI::RetrievePairedDevices()
-    {
-	FLOG(_L("[BTNOTIF]\t CBTInqUI::RetrievePairedDevicesL()"));
-
-	TBTRegistrySearch searchPattern;
-    searchPattern.FindBonded();
-
-	TInt err= iDevMan->GetDevices( searchPattern, iPairedDevicesArray );	
-	FTRACE(FPrint(_L("[BTNOTIF]\t CBTInqUI: get paireddevice err %d"), err));  
-	if(err)
-	    {
-        //Next: try to get used devices
-	    RetrieveUsedDevices();
-	    }
-	else
-	    {
-	    iBTRegistryQueryState=EQueryPaired;	
-	    }
-	FLOG(_L("[BTNOTIF]\t CBTInqUI::RetrievePairedDevicesL() returned"));
-    }
-    
-// ----------------------------------------------------------
-// CBTInqUI::HandleGetDevicesComplete
-// ----------------------------------------------------------
-//
-void CBTInqUI::HandleGetDevicesComplete(TInt aErr, CBTDeviceArray* /*aDeviceArray*/)
-	{
-	FTRACE(FPrint(_L("[BTNOTIF]\t CBTInqUI::HandleGetDevicesComplete() err: %d"), aErr));	
-	(void) aErr;
-	switch(iBTRegistryQueryState)
-		{
-		case EQueryPaired:
-		    // If a device is paired in Just Works model but without user awareness,
-		    // This device won't be shown in UI paired view, so we have to 
-		    // remove it from this array so that it will be shown to user
-		    // in the last used device list.
-		    for (int i = iPairedDevicesArray->Count() - 1; i >= 0; --i )
-		        {
-		        if ( !IsUserAwarePaired( iPairedDevicesArray->At( i )->AsNamelessDevice() ) )
-		            {
-		            delete iPairedDevicesArray->At( i );
-		            iPairedDevicesArray->Delete( i );
-		            }
-		        }
-			RetrieveUsedDevices();
-			break;
-		case EQueryUsed:
-			// fill in the list of last seen devices, so it can be shown
-			TRAP_IGNORE(AdjustDeviceArrayL(iAdjustedUsedDeviceArray));
-			DoDeviceFrontListSelection();
-			break;
-		default:
-			break;
-		}
-	
-	FLOG(_L("[BTNOTIF]\t CBTInqUI::HandleGetDevicesComplete() Complete"));		
-	}
-
-// ----------------------------------------------------------
-// Destructor
-// ----------------------------------------------------------
-//
-CBTInqUI::~CBTInqUI()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::~CBTInqUI()"));
-
-    if( iBroughtForwards )
-        {
-        iEikonEnvRef.BringForwards(EFalse);
-        iBroughtForwards = EFalse;
-        }
-
-    if( iPairedDevicesArray ) 
-        {
-        iPairedDevicesArray->ResetAndDestroy();	            
-        delete iPairedDevicesArray; 
-        }
-    if( iLastUsedDevicesArray ) 
-        {  
-        iLastUsedDevicesArray->ResetAndDestroy();	    
-        delete iLastUsedDevicesArray; 
-        }       
-    if( iLastSeenDevicesArray ) 
-        {  
-        iLastSeenDevicesArray->ResetAndDestroy();
-        delete iLastSeenDevicesArray; 
-        }
-    if( iAdjustedUsedDeviceArray )
-        {  
-        iAdjustedUsedDeviceArray->ResetAndDestroy();
-        delete iAdjustedUsedDeviceArray; 
-        }
-    if( iDefaultDeviceNamesArray )
-        {
-        iDefaultDeviceNamesArray->Reset();
-        delete iDefaultDeviceNamesArray;
-        }
-    
-	delete iDevMan;    
-    delete iDeviceListBox;
-    delete iDeviceListRows;
-	delete iPeriodicTimer;	
-	    
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::~CBTInqUI() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTInqUI::Cancel
-// ----------------------------------------------------------
-//
-void CBTInqUI::Cancel()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::Cancel()"));  
-    
-    iSystemCancel = ETrue;
-    if(iDevMan)
- 	   {
- 	   iDevMan->Cancel();  	
-  	   }
-
-    if( iSearchFilterPopupList )
-        {
-        iSearchFilterPopupList->CancelPopup();
-        }
-
-    if(iPeriodicTimer)
-        {
-        iPeriodicTimer->Cancel();
-        }
-    
-    RemoveScanner();
-    InquiryComplete(KErrCancel);
-
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::Cancel() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTInqUI::DisplayDevicesFrontListL
-// Display last seen devices popuplist
-// ----------------------------------------------------------
-//
-void CBTInqUI::DisplayDevicesFrontListL()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::DisplayDevicesFrontListL()"));
-
-    
-    if ( iAdjustedUsedDeviceArray->Count() <= 0 )
-        {
-        SelectSearchCategoryL();
-        return;
-        }
-    
-    if( !iBroughtForwards )
-        {
-        iEikonEnvRef.BringForwards(ETrue); // Destructor will release this later on
-        iBroughtForwards = ETrue;
-        }
-
-    // Create the devices popuplist
-    CreatePopupListL( R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT , R_BT_LAST_USED_DEVS_POPUP_TITLE );
-
-    // Add devices into device list.
-    for( TInt index = 0; index < iAdjustedUsedDeviceArray->Count(); index++ )
-    	{        
-   	    UpdateDeviceListL ( iAdjustedUsedDeviceArray->At(index) );  
-        }  
-
-    // Add "more devices" command as first item of list
-    HBufC* formatString = HBufC::NewLC( KBTAllPurposeBufferLength );
-    formatString->Des().Copy( TPtrC(KDeviceIconFormatTable[EDeviceIconBlank].iFormat ) );
-    HBufC* moreDevicesString = iEikonEnvRef.AllocReadResourceLC( R_BT_MORE_DEVICES_ITEM );
-    formatString->Des().Append( *moreDevicesString );
-    CleanupStack::PopAndDestroy(); // moreDevicesString
-    iDeviceListRows->InsertL( 0, *formatString );
-    CleanupStack::Pop(); // formatString
-
-    // Launch popup list and wait for user input 
-    AllowDialerAndAppKeyPress( EFalse );
-    TInt popupRetVal = iDevicePopupList->ExecuteLD();    
-    iDevicePopupList = NULL;   
-    AllowDialerAndAppKeyPress( ETrue );
-    
-    if( !popupRetVal )
-        { 
-        // query cancelled by user or system, complete device search:
-        iDevSearchObserver->NotifyDeviceSearchCompleted(KErrCancel);
-        return;
-        }
-    TInt currentDeviceIndex = iDeviceListBox->CurrentItemIndex();
-    
-    // Delete device list box and reset device items array
-    delete iDeviceListBox;
-    iDeviceListBox = NULL;
-    iDeviceListRows->Reset();
-
-    if( currentDeviceIndex > 0 ) // User selected "a used device"
-        {
-        HandleDeviceSelectionL( iAdjustedUsedDeviceArray->At( currentDeviceIndex - 1 ) );   
-        return;
-        }
-    
-    // user selected more devices.
-    SelectSearchCategoryL();
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::DisplayDevicesFrontListL() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTInqUI::DeviceSearchUiL
-// Execute bluetooth device search/inquiry.
-// Parameters:
-//  OUT: aDevice     - selected device after inquiry
-//  IN:  aObexOnly   - flag if OBEX capable devices is requested
-// ----------------------------------------------------------
-//
-void CBTInqUI::DeviceSearchUiL()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::DeviceSearchUiL()"));
-    
-    TSearchFlowState searchFlow;
-    TInt err;
-    AllowDialerAndAppKeyPress( EFalse );
-    do
-        {
-        searchFlow = InitInquiryL(err);
-        } while (searchFlow == ESearchAgain);
-    
-    if (searchFlow == ESearchCompleted)
-        {
-        // search completed caused by either user cancel or failure
-        iDevSearchObserver->NotifyDeviceSearchCompleted(err);
-        AllowDialerAndAppKeyPress( ETrue );
-        return;
-        }
- 
-    FLOG(_L("[BTNOTIF]\t CBTInqUI, Displaying devices already found"));
-
-    TInt keypress(0);
-    // Show devices popup list for received devices while
-    // inquiry is still active and list may be updated.
-    if( !iInquiryComplete )
-        {
-        CreatePopupListL( R_BT_SOFTKEYS_SELECT_STOP, R_BT_SEARCH_DEVS_POPUP_TITLE );
-
-        // Set animation
-        iDevicePopupList->Heading()->SetHeaderAnimationL( R_BT_ANIMATION_FOR_POPUPLIST );
-
-        // Launch popup list and wait for user input
-        keypress = iDevicePopupList->ExecuteLD();    
-        iDevicePopupList = NULL;
-        }
-
-    // If Cancel() is called while DoInquery() is still running,
-    // such as taking out MMC while bt devices discovery or user pressed redkey.                 
-    // In such cases, We need to dismiss anything and function returns immediately.
-    //
-    if (iSystemCancel )
-        {
-        FLOG(_L("[BTNOTIF]\t inquiry was canncelled by the system!"));
-        iSystemCancel = EFalse;
-        AllowDialerAndAppKeyPress( ETrue );
-        iDevSearchObserver->NotifyDeviceSearchCompleted(KErrCancel);
-        return;
-        }
-
-    // Cancel inquiry
-    RemoveScanner();
-    
-    // Store the highlighted device index and destroy list box
-    iHighLightedItemIndex = 0;
-    if( iDeviceListBox )
-        {
-        iHighLightedItemIndex = iDeviceListBox->CurrentItemIndex();
-        delete iDeviceListBox;
-        iDeviceListBox = NULL;
-        }
-    
-    // user selected a device during active inquiry
-    if (keypress)
-        {
-        AllowDialerAndAppKeyPress( ETrue );
-        HandleDeviceSelectionL( iLastSeenDevicesArray->At( iHighLightedItemIndex ) );
-        return;
-        }
-
-    // Error encountered in inquiry
-    if (iInquiryStatus)
-        {
-        AllowDialerAndAppKeyPress( ETrue );
-        iDevSearchObserver->NotifyDeviceSearchCompleted(iInquiryStatus);
-        return;
-        }
-    
-    // Inquiry completed, show final device list 
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::DeviceSearchUiL Displaying final devicelist"));          
-    CreatePopupListL( R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT, R_BT_FOUND_DEVS_POPUP_TITLE );
-   
-    //cancel iPeriodicTimer after the final list is shown
-    iPeriodicTimer->Cancel();
-    User::ResetInactivityTime();
-    // Set highlight on top of same device as it was in previous popuplist
-    if( iHighLightedItemIndex >= 0 )
-        {
-        iDeviceListBox->HandleItemAdditionL();
-        iDeviceListBox->SetCurrentItemIndex(iHighLightedItemIndex);
-        }
-
-    // Launch popup list and wait for user input
-    keypress = iDevicePopupList->ExecuteLD();
-    iDevicePopupList = NULL;
-    AllowDialerAndAppKeyPress( ETrue );
-    // If dialog is cancelled by system:
-    if( !keypress)
-        {
-        iDevSearchObserver->NotifyDeviceSearchCompleted(KErrCancel);
-        return;
-        }
-
-    // Get user selection
-    TInt index = iDeviceListBox->CurrentItemIndex();
-    delete iDeviceListBox;
-    iDeviceListBox = NULL;
-
-    HandleDeviceSelectionL( iLastSeenDevicesArray->At( index ) );
-
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::DeviceSearchUiL() complete"));    
-    }
-
-TSearchFlowState CBTInqUI::InitInquiryL(TInt& aReason)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::InitInquiryL"));
-    if (IsActiveVoIPOverWLAN())
-        {
-        iUiUtil->ShowInfoNoteL( R_BT_NO_DEVICE_DISCOVERY_VOIP, ECmdBTnotifUnavailable );
-        aReason = KErrInUse;
-        return ESearchCompleted;
-        }
-
-    // starting  the timer
-    iPeriodicTimer->Cancel();
-    iPeriodicTimer->Start(KPeriodicTimerInterval4Sec, KPeriodicTimerInterval4Sec, 
-                        TCallBack(PeriodicTimerCallBack, this));
-    
-    // Prepare for using hostresolver to search devices 
-    CreateScannerL();
-    
-    iInquiryStatus = KErrCancel; // Give a initial value (for end key handling)
-    iDevicesFound = EFalse;
-    iInquiryComplete = EFalse;
-    iSystemCancel = EFalse;   
-    
-    // Show wait note until dialog is dismissed by inquirey result callbacks or user cancel
-    TInt ret = iUiUtil->ShowWaitDlgL( R_BT_SEARCHING_DEVICES_NOTE );
-    
-    // If user cancels searching, ret will be KerrNone.  
-    // According to Description of Eikdialog, ShowWaitDlgL() returns zero 
-    // if it was the cancel button (@c EEikBidCancel). 
-    if( ret == KErrNone || iSystemCancel )
-        {
-        FLOG(_L("[BTNOTIF]\t CBTInqUI, User cancelled waiting note"));
-        RemoveScanner();
-        aReason = KErrCancel;
-        return ESearchCompleted;
-        }
-
-     if( !iDevicesFound ) // No devices found at all
-         {
-         FLOG(_L("[BTNOTIF]\t CBTInqUI no devices found at all"));
-         RemoveScanner(); // Cancel inquiry
-
-         if( iInquiryStatus != KErrNone )
-             {
-             aReason = iInquiryStatus;
-             return ESearchCompleted;
-             }
-         
-         // Show try again query
-         TBool keypress(0);
-         keypress = iUiUtil->ShowQueryL( KErrNone, R_BT_TRY_AGAIN_QUERY, ECmdBTnotifUnavailable );
-         if( !keypress ) // User has not requested new inquiry
-             {
-             aReason = KErrCancel;
-             return ESearchCompleted;
-             }
-         else
-             {
-             FLOG(_L("[BTNOTIF]\t CBTInqUI user wanted to try again"));
-             return ESearchAgain;
-             }
-         }
-     return ESearchFirstDeviceFound;
-    }
-
-// ----------------------------------------------------------
-// CBTInqUI::DeviceAvailableL
-// Bluetooth device has been received.
-// ----------------------------------------------------------
-//
-void CBTInqUI::DeviceAvailableL( const TNameRecord& aNameRecord, const TDesC& aDevName )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::DeviceAvailableL()"));
-
-    if( !iDevicesFound )
-        {
-        FLOG(_L("[BTNOTIF]\t CBTInqUI::DeviceAvailableL() first found, clear last seen devices array"));
-        iLastSeenDevicesArray->ResetAndDestroy(); // Remove previous inquiry results
-        iDevicesFound = ETrue; 
-        iInquiryStatus = KErrNone;
-        }
-    
-    iUiUtil->CompleteWaitDlgL();
-
-    TInquirySockAddr& sa = TInquirySockAddr::Cast( aNameRecord.iAddr );
-    
-    // Create device object with received CoD information
-    CBTDevice* newDevice = CBTDevice::NewLC( sa.BTAddr() );      
-    TBTDeviceClass cod( sa.MajorServiceClass(), sa.MajorClassOfDevice(), sa.MinorClassOfDevice() );
-    newDevice->SetDeviceClass( cod );
-    FTRACE(FPrint(_L("[BTNOTIF]\t CoD %b"), cod.DeviceClass() ));
-    TInt rssi = 0;
-    if( sa.ResultFlags() & TInquirySockAddr::ERssiValid )
-        {
-        rssi = sa.Rssi() + KRssiRangeOffset;
-        }
-
-    BtNotifNameUtils::SetDeviceNameL(aDevName, *newDevice);
-
-    // Update device popup list with newDevice
-    UpdateDeviceListL( newDevice, rssi );
-
-    // Append newDevice in the bottom of the "last seen" device array.
-    iLastSeenDevicesArray->AppendL(newDevice);
-    CleanupStack::Pop(); // new device is under iLastSeenDevicesArray control now
-
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::DeviceAvailableL() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTInqUI::InquiryComplete
-// Inquiry has been completed.
-// ----------------------------------------------------------
-//
-void CBTInqUI::InquiryComplete( TInt aError )
-    {
-    FTRACE(FPrint(_L("[BTNOTIF]\t CBTInqUI::InquiryComplete() status = %d: %d devices found"), aError, iLastSeenDevicesArray->Count() ));
-    iInquiryComplete = ETrue;
-    // Remove popup list if any devices exists
-    if( iDevicePopupList )
-        {
-        iDevicePopupList->CancelPopup();
-        iDevicePopupList = NULL;
-        }
-    
-    TRAP_IGNORE( iUiUtil->CompleteWaitDlgL() );
-    
-    if ( aError == KErrNone || aError == KErrCancel || aError == KErrEof )
-        {
-        iInquiryStatus = (aError == KErrEof ) ? KErrNone : aError;
-        }
-    else
-        {
-        iLastSeenDevicesArray->ResetAndDestroy(); // Remove previous inquiry results
-        }
-
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::InquiryComplete() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTInqUI::PeriodicTimerCallBack(TAny* aAny)
-// The call back function
-// ----------------------------------------------------------
-//
-TInt CBTInqUI::PeriodicTimerCallBack(TAny* /*aAny*/)
-    {
-    User::ResetInactivityTime();
-    return KErrNone; // Return value ignored by CPeriodic
-    }
-
-// ----------------------------------------------------------
-// CBTInqUI::RemoveScanner
-// Remove scanner active object if still exists.
-// ----------------------------------------------------------
-//
-void CBTInqUI::RemoveScanner()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::RemoveScanner()"));
-    if( iScanner )
-        {
-        iScanner->CancelRequest();
-        iHostResolver.Close();
-        iSocketServer.Close(); 
-        delete iScanner; 
-        iScanner = NULL;
-        }
-    iDevsWithoutName.Close();
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::RemoveScanner() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTInqUI::CreatePopupListL
-// ----------------------------------------------------------
-//
-void CBTInqUI::CreatePopupListL(TInt aSoftkeysResourceId, TInt aTitleResourceId )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::CreatePopupListL()"));
-
-    __ASSERT_DEBUG( !iDeviceListBox,   User::Panic(_L("BTNotifInqUI - iDeviceListBox not released!"  ), KErrAlreadyExists));
-    __ASSERT_DEBUG( !iDevicePopupList, User::Panic(_L("BTNotifInqUI - iDevicePopupList not released!"),KErrAlreadyExists));
-
-    // Create listbox for devices
-    iDeviceListBox = new(ELeave) CAknSingleGraphicPopupMenuStyleListBox;
-
-    // Create popup list
-    iDevicePopupList = CAknPopupList::NewL( iDeviceListBox, aSoftkeysResourceId, AknPopupLayouts::EDynMenuWindow );
-
-    iDeviceListBox->ConstructL(iDevicePopupList, EAknListBoxMenuList );
-    iDeviceListBox->CreateScrollBarFrameL(ETrue);
-    iDeviceListBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
-
-    // Read title from resources
-    HBufC* popupListTitle = iEikonEnvRef.AllocReadResourceLC( aTitleResourceId );
-    iDevicePopupList->SetTitleL(*popupListTitle);
-    CleanupStack::PopAndDestroy(); // popupListTitle
-
-    // Create list box model for devices
-    CTextListBoxModel* model = iDeviceListBox->Model();
-    model->SetItemTextArray(iDeviceListRows);
-    model->SetOwnershipType(ELbmDoesNotOwnItemArray);  // Do not destroy items
-
-    // Set up filename for Avkon bitmap
-    TFileName avkonbmpFilename = AknIconUtils::AvkonIconFileName();
-
-    // Setup graphic items list for BT devices listbox
-    CAknIconArray* iconList = new(ELeave) CAknIconArray(KDeviceIconCount);
-    CleanupStack::PushL( iconList );
-	
-	CreateAndAppendIconL( KAknsIIDQgnPropBtComputer, avkonbmpFilename, 
-						  EMbmAvkonQgn_prop_bt_computer,
-						  EMbmAvkonQgn_prop_bt_computer_mask, iconList);
-
-	CreateAndAppendIconL( KAknsIIDQgnPropBtPhone, avkonbmpFilename, 
-						  EMbmAvkonQgn_prop_bt_phone,
-						  EMbmAvkonQgn_prop_bt_phone_mask, iconList);
-
-	CreateAndAppendIconL( KAknsIIDQgnPropBtAudio, avkonbmpFilename, 
-						  EMbmAvkonQgn_prop_bt_audio,
-						  EMbmAvkonQgn_prop_bt_audio_mask, iconList);
-
-	CreateAndAppendIconL( KAknsIIDQgnPropBtMisc, avkonbmpFilename, 
-						  EMbmAvkonQgn_prop_bt_misc,
-						  EMbmAvkonQgn_prop_bt_misc_mask, iconList);
-
-	CreateAndAppendIconL( KAknsIIDQgnStatBtBlank, avkonbmpFilename, 
-						  EMbmAvkonQgn_stat_bt_blank,
-						  EMbmAvkonQgn_stat_bt_blank, iconList);
-	
-	CreateAndAppendIconL( KAknsIIDQgnPropBtKeyboard, avkonbmpFilename, 
-						  EMbmAvkonQgn_prop_bt_keyboard,
-						  EMbmAvkonQgn_prop_bt_keyboard_mask, iconList);					  
-
-	CreateAndAppendIconL( KAknsIIDQgnPropBtMouse, avkonbmpFilename, 
-						  EMbmAvkonQgn_prop_bt_mouse,
-						  EMbmAvkonQgn_prop_bt_mouse_mask, iconList);
-						  
-	CreateAndAppendIconL( KAknsIIDQgnPropBtPrinter, avkonbmpFilename, 
-						  EMbmAvkonQgn_prop_bt_printer,
-						  EMbmAvkonQgn_prop_bt_printer_mask, iconList);					  					  
-	
-	CreateAndAppendIconL( KAknsIIDQgnPropBtCarKit, avkonbmpFilename, 
-						  EMbmAvkonQgn_prop_bt_carkit,
-						  EMbmAvkonQgn_prop_bt_carkit_mask, iconList);
-	
-	GetColorIconL( avkonbmpFilename, KAknsIIDQgnIndiBtPairedAdd, 
-	                EMbmAvkonQgn_indi_bt_paired_add, 
-	                EMbmAvkonQgn_indi_bt_paired_add_mask, iconList );
-	
-    
-    TFileName bmpFilename;
-    bmpFilename += KFileDrive;
-    bmpFilename += KDC_BITMAP_DIR;
-    bmpFilename += KBtnotifBmpFileName;	
-	
-	GetColorIconL( bmpFilename, KAknsIIDQgnIndiBtBlocked, 
-	                EMbmBtnotifQgn_indi_bt_blocked, 
-	                EMbmBtnotifQgn_indi_bt_blocked_mask, iconList );
-
-    GetColorIconL( bmpFilename, KAknsIIDQgnIndiBtSignalLowAdd, 
-                    EMbmBtnotifQgn_indi_bt_signal_low_add, 
-                    EMbmBtnotifQgn_indi_bt_signal_low_add_mask, iconList);
-	
-    GetColorIconL( bmpFilename, KAknsIIDQgnIndiBtSignalMedAdd, 
-                    EMbmBtnotifQgn_indi_bt_signal_med_add, 
-                    EMbmBtnotifQgn_indi_bt_signal_med_add_mask, iconList );
-
-    GetColorIconL( bmpFilename, KAknsIIDQgnIndiBtSignalGoodAdd, 
-                    EMbmBtnotifQgn_indi_bt_signal_good_add, 
-                    EMbmBtnotifQgn_indi_bt_signal_good_add_mask, iconList );
-	
-	// Transfer iconlist ownership to the listbox
-	//
-	iDeviceListBox->ItemDrawer()->ColumnData()->SetIconArray(iconList);
-	CleanupStack::Pop(); // iconList
-	
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::CreatePopupListL() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTInqUI::UpdateDeviceListL
-// ----------------------------------------------------------
-//
-void CBTInqUI::UpdateDeviceListL( CBTDevice* aDevice, const TInt aSignalStrength )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::UpdateDeviceListL()")); 
-    
-    TInt iconIndex (EDeviceIconDefault);
-    TInt defNameIndex (EBTDeviceNameIndexDefault);
-    
-    HBufC* formatString = HBufC::NewLC( KBTAllPurposeBufferLength );
-
-    // Check whether the device is already in registry.
-    TInt index = LookupFromDevicesArray(iPairedDevicesArray, aDevice );
-
-    if( index >= 0 )
-        {
-        // Update device's link key and friendly name 
-        // with those found from registry.
-        aDevice->UpdateL( *( iPairedDevicesArray->At( index ) ) );
-        }
-
-	for (TInt i = 0; i < KDeviceRowLayoutTableSize; i++)
-	    {
-	    if ( ( aDevice->DeviceClass().MajorDeviceClass() == KDeviceRowLayoutTable[i].iMajorDevClass ) &&
-	        ( (aDevice->DeviceClass().MinorDeviceClass() == KDeviceRowLayoutTable[i].iMinorDevClass ) ||
-	                KDeviceRowLayoutTable[i].iMinorDevClass == 0 ) )
-            {
-            iconIndex = KDeviceRowLayoutTable[i].iIconIndex;
-            defNameIndex = KDeviceRowLayoutTable[i].iDefaultNameIndex;
-            break;
-            }
-	    }
-    
-	if ( !aDevice->IsValidFriendlyName() && !aDevice->IsValidDeviceName() )
-		{
-        BtNotifNameUtils::SetDeviceNameL(iDefaultDeviceNamesArray->MdcaPoint(defNameIndex), *aDevice);
-		}
-
-	//Convert device name to Unocode for display
-	if ( aDevice->IsValidFriendlyName() )
-		{
-        formatString->Des().Copy( aDevice->FriendlyName() );
-		}
-	else 
-		{
-		formatString->Des().Copy( BTDeviceNameConverter::ToUnicodeL(aDevice->DeviceName()));
-		}
-
-	TPtrC iconFormat (KDeviceIconFormatTable[iconIndex].iFormat);
-	
-    formatString->Des().Insert( 0, iconFormat );
-
-    if( aSignalStrength > 0)
-        {
-        if( aSignalStrength <= KMediumStrength )
-            {
-            formatString->Des().Append( TPtrC(KDeviceIconFormatTable[EDeviceIconRssiLow].iFormat ) );
-            }
-        else if( aSignalStrength <= KHighStrength )
-            {
-            formatString->Des().Append( TPtrC(KDeviceIconFormatTable[EDeviceIconRssiMed].iFormat ) );
-            }
-        else
-            {
-            formatString->Des().Append( TPtrC(KDeviceIconFormatTable[EDeviceIconRssiGood].iFormat ) );
-            }
-        }
-    
-    // If the device is paired, add paired icon to format list
-    // Paired device using JustWork file transfering mode is not shown as paired here. 
-    if( index >= 0 && IsUserAwarePaired ( aDevice->AsNamelessDevice() ) )
-        {
-        formatString->Des().Append( TPtrC(KDeviceIconFormatTable[EDeviceIconPaired].iFormat ) );
-        }
-    else
-    	{
-    	// if device is blocked, add blocked icon to format list
-    	
-    	TInt indexB = LookupFromDevicesArray(iLastUsedDevicesArray, aDevice );
-    	
-    	if ( indexB>=0 && iLastUsedDevicesArray->At( indexB )->GlobalSecurity().Banned())
-    		{
-        	formatString->Des().Append( TPtrC(KDeviceIconFormatTable[EDeviceIconBlocked].iFormat ) );
-    		}
-    	}
-
-    // Add device format string into device items
-    //
-    TInt deviceCount = iDeviceListRows->Count();
-	iDeviceListRows->InsertL( deviceCount, *formatString );      
-    CleanupStack::PopAndDestroy();  // formatString
-	
-    TInt currentItemIndex = 0;
-	if(deviceCount != 0 && iDeviceListBox)
-		{
-	 	// Store temporarily the highlighted device and destroy list box
-	    //
-	    currentItemIndex = iDeviceListBox->CurrentItemIndex();		
-		}
-
-    if( iDeviceListBox )
-        {
-        iDeviceListBox->HandleItemAdditionL();
-        
-		if(deviceCount != 0 )	
-			{        
-			//set highligh back to user selected one.       
-			iDeviceListBox->SetCurrentItemIndex(currentItemIndex); 
-			}
-
-		// Adjust top item index in order to "scroll up" the list. 
-		// If current highlight device is not the top one and the listbox's visible slots are full(at least 5 devices are listed), 
-		// to make the newly discovered device visible, the list needs to be scrolled up. 
-		//
-		TInt topIndex = iDeviceListBox->TopItemIndex();
-		deviceCount = iDeviceListRows->Count();
-		
-		if( (currentItemIndex != topIndex  && deviceCount > 5 ) && (currentItemIndex+1 < deviceCount ) )
-			{
-			iDeviceListBox->SetTopItemIndex( topIndex+1 ); //scroll up
-			}	     
-        }
-		
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::UpdateDeviceListL() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTInqUI::LookupFromDevicesArrayL
-// Check if the BT device is paired devices array
-// ----------------------------------------------------------
-//
-TInt CBTInqUI::LookupFromDevicesArray(const CBTDeviceArray* aDeviceArray, const CBTDevice* aDevice ) const
-    {
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::LookupFromDevicesArray()"));
-
-    __ASSERT_DEBUG( aDeviceArray, User::Panic(_L("BTNotifInqUI - aDeviceArray not created"), KErrNotFound ));
-
-    for( TInt index = 0; index < aDeviceArray->Count(); index++ )
-        {
-        // Try to find device by its address.
-        if ( aDeviceArray->At( index )->BDAddr() == aDevice->BDAddr() )
-            {
-            FTRACE(FPrint(_L("[BTNOTIF]\t CBTInqUI::LookupFromDevicesArrayL()idx %d"), index));
-            return index; // Return index to the device at array
-            }
-        }
-    return KErrNotFound;
-    }
-    
-// ----------------------------------------------------
-// CBTInqUI::CreateAndAppendIconL
-// ----------------------------------------------------
-void CBTInqUI::CreateAndAppendIconL( const TAknsItemID& aID,
-									 const TDesC& aFileName,
-									 const TInt aBitmapId,
-									 const TInt aMaskId,
-									 CAknIconArray* aIconList)
-    {
-	CGulIcon* icon = AknsUtils::CreateGulIconL(AknsUtils::SkinInstance(), aID, aFileName, aBitmapId, aMaskId);
-    
-    CleanupStack::PushL(icon);    
-	aIconList->AppendL( icon );
-    CleanupStack::Pop(); // icon
-	}
-
-// ---------------------------------------------------------
-// CBTInqUI::AdjustDeviceArrayL
-// Applend max 5 lately used non-paird devices plus all the 
-// paired devices to the input parameter by the order of 
-// the last used time stamp.
-// ---------------------------------------------------------
-//
-void CBTInqUI::AdjustDeviceArrayL(CBTDeviceArray* aDeviceArray)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::AdjustDeviceArrayL()"));
-
-    TInt lSize = iLastUsedDevicesArray->Count(); 
-    
-    if (lSize <= 0)
-        {
-        return;
-        }
-    
-    TInt pSize = iPairedDevicesArray->Count();   
-	TInt nonPairedUsedDevicesNumber = lSize - pSize;	
-    	
-    // Pickup 5 latest used devices (paired devices are excluded)
-    //   		    
-    TInt count(0);
- 
-    if (nonPairedUsedDevicesNumber <= KBTNotifNonPairedUsedDevicesMaxNumber)
-    	count = nonPairedUsedDevicesNumber;
-    else 
-    	count = KBTNotifNonPairedUsedDevicesMaxNumber;
-    
-	for(TInt i=0; i < count; i++ )
-		{
-	    TInt targetDeviceIndex = 0;
-	    	   	    
-	    //go through iLastUsedDevicesArray, compare each device's time stamp and, find the latest used one.
-	    for(TInt k=0; k < lSize; k++)
-	    	{
-		    if(iLastUsedDevicesArray->At(targetDeviceIndex)->Used() < iLastUsedDevicesArray->At(k)->Used())
-		    	{
-		    	targetDeviceIndex = k;
-		    	}
-	    	}
-	    	
-		//if result is not a paired device, add it to the adjuested device array.	    	
-	   	if( LookupFromDevicesArray(iPairedDevicesArray, iLastUsedDevicesArray->At(targetDeviceIndex)) == KErrNotFound )
-	   		{
-		    aDeviceArray->AppendL(iLastUsedDevicesArray->At(targetDeviceIndex)->CopyL()); 	  	   			   		
-	   		}
-	    //if result is a paired device, ignore this search round and step-back counter i to make sure this 
-	    //search round won't be count.
-		else
-	   		{
-	   		i--; 
-	   		}
-   		    
-	    //set the time stamp to -1, in order to ignore this device during next search round.
-	    iLastUsedDevicesArray->At(targetDeviceIndex)->SetUsed(-1);	    
-		}
-
-	// Add paired devices to the adjusted list(if paired device exist),
-	// by the order of last used time.
-	//
-    if(pSize > 0)
-    	{
-	    for( TInt i = 0; i < pSize; i++ )
-	        {
-	    	//count size in the beginning of each loop, since the size could grow,
-	    	//if new item has been appended in last loop round. 
-			TInt sSize = aDeviceArray->Count();
-	        
-	        TInt j = 0;
-	        for (; j < sSize ; j++)
-	            {
-	            //check if this paired device alreay on the list jump out this loop
-	            if (iPairedDevicesArray->At(i)->BDAddr() == aDeviceArray->At(j)->BDAddr())
-	            	{
-	                break;
-	                }
-	            
-	            // We do not add device still valid paired into list if iExcludePairedDevices is set.  
-	            if ( IsUserAwarePaired( iPairedDevicesArray->At(i)->AsNamelessDevice() ) &&
-	                    iExcludePairedDevices )
-	                {
-	                break;
-	                }
-	                
-	            //if this device is not on the list and it is used later then current comparing
-	            //device, insert the paired device to aDeviceArray at suitable position.
-				TTime pTime = iPairedDevicesArray->At(i)->Used();
-				TTime sTime = aDeviceArray->At(j)->Used();
-				
-	            if ( pTime > sTime)
-	            	{
-	                aDeviceArray->InsertL(j, iPairedDevicesArray->At(i)->CopyL());
-	                break;
-	                }
-	            }	            
-	            
-			//if this paired device is not on the sorted list(it is older then all the devices on the list),
-			//append it to the end of the list.
-	        if (j == sSize) 
-	            {
-							if ( iExcludePairedDevices )
-								 {                
-			            // Add device to list if device is not paired and iExcludePairedDevices is not set. 
-			            if ( !IsUserAwarePaired( iPairedDevicesArray->At(i)->AsNamelessDevice() ) )
-			                {                                      
-			                aDeviceArray->AppendL(iPairedDevicesArray->At(i)->CopyL());
-			                }			           
-	               }
-	            else
-	            	{
-	            	aDeviceArray->AppendL(iPairedDevicesArray->At(i)->CopyL());
-	            	}
-	            }	            
-	        }    	
-    	}
- 
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::AdjustDeviceArrayL()  Complete."));
-    }
-
-//----------------------------------------------------------
-// CBTInqUI::QueryUnblockDeviceL
-//----------------------------------------------------------
-TInt CBTInqUI::QueryUnblockDeviceL(CBTDevice* aDevice)
-	{
-	FLOG(_L("[BTNOTIF]\t CBTInqUI::QueryUnblockDeviceL()"));
-	RBuf stringholder;
-	stringholder.CleanupClosePushL();
-    TBTDeviceName name;
-    BtNotifNameUtils::GetDeviceDisplayName( name, aDevice );
-    BluetoothUiUtil::LoadResourceAndSubstringL( 
-            stringholder, R_BT_UNBLOCK_DEVICE, name, 0 );
-    TInt keypress(0);
-    keypress = iUiUtil->ShowQueryL( stringholder, R_BT_UNBLOCK_QUERY, 
-            ECmdBTnotifUnavailable, name, CAknQueryDialog::EConfirmationTone );
-    CleanupStack::PopAndDestroy();  // stringholder
-    FTRACE(FPrint(_L("[BTNOTIF]\t CBTInqUI::QueryUnblockDeviceL()  keypress= %d"),keypress));    
-
-	return keypress;
-	}
-
-// ----------------------------------------------------------
-// CBTInqUI::UnblockDevice
-// Unblock device by modifying registry
-//-----------------------------------------------------------
-//
-TInt CBTInqUI::UnblockDevice(TInt aIndex)
-    {
-    TInt returnValue = KErrNone;
-    TBTDeviceSecurity deviceSecuritySettings = iLastUsedDevicesArray->At(aIndex)->GlobalSecurity();
-    deviceSecuritySettings.SetBanned(EFalse);
-    iLastUsedDevicesArray->At(aIndex)->DeleteLinkKey();
-    //DeleteLinkKey() invalidates the LinkKey and IsPaired entries in Lisbon, so...       
-    iLastUsedDevicesArray->At(aIndex)->SetGlobalSecurity(deviceSecuritySettings);
-    returnValue = iDevMan->ModifyDevice(*iLastUsedDevicesArray->At(aIndex));
-    if (!returnValue)
-        {
-        iBTRegistryQueryState = ESetDeviceUnblocked;
-        }
-    return returnValue;
-    }
-
-// ---------------------------------------------------------
-// CBTInqUI::HandleDevManComplete
-// CBTEngDevMan callback
-// ---------------------------------------------------------
-//
-void CBTInqUI::HandleDevManComplete(TInt aErr)
-	{
-	FTRACE(FPrint(_L("[BTNOTIF]\t CBTInqUI::HandleDevManComplete()  aErr= %d"),aErr));
-	
-	switch(iBTRegistryQueryState)
-		{	
-		case ESetDeviceUnblocked:
-		    FTRACE(FPrint(_L("[BTNOTIF]\t CBTInqUI::HandleDevManComplete() EModifyDevice")));  
-		    iDevSearchObserver->NotifyDeviceSearchCompleted(aErr, iDevParams);
-		    break;
-		}
-
-	FTRACE(FPrint(_L("[BTNOTIF]\t CBTInqUI::HandleDevManComplete()  complete")));
-	}
-		
-//----------------------------------------------------------------
-// CBTInqUI: DeviceSearchFilter
-//----------------------------------------------------------------
-void CBTInqUI::SelectSearchCategoryL()
-	{
-	FLOG(_L("[BTNOTIF]\t CBTInqUI::SelectSearchCategoryL()"));
-	
-	if( !(iDesiredDeviceClass == TBTDeviceClass(0)) )
-	    {
-	    // Notifier caller passed specified COD to search device, not need to show filter query.
-        DeviceSearchUiL();
-        FLOG(_L("[BTNOTIF]\t CBTInqUI::SelectSearchCategoryL() complete: not show filter query"));
-        return;
-	    }
-	// Create listbox for devices
-    //
-    CEikTextListBox* searchFilterListBox = new(ELeave) CAknSinglePopupMenuStyleListBox;
-	CleanupStack::PushL(searchFilterListBox);
-
-    // Create popup list    
-    //
-	iSearchFilterPopupList = CAknPopupList::NewL(
-        searchFilterListBox,
-        R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT,
-        AknPopupLayouts::EDynMenuWindow );
-
-    searchFilterListBox->ConstructL(iSearchFilterPopupList, EAknListBoxMenuList );
-    searchFilterListBox->CreateScrollBarFrameL(ETrue);
-    searchFilterListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
-        CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
-
-    // Read title from resources
-    //
-    HBufC* popupListTitle = iEikonEnvRef.AllocReadResourceLC( R_BT_SEARCH_FILTER_POPUP_TITLE );
-    iSearchFilterPopupList->SetTitleL(*popupListTitle);
-    CleanupStack::PopAndDestroy(); // popupListTitle
-
-	// reuse iDeviceListRows for serch filter items
-	iDeviceListRows->Reset();
-
-    // Create list box model for devices
-    //
-    
-    CTextListBoxModel* model = searchFilterListBox->Model();
-    model->SetItemTextArray(iDeviceListRows);
-    model->SetOwnershipType(ELbmDoesNotOwnItemArray);  // Do not destroy items
-    
-    
-	// Add itms of filter to popuplist
-    // Order must be same as in enum EBTSerchFilterItem
-    //
-    
-    AddItemToSearchFilterL(R_BT_SEARCH_FOR_ALL); 
-    AddItemToSearchFilterL(R_BT_SEARCH_FOR_AUDIO);
-    AddItemToSearchFilterL(R_BT_SEARCH_FOR_PHONE);
-    AddItemToSearchFilterL(R_BT_SEARCH_FOR_COMPUTER);
-    AddItemToSearchFilterL(R_BT_SEARCH_FOR_INPUT);
-
-    // Launch popup list and wait for user input, disable other Ui key presses first:
-    AllowDialerAndAppKeyPress( EFalse );
-    // After input, destroy popup list
-    //
-    TInt popupRetVal = iSearchFilterPopupList->ExecuteLD(); 
-    iSearchFilterPopupList = NULL;
-    AllowDialerAndAppKeyPress( ETrue );
-
-    if( popupRetVal )
-        {
-        TInt currentDeviceIndex = searchFilterListBox->CurrentItemIndex();
-		switch(currentDeviceIndex)
-			{
-			case EBTSearchForAll:				
-				iDesiredDeviceClass = TBTDeviceClass(0,0,0);  				
-				break;
-			case EBTSearchForAudio:
-				iDesiredDeviceClass = TBTDeviceClass(0,EMajorDeviceAV,0);					
-				break;
-				 
-			case EBTSearchForPhone:	
-				iDesiredDeviceClass = TBTDeviceClass(0,EMajorDevicePhone,0);					
-				break;	 
-				
-			case EBTSearchForComputer:					
-				iDesiredDeviceClass = TBTDeviceClass(0,EMajorDeviceComputer,0);
-				break;
-				 	 
-			case EBTSearchForInput:
-				iDesiredDeviceClass = TBTDeviceClass(0,EMajorDevicePeripheral,0);
-				break;	 
-				 			
-			default:                    
-				break;
-			}
-        } 
-
-	CleanupStack::PopAndDestroy(); //searchFilterListBox 
-	iDeviceListRows->Reset();
-
-    if( !popupRetVal )
-        {
-        iDevSearchObserver->NotifyDeviceSearchCompleted(KErrCancel);
-        }
-    else
-        {
-        DeviceSearchUiL();
-        }
-    
-	FLOG(_L("[BTNOTIF]\t CBTInqUI::SelectSearchCategoryL() complete"));
-	}
-   
-//------------------------------------------------------------------------------
-// CBTInqUI: AddItemToSearchFilterL
-//------------------------------------------------------------------------------
-void CBTInqUI::AddItemToSearchFilterL ( TInt aResourceId )
-	{
-	HBufC* formatString = HBufC::NewLC( KBTAllPurposeBufferLength );
-    HBufC* string = iEikonEnvRef.AllocReadResourceLC( aResourceId );
-    formatString->Des().Append( *string );
-    CleanupStack::PopAndDestroy(); // string
-    iDeviceListRows->AppendL( *formatString );
-    CleanupStack::Pop(); // formatString
-	}
-
-void CBTInqUI::GetColorIconL( TFileName& aFilename, TAknsItemID aItemID, 
-                        TInt aPic, TInt aPicmask, CAknIconArray* aIconList )
-    {
-    CFbsBitmap* bitmap = NULL;
-    CFbsBitmap* mask = NULL;
-    
-    AknsUtils::CreateColorIconLC(AknsUtils::SkinInstance(), aItemID,
-                                KAknsIIDQsnIconColors,
-                                EAknsCIQsnIconColorsCG13,
-                                bitmap, mask, aFilename, aPic, aPicmask, KRgbBlack);
-    
-    CGulIcon* icon = CGulIcon::NewL(bitmap, mask);
-    CleanupStack::Pop(2); // bitmap, mask;
-    CleanupStack::PushL(icon);    
-    aIconList->AppendL( icon );
-    CleanupStack::Pop(); // icon
-    }
-
-TBool CBTInqUI::IsActiveVoIPOverWLAN()
-    {
-    TInt error = KErrNone;
-    
-    // check VoIP over WLAN is on going or not:
-    //
-    TInt wlanStatus = 0;
-    error = RProperty::Get(KPSUidWlan, KPSWlanIndicator, wlanStatus);                       
-    FTRACE( FPrint( _L( "CBTInqNotifier::CheckActivationOfVoIPOverWLAN() WLAN state: %d (error %d)" ), wlanStatus, error ) );
-    if (error)
-        {
-        return EFalse;
-        }
-
-    TInt callState = 0;
-    error = RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallType, callState ); 
-    FTRACE( FPrint( _L( "CBTInqNotifier::CheckActivationOfVoIPOverWLAN() call state: %d (error %d)" ), callState, error ) );
-    if( error == KErrNone &&
-      (wlanStatus == EPSWlanIndicatorActive || wlanStatus == EPSWlanIndicatorActiveSecure)&&
-      callState == EPSCTsyCallTypeVoIP )
-        {
-        FTRACE( FPrint( _L( " VoIP call ongoing, do not allow inquiry!" ) ) );
-        return ETrue;
-        }
-    return EFalse;
-    }
-
-void CBTInqUI::DoDeviceFrontListSelection()
-    {
-    TRAPD(err, DisplayDevicesFrontListL());
-    if (err)
-        {
-        iDevSearchObserver->NotifyDeviceSearchCompleted(err);
-        }
-    }
-
-void CBTInqUI::HandleDeviceSelectionL(CBTDevice* aDev)
-    {
-    iDevParams = TBTDeviceResponseParams();
-    iDevParams.SetDeviceAddress( aDev->BDAddr());
-    iDevParams.SetDeviceClass( aDev->DeviceClass());
-    if( aDev->IsValidFriendlyName())
-        {
-        iDevParams.SetDeviceName( aDev->FriendlyName());
-        }
-    else if( aDev->IsValidDeviceName())
-        {
-        iDevParams.SetDeviceName( BTDeviceNameConverter::ToUnicodeL( aDev->DeviceName() ) );
-        }
-    //check if this device is blocked
-    TInt index = LookupFromDevicesArray(iLastUsedDevicesArray, aDev);
-    TBool blocked = ( index >= 0 && iLastUsedDevicesArray->At( index )->GlobalSecurity().Banned() );
-    if (!blocked)
-        {
-        iDevSearchObserver->NotifyDeviceSearchCompleted(KErrNone, iDevParams);
-        return;
-        }
-
-    TInt toUnblk = QueryUnblockDeviceL(aDev);
-    if (!toUnblk)
-        {
-        iDevSearchObserver->NotifyDeviceSearchCompleted(KErrCancel);
-        return;
-        }
-    TInt err = UnblockDevice( index );
-    if (err)
-        {
-        iDevSearchObserver->NotifyDeviceSearchCompleted(err);
-        }  
-    // otherwise NotifyDeviceSearchCompleted will be called after unblock is really done.
-    }
-
-void CBTInqUI::AllowDialerAndAppKeyPress( TBool aAllow )
-    {
-    CEikAppUi* const eikAppUi = CEikonEnv::Static()->EikAppUi();
-    if ( aAllow)
-        {
-        // Enable dialer
-        static_cast<CAknAppUi*>( eikAppUi )->SetKeyEventFlags( 0x00 );     
-        // Activate apps key.
-        // Ignore the return error code as we can do nothing if this operation fails
-        (void) static_cast<CAknNotifierAppServerAppUi*>(eikAppUi)->SuppressAppSwitching(EFalse);         
-        }
-    else
-        {
-        // Disable dialer
-        static_cast<CAknAppUi*>( eikAppUi )->SetKeyEventFlags( CAknAppUiBase::EDisableSendKeyShort | 
-                CAknAppUiBase::EDisableSendKeyLong);
-        // Deactivate apps key
-        (void) static_cast<CAknNotifierAppServerAppUi*>(eikAppUi)->SuppressAppSwitching(ETrue); 
-        }
-    FTRACE( FPrint( _L( "CBTInqUI::AllowDialerAndAppKeyPress : %d" ), aAllow ) );
-    }
-
-// End of File
--- a/bluetoothengine/btnotif/src/BTNInquiAO.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,239 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Part of CBTInqUI class: use Active object to search BT devices.
-*
-*/
-#include "btninqui.h"
-#include "btNotifDebug.h"
-
-/**  Identification for active object request */
-const TInt KBTNotifInquiryNotifierReq = 20;
-
-// ----------------------------------------------------------
-// CBTInqUI::PrepareScannerL
-// ----------------------------------------------------------
-//
-void CBTInqUI::CreateScannerL()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::CreateScannerL()"));
-    
-    __ASSERT_DEBUG( iScanner == NULL, User::Panic(_L("BTNotifInqUI - iScanner not released!"),KErrAlreadyExists));
-        
-    // Create scanner object which will do the actual search
-    iScanner = CBTNotifActive::NewL( this, KBTNotifInquiryNotifierReq, CActive::EPriorityStandard );
-    User::LeaveIfError( iSocketServer.Connect() );
-    TProtocolDesc pInfo;
-    User::LeaveIfError( iSocketServer.FindProtocol( _L("BTLinkManager"), pInfo));
-    User::LeaveIfError( iHostResolver.Open(iSocketServer, pInfo.iAddrFamily, pInfo.iProtocol));
-    IssueRequestL();
-
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::CreateScannerL() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTInqUI::IssueRequestL
-// Issue Bluetooth device inquiry/search itself.
-// Reads also inquiry mode from shared data.
-// ----------------------------------------------------------
-//
-void CBTInqUI::IssueRequestL()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::IssueRequestL()"));
-    
-    TUint action = 0; 
-    if( !iPageForName )
-        {
-        action = KHostResInquiry + KHostResEir + KHostResIgnoreCache;
-        }
-    else
-        {
-        if( iIndex < iDevsWithoutName.Count() )
-            {
-            action = KHostResName + KHostResIgnoreCache;
-            TInquirySockAddr& sa = TInquirySockAddr::Cast( iDevsWithoutName[iIndex].iAddr );
-            iInquirySockAddr.SetBTAddr( sa.BTAddr() );            
-            }
-        }
-    if (action)
-        {
-        iInquirySockAddr.SetAction( action ); 
-        iInquirySockAddr.SetIAC(KGIAC);
-        iHostResolver.GetByAddress( iInquirySockAddr, iEntry, iScanner->RequestStatus() );
-        iScanner->GoActive();
-        }
-    else
-        {
-        FLOG(_L("[BTNOTIF]\t CBTInqUI::RunL() All name inquiries complete ."));
-        iPageForName = EFalse;
-        iIndex = 0;
-        InquiryComplete( KErrNone );
-        }
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::IssueRequestL() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTInqUI::RequestCompletedL
-// BT-device or timeout has been received. Inform caller for
-// received device and issue next EIR/Name request.
-// ----------------------------------------------------------
-//
-void CBTInqUI::RequestCompletedL( CBTNotifActive* aActive, TInt aId, TInt aStatus )
-    {
-    FTRACE(FPrint(_L("[BTNOTIF]\t CBTInqUI::RequestCompletedL() status: %d >>"), aStatus ));
-    ASSERT( aId == KBTNotifInquiryNotifierReq);
-    (void) aActive;
-    
-    if( aStatus == KErrNone )
-        {
-        if( iPageForName )
-            {
-            HandleFoundNameL();
-            iIndex++;
-            IssueRequestL();
-            }
-        else
-            {
-            HandleInquiryDeviceL();
-            iHostResolver.Next( iEntry, iScanner->RequestStatus() );
-            iScanner->GoActive();
-            }
-        }
-    else if( aStatus == (KHCIErrorBase - EPageTimedOut) && iPageForName )
-        {
-        FLOG(_L("[BTNOTIF]\t CBTInqUI::RequestCompletedL() HCI:EPageTimeOut, page next one."));
-        iIndex++;
-        IssueRequestL();
-        }
-    else
-        {
-        if( !iPageForName && iDevsWithoutName.Count()>0 )
-            {
-            FTRACE(FPrint(_L("[BTNOTIF]\t CBTInqUI::RequestCompletedL() nameless devices %d, paging for name."), 
-                    iDevsWithoutName.Count() ));
-            iIndex = 0;
-            iPageForName = ETrue;
-            IssueRequestL();
-            }
-        else
-            {
-            FLOG(_L("[BTNOTIF]\t CBTInqUI::RequestCompletedL() NameInquiryComplete with error or no device found."));
-            HandleError( aActive, aId, aStatus );
-            }
-        }
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::RequestCompletedL() <<"));
-    }
-
-// ----------------------------------------------------------
-// CBTInqUI::HandleError
-// Inform UI from error occured.
-// ----------------------------------------------------------
-//
-void CBTInqUI::HandleError( CBTNotifActive* aActive, TInt aId, TInt aError )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::HandleError()"));
-    (void) aActive;
-    (void) aId;
-    iPageForName = EFalse;
-    InquiryComplete( aError );
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::HandleError() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTInqUI::DoCancelRequest
-// ----------------------------------------------------------
-//
-void CBTInqUI::DoCancelRequest( CBTNotifActive* aActive, TInt aId )
-    {
-    (void) aActive;
-    (void) aId;
-    iHostResolver.Cancel();
-    }
-	
-// ----------------------------------------------------------
-// CBTInqUI::HandleInquiryDeviceL
-// Inform of properties of the found BTdevice,   
-// which passes the search filter. Its name would be retrived 
-// later if not contained by the first round of inquiry.   
-// ----------------------------------------------------------
-//
-void CBTInqUI::HandleInquiryDeviceL()
-    {
-    TInquirySockAddr& sa = TInquirySockAddr::Cast( iEntry().iAddr );
-    
-    if ( iDesiredDeviceClass.DeviceClass() == 0 || sa.MajorClassOfDevice() == iDesiredDeviceClass.MajorDeviceClass() )
-        {
-        FLOG(_L("[BTNOTIF]\t CBTInqUI::HandleInquiryDeviceL() The found device passes the search filter."));
-#ifdef _DEBUG
-    TBuf<12> devAddrString;
-    sa.BTAddr().GetReadable(devAddrString);
-    FTRACE(FPrint(_L("[BTNOTIF]\t BT Address: %S"), &devAddrString));
-#endif
-        TBTDeviceName devName;
-        TBool nameGotten = CheckEirDeviceName( iEntry, devName );
-        FTRACE(FPrint(_L("[BTNOTIF]\t CBTInqUI::HandleInquiryDeviceL() EIR device name? %d, %S"), nameGotten, &devName ));
-        if( nameGotten )
-            {
-            DeviceAvailableL( iEntry(), devName );
-            }
-        else
-            {
-            iDevsWithoutName.Append( iEntry() );
-            }
-        }
-    }
-
-// ----------------------------------------------------------
-// CBTInqUI::HandleFoundNameL
-// Inform of retrieved device name after 2nd inquiry.  
-// ----------------------------------------------------------
-//
-void CBTInqUI::HandleFoundNameL()
-    {
-#ifdef _DEBUG
-    TBuf<12> devAddrString;
-    TInquirySockAddr& sa = TInquirySockAddr::Cast( iEntry().iAddr );
-    sa.BTAddr().GetReadable(devAddrString);
-    FTRACE(FPrint(_L("[BTNOTIF]\t CBTInqUI::HandleFoundNameL() BT Address: %S"), &devAddrString));
-#endif
-    if( iEntry().iName != KNullDesC )
-        {
-        FTRACE(FPrint(_L("[BTNOTIF]\t CBTInqUI::HandleFoundNameL() Name found: %S"), &(iEntry().iName) ));
-
-        DeviceAvailableL( iDevsWithoutName[iIndex], iEntry().iName );
-        }
-    
-    FLOG(_L("[BTNOTIF]\t CBTInqUI::HandleFoundNameL() Complete"));
-    }
-
-// ----------------------------------------------------------
-// CBTInqUI::CheckEirDeviceName
-// Check if the retrieved the device info contains device name.  
-// ----------------------------------------------------------
-//
-TBool CBTInqUI::CheckEirDeviceName( TNameEntry& aEntry, TBTDeviceName& aName )
-    {
-    TBluetoothNameRecordWrapper eir( aEntry() );
-    TInt length = eir.GetDeviceNameLength();
-    
-    TBool isComplete( EFalse );
-    TInt err( KErrNone );
-        
-    if( length > 0 )
-        {            
-        err = eir.GetDeviceName( aName, isComplete);
-        return (!err);
-        }
-    return EFalse;
-    }
-// End of File
--- a/bluetoothengine/btnotif/src/BTNMain.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Methods for BT notifier
-*
-*/
-
-
-// INCLUDE FILES
-
-#include <eikenv.h>
-
-#include "btnauthnotifier.h"            // All notifiers
-#include "btnpinnotifier.h"
-#include "btninqnotifier.h"
-#include "btnobexpinnotifier.h"
-#include "btnpwrnotifier.h"
-#include "btNotifDebug.h"
-#include "BTNGenericInfoNotifier.h"   
-#include "BTNGenericQueryNotifier.h"   
-#include "btnpbappinnotifier.h"
-#include "btnpaireddevsettnotifier.h"
-#include "btnssppasskeyentrynotifier.h"
-#include "btnumcmpnotifier.h"
-#include "btuserconfnotifier.h"
-#include "btnenterpriseitsecurityinfonotifier.h"
-
-// CONSTANTS
-const TInt KBTNotifierArrayIncrement = 8;
-
-
-// ================= EXPORTED FUNCTIONS ====================
-
-// ---------------------------------------------------------
-//
-// Instantiate notifiers
-//
-// ---------------------------------------------------------
-
-LOCAL_C void CreateBTNotifiersL( CArrayPtrFlat<MEikSrvNotifierBase2>* aNotifiers )
-    {
-    FLOG(_L("[BTNOTIF]\t CreateBTNotifiersL"));
-
-    CBTInqNotifier* inquiryNotifier = CBTInqNotifier::NewL();
-    CleanupStack::PushL( inquiryNotifier );
-    aNotifiers->AppendL( inquiryNotifier );
-    CleanupStack::Pop( inquiryNotifier );
-
-    CBTPinNotifier* pinNotifier = CBTPinNotifier::NewL();
-    CleanupStack::PushL( pinNotifier );
-    aNotifiers->AppendL( pinNotifier );
-    CleanupStack::Pop( pinNotifier );
-
-    CBTAuthNotifier* authNotifier = CBTAuthNotifier::NewL();
-    CleanupStack::PushL( authNotifier );
-    aNotifiers->AppendL( authNotifier );
-    CleanupStack::Pop( authNotifier );
-
-    CBTObexPinNotifier* obexNotifier = CBTObexPinNotifier::NewL();
-    CleanupStack::PushL( obexNotifier );
-    aNotifiers->AppendL( obexNotifier );
-    CleanupStack::Pop( obexNotifier );
-
-    CBTPwrNotifier* pwrNotifier = CBTPwrNotifier::NewL();
-    CleanupStack::PushL( pwrNotifier );
-    aNotifiers->AppendL( pwrNotifier );
-    CleanupStack::Pop( pwrNotifier );
-	
-	CBTGenericInfoNotifier* infoNotifier = CBTGenericInfoNotifier::NewL();
-	CleanupStack::PushL( infoNotifier );
-	aNotifiers->AppendL( infoNotifier );
-	CleanupStack::Pop( infoNotifier );
-
-	CBTGenericQueryNotifier* queryNotifier = CBTGenericQueryNotifier::NewL();
-	CleanupStack::PushL( queryNotifier );
-	aNotifiers->AppendL( queryNotifier );
-	CleanupStack::Pop( queryNotifier );
-	
-    CBTPBAPPinNotifier* pbapNotifier = CBTPBAPPinNotifier::NewL();
-    CleanupStack::PushL( pbapNotifier );
-    aNotifiers->AppendL( pbapNotifier );
-    CleanupStack::Pop( pbapNotifier );
-
-    CBTPairedDevSettNotifier* pdsNotifier = CBTPairedDevSettNotifier::NewL();
-    CleanupStack::PushL( pdsNotifier );
-    aNotifiers->AppendL( pdsNotifier );
-    CleanupStack::Pop( pdsNotifier );
-
-    CBTSSPPasskeyEntryNotifier* sspPinNotifier = CBTSSPPasskeyEntryNotifier::NewL();
-    CleanupStack::PushL( sspPinNotifier );
-    aNotifiers->AppendL( sspPinNotifier );
-    CleanupStack::Pop( sspPinNotifier );
-
-    CBTNumCmpNotifier* numCmpNotifier = CBTNumCmpNotifier::NewL();
-    CleanupStack::PushL(numCmpNotifier);
-    aNotifiers->AppendL( numCmpNotifier );
-    CleanupStack::Pop( numCmpNotifier );
-
-    CBTUserConfNotifier* userConfNotifier = CBTUserConfNotifier::NewL();
-    CleanupStack::PushL(userConfNotifier);
-    aNotifiers->AppendL( userConfNotifier );
-    CleanupStack::Pop( userConfNotifier );
-
-    
-    CBTEnterpriseItSecurityInfoNotifier* enterpriseItSecurityNotifier = CBTEnterpriseItSecurityInfoNotifier::NewL();
-    CleanupStack::PushL(enterpriseItSecurityNotifier);
-    aNotifiers->AppendL(enterpriseItSecurityNotifier);
-    CleanupStack::Pop(enterpriseItSecurityNotifier);
-    
-    FLOG(_L("[BTNOTIF]\t CreateBTNotifiersL completed"));
-    }
-
-// ---------------------------------------------------------
-//
-// Lib main entry point: Creates a notifiers array.
-//
-// ---------------------------------------------------------
-
-EXPORT_C CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
-    {
-    FLOG(_L("[BTNOTIF]\t NotifierArray"));
-    
-    CArrayPtrFlat<MEikSrvNotifierBase2>* notifiers = NULL;
-
-	notifiers = 
-	           new CArrayPtrFlat<MEikSrvNotifierBase2>( KBTNotifierArrayIncrement );
-    if( notifiers )
-        {
-        TRAPD( err, CreateBTNotifiersL( notifiers ));
-        if( err )
-            {
-            FTRACE(FPrint(_L("[BTNOTIF]\t Notifier creation failure! Error code: %d"), err));
-            TInt count = notifiers->Count();
-            while(count--)
-                (*notifiers)[count]->Release();
-            delete notifiers;
-            notifiers = NULL;
-            }
-            
-        FLOG(_L("[BTNOTIF]\t NotifierArray completed"));
-        }
-    return notifiers;
-    }
-
-
-//  End of File
-
-
-
--- a/bluetoothengine/btnotif/src/BTNObexPinNotifier.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 OBEX PIN query notifier class.
-*
-*/
-
-
-// INCLUDE FILES
-#include <utf.h>                // Unicode character conversion utilities
-
-#include <BTNotif.rsg>          // Own resources
-#include "btnobexpinnotifier.h" // Own class definition
-#include "btNotifDebug.h"       // Debugging macros
-
-#include <secondarydisplay/BTnotifSecondaryDisplayAPI.h>
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------------
-// CBTObexPinNotifier::NewL
-// Two-phased constructor.
-// ----------------------------------------------------------
-//
-CBTObexPinNotifier* CBTObexPinNotifier::NewL()
-    {
-    CBTObexPinNotifier* self=new (ELeave) CBTObexPinNotifier();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-
-// ----------------------------------------------------------
-// CBTObexPinNotifier::CBTObexPinNotifier
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// ----------------------------------------------------------
-//
-CBTObexPinNotifier::CBTObexPinNotifier()
-    {
-    }
-
-// ----------------------------------------------------------
-// Destructor
-// ----------------------------------------------------------
-//
-CBTObexPinNotifier::~CBTObexPinNotifier()
-    {
-    }
-
-// ----------------------------------------------------------
-// CBTObexPinNotifier::RegisterL
-// ----------------------------------------------------------
-//
-CBTObexPinNotifier::TNotifierInfo CBTObexPinNotifier::RegisterL()
-    {
-    iInfo.iUid=KBTObexPasskeyQueryNotifierUid;
-    iInfo.iChannel=KBTObexPINChannel;
-    iInfo.iPriority=ENotifierPriorityVHigh;
-    return iInfo;
-    }
-
-// ----------------------------------------------------------
-// CBTObexPinNotifier::GetParamsL
-// Initialize parameters. Jump to RunL as soon as possible.
-// ----------------------------------------------------------
-//
-void CBTObexPinNotifier::GetParamsL(const TDesC8& /* aBuffer */, TInt aReplySlot, const RMessagePtr2& aMessage)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTObexPinNotifier::GetParamsL()"));
-
-    if( !iMessage.IsNull())
-        {
-        User::Leave(KErrInUse);
-        }
-
-    iMessage = aMessage;
-    iReplySlot = aReplySlot;
-
-    if ( AutoLockOnL() )
-        {
-        // The phone is locked, access denied.
-        //
-        CompleteMessage(KErrCancel);
-        return;
-        }
- 
-    ShowNoteCompleteMessageL();
-
-    FLOG(_L("[BTNOTIF]\t CBTObexPinNotifier::GetParamsL() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTObexPinNotifier::ShowNoteCompleteMessageL
-// Ask user response and return it to caller.
-// ----------------------------------------------------------
-//
-void CBTObexPinNotifier::ShowNoteCompleteMessageL()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTObexPinNotifier::ShowNoteCompleteMessageL()"));
-
-    TBuf<KBTObexPasskeyMaxLength> tempPasskeyBuffer;    // Unicode buffer
-
-    TInt keypress = iNotifUiUtil->ShowTextInputQueryL( tempPasskeyBuffer, 
-            R_BT_OBEX_PASSKEY_QUERY, ECmdShowBtOpenCoverNote );
-		
-    if( keypress ) // OK pressed
-        {
-        // Convert data from unicode to 8 bit and write it back to caller
-        //
-        TBTObexPasskey obexPasskey;
-        obexPasskey.Zero();
-        CnvUtfConverter::ConvertFromUnicodeToUtf8(obexPasskey, tempPasskeyBuffer);
-        CompleteMessage(TPckgBuf<TBTObexPasskey>(obexPasskey), KErrNone);
-        }
-    else  // Cancel pressed
-        {
-        CompleteMessage(KErrCancel);
-        }	
-
-    FLOG(_L("[BTNOTIF]\t CBTObexPinNotifier::ShowNoteCompleteMessageL() completed"));
-    }
-
-
-// End of File
--- a/bluetoothengine/btnotif/src/BTNPBAPPinNotifier.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 PBAP PIN query notifier class.
-*
-*/
-
-
-// INCLUDE FILES
-#include <StringLoader.h>       // Localisation stringloader
-#include <utf.h>                // Unicode character conversion utilities
-
-#include <BTNotif.rsg>          // own resources
-#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
-#include <btextnotifiers.h>
-#else
-#include <btextnotifiers.h>
-#include <btextnotifierspartner.h>
-#endif
-
-#include "btnpbappinnotifier.h" // own class definition
-#include "btNotifDebug.h"       // debugging macros
-
-#include <secondarydisplay/BTnotifSecondaryDisplayAPI.h>
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------------
-// CBTObexPinNotifier::NewL
-// Two-phased constructor.
-// ----------------------------------------------------------
-//
-CBTPBAPPinNotifier* CBTPBAPPinNotifier::NewL()
-    {
-    CBTPBAPPinNotifier* self=new (ELeave) CBTPBAPPinNotifier();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-
-// ----------------------------------------------------------
-// CBTObexPinNotifier::CBTObexPinNotifier
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// ----------------------------------------------------------
-//
-CBTPBAPPinNotifier::CBTPBAPPinNotifier()
-    {
-    }
-
-// ----------------------------------------------------------
-// Destructor
-// ----------------------------------------------------------
-//
-CBTPBAPPinNotifier::~CBTPBAPPinNotifier()
-    {
-    }
-
-// ----------------------------------------------------------
-// CBTPBAPPinNotifier::RegisterL
-// ----------------------------------------------------------
-//
-CBTPBAPPinNotifier::TNotifierInfo CBTPBAPPinNotifier::RegisterL()
-    {
-    iInfo.iUid=KPbapAuthNotifierUid;
-    iInfo.iChannel=KBTObexPINChannel;
-    iInfo.iPriority=ENotifierPriorityVHigh;
-    return iInfo;
-    }
-
-// ----------------------------------------------------------
-// CBTPBAPPinNotifier::GetParamsL
-// Initialize parameters. Jump to RunL as soon as possible.
-// ----------------------------------------------------------
-//
-void CBTPBAPPinNotifier::GetParamsL(const TDesC8& /* aBuffer */, TInt aReplySlot, const RMessagePtr2& aMessage)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTPBAPPinNotifier::GetParamsL()"));
-
-    if( !iMessage.IsNull())
-        {
-        User::Leave(KErrInUse);
-        }
-    
-    iMessage = aMessage;
-    iReplySlot = aReplySlot;
-    
-    if ( AutoLockOnL() )
-        {
-        // The phone is locked, access denied.
-        //
-        CompleteMessage(KErrCancel);
-        return;
-        }
-
-    ShowNoteCompleteMessageL();
-
-    FLOG(_L("[BTNOTIF]\t CBTPBAPPinNotifier::GetParamsL() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTPBAPPinNotifier::ShowNoteCompleteMessageL
-// Ask user response and return it to caller.
-// ----------------------------------------------------------
-//
-void CBTPBAPPinNotifier::ShowNoteCompleteMessageL()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTPBAPPinNotifier::ShowNoteCompleteMessageL()"));
-
-    TBuf<KBTObexPasskeyMaxLength> pbapPasskey;    // Unicode buffer
-		
-    TInt keypress = iNotifUiUtil->ShowTextInputQueryL( pbapPasskey, 
-            R_BT_OBEX_PASSKEY_QUERY, ECmdShowBtOpenCoverNote );
-	
-    if( keypress ) // OK pressed
-        {        
-        TPbapAuthNotifierResponsePckg  pbapPasskeyResponse;
-        pbapPasskeyResponse().SetPassword(pbapPasskey);        
-        CompleteMessage(pbapPasskeyResponse, KErrNone);
-        }
-    else  // Cancel pressed
-        {
-        CompleteMessage(KErrCancel);
-        }
-
-    FLOG(_L("[BTNOTIF]\t CBTPBAPPinNotifier::ShowNoteCompleteMessageL() completed"));
-    }
-
-// End of File
--- a/bluetoothengine/btnotif/src/BTNPinNotifier.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,281 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 authentication (PIN query) notifier class.
-*
-*/
-
-
-// INCLUDE FILES
-#include <StringLoader.h>    // Localisation stringloader
-#include <utf.h>             // Unicode character conversion utilities
-#include <avkon.mbg>
-#include <btengconnman.h>
-#include <btotgpairpub.inl>
-#include <btextnotifiers.h>
-#include <BTNotif.rsg>       // Own resources
-#include <bluetoothuiutil.h>
-#include "btnotif.hrh"       // Own resource header
-#include "btnpinnotifier.h"  // Own class definition
-#include "btNotifDebug.h"    // Debugging macros
-#include "btnotifnameutils.h"
-
-#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
-#include <btextnotifiers.h>
-#else
-#include <btextnotifiers.h>
-#include <btextnotifierspartner.h>
-#endif
-
-#include <secondarydisplay/BTnotifSecondaryDisplayAPI.h>
-
-#ifdef __SERIES60_HELP
-#include <hlplch.h>
-#include <csxhelp/bt.hlp.hrh> // The bt hrh info is needed, for help launching
-#endif
-const TInt KDefaultPinCodeLength=4;
-const TUint8 KZeroPinValue = '0';
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------------
-// CBTPinNotifier::NewL
-// Two-phased constructor.
-// ----------------------------------------------------------
-//
-CBTPinNotifier* CBTPinNotifier::NewL()
-    {
-    CBTPinNotifier* self=new (ELeave) CBTPinNotifier();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-// ----------------------------------------------------------
-// CBTPinNotifier::CBTPinNotifier
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// ----------------------------------------------------------
-//
-CBTPinNotifier::CBTPinNotifier()
-    {    
-    }
-
-// ----------------------------------------------------------
-// Destructor
-// ----------------------------------------------------------
-//
-CBTPinNotifier::~CBTPinNotifier()
-    {
-    }
-
-// ----------------------------------------------------------
-// CBTPinNotifier::RegisterL
-// Register notifier.
-// ----------------------------------------------------------
-//
-CBTPinNotifier::TNotifierInfo CBTPinNotifier::RegisterL()
-    {
-    iInfo.iUid=KBTPinCodeEntryNotifierUid;
-    iInfo.iChannel=KBTAuthenticationChannel;
-    iInfo.iPriority=ENotifierPriorityVHigh;
-    return iInfo;
-    }
-
-// ----------------------------------------------------------
-// CBTPinNotifier::GetParamsL
-// Initialize parameters and check if device is already
-// in registry. Jump to RunL as soon as possible.
-// ----------------------------------------------------------
-//
-void CBTPinNotifier::GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTPinNotifier::GetParamsL() >>"));
-
-    CBTNPairNotifierBase::GetParamsL( aBuffer, aReplySlot, aMessage );
-
-    TBTPinCodeEntryNotifierParams param;
- 	TPckgC<TBTPinCodeEntryNotifierParams> pckg(param);
- 	pckg.Set(aBuffer);
-
-    iBTAddr = pckg().DeviceAddress();
-    if ( OtherOutgoPairing(iBTAddr) )
-        {
-        // We won't allow incoming pairing during outgoing pairing:
-        FLOG(_L("[BTNOTIF]\t CBTPinNotifier: outgoing pair in progress, reject incoming pair"));
-        CompleteMessage(KErrCancel);
-        return;
-        }
-
- 	iLocallyInitiated = pckg().LocallyInitiated();
-    iPasskeyLength = pckg().PinCodeMinLength();
-    iStrongPinRequired = pckg().StrongPinCodeRequired();
-    ProcessParamsGetDeviceL( iBTAddr, pckg().DeviceName() );
-    
-    FLOG(_L("[BTNOTIF]\t CBTPinNotifier::GetParamsL() <<"));
-    }
-
-// ----------------------------------------------------------
-// CBTPinNotifier::HandleGetDeviceCompletedL
-// Ask user response and return it to caller.
-// Store device into registry if user has accepted pairing.
-// ----------------------------------------------------------
-//
-void CBTPinNotifier::HandleGetDeviceCompletedL(const CBTDevice* aDev)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTPinNotifier::HandleGetDeviceCompletedL() >>"));
-    (void) aDev;
-
-    // Check if blocked device  
-    if( CheckBlockedDeviceL() )
-        return;
-
-    // Turn lights on and deactivate apps -key
-    iNotifUiUtil->TurnLightsOn();
-    
-    if( CheckAndSetAutomatedPairing() )
-        {
-        CompleteMessage(iPinCode, KErrNone);
-        return;
-        }
-
-    // For incoming pairing request
-    if(!iLocallyInitiated)
-    	{
-    	TBool userAnswer = AuthoriseIncomingPairingL();
-        if( !userAnswer )
-            {
-            //User rejects the incoming pairing, complete message in QueryBlockDevice.
-            FLOG(_L("[BTNOTIF]\t CBTPinNotifier::HandleGetDeviceCompletedL() <<"));
-            return;
-            }
-    	}
-
-	// Use a forever loop here to show query dialog again of ínput pin code does't fulfill the
-	// minimum length requirement 
-	//      
- 	FOREVER
-	 	{
-	    TBuf<KBTPassKeyMaxLength> tempResultBuffer;
-	    RBuf prompt;
-	    prompt.CleanupClosePushL();
-	    GenerateQueryPromptL( prompt );
-        TInt keypress = iNotifUiUtil->ShowTextInputQueryL(tempResultBuffer, prompt, R_BT_ENTER_PASSKEY_QUERY, 
-                ECmdShowBtOpenCoverNote, CAknQueryDialog::EConfirmationTone );
-        CleanupStack::PopAndDestroy( &prompt );
-
-        if( keypress ) // OK pressed
-        	{
-       		// Convert data from buf to pin
-        	TBuf8<KBTPassKeyMaxLength> buf8;
-        	buf8.Zero();
-        	CnvUtfConverter::ConvertFromUnicodeToUtf8(buf8, tempResultBuffer);
-        	
-        	    //check if the length of pin less that minimum required pin code length
-        	if ((iPasskeyLength == 0) || ( buf8.Length() >= iPasskeyLength))
-        		{
-			    iPinCode().iLength = STATIC_CAST(TUint8, buf8.Length());
-			    for (TInt index=0; index<buf8.Length(); index++)
-			        {
-			        iPinCode().iPIN[index] = buf8[index];
-			        }
-			   	CompleteMessage(iPinCode, KErrNone);
-        		break;
-        		}
-        	else 
-        		{
-        		//keep FOREVER loop runing, till the user input pin meet the requirement.
-        		tempResultBuffer.Zero();
-        		}
-        	}
-	    else    // Cancel pressed
-	        {
-            // If the outgoing pairing mode is set, then this is bonding initiated by the user.
-            TBool incomingConn = ( OutgoPairingMode( iBTAddr ) == EBTOutgoingPairNone );
-            if( !iMessage.IsNull() )
-                {
-                // No need to inform the user of the pairing result if the user cancelled it.
-                // If user doesn't answer anything but stack cancels, pairing result is needed 
-                // to show for outgoing pairing. In this case, don't stop pairng observer.
-                CBTEngConnMan::StopPairingObserver( iBTAddr );    
-                }
-
-            // We may be asking for pairing (locally initiated), because a remote device is requesting
-            // accesss to a service for which we require authentication.
-            if( iLocallyInitiated && incomingConn )
-                {
-                CheckAndHandleQueryIntervalL();
-                }
-            CompleteMessage(KErrCancel);
-	        return;
-	        }
-	 	}//END of FOREVER loop
-
-    FLOG(_L("[BTNOTIF]\t CBTPinNotifier::HandleGetDeviceCompletedL() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTPinNotifier::CheckAndSetAutomatedPairing
-// ---------------------------------------------------------- 
-TBool CBTPinNotifier::CheckAndSetAutomatedPairing()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTPinNotifier::CheckAndSetAutomatedPairing()"));    
-    TBool ret( EFalse );
-    // check if device is headset and passkey is empty -> do automated pairing with 0000.
-	if ( iDevice && 
-	     OutgoPairingMode( iBTAddr ) == EBTOutgoingHeadsetAutoPairing && 
-	     iPasskeyLength <= KDefaultPinCodeLength )
-	    {
-	    FLOG( _L( "[BTNOTIF]\t CBTPinNotifier::CheckAndSetAutomatedPairing - automated pairing on" ) );
-	    FLOG(_L("[BTNOTIF]\t Setting default PIN code"));
-	    iPinCode().iLength = KDefaultPinCodeLength;
-	    for( TInt i=0; i < KDefaultPinCodeLength; ++i)
-	        {
-	        iPinCode().iPIN[i] = KZeroPinValue;
-	        }
-	    ret = ETrue;
-	    }
-	return ret;
-    }
-
-// ----------------------------------------------------------
-// CBTPinNotifier::GenerateQueryPromptL
-// ---------------------------------------------------------- 
-void CBTPinNotifier::GenerateQueryPromptL( RBuf& aRBuf )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTPinNotifier::GenerateQueryPromptLC() >>"));
-    TBTDeviceName devName;
-    BtNotifNameUtils::GetDeviceDisplayName( devName, iDevice ); 
-    if (iPasskeyLength > 0)  //Minimum length passkey is defined
-        {
-        BluetoothUiUtil::LoadResourceAndSubstringL( 
-                aRBuf, R_BT_MIN_PASSKEY_PROMPT, devName, 1 );
-
-        RBuf tmpBuf;
-        tmpBuf.CleanupClosePushL();
-        tmpBuf.Swap( aRBuf );
-        aRBuf.ReAllocL( aRBuf.MaxLength() + sizeof(TUint));
-        aRBuf.Zero();
-        // Passkey length should be localized, hope StringLoader can make it:
-        StringLoader::Format( aRBuf, tmpBuf, 0, iPasskeyLength );
-        CleanupStack::PopAndDestroy( &tmpBuf );
-        }
-    else
-        {
-        BluetoothUiUtil::LoadResourceAndSubstringL( 
-                aRBuf, R_BT_PASSKEY_PROMPT, devName, 0 );
-        }
-    FLOG(_L("[BTNOTIF]\t CBTPinNotifier::GenerateQueryPromptLC() <<"));
-    }
-// End of File
--- a/bluetoothengine/btnotif/src/BTNPwrNotifier.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 power mode setting notifier class.
-*
-*/
-
-
-// INCLUDE FILES
-#include <BTNotif.rsg>       // Own resources
-#include "btnpwrnotifier.h"  // Own class definition
-#include "btNotifDebug.h"    // Debugging macros
-#include <bt_subscribe.h>
-#include <secondarydisplay/BTnotifSecondaryDisplayAPI.h>
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------------
-// CBTPwrNotifier::NewL
-// Two-phased constructor.
-// ----------------------------------------------------------
-//
-CBTPwrNotifier* CBTPwrNotifier::NewL()
-    {
-    CBTPwrNotifier* self=new (ELeave) CBTPwrNotifier();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-
-// ----------------------------------------------------------
-// CBTPwrNotifier::CBTPwrNotifier
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// ----------------------------------------------------------
-//
-CBTPwrNotifier::CBTPwrNotifier()
-    {
-    }
-
-// ----------------------------------------------------------
-// Destructor
-// ----------------------------------------------------------
-//
-CBTPwrNotifier::~CBTPwrNotifier()
-    {
-    }
-
-// ----------------------------------------------------------
-// CBTPwrNotifier::RegisterL
-// Register notifier.
-// ----------------------------------------------------------
-//
-CBTPwrNotifier::TNotifierInfo CBTPwrNotifier::RegisterL()
-    {
-    iInfo.iUid=KPowerModeSettingNotifierUid;
-    iInfo.iChannel=KBTPowerModeChannel;
-    iInfo.iPriority=ENotifierPriorityVHigh;
-    return iInfo;
-    }
-
-// ----------------------------------------------------------
-// CBTPwrNotifier::GetParamsL
-// Initialize parameters. Jump to RunL as soon as possible.
-// ----------------------------------------------------------
-//
-void CBTPwrNotifier::GetParamsL(const TDesC8& /*aBuffer*/, TInt aReplySlot, const RMessagePtr2& aMessage)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTPwrNotifier::GetParamsL()"));
-
-    if( iReplySlot!=NULL || !iMessage.IsNull() )
-        User::Leave(KErrInUse);
-
-    iMessage = aMessage;
-    iReplySlot = aReplySlot;
-
-    ShowNoteAndCompleteMessageL();
-    FLOG(_L("[BTNOTIF]\t CBTPwrNotifier::GetParamsL() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTPwrNotifier::RunL
-// Ask user response and return it to caller.
-// ----------------------------------------------------------
-//
-void CBTPwrNotifier::ShowNoteAndCompleteMessageL()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTPwrNotifier::ShowNoteAndCompleteMessageL()"));
-
-    if ( !CheckAndSetPowerOnL() )
-        {
-        CompleteMessage(KErrGeneral);
-        return;
-        }
-    // TODO: Why do we show BT BUSY note from BT power notifier?
-    //get connection amount
-    TInt linkCount = 0;
-    RProperty::Get(KPropertyUidBluetoothCategory, KPropertyKeyBluetoothGetPHYCount, linkCount);	
-        
-    if (linkCount > 6)   //support only piconet
-        {
-        iNotifUiUtil->ShowInfoNoteL( R_BT_BUSY_NOTE, ECmdShowBtBusyNote );
-        }
-	CompleteMessage(ETrue, KErrNone );
-    FLOG(_L("[BTNOTIF]\t CBTPwrNotifier::ShowNoteAndCompleteMessageL() completed"));
-    }
-
-// End of File
--- a/bluetoothengine/btnotif/src/BTNotifier.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,772 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 Bluetooth notifiers base class.
-*
-*/
-
-
-// INCLUDE FILES
-#include <centralrepository.h> 
-#include <CoreApplicationUIsSDKCRKeys.h>
-
-#include <settingsinternalcrkeys.h>
-#include <e32property.h>
-
-#include <btengsettings.h>
-#include <btengprivatecrkeys.h>
-#include <btengconnman.h>
-#include <btengutil.h>
-#include <StringLoader.h>    // Localisation stringloader
-#include <BTNotif.rsg>       // Own resources
-#include <featmgr.h>            // Feature Manager API
-#include <utf.h>             // CnvUtfConverter
-#include <bluetoothuiutil.h>
-#include "btnotifier.h"      // Own class definition
-#include "btNotifDebug.h"    // Debugging macros
-#include "btnotiflock.h"
-#include "btnotif.hrh"       // define MaxNameLength
-#include "btnotifpanic.h"
-#include "btnotifnameutils.h"
-
-#ifdef __SERIES60_HELP
-#include <hlplch.h>
-#include <csxhelp/bt.hlp.hrh> // The bt hrh info is needed, for help launching
-#endif
-
-// CONSTANTS
-const TInt KBTNAutolockEnabled = 1;
-
-// The following definitions are used to implement checking of connection/pairing
-// request frequency
-
-// if a new connection is made quicker than CONNECT_ADD_TIME after the old one, 
-// then the saved time is added with CONNECT_ADD_TIME.
-#define CONNECT_ADD_TIME TTimeIntervalSeconds(10)
-
-// if the saved time is later than now+DENY_THRESHOLD, start rejecting incoming connections
-// from unpaired devices.
-#define DENY_THRESHOLD	 TTimeIntervalSeconds(30)
-
-// if the user denies incoming connection the saved time goes this much in the future.
-#define REJECT_ADD_TIME TTimeIntervalSeconds(31)
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------------
-// CBTNotifierBase::CBTNotifierBase
-// C++ default constructor can NOT contain any code, that
-// might leave. Sets the AOs priority and puts
-// itself to the active scheduler stack.
-// ----------------------------------------------------------
-//
-CBTNotifierBase::CBTNotifierBase() 
-    {
-    }
-
-// ----------------------------------------------------------
-// CBTNotifierBase::ConstructL
-// Symbian 2nd phase constructor can leave.
-// Create registry object and open resource file.
-// ----------------------------------------------------------
-//
-void CBTNotifierBase::ConstructL()
-    {
-	// Sets up TLS, must be done before FeatureManager is used.
-	FeatureManager::InitializeLibL();
-	iIsCoverUI = ( FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ) ) 
-                    ? ETrue : EFalse; 	
-	// Frees the TLS. Must be done after FeatureManager is used.
-    FeatureManager::UnInitializeLib(); 
-
-    iBTEngSettings = CBTEngSettings::NewL();
-    iDevMan = CBTEngDevMan::NewL( this );
-    iNotifUiUtil = CBTNotifUIUtil::NewL( iIsCoverUI );
-    }
-
-// ----------------------------------------------------------
-// Destructor.
-// ----------------------------------------------------------
-//
-CBTNotifierBase::~CBTNotifierBase()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNotifierBase::~CBTNotifierBase()"));    
-    Cancel();
-    FLOG(_L("[BTNOTIF]\t CBTNotifierBase::~CBTNotifierBase() -- Done"));    
-    }
-
-// ----------------------------------------------------------
-// CBTNotifierBase::Release
-// Release itself. Call to destructor.
-// ----------------------------------------------------------
-//
-void CBTNotifierBase::Release()
-    {
-    delete this;
-    }
-
-
-// ----------------------------------------------------------
-// CBTNotifierBase::Info
-// Return registered information.
-// ----------------------------------------------------------
-//
-CBTNotifierBase::TNotifierInfo CBTNotifierBase::Info() const
-    {
-    return iInfo;
-    }
-
-// ----------------------------------------------------------
-// CBTNotifierBase::StartL
-// Synchronic notifier launch. Does nothing here.
-// ----------------------------------------------------------
-//
-TPtrC8 CBTNotifierBase::StartL(const TDesC8& /*aBuffer*/)
-    {
-    TPtrC8 ret(KNullDesC8);
-    return (ret);
-    }
-
-// ----------------------------------------------------------
-// CBTNotifierBase::StartL
-// Asynchronic notifier launch.
-// ----------------------------------------------------------
-//
-void CBTNotifierBase::StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
-    {
-    if( !iNotifUiUtil )
-        {
-        iNotifUiUtil = CBTNotifUIUtil::NewL( iIsCoverUI );    
-        }
-    
-    TRAPD(err, GetParamsL(aBuffer, aReplySlot, aMessage));
-    if (err)
-        {
-        CompleteMessage(err);
-        }
-    }
-
-// ----------------------------------------------------------
-// CBTNotifierBase::Cancel
-// Cancelling method.
-// ----------------------------------------------------------
-//
-void CBTNotifierBase::Cancel()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNotifierBase::Cancel()"));    
-
-    delete iNotifUiUtil;
-    iNotifUiUtil = NULL;
-    
-	delete iBTEngSettings;
-    iBTEngSettings = NULL;
-
-    delete iDevMan;
-    iDevMan = NULL;
-    
-    delete iDevice;
-    iDevice = NULL;
-    
-    if (iDeviceArray)
-        {
-        iDeviceArray->ResetAndDestroy();
-        delete iDeviceArray;
-        iDeviceArray = NULL;
-        }
-        
-	CompleteMessage(KErrCancel);        
-    }
-
-// ----------------------------------------------------------
-// CBTNotifierBase::UpdateL
-// Notifier update. Not supported.
-// ----------------------------------------------------------
-//
-TPtrC8 CBTNotifierBase::UpdateL(const TDesC8& /*aBuffer*/)
-    {
-    TPtrC8 ret(KNullDesC8);
-    return (ret);
-    }
-
-
-// ----------------------------------------------------------
-// CBTNotifierBase::AutoLockOnL
-// ----------------------------------------------------------
-//
-TBool CBTNotifierBase::AutoLockOnL()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNotifierBase::AutoLockOnL()"));
-
-    TBool result = EFalse;
-    TInt status = KBTNAutolockEnabled;
-    
-    // Connecting and initialization:
-	CRepository* repository = CRepository::NewL(KCRUidSecuritySettings);
-		
-	repository->Get(KSettingsAutolockStatus, status);
-		
-	// Closing connection:
-	delete repository;
-		
-    if ( status == KBTNAutolockEnabled )
-        {
-        result = ETrue;
-        }
-
-    FTRACE(FPrint(_L("[BTNOTIF]\t CBTNotifierBase::AutoLockOnL() completed with %d"), result ));
-
-    return result;
-    }
-
-// ----------------------------------------------------------
-// CBTNotifierBase::CheckAndSetPowerOnL
-// The note or query to be shown depends on two SharedData flags
-// ----------------------------------------------------------
-//
-TBool CBTNotifierBase::CheckAndSetPowerOnL()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNotifierBase::CheckAndSetPowerOnL()"));
-
-	TBTPowerStateValue powerState( EBTPowerOff );
-    // Get current power status
-    //
-    User::LeaveIfError( iBTEngSettings->GetPowerState( powerState ) );
-
-    // If power is off, turn it on
-    //
-    if ( powerState == EBTPowerOff )
-        {
-        TInt offlineModeOff( 1 );    // possible values are 0 and 1
-        TInt activationEnabled( 0 ); // possible values are 0 and 1
-        
-        // Offline mode on?
-        CRepository* repository = CRepository::NewL(KCRUidCoreApplicationUIs);
-        repository->Get(KCoreAppUIsNetworkConnectionAllowed, offlineModeOff);
-        delete repository;
-        
-        // BT Activation enabled?
-        repository = CRepository::NewL(KCRUidBluetoothEngine);
-        repository->Get(KBTEnabledInOffline, activationEnabled);
-        delete repository;
-        
-        // Choose user interaction
-        //
-        if ( !offlineModeOff && !activationEnabled )
-            {
-            // Show user that feature is disabled:
-            iNotifUiUtil->ShowInfoNoteL( R_BT_OFFLINE_DISABLED, ECmdShowBtOfflineDisableNote );
-            return EFalse; // Bluetooth can't be set on.
-            }
-        else
-            {
-            // Choose query
-            //
-            TInt keypress( 0 );	
-            if ( offlineModeOff )
-                {
-                keypress = iNotifUiUtil->ShowQueryL( KErrNone, R_BT_POWER_IS_OFF_QUERY, ECmdShowBtIsOffDlg );
-                }
-            else
-                {
-                keypress = iNotifUiUtil->ShowQueryL( KErrNone, R_BT_ACTIVATE_IN_OFFLINE_QUERY, 
-                        ECmdShowBtActivateInOfflineDlg );
-				}
-
-            if( keypress )  // User answered YES
-                { 
-                //Check if the local name has been set. If not ask user to set name
-                
-				TBool ok = IsLocalNameModifiedL();
-    			if( !ok )
-    				{
-      				ok = AskLocalBTNameQueryL();
-    				}
-               if ( ok )
-			       {  
-                	ok = ( iBTEngSettings->SetPowerState( EBTPowerOn ) ) ? EFalse : ETrue;
-                	}
-                return ok;
-                }
-            else // User has cancelled the dialog
-                {
-                FLOG(_L("[BTNOTIF]\t CBTNotifierBase::CheckAndSetPowerOnL(), dialog canceled"));
-                return EFalse;
-                }                    
-            }
-        }
-    return ETrue;
-    }
-    
-// ----------------------------------------------------------
-// CBTNotifierBase::AskLocalBTNameQueryL()
-// ----------------------------------------------------------
-//
-TBool CBTNotifierBase::AskLocalBTNameQueryL()
-    {
-	FLOG(_L("[BTNOTIF]\t CBTNotifierBase::AskLocalBTNameQueryL() >>"));
-	
-	TBTDeviceName tempNameBuffer;
-    // Cut the excess part of the name away. The query can handle only 
-    // KBTUIMaxNameLength characters.
-    //
-    if( tempNameBuffer.Length() > KBTUIMaxNameLength )
-     {
-     tempNameBuffer.SetLength( KBTUIMaxNameLength );
-     }
-
-    //Get default name if given by e.g. phone product
-    (void) RProperty::Get( KPropertyUidBluetoothCategory, 
-                           KPropertyKeyBluetoothGetDeviceName, tempNameBuffer );
-    
-    if( !tempNameBuffer.Length() )
-        {
-        (void) RProperty::Get( KPropertyUidBluetoothCategory, 
-                KPropertyKeyBluetoothGetDeviceName, tempNameBuffer );
-        }
-    
-    if( !tempNameBuffer.Length() )
-        {
-        RBTRegServ btRegServ;
-        RBTLocalDevice btReg;
-        TBTLocalDevice localDev;
-
-        TInt err = btRegServ.Connect();
-        if( !err )
-            {
-            err = btReg.Open( btRegServ );
-            } 
-        if( !err )
-            {
-            // Read the BT local name from BT Registry.
-            err = btReg.Get( localDev );
-            }
-        if( !err )
-            {
-            // The error can be > 0 if there are unconverted characters.
-            err = CnvUtfConverter::ConvertToUnicodeFromUtf8( tempNameBuffer, localDev.DeviceName() );
-            }
-        btReg.Close();
-        btRegServ.Close();
-        }
-
-    TInt keypress = iNotifUiUtil->ShowTextInputQueryL( tempNameBuffer, 
-            R_BT_ENTER_LOCAL_NAME_QUERY, ECmdBTnotifUnavailable );
-    
-    if( keypress )  // User has accepted the dialog
-        {
-        AknTextUtils::StripCharacters(tempNameBuffer,  KAknStripListControlChars);
-        tempNameBuffer.TrimAll();   // Remove extra spaces
-        // If name was full of invalid chars, it becomes empty after above cleanup. 
-        if( tempNameBuffer.Length() ) 
-            {
-            TInt err = iBTEngSettings->SetLocalName( tempNameBuffer );
-            FLOG(_L("[BTNOTIF]\t CBTNotifierBase::AskLocalBTNameQueryL() <<"));
-            return (err) ? EFalse : ETrue;    
-            }
-        else
-            {
-            FLOG(_L("[BTNOTIF]\t CBTNotifierBase::AskLocalBTNameQueryL() << failed"));
-            return EFalse;
-            }
-        }
-    else
-        {
-        FLOG(_L("[BTNOTIF]\t CBTNotifierBase::AskLocalBTNameQueryL() << cancelled"));
-        return EFalse;
-        }
-    }
-
-// ---------------------------------------------------------------------------------
-// CBTNotifierBase::IsExistingConnectionToAudioL
-// Check if there is any existing connection to audio profiles from the same device
-// ---------------------------------------------------------------------------------
-TBool CBTNotifierBase::IsExistingConnectionToAudioL( const TBTDevAddr& aDevAddr )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNotifierBase::IsExistingConnectionToAudioL()"));
-    CBTEngConnMan* connMan = CBTEngConnMan::NewL();
-    TBTEngConnectionStatus conntatus( EBTEngNotConnected );
-    (void) connMan->IsConnected(aDevAddr,conntatus);      
-    delete connMan;
-    FLOG(_L("[BTNOTIF]\t CBTNotifierBase::IsExistingConnectionToAudioL() complete"));
-    return ( conntatus==EBTEngConnected || conntatus==EBTEngConnecting );
-    }
-
-// ---------------------------------------------------------------------------
-// CBTNotifierBase::IsLocalNameModified
-// Checks from central repository whether the Bluetooth friendly name 
-// has been modified .
-// ---------------------------------------------------------------------------
-//
-TBool CBTNotifierBase::IsLocalNameModifiedL()
-	{
-	FLOG(_L("[BTNOTIF]\t CBTNotifierBase::IsLocalNameModified()"));   
-    CRepository* cenRep = CRepository::NewL( KCRUidBTEngPrivateSettings );
-    TInt val( EBTLocalNameDefault );
-    (void) cenRep->Get( KBTLocalNameChanged, val );
-    delete cenRep;
-    FLOG(_L("[BTNOTIF]\t CBTNotifierBase::IsLocalNameModified() complete"));
-    return val == EBTLocalNameSet;
-    }
-
-
-void CBTNotifierBase::GetDeviceFromRegL(const TBTDevAddr& aAddr)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNotifierBase::GetDeviceFromRegL"));
-    __ASSERT_DEBUG(iDevice, BTNOTIF_PANIC(EiDeviceNullWhenCallingGetDeviceFromRegL));
-
-    TBTRegistrySearch mySearch;
-    mySearch.FindAddress( aAddr );
-    iDeviceArray = new (ELeave) CBTDeviceArray(1);
-    if( !iDevMan )
-        {
-        iDevMan = CBTEngDevMan::NewL( this );    
-        }
-    TInt err = iDevMan->GetDevices( mySearch, iDeviceArray );
-    if(err)
-        {
-        FTRACE(FPrint(_L("[BTNOTIF]\t CBTNotifierBase::GetDeviceFromRegL iDevMan->GetDevices error = %d"), err));
-        DoHandleGetDevicesCompleteL(err, NULL);
-        }
-    FLOG(_L("[BTNOTIF]\t CBTNotifierBase::GetDeviceFromRegL done"));
-    }
-
-// ----------------------------------------------------------
-// CBTNotifierBase::QueryBlockDeviceL
-// Opens a query that returns wether or not user wants the device blocked
-// ----------------------------------------------------------
-void CBTNotifierBase::QueryBlockDeviceL()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNotifierBase::QueryBlockDeviceL()"));
-    __ASSERT_DEBUG( iNotifUiUtil->IsQueryReleased(), User::Panic( _L("CBTNotifierBase - iYesNoDlg not released!"), KErrAlreadyExists ) );
-    
-    TBTDeviceName bName;
-    BtNotifNameUtils::GetDeviceDisplayName(bName, iDevice);
-
-    HBufC* header= StringLoader::LoadLC( R_BT_BLOCK_DEVICE_HEADER );
-
-    TInt resId = IsUserAwarePaired( iDevice->AsNamelessDevice() ) ? 
-        R_BT_BLOCK_PAIRED_DEVICE_NOHELP : R_BT_BLOCK_DEVICE_NOHELP;
-	
-    RBuf stringholder;
-    stringholder.CleanupClosePushL();
-    BluetoothUiUtil::LoadResourceAndSubstringL( stringholder, resId, bName, 0 );
-
-	TInt keypress = iNotifUiUtil->ShowMessageQueryL( stringholder, *header, 
-	        R_BT_GENERIC_MESSAGE_QUERY, CAknQueryDialog::EConfirmationTone );
-    
-    CleanupStack::PopAndDestroy(&stringholder);                   
-    CleanupStack::PopAndDestroy(header);  
-
-    if( keypress )// user replied "Yes"
-        {
-        DoBlockDevice();
-        }
-    else  // user replied "No" 
-        {
-        CompleteMessage(KErrCancel);        
-        } 
-    FLOG(_L("[BTNOTIF]\t CBTNotifierBase::QueryBlockDeviceL() complete"));   
-    }
-
-void CBTNotifierBase::DoBlockDevice()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNotifierBase::DoBlockDevice()"));
-    TBTDeviceSecurity deviceSecurity = iDevice->GlobalSecurity();
-    deviceSecurity.SetBanned(ETrue);
-    deviceSecurity.SetNoAuthenticate(EFalse);
-    deviceSecurity.SetNoAuthorise(EFalse);
-    iDevice->SetGlobalSecurity(deviceSecurity);
-    iDevice->DeleteLinkKey();
- 
-    iBTRegistryQueryState = ESetDeviceBlocked;
-    TInt err = KErrNone;
-    if( !iDevMan )
-        {
-        TRAP(err, iDevMan = CBTEngDevMan::NewL( this ));    
-        }
-    if( !err )
-        {
-        err = iDevMan->ModifyDevice( *iDevice );
-        }
-    if( err )
-        {
-        // if error, complete message, otherwise waiting for devman callback
-        CompleteMessage(err); 
-        }
-    }
-
-void CBTNotifierBase::ChangeAuthorizeState( TBool aTrust )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNotifierBase::ChangeAuthorizeState()"));   
-    TBTDeviceSecurity sec = iDevice->GlobalSecurity();
-    sec.SetBanned(EFalse);
-    sec.SetNoAuthorise( ( aTrust ) ? ETrue : EFalse ) ;
-    iDevice->SetGlobalSecurity(sec);
- 
-    iBTRegistryQueryState = ESetDeviceAuthorizeState;
-    TInt err = KErrNone;
-    if( !iDevMan )
-        {    
-        TRAP(err, iDevMan = CBTEngDevMan::NewL( this ));
-        }
-    if( !err )
-        {
-        err = iDevMan->ModifyDevice( *iDevice );
-        }
-    if( err )
-        {
-        // if error, complete message, otherwise waiting for devman callback        
-        CompleteMessage(err); 
-        TBTNotifLockPublish::DeleteNotifLocks( 
-                EBTNotiferLockPairedDeviceSetting, iDevice->BDAddr() );
-        }
-    }
-
-// ----------------------------------------------------------
-// CBTNotifierBase::CheckAndHandleQueryIntervalL
-// ----------------------------------------------------------
-//
-void CBTNotifierBase::CheckAndHandleQueryIntervalL()
-    {
-    FLOG( _L( "[BTNOTIF]\t CBTNotifierBase::CheckQueryInterval start." ) );
-    TBool res = CheckQueryInterval();
-    if( res )
-        {
-        FLOG( _L( "[BTNOTIF]\t CBTNotifierBase::CheckQueryInterval check on/off query status." ) );
-        // Check if we're already showing Turn BT off query
-        TInt queryValue=EBTQueryOff;
-        RProperty::Get( KPSUidBluetoothEnginePrivateCategory, KBTTurnBTOffQueryOn, queryValue );
-        if( queryValue==EBTQueryOff )
-            {
-            FLOG( _L( "[BTNOTIF]\t CBTNotifierBase::CheckQueryInterval asking to turn BT off." ) );
-            RProperty::Set( KPSUidBluetoothEnginePrivateCategory, KBTTurnBTOffQueryOn, EBTQueryOn );
-            TInt keypress = iNotifUiUtil->ShowQueryL( KErrNone, R_BT_TURN_BT_OFF_NOTE, ECmdBTnotifUnavailable );
-            RProperty::Set( KPSUidBluetoothEnginePrivateCategory, KBTTurnBTOffQueryOn, EBTQueryOff );
-            if( keypress )  // User has accepted the dialog
-                {
-                FLOG( _L( "[BTNOTIF]\t CBTNotifierBase::CheckQueryInterval turning BT off." ) );
-                (void) iBTEngSettings->SetPowerState( EBTPowerOff );
-                CompleteMessage( KErrAccessDenied );
-                }
-            }
-        }
-    FLOG( _L( "[BTNOTIF]\t CBTNotifierBase::CheckAndHandleQueryIntervalL done." ) );
-    }
-
-void CBTNotifierBase::DoHandleGetDevicesCompleteL( TInt aErr, CBTDeviceArray* aDeviceArray)
-    {
-    FTRACE(FPrint(_L("[BTNOTIF]\t CBTNotifierBase::DoHandleGetDevicesCompleteL(%d)"), aErr ));
-    TBTDeviceName devName;
-    if (!aErr && aDeviceArray && aDeviceArray->Count())
-        {
-        // Reassign so that we won't lose the device name as it is
-        // needed if registry doesn't have the name for this device yet:
-        CBTDevice* temp = iDevice;
-        CleanupStack::PushL(temp);
-        // Taking the object returned by registry so that iDevice have
-        // all the up-to-date information except device name.
-        iDevice = aDeviceArray->At(0);
-        aDeviceArray->Delete( 0 );
-        // we show user the device name from registry if it is available;
-        // Otherwise, the name passed in by the notifier request shall be 
-        // used.
-        if( ( !iDevice->IsValidDeviceName() || 
-              !iDevice->DeviceName().Length() ) && 
-            temp->IsValidDeviceName() )
-            {
-            // We are using a stored device name, which will
-            // already have been processed
-            iDevice->SetDeviceNameL( temp->DeviceName() );
-            }
-        CleanupStack::PopAndDestroy(temp);
-        }
-    BtNotifNameUtils::GetDeviceName(devName, iDevice);   
-    
-    // It is possible that iDevice hasn't got a name so far. Use the default BT name
-    // got from GetDeviceName().
-    if ( !iDevice->IsValidDeviceName() || !iDevice->DeviceName().Length() )
-        {
-        BtNotifNameUtils::SetDeviceNameL(devName, *iDevice);
-        }
-    HandleGetDeviceCompletedL( iDevice ); 
-    }
-
-// ----------------------------------------------------------
-// CBTNotifierBase::CompleteMessage
-// ----------------------------------------------------------
-//	
-void CBTNotifierBase::CompleteMessage(TInt aErr)
-    {	   
-	if( !iMessage.IsNull() )
-	    {
-	    FTRACE(FPrint(_L("[BTNOTIF]\t CBTNotifierBase::CompleteMessage(%d)"), aErr ));
-	    iMessage.Complete( aErr );
-	    }
-	}
-
-// ----------------------------------------------------------
-// CBTNotifierBase::CompleteMessage
-// ----------------------------------------------------------
-//	
-void CBTNotifierBase::CompleteMessage(TInt aValueToReplySlot, TInt aErr)
-    {
-    FTRACE(FPrint(_L("[BTNOTIF]\t CBTNotifierBase::CompleteMessage(%d, %d)"), 
-            aValueToReplySlot, aErr ) );
-    CompleteMessage(TPckgBuf<TInt>( aValueToReplySlot ), aErr);
-	}
-
-// ----------------------------------------------------------
-// CBTNotifierBase::CompleteMessage
-// ----------------------------------------------------------
-//	
-void CBTNotifierBase::CompleteMessage(const TDesC8& aDesToReplySlot, TInt aErr)
-    {	   
-	if( !iMessage.IsNull() )
-	    {
-	    FTRACE(FPrint(_L("[BTNOTIF]\t CBTNotifierBase::CompleteMessage(TDesC8&, %d)"), aErr ) );
-	    if ( !aErr )
-	        {
-	        aErr = iMessage.Write( iReplySlot, aDesToReplySlot );
-	        }
-	    iMessage.Complete( aErr );
-	    }
-	}
-
-#ifdef __SERIES60_HELP    
-//-------------------------------------------------------------
-// CBTNotifierBase::LaunchHelp
-//--------------------------------------------------------------
-TInt CBTNotifierBase::LaunchHelp(TAny * tCoeHelpContext )
-	{	
-	TCoeHelpContext hc;
-	
-	if( tCoeHelpContext==NULL)
-		hc = TCoeHelpContext(KUidBTUI,KBT_HLP_BLOCKED);
-	else
-		hc = *static_cast<TCoeHelpContext*>(tCoeHelpContext);
-		 
-		CArrayFix< TCoeHelpContext >* array = new CArrayFixFlat< TCoeHelpContext >(1);
-	TRAPD(err,
-		{
-		CleanupStack::PushL(array);
-		array->AppendL(hc);		
-		HlpLauncher::LaunchHelpApplicationL( CCoeEnv::Static()->WsSession() , array );
-    	CleanupStack::Pop(array);
-		});
-
-    // the array is not deleted, since deleting it will result
-    // to E32User-CBase 3. It is assumed that HlpLancher is taking care of it.
-    // however this has not been documented.
-    return err;
-	}
-#endif
-
-void CBTNotifierBase::HandleGetDevicesComplete( TInt aErr, CBTDeviceArray* aDeviceArray)
-    {
-    TRAP_IGNORE(DoHandleGetDevicesCompleteL(aErr, aDeviceArray));
-    }
-
-void CBTNotifierBase::HandleDevManComplete(TInt aErr)
-    {
-    FTRACE(FPrint(_L("[BTNOTIF]\t CBTNotifierBase::HandleDevManComplete()  aErr = %d"), aErr ));
-    
-    switch (iBTRegistryQueryState)
-        {
-        case ESetDeviceBlocked:
-            {
-            // Blocking device was demanded by user after the user
-            // rejected incoming pairing or connect request. The message
-            // to be completed here is the original pair or authorization request
-            // which has been rejected by the user.
-            CompleteMessage(KErrCancel);
-            }
-        case ESetDeviceAuthorizeState:
-            {
-            TBTNotifLockPublish::DeleteNotifLocks( 
-                    EBTNotiferLockPairedDeviceSetting, iDevice->BDAddr() );
-            CompleteMessage(aErr);
-            break;
-            }
-        }
-    FLOG(_L("[BTNOTIF]\t CBTNotifierBase::HandleDevManComplete() Complete"));           
-    }
-
-void CBTNotifierBase::HandleGetDeviceCompletedL(const CBTDevice* /*aDev*/)
-    {    
-    }
-
-// ----------------------------------------------------------
-// CBTNotifierBase::CheckQueryInterval
-// ----------------------------------------------------------
-//
-TBool CBTNotifierBase::CheckQueryInterval()
-    {
-    FLOG( _L( "[BTNOTIF]\t CBTNotifierBase::CheckQueryInterval()" ) );
-    TBool result = EFalse;
-    // Check if the user gets too many queries within a certain time interval from unpaired devices
-    if( iDevice && !iDevice->IsValidLinkKey() )
-        {
-        TBuf8<32> buf;
-        TTime now;
-        now.UniversalTime();    // Get current time
-        TInt64 writeTime = ( now + REJECT_ADD_TIME ).Int64();
-
-        // get last connection time
-        TInt err = RProperty::Get( KPSUidBluetoothEnginePrivateCategory, KBTConnectionTimeStamp, buf );
-        if( !err )
-            {
-            FLOG( _L( "[BTNOTIF]\t CBTNotifierBase::CheckQueryInterval Checking query interval." ) );
-            // Parse recorded time stamp
-            TInt64 num(0);
-            TLex8 lex;
-            lex = buf;
-            lex.Val( num );
-            TTime lastTime( num );
-
-            // detection of clock adjusment
-            TInt timetravel = 2 * REJECT_ADD_TIME.Int();
-            if( lastTime > now + TTimeIntervalSeconds(timetravel) )
-                {
-                FLOG( _L( "[BTNOTIF]\t CBTNotifierBase::CheckQueryInterval  time travel detection." ) );
-                lastTime = now;
-                }
-            // new request too quickly, move booked time
-            if( lastTime + CONNECT_ADD_TIME > now )
-                {
-                FLOG( _L( "[BTNOTIF]\t CBTAuthNotifier::IsDosAttack  CONNECT_ADD_TIME added." ) );
-                writeTime = ( lastTime + CONNECT_ADD_TIME ).Int64();
-                }
-
-            FTRACE( FPrint( _L( "[BTNOTIF]\t CBTNotifierBase::CheckQueryInterval() lastTime = %d" ), lastTime.Int64() ) );
-            FTRACE( FPrint( _L( "[BTNOTIF]\t CBTNotifierBase::CheckQueryInterval now + treshold: %d" ), (now + DENY_THRESHOLD).Int64() ) );
-            // If threshold is exceeded, ask user to turn Bluetooth OFF
-            if( lastTime > now + DENY_THRESHOLD )
-                {
-                FLOG( _L( "[BTNOTIF]\t CBTNotifierBase::CheckQueryInterval threshold exceeded!." ) );
-                result = ETrue;
-                }
-            }
-        else
-            {
-            FLOG( _L( "[BTNOTIF]\t CBTNotifierBase::CheckQueryInterval setting connection timestamp first time." ) );
-            }
-        // Write back the timestamp
-        buf.Num( writeTime );
-        FTRACE( FPrint( _L( "[BTNOTIF]\t CBTNotifierBase::CheckQueryInterval updating timestamp: %d." ), writeTime ) );
-        RProperty::Set( KPSUidBluetoothEnginePrivateCategory,KBTConnectionTimeStamp, buf );
-        } // end of query interval check
-    FLOG( _L( "[BTNOTIF]\t CBTNotifierBase::CheckQueryInterval() complete" ) );
-    return result;
-    }
-// End of File
--- a/bluetoothengine/btnotif/src/btnenterpriseitsecurityinfonotifier.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 visibility timeout notifier class.
-*
-*/
-
-// INCLUDE FILES
-#include <BTNotif.rsg>								// Own resources
-#include "btnenterpriseitsecurityinfonotifier.h"	// Own class definition
-#include "btNotifDebug.h"							// Debugging macros
-#include <tulstringresourcereader.h>
-#include <e32cmn.h>
-#include <dcmo.rsg>
-
-_LIT(KDcmoResourceFileName, "z:dcmo.rsc");
-_LIT(KNewLine, "\n");
-
-//"Bluetooth" is 9 characters long
-const TInt KDefaultBluetoothStringLength = 9;
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------------
-// CBTEnterpriseItSecurityInfoNotifier::NewL
-// Two-phased constructor.
-// ----------------------------------------------------------
-//
-CBTEnterpriseItSecurityInfoNotifier* CBTEnterpriseItSecurityInfoNotifier::NewL()
-    {
-    CBTEnterpriseItSecurityInfoNotifier* self=new (ELeave) CBTEnterpriseItSecurityInfoNotifier();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-// ----------------------------------------------------------
-// CBTEnterpriseItSecurityInfoNotifier::CBTEnterpriseItSecurityInfoNotifier
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// ----------------------------------------------------------
-//
-CBTEnterpriseItSecurityInfoNotifier::CBTEnterpriseItSecurityInfoNotifier() 
-    {
-    }
-
-// ----------------------------------------------------------
-// Destructor
-// ----------------------------------------------------------
-//
-CBTEnterpriseItSecurityInfoNotifier::~CBTEnterpriseItSecurityInfoNotifier()
-    {
-    Cancel();
-    }
-
-// ----------------------------------------------------------
-// CBTEnterpriseItSecurityInfoNotifier::RegisterL
-// Register notifier.
-// ----------------------------------------------------------
-//
-CBTEnterpriseItSecurityInfoNotifier::TNotifierInfo CBTEnterpriseItSecurityInfoNotifier::RegisterL()
-    {
-    iInfo.iUid = KBTEnterpriseItSecurityInfoNotifierUid;
-    iInfo.iChannel = KBTEnterpriseItSecurityInfoNotifierUid;
-    iInfo.iPriority = ENotifierPriorityHigh;
-    return iInfo;
-    }
-
-// ----------------------------------------------------------
-// CBTEnterpriseItSecurityInfoNotifier::StartL
-// Synchronic notifier launch. Contructs and shows a global
-// note when temp visibility expire, no parameters need here.
-// ----------------------------------------------------------
-//
-TPtrC8 CBTEnterpriseItSecurityInfoNotifier::StartL(const TDesC8& /*aBuffer*/)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTEnterpriseItSecurityInfoNotifier::StartL()"));
-    
-    ShowNoteAndCompleteL();
-
-	FLOG(_L("[BTNOTIF]\t CBTEnterpriseItSecurityInfoNotifier::StartL() completed"));
-    return TPtrC8(KNullDesC8);
-    }
-
-// ----------------------------------------------------------
-// CBTEnterpriseItSecurityInfoNotifier::GetParamsL
-// Mandatory for BT Notifiers when using asynchronous launch. 
-// ----------------------------------------------------------
-//
-void CBTEnterpriseItSecurityInfoNotifier::GetParamsL(const TDesC8& /*aBuffer*/,
-										 TInt /*aReplySlot*/,
-										 const RMessagePtr2& /*aMessage*/)
-    {
-    //nothing to do here
-    }
-
-// ----------------------------------------------------------
-// CBTEnterpriseItSecurityInfoNotifier::ShowNoteAndCompleteL
-// Shows the notifier in backround 
-// ----------------------------------------------------------
-//
-void CBTEnterpriseItSecurityInfoNotifier::ShowNoteAndCompleteL()
-	{
-	FLOG(_L("[BTNOTIF]\t CBTEnterpriseItSecurityInfoNotifier::ShowNoteAndComplete()"));
-	
-	//get full path to the DCMO resource file
-	TParse* parser = new (ELeave) TParse;
-	parser->Set(KDcmoResourceFileName(), &KDC_RESOURCE_FILES_DIR, NULL);
-	CleanupStack::PushL(parser);
-	TFileName* fileName = new (ELeave) TFileName;
-	*fileName = parser->FullName();
-	CleanupStack::PopAndDestroy(parser);
-	CleanupStack::PushL(fileName);
-	
-	//create the resource reader object that we need to use several times
-	CTulStringResourceReader* reader = CTulStringResourceReader::NewL(*fileName);
-	CleanupStack::PushL(reader);
-	
-	//get pointer to the message part of the notifier
-	TPtrC resourceString;
-	resourceString.Set(reader->ReadResourceString(R_DM_RUN_TIME_VAR_DISABLE));
-
-	//create descriptor with a max length to fit the localised "disabled" text + new line + "Bluetooth"
-	RBuf content;
-	content.CreateL(resourceString.Length() + KNewLine().Length() + KDefaultBluetoothStringLength);
-	CleanupClosePushL(content);
-	
-	//add resource string and new line character to the content descriptor
-	content.Append(resourceString);	
-	content.Append(KNewLine());
-	
-	//get pointer to the Bluetooth name part of the notifier (can't assume this is actually "Bluetooth" in all languages)
-	resourceString.Set(reader->ReadResourceString(R_DM_RUN_TIME_VAR_BLUETOOTH));
-	
-	//check that the resource string will fit into the content descriptor
-	TInt requiredLength = content.Length() + resourceString.Length();
-	if (requiredLength > content.MaxLength())
-		{
-		//allocate more space in the content descriptor
-		content.ReAllocL(requiredLength);
-		}
-	
-	//add resource string to the content descriptor
-	content.Append(resourceString);	
-	
-	//display the notifier and complete
-	iNotifUiUtil->ShowInfoNoteL(content, ECmdBTnotifUnavailable);
-	CompleteMessage(KErrNone);
-	
-	//pop and destroy the content descriptor, resource reader and file name
-	CleanupStack::PopAndDestroy(3, fileName);
-	
-	FLOG(_L("[BTNOTIF]\t CBTEnterpriseItSecurityInfoNotifier::ShowNoteAndComplete() complete"));
-	}
-
-void CBTEnterpriseItSecurityInfoNotifier::HandleGetDeviceCompletedL(const CBTDevice* /*aDev*/)
-    {
-    //nothing to do here
-    }
-
-// End of File
--- a/bluetoothengine/btnotif/src/btnotifactive.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 helper class.
-*
-*/
-
-#include "btnotifactive.h"
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-// C++ default constructor
-// ---------------------------------------------------------------------------
-//
-CBTNotifActive::CBTNotifActive( MBTNotifActiveObserver* aObserver, 
-        TInt aId, TInt aPriority )
-: CActive( aPriority ), iRequestId( aId ), iObserver( aObserver )
-    {
-    CActiveScheduler::Add( this );
-    }
-
-// ---------------------------------------------------------------------------
-// Symbian 2nd-phase constructor
-// ---------------------------------------------------------------------------
-//
-void CBTNotifActive::ConstructL()
-    {
-    }
-
-// ---------------------------------------------------------------------------
-// NewL
-// ---------------------------------------------------------------------------
-//
-CBTNotifActive* CBTNotifActive::NewL( MBTNotifActiveObserver* aObserver, 
-        TInt aId, TInt aPriority )
-    {
-    CBTNotifActive* self = new (ELeave) CBTNotifActive( aObserver, aId, aPriority );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------------------------
-//
-CBTNotifActive::~CBTNotifActive()
-    {
-    Cancel();
-    }
-
-// ---------------------------------------------------------------------------
-// From class CActive.
-// Called by the active scheduler when the request has been cancelled.
-// ---------------------------------------------------------------------------
-//
-void CBTNotifActive::DoCancel()
-    {
-    iObserver->DoCancelRequest( this, iRequestId );
-    }
-
-// ---------------------------------------------------------------------------
-// From class CActive.
-// Called by the active scheduler when the request has been completed.
-// ---------------------------------------------------------------------------
-//
-void CBTNotifActive::RunL()
-    {
-    iObserver->RequestCompletedL( this, iRequestId, iStatus.Int() );
-    }
-
-
-// ---------------------------------------------------------------------------
-// From class CActive.
-// Called by the active scheduler when an error in RunL has occurred.
-// ---------------------------------------------------------------------------
-//
-TInt CBTNotifActive::RunError( TInt aError )
-    {
-    iObserver->HandleError( this, iRequestId, aError );
-    return KErrNone;
-    }
--- a/bluetoothengine/btnotif/src/btnotifnameutils.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies 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 Bluetooth notifiers base class.
- *
- */
-
-#include <AknUtils.h>
-#include <StringLoader.h>
-#include <utf.h>
-
-#include <BTNotif.rsg>
-
-#include "btNotifDebug.h"
-#include "btnotifnameutils.h"
-
-/**
- * A function for strip dangerous chars out of BT name 
- * @param  a device name. After return, it contains the stripped name.
- * @return void
- */
-void BtNotifNameUtils::StripDeviceName(TBTDeviceName& aDeviceNameForStrip)
-    {	   
-    aDeviceNameForStrip.Trim();
-    // Filter out listbox non-friendly control chars.
-    //
-    AknTextUtils::StripCharacters(aDeviceNameForStrip, KAknStripListControlChars);  	             
-
-    // Filter out sub-string-separator to pretend unexpected text layout.
-    //
-    TChar subStringSeparator = TChar(0x0001);
-    TBuf<1> tempCharBuf;
-    tempCharBuf.Append(subStringSeparator);
-    AknTextUtils::StripCharacters(aDeviceNameForStrip, tempCharBuf); 
-    }
-
-/**
- * Gets the device name to be displayed in note or dialog.
- * @param aName contains the name to be displayed
- * @param aDev the device that may have a friendly or device name, or no name at all.
- */
-void BtNotifNameUtils::GetDeviceDisplayName(TBTDeviceName& aName, const CBTDevice* aDev)
-    {
-    if(aDev && aDev->IsValidFriendlyName() )
-        {
-        aName.Copy( aDev->FriendlyName() );
-        }
-    else
-        {
-        GetDeviceName(aName, aDev);
-        }
-    }
-
-/**
- * Gets the device name from aDev if its friendly name or device name is valid; otherwise 
- * the predefined default BT name.
- * @param aName contains the device name as the result 
- * @param aDev the device that may have a device name, or no name at all.
- */
-void BtNotifNameUtils::GetDeviceName(TBTDeviceName& aName, const CBTDevice* aDev)
-    {
-    aName.Zero();
-    TInt err (CnvUtfConverter::EErrorIllFormedInput);
-    if(aDev && aDev->IsValidDeviceName())
-        {
-        err = CnvUtfConverter::ConvertToUnicodeFromUtf8(aName, aDev->DeviceName());
-        }
-    // if there are illformated chars in the device name, default name should be used for display.
-    if (err == CnvUtfConverter::EErrorIllFormedInput || aName.Length() == 0)
-        {
-        StringLoader::Load(aName, R_BT_DIALOG_DEF_NAME);
-        }
-    StripDeviceName(aName);
-    }
-
-/**
- * Sets the device name.  This handles the conversion from unicode
- * to UTF8.
- * @param aDev the device that the name should be set for
- * @param aName the name to set
- */
-void BtNotifNameUtils::SetDeviceNameL(const TBTDeviceName& aName, CBTDevice& aDev)
-    {
-    FTRACE(FPrint(_L("[BTNOTIF]\t CBTNotifierBase::SetDeviceNameL - Name: '%S' length: %d"), &aName, aName.Length() ));
-
-    // Rationalise the name to remove whitespace and control characters
-    // then set the name if there's anything left
-    TBTDeviceName devName(aName);
-    StripDeviceName(devName);
-    if (aName.Length())
-        {
-        aDev.SetDeviceNameL(BTDeviceNameConverter::ToUTF8L(devName)); 
-        }	
-    }
-
-
--- a/bluetoothengine/btnotif/src/btnotifuiutil.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,412 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 Utility to show UI notes and queries. 
-*
-*/
-
-#include <bautils.h>         // BAFL utils (for language file)
-#include "btnotifuiutil.h"
-#include "btNotifDebug.h"    // Debugging macros
-#include <StringLoader.h>    // Localisation stringloader
-#include <aknnotewrappers.h> // Information note
-#include <aknmessagequerydialog.h> // for the blocking query
-#include <AknMediatorFacade.h>  // CoverUI 
-#include <coreapplicationuisdomainpskeys.h>  // Backlight control
-#include <AknNotiferAppServerApplication.h>  // Application Key enable/disable
-
-CBTNotifUIUtil* CBTNotifUIUtil::NewL( TBool aCoverDisplayEnabled )
-    {
-    CBTNotifUIUtil* self = new (ELeave) CBTNotifUIUtil( aCoverDisplayEnabled );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-CBTNotifUIUtil::CBTNotifUIUtil( TBool aCoverDisplayEnabled ) :
-    iCoverDisplayEnabled( aCoverDisplayEnabled ), 
-    iSystemCancel( EFalse ), 
-    iAppKeyBlocked( EFalse )
-    {
-    }
-
-void CBTNotifUIUtil::ConstructL()
-    {
-    iEikEnv = CEikonEnv::Static();
-
-    TFileName filename;
-    filename += KFileDrive;
-    filename += KDC_RESOURCE_FILES_DIR; 
-    filename += KResourceFileName;
-    BaflUtils::NearestLanguageFile(iEikEnv->FsSession(),filename);
-    iResourceFileFlag=iEikEnv->AddResourceFileL(filename);
-    }
-
-CBTNotifUIUtil::~CBTNotifUIUtil()
-    {
-    iSystemCancel = ETrue;
-    delete iQueryDlg;
-    delete iWaitDlg;
-    // Activate apps key again before exit, in case any interruption happens before activation   
-    if( iAppKeyBlocked )
-        {
-        FLOG(_L("[BTNOTIF]\t CBTNotifUIUtil destructor Activate apps key before exiting. "));
-        (void) ((CAknNotifierAppServerAppUi*)iEikEnv->EikAppUi())->SuppressAppSwitching(EFalse);    
-        }
-    iEikEnv->DeleteResourceFile(iResourceFileFlag);
-    }
-// ----------------------------------------------------------
-// CBTNotifierBase::TurnLightsOn
-// ----------------------------------------------------------
-//
-void CBTNotifUIUtil::TurnLightsOn()
-    { 
-    // Change the bit on and off. SysAp will detect that
-    // the lights should be switched on for the specified time.
-    //
-    TInt err = KErrNone;
-    
-    err = RProperty::Set(KPSUidCoreApplicationUIs, KLightsControl, ELightsOn);
-    err = RProperty::Set(KPSUidCoreApplicationUIs, KLightsControl, ELightsOff);
-       
-    if ( err != KErrNone )
-        {
-        FTRACE(FPrint(_L("[BTNOTIF]\t CBTNotifUIUtil::TurnLightsOn() RProperty::Set return error %d"), err ));
-        }
-           
-    FLOG(_L("[BTNOTIF]\t CBTNotifUIUtil::TurnLightsOn() <<"));
-    }
-
-// ----------------------------------------------------------
-// CBTNotifierBase::LocalEikonEnv
-// ----------------------------------------------------------
-//
-CEikonEnv& CBTNotifUIUtil::LocalEikonEnv()
-    {
-    return *iEikEnv;
-    }
-
-// ----------------------------------------------------------
-// CBTNotifierBase::ShowQueryL
-// ----------------------------------------------------------
-//
-TInt CBTNotifUIUtil::ShowQueryL(TInt aPromptResource, TInt aExecuteResource, 
-        TSecondaryDisplayBTnotifDialogs aDialogId, CAknQueryDialog::TTone aTone )
-    {
-    TInt ret;
-    TBTDeviceName name( KNullDesC );
-    if ( aPromptResource )
-        {
-        HBufC* prompt = StringLoader::LoadLC( aPromptResource );
-        ret = ShowQueryL(*prompt, aExecuteResource, aDialogId, name, aTone );
-        CleanupStack::PopAndDestroy( prompt );
-        }
-    else
-        {
-        ret = ShowQueryL(KNullDesC, aExecuteResource, aDialogId, name, aTone );
-        }
-    return ret;
-    }
-
-TInt CBTNotifUIUtil::ShowQueryL(const TDesC& aPrompt, TInt aExecuteResource, 
-        TSecondaryDisplayBTnotifDialogs aDialogId, const TBTDeviceName& aDevNameInCoverUi, CAknQueryDialog::TTone aTone )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNotifUIUtil::ShowQueryL >>"));
-    __ASSERT_DEBUG( iQueryDlg == NULL, 
-            User::Panic(_L("CBTNotifier iQueryDlg not released!"),KErrAlreadyExists));
-
-    iQueryDlg = CAknQueryDialog::NewL(aTone);
-    if( iCoverDisplayEnabled && aDialogId != ECmdBTnotifUnavailable)
-        {
-        // initializes cover support
-        iQueryDlg->PublishDialogL(aDialogId, KUidCoverUiCategoryBTnotif );
-        CoverUIDisplayL( iQueryDlg, aDevNameInCoverUi );
-        }
- 
-    // Deactivate apps key
-    // we can do nothing if this operation fails
-    (void) ((CAknNotifierAppServerAppUi*)iEikEnv->EikAppUi())->SuppressAppSwitching(ETrue);     
-    iAppKeyBlocked = ETrue;
-    TurnLightsOn();
-    iQueryDlg->SetFocus( ETrue );
-
-    TInt keypress;
-    if ( aPrompt.Length() )
-        {
-        keypress = iQueryDlg->ExecuteLD(aExecuteResource, aPrompt );
-        }
-    else
-        {
-        keypress = iQueryDlg->ExecuteLD( aExecuteResource );
-        }
-    
-    iQueryDlg = NULL;
-    if( !iSystemCancel )
-        {    // Activate apps key when no external cancellation happens
-        (void) ((CAknNotifierAppServerAppUi*)iEikEnv->EikAppUi())->SuppressAppSwitching(EFalse);
-        iAppKeyBlocked = EFalse;
-        }
-    
-    FTRACE(FPrint(_L("[BTNOTIF]\t CBTNotifUIUtil::ShowQueryL keypress %d <<"), keypress ) );
-    return keypress;
-    }
-
-TInt CBTNotifUIUtil::ShowMessageQueryL(TDesC& aMessage, const TDesC& aHeader,
-        TInt aResourceId, CAknQueryDialog::TTone aTone )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNotifUIUtil::ShowMessageQueryL >>"));
-    __ASSERT_DEBUG( iQueryDlg == NULL, 
-            User::Panic(_L("CBTNotifier iQueryDlg not released!"),KErrAlreadyExists));
-
-    iQueryDlg = CAknMessageQueryDialog::NewL( aMessage, aTone );
-    iQueryDlg->PrepareLC( aResourceId );
-     if( aHeader.Length() )
-         {
-         static_cast<CAknMessageQueryDialog*>(iQueryDlg)->Heading()->SetTextL( aHeader );
-         }
-    
-    // Deactivate apps key
-    // we can do nothing if this operation fails
-    (void) ((CAknNotifierAppServerAppUi*)iEikEnv->EikAppUi())->SuppressAppSwitching(ETrue); 
-    iAppKeyBlocked = ETrue;
-    TurnLightsOn();
-    iQueryDlg->SetFocus( ETrue );
-    TInt keypress = iQueryDlg->RunLD();  
-    iQueryDlg = NULL;
-    
-    if( !iSystemCancel )
-        { // Activate apps key when no external cancellation happens
-        (void) ((CAknNotifierAppServerAppUi*)iEikEnv->EikAppUi())->SuppressAppSwitching(EFalse);
-        iAppKeyBlocked = EFalse;
-        }
-    
-    FTRACE(FPrint(_L("[BTNOTIF]\t CBTNotifUIUtil::ShowMessageQueryL keypress %d <<"), keypress ) );
-    return keypress;
-    }
-
-
-TInt CBTNotifUIUtil::ShowTextInputQueryL(TDes& aText, TInt aExecuteResource, 
-        TSecondaryDisplayBTnotifDialogs aDialogId, 
-        CAknQueryDialog::TTone aTone )
-    {
-    return ShowTextInputQueryL(aText, KNullDesC, aExecuteResource, aDialogId, aTone);
-    }
-
-TInt CBTNotifUIUtil::ShowTextInputQueryL(TDes& aText, const TDesC& aPrompt, TInt aExecuteResource, 
-        TSecondaryDisplayBTnotifDialogs aDialogId, 
-        CAknQueryDialog::TTone aTone )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNotifUIUtil::ShowTextInputQueryL >>"));
-    
-    __ASSERT_DEBUG( iQueryDlg == NULL, 
-            User::Panic(_L("CBTNotifier iQueryDlg not released!"),KErrAlreadyExists));
-
-    iQueryDlg = CAknTextQueryDialog::NewL( aText, aTone );
-    if( iCoverDisplayEnabled && aDialogId != ECmdBTnotifUnavailable)
-        {
-        // initializes cover support
-        iQueryDlg->PublishDialogL(aDialogId, KUidCoverUiCategoryBTnotif );
-        }
-    if ( aPrompt.Length() )
-        {
-        iQueryDlg->SetPromptL( aPrompt );
-        }
-    
-    // Deactivate apps key
-    // we can do nothing if this operation fails
-    (void) ((CAknNotifierAppServerAppUi*)iEikEnv->EikAppUi())->SuppressAppSwitching(ETrue);   
-    iAppKeyBlocked = ETrue;
-    TurnLightsOn();
-    iQueryDlg->SetFocus( ETrue );
-    TInt keypress = iQueryDlg->ExecuteLD( aExecuteResource );
-    iQueryDlg = NULL;
-    
-    if( !iSystemCancel )
-        { // Activate apps key when no external cancellation happens
-        (void) ((CAknNotifierAppServerAppUi*)iEikEnv->EikAppUi())->SuppressAppSwitching(EFalse);
-        iAppKeyBlocked = EFalse;
-        }
-    
-    FTRACE(FPrint(_L("[BTNOTIF]\t CBTNotifUIUtil::ShowTextInputQueryL txt '%S' keypress %d <<"), 
-            &aText, keypress ) );
-    return keypress;    
-    }
-
-void CBTNotifUIUtil::ShowInfoNoteL(
-        TInt aResourceId, TSecondaryDisplayBTnotifDialogs aDialogId )
-    {
-    // Load a string, create and show a note
-    HBufC* stringHolder = StringLoader::LoadLC( aResourceId );
-    ShowInfoNoteL( *stringHolder, aDialogId );
-    CleanupStack::PopAndDestroy(); //stringHolder    
-    }
-
-
-void CBTNotifUIUtil::ShowInfoNoteL(
-        const TDesC& aResource, TSecondaryDisplayBTnotifDialogs aDialogId )
-    {
-    FTRACE(FPrint(_L("[BTNOTIF]\t CBTNotifUIUtil::ShowInfoNoteL  '%S' >> "), 
-            &aResource ) ); 
-    CAknInformationNote* note = new (ELeave) CAknInformationNote(); 
-    if(iCoverDisplayEnabled && aDialogId != ECmdBTnotifUnavailable)
-        {
-        CleanupStack::PushL( note );
-        // initializes cover support
-        note->PublishDialogL(aDialogId, KUidCoverUiCategoryBTnotif ); 
-        CleanupStack::Pop(note);
-        }
-    note->ExecuteLD( aResource );
-    FLOG(_L("[BTNOTIF]\t CBTNotifUIUtil::ShowInfoNoteL done <<"));
-    }
-
-void CBTNotifUIUtil::ShowConfirmationNoteL( TBool aWaitingDlg, const TDesC& aResource, 
-        TSecondaryDisplayBTnotifDialogs aDialogId, const TBTDeviceName& aDevNameInCoverUi )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNotifUIUtil::ShowConfirmationNoteL >>"));
-    CAknConfirmationNote* note = new (ELeave) CAknConfirmationNote( aWaitingDlg );
-
-    if(iCoverDisplayEnabled && aDialogId != ECmdBTnotifUnavailable)
-        {
-        CleanupStack::PushL( note );
-        // initializes cover support
-        note->PublishDialogL(aDialogId, KUidCoverUiCategoryBTnotif ); 
-        CoverUIDisplayL( note, aDevNameInCoverUi );
-        CleanupStack::Pop(note);
-        }
-    TurnLightsOn();
-    note->ExecuteLD( aResource );
-    FLOG(_L("[BTNOTIF]\t CBTNotifUIUtil::ShowConfirmationNoteL done <<"));
-    }
-
-void CBTNotifUIUtil::ShowErrorNoteL( TBool aWaitingDlg, const TDesC& aResource, 
-        TSecondaryDisplayBTnotifDialogs aDialogId, TBTDeviceName aDevNameInCoverUi )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNotifUIUtil::ShowErrorNoteL >>"));
-    CAknErrorNote* note = new (ELeave) CAknErrorNote( aWaitingDlg );
-    if(iCoverDisplayEnabled && aDialogId != ECmdBTnotifUnavailable)
-        {
-        CleanupStack::PushL( note );
-        // initializes cover support
-        note->PublishDialogL(aDialogId, KUidCoverUiCategoryBTnotif ); 
-        CoverUIDisplayL( note, aDevNameInCoverUi );
-        CleanupStack::Pop(note);
-        }
-    TurnLightsOn();
-    note->ExecuteLD( aResource );
-    FLOG(_L("[BTNOTIF]\t CBTNotifUIUtil::ShowErrorNoteL done <<"));
-    }
-
-// ----------------------------------------------------------
-// CBTNotifUIUtil::IsQueryReleased
-// Check if iQueryDlg is NULL
-// ----------------------------------------------------------
-// 
-TBool CBTNotifUIUtil::IsQueryReleased()
-    {
-    return ( iQueryDlg ) ? EFalse : ETrue;   
-    }
-
-// ----------------------------------------------------------
-// CBTNotifUIUtil::UpdateQueryDlgL
-// Update Query with specified info, called by UpdateL()
-// ----------------------------------------------------------
-// 
-void CBTNotifUIUtil::UpdateQueryDlgL( TDesC& aMessage )
-    {
-    __ASSERT_DEBUG( iQueryDlg != NULL, 
-                User::Panic(_L("CBTNotifier iQueryDlg not exist to update!"),KErrNotFound));
-    iQueryDlg->SetPromptL( aMessage );
-    iQueryDlg->DrawDeferred();
-    }
-
-// ----------------------------------------------------------
-// CBTNotifUIUtil::UpdateMessageQueryDlgL
-// Update message query when RNotifier::UpdateL() is called
-// ----------------------------------------------------------
-// 
-void CBTNotifUIUtil::UpdateMessageQueryDlgL( TDesC& aMessage )
-    {
-    __ASSERT_DEBUG( iQueryDlg != NULL, 
-                User::Panic(_L("CBTNotifier CAknTextQueryDialog iQueryDlg not exist to update!"),KErrNotFound));
-    static_cast<CAknMessageQueryDialog*>(iQueryDlg)->SetMessageTextL( aMessage );
-    iQueryDlg->DrawDeferred();
-    FLOG(_L("[BTNOTIF]\t CBTNotifUIUtil::UpdateMessageQueryDlg "));
-    }
-
-// ----------------------------------------------------------
-// CBTNotifUIUtil::UpdateCoverUiL
-// Update secondary display 
-// ----------------------------------------------------------
-// 
-void CBTNotifUIUtil::UpdateCoverUiL( const TDesC8& aMessage )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNotifUIUtil::UpdateCoverUiL >>"));
-    __ASSERT_DEBUG( iQueryDlg != NULL, 
-                    User::Panic(_L("CBTNotifier iQueryDlg not exist to update!"),KErrNotFound));
-    if(iCoverDisplayEnabled )
-        {                                        
-        CAknMediatorFacade* coverData = AknMediatorFacade(iQueryDlg);
-        if(coverData)
-            { 
-            coverData->ResetBuffer();
-            coverData->BufStream() << aMessage; // insert your buffer here
-            coverData->BufStream().CommitL();
-            coverData->PostUpdatedDataL();
-            }
-        }
-    FLOG(_L("[BTNOTIF]\t CBTNotifUIUtil::UpdateCoverUiL done <<"));
-    }
-
-void CBTNotifUIUtil::DismissDialog()
-    {
-    if( !IsQueryReleased() )
-        {
-        delete iQueryDlg;
-        iQueryDlg = NULL;
-        }
-    }
-
-void CBTNotifUIUtil::CoverUIDisplayL( const MObjectProvider* aMop, 
-        const TBTDeviceName& aDevNameInCoverUi )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNotifUIUtil::CoverUIDisplayL() >>"));
-    
-    CAknMediatorFacade* covercl = AknMediatorFacade( aMop ); 
-    if( covercl && aDevNameInCoverUi.Length() )
-        {
-        covercl->BufStream() << aDevNameInCoverUi;
-        covercl->BufStream().CommitL(); // no more data to send so commit buf
-        }
-    
-    FLOG(_L("[BTNOTIF]\t CBTNotifUIUtil::CoverUIDisplayL() <<"));
-    }
-
-TInt CBTNotifUIUtil::ShowWaitDlgL( TInt aResourceId )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNotifUIUtil::ShowWaitDlgL() >>"));
-    iWaitDlg = new(ELeave) CAknWaitDialog((REINTERPRET_CAST(CEikDialog**,&iWaitDlg)), ETrue );
-    TInt ret = iWaitDlg->ExecuteLD(aResourceId);
-    FLOG(_L("[BTNOTIF]\t CBTNotifUIUtil::ShowWaitDlgL() <<"));
-    return ret;
-    }
-
-void CBTNotifUIUtil::CompleteWaitDlgL()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNotifUIUtil::CompleteWaitDlgL() >>"));
-    if(iWaitDlg)
-        {
-        iWaitDlg->ProcessFinishedL();
-        }
-    FLOG(_L("[BTNOTIF]\t CBTNotifUIUtil::CompleteWaitDlgL() <<"));
-    }
--- a/bluetoothengine/btnotif/src/btnpaireddevsettnotifier.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,241 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 pairing status and set authorized, unique devicename of paired device.
-*
-*/
-
-
-// INCLUDE FILES
-
-#include <BTNotif.rsg>          // Own resources
-#include <btnotif.h>
-#include <bluetoothuiutil.h>
-#include "btnotiflock.h"
-#include "btnpaireddevsettnotifier.h"      // Own class definition
-#include "btNotifDebug.h"       // Debugging macros
-#include <bluetooth/hci/hcierrors.h>
-#include "btnotifnameutils.h"
-
-#include <secondarydisplay/BTnotifSecondaryDisplayAPI.h>
-
-#include <e32cmn.h>
-#include <AknMediatorFacade.h>  // CoverUI 
-
-#ifdef __SERIES60_HELP
-#include <hlplch.h>
-#include <csxhelp/bt.hlp.hrh> // The bt hrh info is needed, for help launching
-#endif
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------------
-// CBTPairedDevSettNotifier::NewL
-// Two-phased constructor.
-// ----------------------------------------------------------
-//
-CBTPairedDevSettNotifier* CBTPairedDevSettNotifier::NewL()
-    {
-    CBTPairedDevSettNotifier* self=new (ELeave) CBTPairedDevSettNotifier();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-
-// ----------------------------------------------------------
-// CBTPairedDevSettNotifier::CBTPairedDevSettNotifier
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// ----------------------------------------------------------
-//
-CBTPairedDevSettNotifier::CBTPairedDevSettNotifier()
-    {	
-    }
-
-// ----------------------------------------------------------
-// Destructor
-// ----------------------------------------------------------
-//
-CBTPairedDevSettNotifier::~CBTPairedDevSettNotifier()
-    {
-    }
-
-// ----------------------------------------------------------
-// CBTPairedDevSettNotifier::RegisterL
-// Register notifier.
-// ----------------------------------------------------------
-//
-CBTPairedDevSettNotifier::TNotifierInfo CBTPairedDevSettNotifier::RegisterL()
-    {
-	iInfo.iUid = KBTPairedDeviceSettingNotifierUid;
-    iInfo.iChannel = KBTPairedDeviceSettingChannel;
-    iInfo.iPriority = ENotifierPriorityVHigh;
-    return iInfo;
-    }
-
-
-// ----------------------------------------------------------
-// CBTPairedDevSettNotifier::GetParamsL
-// Mandatory for BT Notifiers when using asynchronous launch. 
-// This notifier is synchronous so no implementation is needed.
-// ----------------------------------------------------------
-//
-void CBTPairedDevSettNotifier::GetParamsL(const TDesC8& aBuffer, 
-                                     TInt aReplySlot, 
-                                     const RMessagePtr2& aMessage)
-    {
-   	FLOG(_L("[BTNOTIF]\t CBTPairedDevSettNotifier::GetParamsL"));    
-
-    if( iReplySlot != NULL || !iMessage.IsNull())
-        {
-        User::Leave(KErrInUse);
-        }
-
-    iMessage = aMessage;
-    iReplySlot = aReplySlot;
-	ProcessParamBufferL(aBuffer); 
-
-	FLOG(_L("[BTNOTIF]\t CBTPairedDevSettNotifier::GetParamsL Complete"));    
-  	}
-
-// ----------------------------------------------------------
-// CBTPairedDevSettNotifier::UpdateL
-// Update notifier according to new data
-// ----------------------------------------------------------
-//	
-TPtrC8 CBTPairedDevSettNotifier::UpdateL(const TDesC8& /*aBuffer*/)
-	{
- 	FLOG(_L("[BTNOTIF]\t CBTPairedDevSettNotifier::UpdateL"));
-    TPtrC8 ret(KNullDesC8);
-    return (ret);
-	}
-
-void CBTPairedDevSettNotifier::HandleGetDeviceCompletedL(const CBTDevice* /*aDev*/)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTPairedDevSettNotifier::HandleGetDeviceCompletedL >>"));    
-    TBTDeviceName name;
-    BtNotifNameUtils::GetDeviceDisplayName(name, iDevice);
-    
-    RBuf stringholder;
-    stringholder.CleanupClosePushL();
-    
-    // 1. Show pairing status note
-    FTRACE(FPrint(_L("[BTNOTIF]\t CBTPairedDevSettNotifier iPairingStatus: %d"), iPairingStatus));
-    TInt resourceId = ProcessPairingErrorCode( iPairingStatus );    
-    BluetoothUiUtil::LoadResourceAndSubstringL( stringholder, resourceId, name, 0 );
-
-    if (!iPairingStatus)
-        {
-        iNotifUiUtil->ShowConfirmationNoteL( ETrue, stringholder, iSecondaryDisplayCommand, name );
-        }
-    else
-        {
-        iNotifUiUtil->ShowErrorNoteL( EFalse, stringholder, iSecondaryDisplayCommand, name );
-        }
-    CleanupStack::PopAndDestroy( &stringholder );
-      
-    if( iPairingStatus || (iDevice && iDevice->GlobalSecurity().Banned() ) )
-        {
-        TBTNotifLockPublish::DeleteNotifLocks( 
-                EBTNotiferLockPairedDeviceSetting, iDevice->BDAddr() );
-        CompleteMessage(KErrNone);
-        return;
-        }
-    
-    // 2. Show Authorization query
-    //
-    TInt keypress = iNotifUiUtil->ShowQueryL( R_BT_AUTHORIZATION_PROMPT, R_BT_AUTHORISATION_QUERY, 
-            iSecondaryDisplayCommand, CAknQueryDialog::EConfirmationTone);
-
-    if (!iMessage.IsNull())
-        {
-        // this notifier is not cancelled, continue the task:
-        ChangeAuthorizeState(keypress);
-        }
-    }
-
-// ----------------------------------------------------------
-// CBTGenericQueryNotifier::ProcessParamBufferL
-// Parse the data out of the message that is sent by the
-// client of the notifier.
-// ----------------------------------------------------------
-void CBTPairedDevSettNotifier::ProcessParamBufferL(const TDesC8& aBuffer)
-	{
-    FLOG(_L("[BTNOTIF]\t CBTPairedDevSettNotifier::ProcessParamBufferL()"));
-    
-    TBTPairedDeviceSettingParamsPckg pckg; 
-    pckg.Copy( aBuffer );
-
-    iPairingStatus = pckg().iPairingStatus;
-    if( iPairingStatus <= KHCIErrorBase )
-        {
-        // Pairing status could be KErrNone, or the Symbian error code
-        // used for indicating HCI error codes.
-        iPairingStatus -= KHCIErrorBase;
-        }
-    if ( !iPairingStatus )
-        {
-        TBTNotifLockPublish::AddNotifLocks( 
-                EBTNotiferLockPairedDeviceSetting, pckg().iRemoteAddr );
-        }
-
-    iDevice = CBTDevice::NewL(pckg().iRemoteAddr);
-    GetDeviceFromRegL( pckg().iRemoteAddr );
-
-    FLOG(_L("[BTNOTIF]\t CBTPairedDevSettNotifier::ProcessParamBufferL() end"));
-	}
-
-// ----------------------------------------------------------
-// CBTPairedDevSettNotifier::Cancel
-// Release all own resources (member variables)
-// ----------------------------------------------------------
-//
-void CBTPairedDevSettNotifier::Cancel()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTPairedDevSettNotifier::Cancel()"));
-
-    TBTNotifLockPublish::DeleteNotifLocks( 
-            EBTNotiferLockPairedDeviceSetting, iDevice->BDAddr() );    	
-    CBTNotifierBase::Cancel();
-
-    FLOG(_L("[BTNOTIF]\t CBTPairedDevSettNotifier::Cancel() completed"));
-    }
-	
-// ----------------------------------------------------------
-// CBTPairedDevSettNotifier::ProcessPairingErrorCode
-// ----------------------------------------------------------
-//
-TInt CBTPairedDevSettNotifier::ProcessPairingErrorCode( const TInt aErr )
-    {
-    if( !aErr )
-        {
-        return R_BT_SUCCESFULLY_PAIRED_PROMPT;
-        }
-    else if( aErr == -EHostBusyPairing )
-        {
-        return R_BT_SSP_BUSY;
-        }
-    else
-        {
-        return R_BT_PAIRING_FAILED_PROMPT;
-        }
-    }
-
-
-void CBTPairedDevSettNotifier::QueryRenameDeviceL(const CBTDevice& /*aDevice*/) 
-    {
-    // No implementation for now.   
-    }
-
-// End of File
--- a/bluetoothengine/btnotif/src/btnpairnotifier.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,253 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 notifiers for pairing purpose.
-*
-*/
-
-#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
-#include <btextnotifiers.h>
-#else
-#include <btextnotifiers.h>
-#include <btextnotifierspartner.h> // new file introduced by xSymbian
-#endif
-
-#include <utf.h>             // Unicode character conversion utilities
-#include <btengconnman.h>
-#include <BTNotif.rsg>       // Own resources
-#include <bluetoothuiutil.h>
-#include "btnpairnotifier.h"
-#include "btNotifDebug.h"
-#include "btnotifnameutils.h"
-
-// ----------------------------------------------------------
-// CBTNPairNotifierBase::NewL
-// ----------------------------------------------------------
-//
-CBTNPairNotifierBase* CBTNPairNotifierBase::NewL()
-    {
-    CBTNPairNotifierBase* self = new (ELeave) CBTNPairNotifierBase();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ----------------------------------------------------------
-// CBTNPairNotifierBase Destructor
-// ----------------------------------------------------------
-//
-CBTNPairNotifierBase::~CBTNPairNotifierBase()
-    {
-    }
-
-// ----------------------------------------------------------
-// CBTNPairNotifierBase default construct
-// ----------------------------------------------------------
-//
-CBTNPairNotifierBase::CBTNPairNotifierBase()
-    :iLocallyInitiated(EFalse)
-    {
-    }
-
-// ----------------------------------------------------------
-// CBTNPairNotifierBase::RegisterL
-// ----------------------------------------------------------
-//
-CBTNPairNotifierBase::TNotifierInfo CBTNPairNotifierBase::RegisterL()
-    {
-    return iInfo;
-    }
-
-// ----------------------------------------------------------
-// CBTNPairNotifierBase::GetParamsL
-// ----------------------------------------------------------
-//
-void CBTNPairNotifierBase::GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
-    {
-    (void)aBuffer;
-    if( !iMessage.IsNull() )
-        {
-        User::Leave(KErrInUse);
-        }
-
-    iMessage = (RMessage2)aMessage;
-    iReplySlot = aReplySlot;
-
-    if ( AutoLockOnL() )
-        {
-        // The phone is locked, access denied.
-        //
-        CompleteMessage(KErrCancel);
-        }
-
-    }
-
-// ----------------------------------------------------------
-// CBTNPairNotifierBase::UpdateL
-// ----------------------------------------------------------
-//
-void CBTNPairNotifierBase::UpdateL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
-    {
-    (void) aReplySlot;
-    UpdateL(aBuffer);
-    aMessage.Complete(KErrNone);
-    }
-
-// ----------------------------------------------------------
-// CBTNPairNotifierBase::UpdateL
-// ----------------------------------------------------------
-//
-TPtrC8 CBTNPairNotifierBase::UpdateL( const TDesC8& aBuffer )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNPairNotifierBase::UpdateL()"));
-
-    TBTDeviceNameUpdateParamsPckg pckg;
-    pckg.Copy( aBuffer );
-    if (pckg().Type() != TBTNotifierUpdateParams2::EDeviceName)
-        {
-        TPtrC8 ret(KNullDesC8);
-        return (ret);
-        }
-
-    if (pckg().Result() == KErrNone)
-        {
-        BtNotifNameUtils::SetDeviceNameL(pckg().DeviceName(), *iDevice);
-
-    // Finally show new prompt for dialog if it is still on the screen
-    // and user has not given a alias for device.   
-        if( !iNotifUiUtil->IsQueryReleased() && !iDevice->IsValidFriendlyName() )
-            {
-            RBuf prompt;
-            prompt.CleanupClosePushL();
-            GenerateQueryPromptL( prompt );
-            iNotifUiUtil->UpdateQueryDlgL( prompt );
-            CleanupStack::PopAndDestroy( &prompt );
-            }
-        }
-
-    FLOG(_L("[BTNOTIF]\t CBTNPairNotifierBase::UpdateL() completed"));
-    TPtrC8 ret(KNullDesC8);
-    return (ret);
-    }
-
-// ----------------------------------------------------------
-// CBTNPairNotifierBase::ProcessParamsGetDeviceL
-// Get device from registry based on notifier's param
-// ----------------------------------------------------------
-//
-void CBTNPairNotifierBase::ProcessParamsGetDeviceL( const TBTDevAddr& aAddr, const TBTDeviceName& aName )
-    {
-    iDevice = CBTDevice::NewL(aAddr);
-    BtNotifNameUtils::SetDeviceNameL(aName, *iDevice);
-
-    // Get all properties of device from registry. 
-    GetDeviceFromRegL( aAddr ); 
-    
-#ifdef _DEBUG
-    FTRACE(FPrint(_L("[BTNOTIF]\t Executing authentication... Parameters:")));
-    TBuf<12> deviceAddressString;
-    aAddr.GetReadable(deviceAddressString);
-    FTRACE(FPrint(_L("[BTNOTIF]\t BT Address: %S"), &deviceAddressString));
-#endif
-    }
-
-// ----------------------------------------------------------
-// CBTNPairNotifierBase::CheckBlockedDeviceL
-// Forbid pairing from remote banned devices
-// ----------------------------------------------------------
-//
-TBool CBTNPairNotifierBase::CheckBlockedDeviceL()
-    {
-    if ( !iDevice )
-        {
-        User::Leave( KErrGeneral );
-        }
-
-    // Do not allow pairing attempt from banned devices
-    if( iDevice->GlobalSecurity().Banned() && !iLocallyInitiated )
-       {
-       FLOG(_L("[BTNOTIF]\t CBTNPairNotifierBase::CheckBlockedDeviceL() Pairing attempt from banned device is denied.")); 
-       CompleteMessage(KErrCancel);       
-       return ETrue;
-       }
-    return EFalse;
-    }
-
-// ----------------------------------------------------------
-// CBTNPairNotifierBase::AuthoriseIncomingPairingL
-// Query user to authorise imcoming pair request or not.
-// If reject, query whether to block the remot device. 
-// ----------------------------------------------------------
-//
-TBool CBTNPairNotifierBase::AuthoriseIncomingPairingL()
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNPairNotifierBase::AuthoriseIncomingPairingL() >>"));
-    
-    // Start pairing observer so that user will be informed about the result:
-    TInt err = CBTEngConnMan::StartPairingObserver( iBTAddr );
-    if ( err )
-        {
-        // Failed to start observer because of other ongoing pairing,
-        // reject this request:
-        CompleteMessage( err );
-        return EFalse;            
-        }
-    
-    TBTDeviceName devName;
-    BtNotifNameUtils::GetDeviceDisplayName( devName, iDevice );
-    RBuf prompt;
-    prompt.CleanupClosePushL();
-    BluetoothUiUtil::LoadResourceAndSubstringL( 
-            prompt, R_BT_ACCEPT_PAIRING_REQUEST, devName, 0 );
-
-    devName.Zero();
-    // Show query for use to accept/reject incoming pairing request
-    TInt keypress = iNotifUiUtil->ShowQueryL( prompt, R_BT_GENERIC_QUERY, 
-             ECmdBTnotifUnavailable, devName, CAknQueryDialog::EConfirmationTone );
-    CleanupStack::PopAndDestroy( &prompt );
-
-    if( iMessage.IsNull() ) // cancelled by the stack
-        {
-        return EFalse;
-        }
-    else if( !keypress ) // User rejected pairing
-        {
-        FLOG(_L("[BTNOTIF]\t CBTNPairNotifierBase: user rejected incoming pairing"));
-        // stop observer to omit pairing failure note.
-        CBTEngConnMan::StopPairingObserver( iDevice->BDAddr() );
-        iDevice->SetPaired(EFalse);
-        CheckAndHandleQueryIntervalL();
-        if( !iMessage.IsNull() )
-            {
-            // Ask user does he/she wishes to block this device (if not canceled because the 
-            // frequency is too high).
-            QueryBlockDeviceL();
-            }
-        return EFalse;
-        }
-
-    FLOG(_L("[BTNOTIF]\t CBTNPairNotifierBase::AuthoriseIncomingPairingL() << "));
-    return ETrue;
-    }
-
-// ----------------------------------------------------------
-// CBTNPairNotifierBase::GenerateQueryPromptL
-// To be implemented in derived classes.
-// ----------------------------------------------------------
-//
-void CBTNPairNotifierBase::GenerateQueryPromptL(  RBuf& aRBuf )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNPairNotifierBase::GenerateQueryPromptL WARNING "));
-    (void) aRBuf;
-    }
--- a/bluetoothengine/btnotif/src/btnssppasskeyentrynotifier.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,282 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 authentication (PIN query) notifier class.
-*
-*/
-
-
-// INCLUDE FILES
-#include <StringLoader.h>    // Localisation stringloader
-#include <utf.h>             // Unicode character conversion utilities
-#include <avkon.mbg>
-#include <btengdevman.h>
-#include <btengconnman.h>
-#include <btotgpairpub.inl>
-#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
-#include <btextnotifiers.h>
-#else
-#include <btextnotifiers.h>
-#include <btextnotifierspartner.h>
-#endif
-#include <BTNotif.rsg>       // Own resources
-#include <secondarydisplay/BTnotifSecondaryDisplayAPI.h>
-#include <bluetoothuiutil.h>
-#include "btnotif.hrh"       // Own resource header
-#include "btnssppasskeyentrynotifier.h"  // Own class definition
-#include "btNotifDebug.h"    // Debugging macros
-#include "btnotifnameutils.h"
-
-#ifdef __SERIES60_HELP
-#include <hlplch.h>
-#include <csxhelp/bt.hlp.hrh> // The bt hrh info is needed, for help launching
-#endif
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------------
-// CBTSSPPasskeyEntryNotifier::NewL
-// Two-phased constructor.
-// ----------------------------------------------------------
-//
-CBTSSPPasskeyEntryNotifier* CBTSSPPasskeyEntryNotifier::NewL()
-    {
-    CBTSSPPasskeyEntryNotifier* self=new (ELeave) CBTSSPPasskeyEntryNotifier();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-// ----------------------------------------------------------
-// CBTSSPPasskeyEntryNotifier::CBTSSPPasskeyEntryNotifier
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// ----------------------------------------------------------
-//
-CBTSSPPasskeyEntryNotifier::CBTSSPPasskeyEntryNotifier()
-    {
-    iPasskey.Zero();
-    }
-
-// ----------------------------------------------------------
-// Destructor
-// ----------------------------------------------------------
-//
-CBTSSPPasskeyEntryNotifier::~CBTSSPPasskeyEntryNotifier()
-    {
-    }
-
-// ----------------------------------------------------------
-// CBTSSPPasskeyEntryNotifier::RegisterL
-// Register notifier.
-// ----------------------------------------------------------
-//
-CBTSSPPasskeyEntryNotifier::TNotifierInfo CBTSSPPasskeyEntryNotifier::RegisterL()
-    {
-    iInfo.iUid = KBTPasskeyDisplayNotifierUid;
-    iInfo.iChannel = KBTPasskeyDisplayNotifierUid;
-    iInfo.iPriority = ENotifierPriorityVHigh;
-    return iInfo;
-    }
-
-// ----------------------------------------------------------
-// CBTSSPPasskeyEntryNotifier::GetParamsL
-// Initialize parameters and check if device is already
-// in registry. Jump to RunL as soon as possible.
-// ----------------------------------------------------------
-//
-void CBTSSPPasskeyEntryNotifier::GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTSSPPasskeyEntryNotifier::GetParamsL()"));
-
-    CBTNPairNotifierBase::GetParamsL( aBuffer, aReplySlot, aMessage );
-    
-    TBTPasskeyDisplayParamsPckg pckg;
-    pckg.Copy(aBuffer);
-    iBTAddr = pckg().DeviceAddress();
-    if ( OtherOutgoPairing(iBTAddr) )
-        {
-        // We won't allow incoming pairing during outgoing pairing:
-        FLOG(_L("[BTNOTIF]\t CBTSSPPasskeyEntryNotifier: outgoing pair in progress, reject incoming pair"));
-        CompleteMessage(KErrCancel);
-        return;
-        }
-
-    iLocallyInitiated = pckg().LocallyInitiated();
-    iPasskey.AppendNumFixedWidth(pckg().NumericalValue(), EDecimal, KPassKeylength);
-    iPasskey.Insert(3,_L(" "));
-
-    ProcessParamsGetDeviceL( iBTAddr, pckg().DeviceName() );
-    
-    FLOG(_L("[BTNOTIF]\t CBTSSPPasskeyEntryNotifier::GetParamsL() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTSSPPasskeyEntryNotifier::UpdateL
-// Notifier update. Stores the received bluetooth
-// device name into registry and show it on screen.
-// ----------------------------------------------------------
-//
-TPtrC8 CBTSSPPasskeyEntryNotifier::UpdateL(const TDesC8& aBuffer)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTSSPPasskeyEntryNotifier::UpdateL()"));
-    
-    TBTPasskeyDisplayUpdateParamsPckg pckg;
-    pckg.Copy(aBuffer);
-  
-    if(pckg().Type() != TBTNotifierUpdateParams2::EPasskeyDisplay)
-        {
-        TPtrC8 ret(KNullDesC8);
-        return (ret);
-        }
-    
-    switch (pckg().KeypressNotification())
-        {
-        case EPasskeyEntryStarted:
-            {
-            iBuf.Zero();
-            iBuf.Append(iPasskey);
-            iBuf.Append(_L("    "));
-            break;
-            }
-        case EPasskeyDigitEntered:
-            {
-            // show an '*'
-            iBuf.Append(_L("*"));
-            break;
-            }
-        case EPasskeyDigitDeleted:
-            {
-            // remove an '*' from the tail of iBuf
-            iBuf.Delete(iBuf.Length()-1, 1);  
-            break;
-            }
-        case EPasskeyCleared:
-            {
-            // remove all '*'
-            iBuf.Zero();
-            iBuf.Append(iPasskey);
-            iBuf.Append(_L("    "));
-            break;
-            }
-        case EPasskeyEntryCompleted:
-            {                                  
-            // complete passkey entry
-            // Set iAnswer to 1 ,
-            // Continue pairing in Run()
-            iAnswer = 1;
-            //iPasskeyDlg->DismissQueryL();
-            iNotifUiUtil->DismissDialog();
-            break;
-            }
-        }
-    if ( !iNotifUiUtil->IsQueryReleased() )
-        {
-        RBuf prompt;
-        prompt.CleanupClosePushL();
-        GenerateQueryPromptL( prompt );
-        iNotifUiUtil->UpdateQueryDlgL( prompt );
-        CleanupStack::PopAndDestroy( &prompt ); 
-        }        
-    
-    FLOG(_L("[BTNOTIF]\t CBTSSPPasskeyEntryNotifier::UpdateL() completed"));
-    TPtrC8 ret(KNullDesC8);
-    return (ret);
-    }
-
-// ----------------------------------------------------------
-// CBTSSPPasskeyEntryNotifier::HandleGetDeviceCompletedL
-// Ask user response and return it to caller.
-// Store device into registry if user rejects the incoming pairing.
-// ----------------------------------------------------------
-//
-void CBTSSPPasskeyEntryNotifier::HandleGetDeviceCompletedL(const CBTDevice* /*aDev*/)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTSSPPasskeyEntryNotifier::HandleGetDeviceCompletedL()"));
-    iAnswer = 0;
-    
-    // Check if blocked device. 
-    if( CheckBlockedDeviceL() )
-        return;
-
-    // For pairing request from remote device
-    if ( !iLocallyInitiated )
-        {
-        TBool keypress = AuthoriseIncomingPairingL();
-        if( !keypress )
-            {
-            //User rejects the incoming pairing, complete message in QueryBlockDevice.
-            FLOG(_L("[BTNOTIF]\t CBTSSPPasskeyEntryNotifier::HandleGetDeviceCompletedL() <<"));
-            return;
-            }
-        }
-   
-    TBTDeviceName nameCoverUi( KNullDesC );
-    
-    iBuf.Zero();
-    iBuf.Append(iPasskey);
-    iBuf.Append(_L("    "));
-    
-    RBuf prompt;
-    prompt.CleanupClosePushL();
-    GenerateQueryPromptL( prompt );
-    
-    TInt answer = iNotifUiUtil->ShowQueryL( prompt, R_BT_PASSKEY_QUERY, 
-            ECmdBTnotifUnavailable, nameCoverUi );    
-    CleanupStack::PopAndDestroy( &prompt );  
-
-    if( iAnswer ) // user pressed entry key from remote keyboard.
-        {
-        CompleteMessage(KErrNone);
-        }
-    else 
-        {
-        // If the outgoing pairing mode is set, then this is bonding initiated by the user.
-        TBool incomingConn = ( OutgoPairingMode( iBTAddr ) == EBTOutgoingPairNone );
-        if( !iMessage.IsNull() )
-            {
-            // No need to inform the user of the pairing result if the user cancelled it.
-            // If user doesn't answer anything but stack cancels, pairing result is needed 
-            // to show for outgoing pairing. In this case, don't stop pairng observer.
-            (void) CBTEngConnMan::StopPairingObserver( iBTAddr );
-            }
-        // We may be asking for pairing (locally initiated), because a remote device is requesting
-        // accesss to a service for which we require authentication.
-        if( iLocallyInitiated && incomingConn )
-            {
-            CheckAndHandleQueryIntervalL();
-            }
-        CompleteMessage(KErrCancel);
-        }
-    
-     FLOG(_L("[BTNOTIF]\t CBTSSPPasskeyEntryNotifier::HandleGetDeviceCompletedL() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTSSPPasskeyEntryNotifier::GenerateQueryPromptL
-// ----------------------------------------------------------
-//
-void CBTSSPPasskeyEntryNotifier::GenerateQueryPromptL(  RBuf& aRBuf )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTSSPPasskeyEntryNotifier::GenerateQueryPromptL()"));
-    TBTDeviceName devName; 
-    BtNotifNameUtils::GetDeviceDisplayName(devName, iDevice);   
-    BluetoothUiUtil::LoadResourceAndSubstringL( 
-            aRBuf, R_BT_SSP_PASSKEY_ENTRY, devName, 0 );
-    BluetoothUiUtil::AddSubstringL( aRBuf, iBuf, 1 );
-    FLOG(_L("[BTNOTIF]\t CBTSSPPasskeyEntryNotifier::GenerateQueryPromptL() << "));
-
-    }
-// End of File
--- a/bluetoothengine/btnotif/src/btnumcmpnotifier.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,235 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 Numeric Comparison notifier for Secure Simle Pairing 
-*
-*/
-
-
-// INCLUDE FILES
-#include <StringLoader.h>    // Localisation stringloader
-#include <utf.h>             // Unicode character conversion utilities
-#include <avkon.mbg>
-#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
-#include <btextnotifiers.h>
-#else
-#include <btextnotifiers.h>
-#include <btextnotifierspartner.h>
-#endif
-#include <BTNotif.rsg>       // Own resources
-#include "btnotif.hrh"       // Own resource header
-#include "btnumcmpnotifier.h"  // Own class definition
-#include "btNotifDebug.h"    // Debugging macros
-#include <btotgpairpub.inl>
-#include <btengconnman.h>
-#include <secondarydisplay/BTnotifSecondaryDisplayAPI.h>
-#include <bluetoothuiutil.h>
-#include "btnotifnameutils.h"
-
-#ifdef __SERIES60_HELP
-#include <hlplch.h>
-#include <csxhelp/bt.hlp.hrh> // The bt hrh info is needed, for help launching
-#endif
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------------
-// CBTNumCmpNotifier::NewL
-// Two-phased constructor.
-// ----------------------------------------------------------
-//
-CBTNumCmpNotifier* CBTNumCmpNotifier::NewL()
-    {
-    CBTNumCmpNotifier* self=new (ELeave) CBTNumCmpNotifier();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-// ----------------------------------------------------------
-// CBTNumCmpNotifier::CBTNumCmpNotifier
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// ----------------------------------------------------------
-//
-CBTNumCmpNotifier::CBTNumCmpNotifier()
-    {
-    iPasskeyToShow.Zero();
-    }
-
-// ----------------------------------------------------------
-// Destructor
-// ----------------------------------------------------------
-//
-CBTNumCmpNotifier::~CBTNumCmpNotifier()
-    {
-    }
-
-// ----------------------------------------------------------
-// CBTNumCmpNotifier::RegisterL
-// Register notifier.
-// ----------------------------------------------------------
-//
-CBTNumCmpNotifier::TNotifierInfo CBTNumCmpNotifier::RegisterL()
-    {
-    iInfo.iUid = KBTNumericComparisonNotifierUid;
-    iInfo.iChannel = KBTNumericComparisonNotifierUid;
-    iInfo.iPriority=ENotifierPriorityVHigh;
-    return iInfo;
-    }
-
-// ----------------------------------------------------------
-// CBTNumCmpNotifier::GetParamsL
-// Initialize parameters and check if device is already
-// in registry. Jump to RunL as soon as possible.
-// ----------------------------------------------------------
-//
-void CBTNumCmpNotifier::GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNumCmpNotifier::GetParamsL()"));
-
-    CBTNPairNotifierBase::GetParamsL( aBuffer, aReplySlot, aMessage );
-    
-    TBTNumericComparisonParamsPckg pckg;
- 	pckg.Copy(aBuffer);
- 	iBTAddr = pckg().DeviceAddress();
-    if ( OtherOutgoPairing( iBTAddr) )
-        {
-        // We won't allow incoming pairing during outgoing pairing:
-        FLOG(_L("[BTNOTIF]\t CBTNumCmpNotifier: outgoing pair in progress, reject incoming pair"));
-        CompleteMessage(KErrCancel);
-        return;
-        }
-    
-	TUint32 passkey = pckg().NumericalValue(); 
-	iLocallyInitiated = pckg().LocallyInitiated(); 
-	iPasskeyToShow.AppendNumFixedWidth(passkey, EDecimal, Klength);
-	iPasskeyToShow.Insert(3,_L(" "));
-
-	// base class
-	ProcessParamsGetDeviceL( iBTAddr, pckg().DeviceName() );
-	
-	FLOG(_L("[BTNOTIF]\t CBTNumCmpNotifier::GetParamsL() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTNumCmpNotifier::HandleGetDeviceCompletedL
-// Ask user response and return it to caller.
-// Store device into registry if user has accepted pairing.
-// ----------------------------------------------------------
-//
-void CBTNumCmpNotifier::HandleGetDeviceCompletedL(const CBTDevice* /*aDev*/)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNumCmpNotifier::HandleGetDeviceCompletedL()"));
-    
-    // Check if blocked device. 
-    if( CheckBlockedDeviceL() )
-        return;
-    
-    // Turn lights on and deactivate apps -key
-    iNotifUiUtil->TurnLightsOn();
-
-   	// For incoming pairing request
-	if(!iLocallyInitiated)
-	    {
-	    TBool keypress = AuthoriseIncomingPairingL();
-	    if( !keypress ) 
-	        {
-	        //User rejects the incoming pairing, complete message in QueryBlockDevice.
-	        FLOG(_L("[BTNOTIF]\t CBTNumCmpNotifier::HandleGetDeviceCompletedL() <<"));
-	        return;
-	        }
-	    }
-	
-	// For outgoing pairing request or accepted incoming pairing request,
-	// ask user to compare the pincodes in two devices.
-	TBTDeviceName nameCoverUi( KNullDesC );
-    RBuf prompt;
-    prompt.CleanupClosePushL();
-    GenerateQueryPromptL( prompt );
-    TInt answer = iNotifUiUtil->ShowQueryL( prompt, R_BT_GENERIC_QUERY, ECmdShowBtOpenCoverNote, nameCoverUi );   
-	CleanupStack::PopAndDestroy( &prompt ); 
-	
-    if( answer )
-        {
-        CompleteMessage(answer, KErrNone);
-        }
-    else
-        {
-        // If the outgoing pairing mode is set, then this is bonding initiated by the user.
-        TBool incomingConn = ( OutgoPairingMode( iBTAddr ) == EBTOutgoingPairNone );
-
-        if( !iMessage.IsNull() )
-            {
-            // No need to inform the user of the pairing result if the user cancelled it.
-            // If user doesn't answer anything but stack cancels, pairing result is needed 
-            // to show for outgoing pairing. In this case, don't stop pairng observer.
-            CBTEngConnMan::StopPairingObserver( iBTAddr );
-            }
-        // We may be asking for pairing (locally initiated), because a remote device is requesting
-        // accesss to a service for which we require authentication.
-        if( iLocallyInitiated && incomingConn )
-            {
-            CheckAndHandleQueryIntervalL();
-            }
-        CompleteMessage(KErrCancel);
-        }
-
-    FLOG(_L("[BTNOTIF]\t CBTNumCmpNotifier::HandleGetDeviceCompletedL() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTNumCmpNotifier::GenerateQueryPromptL
-// Generate prompt for Numeric Comparison query and return.
-// ----------------------------------------------------------
-//
-void CBTNumCmpNotifier::GenerateQueryPromptL( RBuf& aRBuf )
-    {
-    FLOG(_L("[BTNOTIF]\t CBTNumCmpNotifier::GenerateQueryPromptL()"));
-    TBTDeviceName devName;
-    BtNotifNameUtils::GetDeviceDisplayName( devName, iDevice );
-    TBuf<KBTDeviceShortNameLength> shortName;
-    
-    TPtrC namePtr;
-    // Cut the name and put ellipsis in the middle if necessary
-    // By example "SampleSymbianDevice" after this operation will be shown in
-    // the dialog as "Sam...ice"(for 7 chars device name limit)
-    // This need to be done, because if name of the device is too long, the PIN
-    // codes aren't visible and user can't compare it with PIN code taken from
-    // other phone
-    if ( devName.Length() > KBTDeviceShortNameLength ) 
-        {
-        shortName.Copy( devName.Left( KBTDeviceShortNameLength/2 ) );
-        //adding ellipsis ("...") char in the middle of the string
-        shortName.Append( TChar( KEllipsis) );
-        //adding only end of the name to the final string
-        shortName.Append( devName.Right( shortName.MaxLength() - 
-                          shortName.Length() ) );
-        namePtr.Set( shortName );
-        }
-    else
-        {
-        namePtr.Set( devName );
-        }
-
-    BluetoothUiUtil::LoadResourceAndSubstringL( 
-            aRBuf, R_BT_SSP_PASSKEY_COMPARISON_PROMPT, namePtr, 0 );
-    // Numeric comparison key shall not be localized either, use our own
-    // string loading:
-    BluetoothUiUtil::AddSubstringL( aRBuf, iPasskeyToShow, 1);
-    FLOG(_L("[BTNOTIF]\t CBTNumCmpNotifier::GenerateQueryPromptL() <<"));
-
-    }
-
-// End of File
--- a/bluetoothengine/btnotif/src/btuserconfnotifier.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,153 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Declares User confirmation notifier for Secure Simle Pairing 
-*
-*/
-
-
-// INCLUDE FILES
-#include <StringLoader.h>    // Localisation stringloader
-#include <utf.h>             // Unicode character conversion utilities
-#include <avkon.mbg>
-#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
-#include <btextnotifiers.h>
-#else
-#include <btextnotifiers.h>
-#include <btextnotifierspartner.h>
-#endif
-#include <BTNotif.rsg>       // Own resources
-#include "btnotif.hrh"       // Own resource header
-#include "btuserconfnotifier.h"  // Own class definition
-#include "btNotifDebug.h"    // Debugging macros
-#include <btotgpairpub.inl>
-#include <btengconnman.h>
-#include <secondarydisplay/BTnotifSecondaryDisplayAPI.h>
-#include <bluetoothuiutil.h>
-#include "btnotifnameutils.h"
-
-#ifdef __SERIES60_HELP
-#include <hlplch.h>
-#include <csxhelp/bt.hlp.hrh> // The bt hrh info is needed, for help launching
-#endif
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------------
-// CBTUserConfNotifier::NewL
-// Two-phased constructor.
-// ----------------------------------------------------------
-//
-CBTUserConfNotifier* CBTUserConfNotifier::NewL()
-    {
-    CBTUserConfNotifier* self=new (ELeave) CBTUserConfNotifier();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-// ----------------------------------------------------------
-// CBTUserConfNotifier::CBTUserConfNotifier
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// ----------------------------------------------------------
-//
-CBTUserConfNotifier::CBTUserConfNotifier()
-    {
-    
-    }
-
-// ----------------------------------------------------------
-// Destructor
-// ----------------------------------------------------------
-//
-CBTUserConfNotifier::~CBTUserConfNotifier()
-    {
-    }
-
-// ----------------------------------------------------------
-// CBTUserConfNotifier::RegisterL
-// Register notifier.
-// ----------------------------------------------------------
-//
-CBTUserConfNotifier::TNotifierInfo CBTUserConfNotifier::RegisterL()
-    {
-    iInfo.iUid = KBTUserConfirmationNotifierUidCopy;
-    iInfo.iChannel = KBTUserConfirmationNotifierUidCopy;
-    iInfo.iPriority=ENotifierPriorityVHigh;
-    return iInfo;
-    }
-
-// ----------------------------------------------------------
-// CBTUserConfNotifier::GetParamsL
-// Initialize parameters and check if device is already
-// in registry. Jump to RunL as soon as possible.
-// ----------------------------------------------------------
-//
-void CBTUserConfNotifier::GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTUserConfNotifier::GetParamsL()"));
-
-    CBTNPairNotifierBase::GetParamsL( aBuffer, aReplySlot, aMessage );
-    
-    TBTUserConfirmationParamsPckgCopy pckg;
- 	pckg.Copy(aBuffer);
- 	iBTAddr = pckg().DeviceAddress();
-    if ( OtherOutgoPairing( iBTAddr) )
-        {
-        // We won't allow incoming pairing during outgoing pairing:
-        FLOG(_L("[BTNOTIF]\t CBTUserConfNotifier: outgoing pair in progress, reject incoming pair"));
-        CompleteMessage(KErrCancel);
-        return;
-        }
-    
-	iLocallyInitiated = pckg().LocallyInitiated(); 
-
-	// base class
-	ProcessParamsGetDeviceL( iBTAddr, pckg().DeviceName() );
-	
-	FLOG(_L("[BTNOTIF]\t CBTUserConfNotifier::GetParamsL() completed"));
-    }
-
-// ----------------------------------------------------------
-// CBTUserConfNotifier::HandleGetDeviceCompletedL
-// Ask user response and return it to caller.
-// Store device into registry if user has accepted pairing.
-// ----------------------------------------------------------
-//
-void CBTUserConfNotifier::HandleGetDeviceCompletedL(const CBTDevice* /*aDev*/)
-    {
-    FLOG(_L("[BTNOTIF]\t CBTUserConfNotifier::HandleGetDeviceCompletedL()"));
-    
-    // Check if blocked device. 
-    if( CheckBlockedDeviceL() )
-        return;
-    
-    // Turn lights on and deactivate apps -key
-    iNotifUiUtil->TurnLightsOn();
-
-   	// For incoming pairing request
-    TBool answer = AuthoriseIncomingPairingL();
-    if( !answer ) 
-        {
-        //User rejects the incoming pairing, complete message in QueryBlockDevice.
-        FLOG(_L("[BTNOTIF]\t CBTUserConfNotifier::HandleGetDeviceCompletedL() <<"));
-        return;
-        }
-    CompleteMessage(answer, KErrNone);
-
-    FLOG(_L("[BTNOTIF]\t CBTUserConfNotifier::HandleGetDeviceCompletedL() completed"));
-    }
-
-// End of File
--- a/bluetoothengine/btnotif/tsrc/BtNotifApiTest/Bmarm/BtNotifApiTestU.DEF	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
-
--- a/bluetoothengine/btnotif/tsrc/BtNotifApiTest/Bwins/BtNotifApiTestU.DEF	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
-
--- a/bluetoothengine/btnotif/tsrc/BtNotifApiTest/EABI/BtNotifApiTestU.def	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
-
--- a/bluetoothengine/btnotif/tsrc/BtNotifApiTest/conf/ui_BtNotifApiTest.cfg	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,834 +0,0 @@
-// BT notif tests - 74 tc 
-
-
-// Paired device setting notifier tests
-
-
-
-// PBAP authorization query notifier tests (2)
-
-[Test]
-title BT Correct Passkey Entered (PBAP Auth Query Notifier Test)
-create BtNotifApiTest tester
-tester PbapAuthNotifierTest
-pause 1000
-presskey global 0
-presskey global 0
-presskey global 0
-presskey global 0
-presskey global EKeyDevice0
-tester FinishPbapAuthQuery PASSKEY
-delete tester
-[Endtest]
-
-[Test]
-title BT PBAP Auth Query Cancelled (PBAP Auth Query Notifier Test)
-create BtNotifApiTest tester
-tester PbapAuthNotifierTest
-pause 1000
-presskey global EKeyDevice1
-tester FinishPbapAuthQuery CANCEL
-delete tester
-[Endtest]
-
-// Passkey display notifier tests (4)
-
-[Test]
-title BT Remote Connection/Pairing Discarded/Device Blocked (Passkey Display Notifier Test)
-create BtNotifApiTest tester
-tester PasskeyDisplayNotifierTest REMOTE
-pause 1000
-presskey global EKeyDevice1
-pause 1000
-presskey global EKeyDevice0
-tester FinishPasskeyDisplayQuery BLOCK
-delete tester
-[Endtest]
-
-[Test]
-title BT Remote Connection/Pairing Discarded/Device Not Blocked (Passkey Display Notifier Test)
-create BtNotifApiTest tester
-tester PasskeyDisplayNotifierTest REMOTE
-pause 1000
-presskey global EKeyDevice1
-pause 1000
-presskey global EKeyDevice1
-tester FinishPasskeyDisplayQuery NONBLOCK
-delete tester
-[Endtest]
-
-[Test]
-title BT Remote Connection/Pairing Allowed (Passkey Display Notifier Test)
-create BtNotifApiTest tester
-tester PasskeyDisplayNotifierTest REMOTE
-pause 1000
-presskey global EKeyDevice0
-pause 1000
-presskey global EKeyDevice1
-tester FinishPasskeyDisplayQuery
-delete tester
-[Endtest]
-
-[Test]
-title BT Local Connection/Pairing Allowed (Passkey Display Notifier Test)
-create BtNotifApiTest tester
-tester PasskeyDisplayNotifierTest LOCAL
-pause 1000
-presskey global EKeyDevice1
-tester FinishPasskeyDisplayQuery
-delete tester
-[Endtest]
-
-// Numeric comparison query notifier tests (6)
-
-[Test]
-title BT Remote Connection/Pairing Discarded/Device Blocked (Numeric Comparison Query Notifier Test)
-create BtNotifApiTest tester
-tester NumericComparisonQueryNotifierTest REMOTE
-pause 1000
-presskey global EKeyDevice1
-pause 1000
-presskey global EKeyDevice0
-tester FinishNumericComparisonQuery CANCEL BLOCK
-delete tester
-[Endtest]
-
-[Test]
-title BT Remote Connection/Pairing Discarded/Device Not Blocked (Numeric Comparison Query Notifier Test)
-create BtNotifApiTest tester
-tester NumericComparisonQueryNotifierTest REMOTE
-pause 1000
-presskey global EKeyDevice1
-pause 1000
-presskey global EKeyDevice1
-tester FinishNumericComparisonQuery CANCEL NONBLOCK
-delete tester
-[Endtest]
-
-[Test]
-title BT Remote Connection/Pairing Allowed/Code Mismatch (Numeric Comparison Query Notifier Test)
-create BtNotifApiTest tester
-tester NumericComparisonQueryNotifierTest REMOTE
-pause 1000
-presskey global EKeyDevice0
-pause 1000
-presskey global EKeyDevice1
-tester FinishNumericComparisonQuery DISCARD
-delete tester
-[Endtest]
-
-[Test]
-title BT Remote Connection/Pairing Allowed/Code Match (Numeric Comparison Query Notifier Test)
-create BtNotifApiTest tester
-tester NumericComparisonQueryNotifierTest REMOTE
-pause 1000
-presskey global EKeyDevice0
-pause 1000
-presskey global EKeyDevice0
-tester FinishNumericComparisonQuery ACCEPT
-delete tester
-[Endtest]
-
-[Test]
-title BT Local Connection/Code Mismatch (Numeric Comparison Query Notifier Test)
-create BtNotifApiTest tester
-tester NumericComparisonQueryNotifierTest LOCAL
-pause 1000
-presskey global EKeyDevice1
-tester FinishNumericComparisonQuery DISCARD
-delete tester
-[Endtest]
-
-[Test]
-title BT Local Connection/Code Match (Numeric Comparison Query Notifier Test)
-create BtNotifApiTest tester
-tester NumericComparisonQueryNotifierTest LOCAL
-pause 1000
-presskey global EKeyDevice0
-tester FinishNumericComparisonQuery ACCEPT
-delete tester
-[Endtest]
-
-// Authorization query notifier tests (3)
-
-[Test]
-title BT Authorization Query Discarded - Accept Blocking (Authorization Query Notifier Test)
-create BtNotifApiTest tester
-tester AuthQueryNotifierTest
-pause 1000
-presskey global EKeyDevice1
-pause 1000
-presskey global EKeyDevice0
-tester FinishAuthQuery DISCARD BLOCK
-delete tester
-[Endtest]
-
-[Test]
-title BT Authorization Query Discarded - Discard Blocking (Authorization Query Notifier Test)
-create BtNotifApiTest tester
-tester AuthQueryNotifierTest
-pause 1000
-presskey global EKeyDevice1
-pause 1000
-presskey global EKeyDevice1
-tester FinishAuthQuery DISCARD NONBLOCK
-delete tester
-[Endtest]
-
-[Test]
-title BT Authorization Query Accepted (Authorization Query Notifier Test)
-create BtNotifApiTest tester
-tester AuthQueryNotifierTest
-pause 1000
-presskey global EKeyDevice0
-tester FinishAuthQuery ACCEPT
-delete tester
-[Endtest]
-
-// PIN query notifier tests (10)
-
-[Test]
-title BT Remote Connection/Pairing Discarded/Device Blocked (Pin Query Notifier Test)
-create BtNotifApiTest tester
-tester PinPasskeyQueryNotifierTest REMOTE
-pause 1000
-presskey global EKeyDevice1
-pause 1000
-presskey global EKeyDevice0
-tester FinishPinPasskeyQuery CANCEL DISCARDCONN BLOCK
-delete tester
-[Endtest]
-
-[Test]
-title BT Remote Connection/Pairing Discarded/Device Not Blocked (Pin Query Notifier Test)
-create BtNotifApiTest tester
-tester PinPasskeyQueryNotifierTest REMOTE
-pause 1000
-presskey global EKeyDevice1
-pause 1000
-presskey global EKeyDevice1
-tester FinishPinPasskeyQuery CANCEL DISCARDCONN NONBLOCK
-delete tester
-[Endtest]
-
-[Test]
-title BT Remote Connection/Pairing Allowed/Correct Pin Entered (Pin Query Notifier Test)
-create BtNotifApiTest tester
-tester PinPasskeyQueryNotifierTest REMOTE
-pause 1000
-presskey global EKeyDevice0
-pause 1000
-presskey global 0
-presskey global 0
-presskey global 0
-presskey global 0
-presskey global EKeyDevice0
-tester FinishPinPasskeyQuery PASSKEY
-delete tester
-[Endtest]
-
-[Test]
-title BT Remote Connection/Pairing Allowed/Too Short Pin Entered (Pin Query Notifier Test)
-create BtNotifApiTest tester
-tester PinPasskeyQueryNotifierTest REMOTE
-pause 1000
-presskey global EKeyDevice0
-pause 1000
-presskey global 0
-presskey global 0
-presskey global 0
-presskey global EKeyDevice0
-pause 1000
-presskey global 0
-presskey global 0
-presskey global 0
-presskey global 0
-presskey global EKeyDevice0
-tester FinishPinPasskeyQuery PASSKEY
-delete tester
-[Endtest]
-
-[Test]
-title BT Remote Connection/Pairing Allowed/Pin Query Cancelled (Pin Query Notifier Test)
-create BtNotifApiTest tester
-tester PinPasskeyQueryNotifierTest REMOTE
-pause 1000
-presskey global EKeyDevice0
-pause 1000
-presskey global EKeyDevice1
-tester FinishPinPasskeyQuery CANCEL ACCEPTCONN
-delete tester
-[Endtest]
-
-[Test]
-title BT Remote Connection/Pairing Allowed/Too Short Pin Entered/Pin Query Cancelled (Pin Query Notifier Test)
-create BtNotifApiTest tester
-tester PinPasskeyQueryNotifierTest REMOTE
-pause 1000
-presskey global EKeyDevice0
-pause 1000
-presskey global 0
-presskey global 0
-presskey global 0
-presskey global EKeyDevice0
-pause 1000
-presskey global EKeyDevice1
-tester FinishPinPasskeyQuery CANCEL ACCEPTCONN
-delete tester
-[Endtest]
-
-[Test]
-title BT Local Connection/Correct Pin Entered (Pin Query Notifier Test)
-create BtNotifApiTest tester
-tester PinPasskeyQueryNotifierTest LOCAL
-pause 1000
-presskey global EKeyDevice0
-pause 1000
-presskey global 0
-presskey global 0
-presskey global 0
-presskey global 0
-presskey global EKeyDevice0
-tester FinishPinPasskeyQuery PASSKEY
-delete tester
-[Endtest]
-
-[Test]
-title BT Local Connection/Too Short Pin Entered (Pin Query Notifier Test)
-create BtNotifApiTest tester
-tester PinPasskeyQueryNotifierTest LOCAL
-pause 1000
-presskey global EKeyDevice0
-pause 1000
-presskey global 0
-presskey global 0
-presskey global 0
-presskey global EKeyDevice0
-pause 1000
-presskey global 0
-presskey global 0
-presskey global 0
-presskey global 0
-presskey global EKeyDevice0
-tester FinishPinPasskeyQuery PASSKEY
-delete tester
-[Endtest]
-
-[Test]
-title BT Local Connection/Pin Query Cancelled (Pin Query Notifier Test)
-create BtNotifApiTest tester
-tester PinPasskeyQueryNotifierTest LOCAL
-pause 1000
-presskey global EKeyDevice0
-pause 1000
-presskey global EKeyDevice1
-tester FinishPinPasskeyQuery CANCEL
-delete tester
-[Endtest]
-
-[Test]
-title BT Local Connection/Too Short Pin Entered/Pin Query Cancelled (Pin Query Notifier Test)
-create BtNotifApiTest tester
-tester PinPasskeyQueryNotifierTest LOCAL
-pause 1000
-presskey global EKeyDevice0
-pause 1000
-presskey global 0
-presskey global 0
-presskey global 0
-presskey global EKeyDevice0
-pause 1000
-presskey global EKeyDevice1
-tester FinishPinPasskeyQuery CANCEL
-delete tester
-[Endtest]
-
-// Inquiry notifier tests (8)
-
-[Test]
-title BT Not Switched On (Inquiry Notifier Test)
-create BtNotifApiTest tester
-tester InquiryNotifierTest BTOFF
-presskey global EKeyDevice1
-tester FinishInquiry CANCEL
-delete tester
-[Endtest]
-
-[Test]
-title BT Launch Inquiry/Test Device Paired/Cancel Search (Inquiry Notifier Test)
-create BtNotifApiTest tester
-tester InquiryNotifierTest PAIRED
-presskey global EKeyEnter
-pause 1000
-presskey global EKeyUpArrow
-pause 1000
-presskey global EKeyEnter
-presskey global EKeyDevice1
-tester FinishInquiry CANCEL
-delete tester
-[Endtest]
-
-[Test]
-title BT Launch Inquiry/Test Device Paired/Switch BT Off (Inquiry Notifier Test)
-create BtNotifApiTest tester
-tester InquiryNotifierTest PAIRED
-presskey global EKeyEnter
-pause 1000
-presskey global EKeyUpArrow
-pause 1000
-presskey global EKeyEnter
-tester FinishInquiry CANCEL BTOFF
-delete tester
-[Endtest]
-
-[Test]
-title BT Select Paired Test Device (Inquiry Notifier Test)
-create BtNotifApiTest tester
-tester InquiryNotifierTest PAIRED
-presskey global EKeyDownArrow
-pause 1000
-presskey global EKeyEnter
-tester FinishInquiry ACCEPT
-delete tester
-[Endtest]
-
-[Test]
-title BT Launch Inquiry/Test Device Paired/Inquiry Timeout (Inquiry Notifier Test)
-create BtNotifApiTest tester
-tester InquiryNotifierTest PAIRED
-presskey global EKeyEnter
-pause 1000
-presskey global EKeyEnter
-pause 60000
-tester TurnLightsOn
-pause 10000
-presskey global EKeyDevice1
-tester FinishInquiry CANCEL
-tester TurnLightsOn
-delete tester
-[Endtest]
-
-[Test]
-title BT Launch Inquiry/Cancel Search (Inquiry Notifier Test)
-create BtNotifApiTest tester
-tester InquiryNotifierTest NONPAIRED
-presskey global EKeyUpArrow
-pause 1000
-presskey global EKeyEnter
-presskey global EKeyDevice1
-tester FinishInquiry CANCEL
-delete tester
-[Endtest]
-
-[Test]
-title BT Launch Inquiry/Switch BT Off (Inquiry Notifier Test)
-create BtNotifApiTest tester
-tester InquiryNotifierTest NONPAIRED
-presskey global EKeyUpArrow
-pause 1000
-presskey global EKeyEnter
-tester FinishInquiry CANCEL BTOFF
-delete tester
-[Endtest]
-
-[Test]
-title BT Launch Inquiry/Inquiry Timeout (Inquiry Notifier Test)
-create BtNotifApiTest tester
-tester InquiryNotifierTest NONPAIRED
-presskey global EKeyEnter
-pause 60000
-tester TurnLightsOn
-pause 10000
-presskey global EKeyDevice1
-tester FinishInquiry CANCEL
-tester TurnLightsOn
-delete tester
-[Endtest]
-
-// OBEX PIN query notifier tests (2)
-
-[Test]
-title BT Correct Passkey (OBEX PIN Query Notifier Test)
-create BtNotifApiTest tester
-tester ObexPasskeyQueryNotifierTest
-pause 1000
-presskey global 0
-presskey global 0
-presskey global 0
-presskey global 0
-presskey global EKeyDevice0 
-tester FinishObexPasskeyQuery PASSKEY
-delete tester
-[Endtest]
-
-[Test]
-title BT Query Canceled (OBEX PIN Query Notifier Test)
-create BtNotifApiTest tester
-tester ObexPasskeyQueryNotifierTest
-pause 1000
-presskey global EKeyDevice1
-tester FinishObexPasskeyQuery CANCEL
-delete tester
-[Endtest]
-
-// Power mode notifier tests (2)
-
-[Test]
-title BT Power Mode Query Discarded (Power Mode Notifier Test)
-create BtNotifApiTest tester
-tester PowerModeQueryNotifierTest
-pause 1000
-presskey global EKeyDevice1
-tester FinishPowerModeQuery DISCARD
-delete tester
-[Endtest]
-
-[Test]
-title BT Power Mode Query Accepted (Power Mode Notifier Test)
-create BtNotifApiTest tester
-tester PowerModeQueryNotifierTest
-pause 1000
-presskey global EKeyDevice0
-tester FinishPowerModeQuery ACCEPT
-delete tester
-[Endtest]
-
-// Generic info notifier tests (17)
-
-[Test]
-title BT Connected (Generic Info Notifier Test)
-create BtNotifApiTest tester
-tester GenericInfoNotifierTest EBTConnected
-delete tester
-pause 6000
-[Endtest]
-
-[Test]
-title BT Disconnected (Generic Info Notifier Test)
-create BtNotifApiTest tester
-tester GenericInfoNotifierTest EBTDisconnected
-delete tester
-pause 6000
-[Endtest]
-
-[Test]
-title BT Audio Accessory (Generic Info Notifier Test)
-create BtNotifApiTest tester
-tester GenericInfoNotifierTest EBTAudioAccessory
-delete tester
-pause 6000
-[Endtest]
-
-[Test]
-title BT Audio Handset (Generic Info Notifier Test)
-create BtNotifApiTest tester
-tester GenericInfoNotifierTest EBTAudioHandset
-delete tester
-pause 6000
-[Endtest]
-
-[Test]
-title BT Closed (Generic Info Notifier Test)
-create BtNotifApiTest tester
-tester GenericInfoNotifierTest EBTClosed
-delete tester
-pause 6000
-[Endtest]
-
-[Test]
-title BT Device Not Available (Generic Info Notifier Test)
-create BtNotifApiTest tester
-tester GenericInfoNotifierTest EBTDeviceNotAvailable
-delete tester
-pause 6000
-[Endtest]
-
-[Test]
-title BT Offline Disabled (Generic Info Notifier Test)
-create BtNotifApiTest tester
-tester GenericInfoNotifierTest EBTOfflineDisabled
-delete tester
-pause 6000
-[Endtest]
-
-[Test]
-title BT Visibility Timeout (Generic Info Notifier Test)
-create BtNotifApiTest tester
-tester GenericInfoNotifierTest EBTVisibilityTimeout
-delete tester
-pause 6000
-[Endtest]
-
-[Test]
-title BT Enter SAP (Generic Info Notifier Test)
-create BtNotifApiTest tester
-tester GenericInfoNotifierTest EBTEnterSap
-delete tester
-pause 6000
-[Endtest]
-
-[Test]
-title BT SAP Ok (Generic Info Notifier Test)
-create BtNotifApiTest tester
-tester GenericInfoNotifierTest EBTSapOk
-delete tester
-pause 6000
-[Endtest]
-
-[Test]
-title BT SAP Failed (Generic Info Notifier Test)
-create BtNotifApiTest tester
-tester GenericInfoNotifierTest EBTSapFailed
-delete tester
-pause 6000
-[Endtest]
-
-[Test]
-title BT SAP No SIM (Generic Info Notifier Test)
-create BtNotifApiTest tester
-tester GenericInfoNotifierTest EBTSapNoSim
-delete tester
-pause 6000
-[Endtest]
-
-[Test]
-title BT Device Busy (Generic Info Notifier Test)
-create BtNotifApiTest tester
-tester GenericInfoNotifierTest EBTDeviceBusy
-delete tester
-pause 6000
-[Endtest]
-
-[Test]
-title IR Not Supported (Generic Info Notifier Test)
-create BtNotifApiTest tester
-tester GenericInfoNotifierTest EIRNotSupported
-delete tester
-pause 6000
-[Endtest]
-
-[Test]
-title BT Cmd Show BT Battery Low (Generic Info Notifier Test)
-create BtNotifApiTest tester
-tester GenericInfoNotifierTest ECmdShowBtBatteryLow
-delete tester
-pause 6000
-[Endtest]
-
-[Test]
-title BT Cmd Show BT Battery Critical (Generic Info Notifier Test)
-create BtNotifApiTest tester
-tester GenericInfoNotifierTest ECmdShowBtBatteryCritical
-delete tester
-pause 6000
-[Endtest]
-
-[Test]
-title BT Stay Power On (Generic Info Notifier Test)
-create BtNotifApiTest tester
-tester GenericInfoNotifierTest EBTStayPowerOn
-delete tester
-pause 6000
-[Endtest]
-
-// Generic query notifier tests (20)
-
-[Test]
-title BT Receive Message Discarded (Generic Query Notifier Test)
-create BtNotifApiTest tester
-tester GenericQueryNotifierTest EBTReceiveMessageQuery
-pause 1000
-presskey global EKeyDevice1
-tester FinishGenericQuery DISCARD
-delete tester
-[Endtest] 
-
-[Test]
-title BT Receive Message Accepted (Generic Query Notifier Test)
-create BtNotifApiTest tester
-tester GenericQueryNotifierTest EBTReceiveMessageQuery
-pause 1000
-presskey global EKeyDevice0
-tester FinishGenericQuery ACCEPT
-delete tester
-[Endtest] 
-
-[Test]
-title BT Receive Message Paired Discarded (Generic Query Notifier Test)
-create BtNotifApiTest tester
-tester GenericQueryNotifierTest EBTReceiveMessagePairedQuery
-pause 1000
-presskey global EKeyDevice1
-tester FinishGenericQuery DISCARD
-delete tester
-[Endtest] 
-
-[Test]
-title BT Receive Message Paired Accepted (Generic Query Notifier Test)
-create BtNotifApiTest tester
-tester GenericQueryNotifierTest EBTReceiveMessagePairedQuery
-pause 1000
-presskey global EKeyDevice0
-tester FinishGenericQuery ACCEPT
-delete tester
-[Endtest] 
-
-[Test]
-title BT Is Off Discarded (Generic Query Notifier Test)
-create BtNotifApiTest tester
-tester GenericQueryNotifierTest EBTIsOffQuery
-pause 1000
-presskey global EKeyDevice1
-tester FinishGenericQuery DISCARD
-delete tester
-[Endtest] 
-
-[Test]
-title BT Is Off Accepted (Generic Query Notifier Test)
-create BtNotifApiTest tester
-tester GenericQueryNotifierTest EBTIsOffQuery
-pause 1000
-presskey global EKeyDevice0
-tester FinishGenericQuery ACCEPT
-delete tester
-[Endtest] 
-
-[Test]
-title BT Activate Offline Discarded (Generic Query Notifier Test)
-create BtNotifApiTest tester
-tester GenericQueryNotifierTest EBTActivateOffLineQuery
-pause 1000
-presskey global EKeyDevice1
-tester FinishGenericQuery DISCARD
-delete tester
-[Endtest] 
-
-[Test]
-title BT Activate Offline Accepted (Generic Query Notifier Test)
-create BtNotifApiTest tester
-tester GenericQueryNotifierTest EBTActivateOffLineQuery
-pause 1000
-presskey global EKeyDevice0
-tester FinishGenericQuery ACCEPT
-delete tester
-[Endtest] 
-
-[Test]
-title BT No Devices Found Discarded (Generic Query Notifier Test)
-create BtNotifApiTest tester
-tester GenericQueryNotifierTest EBTNoDevicesFoundQuery
-pause 1000
-presskey global EKeyDevice1
-tester FinishGenericQuery DISCARD
-delete tester
-[Endtest] 
-
-[Test]
-title BT No Devices Found Accepted (Generic Query Notifier Test)
-create BtNotifApiTest tester
-tester GenericQueryNotifierTest EBTNoDevicesFoundQuery
-pause 1000
-presskey global EKeyDevice0
-tester FinishGenericQuery ACCEPT
-delete tester
-[Endtest] 
-
-[Test]
-title BT Accept Request Discarded (Generic Query Notifier Test)
-create BtNotifApiTest tester
-tester GenericQueryNotifierTest EBTAcceptRequestQuery
-pause 1000
-presskey global EKeyDevice1
-tester FinishGenericQuery DISCARD
-delete tester
-[Endtest] 
-
-[Test]
-title BT Accept Request Accepted (Generic Query Notifier Test)
-create BtNotifApiTest tester
-tester GenericQueryNotifierTest EBTAcceptRequestQuery
-pause 1000
-presskey global EKeyDevice0
-tester FinishGenericQuery ACCEPT
-delete tester
-[Endtest] 
-
-[Test]
-title BT Block Connection Discarded (Generic Query Notifier Test)
-create BtNotifApiTest tester
-tester GenericQueryNotifierTest EBTBlockConnectionQuery
-pause 1000
-presskey global EKeyDevice1
-tester FinishGenericQuery DISCARD
-delete tester
-[Endtest] 
-
-[Test]
-title BT Block Connection Accepted (Generic Query Notifier Test)
-create BtNotifApiTest tester
-tester GenericQueryNotifierTest EBTBlockConnectionQuery
-pause 1000
-presskey global EKeyDevice0
-tester FinishGenericQuery ACCEPT
-delete tester
-[Endtest] 
-
-[Test]
-title BT Block Paired Connection Discarded (Generic Query Notifier Test)
-create BtNotifApiTest tester
-tester GenericQueryNotifierTest EBTBlockPairedConnectionQuery
-pause 1000
-presskey global EKeyDevice1
-tester FinishGenericQuery DISCARD
-delete tester
-[Endtest] 
-
-[Test]
-title BT Block Paired Connection Accepted (Generic Query Notifier Test)
-create BtNotifApiTest tester
-tester GenericQueryNotifierTest EBTBlockPairedConnectionQuery
-pause 1000
-presskey global EKeyDevice0
-tester FinishGenericQuery ACCEPT
-delete tester
-[Endtest] 
-
-[Test]
-title BT Is Not Shown Discarded (Generic Query Notifier Test)
-create BtNotifApiTest tester
-tester GenericQueryNotifierTest EBTIsNotShownQuery
-pause 1000
-presskey global EKeyDevice1
-tester FinishGenericQuery DISCARD
-delete tester
-[Endtest] 
-
-[Test]
-title BT Is Not Shown Accepted (Generic Query Notifier Test)
-create BtNotifApiTest tester
-tester GenericQueryNotifierTest EBTIsNotShownQuery
-pause 1000
-presskey global EKeyDevice0
-tester FinishGenericQuery ACCEPT
-delete tester
-[Endtest] 
-
-[Test]
-title BT Is Off Java Discarded (Generic Query Notifier Test)
-create BtNotifApiTest tester
-tester GenericQueryNotifierTest EBTIsOffJavaQuery
-pause 1000
-presskey global EKeyDevice1
-tester FinishGenericQuery DISCARD
-delete tester
-[Endtest] 
-
-[Test]
-title BT Is Off Java Accepted (Generic Query Notifier Test)
-create BtNotifApiTest tester
-tester GenericQueryNotifierTest EBTIsOffJavaQuery
-pause 1000
-presskey global EKeyDevice0
-tester FinishGenericQuery ACCEPT
-delete tester
-[Endtest]
\ No newline at end of file
--- a/bluetoothengine/btnotif/tsrc/BtNotifApiTest/group/BtNotifApiTest.mmp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-#if defined(__S60_)
-        // To get the OSEXT_LAYER_SYSTEMINCLUDE-definition
-        #include <platform_paths.hrh>
-#endif
-
-TARGET          BtNotifApiTest.dll
-TARGETTYPE      dll
-UID             0x1000008D 0x101FB3E3
-
-CAPABILITY      ALL -TCB
-
-DEFFILE         BtNotifApiTest.def
-
-MW_LAYER_SYSTEMINCLUDE
-
-USERINCLUDE	../inc 
-USERINCLUDE	../../../inc
-
-SOURCEPATH      ../src
-SOURCE          BtNotifApiTest.cpp
-SOURCE          BtNotifApiTestBlocks.cpp BtSettingsObserver.cpp BtEngDevManObserver.cpp
-
-LIBRARY         euser.lib
-LIBRARY         stiftestinterface.lib
-LIBRARY         stiftestengine.lib
-LIBRARY         btengsettings.lib
-LIBRARY		bluetooth.lib
-LIBRARY		btextnotifiers.lib
-LIBRARY		btmanclient.lib
-LIBRARY		btdevice.lib
-LIBRARY 	BTEngDevMan.lib
-
-
-LANG            SC
-
-// End of File
--- a/bluetoothengine/btnotif/tsrc/BtNotifApiTest/group/BtNotifApiTest.pkg	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description: 
-;
-
-; Languages
-&EN
-
-; Provide value for uid
-#{"STIF"},(0x00000000),1,1,0,TYPE=SA
-
-; Series60 product id for S60 3.0
-[0x1028315F], 0, 0, 0, {"Series60ProductID"}
-
-; Localised Vendor name
-%{"Nokia"}
-
-; Unique Vendor name
-:"Nokia"
-
-; Logo
-; None
-
-; Package signature - Optional
-; None
-
-; Start of Package body
-
-; Condition blocks
-; None
-
-; Options list
-; None
-
-; Install files
-"\epoc32\release\armv5\udeb\BtNotifApiTest.dll"-"c:\Sys\Bin\BtNotifApiTest.dll"
-"..\init\BtNotifApiTest.ini"-"e:\testing\init\BtNotifApiTest.ini"
-"..\conf\ui_BtNotifApiTest.cfg"-"e:\testing\conf\ui_BtNotifApiTest.cfg"
-  
-; Embedded SIS 
-; None
-
-; End of Package body
-
-; PKG dependencies
-; None
-
-; PKG capabilities
-; None
--- a/bluetoothengine/btnotif/tsrc/BtNotifApiTest/group/BtNotifApiTest_phone.pkg	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description: 
-;
-
-; Languages
-&EN
-
-; Provide value for uid
-#{"STIF"},(0x00000000),1,1,0,TYPE=SA
-
-; Series60 product id for S60 3.0
-[0x1028315F], 0, 0, 0, {"Series60ProductID"}
-
-; Localised Vendor name
-%{"Nokia"}
-
-; Unique Vendor name
-:"Nokia"
-
-; Logo
-; None
-
-; Package signature - Optional
-; None
-
-; Start of Package body
-
-; Condition blocks
-; None
-
-; Options list
-; None
-
-; Install files
-"\epoc32\release\armv5\urel\BtNotifApiTest.dll"-"c:\Sys\Bin\BtNotifApiTest.dll"
-"..\init\BtNotifApiTest_phone.ini"-"c:\testframework\testframework.ini"
-"..\conf\ui_BtNotifApiTest.cfg"-"c:\testframework\ui_BtNotifApiTest.cfg"
-  
-; Embedded SIS 
-; None
-
-; End of Package body
-
-; PKG dependencies
-; None
-
-; PKG capabilities
-; None
--- a/bluetoothengine/btnotif/tsrc/BtNotifApiTest/group/bld.inf	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
-* 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:   ?Description
-*
-*/
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_TESTEXPORTS
-
-PRJ_EXPORTS
-
-PRJ_TESTMMPFILES
-BtNotifApiTest.mmp
-
-PRJ_MMPFILES
-
-//  End of File
--- a/bluetoothengine/btnotif/tsrc/BtNotifApiTest/group/build_sis.bat	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-rem
-rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-rem All rights reserved.
-rem This component and the accompanying materials are made available
-rem under the terms of "Eclipse Public License v1.0"
-rem which accompanies this distribution, and is available
-rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
-rem
-rem Initial Contributors:
-rem Nokia Corporation - initial contribution.
-rem
-rem Contributors:
-rem
-rem Description: 
-rem
-
-call abld test build armv5
-call makesis BtNotifApiTest.pkg
-call signsis BtNotifApiTest.sis BtNotifApiTest.sisx rd.cer rd-key.pem
--- a/bluetoothengine/btnotif/tsrc/BtNotifApiTest/group/build_sis_phone.bat	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-rem
-rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-rem All rights reserved.
-rem This component and the accompanying materials are made available
-rem under the terms of "Eclipse Public License v1.0"
-rem which accompanies this distribution, and is available
-rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
-rem
-rem Initial Contributors:
-rem Nokia Corporation - initial contribution.
-rem
-rem Contributors:
-rem
-rem Description: 
-rem
-
-call abld test build armv5
-call makesis BtNotifApiTest_phone.pkg
-call signsis BtNotifApiTest_phone.sis BtNotifApiTest_phone.sisx rd.cer rd-key.pem
--- a/bluetoothengine/btnotif/tsrc/BtNotifApiTest/inc/BtEngDevManObserver.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-
-#ifndef BTENGDEVMANOBSERVER_H_
-#define BTENGDEVMANOBSERVER_H_
-
-#include "BTEngDevMan.h"
-
-NONSHARABLE_CLASS( CBtEngDevManObserver ) : public MBTEngDevManObserver
-{
-public:
-	static CBtEngDevManObserver* NewL();
-	static CBtEngDevManObserver* NewLC();
-	
-	TInt GetDevices( const TBTRegistrySearch& aCriteria, 
-                               CBTDeviceArray* aResultArray );
-	TInt AddDevice( const CBTDevice& aDevice );
-	TInt DeleteDevices( const TBTRegistrySearch& aCriteria );
-    
-	virtual ~CBtEngDevManObserver();
-    void HandleDevManComplete( TInt aErr );
-    void HandleGetDevicesComplete( TInt aErr, CBTDeviceArray* aDeviceArray );
-	
-private:
-    CBtEngDevManObserver();
-    void ConstructL();
-    
-private:
-    CActiveSchedulerWait* iWait;
-    CBTEngDevMan* iDevMan;
-
-};
-
-#endif /*BTENGDEVMANOBSERVER_H_*/
--- a/bluetoothengine/btnotif/tsrc/BtNotifApiTest/inc/BtNotifApiTest.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,260 +0,0 @@
-/*
-* 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:   ?Description
-*
-*/
-
-
-
-
-#ifndef BTNOTIFAPITEST_H
-#define BTNOTIFAPITEST_H
-
-//  INCLUDES
-#include <StifLogger.h>
-#include <TestScripterInternal.h>
-#include <StifTestModule.h>
-#include <TestclassAssert.h>
-#include <btextnotifierspartner.h>
-
-#include "btnotif.h"
-#include "btmanclient.h"
-#include "btnotifierapi.h"
-#include "btextnotifiers.h"
-#include "coreapplicationuisdomainpskeys.h"
-
-#include "BtEngDevManObserver.h"
-#include "BtSettingsObserver.h"
-
-
-// CONSTANTS
-//const ?type ?constant_var = ?constant;
-
-// MACROS
-//#define ?macro ?macro_def
-#define TEST_CLASS_VERSION_MAJOR 0
-#define TEST_CLASS_VERSION_MINOR 0
-#define TEST_CLASS_VERSION_BUILD 0
-
-// Logging path
-//_LIT( KBtNotifApiTestLogPath, "\\logs\\testframework\\bt\\" );
-_LIT( KBtNotifApiTestLogPath, "e:\\testing\\stiflogs\\" );
-// Log file
-_LIT( KBtNotifApiTestLogFile, "BtNotifApiTest.txt" ); 
-_LIT( KBtNotifApiTestLogFileWithTitle, "BtNotifApiTest_[%S].txt" );
-
-// FUNCTION PROTOTYPES
-//?type ?function_name(?arg_list);
-
-// FORWARD DECLARATIONS
-//class ?FORWARD_CLASSNAME;
-class CBtNotifApiTest;
-
-// DATA TYPES
-//enum ?declaration
-//typedef ?declaration
-//extern ?data_type;
-
-enum TTestOption
-    {
-    EQueryDiscarded = 0,
-    EQueryAccepted,
-    ECheckPasskey,
-    EQueryCanceled
-    };
-
-// CLASS DECLARATION
-
-/**
-*  CBtNotifApiTest test class for STIF Test Framework TestScripter.
-*  ?other_description_lines
-*
-*  @lib ?library
-*  @since ?Series60_version
-*/
-NONSHARABLE_CLASS(CBtNotifApiTest) : public CScriptBase
-    {
-    public:  // Constructors and destructor
-
-        /**
-        * Two-phased constructor.
-        */
-        static CBtNotifApiTest* NewL( CTestModuleIf& aTestModuleIf );
-
-        /**
-        * Destructor.
-        */
-        virtual ~CBtNotifApiTest();
-
-    public: // New functions
-
-        /**
-        * ?member_description.
-        * @since ?Series60_version
-        * @param ?arg1 ?description
-        * @return ?description
-        */
-        //?type ?member_function( ?type ?arg1 );
-
-    public: // Functions from base classes
-
-        /**
-        * From CScriptBase Runs a script line.
-        * @since ?Series60_version
-        * @param aItem Script line containing method name and parameters
-        * @return Symbian OS error code
-        */
-        virtual TInt RunMethodL( CStifItemParser& aItem );
-
-    protected:  // New functions
-
-        /**
-        * ?member_description.
-        * @since ?Series60_version
-        * @param ?arg1 ?description
-        * @return ?description
-        */
-        //?type ?member_function( ?type ?arg1 );
-
-    protected:  // Functions from base classes
-
-        /**
-        * From ?base_class ?member_description
-        */
-        //?type ?member_function();
-
-    private:
-
-        /**
-        * C++ default constructor.
-        */
-        CBtNotifApiTest( CTestModuleIf& aTestModuleIf );
-
-        /**
-        * By default Symbian 2nd phase constructor is private.
-        */
-        void ConstructL();
-
-        // Prohibit copy constructor if not deriving from CBase.
-        // ?classname( const ?classname& );
-        // Prohibit assigment operator if not deriving from CBase.
-        // ?classname& operator=( const ?classname& );
-
-        /**
-        * Frees all resources allocated from test methods.
-        * @since ?Series60_version
-        */
-        void Delete();
-
-        /**
-        * Test methods are listed below. 
-        */
-
-        /**
-        * Example test method.
-        * @since ?Series60_version
-        * @param aItem Script line containing parameters.
-        * @return Symbian OS error code.
-        */
-        virtual TInt PairedDeviceSettingNotifierTest( CStifItemParser& aItem );
-        virtual TInt FinishPairedDeviceSettingQuery( CStifItemParser& aItem );
-        
-        virtual TInt PbapAuthNotifierTest( CStifItemParser& aItem );
-        virtual TInt FinishPbapAuthQuery( CStifItemParser& aItem );
-        
-        virtual TInt PasskeyDisplayNotifierTest( CStifItemParser& aItem );
-        virtual TInt FinishPasskeyDisplayQuery( CStifItemParser& aItem );
-        
-        virtual TInt NumericComparisonQueryNotifierTest( CStifItemParser& aItem );
-        virtual TInt FinishNumericComparisonQuery( CStifItemParser& aItem );
-        
-        virtual TInt AuthQueryNotifierTest( CStifItemParser& aItem );
-        virtual TInt FinishAuthQuery( CStifItemParser& aItem );
-        
-        virtual TInt PinPasskeyQueryNotifierTest( CStifItemParser& aItem );
-        virtual TInt FinishPinPasskeyQuery( CStifItemParser& aItem );
-        
-        virtual TInt InquiryNotifierTest( CStifItemParser& aItem );
-        virtual TInt FinishInquiry( CStifItemParser& aItem );
-        
-        virtual TInt ObexPasskeyQueryNotifierTest( CStifItemParser& aItem );
-        virtual TInt FinishObexPasskeyQuery( CStifItemParser& aItem );
-        
-        virtual TInt PowerModeQueryNotifierTest( CStifItemParser& aItem );
-        virtual TInt FinishPowerModeQuery( CStifItemParser& aItem );
-        
-        virtual TInt GenericInfoNotifierTest( CStifItemParser& aItem );
-        
-        virtual TInt GenericQueryNotifierTest( CStifItemParser& aItem );
-        virtual TInt FinishGenericQuery( CStifItemParser& aItem );
-        
-        /**
-         * Method used to log version of test class
-         */
-        void SendTestClassVersion();
-        
-        TInt GetGenericInfoNoteType( TPtrC aTypeString, TBTGenericInfoNoteType& aGenericInfoNoteType );        
-        TInt GetGenericQueryNoteType( TPtrC aTypeString, TBTGenericQueryNoteType& aGenericQueryNoteType );
-        
-        TInt GetTestOption( TPtrC optionString, TTestOption& aOption );
-        TInt TurnLightsOn( CStifItemParser& aItem );
-
-        //ADD NEW METHOD DEC HERE
-        //[TestMethods] - Do not remove
-
-    public:     // Data
-        // ?one_line_short_description_of_data
-        //?data_declaration;
-
-    protected:  // Data
-        // ?one_line_short_description_of_data
-        //?data_declaration;
-
-    private:    // Data
-        
-        RNotifier* iNotifier;
-              
-        TPbapAuthNotifierResponsePckg iPbapAuthNotifierResponsePckg;
-        TBTDeviceResponseParamsPckg iBtDeviceResponseParamsPckg;
-        TPckgBuf<TInt> iNumericComparisonQueryReply;
-        TBTPinCode iEnteredPinPasskey;
-        TBTPinCode iPinPasskey;
-        TObexPasskeyBuf iObexPasskeyBuf;
-        TObexPasskeyBuf iEnteredPasskeyBuf;
-        TPckgBuf<TBool> iAuthQueryReply;
-        TPckgBuf<TBool> iPowerModeQueryReply;
-        TPckgBuf<TBool> iGenericQueryReply;
-        
-        
-        TRequestStatus iReqStatus;
-        TBuf<KMaxBCBluetoothNameLen> iLocalDeviceName;
-        
-        CBtSettingsObserver* iBtSettings;
-        CBtEngDevManObserver* iBtEngDevManObserver;
-        CBTDeviceArray* iBtDeviceArray;
-        CBTDevice* iTestDevice;
-        
-
-    public:     // Friend classes
-        //?friend_class_declaration;
-    protected:  // Friend classes
-        //?friend_class_declaration;
-    private:    // Friend classes
-        //?friend_class_declaration;
-
-    };
-
-#endif      // BTNOTIFAPITEST_H
-
-// End of File
--- a/bluetoothengine/btnotif/tsrc/BtNotifApiTest/inc/BtSettingsObserver.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#ifndef BTSETTINGSOBSERVER_H_
-#define BTSETTINGSOBSERVER_H_
-
-#include <e32std.h>
-#include <e32base.h>
-#include <btengsettings.h>
-
-NONSHARABLE_CLASS( CBtSettingsObserver ) : public CBase,
-                                   public MBTEngSettingsObserver
-    {
-public:
-    /**
-     * Destructor.
-     */
-    ~CBtSettingsObserver();
-
-    /**
-     * Two-phased constructor.
-     */
-    static CBtSettingsObserver* NewL();
-
-    /**
-     * Two-phased constructor.
-     */
-    static CBtSettingsObserver* NewLC();
-    
-    TInt GetPowerState( TBTPowerStateValue& aState );
-    TInt SetPowerState( TBTPowerStateValue aState );
-    TInt GetVisibilityMode( TBTVisibilityMode& aMode );
-    TInt SetVisibilityMode( TBTVisibilityMode aMode, TInt aTime = 0 );
-    TInt GetLocalName( TDes& aName );
-    TInt SetLocalName( const TDes& aName );
-
-private:
-
-    // From MBTEngSettingsObserver
-    void PowerStateChanged( TBTPowerStateValue aState );
-    void VisibilityModeChanged( TBTVisibilityMode aState );
-    
-
-    CBtSettingsObserver();
-    void ConstructL();
-
-    
-private: //Data
-    
-    CBTEngSettings* iSettings; // Own.
-    CActiveSchedulerWait* iWaiter; //Own.
-    TInt iError;    
-    };
-
-#endif /*BTSETTINGSOBSERVER_H_*/
--- a/bluetoothengine/btnotif/tsrc/BtNotifApiTest/init/BtNotifApiTest.ini	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +0,0 @@
-#
-# This is STIF initialization file
-# Comment lines start with '#'-character.
-# See STIF TestFramework users guide.doc for instructions
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Set following test engine settings:
-#	- Set Test Reporting mode. TestReportMode's possible values are:
-#		+ 'Summary': Summary of the tested test cases.
-#		+ 'Environment': Hardware and software info.
-#		+ 'TestCases': Test case report.
-#		+ 'FullReport': Set of all above ones.
-#		+ Example 'TestReportMode= Summary TestCases'
-#
-# 	- CreateTestReport setting controls report creation mode
-#		+ YES, Test report will created.
-#		+ NO, No Test report.
-#
-# 	- File path indicates the base path of the test report.
-# 	- File name indicates the name of the test report.
-#
-# 	- File format indicates the type of the test report.
-#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
-#		+ HTML, Test report will be html type, for example 'TestReport.html'.
-#   + XML, Test report will be xml type, for example 'TestReport.xml'.
-#          Note, that xml format is available only when output is set to FILE.
-#
-# 	- File output indicates output source of the test report.
-#		+ FILE, Test report logging to file.
-#		+ RDEBUG, Test report logging to using rdebug.
-#
-# 	- File Creation Mode indicates test report overwriting if file exist.
-#		+ OVERWRITE, Overwrites if the Test report file exist.
-#		+ APPEND, Continue logging after the old Test report information if
-#                 report exist.
-# 	- Sets a device reset module's dll name(Reboot).
-#		+ If Nokia specific reset module is not available or it is not correct one
-#		  StifHWResetStub module may use as a template for user specific reset
-#		  module.
-# 	- Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation
-#		DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02
-#
-
-[Engine_Defaults]
-
-TestReportMode= FullReport    # Possible values are: 'Empty', 'Summary', 'Environment',
-                                                     'TestCases' or 'FullReport'
-
-CreateTestReport= YES         # Possible values: YES or NO
-
-TestReportFilePath= e:\testing\logs\
-TestReportFileName= BtNotifApiTest
-
-TestReportFormat= TXT         # Possible values: TXT, HTML or XML
-TestReportOutput= FILE        # Possible values: FILE or RDEBUG
-TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND
-
-DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
-
-DisableMeasurement= stifmeasurementdisablenone  # Possible values are:
-              # 'stifmeasurementdisablenone', 'stifmeasurementdisableall'
-              # 'stifmeasurementplugin01', 'stifmeasurementplugin02',
-              # 'stifmeasurementplugin03', 'stifmeasurementplugin04',
-              # 'stifmeasurementplugin05' or 'stifbappeaprofiler'
-
-Timeout= 0                    # Default timeout value for each test case. In milliseconds
-UITestingSupport= YES        # Possible values: YES or NO
-#SeparateProcesses= YES       # Possible values: YES or NO (default: NO)
-[End_Defaults]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Module configurations start
-# Modules are added between module tags
-# tags. Module name is specified after ModuleName= tag, like
-# ModuleName= XXXXXXXXX
-# Modules might have initialisation file, specified as
-# IniFile= c:\testframework\YYYYYY
-# Modules might have several configuration files, like
-# TestCaseFile= c:\testframework\NormalCases.txt
-# TestCaseFile= c:\testframework\SmokeCases.txt
-# TestCaseFile= c:\testframework\ManualCases.txt
-
-# (TestCaseFile is synonym for old term ConfigFile)
-
-# Following case specifies demo module settings. Demo module
-# does not read any settings from file, so tags 
-# IniFile and TestCaseFile are not used.
-# In the simplest case it is enough to specify only the
-# name of the test module when adding new test module
-
-[New_Module]
-ModuleName= testscripter
-TestCaseFile= e:\testing\conf\ui_BtNotifApiTest.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]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Set filters to be used by ConsoleUI.
-# 	If you want to use filter with ConsoleUI, simply remove comments
-# 	from section below and provide valid filter entries.
-#   Each filter line has to start with "filter= " keyword.
-#   Filter can contain special wildcard characters:
-#     *  which stands for none or any literal;
-#     ?  which stands for single character.
-#   Filters are not case-sensitive.
-
-#[Filters]
-#filter= *math*
-#filter= *radio*
-#[End_Filters]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-# End of file
--- a/bluetoothengine/btnotif/tsrc/BtNotifApiTest/init/BtNotifApiTest_phone.ini	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +0,0 @@
-#
-# This is STIF initialization file
-# Comment lines start with '#'-character.
-# See STIF TestFramework users guide.doc for instructions
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Set following test engine settings:
-#	- Set Test Reporting mode. TestReportMode's possible values are:
-#		+ 'Summary': Summary of the tested test cases.
-#		+ 'Environment': Hardware and software info.
-#		+ 'TestCases': Test case report.
-#		+ 'FullReport': Set of all above ones.
-#		+ Example 'TestReportMode= Summary TestCases'
-#
-# 	- CreateTestReport setting controls report creation mode
-#		+ YES, Test report will created.
-#		+ NO, No Test report.
-#
-# 	- File path indicates the base path of the test report.
-# 	- File name indicates the name of the test report.
-#
-# 	- File format indicates the type of the test report.
-#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
-#		+ HTML, Test report will be html type, for example 'TestReport.html'.
-#   + XML, Test report will be xml type, for example 'TestReport.xml'.
-#          Note, that xml format is available only when output is set to FILE.
-#
-# 	- File output indicates output source of the test report.
-#		+ FILE, Test report logging to file.
-#		+ RDEBUG, Test report logging to using rdebug.
-#
-# 	- File Creation Mode indicates test report overwriting if file exist.
-#		+ OVERWRITE, Overwrites if the Test report file exist.
-#		+ APPEND, Continue logging after the old Test report information if
-#                 report exist.
-# 	- Sets a device reset module's dll name(Reboot).
-#		+ If Nokia specific reset module is not available or it is not correct one
-#		  StifHWResetStub module may use as a template for user specific reset
-#		  module.
-# 	- Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation
-#		DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02
-#
-
-[Engine_Defaults]
-
-TestReportMode= FullReport    # Possible values are: 'Empty', 'Summary', 'Environment',
-                                                     'TestCases' or 'FullReport'
-
-CreateTestReport= YES         # Possible values: YES or NO
-
-TestReportFilePath= c:\logs\testframework\
-TestReportFileName= BtNotifApiTest
-
-TestReportFormat= TXT         # Possible values: TXT, HTML or XML
-TestReportOutput= FILE        # Possible values: FILE or RDEBUG
-TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND
-
-DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
-
-DisableMeasurement= stifmeasurementdisablenone  # Possible values are:
-              # 'stifmeasurementdisablenone', 'stifmeasurementdisableall'
-              # 'stifmeasurementplugin01', 'stifmeasurementplugin02',
-              # 'stifmeasurementplugin03', 'stifmeasurementplugin04',
-              # 'stifmeasurementplugin05' or 'stifbappeaprofiler'
-
-Timeout= 0                    # Default timeout value for each test case. In milliseconds
-UITestingSupport= YES        # Possible values: YES or NO
-#SeparateProcesses= YES       # Possible values: YES or NO (default: NO)
-[End_Defaults]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Module configurations start
-# Modules are added between module tags
-# tags. Module name is specified after ModuleName= tag, like
-# ModuleName= XXXXXXXXX
-# Modules might have initialisation file, specified as
-# IniFile= c:\testframework\YYYYYY
-# Modules might have several configuration files, like
-# TestCaseFile= c:\testframework\NormalCases.txt
-# TestCaseFile= c:\testframework\SmokeCases.txt
-# TestCaseFile= c:\testframework\ManualCases.txt
-
-# (TestCaseFile is synonym for old term ConfigFile)
-
-# Following case specifies demo module settings. Demo module
-# does not read any settings from file, so tags 
-# IniFile and TestCaseFile are not used.
-# In the simplest case it is enough to specify only the
-# name of the test module when adding new test module
-
-[New_Module]
-ModuleName= testscripter
-TestCaseFile= c:\testframework\ui_BtNotifApiTest.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]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Set filters to be used by ConsoleUI.
-# 	If you want to use filter with ConsoleUI, simply remove comments
-# 	from section below and provide valid filter entries.
-#   Each filter line has to start with "filter= " keyword.
-#   Filter can contain special wildcard characters:
-#     *  which stands for none or any literal;
-#     ?  which stands for single character.
-#   Filters are not case-sensitive.
-
-#[Filters]
-#filter= *math*
-#filter= *radio*
-#[End_Filters]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-# End of file
--- a/bluetoothengine/btnotif/tsrc/BtNotifApiTest/src/BtEngDevManObserver.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#include "BtEngDevManObserver.h"
-
-CBtEngDevManObserver::CBtEngDevManObserver()
-    {
-    
-    }
-
-CBtEngDevManObserver::~CBtEngDevManObserver()
-    {
-    if( iWait->IsStarted() )
-        {
-        iWait->AsyncStop();
-        }
-    delete iWait;
-    iWait = NULL;
-    delete iDevMan;
-    iDevMan = NULL;
-    }
-
-CBtEngDevManObserver* CBtEngDevManObserver::NewLC()
-    {
-    CBtEngDevManObserver* self = new ( ELeave ) CBtEngDevManObserver();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-    }
-
-CBtEngDevManObserver* CBtEngDevManObserver::NewL()
-    {
-    CBtEngDevManObserver* self = CBtEngDevManObserver::NewLC();
-    CleanupStack::Pop(); // self;
-    return self;
-    }
-
-void CBtEngDevManObserver::ConstructL()
-    {
-    iWait = new ( ELeave ) CActiveSchedulerWait();
-    iDevMan = CBTEngDevMan::NewL( this );
-    }
-
-TInt CBtEngDevManObserver::GetDevices( const TBTRegistrySearch& aCriteria, 
-                               CBTDeviceArray* aResultArray )
-    {
-    TInt res;
-    res = iDevMan -> GetDevices( aCriteria, aResultArray );
-    if ( res != KErrNone )
-        {
-        return res;
-        }
-        
-    iWait -> Start();
-    
-    return KErrNone;
-    }
-
-TInt CBtEngDevManObserver::AddDevice( const CBTDevice& aDevice )
-    {
-    TInt res;
-    res = iDevMan -> AddDevice( aDevice );
-    if ( res != KErrNone )
-        {
-        return res;
-        }
-        
-    iWait -> Start();
-    
-    return KErrNone;
-    }
-
-TInt CBtEngDevManObserver::DeleteDevices( const TBTRegistrySearch& aCriteria )
-    {
-    TInt res;
-    res = iDevMan -> DeleteDevices( aCriteria );
-    if ( res != KErrNone )
-        {
-        return res;
-        }
-        
-    iWait -> Start();
-    
-    return KErrNone;
-    }
-
-void CBtEngDevManObserver::HandleGetDevicesComplete( TInt aErr, CBTDeviceArray* aDeviceArray )
-    {
-    iWait -> AsyncStop();
-    }
-
-void CBtEngDevManObserver::HandleDevManComplete( TInt aErr )
-    {
-    iWait -> AsyncStop();
-    }
--- a/bluetoothengine/btnotif/tsrc/BtNotifApiTest/src/BtNotifApiTest.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,209 +0,0 @@
-/*
-* 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:   ?Description
-*
-*/
-
-
-
-
-// INCLUDE FILES
-#include <Stiftestinterface.h>
-#include "BtNotifApiTest.h"
-#include <SettingServerClient.h>
-
-// EXTERNAL DATA STRUCTURES
-//extern  ?external_data;
-
-// EXTERNAL FUNCTION PROTOTYPES  
-//extern ?external_function( ?arg_type,?arg_type );
-
-// CONSTANTS
-//const ?type ?constant_var = ?constant;
-
-// MACROS
-//#define ?macro ?macro_def
-
-// LOCAL CONSTANTS AND MACROS
-//const ?type ?constant_var = ?constant;
-//#define ?macro_name ?macro_def
-
-// MODULE DATA STRUCTURES
-//enum ?declaration
-//typedef ?declaration
-
-// LOCAL FUNCTION PROTOTYPES
-//?type ?function_name( ?arg_type, ?arg_type );
-
-// FORWARD DECLARATIONS
-//class ?FORWARD_CLASSNAME;
-
-// ============================= LOCAL FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// ?function_name ?description.
-// ?description
-// Returns: ?value_1: ?description
-//          ?value_n: ?description_line1
-//                    ?description_line2
-// -----------------------------------------------------------------------------
-//
-/*
-?type ?function_name(
-    ?arg_type arg,  // ?description
-    ?arg_type arg)  // ?description
-    {
-
-    ?code  // ?comment
-
-    // ?comment
-    ?code
-    }
-*/
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CBtNotifApiTest::CBtNotifApiTest
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CBtNotifApiTest::CBtNotifApiTest( 
-    CTestModuleIf& aTestModuleIf ):
-        CScriptBase( aTestModuleIf )
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CBtNotifApiTest::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CBtNotifApiTest::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(KBtNotifApiTestLogFileWithTitle, &title);
-        }
-    else
-        {
-        logFileName.Copy(KBtNotifApiTestLogFile);
-        }
-
-    iLog = CStifLogger::NewL( KBtNotifApiTestLogPath, 
-                          logFileName,
-                          CStifLogger::ETxt,
-                          CStifLogger::EFile,
-                          EFalse );
-    
-    SendTestClassVersion();
-    
-    iNotifier = new ( ELeave ) RNotifier();
-    iBtSettings = CBtSettingsObserver::NewL();
-    iBtEngDevManObserver = CBtEngDevManObserver::NewL();
-    iBtDeviceArray = new ( ELeave ) CBTDeviceArray( 1 );
-    
-    iTestDevice = CBTDevice::NewL();    
-    }
-
-// -----------------------------------------------------------------------------
-// CBtNotifApiTest::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CBtNotifApiTest* CBtNotifApiTest::NewL( 
-    CTestModuleIf& aTestModuleIf )
-    {
-    CBtNotifApiTest* self = new (ELeave) CBtNotifApiTest( aTestModuleIf );
-
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop();
-
-    return self;
-
-    }
-
-// Destructor
-CBtNotifApiTest::~CBtNotifApiTest()
-    { 
-
-    // Delete resources allocated from test methods
-    Delete();
-
-    // Delete logger
-    delete iLog; 
-
-    }
-
-//-----------------------------------------------------------------------------
-// CBtNotifApiTest::SendTestClassVersion
-// Method used to send version of test class
-//-----------------------------------------------------------------------------
-//
-void CBtNotifApiTest::SendTestClassVersion()
-	{
-	TVersion moduleVersion;
-	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
-	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
-	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
-	
-	TFileName moduleName;
-	moduleName = _L("BtNotifApiTest.dll");
-
-	TBool newVersionOfMethod = ETrue;
-	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
-	}
-
-// ========================== OTHER EXPORTED FUNCTIONS =========================
-
-// -----------------------------------------------------------------------------
-// LibEntryL is a polymorphic Dll entry point.
-// Returns: CScriptBase: New CScriptBase derived object
-// -----------------------------------------------------------------------------
-//
-EXPORT_C CScriptBase* LibEntryL( 
-    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
-    {
-
-    return ( CScriptBase* ) CBtNotifApiTest::NewL( aTestModuleIf );
-
-    }
-
-
-//  End of File
--- a/bluetoothengine/btnotif/tsrc/BtNotifApiTest/src/BtNotifApiTestBlocks.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1632 +0,0 @@
-/*
-* 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:   ?Description
-*
-*/
-
-
-
-// [INCLUDE FILES] - do not remove
-#include <e32svr.h>
-#include <StifParser.h>
-#include <Stiftestinterface.h>
-#include "BtNotifApiTest.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 ===============================
-
-// -----------------------------------------------------------------------------
-// CBtNotifApiTest::Delete
-// Delete here all resources allocated and opened from test methods. 
-// Called from destructor. 
-// -----------------------------------------------------------------------------
-//
-void CBtNotifApiTest::Delete() 
-    {
-        delete iNotifier;
-        iNotifier = NULL;
-        delete iBtSettings;
-        iBtSettings = NULL;
-        delete iBtEngDevManObserver;
-        iBtEngDevManObserver = NULL;
-        delete iBtDeviceArray;
-        iBtDeviceArray = NULL;
-        delete iTestDevice;
-        iTestDevice = NULL;
-    }
-
-// -----------------------------------------------------------------------------
-// CBtNotifApiTest::RunMethodL
-// Run specified method. Contains also table of test mothods and their names.
-// -----------------------------------------------------------------------------
-//
-TInt CBtNotifApiTest::RunMethodL( 
-    CStifItemParser& aItem ) 
-    {
-
-    static TStifFunctionInfo const KFunctions[] =
-        {  
-        // Copy this line for every implemented function.
-        // First string is the function name used in TestScripter script file.
-        // Second is the actual implementation member function. 
-                
-        ENTRY( "PairedDeviceSettingNotifierTest", CBtNotifApiTest::PairedDeviceSettingNotifierTest ),
-        ENTRY( "FinishPairedDeviceSettingQuery", CBtNotifApiTest::FinishPairedDeviceSettingQuery ),
-                
-        ENTRY( "PbapAuthNotifierTest", CBtNotifApiTest::PbapAuthNotifierTest ),
-        ENTRY( "FinishPbapAuthQuery", CBtNotifApiTest::FinishPbapAuthQuery ),
-                
-        ENTRY( "PasskeyDisplayNotifierTest", CBtNotifApiTest::PasskeyDisplayNotifierTest ),
-        ENTRY( "FinishPasskeyDisplayQuery", CBtNotifApiTest::FinishPasskeyDisplayQuery ),
-
-        ENTRY( "NumericComparisonQueryNotifierTest", CBtNotifApiTest::NumericComparisonQueryNotifierTest ),
-        ENTRY( "FinishNumericComparisonQuery", CBtNotifApiTest::FinishNumericComparisonQuery ),
-        
-        ENTRY( "AuthQueryNotifierTest", CBtNotifApiTest::AuthQueryNotifierTest ),
-        ENTRY( "FinishAuthQuery", CBtNotifApiTest::FinishAuthQuery ),
-        
-        ENTRY( "PinPasskeyQueryNotifierTest", CBtNotifApiTest::PinPasskeyQueryNotifierTest ),
-        ENTRY( "FinishPinPasskeyQuery", CBtNotifApiTest::FinishPinPasskeyQuery ),
-        
-        ENTRY( "InquiryNotifierTest", CBtNotifApiTest::InquiryNotifierTest ),
-        ENTRY( "FinishInquiry", CBtNotifApiTest::FinishInquiry ),
-        
-        ENTRY( "ObexPasskeyQueryNotifierTest", CBtNotifApiTest::ObexPasskeyQueryNotifierTest ),
-        ENTRY( "FinishObexPasskeyQuery", CBtNotifApiTest::FinishObexPasskeyQuery ),
-        
-        ENTRY( "PowerModeQueryNotifierTest", CBtNotifApiTest::PowerModeQueryNotifierTest ),
-        ENTRY( "FinishPowerModeQuery", CBtNotifApiTest::FinishPowerModeQuery ),
-        
-        ENTRY( "GenericInfoNotifierTest", CBtNotifApiTest::GenericInfoNotifierTest ),
-        
-        ENTRY( "GenericQueryNotifierTest", CBtNotifApiTest::GenericQueryNotifierTest ),
-        ENTRY( "FinishGenericQuery", CBtNotifApiTest::FinishGenericQuery ),
-        
-        ENTRY( "TurnLightsOn", CBtNotifApiTest::TurnLightsOn ),
-                
-        //ADD NEW ENTRY HERE
-        // [test cases entries] - Do not remove
-
-        };
-
-    const TInt count = sizeof( KFunctions ) / 
-                        sizeof( TStifFunctionInfo );
-
-    return RunInternalL( KFunctions, count, aItem );
-
-    }
-
-// -----------------------------------------------------------------------------
-// CBtNotifApiTest::PairedDeviceSettingNotifierTests
-// -----------------------------------------------------------------------------
-//
-
-TInt CBtNotifApiTest::PairedDeviceSettingNotifierTest( CStifItemParser& aItem )
-    {
-    TInt res;
-    TBTRegistrySearch regSearch;
-    
-    res = iNotifier -> Connect();
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Failed to connect RNotifier with value: %d"), res );
-        return res;
-        }   
-    iLog -> Log( _L("RNotifier connected") );
-    
-    regSearch.FindAll();    
-    res = iBtEngDevManObserver -> GetDevices( regSearch, iBtDeviceArray );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Getting devices from register failed with value: %d"), res );
-        return res;
-        }
-
-    if ( iBtDeviceArray -> Count() > 0 )
-        {
-        iBtDeviceArray -> Reset();
-        res = iBtEngDevManObserver -> DeleteDevices( regSearch );
-        if ( res != KErrNone )
-            {
-            iLog -> Log( _L("Deleting devices from register failed with value: %d"), res );
-            return res;
-            }
-        }
-
-    TBTDevAddr addr( 0x12345678 );
-    CBTDevice *testDevice = CBTDevice::NewL( addr );
-    CleanupStack::PushL( testDevice );
-    testDevice -> SetPaired( ELinkKeyAuthenticated );
-    TTime time;
-    time.UniversalTime();
-    testDevice -> SetUsed( time );
-    testDevice -> SetDeviceNameL( _L8( "TestedDevice" ) );
-    CleanupStack::Pop( testDevice );
-    
-    res = iBtEngDevManObserver -> AddDevice( *testDevice );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Adding device to register failed with value: %d"), res );
-        delete testDevice;
-        return res;
-        }
-
-    TInt paramStatus = KErrNone;  
-    TBTPairedDeviceSettingParams notifierParams;    
-    notifierParams.iPairingStatus = paramStatus;
-    notifierParams.iRemoteAddr = testDevice -> BDAddr();
-    TBTPairedDeviceSettingParamsPckg notifierParamsPckg( notifierParams );
-       
-    TPckgBuf<TBool> notifierResponsePckg;
-    
-    iNotifier -> StartNotifierAndGetResponse( iReqStatus, KBTPairedDeviceSettingNotifierUid, notifierParamsPckg, notifierResponsePckg );
-    iLog -> Log( _L("Notifier started") );    
-    
-    User::WaitForRequest( iReqStatus );
-  
-    iLog -> Log( _L("Request status value: %d"), iReqStatus.Int() );
-    iLog -> Log( _L("Input status value: %d"), notifierParams.iPairingStatus );
-    iLog -> Log( _L("Pairing status value: %d"), notifierResponsePckg() );
-    
-    delete testDevice;
-    iNotifier -> Close();  
-    return KErrNone;
-    }
-
-
-TInt CBtNotifApiTest::FinishPairedDeviceSettingQuery( CStifItemParser& aItem )
-    {
-    iLog -> Log( _L("Test case passed") );
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CBtNotifApiTest::PbapAuthNotifierTests
-// -----------------------------------------------------------------------------
-//
-
-TInt CBtNotifApiTest::PbapAuthNotifierTest( CStifItemParser& aItem )
-    {
-    TInt res;
-
-    res = iNotifier -> Connect();
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Failed to connect RNotifier with value: %d"), res );
-        return res;
-        }   
-    iLog -> Log( _L("RNotifier connected") );
-    
-    TPbapAuthNotifierParams notifierParams = TPbapAuthNotifierParams();
-    TPbapAuthNotifierParamsPckg notifierParamsPckg( notifierParams );
-    iNotifier -> StartNotifierAndGetResponse( iReqStatus, KPbapAuthNotifierUid, notifierParamsPckg, iPbapAuthNotifierResponsePckg );
-    iLog -> Log( _L("Notifier started") );
-
-    return KErrNone;
-    }
-
-
-TInt CBtNotifApiTest::FinishPbapAuthQuery( CStifItemParser& aItem )
-    {
-    TInt res;
-    TPtrC optionName( KNullDesC );
-    TTestOption option;
-    TPbapAuthNotifierResponse expectedData;
-    
-    if ( !expectedData.SetPassword( _L( "0000" ) ) )
-        {
-        iLog -> Log( _L("SetPassword failed") );
-        iNotifier -> Close();
-        return KErrGeneral;
-        }       
-    
-    res = aItem.GetString( _L( "FinishPbapAuthQuery" ), optionName );   
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetString failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }
-    
-    res = GetTestOption( optionName, option );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetTestOption failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }  
-    
-    User::WaitForRequest( iReqStatus );    
-    if ( iReqStatus.Int()!= KErrNone && iReqStatus.Int()!= KErrCancel )
-        {
-        iLog -> Log( _L("Failed to get notifier's response: %d"), iReqStatus.Int() );
-        iNotifier -> Close();
-        return iReqStatus.Int();
-        }
-    iLog -> Log( _L("Notifier responded") );
-    
-    switch ( option )
-        {
-        case ECheckPasskey:
-            iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrNone );
-            STIF_ASSERT_EQUALS( KErrNone, iReqStatus.Int() );
-            iLog -> Log( _L("Equal passkeys expected") );
-            STIF_ASSERT_EQUALS( expectedData.Password(), iPbapAuthNotifierResponsePckg().Password() );                       
-            break;
-        case EQueryCanceled:
-            iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrCancel );
-            STIF_ASSERT_EQUALS( KErrCancel, iReqStatus.Int() );
-            break;    
-        default:
-            iLog -> Log( _L("Option unavailable") );
-            return KErrNotFound;
-            
-        }
-    
-    iNotifier -> Close();
-    iLog -> Log( _L("Test case passed") );
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CBtNotifApiTest::PasskeyDisplayNotifierTests
-// -----------------------------------------------------------------------------
-//
-
-TInt CBtNotifApiTest::PasskeyDisplayNotifierTest( CStifItemParser& aItem )
-    {
-    TInt res;
-    TBTRegistrySearch regSearch;
-    TPtrC initOptionName( KNullDesC );
-    TUint32 numericalValue = 999;
-    TBTPasskeyDisplayParams notifierParams;
-    TBTPasskeyDisplayParamsPckg emptyReplyPckg;
-    
-    res = iNotifier -> Connect();
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Failed to connect RNotifier with value: %d"), res );
-        return res;
-        }   
-    iLog -> Log( _L("RNotifier connected") );
-    
-    regSearch.FindAll();    
-    res = iBtEngDevManObserver -> GetDevices( regSearch, iBtDeviceArray );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Getting devices from register failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }
-
-    if ( iBtDeviceArray -> Count() > 0 )
-        {
-        iBtDeviceArray -> Reset();
-        res = iBtEngDevManObserver -> DeleteDevices( regSearch );
-        if ( res != KErrNone )
-            {
-            iLog -> Log( _L("Deleting devices from register failed with value: %d"), res );
-            iNotifier -> Close();
-            return res;
-            }
-        }
-    
-    iTestDevice -> SetDeviceAddress( 0x12345678 );
-    iTestDevice -> SetDeviceNameL( _L8( "Tested_Device" ) );
-    iTestDevice -> SetFriendlyNameL( _L( "TestedDevice" ) );
-    
-    res = iBtEngDevManObserver -> AddDevice( *iTestDevice );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Adding device to register failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }
-    
-    res = aItem.GetString( _L( "PasskeyDisplayNotifierTest" ), initOptionName );   
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetString failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        } 
-    
-    if ( !initOptionName.Compare( _L( "LOCAL" ) ) )
-        {
-        iLog -> Log( _L("Locally initiated connection") );
-        notifierParams = TBTPasskeyDisplayParams( iTestDevice -> BDAddr(), iTestDevice -> FriendlyName(), numericalValue, ETrue );
-        }
-    else if ( !initOptionName.Compare( _L( "REMOTE" ) ) )
-        {
-        iLog -> Log( _L("Remote side initiated connection") );
-        notifierParams = TBTPasskeyDisplayParams( iTestDevice -> BDAddr(), iTestDevice -> FriendlyName(), numericalValue, EFalse );
-        }
-    else
-        {
-        iLog -> Log( _L("Option unavailable") );
-        return KErrNotFound;
-        }
-       
-    TBTPasskeyDisplayParamsPckg notifierParamsPckg( notifierParams );
-    
-    iNotifier -> StartNotifierAndGetResponse( iReqStatus, KBTPasskeyDisplayNotifierUid, notifierParamsPckg, emptyReplyPckg );
-    iLog -> Log( _L("Notifier started") );
-
-    return KErrNone;
-    }
-
-TInt CBtNotifApiTest::FinishPasskeyDisplayQuery( CStifItemParser& aItem )
-    {
-    TInt res;
-    TBTRegistrySearch regSearch;
-    TPtrC deviceBlockOptionName( KNullDesC );
-    
-    res = aItem.GetString( _L( "FinishPasskeyDisplayQuery" ), deviceBlockOptionName );   
-    
-    User::WaitForRequest( iReqStatus );   
-    
-    if ( !deviceBlockOptionName.Compare( _L( "BLOCK" ) ) )
-        {
-        iLog -> Log( _L("Block test device") );
-        iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrAccessDenied );
-        STIF_ASSERT_EQUALS( KErrAccessDenied, iReqStatus.Int() );
-        }
-    else if ( !deviceBlockOptionName.Compare( _L( "NONBLOCK" ) ) )
-        {
-        iLog -> Log( _L("Don't block test device") );
-        iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrCancel );
-        STIF_ASSERT_EQUALS( KErrCancel, iReqStatus.Int() );
-        }
-    else
-        {
-        iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrCancel );
-        STIF_ASSERT_EQUALS( KErrCancel, iReqStatus.Int() );
-        }
-    
-    iBtDeviceArray -> Reset();
-    res = iBtEngDevManObserver -> DeleteDevices( regSearch );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Deleting devices from register failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }
-    
-    iNotifier -> Close();
-    iLog -> Log( _L("Test case passed") );
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CBtNotifApiTest::NumericComparisonQueryNotifierTests
-// -----------------------------------------------------------------------------
-//
-
-TInt CBtNotifApiTest::NumericComparisonQueryNotifierTest( CStifItemParser& aItem )
-    {
-    TInt res;
-    TPtrC initOptionName( KNullDesC );
-    TUint32 numericalValue = 999999;
-    TBTNumericComparisonParams notifierParams;
-    
-    
-    res = iNotifier -> Connect();
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Failed to connect RNotifier with value: %d"), res );
-        return res;
-        }   
-    iLog -> Log( _L("RNotifier connected") );
-    
-    res = aItem.GetString( _L( "NumericComparisonQueryNotifierTest" ), initOptionName );   
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetString failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        } 
-    
-    if ( !initOptionName.Compare( _L( "LOCAL" ) ) )
-        {
-        iLog -> Log( _L("Locally initiated connection") );
-        notifierParams = TBTNumericComparisonParams( TBTDevAddr(), _L( "Test Device" ), numericalValue, TBTNumericComparisonParams::ERemoteCannotConfirm, ETrue );
-        }
-    else if ( !initOptionName.Compare( _L( "REMOTE" ) ) )
-        {
-        iLog -> Log( _L("Remote side initiated connection") );
-        notifierParams = TBTNumericComparisonParams( TBTDevAddr(), _L( "Test Device" ), numericalValue, TBTNumericComparisonParams::ERemoteCannotConfirm, EFalse );
-        }
-    else
-        {
-        iLog -> Log( _L("Option unavailable") );
-        return KErrNotFound;
-        }
-    
-    TBTNumericComparisonParamsPckg notifierParamsPckg( notifierParams );
-    iNotifier -> StartNotifierAndGetResponse( iReqStatus, KBTNumericComparisonNotifierUid, notifierParamsPckg, iNumericComparisonQueryReply );
-    iLog -> Log( _L("Notifier started") );
-    
-    return KErrNone;
-    }
-
-
-TInt CBtNotifApiTest::FinishNumericComparisonQuery( CStifItemParser& aItem )
-    {
-    TInt res;
-    TPtrC optionName( KNullDesC );
-    TPtrC deviceBlockOptionName( KNullDesC );
-    TTestOption option;
-    
-    res = aItem.GetString( _L( "FinishNumericComparisonQuery" ), optionName );   
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetString failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }
-    
-    res = GetTestOption( optionName, option );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetTestOption failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }  
-    
-    User::WaitForRequest( iReqStatus );    
-    if ( iReqStatus.Int()!= KErrNone && iReqStatus.Int()!= KErrCancel && iReqStatus.Int()!= KErrAccessDenied )
-        {
-        iLog -> Log( _L("Failed to get notifier's response: %d"), iReqStatus.Int() );
-        iNotifier -> Close();
-        return iReqStatus.Int();
-        }
-    iLog -> Log( _L("Notifier responded") );
-    
-    switch ( option )
-        {
-        case EQueryDiscarded:
-            iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrNone );
-            STIF_ASSERT_EQUALS( KErrNone, iReqStatus.Int() );
-            iLog -> Log( _L("Notifier's response value: %d, expected: %b"), iNumericComparisonQueryReply(), EFalse );  
-            STIF_ASSERT_FALSE( iNumericComparisonQueryReply() );
-            break;
-        case EQueryAccepted:
-            iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrNone );
-            STIF_ASSERT_EQUALS( KErrNone, iReqStatus.Int() );
-            iLog -> Log( _L("Notifier's response value: %d, expected: %b"), iNumericComparisonQueryReply(), ETrue );  
-            STIF_ASSERT_TRUE( iNumericComparisonQueryReply() );
-            break;
-        case EQueryCanceled:
-            res = aItem.GetNextString( deviceBlockOptionName );   
-            if ( res != KErrNone )
-                {
-                iLog -> Log( _L("GetNextString failed with value: %d"), res );
-                iNotifier -> Close();
-                return res;
-                }
-            
-            if ( !deviceBlockOptionName.Compare( _L( "BLOCK" ) ) )
-                {
-                iLog -> Log( _L("Block test device") );
-                iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrAccessDenied );
-                STIF_ASSERT_EQUALS( KErrAccessDenied, iReqStatus.Int() );
-                }
-            else if ( !deviceBlockOptionName.Compare( _L( "NONBLOCK" ) ) )
-                {
-                iLog -> Log( _L("Don't block test device") );
-                iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrCancel );
-                STIF_ASSERT_EQUALS( KErrCancel, iReqStatus.Int() );
-                }
-            else
-                {
-                iLog -> Log( _L("Option unavailable") );
-                return KErrNotFound;
-                }
-            break;
-        default:
-            iLog -> Log( _L("Option unavailable") );
-            return KErrNotFound;
-        }
-
-    iNotifier -> Close();
-    iLog -> Log( _L("Test case passed") );
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CBtNotifApiTest::AuthQueryNotifierTests
-// -----------------------------------------------------------------------------
-//
-
-TInt CBtNotifApiTest::AuthQueryNotifierTest( CStifItemParser& aItem )
-    {
-    TInt res;
-    
-    res = iNotifier -> Connect();
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Failed to connect RNotifier with value: %d"), res );
-        return res;
-        }   
-    iLog -> Log( _L("RNotifier connected") );
-    
-    TBTAuthorisationParams notifierParams;
-    notifierParams.iName = _L( "Test Device" );
-    TBTAuthorisationParamsPckg notifierParamsPckg( notifierParams );
-    iNotifier -> StartNotifierAndGetResponse( iReqStatus, KBTManAuthNotifierUid, notifierParamsPckg, iAuthQueryReply );
-    iLog -> Log( _L("Notifier started") );
-    
-    return KErrNone;
-    }
-
-
-TInt CBtNotifApiTest::FinishAuthQuery( CStifItemParser& aItem )
-    {
-    TInt res;
-    TPtrC optionName( KNullDesC );
-    TPtrC deviceBlockOptionName( KNullDesC );
-    TTestOption option;
-    
-    res = aItem.GetString( _L("FinishAuthQuery"), optionName );   
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetString failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }
-    
-    res = aItem.GetNextString( deviceBlockOptionName );
-    
-    res = GetTestOption( optionName, option );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetTestOption failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }  
-    
-    User::WaitForRequest( iReqStatus );
-    if ( iReqStatus.Int()!= KErrNone && iReqStatus.Int()!= KErrCancel && iReqStatus.Int()!= KErrAccessDenied )
-        {
-        iLog -> Log( _L("Failed to get notifier's response: %d"), iReqStatus.Int() );
-        iNotifier -> Close();
-        return iReqStatus.Int();
-        }
-    iLog -> Log( _L("Notifier responded") );
-    
-    switch ( option )
-        {
-        case EQueryDiscarded:
-            if ( !deviceBlockOptionName.Compare( _L( "BLOCK" ) ) )
-                {
-                iLog -> Log( _L("Block test device") );
-                iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrAccessDenied );
-                STIF_ASSERT_EQUALS( KErrAccessDenied, iReqStatus.Int() );
-                iLog -> Log( _L("Notifier's response value: %b, expected: %b"), iAuthQueryReply(), EFalse );  
-                STIF_ASSERT_FALSE( iAuthQueryReply() );
-                }
-            else if ( !deviceBlockOptionName.Compare( _L( "NONBLOCK" ) ) )
-                {
-                iLog -> Log( _L("Don't block test device") );
-                iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrCancel );
-                STIF_ASSERT_EQUALS( KErrCancel, iReqStatus.Int() );
-                iLog -> Log( _L("Notifier's response value: %b, expected: %b"), iAuthQueryReply(), EFalse );  
-                STIF_ASSERT_FALSE( iAuthQueryReply() );
-                }
-            else
-                {
-                iLog -> Log( _L("Option unavailable") );
-                return KErrNotFound;
-                }
-            break;
-        case EQueryAccepted:
-            iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrNone );
-            STIF_ASSERT_EQUALS( KErrNone, iReqStatus.Int() );
-            iLog -> Log( _L("Notifier's response value: %b, expected: %b"), iAuthQueryReply(), ETrue );
-            STIF_ASSERT_TRUE( iAuthQueryReply() );
-            break;
-        default:
-            iLog -> Log( _L("Option unavailable") );
-            return KErrNotFound;
-        }
-    
-    iNotifier -> Close();
-    iLog -> Log( _L("Test case passed") );
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CBtNotifApiTest::PinPasskeyQueryNotifierTests
-// -----------------------------------------------------------------------------
-//
-
-TInt CBtNotifApiTest::PinPasskeyQueryNotifierTest( CStifItemParser& aItem )
-    {
-    TInt res;
-    TPtrC initOptionName( KNullDesC );
-    TUint pinCodeMinLength = 4;
-    
-    res = iNotifier -> Connect();
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Failed to connect RNotifier with value: %d"), res );
-        return res;
-        }   
-    iLog -> Log( _L("RNotifier connected") );
-    
-    res = aItem.GetString( _L( "PinPasskeyQueryNotifierTest" ), initOptionName );   
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetString failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }
-    
-    TBTPinCodeEntryNotifierParams notifierParams;
-    
-    if ( !initOptionName.Compare( _L( "LOCAL" ) ) )
-        {
-        iLog -> Log( _L("Locally initiated connection") );
-        notifierParams = TBTPinCodeEntryNotifierParams( TBTDevAddr(), _L( "Test Device" ), pinCodeMinLength, ETrue, EFalse, pinCodeMinLength );
-        }
-    else if ( !initOptionName.Compare( _L( "REMOTE" ) ) )
-        {
-        iLog -> Log( _L("Remote side initiated connection") );
-        notifierParams = TBTPinCodeEntryNotifierParams( TBTDevAddr(), _L( "Test Device" ), pinCodeMinLength, EFalse, EFalse, pinCodeMinLength );
-        }
-    else
-        {
-        iLog -> Log( _L("Option unavailable") );
-        return KErrNotFound;
-        }
-          
-    TBTPinCodeEntryNotifierParamsPckg notifierParamsPckg( notifierParams );
-       
-    iNotifier -> StartNotifierAndGetResponse( iReqStatus, KBTPinCodeEntryNotifierUid, notifierParamsPckg, iEnteredPinPasskey );
-    iLog -> Log( _L("Notifier started") );
-    
-    return KErrNone;
-    }
-
-
-TInt CBtNotifApiTest::FinishPinPasskeyQuery( CStifItemParser& aItem )
-    {
-    TInt res;
-    TPtrC optionName( KNullDesC );
-    TPtrC connectionOptionName( KNullDesC );
-    TPtrC deviceBlockOptionName( KNullDesC );
-    TTestOption option;    
-    TPINCodeV10 pinKey;
-    
-    pinKey.iLength = 4;
-    pinKey.iPIN[0] = '0';
-    pinKey.iPIN[1] = '0';
-    pinKey.iPIN[2] = '0';
-    pinKey.iPIN[3] = '0';
-    
-    for ( int i = pinKey.iLength; i< KHCIPINCodeSize; i++ )
-        {
-        pinKey.iPIN[i] = NULL;
-        } 
-    iPinPasskey = pinKey;   
-    
-    res = aItem.GetString( _L( "FinishPinPasskeyQuery" ), optionName );   
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetString failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }
-    
-    res = GetTestOption( optionName, option );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetTestOption failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }
-    
-    User::WaitForRequest( iReqStatus );
-    
-    switch( option )
-        {
-        case ECheckPasskey:
-            iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrNone );
-            STIF_ASSERT_EQUALS( KErrNone, iReqStatus.Int() );
-            iLog -> Log( _L("Equal passkeys expected") );
-            STIF_ASSERT_EQUALS( iPinPasskey, iEnteredPinPasskey );                       
-            break;
-        case EQueryCanceled:
-            res = aItem.GetNextString( connectionOptionName );   
-            if ( res == KErrNone )
-                {
-                if ( !connectionOptionName.Compare( _L( "DISCARDCONN" ) ) )
-                    {
-                    res = aItem.GetNextString( deviceBlockOptionName );
-                    if ( res != KErrNone )
-                        {
-                        iLog -> Log( _L("GetNextString failed with value: %d"), res );
-                        iNotifier -> Close();
-                        return res;
-                        }
-                    
-                    if ( !deviceBlockOptionName.Compare( _L( "BLOCK" ) ) )
-                        {
-                        iLog -> Log( _L("Block test device") );
-                        iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrAccessDenied );
-                        STIF_ASSERT_EQUALS( KErrAccessDenied, iReqStatus.Int() );
-                        }
-                    else if ( !deviceBlockOptionName.Compare( _L( "NONBLOCK" ) ) )
-                        {
-                        iLog -> Log( _L("Don't block test device") );
-                        iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrCancel );
-                        STIF_ASSERT_EQUALS( KErrCancel, iReqStatus.Int() );
-                        }
-                    else
-                        {
-                        iLog -> Log( _L("Block connection option unavailable") );
-                        return KErrNotFound;
-                        }                    
-                    }
-                else if ( !connectionOptionName.Compare( _L( "ACCEPTCONN" ) ) )
-                    {
-                    iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrCancel );
-                    STIF_ASSERT_EQUALS( KErrCancel, iReqStatus.Int() );
-                    }      
-                else 
-                    {
-                    iLog -> Log( _L("Connection option unavailable") );
-                    return KErrNotFound;
-                    }
-                }
-            else if ( res == KErrNotFound )
-                {
-                iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrCancel );
-                STIF_ASSERT_EQUALS( KErrCancel, iReqStatus.Int() );
-                }
-            else 
-                return res;
-            break;
-        default:
-            iLog -> Log( _L("Option unavailable") );
-            return KErrNotFound;
-        }
-    
-    iNotifier -> Close();
-    iLog -> Log( _L("Test case passed") );
-    
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CBtNotifApiTest::InquiryNotifierTests
-// -----------------------------------------------------------------------------
-//
-
-TInt CBtNotifApiTest::InquiryNotifierTest( CStifItemParser& aItem )
-    {
-    TInt res;
-    TPtrC initOptionName( KNullDesC );
-    TBTRegistrySearch regSearch;
-    TBTPowerStateValue btPowerState;
-    TBTDeviceSelectionParamsPckg emptyNotifierParamsPckg;
-        
-    res = iNotifier -> Connect();
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Failed to connect RNotifier with value: %d"), res );
-        return res;
-        }   
-    iLog -> Log( _L("RNotifier connected") );
-    
-    res = iBtSettings -> GetPowerState( btPowerState );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Failed to get BT power state with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }
-    
-    if ( btPowerState == EBTPowerOn )
-        {
-        res = iBtSettings -> SetPowerState( EBTPowerOff );
-        if ( res != KErrNone )
-            {
-            iLog -> Log( _L("Failed to set BT off with value: %d"), res );
-            iNotifier -> Close();
-            return res;
-            } 
-        }
-    
-    regSearch.FindAll();    
-    res = iBtEngDevManObserver -> GetDevices( regSearch, iBtDeviceArray );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Getting devices from register failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }
-
-    if ( iBtDeviceArray -> Count() > 0 )
-        {
-        iBtDeviceArray -> Reset();
-        res = iBtEngDevManObserver -> DeleteDevices( regSearch );
-        if ( res != KErrNone )
-            {
-            iLog -> Log( _L("Deleting devices from register failed with value: %d"), res );
-            iNotifier -> Close();
-            return res;
-            }
-        }
-    
-    res = aItem.GetString( _L( "InquiryNotifierTest" ), initOptionName );   
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetString failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }
-    
-    if ( !initOptionName.Compare( _L( "BTOFF" ) ) )
-        {    
-        iLog -> Log( _L("Init test option: bt off") );
-        }
-    else if ( !initOptionName.Compare( _L( "PAIRED" ) ) )
-        {
-        iLog -> Log( _L("Init test option: paired test device") );
-        iTestDevice -> SetDeviceAddress( 0x12345678 );
-        iTestDevice -> SetPaired( ELinkKeyAuthenticated );
-        TBTDeviceClass testDeviceClass( EMajorServiceLimitedDiscoverableMode, EMajorDeviceComputer, EMinorDeviceComputerUnclassified );
-        iTestDevice -> SetDeviceClass( testDeviceClass );
-        iTestDevice -> SetDeviceNameL( _L8( "TestedDevice" ) );
-        
-        res = iBtEngDevManObserver -> AddDevice( *iTestDevice );
-        if ( res != KErrNone )
-            {
-            iLog -> Log( _L("Adding device to register failed with value: %d"), res );
-            iNotifier -> Close();
-            return res;
-            }
-        }
-    else if ( !initOptionName.Compare( _L( "NONPAIRED" ) ) )
-        {
-        iLog -> Log( _L("Init test option: test device not paired") );
-        }
-    else
-        {
-        iLog -> Log( _L("Option unavailable") );
-        iNotifier -> Close();
-        return KErrNotFound;
-        }
-    
-    if ( initOptionName.Compare( _L( "BTOFF" ) ) )
-        {
-        res = iBtSettings -> SetPowerState( EBTPowerOn );
-        if ( res != KErrNone )
-            {
-            iLog -> Log( _L("Failed to set BT on with value: %d"), res );
-            iNotifier -> Close();
-            return res;
-            } 
-        }
-
-    iNotifier -> StartNotifierAndGetResponse( iReqStatus, KDeviceSelectionNotifierUid, emptyNotifierParamsPckg, iBtDeviceResponseParamsPckg );
-    iLog -> Log( _L("Notifier started") );
-    
-    User::After( 5000000 );
-
-    return KErrNone;
-    }
-
-
-TInt CBtNotifApiTest::FinishInquiry( CStifItemParser& aItem )
-    {
-    TInt res;
-    TPtrC optionName( KNullDesC );
-    TPtrC subOptionName( KNullDesC );
-    TBTPowerStateValue btPowerState;
-    TTestOption option;
-    
-    res = aItem.GetString( _L( "FinishInquiry" ), optionName );   
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetString failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }
-    
-    res = aItem.GetNextString( subOptionName );   
-    iLog -> Log( _L("GetString  value: %d"), res );
-    
-    if ( !subOptionName.Compare( _L( "BTOFF" ) ) )
-        {
-        iLog -> Log( _L("Test suboption: set bt off") );
-        iBtSettings -> SetPowerState( EBTPowerOff );
-        if ( res != KErrNone )
-            {
-            iLog -> Log( _L("Failed to set BT off with value: %d"), res );
-            iNotifier -> Close();
-            return res;
-            } 
-        }
-   
-    res = GetTestOption( optionName, option );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetTestOption failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }
-    
-    User::WaitForRequest( iReqStatus );
-    
-    switch( option )
-        {
-        case EQueryAccepted:
-            {
-            iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrNone );
-            STIF_ASSERT_EQUALS( KErrNone, iReqStatus.Int() );
-            
-            HBufC16* inputDeviceNameBuf = HBufC16::New( iTestDevice -> DeviceName().Length() );
-            TPtr16 inputDeviceName = inputDeviceNameBuf -> Des();
-            inputDeviceName.Copy( iTestDevice -> DeviceName() );
-            
-            HBufC16* outputDeviceNameBuf = HBufC16::New( iBtDeviceResponseParamsPckg().DeviceName().Length() );
-            TPtr16 outputDeviceName = outputDeviceNameBuf -> Des();
-            outputDeviceName.Copy( iBtDeviceResponseParamsPckg().DeviceName() );
-              
-            iLog -> Log( _L( "Equal device addresses expected" ) );
-            STIF_ASSERT_EQUALS( iTestDevice -> BDAddr(), iBtDeviceResponseParamsPckg().BDAddr() );
-            iLog -> Log( _L( "Equal device names expected" ) );
-            STIF_ASSERT_EQUALS( inputDeviceName, outputDeviceName );
-            iLog -> Log( _L( "Equal device classes expected" ) );
-            STIF_ASSERT_EQUALS( iTestDevice -> DeviceClass(), iBtDeviceResponseParamsPckg().DeviceClass() );
-            
-            delete inputDeviceNameBuf;
-            delete outputDeviceNameBuf;
-            }
-            break;
-        case EQueryCanceled:
-            iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrCancel );
-            STIF_ASSERT_EQUALS( KErrCancel, iReqStatus.Int() );
-            break;
-        default:
-            iLog -> Log( _L("Option unavailable") );
-            return KErrNotFound;
-        }
-    
-    res = iBtSettings -> GetPowerState( btPowerState );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Failed to get BT power state with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }
-    
-    if ( btPowerState == EBTPowerOn )
-        {
-        res = iBtSettings -> SetPowerState( EBTPowerOff );
-        if ( res != KErrNone )
-            {
-            iLog -> Log( _L("Failed to set BT off with value: %d"), res );
-            iNotifier -> Close();
-            return res;
-            } 
-        }
-    
-    iNotifier -> Close();
-    iLog -> Log( _L("Test case passed") );
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CBtNotifApiTest::ObexPasskeyQueryNotifierTests
-// -----------------------------------------------------------------------------
-//
-
-TInt CBtNotifApiTest::ObexPasskeyQueryNotifierTest( CStifItemParser& aItem )
-    {
-    TInt res;
-    TUint8 passCode[] = { "0000" };
-    TBTObexPasskey passKey = passCode;
-    
-    res = iNotifier -> Connect();
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Failed to connect RNotifier with value: %d"), res );
-        return res;
-        }   
-    iLog -> Log( _L("RNotifier connected") );
-    
-    iObexPasskeyBuf = passKey;  
-    iNotifier -> StartNotifierAndGetResponse( iReqStatus, KBTObexPasskeyQueryNotifierUid, iObexPasskeyBuf, iEnteredPasskeyBuf );
-    iLog -> Log( _L("Notifier started") );
-    
-    return KErrNone;
-    }
-
-
-TInt CBtNotifApiTest::FinishObexPasskeyQuery( CStifItemParser& aItem )
-    {
-    TInt res;
-    TPtrC optionName( KNullDesC );
-    TTestOption option;
-    
-    res = aItem.GetNextString( optionName );   
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetNextString failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }  
-    
-    res = GetTestOption( optionName, option );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetTestOption failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }  
-    
-    User::WaitForRequest( iReqStatus );    
-    switch( option )
-        {
-        case ECheckPasskey:
-            iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrNone );
-            STIF_ASSERT_EQUALS( KErrNone, iReqStatus.Int() );
-            iLog -> Log( _L("Equal passkeys expected") );
-            STIF_ASSERT_EQUALS( iObexPasskeyBuf(), iEnteredPasskeyBuf() );
-            break;
-        case EQueryCanceled:
-            iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrCancel );
-            STIF_ASSERT_EQUALS( KErrCancel, iReqStatus.Int() );
-            break;
-        default:
-            iLog -> Log( _L("Option unavailable") );
-            return KErrNotFound;
-        }
-    
-    iNotifier -> Close();
-    iLog -> Log( _L("Test case passed") );
-
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CBtNotifApiTest::PowerModeQueryNotifierTests
-// -----------------------------------------------------------------------------
-//
-
-TInt CBtNotifApiTest::PowerModeQueryNotifierTest( CStifItemParser& aItem )
-    {
-    TInt res;
-    TBTPowerStateValue state;
-    TBuf<KMaxBCBluetoothNameLen> testDeviceName = _L( "Device Test Name" );
-    
-    res = iNotifier -> Connect();
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Failed to connect RNotifier with value: %d"), res );
-        return res;
-        }   
-    iLog -> Log( _L("RNotifier connected") );
-    
-    
-    res = iBtSettings -> GetPowerState( state );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Failed to get bt power state with value: %d"), res );
-        return res;
-        }
-    
-    if ( state != EBTPowerOff )
-        {
-        res = iBtSettings -> SetPowerState( EBTPowerOff );
-        if ( res != KErrNone )
-            {
-            iLog -> Log( _L("Failed to set bt power state with value: %d"), res );
-            return res;
-            }
-        }
-    
-    res = iBtSettings -> GetLocalName( iLocalDeviceName );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Failed backup device name: %d"), res );
-        return res;
-        }
-    
-    res = iBtSettings -> SetLocalName( testDeviceName );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Failed set device name: %d"), res );
-        return res;
-        }
-    
-    TPckgBuf<TBool> emptyInput;   
-    iNotifier -> StartNotifierAndGetResponse( iReqStatus, KPowerModeSettingNotifierUid, emptyInput, iPowerModeQueryReply );
-    iLog -> Log( _L("Notifier started") );
-    
-    return KErrNone;
-    }
-
-
-TInt CBtNotifApiTest::FinishPowerModeQuery( CStifItemParser& aItem )
-    {
-    TInt res;
-    TPtrC optionName( KNullDesC );
-    TTestOption option;    
-    
-    res = aItem.GetNextString( optionName );   
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetNextString failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }  
-    
-    res = GetTestOption( optionName, option );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetTestOption failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }    
-    
-    User::WaitForRequest( iReqStatus );
-    
-    if ( iReqStatus.Int()!= KErrNone && iReqStatus.Int()!= KErrCancel )
-        {
-        iLog -> Log( _L("Failed to get notifier's response: %d"), iReqStatus.Int() );
-        iNotifier -> Close();
-        return iReqStatus.Int();
-        }
-    iLog -> Log( _L("Notifier responded") );
-    
-    iBtSettings -> SetLocalName( iLocalDeviceName );
-    
-    switch ( option )
-        {
-        case EQueryDiscarded:
-            iLog -> Log( _L("Returned request status: %d, expected: %d"), iReqStatus.Int(), KErrCancel );
-            STIF_ASSERT_EQUALS( KErrCancel, iReqStatus.Int() );
-            iLog -> Log( _L("Notifier's response value: %b, expected: %b"), iPowerModeQueryReply(), EFalse );  
-            STIF_ASSERT_FALSE( iPowerModeQueryReply() );
-            break;
-        case EQueryAccepted:
-            res = iBtSettings -> SetPowerState( EBTPowerOff );
-            if ( res != KErrNone )
-                {
-                iLog -> Log( _L("Failed to set bt power state off with value: %d"), res );
-                return res;
-                }
-            iLog -> Log( _L("Returned request status: %d, expected: %d"), iReqStatus.Int(), KErrNone );
-            STIF_ASSERT_EQUALS( KErrNone, iReqStatus.Int() );
-            iLog -> Log( _L("Notifier's response value: %b, expected: %b"), iPowerModeQueryReply(), ETrue );
-            STIF_ASSERT_TRUE( iPowerModeQueryReply() );
-            break;
-        default:
-            iLog -> Log( _L("Option unavailable") );
-            return KErrNotFound;
-        }
-  
-    iNotifier -> Close();
-    iLog -> Log( _L("Test case passed") );
-    
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CBtNotifApiTest::GenericInfoNotifierTests
-// -----------------------------------------------------------------------------
-//
-
-TInt CBtNotifApiTest::GenericInfoNotifierTest( CStifItemParser& aItem )
-    {
-    TInt res;
-    TBTGenericInfoNotifierParams notifierParams;
-    TBTGenericInfoNoteType genericInfoNoteType;
-    TPtrC genericInfoNoteTypeString( KNullDesC );
-    
-    res = iNotifier -> Connect();
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Failed to connect RNotifier with value: %d"), res );
-        return res;
-        }   
-    iLog -> Log( _L("RNotifier connected") );
-    
-    res = aItem.GetNextString( genericInfoNoteTypeString );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetNextString failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }  
-    
-    res = GetGenericInfoNoteType( genericInfoNoteTypeString, genericInfoNoteType );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Generic info note type not found") );
-        iNotifier -> Close();
-        return res;
-        }
-    
-    notifierParams.iMessageType = genericInfoNoteType;
-    notifierParams.iRemoteAddr = _L8( "012345" );
-    TBTGenericInfoNotiferParamsPckg messageInfo( notifierParams );
-    TPckgBuf<TBool> emptyReply;
-    
-    iNotifier -> StartNotifierAndGetResponse( iReqStatus, KBTGenericInfoNotifierUid, messageInfo, emptyReply );
-    iLog -> Log( _L("Notifier started") );
-    User::WaitForRequest( iReqStatus );
-    iLog -> Log( _L("Returned request status: %d, expected: %d"), iReqStatus.Int(), KErrNone );
-    STIF_ASSERT_EQUALS( KErrNone, iReqStatus.Int() );
-    
-    iNotifier -> Close();
-    iLog -> Log( _L("Test case passed") );
-    
-    return KErrNone;
-    }
-
-TInt CBtNotifApiTest::GetGenericInfoNoteType( TPtrC aTypeString, TBTGenericInfoNoteType& aGenericInfoNoteType )
-    {
-    if ( !aTypeString.Compare( _L( "EBTConnected" ) ) )
-        {
-        aGenericInfoNoteType = EBTConnected;
-        iLog -> Log( _L("Generic info message type: EBTConnected") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTDisconnected" ) ) )
-        {
-        aGenericInfoNoteType = EBTDisconnected;
-        iLog -> Log( _L("Generic info message type: EBTDisconnected") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTAudioAccessory" ) ) )
-        {
-        aGenericInfoNoteType = EBTAudioAccessory;
-        iLog -> Log( _L("Generic info message type: EBTAudioAccessory") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTAudioHandset" ) ) )
-        {
-        aGenericInfoNoteType = EBTAudioHandset;
-        iLog -> Log( _L("Generic info message type: EBTAudioHandset") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTClosed" ) ) )
-        {
-        aGenericInfoNoteType = EBTClosed;
-        iLog -> Log( _L("Generic info message type: EBTClosed") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTDeviceNotAvailable" ) ) )
-        {
-        aGenericInfoNoteType = EBTDeviceNotAvailable;
-        iLog -> Log( _L("Generic info message type: EBTDeviceNotAvailable") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTOfflineDisabled" ) ) )
-        {
-        aGenericInfoNoteType = EBTOfflineDisabled;
-        iLog -> Log( _L("Generic info message type: EBTOfflineDisabled") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTVisibilityTimeout" ) ) )
-        {
-        aGenericInfoNoteType = EBTVisibilityTimeout;
-        iLog -> Log( _L("Generic info message type: EBTVisibilityTimeout") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTEnterSap" ) ) )
-        {
-        aGenericInfoNoteType = EBTEnterSap;
-        iLog -> Log( _L("Generic info message type: EBTEnterSap") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTSapOk" ) ) )
-        {
-        aGenericInfoNoteType = EBTSapOk;
-        iLog -> Log( _L("Generic info message type: EBTSapOk") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTSapFailed" ) ) )
-        {
-        aGenericInfoNoteType = EBTSapFailed;
-        iLog -> Log( _L("Generic info message type: EBTSapFailed") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTSapNoSim" ) ) )
-        {
-        aGenericInfoNoteType = EBTSapNoSim;
-        iLog -> Log( _L("Generic info message type: EBTSapNoSim") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTDeviceBusy" ) ) )
-        {
-        aGenericInfoNoteType = EBTDeviceBusy;
-        iLog -> Log( _L("Generic info message type: EBTDeviceBusy") );
-        }
-    else if ( !aTypeString.Compare( _L( "EIRNotSupported" ) ) )
-        {
-        aGenericInfoNoteType = EIRNotSupported;
-        iLog -> Log( _L("Generic info message type: EIRNotSupported") );
-        }
-    else if ( !aTypeString.Compare( _L( "ECmdShowBtBatteryLow" ) ) )
-        {
-        aGenericInfoNoteType = ECmdShowBtBatteryLow;
-        iLog -> Log( _L("Generic info message type: ECmdShowBtBatteryLow") );
-        }
-    else if ( !aTypeString.Compare( _L( "ECmdShowBtBatteryCritical" ) ) )
-        {
-        aGenericInfoNoteType = ECmdShowBtBatteryCritical;
-        iLog -> Log( _L("Generic info message type: ECmdShowBtBatteryCritical") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTStayPowerOn" ) ) )
-        {
-        aGenericInfoNoteType = EBTStayPowerOn;
-        iLog -> Log( _L("Generic info message type: EBTStayPowerOn") );
-        }
-    else
-        {
-        iLog -> Log( _L("Generic info message type: No type matched") );
-        return KErrNotFound;
-        }
-    
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CBtNotifApiTest::GenericQueryNotifierTests
-// -----------------------------------------------------------------------------
-//
-
-TInt CBtNotifApiTest::GenericQueryNotifierTest( CStifItemParser& aItem )
-    {
-    TInt res;
-    TBTGenericQueryNotifierParams notifierParams;
-    TBTGenericQueryNoteType genericQueryNoteType;
-    TPtrC genericQueryNoteTypeString( KNullDesC );
-    
-    res = iNotifier -> Connect();
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Failed to connect RNotifier with value: %d"), res );
-        return res;
-        }   
-    iLog -> Log( _L("RNotifier connected") );
-    
-    res = aItem.GetNextString( genericQueryNoteTypeString );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetNextString failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        } 
-    
-    res = GetGenericQueryNoteType( genericQueryNoteTypeString, genericQueryNoteType );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("Generic query note type not found") );
-        iNotifier -> Close();
-        return res;
-        }
-    
-    notifierParams.iMessageType = genericQueryNoteType;
-    notifierParams.iNameExists = EFalse;   
-    TBTGenericQueryNotiferParamsPckg messageInfo( notifierParams );   
-    iNotifier -> StartNotifierAndGetResponse( iReqStatus, KBTGenericQueryNotifierUid, messageInfo, iGenericQueryReply );
-    iLog -> Log( _L("Notifier started") );
-    
-    return KErrNone;
-    }
-
-
-TInt CBtNotifApiTest::FinishGenericQuery( CStifItemParser& aItem )
-    {
-    TInt res;
-    TPtrC optionName( KNullDesC );
-    TTestOption option;
-    
-    res = aItem.GetNextString( optionName );   
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetNextString failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }  
-    
-    res = GetTestOption( optionName, option );
-    if ( res != KErrNone )
-        {
-        iLog -> Log( _L("GetTestOption failed with value: %d"), res );
-        iNotifier -> Close();
-        return res;
-        }   
-    
-    User::WaitForRequest( iReqStatus );
-    if ( iReqStatus.Int()!= KErrNone )
-        {
-        iLog -> Log( _L("Failed to get notifier's response: %d"), iReqStatus.Int() );
-        iNotifier -> Close();
-        return iReqStatus.Int();
-        }
-    iLog -> Log( _L("Notifier responded") );
-    
-    switch ( option )
-        {
-        case EQueryDiscarded:
-            iLog -> Log( _L("Notifier's response value: %b, expected: %b"), iGenericQueryReply(), EFalse );  
-            STIF_ASSERT_FALSE( iGenericQueryReply() );
-            break;
-        case EQueryAccepted:
-            iLog -> Log( _L("Notifier's response value: %b, expected: %b"), iGenericQueryReply(), ETrue );
-            STIF_ASSERT_TRUE( iGenericQueryReply() );
-            break;
-        default:
-            iLog -> Log( _L("Option unavailable") );
-            return KErrNotFound;
-        }
-    
-    iNotifier -> Close();
-    iLog -> Log( _L("Test case passed") );
-    
-    return KErrNone;
-    }
-
-
-TInt CBtNotifApiTest::GetGenericQueryNoteType( TPtrC aTypeString, TBTGenericQueryNoteType& aGenericQueryNoteType )
-    {   
-    if ( !aTypeString.Compare( _L( "EBTReceiveMessageQuery" ) ) )
-        {
-        aGenericQueryNoteType = EBTReceiveMessageQuery;
-        iLog -> Log( _L("Generic query message type: EBTReceiveMessageQuery") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTReceiveMessagePairedQuery" ) ) )
-        {
-        aGenericQueryNoteType = EBTReceiveMessagePairedQuery;
-        iLog -> Log( _L("Generic query message type: EBTReceiveMessagePairedQuery") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTIsOffQuery" ) ) )
-        {
-        aGenericQueryNoteType = EBTIsOffQuery;
-        iLog -> Log( _L("Generic query message type: EBTIsOffQuery") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTActivateOffLineQuery" ) ) )
-        {
-        aGenericQueryNoteType = EBTActivateOffLineQuery;
-        iLog -> Log( _L("Generic query message type: EBTActivateOffLineQuery") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTNoDevicesFoundQuery" ) ) )
-        {
-        aGenericQueryNoteType = EBTNoDevicesFoundQuery;
-        iLog -> Log( _L("Generic query message type: EBTNoDevicesFoundQuery") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTAcceptRequestQuery" ) ) )
-        {
-        aGenericQueryNoteType = EBTAcceptRequestQuery;
-        iLog -> Log( _L("Generic query message type: EBTAcceptRequestQuery") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTBlockConnectionQuery" ) ) )
-        {
-        aGenericQueryNoteType = EBTBlockConnectionQuery;
-        iLog -> Log( _L("Generic query message type: EBTBlockConnectionQuery") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTBlockPairedConnectionQuery" ) ) )
-        {
-        aGenericQueryNoteType = EBTBlockPairedConnectionQuery;
-        iLog -> Log( _L("Generic query message type: EBTBlockPairedConnectionQuery") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTIsNotShownQuery" ) ) )
-        {
-        aGenericQueryNoteType = EBTIsNotShownQuery;
-        iLog -> Log( _L("Generic query message type: EBTIsNotShownQuery") );
-        }
-    else if ( !aTypeString.Compare( _L( "EBTIsOffJavaQuery" ) ) )
-        {
-        aGenericQueryNoteType = EBTIsOffJavaQuery;
-        iLog -> Log( _L("Generic query message type: EBTIsOffJavaQuery") );
-        }
-    else
-        {
-        iLog -> Log( _L("Generic query message type: No type matched") );
-        return KErrNotFound;
-        }
-    
-    return KErrNone;
-    }
-
-
-// -----------------------------------------------------------------------------
-// CBtNotifApiTest::GetTestOption
-// -----------------------------------------------------------------------------
-//
-
-TInt CBtNotifApiTest::GetTestOption( TPtrC aOptionString, TTestOption& aOption )
-    {    
-    if ( !aOptionString.Compare( _L( "DISCARD" ) ) )
-        {
-        aOption = EQueryDiscarded;
-        iLog -> Log( _L("Test type: EQueryDiscarded") );
-        }
-    else if ( !aOptionString.Compare( _L( "ACCEPT" ) ) )
-        {
-        aOption = EQueryAccepted;
-        iLog -> Log( _L("Test type: EQueryAccepted") );
-        }
-    else if ( !aOptionString.Compare( _L( "PASSKEY" ) ) )
-        {
-        aOption = ECheckPasskey;
-        iLog -> Log( _L("Test type: ECheckPasskey") );
-        }
-    else if ( !aOptionString.Compare( _L( "CANCEL" ) ) )
-        {
-        aOption = EQueryCanceled;
-        iLog -> Log( _L("Test type: EQueryCanceled") );
-        }
-    else
-        return KErrNotFound;  
- 
-    return KErrNone;
-    }
-
-TInt CBtNotifApiTest::TurnLightsOn( CStifItemParser& aItem )
-    {
-    TInt res;
-    res = RProperty::Set(KPSUidCoreApplicationUIs, KLightsControl, ELightsOn);
-    return res;
-    }
-
-
-// ========================== OTHER EXPORTED FUNCTIONS =========================
-// None
-
-//  [End of File] - Do not remove
--- a/bluetoothengine/btnotif/tsrc/BtNotifApiTest/src/BtSettingsObserver.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#include "BtSettingsObserver.h"
-
-CBtSettingsObserver::CBtSettingsObserver()
-    {
-    }
-
-CBtSettingsObserver::~CBtSettingsObserver()
-    {
-    delete iSettings;
-    if( iWaiter->IsStarted() )
-        {
-        iWaiter->AsyncStop();
-        }
-    delete iWaiter;
-    }
-
-CBtSettingsObserver* CBtSettingsObserver::NewLC()
-    {
-    CBtSettingsObserver* self = new ( ELeave ) CBtSettingsObserver();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-    }
-
-CBtSettingsObserver* CBtSettingsObserver::NewL()
-    {
-    CBtSettingsObserver* self = CBtSettingsObserver::NewLC();
-    CleanupStack::Pop(); // self;
-    return self;
-    }
-
-void CBtSettingsObserver::ConstructL()
-    {
-    iWaiter = new ( ELeave ) CActiveSchedulerWait();
-    iSettings = CBTEngSettings::NewL( this );
-    iError = KErrNone;
-    }
-
-void CBtSettingsObserver::PowerStateChanged( TBTPowerStateValue /*aState*/ )
-    {
-    if( iWaiter->IsStarted() )
-        {
-        iWaiter->AsyncStop();
-        }
-    }
-
-void CBtSettingsObserver::VisibilityModeChanged( TBTVisibilityMode /*aState*/ )
-    {
-    if( iWaiter->IsStarted() )
-        {
-        iWaiter->AsyncStop();
-        }
-    }
-
-TInt CBtSettingsObserver::GetPowerState( TBTPowerStateValue& aState )
-    {
-    iError = iSettings->GetPowerState( aState );
-    return iError;
-    }
-
-TInt CBtSettingsObserver::SetPowerState( TBTPowerStateValue aState )
-    {
-    TBTPowerStateValue state;
-    
-    iError = iSettings->GetPowerState( state );
-    if( iError )
-        {
-        return iError;
-        }
-    else if( state != aState )
-            {
-            if( state == EBTPowerOff )
-                {
-                iError = iSettings->SetPowerState( EBTPowerOn );
-                }
-            else
-                {
-                iError = iSettings->SetPowerState( EBTPowerOff );
-                }
-            
-            if( iError )
-                {
-                return iError;
-                }
-            else
-                {
-                if ( !iWaiter->IsStarted() )
-                    {
-                    iWaiter->Start();
-                    }
-                }
-            }
-    return iError;
-    }
-
-TInt CBtSettingsObserver::GetVisibilityMode( TBTVisibilityMode& /*aMode*/ )
-    {
-    return KErrNone;
-    }
-
-TInt CBtSettingsObserver::SetVisibilityMode( TBTVisibilityMode /*aMode*/, TInt /*aTime*/ )
-    {
-    return KErrNone;
-    }
-
-TInt CBtSettingsObserver::GetLocalName( TDes& aName )
-    {
-    iError = iSettings -> GetLocalName( aName );    
-    return iError;
-    }
-
-TInt CBtSettingsObserver::SetLocalName( const TDes& aName )
-    {
-    iError = iSettings -> SetLocalName( aName );    
-    return iError;
-    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/bwins/btserviceutilu.def	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,33 @@
+EXPORTS
+	?CopyL@CBtDevExtension@@QAEPAV1@XZ @ 1 NONAME ; class CBtDevExtension * CBtDevExtension::CopyL(void)
+	?GoActive@CBtSimpleActive@@QAEXXZ @ 2 NONAME ; void CBtSimpleActive::GoActive(void)
+	?IsUserAwareBonded@CBtDevExtension@@QBEHXZ @ 3 NONAME ; int CBtDevExtension::IsUserAwareBonded(void) const
+	?IsUserAwareBonded@CBtDevExtension@@SAHABVTBTNamelessDevice@@@Z @ 4 NONAME ; int CBtDevExtension::IsUserAwareBonded(class TBTNamelessDevice const &)
+	?NewL@CBtSimpleActive@@SAPAV1@AAVMBtSimpleActiveObserver@@HH@Z @ 5 NONAME ; class CBtSimpleActive * CBtSimpleActive::NewL(class MBtSimpleActiveObserver &, int, int)
+	?AllDevices@CBtDevRepository@@QBEABV?$RPointerArray@VCBtDevExtension@@@@XZ @ 6 NONAME ; class RPointerArray<class CBtDevExtension> const & CBtDevRepository::AllDevices(void) const
+	?IsBonded@CBtDevExtension@@SAHABVTBTNamelessDevice@@@Z @ 7 NONAME ; int CBtDevExtension::IsBonded(class TBTNamelessDevice const &)
+	?RemoveObserver@CBtDevRepository@@QAEXPAVMBtDevRepositoryObserver@@@Z @ 8 NONAME ; void CBtDevRepository::RemoveObserver(class MBtDevRepositoryObserver *)
+	?AddObserverL@CBtDevRepository@@QAEXPAVMBtDevRepositoryObserver@@@Z @ 9 NONAME ; void CBtDevRepository::AddObserverL(class MBtDevRepositoryObserver *)
+	?SetRequestId@CBtSimpleActive@@QAEXH@Z @ 10 NONAME ; void CBtSimpleActive::SetRequestId(int)
+	?SetDeviceL@CBtDevExtension@@QAEXPAVCBTDevice@@@Z @ 11 NONAME ; void CBtDevExtension::SetDeviceL(class CBTDevice *)
+	??1CBtDevRepository@@UAE@XZ @ 12 NONAME ; CBtDevRepository::~CBtDevRepository(void)
+	?SetObserver@CAdvanceDevDiscoverer@@QAEXAAVMDevDiscoveryObserver@@@Z @ 13 NONAME ; void CAdvanceDevDiscoverer::SetObserver(class MDevDiscoveryObserver &)
+	?RequestStatus@CBtSimpleActive@@QAEAAVTRequestStatus@@XZ @ 14 NONAME ; class TRequestStatus & CBtSimpleActive::RequestStatus(void)
+	??1CAdvanceDevDiscoverer@@UAE@XZ @ 15 NONAME ; CAdvanceDevDiscoverer::~CAdvanceDevDiscoverer(void)
+	?Alias@CBtDevExtension@@QBEABVTDesC16@@XZ @ 16 NONAME ; class TDesC16 const & CBtDevExtension::Alias(void) const
+	?NewL@CAdvanceDevDiscoverer@@SAPAV1@AAVCBtDevRepository@@AAVMDevDiscoveryObserver@@@Z @ 17 NONAME ; class CAdvanceDevDiscoverer * CAdvanceDevDiscoverer::NewL(class CBtDevRepository &, class MDevDiscoveryObserver &)
+	?ServiceConnectionStatus@CBtDevExtension@@QBE?AW4TBTEngConnectionStatus@@XZ @ 18 NONAME ; enum TBTEngConnectionStatus CBtDevExtension::ServiceConnectionStatus(void) const
+	?NewLC@CBtDevExtension@@SAPAV1@ABVTInquirySockAddr@@ABVTDesC16@@W4TDefaultDevNameOption@@@Z @ 19 NONAME ; class CBtDevExtension * CBtDevExtension::NewLC(class TInquirySockAddr const &, class TDesC16 const &, enum TDefaultDevNameOption)
+	??1CBtDevExtension@@UAE@XZ @ 20 NONAME ; CBtDevExtension::~CBtDevExtension(void)
+	?DiscoverDeviceL@CAdvanceDevDiscoverer@@QAEXW4TDevDiscoveryFilter@1@W4TBTMajorDeviceClass@@@Z @ 21 NONAME ; void CAdvanceDevDiscoverer::DiscoverDeviceL(enum CAdvanceDevDiscoverer::TDevDiscoveryFilter, enum TBTMajorDeviceClass)
+	?NewLC@CBtDevExtension@@SAPAV1@PAVCBTDevice@@W4TDefaultDevNameOption@@@Z @ 22 NONAME ; class CBtDevExtension * CBtDevExtension::NewLC(class CBTDevice *, enum TDefaultDevNameOption)
+	?IsJustWorksBonded@CBtDevExtension@@SAHABVTBTNamelessDevice@@@Z @ 23 NONAME ; int CBtDevExtension::IsJustWorksBonded(class TBTNamelessDevice const &)
+	?Device@CBtDevExtension@@QBEABVCBTDevice@@XZ @ 24 NONAME ; class CBTDevice const & CBtDevExtension::Device(void) const
+	?RequestId@CBtSimpleActive@@QAEHXZ @ 25 NONAME ; int CBtSimpleActive::RequestId(void)
+	?IsInitialized@CBtDevRepository@@QBEHXZ @ 26 NONAME ; int CBtDevRepository::IsInitialized(void) const
+	?Addr@CBtDevExtension@@QBEABVTBTDevAddr@@XZ @ 27 NONAME ; class TBTDevAddr const & CBtDevExtension::Addr(void) const
+	?CancelDiscovery@CAdvanceDevDiscoverer@@QAEXXZ @ 28 NONAME ; void CAdvanceDevDiscoverer::CancelDiscovery(void)
+	?NewL@CBtDevRepository@@SAPAV1@XZ @ 29 NONAME ; class CBtDevRepository * CBtDevRepository::NewL(void)
+	??1CBtSimpleActive@@UAE@XZ @ 30 NONAME ; CBtSimpleActive::~CBtSimpleActive(void)
+	?Device@CBtDevRepository@@QBEPBVCBtDevExtension@@ABVTBTDevAddr@@@Z @ 31 NONAME ; class CBtDevExtension const * CBtDevRepository::Device(class TBTDevAddr const &) const
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/eabi/btserviceutilu.def	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,37 @@
+EXPORTS
+	_ZN15CBtDevExtension10SetDeviceLEP9CBTDevice @ 1 NONAME
+	_ZN15CBtDevExtension5CopyLEv @ 2 NONAME
+	_ZN15CBtDevExtension5NewLCEP9CBTDevice21TDefaultDevNameOption @ 3 NONAME
+	_ZN15CBtDevExtension5NewLCERK16TInquirySockAddrRK7TDesC1621TDefaultDevNameOption @ 4 NONAME
+	_ZN15CBtDevExtensionD0Ev @ 5 NONAME
+	_ZN15CBtDevExtensionD1Ev @ 6 NONAME
+	_ZN15CBtDevExtensionD2Ev @ 7 NONAME
+	_ZN15CBtSimpleActive12SetRequestIdEi @ 8 NONAME
+	_ZN15CBtSimpleActive13RequestStatusEv @ 9 NONAME
+	_ZN15CBtSimpleActive4NewLER23MBtSimpleActiveObserverii @ 10 NONAME
+	_ZN15CBtSimpleActive8GoActiveEv @ 11 NONAME
+	_ZN15CBtSimpleActive9RequestIdEv @ 12 NONAME
+	_ZN15CBtSimpleActiveD0Ev @ 13 NONAME
+	_ZN15CBtSimpleActiveD1Ev @ 14 NONAME
+	_ZN15CBtSimpleActiveD2Ev @ 15 NONAME
+	_ZN16CBtDevRepository12AddObserverLEP24MBtDevRepositoryObserver @ 16 NONAME
+	_ZN16CBtDevRepository14RemoveObserverEP24MBtDevRepositoryObserver @ 17 NONAME
+	_ZN16CBtDevRepository4NewLEv @ 18 NONAME
+	_ZN16CBtDevRepositoryD0Ev @ 19 NONAME
+	_ZN16CBtDevRepositoryD1Ev @ 20 NONAME
+	_ZN16CBtDevRepositoryD2Ev @ 21 NONAME
+	_ZN21CAdvanceDevDiscoverer11SetObserverER21MDevDiscoveryObserver @ 22 NONAME
+	_ZN21CAdvanceDevDiscoverer15CancelDiscoveryEv @ 23 NONAME
+	_ZN21CAdvanceDevDiscoverer15DiscoverDeviceLENS_19TDevDiscoveryFilterE19TBTMajorDeviceClass @ 24 NONAME
+	_ZN21CAdvanceDevDiscoverer4NewLER16CBtDevRepositoryR21MDevDiscoveryObserver @ 25 NONAME
+	_ZN21CAdvanceDevDiscovererD0Ev @ 26 NONAME
+	_ZN21CAdvanceDevDiscovererD1Ev @ 27 NONAME
+	_ZN21CAdvanceDevDiscovererD2Ev @ 28 NONAME
+	_ZNK15CBtDevExtension17IsUserAwareBondedEv @ 29 NONAME
+	_ZNK15CBtDevExtension4AddrEv @ 30 NONAME
+	_ZNK15CBtDevExtension5AliasEv @ 31 NONAME
+	_ZNK15CBtDevExtension6DeviceEv @ 32 NONAME
+	_ZNK16CBtDevRepository10AllDevicesEv @ 33 NONAME
+	_ZNK16CBtDevRepository13IsInitializedEv @ 34 NONAME
+	_ZNK16CBtDevRepository6DeviceERK10TBTDevAddr @ 35 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/export/advancedevdiscoverer.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declares Bluetooth device inquiry helper class.
+*
+*/
+
+#ifndef ADVANCEBTDEVDISCOVERER_H
+#define ADVANCEBTDEVDISCOVERER_H
+
+#include <btdevice.h>
+#include <bt_sock.h>
+#include <btservices/devdiscoveryobserver.h>
+#include <btservices/btdevrepository.h>
+
+class CAdvanceDevDiscovererImpl;
+
+/**
+ * APIs from this class offer functionalities that are common in mw and app 
+ * components of Bluetooth packages. They do not serve as domain APIs.
+ * 
+ * Using these from external components is risky, due to possible source
+ * and binary breaks in future.
+ * 
+ */
+
+/**
+* The interface of discovering in-range Bluetooth devices via Host Resolver.
+* This class offers some options to search certain devices by CoD and other 
+* filters e.g., bonded and blocked.
+* 
+* It requires the client to supply a CBtDevRepository instance for filtering
+* devices.
+*/
+NONSHARABLE_CLASS( CAdvanceDevDiscoverer ) : public CBase
+    {
+
+public: // Constructor and destructor
+
+    /**
+     * Options for clients to specify criteria on discovered devices.
+     */
+    enum TDevDiscoveryFilter
+        {
+        // do not filter in-range devices
+        ENoFilter = 0,
+
+        // Excludes an in-range device if its device name is not available
+        ExcludeIfNoDevName = 0x01,
+        
+        // Excludes an in-range device if it is user-aware bonded with phone.
+        ExcludeUserAwareBonded = 0x02,
+        
+        // Excludes an in-range device if it is banned by phone.
+        ExcludeBanned = 0x04,
+        };
+
+    IMPORT_C static CAdvanceDevDiscoverer* NewL(
+            CBtDevRepository& aDevRep,
+            MDevDiscoveryObserver& aObserver );
+    
+    /**
+    * Destructor.
+    */
+    IMPORT_C virtual ~CAdvanceDevDiscoverer();
+
+    /**
+     * sets the discovery result receiver.
+     * 
+     * @param aObserver the new observer to receive inquiry results
+     */
+    IMPORT_C void SetObserver( MDevDiscoveryObserver& aObserver );
+    
+    /**
+    * Discover currently in-range devices that matches the given major 
+    * device class type.
+     
+    * Found devices will be informed by 
+    * MBtDevDiscoveryObserver::HandleNextDiscoveryResult().
+    * 
+    * When no more device can be found, 
+    * MBtDevDiscoveryObserver::HandleDiscoveryCompleted() will be issued.
+    * 
+    * @param aFilter the filter that shall be applied when a device 
+    *        is discovered. If this is specified, only a device passing 
+    *        the filter will be informed to client. 
+    *        By default, no filter is applied.
+    * 
+    * @param aDeviceClass the major device class which a found device 
+    *        must match. 
+    *        By default, it includes any device types.
+    */
+    IMPORT_C void DiscoverDeviceL( 
+            TDevDiscoveryFilter aFilter = CAdvanceDevDiscoverer::ENoFilter, 
+            TBTMajorDeviceClass aDeviceClass = EMajorDeviceMisc );
+
+    /**
+    * Cancels any outstanding discovery request.
+    */
+    IMPORT_C void CancelDiscovery();
+    
+private:
+
+    /**
+    * C++ default constructor.
+    */
+    CAdvanceDevDiscoverer();
+
+    /**
+    * The 2nd phase constructor
+    */
+    void ConstructL( CBtDevRepository& aDevRep, MDevDiscoveryObserver& aObserver );
+
+private:  // Data
+
+    CAdvanceDevDiscovererImpl* iImpl;
+};
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/export/btdevextension.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,225 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  an extended BT device offering properties of
+* a Bluetooth device that may be needed by Bluetooth UIs
+*
+*/
+
+#ifndef BTDEVEXTENSION_H
+#define BTDEVEXTENSION_H
+
+#include <btdevice.h>
+#include <btmanclient.h>
+#include <bt_sock.h>
+#include <btengconstants.h>
+
+/**
+ * APIs from this class offer functionalities that are common in mw and app 
+ * components of Bluetooth packages. They do not serve as domain APIs.
+ * 
+ * Using these from external components is risky, due to possible source
+ * and binary breaks in future.
+ * 
+ */
+
+/**
+ * The option for specify the default name for a BT device in 
+ * case the device has neither a device name nor a friendly name.
+ */
+enum TDefaultDevNameOption
+    {
+    ENoDefaultName,
+    EColonSeperatedBDAddr, // device name will be formated
+    EPlainBDAddr,
+    };
+
+/**
+ *  Class CBtDevExtension
+ *
+ *  This class provides the access to the properties of devices from BT registry.
+ *  In addition, it provides other dynamic properties such as the connection 
+ *  and proximity statuses. Note that client should not store the dynamic 
+ *  properties for future use since they may change frequently.
+ *
+ */
+NONSHARABLE_CLASS( CBtDevExtension ) : public CBase
+    {
+
+public:
+    // placeholder for providing more properties of a device
+    enum TBtDevStatus
+        {
+        EUndefinedStatus,
+        EInRangUnknown = 0x01,
+        EInRange = 0x02,
+        EPermanentInRegistry = 0x04,
+        };
+    
+    /**
+     * Two-phase constructor
+     * @param aDev a CBTDevice instance. The ownership is transferred.
+     * @param aNameOption the option for formating the default device
+     *  name when the given aDev instance has no valid name.
+     */
+    IMPORT_C static CBtDevExtension* NewLC( CBTDevice* aDev, 
+            TDefaultDevNameOption aNameOption = EColonSeperatedBDAddr );    
+
+    /**
+     * Two-phase constructor
+     * @param aDev a CBTDevice instance. The ownership is transferred.
+     * @param aNameOption the option for formating the default device
+     *  name when the given aDev instance has no valid name.
+     */
+    IMPORT_C static CBtDevExtension* NewLC( 
+            const TInquirySockAddr& aAddr, 
+            const TDesC& aName = KNullDesC,
+            TDefaultDevNameOption aNameOption = EColonSeperatedBDAddr );        
+    
+    /**
+     * Destructor
+     */
+    IMPORT_C virtual ~CBtDevExtension();
+    
+    /**
+     * Tells if the given device is bonded regardless of whether the pairing was 
+     * performed under user awareness.
+     * 
+     * @return ETrue if it is bonded.
+    */
+    IMPORT_C static TBool IsBonded( const TBTNamelessDevice &dev );
+    
+    /**
+     * Tells if the given device is bonded with the Just Works pairing model.
+     * 
+     * @return ETrue if it is bonded and the pairing was performed with Just Works.
+     */
+    IMPORT_C static TBool IsJustWorksBonded( const TBTNamelessDevice &dev );
+    
+    /**
+     *   Tells if the given device has been bonded under user awareness.
+     *   User awareness refers that the user interacted or was informed during or 
+     *   immediately after the pairing completed.
+     *   
+     *   @return ETrue if the user is aware of the bonding.
+     */
+    IMPORT_C static TBool IsUserAwareBonded( const TBTNamelessDevice &dev );
+    
+    /**
+     * Returns the display name of this device for end users. 
+     * @return the friendly name of the device if it is available; else, the device
+     * name if it is available; otherwise, the BDADDR seperated with ":".
+     */
+    IMPORT_C const TDesC& Alias() const;
+    
+    /**
+     * Gets the device address.
+     * @return the device.
+     */
+    IMPORT_C const TBTDevAddr& Addr() const;    
+    
+    /**
+     * Gets the CBTDevice instance.
+     * @return the device.
+     */
+    IMPORT_C const CBTDevice& Device() const;
+    
+    /**
+     * Checks if this device was bonded under user awareness.
+     * @return ETrue if it is user-aware bonded.
+     */
+    IMPORT_C TBool IsUserAwareBonded() const;
+    
+    /**
+     * 
+     * Returns the service (limited to services managed in bteng scope)
+     * level connection status of the specified device.
+     *
+     * @param aAddr the address of the device
+     * @return one of TBTEngConnectionStatus enums
+     */
+    IMPORT_C TBTEngConnectionStatus ServiceConnectionStatus() const;
+    
+    /**
+     * Sets a device. The ownership is transferred.
+     * 
+     * @param aDev the device to be set.
+     */
+    IMPORT_C void SetDeviceL( CBTDevice* aDev );
+
+    /**
+     * Make a copy of this evice.
+     * 
+     * @return a new device instance.
+     */
+    IMPORT_C CBtDevExtension* CopyL();
+    
+public:
+    
+    /**
+     * Internally invoked in this module, not a DLL level API.
+     *
+     * Sets the service connection status of this device.
+     */
+    void SetServiceConnectionStatus( TBTEngConnectionStatus aStatus ); 
+    
+private:
+    
+    /**
+     * C++ default constructor
+     */
+    CBtDevExtension( TDefaultDevNameOption aNameOption );
+    
+    /**
+     * Symbian 2nd-phase constructor
+     */
+    void ConstructL( CBTDevice* aDev );
+    
+    /**
+     * Update device properties due to setDeviceL or other events.
+     */
+    void UpdateNameL();
+    
+    /**
+     * Update the service connection status for this device:
+     */
+    //void UpdateServiceStatusL();
+    
+    /**
+     * formats the BD_Addr as the device name. 
+     */
+    void FormatAddressAsNameL();
+    
+private:
+    
+    RBuf iAlias; // contains: 
+                 // friendly name, if it is not empty; else
+                 // device name, if it is not empty; else
+                 // the assignment depending on the option chosen by client.
+    
+    // The Device instance ( in most case it is given by registry)
+    CBTDevice* iDev;
+    
+    // The bits of dynamic status
+    TInt iDynamicStatus;
+    
+    // Indicates the service connection status of this device
+    TBTEngConnectionStatus iServiceStatus;
+    
+    // The option chosen by the client to deal with default BT name assignment.
+    TDefaultDevNameOption iNameOption;
+    };
+
+typedef RPointerArray<CBtDevExtension> RDevExtensionArray;
+
+#endif /*BTDEVEXTENSION_H*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/export/btdevrepository.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,156 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  The repository of remote devices from BT registry
+*
+*/
+
+#ifndef BTDEVICEREPOSITORY_H
+#define BTDEVICEREPOSITORY_H
+
+#include <btdevice.h>
+#include <btmanclient.h>
+#include <btservices/btdevextension.h>
+
+class CBtDevRepositoryImpl;
+
+/**
+ * APIs from this class offer functionalities that are common in mw and app 
+ * components of Bluetooth packages. They do not serve as domain APIs.
+ * 
+ * Using these from external components is risky, due to possible source
+ * and binary breaks in future.
+ * 
+ */
+
+/**
+ *  Class MBtDevRepositoryObserver
+ *
+ *  Callback class to notify changes in BT registry.
+ */
+class MBtDevRepositoryObserver
+    {
+public:
+
+    /**
+     * Callback to notify that the repository has finished initialization.
+     * Initialization completion means the repository has retieved all
+     * Bluetooth devices from BT registry, and it is subscribing to
+     * registry update events.
+     * 
+     */
+    virtual void RepositoryInitialiazed() = 0;    
+    
+    /**
+     * Callback to notify that a device has been deleted from BT registry.
+     * 
+     *
+     * @param aAddr the bd_addr of the deleted device
+     */
+    virtual void BtDeviceDeleted( const TBTDevAddr& aAddr ) = 0;
+    
+    /**
+     * Callback to notify that the device has been added to BT registry.
+     *
+     * @param aDevice the device that has been added to registry
+     */
+    virtual void BtDeviceAdded( const CBtDevExtension& aDevice ) = 0;
+    
+    /**
+     * Callback to notify that the property of a device in BT registry has been
+     * changed.
+     *
+     * @param aDevice the device that possesses the latest properties.
+     * @param aSimilarity the similarity of the properties comparing to the ones
+     *        prior to this change.
+     *        Refer CBTDevice::TBTDeviceNameSelector and 
+     *        TBTNamelessDevice::TBTDeviceSet for the meanings of the bits 
+     *        in this parameter.
+     */
+    virtual void BtDeviceChangedInRegistry( 
+            const CBtDevExtension& aDevice, TUint aSimilarity ) = 0;    
+    };
+
+/**
+ *  Class CBtDevRepository
+ *
+ *  This class provides the full access to remote devices in BT registry, 
+ *  and informs client when the properties of remote devices are changed.
+ *
+ */
+NONSHARABLE_CLASS( CBtDevRepository ) : public CBase
+    {
+public:
+
+    /**
+     * Two-phase constructor
+     */
+    IMPORT_C static CBtDevRepository* NewL();
+
+    /**
+     * Destructor
+     */
+    IMPORT_C virtual ~CBtDevRepository();
+
+    /**
+     * Add an observer to this reposity for receivng repository update
+     * events.
+     * @param aObserver the observer to be added.
+     */
+    IMPORT_C void AddObserverL( MBtDevRepositoryObserver* aObserver );
+
+    /**
+     * Remove an observer from this repository.
+     * @param aObserver the observer to be removed.
+     */
+    IMPORT_C void RemoveObserver( MBtDevRepositoryObserver* aObserver );
+    
+    /**
+     * Tells if this repository has finished the initialization.
+     * Initialization completion means the repository has retieved all
+     * Bluetooth devices from BT registry, and it is subscribing to
+     * registry update events.
+     */
+    IMPORT_C TBool IsInitialized() const;
+    
+    /**
+     * Get all devices in this repository.
+     * @return the device list
+     */
+    IMPORT_C const RDevExtensionArray& AllDevices() const;
+
+    /**
+     * Get a specific device by the given address.
+     * @param aAddr the address of the device to be retrieved
+     * @return the device pointer, NULL if the device is unavailable.
+     */
+    IMPORT_C const CBtDevExtension* Device( const TBTDevAddr& aAddr ) const;
+
+private:
+    
+    /**
+     * C++ default constructor
+     */
+    CBtDevRepository();
+    
+    /**
+     * Symbian 2nd-phase constructor
+     */
+    void ConstructL();
+    
+private:
+    
+    CBtDevRepositoryImpl* iImpl; 
+    };
+
+#endif /*BTDEVICEREPOSITORY_H*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/export/btsimpleactive.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,194 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Active object helper class.
+*
+*/
+
+#ifndef BTSIMPLEACTIVE_H
+#define BTSIMPLEACTIVE_H
+
+#include <e32base.h>
+
+class CBtSimpleActive;
+
+/**
+ * APIs from this class offer functionalities that are common in mw and app 
+ * components of Bluetooth packages. They do not serve as domain APIs.
+ * 
+ * Using these from external components is risky, due to possible source
+ * and binary breaks in future.
+ * 
+ */
+
+
+/**
+ *  Class MBtSimpleActiveObserver
+ *
+ *  Callback class for receiving a completed active object event.
+ *  Users of CBtSimpleActive need to derive from this class. 
+ *
+ *  @lib bteng*.lib
+ *  @since S60 v3.2
+ */
+class MBtSimpleActiveObserver
+    {
+public:
+
+    /**
+     * Callback from RunL() to notify that an outstanding request has completed.
+     *
+     * @since Symbian^4
+     * @param aActive Pointer to the active object that completed.
+     * @param aStatus The status of the completed request.
+     */
+    virtual void RequestCompletedL( CBtSimpleActive* aActive, TInt aStatus ) = 0;
+
+    /**
+     * Callback from Docancel() for handling cancelation of an outstanding request.
+     *
+     * @since Symbian^4
+     * @param aId The ID that identifies the outstanding request.
+     */
+    virtual void CancelRequest( TInt aRequestId ) = 0;
+
+    /**
+     * Callback from RunError() to notify that an error has occurred in RunL.
+     *
+     * @since Symbian^4
+     * @param aActive Pointer to the active object that completed.
+     * @param aError The error occurred in RunL.
+     */
+    virtual void HandleError( CBtSimpleActive* aActive, TInt aError ) = 0;
+    };
+
+/**
+ *  Class CBtSimpleActive.
+ *  
+ *  This Active Object provides its client a TRequestStatus for performing 
+ *  asynchronous requests. It does not know the detail of the asynch operation.
+ *  All of AO callbacks, such as RunL, will be delegated to the client
+ *  for processing, via interface MBtSimpleActiveObserver.
+ *  
+ */
+NONSHARABLE_CLASS ( CBtSimpleActive ): public CActive
+    {
+
+public:
+
+    /**
+     * Two-phase constructor
+     *
+     * @since Symbian^4
+     * @param aObserver Pointer to callback interface that receives notification
+     *                  that the request has been completed.
+     * @param aId Identifier for the CBtSimpleActive instance.
+     * @param aPriority The priority of the active object.
+     * @return Pointer to the constructed CBtSimpleActive object.
+     */
+    IMPORT_C static CBtSimpleActive* NewL( MBtSimpleActiveObserver& aObserver, TInt aId,
+                                TInt aPriority = CActive::EPriorityStandard );
+
+    /**
+     * Destructor
+     */
+    IMPORT_C virtual ~CBtSimpleActive();
+
+    /**
+     * Get the request ID of this active object.
+     *
+     * @since Symbian^4
+     * @return The request ID of this active object.
+     */
+    IMPORT_C TInt RequestId();
+
+    /**
+     * Set a new request ID for this active object.
+     *
+     * @since Symbian^4
+     * @param The new request ID of this active object.
+     */
+    IMPORT_C void SetRequestId( TInt aId );
+
+    /**
+     * Activate the active object.
+     *
+     * @since Symbian^4
+     */
+    IMPORT_C void GoActive();
+
+    /**
+     * Get a reference to the active object request status.
+     *
+     * @since Symbian^4
+     * @return Reference to the active object request status.
+     */
+    IMPORT_C TRequestStatus& RequestStatus();
+
+private:
+// from base class CActive
+
+    /**
+     * From CActive.
+     * Called by the active scheduler when the request has been cancelled.
+     *
+     * @since S60 v3.2
+     */
+    void DoCancel();
+
+    /**
+     * From CActive.
+     * Called by the active scheduler when the request has been completed.
+     *
+     * @since S60 v3.2
+     */
+    void RunL();
+
+    /**
+     * From CActive.
+     * Called by the active scheduler when an error in RunL has occurred.
+     *
+     * @since S60 v3.2
+     */
+    TInt RunError( TInt aError );
+
+private:
+
+    /**
+     * C++ default constructor
+     *
+     * @since S60 v3.2
+     * @param aObserver Pointer to callback interface that receives notification
+     *                  that the request has been completed.
+     * @param aId ID of the request (for the client to keep track of multiple 
+     *            active objects).
+     * @param aPriority Priority of 
+     */
+    CBtSimpleActive( MBtSimpleActiveObserver& aObserver, TInt aId, TInt aPriority );
+
+private: // data
+
+    /**
+     * ID of the request (used only by our client).
+     */
+    TInt iRequestId;
+
+    /**
+     * Our observer.
+     * Not own.
+     */
+    MBtSimpleActiveObserver& iObserver;
+
+    };
+
+#endif // BTSIMPLEACTIVE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/export/devdiscoveryobserver.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef DEVDISCOVEREYOBSERVER_H
+#define DEVDISCOVEREYOBSERVER_H
+
+#include <btdevice.h>
+#include <bt_sock.h>
+
+/**
+ *  Class MDevDiscoveryObserver
+ *
+ *  Callback class to notify the completion of device discovery. 
+ */
+class MDevDiscoveryObserver
+    {
+public:
+    
+    /**
+     * Callback to notify that a device has been found.
+     *
+     * @param aAddr the inquiry address that contains the inquiry information
+     *  of the found device.
+     * @param aName the Bluetooth device name of the found device
+     */
+    virtual void HandleNextDiscoveryResultL( 
+            const TInquirySockAddr& aAddr, const TDesC& aName ) = 0;
+    
+    /**
+     * Callback to notify that the device search has completed.
+     *
+     * @param aErr the error code of device search result.
+     */
+    virtual void HandleDiscoveryCompleted( TInt aErr ) = 0;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/group/bld.inf	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,41 @@
+/*
+* ============================================================================
+*  Name        : bld.inf
+*  Part of     : bluetoothengine / bluetoothengine
+*  Description : Build information file for bluetoothengine subsystem
+*
+*  Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.1.1
+*/
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../export/btsimpleactive.h       MW_LAYER_PLATFORM_EXPORT_PATH(btservices/btsimpleactive.h)
+../export/btdevextension.h       MW_LAYER_PLATFORM_EXPORT_PATH(btservices/btdevextension.h)
+../export/advancedevdiscoverer.h MW_LAYER_PLATFORM_EXPORT_PATH(btservices/advancedevdiscoverer.h)
+../export/devdiscoveryobserver.h MW_LAYER_PLATFORM_EXPORT_PATH(btservices/devdiscoveryobserver.h)
+../export/btdevrepository.h      MW_LAYER_PLATFORM_EXPORT_PATH(btservices/btdevrepository.h)
+../rom/btserviceutil.iby         CORE_MW_LAYER_IBY_EXPORT_PATH(btserviceutil.iby)
+
+PRJ_MMPFILES
+btserviceutil.mmp
+
+PRJ_TESTMMPFILES
+../tsrc/btserviceutiltest/group/btserviceutiltest.mmp
+
+PRJ_TESTEXPORTS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/group/btserviceutil.mmp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project definition file for project btservice utility
+*
+*/
+
+
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+TARGET                  btserviceutil.dll
+TARGETTYPE              dll
+UID                     0x1000008d 0x2002E6E0
+
+CAPABILITY              CAP_GENERAL_DLL
+VENDORID                VID_DEFAULT
+
+SOURCEPATH              ../src
+
+SOURCE                  btsimpleactive.cpp
+SOURCE                  btdevextension.cpp 
+SOURCE                  btdevrepository.cpp 
+SOURCE                  btdevrepositoryimpl.cpp 
+
+SOURCE                  basicdevdiscoverer.cpp
+SOURCE                  advancebtdevdiscoverer.cpp
+SOURCE                  advancedevdiscovererimpl.cpp
+
+USERINCLUDE             ../inc
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY                 euser.lib
+LIBRARY                 btdevice.lib
+LIBRARY                 btmanclient.lib
+LIBRARY                 bluetooth.lib
+LIBRARY                 esock.lib
+LIBRARY                 btengconnman.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/inc/advancedevdiscovererimpl.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,176 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declares Bluetooth device inquiry helper class.
+*
+*/
+
+#ifndef ADVANCEDEVDISCOVERERIMPL_H
+#define ADVANCEDEVDISCOVERERIMPL_H
+
+#include <btservices/devdiscoveryobserver.h>
+
+#include <btservices/btsimpleactive.h>
+#include <btservices/advancedevdiscoverer.h>
+
+class CBasicDevDiscoverer;
+class CBtDevRepository;
+class CBtDevExtension;
+
+/**
+* A helper class for searching nearby Bluetooth devices.
+*/
+NONSHARABLE_CLASS(CAdvanceDevDiscovererImpl) : public CBase, 
+        public MDevDiscoveryObserver,
+        public MBtSimpleActiveObserver
+    {
+public:
+    /**
+     * instantiator
+     */
+    static CAdvanceDevDiscovererImpl* NewL( 
+            CBtDevRepository& aDevRep,
+            MDevDiscoveryObserver& aObserver );
+    
+    /**
+    * Destructor.
+    */
+    virtual ~CAdvanceDevDiscovererImpl();
+    
+    /**
+     * sets the inquiry result observer.
+     * 
+     * @param aObserver the new observer to receive inquiry results
+     */
+    void SetObserver( MDevDiscoveryObserver& aObserver );
+    
+    /**
+    * Cancels all inquiry activity.
+    */
+    void Cancel();
+    
+    /**
+    * Discover currently in-range devices that matches the given major device class type.
+    * Found devices will be informed by 
+    * MBtAdvanceDevDiscoveryObserver::HandleNextDiscoveryResult().
+    * 
+    * When no more device can be found, 
+    * MBtAdvanceDevDiscoveryObserver::HandleDiscoveryCompleted() will be issued.
+    * 
+    * @param aFilter the filter that shall be applied when a device 
+    *        is discovered. If this is specified, only a device passing 
+    *        the filter will be informed to client. 
+    * 
+    * @param aDeviceClass the major device class which a found device 
+    *        must match. 
+    */
+    void DiscoverDeviceL(
+            CAdvanceDevDiscoverer::TDevDiscoveryFilter aFilter, 
+            TBTMajorDeviceClass aDeviceClass );
+    
+    /**
+    * Discover currently in-range devices that match the given major device class.
+    * The devices in the given priority list have higher priority to 
+    * be discovered, i.e., inquiry on these devices will take place first.
+    * 
+    * Found devices will be informed by 
+    * MDevDiscoveryObserver::HandleNextDiscoveryResult().
+    * 
+    * When no more device can be found, 
+    * MDevDiscoveryObserver::HandleDiscoveryCompleted() will be issued.
+    * 
+    * @param aPriorityList contains the devices to be discovered first
+    */
+    void DiscoverDeviceL(
+            const RBTDevAddrArray& aPriorityList );
+    
+private: 
+    
+    // from MDevDiscoveryObserver
+    
+    /**
+     * Callback to notify that a device has been found.
+     *
+     * @param aAddr the inquiry address that contains the inquiry information
+     *  of the found device.
+     * @param aName the Bluetooth device name of the found device
+     */
+    void HandleNextDiscoveryResultL( 
+            const TInquirySockAddr& aAddr, const TDesC& aName );
+    
+    /**
+     * Callback to notify that the device search has completed.
+     *
+     * @param aErr the error code of device search result.
+     */
+    void HandleDiscoveryCompleted( TInt aErr );
+
+    // from MBtSimpleActiveObserver
+       
+    /**
+    * Callback to notify that an outstanding request has completed.
+    *
+    * @param aActive Pointer to the active object that completed.
+    * @param aStatus The status of the completed request.
+    */
+    void RequestCompletedL( CBtSimpleActive* aActive, TInt aStatus );
+    
+    /**
+    * Callback for handling cancelation of an outstanding request.
+    *
+    * @param aId The ID that identifies the outstanding request.
+    */
+    void CancelRequest( TInt aId );
+    
+    /**
+    * Callback to notify that an error has occurred in RunL.
+    *
+    * @param aActive Pointer to the active object that completed.
+    * @param aError The error occurred in RunL.
+    */
+    void HandleError( CBtSimpleActive* aActive, TInt aError );
+    
+private:
+    
+    /**
+    * C++ default constructor.
+    */
+    CAdvanceDevDiscovererImpl( 
+            CBtDevRepository& aDevRep,
+            MDevDiscoveryObserver& aObserver );
+    
+    /**
+    * The 2nd phase constructor
+    */
+    void ConstructL();
+
+private:  // Data
+    
+    // for retrieving device properties
+    // Not own
+    CBtDevRepository& iDevRep;
+    
+    // our client
+    // Not own
+    MDevDiscoveryObserver& iObserver;
+    
+    // The class doing actual inquirying
+    CBasicDevDiscoverer* iBasicDiscoverer;
+    
+    // filters from CAdvanceDevDiscoverer::TDevDiscoveryFilter
+    TInt iFilter;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/inc/basicdevdiscoverer.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,160 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declares Bluetooth device inquiry helper class.
+*
+*/
+
+#ifndef BASICDEVDISCOVERER_H
+#define BASICDEVDISCOVERER_H
+
+#include <btdevice.h>
+#include <bt_sock.h>
+#include <btservices/btsimpleactive.h>
+
+class MDevDiscoveryObserver;
+
+class CDeviceSearchRecord : public CBase
+    {
+public:
+    TInquirySockAddr iAddr;
+    TBTDeviceName iName;
+    };
+
+/**
+* A basic implementation for searching nearby Bluetooth devices.
+*/
+NONSHARABLE_CLASS(CBasicDevDiscoverer) : public CBase, public MBtSimpleActiveObserver
+    {
+public:
+
+    /**
+     * factory method
+     */
+    static CBasicDevDiscoverer* NewL( MDevDiscoveryObserver& aObserver );
+    
+    /**
+    * Destructor.
+    */
+    virtual ~CBasicDevDiscoverer();
+    
+    /**
+     * sets the inquiry result observer.
+     * 
+     * @param aObserver the new observer to receive inquiry results
+     */
+    void SetObserver( MDevDiscoveryObserver& aObserver );
+    
+    /**
+    * Cancels all inquiry activity.
+    */
+    void Cancel();
+    
+    /**
+    * Discover currently in-range devices that matches the given major device class type.
+    * Found devices will be informed by 
+    * MDevDiscoveryObserver::HandleNextDiscoveryResult().
+    * 
+    * When no device can be found any more, 
+    * MDevDiscoveryObserver::HandleDiscoveryCompleted() will be issued.
+    * 
+    * @param aDeviceClass the major device class device must match.
+    */
+    void DiscoverDeviceL( TBTMajorDeviceClass aDeviceClass  = EMajorDeviceMisc );
+    
+private: // from MBtSimpleActiveObserver
+    
+    /**
+     * Callback to notify that an outstanding request has completed.
+     *
+     * @param aActive Pointer to the active object that completed.
+     * @param aStatus The status of the completed request.
+     */
+    void RequestCompletedL( CBtSimpleActive* aActive, TInt aStatus );
+    
+    /**
+     * Callback for handling cancelation of an outstanding request.
+     *
+     * @param aId The ID that identifies the outstanding request.
+     */
+    void CancelRequest( TInt aId );
+    
+    /**
+     * Callback to notify that an error has occurred in RunL.
+     *
+     * @param aActive Pointer to the active object that completed.
+     * @param aError The error occurred in RunL.
+     */
+    void HandleError( CBtSimpleActive* aActive, TInt aError );
+    
+private:
+    
+    /**
+    * C++ default constructor.
+    */
+    CBasicDevDiscoverer( MDevDiscoveryObserver& aObserver );
+    
+    /**
+    * The 2nd phase constructor
+    */
+    void ConstructL();
+
+    /*
+     * retrieves the device name of the device pointed by 
+     * iPagingNamePos to local array.
+     */
+    void PageNextDeviceName();
+    
+    /**
+     * Performs the result from an inquiry operation.
+     */
+    TInt HandleInquiryResultL();
+    
+    /**
+     * Create a heap object of CDeviceSearchRecord.
+     */
+    CDeviceSearchRecord* NewInstanceL( 
+        const TInquirySockAddr& aAddr, const TDesC& aName = KNullDesC );
+
+    /**
+     * resets the state and memory caused by a client request.
+     */
+    void Reset();
+    
+private:  // Data
+
+    // Not own
+    MDevDiscoveryObserver& iObserver; 
+    
+    // The major device class filter from the client.
+    TBTMajorDeviceClass iMajorDeviceClassFilter;
+    
+    // For inquiry and paging names:
+    CBtSimpleActive* iActive;
+
+    RSocketServ iSocketServer;
+    RHostResolver iHostResolver;
+    TInquirySockAddr iInquirySockAddr;
+    TNameEntry iEntry; // Inquiry result record
+    
+    // Devices found so far
+    RPointerArray<CDeviceSearchRecord> iDevices;
+    
+    // position in array iDevices: the item the current name paging operation is for
+    TInt iPagingNamePos;
+
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/inc/btdevrepositoryimpl.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,263 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  The repository of remote devices from BT registry
+*
+*/
+
+#ifndef BTDEVICEREPOSITORYIMPL_H
+#define BTDEVICEREPOSITORYIMPL_H
+
+#include <bttypes.h>
+#include <bt_sock.h>
+#include <btmanclient.h>
+#include <e32property.h>
+#include <btengconnman.h>
+#include <btservices/btsimpleactive.h>
+#include <btservices/btdevextension.h>
+
+class MBtDevRepositoryObserver;
+
+/**
+ *  Class CBtDevRepositoryImpl
+ *
+ *  This class keep a storage of remote device information.
+ *
+ */
+NONSHARABLE_CLASS( CBtDevRepositoryImpl ) : 
+    public CBase, 
+    public MBtSimpleActiveObserver,
+    public MBTEngConnObserver
+    {
+public:
+
+    /**
+     * Two-phase constructor
+     */
+    static CBtDevRepositoryImpl* NewL();
+
+    /**
+     * Destructor
+     */
+    ~CBtDevRepositoryImpl();
+
+    /**
+     * Add an observer to this reposity for receivng repository update
+     * events.
+     * @param aObserver the observer to be added.
+     */
+    void AddObserverL( MBtDevRepositoryObserver* aObserver );
+
+    /**
+     * Remove an observer from this repository.
+     * @param aObserver the observer to be removed.
+     */
+    void RemoveObserver( MBtDevRepositoryObserver* aObserver );
+    
+    /**
+     * Tells if this repository has finished the initialization.
+     * Initialization completion means the repository has retieved all
+     * Bluetooth devices from BT registry, and it is subscribing to
+     * registry update events.
+     */
+    TBool IsInitialized() const;
+    
+    /**
+     * Gets all devices in this repository.
+     * @return the device list.
+     */
+    const RDevExtensionArray& AllDevices() const;
+    
+    /**
+     * Get a specific device by the given address.
+     * @param aAddr the address of the device to be retrieved
+     * @return the device pointer, NULL if the device is unavailable.
+     */
+    const CBtDevExtension* Device( const TBTDevAddr& aAddr ) const;
+    
+    /**
+     * Returns the service (limited to services managed in bteng scope)
+     * level connection status of the specified device.
+     *
+     * @param aAddr the address of the device
+     * @return one of TBTEngConnectionStatus enums
+     */
+    //TBTEngConnectionStatus IsDeviceConnected( const TBTDevAddr& aAddr );
+    
+private:
+    
+    // from MBtSimpleActiveObserver
+    
+    /**
+     * Callback from RunL() to notify that an outstanding request has completed.
+     *
+     * @since Symbian^4
+     * @param aActive Pointer to the active object that completed.
+     * @param aStatus The status of the completed request.
+     */
+    void RequestCompletedL( CBtSimpleActive* aActive, TInt aStatus );
+
+    /**
+     * Callback from Docancel() for handling cancelation of an outstanding request.
+     *
+     * @since Symbian^4
+     * @param aId The ID that identifies the outstanding request.
+     */
+    void CancelRequest( TInt aRequestId );
+
+    /**
+     * Callback from RunError() to notify that an error has occurred in RunL.
+     *
+     * @since Symbian^4
+     * @param aActive Pointer to the active object that completed.
+     * @param aError The error occurred in RunL.
+     */
+    void HandleError( CBtSimpleActive* aActive, TInt aError );
+
+    // From MBTEngConnObserver
+    
+    /**
+     * Indicates to the caller that a service-level connection has completed.
+     * This function is called for both incoming and outgoing connections. 
+     * This function is also called when an outgoing connection request fails, 
+     * e.g. with error code KErrCouldNotConnect.
+     * When this function is called, new commands can be issued to the 
+     * CBTEngConnMan API immediately.
+     * @param  aAddr The address of the remote device.
+     * @param  aErr Status information of the connection. KErrNone if the
+     *              connection succeeded, otherwise the error code with 
+     *              which the outgoing connection failed. KErrAlreadyExists 
+     *              is returned if there already is an existing connection 
+     *              for the selected profile(s), or otherwise e.g. 
+     *              KErrCouldNotConnect or KErrDisconnected for indicating 
+     *              connection problems.
+     * @param  aConflicts If there already is a connection for the selected 
+     *                    profile(s) of an outgoing connection request (the 
+     *                    selection is performed by BTEng), then this array 
+     *                    contains the bluetooth device addresses of the 
+     *                    remote devices for those connections.
+     */
+    void ConnectComplete( TBTDevAddr& aAddr, TInt aErr, 
+                          RBTDevAddrArray* aConflicts = NULL );
+
+    /**
+     * Indicates to the caller that a service-level connection has disconnected.
+     * When this function is called, new commands can be issued to the 
+     * CBTEngConnMan API immediately.
+     * 
+     * @param  aAddr The address of the remote device.
+     * @param  aErr The error code with which the disconnection occured. 
+     *              KErrNone for a normal disconnection, 
+     *              or e.g. KErrDisconnected if the connection was lost.
+     */
+    void DisconnectComplete( TBTDevAddr& aAddr, TInt aErr );
+    
+private:
+    
+    /**
+     * C++ default constructor
+     */
+    CBtDevRepositoryImpl();
+    
+    /**
+     * Symbian 2nd-phase constructor
+     */
+    void ConstructL();
+    
+    /**
+     * Creates a registry view which shall contain all remote devices.
+     */    
+    void CreateRemoteDeviceView();
+    
+    /**
+     * retrieves remote devices from registry.
+     */
+    void GetRemoteDevicesL();
+    
+    /**
+     * handles the completion of paired device view creation
+     */
+    void HandleCreateRemoteDeviceViewCompletedL( TInt aStatus);
+    
+    /**
+     * handles the completion of getting paired devices
+     */
+    void HandleGetRemoteDevicesCompletedL( TInt aStatus );
+    
+    /**
+     * Copy the remote devices to internal array storage.
+     */
+    void UpdateRemoteDeviceRepositoryL();
+    
+private:
+    
+    /**
+     * The observers
+     * do not own them.
+     */
+    RPointerArray<MBtDevRepositoryObserver> iObservers;
+    
+    /**
+     * Registry sub session for remote device db.
+     * not own
+     */
+    RBTRegistry iBTRegistry;
+    
+    // own.
+    RBTRegServ iBTRegServ;
+    
+    /**
+     * AO for registry operations
+     * own.
+     */
+    CBtSimpleActive* iRegistryActive;    
+    
+    /**
+     * the counter of not handled registry events.
+     */
+    TInt iNotHandledRegEventCounter;
+    
+    /**
+     * temporary instance to retrieve paired devices.
+     * own.
+     */
+    CBTRegistryResponse* iRegRespRemoteDevices;
+
+    /**
+     * Property containing the BT registry change monitoring key
+     * own.
+     */
+    RProperty iBtRegistryKey;
+     
+    /**
+     * AO for subscribing registry PubSub key
+     * own.
+     */
+    CBtSimpleActive* iRegistryKeyActive;  
+    
+    /**
+     * For connection status
+     */
+    CBTEngConnMan* iBtengConn;
+    
+    /**
+     * contains the list of all devices.
+     * own.
+     */
+    RDevExtensionArray iDevices;
+
+    TInt iInitialized;
+    
+    };
+
+#endif /*BTDEVICEREPOSITORYIMPL_H*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/inc/btserviceutilconsts.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Internal symbolic constants of this component
+*
+*/
+
+#ifndef BTSERVICEUTILCONSTS_H
+#define BTSERVICEUTILCONSTS_H
+
+#include <e32base.h>
+
+namespace BtServiceUtil {
+
+const TInt KServiceRequestIdBase = 0x100;
+
+enum TRequestIdentifier
+    {
+    // Inquiry with Host Resolver
+    EBluetoothInquiry = KServiceRequestIdBase,
+    // Get the name of a device
+    EBluetoothPageDeviceName,
+    // Schedule the notification of search completion
+    EAsyncNotifyDeviceSearchCompleted,
+    // Create view table of remote devices from BT registry
+    ECreateRemoteDeviceViewRequest,
+    // Retrieves remote devices from BT registry
+    EGetRemoteDevicesRequest,
+    // Subsribes the PubSub key for BT registry update events
+    ERegistryPubSubWatcher
+    };
+}
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/rom/btserviceutil.iby	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Image description file for project btserviceutil
+*
+*/
+
+
+#ifndef BTSERVICEUTIL_IBY
+#define BTSERVICEUTIL_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+#ifdef __BT
+file=ABI_DIR\BUILD_DIR\btserviceutil.dll    SHARED_LIB_DIR\btserviceutil.dll
+
+#endif // __BT
+
+#endif // BTSERVICEUTIL_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/src/advancebtdevdiscoverer.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CAdvanceDevDiscoverer class: the interface class for
+*               searching in-range Bluetooth devices using Host Resolver.
+*
+*/
+
+#include <btservices/advancedevdiscoverer.h>
+#include "advancedevdiscovererimpl.h"
+
+// ----------------------------------------------------------
+// CAdvanceDevDiscoverer::CAdvanceDevDiscoverer
+// ----------------------------------------------------------
+//
+CAdvanceDevDiscoverer::CAdvanceDevDiscoverer()
+    {
+    }
+
+// ----------------------------------------------------------
+// CAdvanceDevDiscoverer::CAdvanceDevDiscoverer
+// ----------------------------------------------------------
+//
+void CAdvanceDevDiscoverer::ConstructL( 
+        CBtDevRepository& aDevRep,
+        MDevDiscoveryObserver& aObserver )
+    {
+    iImpl = CAdvanceDevDiscovererImpl::NewL( aDevRep, aObserver );
+    }
+
+// ----------------------------------------------------------
+// CAdvanceDevDiscoverer::NewL
+// ----------------------------------------------------------
+//
+EXPORT_C CAdvanceDevDiscoverer* CAdvanceDevDiscoverer::NewL(
+        CBtDevRepository& aDevRep,
+        MDevDiscoveryObserver& aObserver )
+    {
+    CAdvanceDevDiscoverer* self = new (ELeave) CAdvanceDevDiscoverer();
+    CleanupStack::PushL( self );
+    self->ConstructL( aDevRep, aObserver );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ----------------------------------------------------------
+// Destructor
+// ----------------------------------------------------------
+//
+EXPORT_C CAdvanceDevDiscoverer::~CAdvanceDevDiscoverer()
+    {
+    delete iImpl;
+    }
+
+// ----------------------------------------------------------
+// CAdvanceDevDiscoverer::SetObserver
+// ----------------------------------------------------------
+//
+EXPORT_C void CAdvanceDevDiscoverer::SetObserver(
+        MDevDiscoveryObserver& aObserver )
+    {
+    iImpl->SetObserver( aObserver );
+    }
+
+// ----------------------------------------------------------
+// CAdvanceDevDiscoverer::DiscoverDeviceL
+// ----------------------------------------------------------
+//
+EXPORT_C void CAdvanceDevDiscoverer::DiscoverDeviceL(
+        TDevDiscoveryFilter aFilter,
+        TBTMajorDeviceClass aDeviceClass )
+    {
+    iImpl->DiscoverDeviceL( aFilter, aDeviceClass );
+    }
+
+// ----------------------------------------------------------
+// CAdvanceDevDiscoverer::CancelDiscovery
+// ----------------------------------------------------------
+//
+EXPORT_C void CAdvanceDevDiscoverer::CancelDiscovery()
+    {
+    iImpl->Cancel();
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/src/advancedevdiscovererimpl.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,180 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  class for searching BT devices
+*
+*/
+#include "advancedevdiscovererimpl.h"
+#include "basicdevdiscoverer.h"
+
+
+// ----------------------------------------------------------
+// CAdvanceDevDiscovererImpl::CAdvanceDevDiscovererImpl
+// ----------------------------------------------------------
+//
+CAdvanceDevDiscovererImpl::CAdvanceDevDiscovererImpl(
+        CBtDevRepository& aDevRep,
+        MDevDiscoveryObserver& aObserver )
+    :iDevRep( aDevRep ), iObserver( aObserver )
+    {
+    }
+
+// ----------------------------------------------------------
+// CAdvanceDevDiscovererImpl::ConstructL
+// ----------------------------------------------------------
+//
+void CAdvanceDevDiscovererImpl::ConstructL()
+    {
+    iBasicDiscoverer = CBasicDevDiscoverer::NewL( *this );   
+    }
+
+// ----------------------------------------------------------
+// CAdvanceDevDiscovererImpl::NewL
+// ----------------------------------------------------------
+//
+CAdvanceDevDiscovererImpl* CAdvanceDevDiscovererImpl::NewL(
+        CBtDevRepository& aDevRep,
+        MDevDiscoveryObserver& aObserver )
+    {
+    CAdvanceDevDiscovererImpl* self = 
+            new (ELeave) CAdvanceDevDiscovererImpl( aDevRep, aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ----------------------------------------------------------
+// CAdvanceDevDiscovererImpl::
+// ----------------------------------------------------------
+//
+CAdvanceDevDiscovererImpl::~CAdvanceDevDiscovererImpl()
+    {
+    delete iBasicDiscoverer;
+    }
+
+// ----------------------------------------------------------
+// CAdvanceDevDiscovererImpl::SetObserver
+// ----------------------------------------------------------
+//
+void CAdvanceDevDiscovererImpl::SetObserver( MDevDiscoveryObserver& aObserver )
+    {
+    iObserver = aObserver;
+    }
+
+// ----------------------------------------------------------
+// CAdvanceDevDiscovererImpl::
+// ----------------------------------------------------------
+//
+void CAdvanceDevDiscovererImpl::Cancel()
+    {
+    iBasicDiscoverer->Cancel();
+    }
+
+// ----------------------------------------------------------
+// CAdvanceDevDiscovererImpl::
+// ----------------------------------------------------------
+//
+void CAdvanceDevDiscovererImpl::DiscoverDeviceL(
+        CAdvanceDevDiscoverer::TDevDiscoveryFilter aFilter, 
+        TBTMajorDeviceClass aDeviceClass )
+    {
+    iBasicDiscoverer->DiscoverDeviceL( aDeviceClass );
+    iFilter = aFilter;
+    }
+
+// ----------------------------------------------------------
+// CAdvanceDevDiscovererImpl::DiscoverDeviceL
+// ----------------------------------------------------------
+//
+void CAdvanceDevDiscovererImpl::DiscoverDeviceL( 
+    const RBTDevAddrArray& aPriorityList )
+    {
+    // to be implemented when BTUI requires this feature.
+    ( void ) aPriorityList;
+    }
+
+// ----------------------------------------------------------
+// CAdvanceDevDiscovererImpl::HandleNextDiscoveryResult
+// ----------------------------------------------------------
+//
+void CAdvanceDevDiscovererImpl::HandleNextDiscoveryResultL( 
+        const TInquirySockAddr& aAddr, const TDesC& aName )
+    {
+    TBool filtered = EFalse;
+    if ( iFilter )
+        {
+        // For filtering, we need to examine the properties of
+        // this device from repository.        
+        const CBtDevExtension* devExt = iDevRep.Device( aAddr.BTAddr() );
+        // No filter is needed if this device is not in registry.
+        if ( devExt )
+            {
+            if ( iFilter & CAdvanceDevDiscoverer::ExcludeUserAwareBonded)
+                {
+                // client does not want to discover devices that have been
+                // bonded already.
+                if ( devExt->IsUserAwareBonded() )
+                    {
+                    filtered = ETrue;
+                    }
+                }
+            }
+        }
+    if ( !filtered )
+        {
+        iObserver.HandleNextDiscoveryResultL( aAddr, aName );
+        }
+    }
+
+// ----------------------------------------------------------
+// CAdvanceDevDiscovererImpl::HandleDiscoveryCompleted
+// ----------------------------------------------------------
+//
+void CAdvanceDevDiscovererImpl::HandleDiscoveryCompleted( TInt aErr )
+    {
+    iObserver.HandleDiscoveryCompleted( aErr );
+    }
+
+// ----------------------------------------------------------
+// CAdvanceDevDiscovererImpl::RequestCompletedL
+// Inform caller for received device and issue next EIR/Name request
+// if the request was successful.
+// ----------------------------------------------------------
+//
+void CAdvanceDevDiscovererImpl::RequestCompletedL( CBtSimpleActive* aActive, TInt aStatus )
+    {
+    (void) aActive;
+    (void) aStatus;
+    }
+
+// ----------------------------------------------------------
+// CAdvanceDevDiscovererImpl::CancelRequest
+// ----------------------------------------------------------
+//
+void CAdvanceDevDiscovererImpl::CancelRequest( TInt aId )
+    {
+    (void) aId;
+    }
+
+// ----------------------------------------------------------
+// CAdvanceDevDiscovererImpl::HandleError
+// ----------------------------------------------------------
+//
+void CAdvanceDevDiscovererImpl::HandleError( CBtSimpleActive* aActive, TInt aError )
+    {
+    (void) aActive;
+    (void) aError;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/src/basicdevdiscoverer.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,318 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  class for searching BT devices
+*
+*/
+#include "basicdevdiscoverer.h"
+#include <btservices/devdiscoveryobserver.h>
+#include "btserviceutilconsts.h"
+
+// ----------------------------------------------------------
+// CBasicDevDiscoverer::CBasicDevDiscoverer
+// ----------------------------------------------------------
+//
+CBasicDevDiscoverer::CBasicDevDiscoverer( MDevDiscoveryObserver& aObserver )
+    : iObserver( aObserver )
+    {
+    }
+
+// ----------------------------------------------------------
+// CBasicDevDiscoverer::ConstructL
+// ----------------------------------------------------------
+//
+void CBasicDevDiscoverer::ConstructL()
+    {
+    User::LeaveIfError( iSocketServer.Connect() );
+    iActive = CBtSimpleActive::NewL( *this, BtServiceUtil::EBluetoothInquiry );
+    }
+
+// ----------------------------------------------------------
+// CBasicDevDiscoverer::NewL
+// ----------------------------------------------------------
+//
+CBasicDevDiscoverer* CBasicDevDiscoverer::NewL( MDevDiscoveryObserver& aObserver )
+    {
+    CBasicDevDiscoverer* self = new (ELeave) 
+            CBasicDevDiscoverer( aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ----------------------------------------------------------
+// CBasicDevDiscoverer::
+// ----------------------------------------------------------
+//
+CBasicDevDiscoverer::~CBasicDevDiscoverer()
+    {
+    delete iActive;
+    Reset();
+    iSocketServer.Close();
+    iDevices.Close();
+    }
+
+// ----------------------------------------------------------
+// CBasicDevDiscoverer::SetObserver
+// ----------------------------------------------------------
+//
+void CBasicDevDiscoverer::SetObserver( MDevDiscoveryObserver& aObserver )
+    {
+    iObserver = aObserver;
+    }
+
+// ----------------------------------------------------------
+// CBasicDevDiscoverer::
+// ----------------------------------------------------------
+//
+void CBasicDevDiscoverer::Cancel()
+    {
+    iActive->Cancel();
+    iHostResolver.Close();
+    iDevices.ResetAndDestroy();
+    }
+
+// ----------------------------------------------------------
+// CBasicDevDiscoverer::
+// ----------------------------------------------------------
+//
+void CBasicDevDiscoverer::DiscoverDeviceL(TBTMajorDeviceClass aDeviceClass )
+    {
+    // This class supports only one request at the time:
+    if ( iActive->IsActive() )
+        {
+        User::Leave( KErrInUse );
+        }
+    Reset();
+    iMajorDeviceClassFilter = aDeviceClass;
+    _LIT( KLinkMgrDes, "BTLinkManager" );
+    // Associate with bluetooth Link Manager.
+    TProtocolName protocol( KLinkMgrDes );
+    TProtocolDesc pInfo;
+    User::LeaveIfError( iSocketServer.FindProtocol( protocol, pInfo));
+    User::LeaveIfError( iHostResolver.Open(iSocketServer, 
+            pInfo.iAddrFamily, pInfo.iProtocol));
+    iActive->SetRequestId( BtServiceUtil::EBluetoothInquiry );
+    iInquirySockAddr.SetAction( KHostResInquiry + KHostResEir + KHostResIgnoreCache );
+    // We always do Generic Inquiry.
+    // Limited Inquiry could be added here in future on business need.
+    iInquirySockAddr.SetIAC(KGIAC);
+    iHostResolver.GetByAddress( iInquirySockAddr, iEntry, iActive->RequestStatus() );
+    iActive->GoActive();
+    }
+
+// ----------------------------------------------------------
+// CBasicDevDiscoverer::RequestCompletedL
+// Inform caller for received device and issue next EIR/Name request
+// if the request was successful.
+// ----------------------------------------------------------
+//
+void CBasicDevDiscoverer::RequestCompletedL( CBtSimpleActive* aActive, TInt aStatus )
+    {
+    TInt errToObserver( aStatus );
+    // position in array iDevices: the device item the observer will be notified of.
+    TInt devToNotify ( KErrNotFound ); 
+    
+    if ( aActive->RequestId() == BtServiceUtil::EBluetoothInquiry )
+        {
+        if ( aStatus == KErrNone )
+            {
+            TInt pos = HandleInquiryResultL();
+            // continue to inquiry for more devices in range
+            iHostResolver.Next( iEntry, iActive->RequestStatus() );
+            iActive->GoActive();
+            if ( pos > KErrNotFound && iDevices[pos]->iName.Length() > 0 )
+                {
+                devToNotify = pos;
+                }
+            }
+        else if( iDevices.Count() > 0 )
+            {
+            // an error from inquiry operation. 
+            // we move to next step to get device names if some devices have been
+            // found but without a name.
+            iPagingNamePos = iDevices.Count() - 1;
+            aActive->SetRequestId( BtServiceUtil::EBluetoothPageDeviceName );
+            PageNextDeviceName();
+            }
+        }
+    else if ( aActive->RequestId() ==  BtServiceUtil::EBluetoothPageDeviceName )
+        {
+        errToObserver = KErrNone;
+        devToNotify = iPagingNamePos;
+        // the name in iEntry was reset before paging operation, so we
+        // can rely on this length() at this time:
+        if ( aStatus == KErrNone && iEntry().iName.Length() > 0 )
+            {
+            iDevices[iPagingNamePos]->iName = iEntry().iName;
+            }
+            // the return error is not checked here. We continue to page the rest
+            // device names.
+            --iPagingNamePos;
+            PageNextDeviceName();
+        }
+    // request ID is BtServiceUtil::EAsyncNotifyDeviceSearchCompleted
+    else 
+        {
+        iObserver.HandleDiscoveryCompleted( errToObserver );
+        return;
+        }
+    
+    // AO not active means that this is neither inquiring nor paging name.
+    // Schedule an operation completion callback:
+    if ( !iActive->IsActive() && 
+            aActive->RequestId() != BtServiceUtil::EAsyncNotifyDeviceSearchCompleted )
+        {
+        // We inform the client of operation completion asynchronously, so that
+        // we will not end up with problems, e.g., invalid memory,
+        // if the client issues more request in the callback context.
+        aActive->SetRequestId( BtServiceUtil::EAsyncNotifyDeviceSearchCompleted );
+        aActive->RequestStatus() = KRequestPending;
+        TRequestStatus* sta = &aActive->RequestStatus();
+        User::RequestComplete( sta, errToObserver );
+        aActive->GoActive();
+        }
+    
+    // This could be possible in both inquiry and paging operations.
+    if ( devToNotify > KErrNotFound )
+        {
+        // This device record is not used any more after we have informed client.
+        // Extract it and push to cleanup for detroy.
+        // This is to prevent peak memory usage in case of a great number of 
+        // devices being in range.
+        CDeviceSearchRecord* rec = iDevices[devToNotify];
+        iDevices.Remove( devToNotify );
+        CleanupStack::PushL( rec );
+        iObserver.HandleNextDiscoveryResultL( rec->iAddr, rec->iName );
+        CleanupStack::PopAndDestroy( rec );
+        }
+    }
+
+// ----------------------------------------------------------
+// CBasicDevDiscoverer::DoCancelRequest
+// ----------------------------------------------------------
+//
+void CBasicDevDiscoverer::CancelRequest( TInt aId )
+    {
+    // host resolver needs to be cancelled.
+    // For request BtServiceUtil::EAsyncNotifyDeviceSearchCompleted, we 
+    // are doing self-completing. Thus, nothing is needed now.
+    if ( aId == BtServiceUtil::EBluetoothInquiry || 
+         aId == BtServiceUtil::EBluetoothPageDeviceName )
+        {
+        iHostResolver.Cancel();
+        }
+    }
+
+// ----------------------------------------------------------
+// CBasicDevDiscoverer::HandleError
+// Inform UI from error occured.
+// ----------------------------------------------------------
+//
+void CBasicDevDiscoverer::HandleError( CBtSimpleActive* aActive, TInt aError )
+    {
+    // We might have issued an request to Host Resolver in RequestCompleted().
+    // Cancel AO just in case:
+    aActive->Cancel();
+    Reset();
+    // We cannot proceed more. Inform client:
+    iObserver.HandleDiscoveryCompleted( aError );
+    }
+
+// ----------------------------------------------------------
+// CBasicDevDiscoverer::
+// ----------------------------------------------------------
+//
+void CBasicDevDiscoverer::PageNextDeviceName()
+    {
+    // reset the name in entry so that previous result will
+    // not propogate if the next paging operation fails.
+    iEntry().iName.Zero();
+    for (; iPagingNamePos > -1; --iPagingNamePos )
+        {
+        // Get the next in-range device that has no device name yet 
+        // This is practically meaning that the device would be
+        // < v2.1
+        if( iDevices[iPagingNamePos]->iName.Length() == 0 )
+            {
+            iInquirySockAddr.SetAction( KHostResName + KHostResIgnoreCache );
+            TBTDevAddr btaddr = iDevices[iPagingNamePos]->iAddr.BTAddr();
+            iInquirySockAddr.SetBTAddr( iDevices[iPagingNamePos]->iAddr.BTAddr() );
+            iInquirySockAddr.SetIAC(KGIAC);
+            iHostResolver.GetByAddress( iInquirySockAddr, iEntry, iActive->RequestStatus() );
+            iActive->GoActive();
+            break;
+            }
+        }
+    }
+
+// ----------------------------------------------------------
+// CBasicDevDiscoverer::HandleInquiryResultL
+// Inform of properties of the found BTdevice,   
+// which passes the search filter. Its name would be retrived 
+// later if not contained by the first round of inquiry.   
+// ----------------------------------------------------------
+//
+TInt CBasicDevDiscoverer::HandleInquiryResultL()
+    {
+    TInquirySockAddr& sa = TInquirySockAddr::Cast( iEntry().iAddr );
+    // parse the inquiry result if this device passes the filters:
+    if ( iMajorDeviceClassFilter == EMajorDeviceMisc 
+         || sa.MajorClassOfDevice() == iMajorDeviceClassFilter )
+        {
+        CDeviceSearchRecord* record = NewInstanceL( sa );
+        CleanupStack::PushL( record );
+        iDevices.InsertL(record, 0 );
+        CleanupStack::Pop( record );
+        
+        TBTDeviceName devName;
+        TBluetoothNameRecordWrapper eir( iEntry() );
+        TInt length = eir.GetDeviceNameLength();
+        TBool isComplete( EFalse );
+        if( length > 0 )
+            {
+            User::LeaveIfError( eir.GetDeviceName( record->iName, isComplete) );
+            }
+        return 0;
+        }
+    return KErrNotFound;
+    }
+
+// ----------------------------------------------------------
+// CBasicDevDiscoverer::CompleteDiscovery
+// ----------------------------------------------------------
+//
+CDeviceSearchRecord* CBasicDevDiscoverer::NewInstanceL( 
+        const TInquirySockAddr& aAddr, const TDesC& aName )
+    {
+    CDeviceSearchRecord* record = new (ELeave) CDeviceSearchRecord();
+    record->iAddr = aAddr;
+    record->iName = aName;
+    return record;
+    }
+
+// ----------------------------------------------------------
+// CBasicDevDiscoverer::Reset
+// ----------------------------------------------------------
+//
+void CBasicDevDiscoverer::Reset()
+    {
+    // Free the cache of host Resolver.
+    iHostResolver.Close();
+    // Clean previous in-range devices whose proximity status
+    // may have been changed.
+    iDevices.ResetAndDestroy();
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/src/btdevextension.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,268 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  an extended BT device offering properties of
+* a Bluetooth device that may be needed by Bluetooth UIs
+*
+*/
+
+#include <btservices/btdevextension.h>
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// C++ default constructor
+// ---------------------------------------------------------------------------
+//
+CBtDevExtension::CBtDevExtension( TDefaultDevNameOption aNameOption ) 
+: iNameOption( aNameOption )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Symbian 2nd-phase constructor
+// ---------------------------------------------------------------------------
+//
+void CBtDevExtension::ConstructL(  CBTDevice* aDev )
+    {
+    SetDeviceL( aDev );
+    }
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CBtDevExtension* CBtDevExtension::NewLC( 
+        CBTDevice* aDev, TDefaultDevNameOption aNameOption )
+    {
+    CBtDevExtension* self = NULL;
+    self = new (ELeave) CBtDevExtension( aNameOption );
+    CleanupStack::PushL( self );
+    self->ConstructL( aDev );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CBtDevExtension* CBtDevExtension::NewLC( 
+        const TInquirySockAddr& aAddr,
+        const TDesC& aName,
+        TDefaultDevNameOption aNameOption )
+    {
+    CBtDevExtension* self = new (ELeave) CBtDevExtension( aNameOption );
+    CleanupStack::PushL( self );
+    CBTDevice* dev = CBTDevice::NewLC( aAddr.BTAddr() );
+    TBTDeviceClass cod( aAddr.MajorServiceClass(), 
+            aAddr.MajorClassOfDevice(), aAddr.MinorClassOfDevice() );
+    dev->SetDeviceClass( cod );
+    if ( aName.Length() )
+        {
+        dev->SetDeviceNameL(  BTDeviceNameConverter::ToUTF8L( aName ) );
+        }
+    self->ConstructL( dev );
+    CleanupStack::Pop( dev );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CBtDevExtension::~CBtDevExtension()
+    {
+    iAlias.Close();
+    delete iDev;
+    }
+
+// ---------------------------------------------------------------------------
+// IsBonded
+// ---------------------------------------------------------------------------
+//
+TBool CBtDevExtension::IsBonded( const TBTNamelessDevice &dev )
+    {
+    // IsValidPaired tells if the paired bit of dev is valid
+    // and IsPaired tells if the device is paired or not:
+    return dev.IsValidPaired() && 
+           dev.IsPaired() && 
+           // Authentication due to OBEX cases e.g. file transfer, is not 
+           // considered as bonded in Bluetooth UI:
+           dev.LinkKeyType() != ELinkKeyUnauthenticatedUpgradable;
+    }
+
+// ---------------------------------------------------------------------------
+// IsJustWorksBonded
+// ---------------------------------------------------------------------------
+//
+TBool CBtDevExtension::IsJustWorksBonded( const TBTNamelessDevice &dev )
+    {
+    return IsBonded( dev ) && 
+         dev.LinkKeyType() == ELinkKeyUnauthenticatedNonUpgradable;
+    }
+
+// ---------------------------------------------------------------------------
+// IsUserAwareBonded
+// ---------------------------------------------------------------------------
+//
+TBool CBtDevExtension::IsUserAwareBonded( const TBTNamelessDevice &dev )
+    {
+    if ( IsJustWorksBonded( dev ) )
+        {
+        // Just Works bonded devices can happen without user awareness.
+        // For example, authentication due to an incoming service connection request 
+        // from a device without IO.
+        // We use cookies to identify if this JW pairing is user aware or not:
+        TInt32 cookie = dev.IsValidUiCookie() ? dev.UiCookie() : EBTUiCookieUndefined;
+        return (cookie & EBTUiCookieJustWorksPaired );        
+        }
+    // Pairing in other mode than Just Works are always user-aware:
+    return IsBonded( dev );
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TDesC& CBtDevExtension::Alias() const
+    {
+    return iAlias;
+    }
+
+// ---------------------------------------------------------------------------
+// Addr()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TBTDevAddr& CBtDevExtension::Addr() const
+    {
+    return iDev->BDAddr();
+    }
+
+// ---------------------------------------------------------------------------
+// Device
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const CBTDevice& CBtDevExtension::Device() const
+    {
+    return *iDev;
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// IsUserAwareBonded
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CBtDevExtension::IsUserAwareBonded() const
+    {
+    return IsUserAwareBonded( iDev->AsNamelessDevice() );
+    }
+
+// ---------------------------------------------------------------------------
+// ServiceConnectionStatus()
+// ---------------------------------------------------------------------------
+//
+TBTEngConnectionStatus CBtDevExtension::ServiceConnectionStatus() const
+    {
+    return iServiceStatus;
+    }
+
+// ---------------------------------------------------------------------------
+// SetDeviceL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBtDevExtension::SetDeviceL( CBTDevice* aDev )
+    {
+    delete iDev;
+    iDev = aDev;
+    // It is possible that the client set a NULL object to us.
+    if ( !iDev )
+        {
+        iDev = CBTDevice::NewL();
+        }
+    // No optimization here. If client sets an identical device instance
+    // We will still execute these steps:
+    UpdateNameL();
+    //UpdateServiceStatusL();
+    }
+
+EXPORT_C CBtDevExtension* CBtDevExtension::CopyL()
+    {
+    CBtDevExtension* newDev = CBtDevExtension::NewLC( NULL );
+    CBTDevice* dev = iDev->CopyL();
+    CleanupStack::PushL( dev );
+    newDev->SetDeviceL( dev );
+    CleanupStack::Pop( dev);
+    newDev->SetServiceConnectionStatus( ServiceConnectionStatus() );
+    CleanupStack::Pop( newDev );
+    return newDev;
+    }
+
+// ---------------------------------------------------------------------------
+// ServiceConnectionStatus()
+// ---------------------------------------------------------------------------
+//
+void CBtDevExtension::SetServiceConnectionStatus(
+        TBTEngConnectionStatus aStatus )
+    {
+    iServiceStatus = aStatus;
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// UpdateL()
+// ---------------------------------------------------------------------------
+//
+void CBtDevExtension::UpdateNameL()
+    {
+    // UI takes friendly name for displaying if it is available
+    iAlias.Zero();
+    if ( iDev->IsValidFriendlyName() && iDev->FriendlyName().Length() != 0 )
+        {
+        iAlias.CreateL( iDev->FriendlyName() );
+        }
+    // otherwise, device name, if it is available, will be displayed
+    else if ( iDev->IsValidDeviceName() && iDev->DeviceName().Length() != 0 )
+        {
+        iAlias.CreateL( BTDeviceNameConverter::ToUnicodeL(iDev->DeviceName() ) );
+        }
+    if ( iAlias.Length() == 0 && 
+        ( iNameOption == EColonSeperatedBDAddr || iNameOption == EPlainBDAddr ) )
+        {
+        // Name for display is still missing. We need to make one for user to 
+        // identify it.
+        FormatAddressAsNameL();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// FormatAddressAsNameL()
+// ---------------------------------------------------------------------------
+//
+void CBtDevExtension::FormatAddressAsNameL()
+    {
+    // readable format of BD_ADDR is double size of BD ADDR size,
+    // and plus the seperators.
+    iAlias.ReAllocL( KBTDevAddrSize * 3 );
+    _LIT(KColon, ":");
+    if ( iNameOption == EColonSeperatedBDAddr )
+        {
+        iDev->BDAddr().GetReadable( iAlias, KNullDesC, KColon, KNullDesC );         
+        }
+    else
+        {
+        iDev->BDAddr().GetReadable( iAlias );
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/src/btdevrepository.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Repository of remote Bluetooth devices
+*
+*/
+
+#include <btservices/btdevrepository.h>
+#include "btdevrepositoryimpl.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// C++ default constructor
+// ---------------------------------------------------------------------------
+//
+CBtDevRepository::CBtDevRepository()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Symbian 2nd-phase constructor
+// ---------------------------------------------------------------------------
+//
+void CBtDevRepository::ConstructL()
+    {
+    iImpl = CBtDevRepositoryImpl::NewL();
+    }
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CBtDevRepository* CBtDevRepository::NewL()
+    {
+    CBtDevRepository* self = NULL;
+    self = new (ELeave) CBtDevRepository();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CBtDevRepository::~CBtDevRepository()
+    {
+    delete iImpl;
+    }
+
+// ---------------------------------------------------------------------------
+// AddObserverL.
+// Delegate to the implementor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBtDevRepository::AddObserverL( MBtDevRepositoryObserver* aObserver )
+    {
+    iImpl->AddObserverL( aObserver );
+    }
+
+// ---------------------------------------------------------------------------
+// RemoveObserver.
+// Delegate to the implementor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CBtDevRepository::RemoveObserver( MBtDevRepositoryObserver* aObserver )
+    {
+    iImpl->RemoveObserver( aObserver );
+    }
+
+// ---------------------------------------------------------------------------
+// AllDevices
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CBtDevRepository::IsInitialized() const
+    {
+    return iImpl->IsInitialized();
+    }
+
+// ---------------------------------------------------------------------------
+// AllDevices
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const RDevExtensionArray& CBtDevRepository::AllDevices() const
+    {
+    return iImpl->AllDevices();
+    }
+
+// ---------------------------------------------------------------------------
+// Device
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const CBtDevExtension* CBtDevRepository::Device( 
+        const TBTDevAddr& aAddr ) const
+    {
+    return iImpl->Device( aAddr );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/src/btdevrepositoryimpl.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,439 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: respository of remote Bluetooth devices.
+*
+*/
+
+#include "btdevrepositoryimpl.h"
+#include <e32property.h>
+#include <bt_subscribe.h>
+#include <btservices/btdevrepository.h>
+#include "btserviceutilconsts.h"
+
+// ---------------------------------------------------------------------------
+// Tells if two CBTDevice instances are for the same remote device
+// ---------------------------------------------------------------------------
+//
+TBool CompareDeviceByAddress( const CBTDevice& aDevA, const CBTDevice& aDevB )
+    {
+    return aDevA.BDAddr() == aDevB.BDAddr();
+    }
+
+// ---------------------------------------------------------------------------
+// Tells if these two instances are for the same remote device
+// ---------------------------------------------------------------------------
+//
+TBool MatchDeviceAddress(const TBTDevAddr* aAddr, const CBTDevice& aDev)
+    {
+    return *aAddr == aDev.BDAddr();
+    }
+
+// ---------------------------------------------------------------------------
+// Tells if these two instances are for the same remote device
+// ---------------------------------------------------------------------------
+//
+TBool MatchDeviceAddress(const TBTDevAddr* aAddr, const CBtDevExtension& aDev)
+    {
+    return *aAddr == aDev.Device().BDAddr();
+    }
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// C++ default constructor
+// ---------------------------------------------------------------------------
+//
+CBtDevRepositoryImpl::CBtDevRepositoryImpl()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Symbian 2nd-phase constructor
+// ---------------------------------------------------------------------------
+//
+void CBtDevRepositoryImpl::ConstructL()
+    {
+    // connect to registry
+    User::LeaveIfError( iBTRegServ.Connect() );
+    User::LeaveIfError( iBTRegistry.Open( iBTRegServ ) );
+    iRegistryActive = CBtSimpleActive::NewL(
+           *this, BtServiceUtil::ECreateRemoteDeviceViewRequest );
+    // Start to get the list of devices from registry.
+    CreateRemoteDeviceView();
+    
+    User::LeaveIfError( iBtRegistryKey.Attach(
+            KPropertyUidBluetoothCategory, 
+            KPropertyKeyBluetoothGetRegistryTableChange ) );
+
+    iRegistryKeyActive = CBtSimpleActive::NewL( *this, BtServiceUtil::ERegistryPubSubWatcher );
+    iBtRegistryKey.Subscribe( iRegistryKeyActive->RequestStatus() );
+    iRegistryKeyActive->GoActive();
+    iBtengConn = CBTEngConnMan::NewL( this );
+    }
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CBtDevRepositoryImpl* CBtDevRepositoryImpl::NewL()
+    {
+    CBtDevRepositoryImpl* self = NULL;
+    self = new (ELeave) CBtDevRepositoryImpl();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CBtDevRepositoryImpl::~CBtDevRepositoryImpl()
+    {
+    iObservers.Close();
+    delete iBtengConn;
+    delete iRegistryActive;
+    delete iRegRespRemoteDevices;
+    iDevices.ResetAndDestroy();
+    iDevices.Close();
+    iBTRegistry.Close();
+    iBTRegServ.Close();
+    delete iRegistryKeyActive;
+    iBtRegistryKey.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// AddObserverL
+// ---------------------------------------------------------------------------
+//
+void CBtDevRepositoryImpl::AddObserverL( MBtDevRepositoryObserver* aObserver )
+    {
+    // Do not allow null pointer.
+    if ( aObserver )
+        {
+        iObservers.AppendL( aObserver );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// RemoveObserver
+// ---------------------------------------------------------------------------
+//
+void CBtDevRepositoryImpl::RemoveObserver( MBtDevRepositoryObserver* aObserver )
+    {
+    TInt i = iObservers.Find( aObserver );
+    if ( i >= 0 )
+        {
+        iObservers.Remove( i );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// IsInitialized
+// ---------------------------------------------------------------------------
+//
+TBool CBtDevRepositoryImpl::IsInitialized() const
+    {
+    return iInitialized;
+    }
+
+// ---------------------------------------------------------------------------
+// AllDevices
+// ---------------------------------------------------------------------------
+//
+const RDevExtensionArray& CBtDevRepositoryImpl::AllDevices() const
+    {
+    return iDevices;
+    }
+
+// ---------------------------------------------------------------------------
+// Device
+// ---------------------------------------------------------------------------
+//
+const CBtDevExtension* CBtDevRepositoryImpl::Device( 
+        const TBTDevAddr& aAddr ) const
+    {
+    TInt pos = iDevices.Find( aAddr, MatchDeviceAddress);
+    if ( pos > -1 )
+        {
+        return iDevices[pos];
+        }
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBtSimpleActiveObserver.
+// Checks if there is an authentication result.
+// ---------------------------------------------------------------------------
+//
+void CBtDevRepositoryImpl::RequestCompletedL( CBtSimpleActive* aActive, TInt aStatus )
+    {
+    if ( aActive->RequestId() == BtServiceUtil::ECreateRemoteDeviceViewRequest )
+        {
+        HandleCreateRemoteDeviceViewCompletedL( aStatus );
+        }
+    else if ( aActive->RequestId() == BtServiceUtil::EGetRemoteDevicesRequest )
+        {
+        HandleGetRemoteDevicesCompletedL( aStatus );
+        }
+    else if ( aActive->RequestId() == BtServiceUtil::ERegistryPubSubWatcher )
+        {
+        TInt myChangedTable;
+        iBtRegistryKey.Subscribe( aActive->RequestStatus() );
+        aActive->GoActive();
+        TInt err = iBtRegistryKey.Get( myChangedTable );
+        if( !err && myChangedTable == KRegistryChangeRemoteTable )
+            {
+            if ( !iRegistryActive->IsActive() )
+                {
+                CreateRemoteDeviceView();
+                }
+            else
+                {
+                iNotHandledRegEventCounter++;
+                }
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBtSimpleActiveObserver.
+// Checks if there is an authentication result.
+// ---------------------------------------------------------------------------
+//
+void CBtDevRepositoryImpl::CancelRequest( TInt aRequestId )
+    {
+    if ( aRequestId == BtServiceUtil::ECreateRemoteDeviceViewRequest )
+        {
+        iBTRegistry.CancelRequest(iRegistryActive->RequestStatus());
+        }
+    else if ( aRequestId == BtServiceUtil::EGetRemoteDevicesRequest )
+        {
+        iRegRespRemoteDevices->Cancel();
+        }
+    else if ( aRequestId == BtServiceUtil::ERegistryPubSubWatcher )
+        {
+        iBtRegistryKey.Cancel();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBtSimpleActiveObserver.
+// ---------------------------------------------------------------------------
+//
+void CBtDevRepositoryImpl::HandleError( CBtSimpleActive* aActive, TInt aError )
+    {
+    (void) aError;
+    if ( aActive->RequestId() == BtServiceUtil::ECreateRemoteDeviceViewRequest || 
+            aActive->RequestId() == BtServiceUtil::EGetRemoteDevicesRequest )
+        {// leave happened in registry operation, delete registry response:
+        delete iRegRespRemoteDevices;
+        iRegRespRemoteDevices = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBTEngConnObserver.
+// ---------------------------------------------------------------------------
+//
+void CBtDevRepositoryImpl::ConnectComplete( TBTDevAddr& aAddr, TInt aErr, 
+                               RBTDevAddrArray* aConflicts)
+    {
+    // connection is single profile based, to make sure getting the correct status, 
+    // we always retrieve it from btengconnman:
+    (void)aConflicts;
+    (void) aErr;
+    TInt pos = iDevices.Find( aAddr, MatchDeviceAddress );
+    if ( pos > -1 )
+        {
+        TBTEngConnectionStatus  status = EBTEngNotConnected;
+        // error returned from the call is treated as not connected.
+        (void) iBtengConn->IsConnected( aAddr,  status );
+        iDevices[pos]->SetServiceConnectionStatus( status );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBTEngConnObserver.
+// ---------------------------------------------------------------------------
+//
+void CBtDevRepositoryImpl::DisconnectComplete( TBTDevAddr& aAddr, TInt aErr )
+    {
+    // unified handling for connections status events:
+    ConnectComplete( aAddr, aErr, NULL);
+    }
+
+// ---------------------------------------------------------------------------
+// issue creating a remote device view from the registry
+// ---------------------------------------------------------------------------
+//
+void CBtDevRepositoryImpl::CreateRemoteDeviceView()
+    {
+    iNotHandledRegEventCounter = 0;
+    (void) iBTRegistry.CloseView();
+    TBTRegistrySearch searchPattern;
+    searchPattern.FindAll();
+    iRegistryActive->SetRequestId( BtServiceUtil::ECreateRemoteDeviceViewRequest );
+    iBTRegistry.CreateView( searchPattern, iRegistryActive->iStatus );
+    iRegistryActive->GoActive();
+    }
+
+// ---------------------------------------------------------------------------
+// gets the paired devices from the view created by CreatePairedDevicesView
+// ---------------------------------------------------------------------------
+//
+void CBtDevRepositoryImpl::GetRemoteDevicesL()
+    {
+    delete iRegRespRemoteDevices;
+    iRegRespRemoteDevices = NULL;
+    iRegRespRemoteDevices = CBTRegistryResponse::NewL( iBTRegistry );
+    iRegistryActive->SetRequestId( BtServiceUtil::EGetRemoteDevicesRequest );
+    iRegRespRemoteDevices->Start( iRegistryActive->iStatus );
+    iRegistryActive->GoActive();
+    }
+
+// ---------------------------------------------------------------------------
+// re-create a paired device view if registry was changed during the previous
+// operation. otherwise if the view is not empty, get the remote devices.
+// ---------------------------------------------------------------------------
+//
+void CBtDevRepositoryImpl::HandleCreateRemoteDeviceViewCompletedL( TInt aStatus )
+    {
+    // aStatus may indicate the number of devices from registry.
+    // However, our algorithm does not rely on this return error 
+    // for implementation simplicity.
+    (void) aStatus;
+    if (iNotHandledRegEventCounter)
+        { // more registry change detected, create paired device view again:
+        CreateRemoteDeviceView( );
+        }
+    else
+        {
+        GetRemoteDevicesL( );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// update remote device list. if registry was changed, create a new view.
+// otherwise inform client for any changes.
+// ---------------------------------------------------------------------------
+//
+void CBtDevRepositoryImpl::HandleGetRemoteDevicesCompletedL( TInt aStatus )
+    {
+    // aStatus may indicate the number of devices from registry.
+    // However, our algorithm does not rely on this return error.
+    (void) aStatus;
+    if (iNotHandledRegEventCounter)
+        { // more registry change detected, create paired device view again:
+        CreateRemoteDeviceView( );
+        return;
+        }
+
+    UpdateRemoteDeviceRepositoryL();
+    if ( !iInitialized )
+        {
+        iInitialized = ETrue;
+        // The first time we have got the device lists from registry,
+        // Get the connections statuses of these devices from bteng.
+        for ( TInt i = iDevices.Count() - 1; i > -1; --i )
+            {
+            TBTEngConnectionStatus  status = EBTEngNotConnected;
+            // error returned from the call is treated as not connected.
+            (void) iBtengConn->IsConnected( iDevices[i]->Addr(),  status );
+            iDevices[i]->SetServiceConnectionStatus( status );
+            }
+        for ( TInt i = 0; i < iObservers.Count(); ++i )
+            {
+            iObservers[i]->RepositoryInitialiazed();
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// update remote devices in local array with the latest data
+// ---------------------------------------------------------------------------
+//
+void CBtDevRepositoryImpl::UpdateRemoteDeviceRepositoryL()
+    {
+    TIdentityRelation<CBTDevice> addrComp( CompareDeviceByAddress );
+    RBTDeviceArray& devsFromReg = iRegRespRemoteDevices->Results();
+    for ( TInt i = iDevices.Count() - 1; i > -1; --i )
+        {
+        TInt pos = devsFromReg.Find( &(iDevices[i]->Device()), addrComp );
+        if ( pos > KErrNotFound )
+            {
+            // Device is found in registry, check if its properties have been changed
+            TUint similarity = devsFromReg[pos]->CompareTo( iDevices[i]->Device() );
+            TBool changed = EFalse;
+            if ( similarity != 
+                    ( CBTDevice::EAllNameProperties | 
+                      TBTNamelessDevice::EAllNamelessProperties) )
+                {
+                // This device was updated in registry.
+                // move its ownership to local store
+                iDevices[i]->SetDeviceL( devsFromReg[pos] );
+                changed = ETrue;
+                }
+            else
+                {
+                // This device has no update:
+                delete devsFromReg[pos];
+                }
+            // either the instance at pos has been moved or deleted.
+            devsFromReg.Remove( pos );
+            if ( iInitialized && changed )
+                {
+                for ( TInt i = 0; i < iObservers.Count(); ++i )
+                    {
+                    iObservers[i]->BtDeviceChangedInRegistry( *iDevices[i], similarity );
+                    }
+                }
+            }
+        else
+            {
+            // This device was deleted from registry.
+            // Free it from the local store before informing client.
+            TBTDevAddr addr = iDevices[i]->Addr();
+            delete iDevices[i];
+            iDevices.Remove( i );
+            if ( iInitialized )
+                {
+                for ( TInt i = 0; i < iObservers.Count(); ++i )
+                    {
+                    iObservers[i]->BtDeviceDeleted( addr );
+                    }
+                }
+            }
+        }
+    
+    // Remaining devices in iRegRespRemoteDevices are new devices:
+    for ( TInt i = 0; i < devsFromReg.Count() ; i++ )
+        {
+        CBtDevExtension* devExt = CBtDevExtension::NewLC( devsFromReg[i] );
+        iDevices.AppendL( devExt );
+        CleanupStack::Pop( devExt );
+        devsFromReg.Remove( i );
+        if ( iInitialized )
+            {
+            for ( TInt i = 0; i < iObservers.Count(); ++i )
+                {
+                iObservers[i]->BtDeviceAdded( *iDevices[ iDevices.Count() - 1 ] );
+                }
+            }
+        }
+    // the devices in devsFromReg was either deleted, or moved.
+    delete iRegRespRemoteDevices;
+    iRegRespRemoteDevices = NULL;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btserviceutil/src/btsimpleactive.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,120 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Active object helper class.
+*
+*/
+
+#include <btservices/btsimpleactive.h>
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// C++ default constructor
+// ---------------------------------------------------------------------------
+//
+CBtSimpleActive::CBtSimpleActive(  MBtSimpleActiveObserver& aObserver, TInt aId, 
+    TInt aPriority )
+:   CActive( aPriority ),
+    iRequestId( aId ),
+    iObserver( aObserver )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CBtSimpleActive* CBtSimpleActive::NewL( MBtSimpleActiveObserver& aObserver, 
+    TInt aId, TInt aPriority )
+    {
+    CBtSimpleActive* self = new( ELeave ) CBtSimpleActive( aObserver, aId, aPriority );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CBtSimpleActive::~CBtSimpleActive()
+    {
+    Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// Get the identifier of this instance.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CBtSimpleActive::RequestId()
+    {
+    return iRequestId;
+    }
+
+// -----------------------------------------------------------------------------
+// Set the identifier of this instance.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CBtSimpleActive::SetRequestId( TInt aId )
+    {
+    iRequestId = aId;
+    }
+
+// -----------------------------------------------------------------------------
+// Activate the active object.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CBtSimpleActive::GoActive()
+    {
+    SetActive();
+    }
+
+// -----------------------------------------------------------------------------
+// Get a reference to the active object request status.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TRequestStatus& CBtSimpleActive::RequestStatus()
+    {
+    return iStatus;
+    }
+
+// ---------------------------------------------------------------------------
+// From class CActive.
+// Called by the active scheduler when the request has been cancelled.
+// ---------------------------------------------------------------------------
+//
+void CBtSimpleActive::DoCancel()
+    {
+    iObserver.CancelRequest( iRequestId );
+    }
+
+// ---------------------------------------------------------------------------
+// From class CActive.
+// Called by the active scheduler when the request has been completed.
+// ---------------------------------------------------------------------------
+//
+void CBtSimpleActive::RunL()
+    {
+    iObserver.RequestCompletedL( this, iStatus.Int() );
+    }
+
+// ---------------------------------------------------------------------------
+// From class CActive.
+// Called by the active scheduler when an error in RunL has occurred.
+// ---------------------------------------------------------------------------
+//
+TInt CBtSimpleActive::RunError( TInt aError )
+    {
+    iObserver.HandleError( this, aError );
+    return KErrNone;
+    }
--- a/bluetoothengine/btui/Ecom/data/1020742B.rss	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 BTUI plugin.
-*
-*
-*/
-
-#include <registryinfo.rh>
-
-RESOURCE REGISTRY_INFO theInfo
-	{
-	dll_uid     = 0x1020742B; 
-	interfaces  = 
-		{
-		INTERFACE_INFO
-			{
-			interface_uid   = 0x10207236; // UID for CGSPluginInterface 
-			implementations = 
-				{
-				IMPLEMENTATION_INFO
-					{
-					implementation_uid  = 0x1020742C; 
-					version_no          = 1;
-					display_name        = "GS Btui Plugin"; // Plugin debug name
-					default_data        = "0x10207250"; // Parent UID (BTUI is under "Connection" folder of General Setting Application)
-					opaque_data         = "30"; // Order number
-					}
-				};
-			},	
-		
-		INTERFACE_INFO
-			{
-			interface_uid   = 0x1020745F; // UID for CBtuiPluginInterface
-			implementations = 
-				{
-				IMPLEMENTATION_INFO
-					{
-					implementation_uid  = 0x1020745C; // implementation UID
-					version_no          = 1;
-					display_name        = "Btui Application Plugin for MainView"; // Plugin debug name 
-					},
-
-				IMPLEMENTATION_INFO
-					{
-					implementation_uid  = 0x1020745D; // implementation UID
-					version_no          = 1;
-					display_name        = "Btui Application Plugin for PairedDevicesView"; // Plugin debug name
-					},
-
-				IMPLEMENTATION_INFO
-					{
-					implementation_uid  = 0x20002780; // implementation UID
-					version_no          = 1;
-					display_name        = "Btui Application Plugin for BlockedDevicesView"; // Plugin debug name
-					}
-					
-				};
-				
-			}		
-			
-		};
-	}
-
--- a/bluetoothengine/btui/Ecom/data/BtuiViewResources.rss	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1440 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, 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 BTUI.
-*
-*/
-
-
-#include <data_caging_paths_strings.hrh>
-
-//  RESOURCE IDENTIFIER
-
-NAME    BVIE          // 4 letter ID
-
-//  INCLUDES
-#include <eikon.rh>
-#include "btui.hrh"   // Enums for these resources
-#include <btui.loc>   // Localisation file
-#include <btui.mbg>   // Icon indexes created by abld
-#include "eikon.rsg"
-#include <avkon.rsg>
-#include <avkon.rh>
-#include <avkon.mbg>
-#include <avkon.loc>
-#include <appinfo.rh>
-
-//  MACROS
-
-//  RESOURCE DEFINITIONS
-
-RESOURCE RSS_SIGNATURE { }
-
-RESOURCE TBUF { buf=""; }
-
-//----------------------------------------------------
-//
-//  Hotkeys for BTUI
-//
-//----------------------------------------------------
-//
-RESOURCE HOTKEYS r_btui_hotkeys
-    {
-    control=
-        {
-        HOTKEY { command=EAknCmdExit; key='e'; }
-        };
-    }
-
-// == MAIN VIEW ==============================================================
-
-RESOURCE CBA r_btui_softkeys_options_back__change
-    {
-    buttons =
-        {
-        CBA_BUTTON
-            {
-            id = EAknSoftkeyOptions;
-            txt = text_softkey_option;
-            },
-        CBA_BUTTON
-            {
-            id = EAknSoftkeyBack;
-            txt = text_softkey_back; 
-            },
-        CBA_BUTTON 
-            {
-            id = EBTUICmdMSK ;
-            txt = qtn_msk_change; 
-            }
-            
-        };
-    }
-
-
-
-
-//----------------------------------------------------
-//
-//  The main view of the BTUI application
-//
-//----------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_btui_main_view
-    {
-    hotkeys = r_btui_hotkeys;
-    menubar = r_btui_menubar_main_view;
-    cba     = r_btui_softkeys_options_exit__change;
-    }
-
-//----------------------------------------------------
-//
-//  The main view's menu bar
-//
-//----------------------------------------------------
-//
-RESOURCE MENU_BAR r_btui_menubar_main_view
-    {
-    titles =
-        {
-        MENU_TITLE { menu_pane = r_btui_app_menu; txt=""; },
-        MENU_TITLE { menu_pane = r_btui_main_view_menu; txt=""; }
-        };
-    }
-
-//----------------------------------------------------
-//
-//  The main view options
-//
-//----------------------------------------------------
-//
-RESOURCE MENU_PANE r_btui_main_view_menu
-    {
-    items =
-        {
-        MENU_ITEM { command = EBTUICmdChangePowerStateMenu;   txt = qtn_bt_change_value; },
-        MENU_ITEM { command = EBTUICmdChangeVisibilityMenu;   txt = qtn_bt_change_value; },
-        MENU_ITEM { command = EBTUICmdChangeBTNameMenu;       txt = qtn_bt_change_value; }
-		#ifdef __BT_SAP
-		,
-		MENU_ITEM { command = EBTUICmdChangeSapStateMenu;   txt = qtn_bt_change_value; }
-		#endif
-        };
-    }
-
-//----------------------------------------------------
-//
-//  Editor for entering all settings
-//
-//----------------------------------------------------
-//
-RESOURCE LISTBOX r_bt_setting_editor
-    {
-    flags = EEikListBoxMultipleSelection;
-    }
-
-//----------------------------------------------------
-//
-//  The input dialog for entering power mode
-//
-//----------------------------------------------------
-//
-RESOURCE AVKON_SETTING_PAGE r_bt_power_setting_page
-    {
-    label              = qtn_bt_sett_module;
-    hint_text          = " ";
-    softkey_resource   = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
-    type               = EAknSetListBox;
-    editor_resource_id = r_bt_setting_editor;
-    }
-
-//----------------------------------------------------
-//
-//  Bluetooth power modes
-//
-//----------------------------------------------------
-//
-RESOURCE ARRAY r_bt_power_modes
-    {
-    items =
-        {
-        LBUF { txt = qtn_bt_sett_on; },
-        LBUF { txt = qtn_bt_sett_off; }
-        };
-    }
-
-//----------------------------------------------------
-//
-//  The input dialog for bluetooth visibility setting
-//
-//----------------------------------------------------
-//
-RESOURCE AVKON_SETTING_PAGE r_bt_visibility_setting_page
-    {
-    label              = qtn_bt_sett_phone_visibility;
-    hint_text          = " ";
-    softkey_resource   = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
-    type               = EAknSetListBox;
-    editor_resource_id = r_bt_setting_editor;
-    }
-
-//----------------------------------------------------
-//
-//  Bluetooth visibility modes
-//
-//----------------------------------------------------
-//
-RESOURCE ARRAY r_bt_visibility_modes
-    {
-    items =
-        {
-        LBUF { txt = qtn_bt_det_sett_general; },
-        LBUF { txt = qtn_bt_set_visibility_time; },
-        LBUF { txt = qtn_bt_hidden; }
-        };
-    }
-
-//----------------------------------------------------
-//
-//  The input dialog for bluetooth local name setting
-//
-//----------------------------------------------------
-//
-RESOURCE AVKON_SETTING_PAGE r_bt_name_setting_page
-    {
-    label   = qtn_bt_sett_bt_name;
-    type    = EEikCtEdwin;
-    softkey_resource   = R_AVKON_SOFTKEYS_OK_CANCEL__OK;    
-    editor_resource_id = r_bt_name_setting_editor;
-    }
-
-//----------------------------------------------------
-//
-//  Editor for entering BT's local name
-//
-//----------------------------------------------------
-//
-RESOURCE EDWIN r_bt_name_setting_editor
-    {
-    lines = 0; // Expanding to multiple rows
-    maxlength = KBTUIMaxNameLength;
-    flags = EEikEdwinNoLineOrParaBreaks;
-    }
-
-
-// === PAIRED DEVICES VIEW ===================================================
-
-//----------------------------------------------------
-//
-//  This view shows all paired Bluetooth devices.
-//
-//----------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_btui_other_devices_view
-    {
-    hotkeys = r_btui_hotkeys;
-    menubar = r_btui_menubar_other_devices_view;
-    cba     = r_btui_softkeys_options_exit__conoptions; 
-    }
-    
-
-RESOURCE CBA r_btui_softkeys_options_exit__conoptions
-    {
-    buttons =
-        {
-        CBA_BUTTON
-            {
-            id = EAknSoftkeyOptions;
-            txt = text_softkey_option;
-            },
-        CBA_BUTTON
-            {
-            id = EAknSoftkeyExit;
-            txt = text_softkey_exit;
-            },
-        CBA_BUTTON
-            {
-            id = EAknSoftkeyContextOptions;//EAknSoftkeyOptions;
-            txt = text_softkey_option;
-            }
-            
-        };
-    }  
-    
-RESOURCE AVKON_VIEW r_btui_other_devices_view_gs
-    {
-    hotkeys = r_btui_hotkeys;
-    menubar = r_btui_menubar_other_devices_view;
-    cba     = r_btui_softkeys_options_back__conoptions; 
-    }
-//    menubar_context = r_btui_menubar_other_devices_view__context;
-// this is defined in CBTUIOtherDevicesView::DoActivate, since I did not
-// find a way to do this by resources
-
-RESOURCE CBA r_btui_softkeys_options_back__conoptions
-    {
-    buttons =
-        {
-        CBA_BUTTON
-            {
-            id = EAknSoftkeyOptions;
-            txt = text_softkey_option;
-            },
-        CBA_BUTTON
-            {
-            id = EAknSoftkeyBack;
-            txt = text_softkey_back; 
-            },
-        CBA_BUTTON
-            {
-            id = EAknSoftkeyContextOptions;//EAknSoftkeyOptions;
-            txt = text_softkey_option;
-            }
-            
-        };
-    }    
-    
-//----------------------------------------------------
-//
-//  The menubar for other paired devices view
-//
-//----------------------------------------------------
-//
-RESOURCE MENU_BAR r_btui_menubar_other_devices_view
-    {
-    titles =
-        {
-        MENU_TITLE { menu_pane = r_btui_app_menu; txt = ""; },
-        MENU_TITLE { menu_pane = r_btui_other_devices_view_menu; txt = ""; }
-        };
-    }
-
-
-RESOURCE MENU_BAR r_btui_menubar_other_devices_view_context
-    {
-    titles =
-        {
-        MENU_TITLE { menu_pane = r_btui_other_devices_view_menu_context; txt = ""; }
-        };
-    }
-
-//----------------------------------------------------
-//
-//  The other devices view options
-//
-//----------------------------------------------------
-//
-RESOURCE MENU_PANE r_btui_other_devices_view_menu
-    {
-    items =
-        {
-        MENU_ITEM { command = EBTUICmdNewPairedDevice;    txt = qtn_bt_new_paired_device; },
-        MENU_ITEM { command = EBTUICmdConnect;            txt = qtn_bt_gen_connect; },
-        MENU_ITEM { command = EBTUICmdConnectAudio;       txt = qtn_bt_connect; },
-        MENU_ITEM { command = EBTUICmdDisconnect;         txt = qtn_bt_disconnect; },
-        MENU_ITEM { command = EBTUICmdGiveNickname;       txt = qtn_bt_give_nickname; },
-        MENU_ITEM { command = EBTUICmdSetTrusted;         txt = qtn_bt_set_as_trusted; },
-        MENU_ITEM { command = EBTUICmdSetUnTrusted;       txt = qtn_bt_set_as_untrusted; },
-        MENU_ITEM { command = EBTUICmdSetBlocked;         txt = qtn_bt_block; },        
-        MENU_ITEM { command = EBTUICmdDelete;             txt = qtn_bt_delete; },
-        MENU_ITEM { command = EBTUICmdSettings;           txt = qtn_bt_settings; },
-        MENU_ITEM { command = EBTUICmdDeleteAll;          txt = qtn_bt_delete_all; }
-        };
-    }
-
-RESOURCE MENU_PANE r_btui_other_devices_view_menu_context
-    {
-    items =
-        {
-        MENU_ITEM { command = EBTUICmdNewPairedDevice;    txt = qtn_bt_new_paired_device; },
-        MENU_ITEM { command = EBTUICmdConnect;            txt = qtn_bt_gen_connect; },
-        MENU_ITEM { command = EBTUICmdConnectAudio;       txt = qtn_bt_connect; },
-        MENU_ITEM { command = EBTUICmdDisconnect;         txt = qtn_bt_disconnect; },
-        MENU_ITEM { command = EBTUICmdGiveNickname;       txt = qtn_bt_give_nickname; },
-        MENU_ITEM { command = EBTUICmdSetTrusted;         txt = qtn_bt_set_as_trusted; },
-        MENU_ITEM { command = EBTUICmdSetUnTrusted;       txt = qtn_bt_set_as_untrusted; },
-        MENU_ITEM { command = EBTUICmdSetBlocked;         txt = qtn_bt_block; },                
-        MENU_ITEM { command = EBTUICmdDelete;             txt = qtn_bt_delete; },
-        MENU_ITEM { command = EBTUICmdSettings;           txt = qtn_bt_settings; }
-        };
-    }
-
-
-// == APPLICATION ============================================================
-
-//----------------------------------------------------
-//
-//  The BTUI application level menu
-//  Common for all views
-//
-//----------------------------------------------------
-//
-RESOURCE MENU_PANE r_btui_app_menu
-    {
-    items =
-        {
-#ifdef __SERIES60_HELP
-        MENU_ITEM { command = EAknCmdHelp; txt = qtn_options_help; },
-#endif
-        MENU_ITEM { command = EAknCmdExit; txt = qtn_options_exit; }
-        };
-    }
-
-    
-
-// === QUERIES ===============================================================
-
-//----------------------------------------------------
-// Data query "Enter Bluetooth name for your phone"
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_enter_local_name_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_DATA_QUERY
-                {
-                layout  = EDataLayout;
-                label   = qtn_enter_bt_name;
-                control = EDWIN
-                    {
-                    flags     = EEikEdwinNoHorizScrolling | EEikEdwinResizable | EEikEdwinNoLineOrParaBreaks;
-                    maxlength = KBTUIMaxNameLength;
-                    };
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// Confirmation query "You have active Bluetooth
-// connections on. Switch off anyway?"
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_switch_off_anyway_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout    = EConfirmationLayout;
-                label     = qtn_bt_switch_off_anyway;
-                animation = R_QGN_NOTE_QUERY_ANIM;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// Confirmation query "Bluetooth is currently off.
-// Do you want to switch it on?"
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_is_off_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout    = EConfirmationLayout;
-                label     = qtn_bt_is_off;
-                animation = R_QGN_NOTE_QUERY_ANIM;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// Confirmation query "Do you want to activate bluetooth in off-line mode?"
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_activate_in_offline_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout    = EConfirmationQueryLayout;
-                label     = qtn_bt_activate_in_offline;
-                animation = R_QGN_NOTE_QUERY_ANIM;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// Confirmation query "Cancel pairing with: %U"
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_warn_erase_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout    = EConfirmationLayout;
-                animation = R_QGN_NOTE_QUERY_ANIM;
-                };
-            }
-        };
-    }
-
-RESOURCE TBUF r_bt_warn_erase { buf = qtn_bt_warn_erase; }
-RESOURCE TBUF r_bt_warn_erase_connected { buf = qtn_bt_warn_erase_connected; }
-
-//----------------------------------------------------
-// Confirmation query "Cancel all pairings"
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_warn_erase_all_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout    = EConfirmationLayout;
-                label     = qtn_bt_warn_erase_all;
-                animation = R_QGN_NOTE_QUERY_ANIM;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// Confirmation query "Delete all pairings? Some devices may be disconnected."
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_warn_erase_all_connected_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout    = EConfirmationLayout;
-                label     = qtn_bt_warn_erase_all_connected;
-                animation = R_QGN_NOTE_QUERY_ANIM;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// Data query "Enter alias"
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_enter_nickname_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_DATA_QUERY
-                {
-                layout  = EDataLayout;
-                label   = qtn_bt_enter_nickname;
-                control = EDWIN
-                    {
-                    flags     = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
-                    maxlength = KBTUIMaxAliasLength;
-                    };
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// Confirmation query "Set this device as trusted"
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_set_trusted_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout    = EConfirmationLayout;
-                label     = qtn_bt_conf_aut;
-                animation = R_QGN_NOTE_QUERY_ANIM;
-                };
-            }
-        };
-    }
-
-RESOURCE TBUF r_bt_set_as_trusted_prompt { buf = qtn_bt_conf_aut; }
-
-//----------------------------------------------------
-// Confirmation query "Disconnect from: %U"
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_disconnect_from_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout    = EConfirmationLayout;
-                animation = R_QGN_NOTE_QUERY_ANIM;
-                };
-            }
-        };
-    }
-
-RESOURCE TBUF r_bt_disconnect_from { buf = qtn_bt_disconn_from; }
-
-
-// === NOTES =================================================================
-
-//----------------------------------------------------
-// Information note "Phone is visible to other
-// Bluetooth devices."
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_phone_visib_to_oth_note
-    {
-    flags   = EAknInformationNoteFlags;
-    buttons = R_AVKON_SOFTKEYS_EMPTY;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtNote;
-            id      = EBTUIPhoneVisibleToOthers;
-            control = AVKON_NOTE
-                {
-                layout          = EGeneralLayout;
-                singular_label  = qtn_bt_phone_visib_to_oth;
-                animation       = R_QGN_NOTE_INFO_ANIM;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// Information note "Phone is hidden from others"
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_hidden_from_others
-    {
-    flags   = EAknInformationNoteFlags;
-    buttons = R_AVKON_SOFTKEYS_EMPTY;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtNote;
-            id      = EBTUIHiddenFromOthersNote;
-            control = AVKON_NOTE
-                {
-                layout          = EGeneralLayout;
-                singular_label  = qtn_bt_hidden_from_others;
-                animation       = R_QGN_NOTE_INFO_ANIM;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// Error note "Alias exists in Paired devices list."
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_name_exists_note
-    {
-    flags   = EAknErrorNoteFlags | EEikDialogFlagWait;
-    buttons = R_AVKON_SOFTKEYS_EMPTY;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtNote;
-            id      = EBTUINameAlreadyExists;
-            control = AVKON_NOTE
-                {
-                layout          = EGeneralLayout;
-                singular_label  = qtn_bt_name_exists;
-                animation       = R_QGN_NOTE_ERROR_ANIM;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// Error note "Invalid name entered, try again."
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_invalid_local_name_note
-    {
-    //removed
-    //Leave the name here to keep binary compatibility
-    }
-
-//----------------------------------------------------
-// Confirmation note "Device set as untrusted."
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_device_untrusted_note
-    {
-    flags   = EAknConfirmationNoteFlags;
-    buttons = R_AVKON_SOFTKEYS_EMPTY;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtNote;
-            id      = EBTUIDeviceSetAsUntrusted;
-            control = AVKON_NOTE
-                {
-                layout          = EGeneralLayout;
-                singular_label  = qtn_bt_dev_set_as_untrust;
-                animation       = R_QGN_NOTE_OK_ANIM;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// Wait note "Waiting for response from %U"
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_waiting
-    {
-    flags   = EAknWaitNoteFlags;
-    buttons = R_AVKON_SOFTKEYS_EMPTY; 
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtNote;
-            id      = EBTUIWaitingForPairing;
-            control = AVKON_NOTE
-                {
-                layout          = EWaitLayout;
-                singular_label  = qtn_bt_waiting;
-                animation       = R_QGN_GRAF_WAIT_BAR_ANIM;
-                };
-            }
-        };
-    }
-
-RESOURCE TBUF r_bt_waiting_prompt { buf = qtn_bt_waiting; }
-
-//----------------------------------------------------
-// Error note "Cannot execute Bluetooth operation
-// successfully!"
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_general_error_note
-    {
-    flags   = EAknErrorNoteFlags | EEikDialogFlagWait;
-    buttons = R_AVKON_SOFTKEYS_EMPTY;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtNote;
-            id      = EBTUIGeneralError;
-            control = AVKON_NOTE
-                {
-                layout          = EGeneralLayout;
-                singular_label  = qtn_bt_general_error;
-                animation       = R_QGN_NOTE_ERROR_ANIM;
-                };
-            }
-        };
-    }
-
-
-//----------------------------------------------------
-// Wait note "Connecting to %U"
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_connecting_to_wait_note
-    {
-    flags   = EAknWaitNoteFlags;
-    buttons = R_AVKON_SOFTKEYS_CANCEL;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtNote;
-            id      = EBTUIConnectingTo;
-            control = AVKON_NOTE
-                {
-                layout          = EWaitLayout;                
-                animation       = R_QGN_GRAF_WAIT_BAR_ANIM;
-                };
-            }
-        };
-    }
-
-RESOURCE TBUF r_bt_connecting_to { buf = qtn_bt_wait_connecting_to;}
-
-//----------------------------------------------------
-// Information note "Disconnect wired accessory"
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_disconnect_wired_note
-    {
-    flags   = EAknInformationNoteFlags;
-    buttons = R_AVKON_SOFTKEYS_EMPTY;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtNote;
-            id      = EBTUIDisconnectWired;
-            control = AVKON_NOTE
-                {
-                layout          = EGeneralLayout;
-                singular_label  = qtn_bt_disconnect_wired;
-                animation       = R_QGN_NOTE_INFO_ANIM;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// Information note "Cannot establish Bluetooth connection"
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_not_incall_note
-    {
-    flags   = EAknInformationNoteFlags;
-    buttons = R_AVKON_SOFTKEYS_EMPTY;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtNote;
-            id      = EBTUINotIncall;
-            control = AVKON_NOTE
-                {
-                layout          = EGeneralLayout;
-                singular_label  = qtn_bt_not_incall;
-                animation       = R_QGN_NOTE_INFO_ANIM;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// Information note "Disconnect %U first"
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_disconnect_first_prompt { buf = qtn_bt_disconnect_first; }
-
-//----------------------------------------------------
-// Information note "Maximum amount of Bluetooth conn..."
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_busy
-    {
-    flags   = EAknInformationNoteFlags;
-    buttons = R_AVKON_SOFTKEYS_EMPTY;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtNote;
-            id      = EBTUIBtBusy;
-            control = AVKON_NOTE
-                {
-                layout          = EGeneralLayout;
-                singular_label  = qtn_bt_busy;
-                animation       = R_QGN_NOTE_INFO_ANIM;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-// Information note "Bluetooth can't activated in off-line mode"
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_offline_disabled { buf = qtn_bt_offline_disabled; }
-
-//----------------------------------------------------
-// Default value for "My Bluetooth name"
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_default_local_name {	buf = qtn_bt_default_local_name; }
-
-
-// === GLOBAL QUERIES AND NOTES ==============================================
-
-//----------------------------------------------------
-// Global Information note "Audio routed to BT handsfree"
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_audios_accessory_prompt { buf = qtn_bt_audio_accessory; }
-
-//----------------------------------------------------
-// Global Information note "Connected to %U"
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_conf_connected_prompt { buf = qtn_bt_conf_connected; }
-
-//----------------------------------------------------
-// Global Information note "Disconnected from %U"
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_conf_disconnected_prompt { buf = qtn_bt_conf_disconnected; }
-
-//----------------------------------------------------
-// Global Information note "Cannot establish Bluetooth connection"
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_device_not_avail_note { buf = qtn_bt_device_not_avail; }
-
-//----------------------------------------------------
-// Global Information note "Hands-Free Profile not supported by %U"
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_hfp_not_supported { buf = qtn_bt_hfp_not_supported; }
-
-//----------------------------------------------------
-// Global Information note "Unsupported device: %U"
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_device_not_supported { buf = qtn_bt_device_not_supported; }
-
-// ===========================================================================
-
-//----------------------------------------------------
-// Titles for views
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_title_bluetooth  { buf = qtn_bt_title_bluetooth; }
-RESOURCE TBUF r_bt_title_paired_dev { buf = qtn_bt_title_paired_dev; }
-
-//----------------------------------------------------
-// Empty list text
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_no_paired_devices { buf = qtn_bt_no_paired_devices; }
-
-//----------------------------------------------------
-// Popup commands for paired devices view when
-// there are no devices
-//----------------------------------------------------
-//
-RESOURCE ARRAY r_bt_no_paired_devices_popup_commands
-    {
-    items = {
-        LBUF { txt = qtn_bt_new_paired_device; }
-        };
-    }
-
-//----------------------------------------------------
-// Standard popup commands for paired devices view
-//----------------------------------------------------
-//
-RESOURCE ARRAY r_bt_paired_devices_popup_commands
-    {
-    items = {		
-        LBUF { txt = qtn_bt_give_nickname; },        
-        LBUF { txt = qtn_bt_delete; }
-        };
-    }
-
-//----------------------------------------------------
-// Optional popup commands for paired devices view
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_set_untrusted_command { buf = qtn_bt_set_as_untrusted; }
-
-RESOURCE TBUF r_bt_set_trusted_command { buf = qtn_bt_set_as_trusted; }
-
-RESOURCE TBUF r_bt_connect_command { buf = qtn_bt_connect; }
-
-RESOURCE TBUF r_bt_disconnect_command { buf = qtn_bt_disconnect; }
-
-
-//----------------------------------------------------
-// Format/label strings for main view
-// There is also TBTUIMainViewSettingFormatStrings enum
-// in the BTUI.hrh which must reflect EXACTLY this resource !
-//----------------------------------------------------
-//
-RESOURCE ARRAY r_bt_label_strings
-    {
-    items = {
-        LBUF { txt=" \t"qtn_bt_sett_module"\t\t"qtn_bt_sett_on; },
-        LBUF { txt=" \t"qtn_bt_sett_module"\t\t"qtn_bt_sett_off; },
-        LBUF { txt=" \t"qtn_bt_sett_phone_visibility"\t\t"qtn_bt_det_sett_general; },
-        LBUF { txt=" \t"qtn_bt_sett_phone_visibility"\t\t"qtn_bt_hidden; },
-        
-        //temp visible mode		
-        LBUF { txt=" \t"qtn_bt_sett_phone_visibility"\t\t" qtn_bt_temp_visible; },
-        
-        LBUF { txt=" \t"qtn_bt_sett_bt_name"\t\t"; }
-		#ifdef __BT_SAP
-		,
-		LBUF { txt=" \t"qtn_bt_sap"\t\t"qtn_bt_sap_enabled; },
-        LBUF { txt=" \t"qtn_bt_sap"\t\t"qtn_bt_sap_disabled; }
-		#endif
-        };
-    }
-
-
-#ifdef __BT_SAP
-//----------------------------------------------------
-//
-//  The input dialog for SIM access profile setting
-//
-//----------------------------------------------------
-//
-RESOURCE AVKON_SETTING_PAGE r_bt_sap_setting_page
-    {
-    label              = qtn_bt_sap;
-    hint_text          = " ";
-    softkey_resource   = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
-    type               = EAknSetListBox;
-    editor_resource_id = r_bt_setting_editor;
-    }
-
-//----------------------------------------------------
-//
-//  Bluetooth sap modes
-//
-//----------------------------------------------------
-//
-RESOURCE ARRAY r_bt_sap_modes
-    {
-    items =
-        {
-        LBUF { txt = qtn_bt_sap_enabled; },
-        LBUF { txt = qtn_bt_sap_disabled; }
-        };
-    }  
-
-//----------------------------------------------------
-// Information Note "Enabling SIM Access Profile  
-// connection Bluetooth must be ON"
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_sap_enable_note
-    { 
-    flags   = EAknInformationNoteFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtNote;
-            id      = EBTUIBtSapEnableNote;
-            control = AVKON_NOTE
-                {
-                layout           = EGeneralLayout;
-                singular_label   = qtn_bt_sap_enable_info;
-                animation        = R_QGN_NOTE_INFO_ANIM;
-                };
-            }
-        };
-    }
-#endif //__BT_SAP
-
-//  Visibility TIMEOUT
-//----------------------------------------------------
-//    
-//    r_setting_visibility_time_slider    
-//    visibility timeout setting slider
-//
-//----------------------------------------------------
-//
-RESOURCE SLIDER r_setting_visibility_time_slider 
-    {
-    layout = EAknSettingsItemSliderLayout;
-    minvalue = 1;
-    maxvalue = 60;
-    step = 1; 
-    valuetype = EAknSliderValueBareFigure;
-    singular_valuelabel = qtn_bt_slider_singular;
-        
-    minlabel = qtn_bt_slider_min;
-    maxlabel = qtn_bt_slider_max;
-    valuelabel = qtn_bt_slider_plural; 
-    }
-
-//----------------------------------------------------
-//    
-//    r_visibility_time_setting_page     
-//    visibility timeout setting page. 
-//
-//----------------------------------------------------
-//
-RESOURCE AVKON_SETTING_PAGE r_visibility_time_setting_page
-    { 
-    number = EAknSettingPageNoOrdinalDisplayed;
-    label = qtn_bt_slider_visibility_time;
-    type = EAknCtSlider;
-    softkey_resource   = R_AVKON_SOFTKEYS_OK_CANCEL__OK;    
-    editor_resource_id = r_setting_visibility_time_slider;
-    }
- 
-
-//----------------------------------------------------
-//  r_gs_btui_view_caption 
-// 
-// Btui view caption for GS plugin
-//----------------------------------------------------
-//
-RESOURCE TBUF r_gs_btui_view_caption
-    {
-    buf = qtn_set_folder_bluetooth;
-    }
-
-//----------------------------------------------------
-//
-//  The main view of the BTUI as GS plugin
-//
-//----------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_btui_main_view_gs_plugin
-    {
-    hotkeys = r_btui_hotkeys;
-    menubar = r_btui_menubar_main_view;
-    cba     = r_btui_softkeys_options_back__change;   
-    }
-    
-RESOURCE CBA r_btui_softkeys_options_exit__change
-    {
-    buttons =
-        {
-        CBA_BUTTON
-            {
-            id = EAknSoftkeyOptions;
-            txt = text_softkey_option; 
-            },
-        CBA_BUTTON
-            {
-            id = EAknSoftkeyExit;
-            txt = text_softkey_exit; 
-            },
-        CBA_BUTTON 
-            {
-            id = EBTUICmdMSK ;
-            txt = qtn_msk_change; 
-            }
-            
-        };
-    }    
-
-//----------------------------------------------------
-// Audio connection confirmation query 
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_bt_connect_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout    = EConfirmationLayout;
-                animation = R_QGN_NOTE_QUERY_ANIM;
-                };
-            }
-        };
-     }
-     
-// === BLOCKED DEVICES VIEW ===================================================
-
-//----------------------------------------------------
-//
-//  This view shows all blocked Bluetooth devices.(for GS)
-//
-//----------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_btui_block_devices_view_gs
-    {
-    hotkeys = r_btui_hotkeys;
-    menubar = r_btui_menubar_block_devices_view;
-    cba     = r_btui_softkeys_options_back__unblock ;
-    }
-
-//----------------------------------------------------
-//
-//  The menubar buttons for blocked devices view
-//  MSK is dimmed when needed.
-//
-//----------------------------------------------------
-//
-
-
-RESOURCE CBA r_btui_softkeys_options_back__unblock
-    {
-    buttons =
-        {
-        CBA_BUTTON
-            {
-            id = EAknSoftkeyOptions;
-            txt = text_softkey_option; 
-            },
-        CBA_BUTTON
-            {
-            id = EAknSoftkeyBack;
-            txt = text_softkey_back; 
-            },
-        CBA_BUTTON 
-            {
-            id = EBTUICmdUnblock ;
-            txt = qtn_msk_delete ;
-            }
-            
-        };
-    }
-    
-//----------------------------------------------------
-//
-//  This view shows all blocked Bluetooth devices.(bt application) 
-//
-//----------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_btui_block_devices_view
-    {
-    hotkeys = r_btui_hotkeys;
-    menubar = r_btui_menubar_block_devices_view;
-    cba     = r_btui_softkeys_options_exit__unblock ;
-    }
-
-//----------------------------------------------------
-//
-//  The menubar buttons for blocked devices view
-//  MSK is dimmed when needed.
-//
-//----------------------------------------------------
-//
-
-
-RESOURCE CBA r_btui_softkeys_options_exit__unblock
-    {
-    buttons =
-        {
-        CBA_BUTTON
-            {
-            id = EAknSoftkeyOptions;
-            txt = text_softkey_option; 
-            },
-        CBA_BUTTON
-            {
-            id = EAknSoftkeyExit;
-            txt = text_softkey_exit;
-            },
-        CBA_BUTTON 
-            {
-            id = EBTUICmdUnblock ;
-            txt = qtn_msk_delete ;
-            }
-            
-        };
-    }
-    
-//----------------------------------------------------
-//
-//  The menubar for other blocked devices view
-//
-//----------------------------------------------------
-//
-RESOURCE MENU_BAR r_btui_menubar_block_devices_view
-    {
-    titles =
-        {
-        MENU_TITLE { menu_pane = r_btui_app_menu; txt = ""; },
-        MENU_TITLE { menu_pane = r_btui_block_devices_view_menu; txt = ""; }
-        };
-    }
-
-
-//----------------------------------------------------
-//
-//  The blocked devices view options
-//
-//----------------------------------------------------
-//
-RESOURCE MENU_PANE r_btui_block_devices_view_menu
-    {
-    items =
-        {
-        MENU_ITEM { command = EBTUICmdUnblock;    	txt = qtn_bt_delete;},
-        MENU_ITEM { command = EBTUICmdUnblockAll;   txt = qtn_bt_delete_all; }
-        };
-    }
-
-//-----------------------------------------------
-//Title for blocked device view    
-//------------------------------------------------
-//
-RESOURCE TBUF r_bt_title_blocked_dev { buf = qtn_bt_title_blocked_devices; }
-// empty listy
-RESOURCE TBUF r_bt_no_blocked_devices { buf = qtn_bt_no_blocked_devices; }
-// Information note "Disconnect %0U device and %1U device first"
-//----------------------------------------------------
-//
-RESOURCE TBUF r_bt_disconnect_first_stereo_prompt { buf = qtn_bt_disconnect_first_stereo; }
-
-
-RESOURCE TBUF r_bt_warn_erase_blocked
-{
-	buf=qtn_bt_warn_erase_blocked;
-}
-RESOURCE TBUF r_bt_warn_erase_all_blocked
-{
-	buf=qtn_bt_warn_erase_all_blocked;
-}
-
-RESOURCE DIALOG r_bt_generic_query
-    {
-    flags   = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
-    items   =
-        {
-        DLG_LINE
-            {
-            type    = EAknCtQuery;
-            id      = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout    = EConfirmationQueryLayout;
-                animation = R_QGN_NOTE_QUERY_ANIM;
-                };
-            }
-        };
-    }      
-
-RESOURCE TBUF r_bt_option_block_device_header  
-{
-	buf=qtn_bt_block_device_header     ;
-}
-RESOURCE TBUF r_bt_option_block_paired_device_help
-{
-		buf= qtn_bt_block_paired_device "\n\n" qtn_bt_block_device_link;
-}
-
-RESOURCE TBUF r_bt_option_block_paired_device_nohelp
-{
-		buf=qtn_bt_block_paired_device;
-}
-
-RESOURCE TBUF r_bt_option_block_connected_paired_devices_help
-{
-		buf= qtn_bt_block_connected_paired_devices "\n\n" qtn_bt_block_device_link;
-}
-
-RESOURCE TBUF r_bt_option_block_connected_paired_devices_nohelp
-{
-		buf= qtn_bt_block_connected_paired_devices ;
-}
-RESOURCE TBUF r_bt_block_device_link
-	{
-		buf=qtn_bt_block_device_link;
-	}
-	
-RESOURCE DIALOG r_bt_message_query 
-    {
-    flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
-    buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
-    items=
-        {
-		DLG_LINE 
-	        {
-            type = EAknCtPopupHeadingPane;
-            id = EAknMessageQueryHeaderId;
-            control = AVKON_HEADING
-                {
-                label = header_not_defined;
-                };
-            },
-        DLG_LINE
-            {
-            type = EAknCtMessageQuery;
-            id = EAknMessageQueryContentId;
-            control = AVKON_MESSAGE_QUERY
-                {
-                };
-            }
-        };
-    }
-
-RESOURCE TBUF r_cp_detail_bt_off { buf= qtn_cp_detail_bt_off; }   
-RESOURCE TBUF r_cp_detail_bt_on_shown {	buf= qtn_cp_detail_bt_on_shown; }	
-RESOURCE TBUF r_cp_detail_bt_on_hidden {	buf= qtn_cp_detail_bt_on_hidden; }	
-RESOURCE TBUF r_cp_detail_bt_conn_shown {	buf= qtn_cp_detail_bt_conn_shown; }	
-RESOURCE TBUF r_cp_detail_bt_conn_hidden {	buf= qtn_cp_detail_bt_conn_hidden; }	
-
-RESOURCE TBUF r_bt_ssp_incorrect_passcode { buf = qtn_bt_simple_incorrect_passcode;}
-RESOURCE TBUF r_bt_ssp_passcode_retry { buf = qtn_bt_simple_passcode_retry; }
-
-// End of File
--- a/bluetoothengine/btui/Ecom/group/BtuiPlugin.mmp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-/*
-* 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 views of BTUI.
-*
-*/
-
-
-#include <platform_paths.hrh>
-#include <data_caging_paths.hrh>
-#include <bldvariant.hrh>
-
-
-CAPABILITY          CAP_ECOM_PLUGIN NetworkControl
-TARGET              BtuiPlugin.dll 
-TARGETTYPE          PLUGIN
-UID                 0x10009D8D 0x1020742B // UPDATE THIS
-VENDORID            VID_DEFAULT
-
-//********* UIDs *************
-//0x1020742B 	//DLL UID
-//0x1020742C 	//Impl1. UID
-//0x1020745C	//impl2. UID
-//0x1020745D	//impl3. UID 
-//****************************
-
-SOURCEPATH      ../src
-SOURCE          BTUIMainContainer.cpp
-SOURCE          BTUIMainView.cpp
-SOURCE          BTUIViewsCommonUtils.cpp
-SOURCE          BTUIKeyWatcher.cpp
-SOURCE          BTUIActive.cpp
-
-#ifdef __BT_SAP
-SOURCE          BTUISap.cpp
-#else
-SOURCE          BTUINonSap.cpp
-#endif
-
-SOURCE          BTUIBlockedDevicesView.cpp
-SOURCE          BTUIPairedDevicesView.cpp
-SOURCE          BTUIDeviceContainer.cpp
-SOURCE          BtuiPluginImplementationTable.cpp
-SOURCE          btuipluginman.cpp
-
-//BTUI plugin resource definition
-START RESOURCE  ../data/BtuiViewResources.rss
-HEADER
-TARGETPATH 		RESOURCE_FILES_DIR
-LANGUAGE_IDS
-END  
-
-
-//***********ECOM resource definition******************
-//--Ecom resource TARGET name must be same as DLL name,
-//--otherwise Ecom won't recognise it. 
-//*****************************************************
-START RESOURCE      ../data/1020742B.rss
-TARGET              BtuiPlugin.rsc   
-END 
-
-
-USERINCLUDE     ../inc	
-USERINCLUDE     ../../inc	
-USERINCLUDE	../data //for documents
-
-
-SYSTEMINCLUDE   ../../inc   	//for private API headers (BluetoothEngine subsystem)
-SYSTEMINCLUDE   ../../../inc    //for internal API headers (localconnectivity)
-APP_LAYER_SYSTEMINCLUDE
-
-SYSTEMINCLUDE   /epoc32/include/ecom
-
-#ifdef __SERIES60_HELP
-SYSTEMINCLUDE   /epoc32/include/cshelp
-#endif
-LIBRARY         btdevmodel.lib	// Model of BTUI 
-LIBRARY         btengdiscovery.lib	// device search
-LIBRARY         btengsettings.lib	// main settings view
-LIBRARY			btengdevman.lib		// sap name,PairedDevicesView,Blocked devices view
-LIBRARY			btengconnman.lib	// sap address, connect/disconnect device
-LIBRARY			btmanclient.lib		// TBTRegistrySearch for sap address
-LIBRARY         euser.lib apparc.lib cone.lib       // Symbian OS framework libraries
-LIBRARY         eikcore.lib eikcoctl.lib eikctl.lib // UIKON libraries
-LIBRARY         avkon.lib                           // Series 60 UI library
-LIBRARY         bafl.lib                            // Basic Application Framework Library
-LIBRARY         btdevice.lib                        // Bluetooth device handling routines
-LIBRARY         bluetooth.lib                       // Bluetooth device address handling routines
-LIBRARY         commonengine.lib                    // Series 60 common components library publish & subsribe and string loader
-LIBRARY         aknnotify.lib                       // Avkon global notes
-LIBRARY         AknSkins.lib                        // Skinned icons
-LIBRARY         aknicon.lib
-LIBRARY         centralrepository.lib               // Central Repository
-LIBRARY         FeatMgr.lib
-LIBRARY         ecom.lib
-LIBRARY         charconv.lib
-LIBRARY         esock.lib
-
-LIBRARY     	GSEcomPlugin.lib
-LIBRARY         GSFramework.lib
-
-// For cover display support:
-LIBRARY         eikdlg.lib
-LIBRARY         estor.lib
-
-
-#ifdef __BT_SAP
-//LIBRARY         BTSap.lib
-#endif
-                
-DEBUGLIBRARY    flogger.lib                         // File logging services
-
-#ifdef __SERIES60_HELP
-LIBRARY         hlplch.lib                          // Help library
-#endif
-
-LIBRARY         egul.lib 
-LIBRARY         btfeatures.lib
-
-// This is optional - used only by Codewarrior IDE for .RSS file editing.
-//DOCUMENT            ../data/1020742B.rss 
-//DOCUMENT            ../data/BtuiViewResources.rss
-
-//**** End of .mmp *****
--- a/bluetoothengine/btui/Ecom/group/bld.inf	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, 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 project information required for BTUI/ECOM.
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-
-PRJ_EXPORTS
-
-PRJ_MMPFILES
-./BtuiPlugin.mmp 
-
-  
-//---End of File---  
--- a/bluetoothengine/btui/Ecom/inc/BTUIActive.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 helper class.
-*
-*/
-
-
-
-#ifndef BTUIACTIVE_H
-#define BTUIACTIVE_H
-
-
-#include <e32base.h>
-
-class CBTUIActive;
-
-/**
- *  Class MBTUIActiveObserver
- *
- *  Callback class for receiving a completed active object event.
- *  Users of CBTUIActive need to derive from this class. 
- * 
- *  @since S60 v5.0
- */
-class MBTUIActiveObserver
-    {
-
-public:
-
-    /**
-     * Callback to notify that an outstanding request has completed.
-     *
-     * @since S60 v5.0
-     * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
-     * @param aStatus The status of the completed request.
-     */
-    virtual void RequestCompletedL( CBTUIActive* aActive, TInt aId, 
-                                    TInt aStatus ) = 0;
-
-    /**
-     * Callback to notify that an error has occurred in RunL.
-     *
-     * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
-     * @param aStatus The status of the completed request.
-     */
-    virtual void HandleError( CBTUIActive* aActive, TInt aId, 
-                                    TInt aError ) = 0;
-
-    };
-
-
-/**
- *  Class CBTUIActive
- *
- *  Base clase for active objects used in BTUI
- *
- *  @since S60 v5.0
- */
-NONSHARABLE_CLASS( CBTUIActive ) : public CActive
-    {
-
-public:
-
-    /**
-     * Two-phase constructor
-     *
-     * @since S60 v5.0
-     * @param aObserver Pointer to callback interface that receives notification
-     *                  that the request has been completed.
-     * @param aId The request ID
-     * @param aPriority Active Object Priority 
-     * @return Pointer to the constructed CBTUIActive object.
-     */
-    static CBTUIActive* NewL( MBTUIActiveObserver* aObserver, 
-                                TInt aId, TInt aPriority );
-
-    /**
-     * Destructor
-     */
-    virtual ~CBTUIActive();
-
-    /**
-     * Get the request ID of this active object.
-     *
-     * @since S60 v5.0
-     * @return The request ID of this active object.
-     */
-    TInt RequestId();
-    
-    /**
-     * Set a new request ID for this active object.
-     *
-     * @since S60 v5.0
-     * @param The new request ID of this active object.
-     */
-    void SetRequestId( TInt aId );
-    
-    /**
-     * Activate the active object.
-     *
-     * @since S60 v5.0
-     */
-    void GoActive();
-
-    /**
-     * Cancel an outstanding request.
-     *
-     * @since S60 v5.0
-     */
-    void CancelRequest();
-
-    /**
-     * Get a reference to the active object request status.
-     *
-     * @since S60 v5.0
-     * @return Reference to the active object request status.
-     */
-    TRequestStatus& RequestStatus();
-
-// from base class CActive
-
-    /**
-     * From CActive.
-     * Called by the active scheduler when the request has been cancelled.
-     *
-     * @since S60 v5.0
-     */
-    void DoCancel();
-
-    /**
-     * From CActive.
-     * Called by the active scheduler when the request has been completed.
-     *
-     * @since S60 v5.0
-     */
-    void RunL();
-
-    /**
-     * From CActive.
-     * Called by the active scheduler when an error in RunL has occurred.
-     * Error handling is really done by callback in HandleError().
-     *
-     * @since S60 v5.0
-     * @param aError Error occured in Active Object's RunL().
-     * @return KErrNone. 
-     */
-    TInt RunError( TInt aError );
-
-private:
-
-    /**
-     * C++ default constructor
-     *
-     * @since S60 v5.0
-     * @param aObserver Pointer to callback interface that receives notification
-     *                  that the request has been completed.
-     * @param aId ID of the request (for the client to keep track of multiple 
-     *            active objects).
-     * @param aPriority Priority of 
-     */
-    CBTUIActive( MBTUIActiveObserver* aObserver, TInt aId, TInt aPriority );
-
-    /**
-     * Symbian 2nd-phase constructor
-     *
-     * @since S60 v5.0
-     */
-    void ConstructL();
-
-private: // data
-
-    /**
-     * ID of the request (used only by our client).
-     */
-    TInt iRequestId;
-
-    /**
-     * Our observer.
-     * Not own.
-     */
-    MBTUIActiveObserver* iObserver;
-
-    };
-
-
-#endif // BTUIACTIVE_H
--- a/bluetoothengine/btui/Ecom/inc/BTUIBlockedDevicesView.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,176 +0,0 @@
-/*
-* 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:  The view that handles paired devices.
-*
-*/
-
-#ifndef BTUIBLOCKEDDEVICESVIEW_H
-#define BTUIBLOCKEDDEVICESVIEW_H
-
-#include <aknview.h>
-#include <eikmenup.h>       // Menu pane definitions
-#include <btengdevman.h>
-#include "BtuiPluginInterface.h"
-#include "BTUIListedDevicesView.h"
-#include <gstabbedview.h>
-
-
-class CGSTabHelper;
-class CBTUIMainView;  //base view
-class CBTUiDeviceContainer;        
-class CBTDevModel;
-
-/**
-* Blocked devicew view of the pluetooth application.
-*
-* This view handles lists of blocked devices and the abolity to unblock them.
-*
-*@lib BTUIPlugin.dll
-*@since S60 v3.2
-*/
-class CBTUIBlockedDevicesView : public CBTUIListedDevicesView,
-		                      public MGSTabbedView 
-
-    {
-    public: // New functions
-		
-		/**
-        * Symbian 2nd phase constructor.
-        */       
-        void ConstructL( );
-        
-		/**
-        * Symbian 2nd phase constructor when serve as GS plugin.
-        * @param aBaseView, GS base view pointer.
-        * @param aTabViewArray, the array which contains all the tabed views' pointer.
-        * @return None. 
-        */         
-        void ConstructL( CBTUIMainView* aBaseView, CArrayPtrFlat<MGSTabbedView>* aTabViewArray );
-        
-        /*
-        * ECOM implementation instantiation factory function of 
-        * interface "CBtuiPluginInterface", to be used by BTUI Application.
-        */        
-        static CBTUIBlockedDevicesView* NewL(MBtuiPluginViewActivationObserver* aObserver = NULL);
- 
- 		/**
-        * Symbian 2 phase constructor used by base view when serve as GS plugin.
-       	* @param aBaseView, GS base view pointer.
-        * @param aTabViewArray, the array which contains all the tabed views' pointer.        
-        * @return None.
-        */ 		
-        static CBTUIBlockedDevicesView* NewLC(CBTUIMainView* aBaseView, 
-        					CArrayPtrFlat<MGSTabbedView>* aTabViewArray);  
-        					         
-		/**
-        * Destructor.
-        */
-        virtual ~CBTUIBlockedDevicesView();       
-        
-            
-        /**
-        * From MGSTabbedView:
-        * Creates new icon for tab. Ownership is transferred to client.
-        * @since 3.1
-        */       	
-    	CGulIcon* CreateTabIconL();
-    	
-    public: // Functions from base classes
-        
-        /**
-        * From CAknView Returns view id.
-        * @param None.
-        * @return View id.
-        */
-        TUid Id() const;
-
-        /**
-        * From CAknView Handles user commands.
-        * @param aCommand A command id.        
-        * @return None.
-        */
-        void HandleCommandL(TInt aCommand);
-        
-		/** Dim/unDim middleSoftkey.
-		 * This function is called by CBTUiDeviceContainer
-		 * durings screen refreshes based on if there are devices or not.
-         *
-		 * @param aDimmed. If this is true the middleSoftKey is invisible. 
-		 */
-		void DimMskL(TBool aDimmed);
-		
-        /**
-        * From CAknView Dynamically initialises options menu.
-        * @param aResourceId Id identifying the menu pane to initialise.
-        * @param aMenuPane The in-memory representation of the menu pane.
-        * @return None.
-        */
-        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);    
-            
-    public:
-    	/**
-        * Informs the observer that adevice has been changes or a new device added.
-        * @param aErr Symbian error code
-        * @param aDevice the device which is changed.  If iAddr == 0, it's for notifiying "GetAllDevices()", 
-        * @param aEnable True: pair/authorize/block/connect; False: unpair/unauthorize/unblock/disconnect
-        * @param aDevNameArray hold conflicting devices' short names if "AlreadyExist" error happened during "connect"
-        * @return None.
-        */    
-  		void NotifyChangeDeviceComplete(const TInt aErr, const TBTDevice& aDevice, 
-          											const RBTDevNameArray* aDevNameArray = NULL);        
-          
-		/** Updates the shown device list. This module will send this list forward
-		 * to container that takes care of the actual display of those devices
-		 *
-		 *@param aDevices all the devices to be shown
-		 *@param aSelectedItemIndex currently selected item after refresh.
-		 */
-		void RefreshDeviceList(const RDeviceArray* aDevices,TInt aSelectedItemIndex);
-
-	protected:		
-        /**
-        * C++ default constructor.
-        */
-        CBTUIBlockedDevicesView (MBtuiPluginViewActivationObserver* aObserver= NULL);	
-
-    private: // Functions from base classes
-
-        /**
-        * From CAknView Activates view.
-        * @param aPrevViewId Id of previous view.
-        * @param aCustomMessageId Custom message id.
-        * @param aCustomMessage Custom message.
-        * @return None.
-        */
-        void DoActivateL( const TVwsViewId& aPrevViewId,
-                                TUid aCustomMessageId,
-                          const TDesC8& aCustomMessage );
-
-        /**
-        * From CAknView Deactivates view.        
-        * @param None.
-        * @return None.
-        */
-        void DoDeactivate();       
-       
-    private: // Data
-        
-        CGSTabHelper* 					iTabHelper;
-	    CBTUIMainView*					iBaseView; 
-		TBool							iConstructAsGsPlugin;	// Flag that indicate this obj is served as GS plugin not BTUI app's plugin.    
-		MBtuiPluginViewActivationObserver* iActivationObserver; // view activation observer
-    };
-
-#endif
-
--- a/bluetoothengine/btui/Ecom/inc/BTUIDeviceContainer.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,206 +0,0 @@
-/*
-* 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:  The view that handles paired devices.
-*
-*/
-#ifndef BTUIDEVICECONTAINER_H
-#define BTUIDEVICECONTAINER_H
-
-#include <aknview.h>                // AVKON components
-#include <aknlists.h>
-#include <aknPopup.h>               // Commands popup window
-#include <eikclbd.h>                // For column listbox access
-#include <AknIconArray.h>
-
-#include "btdevmodel.h"
-#include "btui.hrh"
-
-class CBTEngConnMan;
-class CAknView;
-class CBTDevModel;
-class CBTUIListedDevicesView;
-
-/**
-* This class displays lists of bluetooth devices.
-*
-* This class is used by blocked devices view and paired devices view to show
-* lists of blocked or paired devices.
-*
-*@lib BTUIPlugin.dll
-*@since S60 v3.2
-*/
-NONSHARABLE_CLASS(CBTUiDeviceContainer) : public CCoeControl, 
-			public MCoeControlObserver,
-			public MEikListBoxObserver  
-    {
-    public: // Constructors and destructor
-
-        /** Create new instance
-	     * @param aView PairedDevicesView or BlockedDevicesView.
-	     * @param aStorage The handler of 
-	     * @param aContainerMode are we serving as blocked or paired device list		
-	     * @param aParent used by SetMopParent
-		 */	
-		static CBTUiDeviceContainer* NewL(const TRect& aRect, 
-			CBTUIListedDevicesView* aView, TBTDeviceGroup aGroup, MObjectProvider* aParent);
-
-		/**
-        * Destructor.
-        */
-        virtual ~CBTUiDeviceContainer();
-
-    public: // Methods ralated devicelist upkeep.
-
-	     /** Refreshes this container to show these devices.
-	     * Note: This container will not refresh screen if the listed
-	     * devices have not changed.
-	     *@param aDeviceArray The items to be displayed
-	     *@param aSelectedItem which one of the items is selected after the refresh. 
-	     *Must be between 0 and aDeviceArray.Count()-1 or -1 if the list is empty.
-	     */
-	    void RefreshDeviceListL(const RDeviceArray* aDeviceArray,TInt aSelectedItem);
-
-	    /** Counts how many devices this container displays.     
-	     * @return the amount of items in this container
-	     */
-	    TInt CountItems();
-
-		/** 
-		 * Return the currently selected item index. KErrNotFound found if
-		 * this container has no items and therefore no selected item.
-		 *
-		 * @return index of currently selected item, or KErrNotFund if none.
-		 */
-		TInt CurrentItemIndex() ;   
-
-   	private: 
-		/** 2nd phase constructor 
-	     * @param aView PairedDevicesView or BlockedDevicesView.
-	     * @param aStorage The handler of 
-	     * @param aContainerMode are we serving as blocked or paired device list		
-	     * @param aParent used by SetMopParent		
-		*/
-		void ConstructL(const TRect& aRect, CBTUIListedDevicesView* aView, TBTDeviceGroup aGroup);
-
-        /**
-        * From CoeControl Responds to size changes. 
-        * Sets the size and position of the contents of this control.
-        * @param None.
-        * @return None.
-        */
-        void SizeChanged();
-
-        /**
-        * From CoeControl Gets the number of controls contained 
-        * in a compound control.        
-        * @param None.
-        * @return The number of component controls contained by this control.
-        */
-        TInt CountComponentControls() const;
-
-        /**
-        * From CoeControl Gets the specified component of a compound control.
-        * @param aIndex The index of the control to get.
-        * @return Reference to the component control.
-        */
-        CCoeControl* ComponentControl(TInt aIndex) const;
-
-        /**
-        * From CoeControl Draws the control.
-        * @param aRect The region of the control to be redrawn.
-        * @return None.
-        */
-        void Draw(const TRect& aRect) const;
-
-        /**
-        * From CoeControl Handles key events.
-        * @param aKeyEvent The key event that occurred.
-        * @param aType The event type.
-        * @return Response to the key event.
-        */
-        TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);        
-        
-        /**
-        * From MCoeControlObserver Handles an event from an observed control.
-        * @param aControl The control that sent the event.
-        * @param aEventType The event type.
-        * @return None.
-        */
-        void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
-
-		/** returns help context or empty context, if help is not supported 
-		 */
-		void GetHelpContext(TCoeHelpContext& aContext) const;
-        
-        /**
-		* From CCoeControl
-		*
-		* Handles a change to the control's resources.
-		*/
-		void HandleResourceChange( TInt aType );
-
-		/**
-        * From CCoeControl 
-        *
-        * Responds to a change in focus.
-        */
-		void FocusChanged(TDrawNow aDrawNow);
-		
-		/**
-        * From MEikListBoxObserver Handles list box events.
-        * 
-        * This is used to handle touch screen double click.
-        *
-        * @param aListBox The originating list box.
-        * @param aEventType The event type.
-        * @return None.
-        */
-        void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
-		
-
-		/** Create descriptor representation of given device
-		 * @param aDevice The device to be represented
-		 * @param aListItem where the representation will be written.
-		 */   
-		void CreateListItemL(const TBTDevice& aDevice, TBTDeviceName& alistItem);
-
-		/**
-	    * Creates and adds local bitmap to icon array.
-	    * @param aID Item ID of the masked bitmap to be created.
-	    * @param aFilename Filename to be used to construct the item.
-	    * @param aBitmapId The ID if bitmap 
-	    * @param aMaskId The ID of bitmap's mask
-		* @param aIconList The icon list for BT devices listbox.
-	    */
-	    void CreateAndAppendIconL( const TAknsItemID& aID,
-			     				   const TDesC& aFileName,
-								   const TInt aBitmapId,
-								   const TInt aMaskId,
-								   CAknIconArray* aIconList);
-	    /**
-	     * Internal leave function called by HandleResourceChange()
-	     * @param aType Type of resource change
-	     */
-	    void HandleResourceChangeL( TInt aType );
-	    
-    private: 
-        CAknSingleGraphicStyleListBox*  	iDeviceList;      // Other paired BT-devices list
-		CBTUIListedDevicesView*				iView;			// The reference to PairedDevicesView or BlockedDevicesView
-		TBTDeviceGroup						iGroup; 		// are we operating blocked or paired devices container
-
-	};
-
-#endif
-
-
--- a/bluetoothengine/btui/Ecom/inc/BTUIKeyWatcher.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
-* 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:  Watcher for PubSub and CenRep keys.
-*
-*/
-
-
-#ifndef CBTUIKEYWATCHER_H
-#define CBTUIKEYWATCHER_H
-
-#include <e32property.h>
-#include <centralrepository.h>
-#include "BTUIActive.h"
-
-//  Identification for key and active object to be watched
-const TInt KBTUIPHYCountWatcher = 0x01;
-
-/**
- *  Class CBTUIKeyWatcher
- *
- *  Notify and handle the key values' change.
- *
- *  @since S60 v5.0
- */
-class CBTUIKeyWatcher : public CBase, public MBTUIActiveObserver
-    {
-
-public:
-
-    /**
-     * Two-phase constructor
-	 * 
-	 * @param aCaller The one calls this class.
-	 * @param aServiceID Identify which key to be listened to. 
-	 *                   It can be a logical AND value when listening to multiple keys. 
-     */
-    static CBTUIKeyWatcher* NewL( TAny* aCaller, TInt aServiceID);
-
-    /**
-     * Destructor
-     */
-    virtual ~CBTUIKeyWatcher();
-
-    /**
-     * From MBTUIActiveObserver.
-     * Notification that a key value has changed.
-     *
-     * @since S60 v5.0
-     * @param aActive Active object for the key which value changed.
-     * @param aId Identification for key, defined in this file.
-     * @param aStatus Request status
-     */
-    void RequestCompletedL( CBTUIActive* aActive, TInt aId, TInt aStatus );
-
-    /**
-     * From MBTUIActiveObserver.
-     * Notification that a key value has changed.
-     *
-     * @since S60 v5.0
-     * @param aActive Active object for the key which value changed.
-     * @param aId Identification for key, defined in this file.
-     * @param aError Error occured in Active Object's RunL().
-     */
-    void HandleError( CBTUIActive* aActive, TInt aId, TInt aError );
-
-private:
-
-    /**
-     * C++ default constructor
-     * @param aCaller The one calls this class.
-     */
-    CBTUIKeyWatcher( TAny* aCaller );
-
-    /**
-     * Symbian 2nd-phase constructor
-     * @param aServiceID Identify which key to be listened to. It can 
-	 *        be a logical AND value when listening to multiple keys. 
-     */
-    void ConstructL( TInt aServiceID );
-
-private: // data
-   	
-   	/**
-     * Property containing count of physical BT connections.
-     * When physical connections exists, specific BT UI indicator is shown.
-     */
-    RProperty iPHYCountKey;
-          
-    /**
-     * Active object for listening to above keys' change.
-     * Own.
-     */    
-    CBTUIActive* iPHYCountWatcher;
-    
-    /**
-     * Our caller view.
-     * Not own.
-     */
-    TAny* iCaller; 
-   
-    };
-
-#endif // CBTUIKEYWATCHER_H
--- a/bluetoothengine/btui/Ecom/inc/BTUIListedDevicesView.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
-* 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:  The view that handles paired devices.
-*
-*/
-
-#ifndef BTUILISTEDDEVICESVIEW_H
-#define BTUILISTEDDEVICESVIEW_H
-
-#include "BtuiPluginInterface.h"
-#include "BTUIDeviceContainer.h"
-#include "btdevmodel.h"
-#include "BTUIViewsCommonUtils.h"
-
-/**
-* SuperClass of PairedDevicesView and BlockedDevicesview.
-*
-* This defines functionality common to PairedDevicesView and BlockedDevicesview.
-*
-*@lib BTUIPlugin.dll
-*@since S60 v3.2
-*/
-class CBTUIListedDevicesView : public CBtuiPluginInterface,
-		                     public MBTDeviceObserver,
-		                     public TBTUIViewsCommonUtils		                      
-		                      
-    {
-    public:
-
-	    /** Checks if there a device change operation
-	     * ongoing.
-	     * @return ETrue if there is. EFalse otherwise
-	     */    	
-    	TBool DeviceChangeInProgress()
-    		{
-   			return iModel && iModel->DeviceChangeInProgress();
-    		}
-    		
-    	/** The index of currently selected item.
-    	 * This function delegates the question to BTUIDevicesContainer.
-    	 * @return the index, or KErrNotFound in the list is empty 
-    	 * or if iContainer is not yet initialized;
-    	 */	
-    	TInt CurrentItemIndex()
-    	{
-    		if(iContainer)
-    			return iContainer->CurrentItemIndex();
-    		else
-    			return KErrNotFound;	
-    	}
-    protected:    
-        CBTUiDeviceContainer* 	iContainer;
-        CBTDevModel* 		  	iModel;
-        TBool					iCoverDisplayEnabled;
-        MBtuiPluginViewActivationObserver*  iActivationObserver;
-    };
-
-#endif
-
-
--- a/bluetoothengine/btui/Ecom/inc/BTUIMainContainer.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,205 +0,0 @@
-/*
-* 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:  Declares container control for application.
-*
-*/
-
-#ifndef BTUIMAINCONTAINER_H
-#define BTUIMAINCONTAINER_H
-
-#include <aknview.h>    // AVKON components
-#include <aknlists.h>
-#include "btui.hrh"
-#include "BTUIMainView.h"
-#include "btengsettings.h"
-
-/**
-* This class handles main view dependent requests from user and 
-* contains listbox for main view items.
-*
-*@lib BTUIPlugin.dll
-*@since S60 v3.0
-*/
-class CBTUIMainContainer : public CCoeControl,
-                           public MCoeControlObserver,
-                           public MEikListBoxObserver
-    {
-    public: // Constructors and destructor
-
-		/**
-        * Symbian 2nd phase constructor.
-        */
-        void ConstructL( const TRect& aRect, CBTUIMainView* aMainView );
-
-		/**
-        * Destructor.
-        */
-        virtual ~CBTUIMainContainer();
-
-
-    public: // New functions
-        
-        /**
-        * Returns the current item index (highlight position) 
-        * for main setting list.
-        * @param None.
-        * @return Current item index.
-        */
-        TInt CurrentItemIndex();
-
-		/**
-        * From MBTUISettingsObserver Handles setting changes.
-        * @param aListItem The changed setting item.
-        * @return None.
-        */
-        void SettingChanged( TBTMainListItemIndexes aListItem );
-        		        
-    private: // Functions from base classes
-        
-        /**
-        * From CoeControl Responds to size changes. 
-        * Sets the size and position of the contents of this control.
-        * @param None.
-        * @return None.
-        */
-        void SizeChanged();
-
-        /**
-        * From CoeControl Gets the number of controls contained 
-        * in a compound control.        
-        * @param None.
-        * @return The number of component controls contained by this control.
-        */
-        TInt CountComponentControls() const;
-
-        /**
-        * From CoeControl Gets the specified component of a compound control.
-        * @param aIndex The index of the control to get.
-        * @return Reference to the component control.
-        */
-        CCoeControl* ComponentControl(TInt aIndex) const;
-
-        /**
-        * From CoeControl Draws the control.
-        * @param aRect The region of the control to be redrawn.
-        * @return None.
-        */
-        void Draw(const TRect& aRect) const;
-
-        /**
-        * From CoeControl Handles key events.
-        * @param aKeyEvent The key event that occurred.
-        * @param aType The event type.
-        * @return Response to the key event.
-        */
-        TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);       
-
-        /**
-        * From MEikListBoxObserver Handles list box events.
-        * @param aListBox The originating list box.
-        * @param aEventType The event type.
-        * @return None.
-        */
-        void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
-
-        /**
-        * From MCoeControlObserver Handles an event from an observed control.
-        * @param aControl The control that sent the event.
-        * @param aEventType The event type.
-        * @return None.
-        */
-        void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType);        
-
-       
-        /**
-        * From CoeControl Gets the control's help context.
-        * @param aContext The control's help context
-        * @return None.
-        */
-        void GetHelpContext(TCoeHelpContext& aContext) const;
-        
-        /**
-		* From CCoeControl
-		*/
-		void HandleResourceChange( TInt aType );
-
-		/**
-        * From CCoeControl 
-        */
-		void FocusChanged(TDrawNow /*aDrawNow*/);
-
-
-    private: // Data
-
-        /**
-        *  Friend class for generating format string for main list.
-        */
-        class TMainListItemArray : public MDesCArray
-	        {
-            public: // Constructors and destructor
-
-		        /**
-		        * C++ default constructor.
-		        */                
-                TMainListItemArray( CDesCArray* aBtAllItemsArray, CBTUIMainView* aMainView,
-                  CBTEngSettings* aBtEngSettings );
-
-            public: // New functions
-
-                /**
-                * Returns number of items in array / main list.
-                * @param None.
-                * @return Number of items.
-                */
-                TInt MdcaCount() const;      
-
-                /**
-                * Returns the current format string for the given item.
-                * @param aIndex Index of the item.
-                * @return Pointer to the format string.
-                */
-                TPtrC MdcaPoint(TInt aIndex) const;
-            private:
-                static void GetSapStatusL( TInt& aStatus );
-        
-            private: // Data
-    
-                // Local BT name format string
-                __MUTABLE TBuf<KBTUIMaxFormattedNameLength> iItemText;
-                
-                // No ownership (reference)
-                CDesCArray& 				iArray;
-                CBTUIMainView*				iMainView;     
-        		CBTEngSettings*				iBtEngSettingsRef;
-         
-            }; 
-        
-        CAknSettingStyleListBox*    iBtMainListBox;		// The setting items list (scrollable)
-        CDesCArray*                 iBtAllItemsArray;   // All format string combinations (ownership)
-        TMainListItemArray*         iBtListItemArray;   // Format strings for list items
-        TInt                        iCurrentItemIndex;  // Current highlighted main list item		
-		CBTUIMainView*				iMainView;			
-		CBTEngSettings*				iBtEngSettingsRef;
-		
-		
-		
-    private: // Friend classes
-        
-        friend class TMainListItemArray;
-
-		 
-
-};
-
-#endif
--- a/bluetoothengine/btui/Ecom/inc/BTUIMainView.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,427 +0,0 @@
-/*
-* 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:  Declares the settings view for BTUI application.
-*
-*/
-
-
-#ifndef BTUIMAINVIEW_H
-#define BTUIMAINVIEW_H
-
-#include "BtuiPluginInterface.h"
-#include "BTUIViewsCommonUtils.h"
-#include "btui.hrh"
-
-#include <aknview.h>        	// AVKON components
-#include <btengconnman.h>       // for disconnect type and connection observer
-#include <btengdomaincrkeys.h>
-#include <btengprivatecrkeys.h>
-#include <btengconstants.h>
-#include <btengdevman.h>
-#include <btengsettings.h>
-#include <bt_sock.h>
-#include <gsplugininterface.h>
-#include <gstabbedview.h>
-#include <eikclb.h>
-#include <ConeResLoader.h>
-
-class CBTUIMainContainer;
-class CBTDevModel;
-class TBTUIViewsCommonUtils;
-class CGSTabHelper;
-class CBTUIKeyWatcher;
-class CAknViewAppUi;
-class MGSTabbedView;
-
-/**
-* Main view of the application.
-*
-* This view handles option activation, 
-* deactivation, commands and dynamic options menus.
-*
-*@lib BTUIPlugin.dll
-*@since S60 v3.0
-*/
-class CBTUIMainView : public CBtuiPluginInterface,
-                      public MBTEngSettingsObserver,
-                      public TBTUIViewsCommonUtils,
-                      public MGSTabbedView 
-    {
-    public: // Constructors and destructor
-
-
-		/**
-        * ECOM implementation instantiation function of 
-        * interface "CBtuiPluginInterface", to be used by BTUI Application.
-        */	            
-        static CBTUIMainView* NewL(MBtuiPluginViewActivationObserver* aObserver= NULL);
-		/**
-        * ECOM implementation instantiation function of 
-        * interface "CGSPluginInterface", to be used by GS application.
-        */
-        static CBTUIMainView* NewGsPluginL();
-
-		/**
-        * Destructor.
-        */
-        virtual ~CBTUIMainView();
-
-        /**
-        * From MGSTabbedView:
-        * Creates new icon for tab. Ownership is transferred to client.
-        * @since 3.1
-        */       
-        CGulIcon* CreateTabIconL();
-
-        /**
-        * From MBTEngSettingsObserver - Called when powerstate is changed
-        * @param TBTPowerStateValue power state
-        * @return None
-        */       
-		void PowerStateChanged( TBTPowerStateValue aState );
-		
-        /**
-        * From MBTEngSettingsObserver - Called when visibility is changed
-        * @param TBTPowerStateValue state of visibility mode
-        * @return None
-        */    		
-		void VisibilityModeChanged( TBTVisibilityMode aState );       
-                
-    protected:
-    
-        /**
-        * C++ default constructor.
-        */
-        CBTUIMainView (MBtuiPluginViewActivationObserver* aObserver= NULL);
-
-		/**
-        * Symbian 2nd phase constructor.
-        */
-        void ConstructL();
-    
-
-    public: // Functions from base classes
-
-        /**
-        * From CAknView Returns view id.
-        * @param None.
-        * @return View id.
-        */
-        TUid Id() const;
-		
-		/**
-        * Calls possibly leaving HandleCommandL function
-        * @param aCommand A command id.        
-        * @return None.
-        */
-        void HandleCommand(TInt aCommand); 		
-        
-		/**
-        * From CAknView Handles user commands.
-        * @param aCommand A command id.        
-        * @return None.
-        */
-        void HandleCommandL(TInt aCommand);
-        
-        /**
-		* Used by BTUIAppUI to Redraw BT name
-		* field.
-		* @param aListItem The changed setting item.
-		* @return None.
-		*/
-		void SettingChangedL( TBTMainListItemIndexes aListItem );
-
-	private: // Functions from base classes
-
-        /**
-        * From CAknView Activates view.
-        * @param aPrevViewId Id of previous view.
-        * @param aCustomMessageId Custom message id.
-        * @param aCustomMessage Custom message.
-        * @return None.
-        */
-        void DoActivateL( const TVwsViewId& aPrevViewId,
-                                TUid aCustomMessageId,
-                          const TDesC8& aCustomMessage );		
-
-        /**
-        * From CAknView Deactivates view.        
-        * @param None.
-        * @return None.
-        */
-        void DoDeactivate();
-
-        /**
-        * From CAknView Dynamically initialises options menu.
-        * @param aResourceId Id identifying the menu pane to initialise.
-        * @param aMenuPane The in-memory representation of the menu pane.
-        * @return None.
-        */
-        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
-        
-        /**
-        * From MProgressDialogCallback Get's called when a dialog is dismissed.        
-        * @param aButtonId Id of the pressed button.
-        * @return None.
-        */
-        void DialogDismissedL( TInt aButtonId );
-
-    public: // New functions
-		
-        /**
-        * Set the power status of Bluetooth.
-        *
-        * @param aValue The new power status.
-        * @return Symbian OS error code.
-        */
-        TInt SetPowerStatusL( TBool aValue );
-
-        /**
-        * Set the visibility mode of Bluetooth.
-        *
-        * @param aMode The new visibility mode.
-        * @return None.
-        */
-        void SetVisibilityStatusL( TBTVisibilityMode aMode );
-        
-
-        /**
-        * Returns the local name of BT Device.
-        *
-        * @param None.
-        * @return The local name.
-        */
-        TDesC* GetBTLocalName();
-          
-        /**
-        * Returns a reference to class CBTEngSettings.
-        *
-        * @param None.
-        * @return A reference to class CBTEngSettings.
-        */        
-        CBTEngSettings* GetBtSettingsReference();     		   
-        
-        /**
-        * Set the SIM Access Profile status .
-        *
-        * @param aValue The new SAP status.
-        */
-        void SetSapStatusL( TBTSapMode aValue );
-        
-        /**
-        * Update its parent's view
-        * @param None.
-        * @return None.
-        */        
-        void UpdateParentView();
-        
-    private:
-        /** takes care of middle softkey press.
-         */
-		void HandleMiddleSoftkey();
-
-         /**
-        * Asks new power mode from user via selection buttons.
-        *
-        * @param None.
-        * @return None.
-        */
-        void AskPowerModeDlgL();
-
-        /**
-        * Asks new visibility mode from user via selection buttons.
-        *
-        * @param None.
-        * @return None.
-        */
-        void AskVisibilityDlgL();
-
-        /**
-        * Asks new local BT Device name from user.
-        *
-        * @param None.
-        * @return None.
-        */
-        void AskNewBtNameDlgL();
-       
-        /**
-        * A callback for launching local BT Device name query.
-        *
-        * @param aAppUi A reference to self.
-        * @return Symbian OS error code.
-        */
-        static TInt LaunchBTLocalNameQueryL(TAny* aAppUi);
-
-        /**
-        * Asks local BT Device name from user at startup.
-        *
-        * @param None.
-        * @return Symbian OS error code.
-        */
-        TInt AskBTLocalNameQueryL();
-
-        /**
-        * Initiates BT local name query after Symbian OS has entered idle state.
-        *
-        * @param None.
-        * @return None.
-        */
-        void InitiateBTLocalNameQueryL();
-		
-        /**
-        * blaa blaa
-        *
-        * @param aNum  count of connectionsions.
-        * @return None.
-        */			
-		TInt GetConnectionNumber(TInt& aNum);
-        
-		/**
-        * Asks new SAP mode from user via selection buttons.
-        *
-        * @param None.
-        * @return None.
-        */
-        void AskSapModeDlgL();
-             
-        /**
-        * Connected sap name
-        *
-        * @param aName
-        * @return TInt.
-        */  	
-		TInt GetConnectedSapNameL( TDes& aName );
-		
-		/**
-        * Get settings' values including power state, discovery mode and connection state
-        * Then set member varient iBtState.
-        */  	
-		void RefreshSettingsStatusL();
-		
-		/**
-		* Internal leave function used by GetValue().
-		*/
-		void GetValueL( const TGSPluginValueKeys aKey, TDes& aValue );
-
-		/**
-		* Checks from central repository whether the Bluetooth friendly name 
-        * has been modified .
-		* @param aStatus
-		* @return error code
-		*/
-		
-		TInt IsLocalNameModifiedL( TBool& aStatus );
-		
-	public: // Enumerations
-	
-	    enum TBTStateSummary
-			{
-			EBTOff = 0,
-			EBTOnShown,
-			EBTOnHidden,
-			EBTConnectedShown,
-			EBTConnectedHidden
-			};
-											
-	private: // from CGSBaseView
-	
-        /**
-        * Handles OK key press.
-        * @since 3.1
-        */
-        void HandleListBoxSelectionL();
-        
-        /**
-        * Creates new container.
-        * @since 3.1
-        */
-        void NewContainerL();
- 
- 
-	public: //Functions from CGSPluginInterface
-	
-        /**
-        * Method for checking plugin's Uid. Uid identifies this GS plugin. Use
-        * same Uid as the ECOM plugin implementation Uid.
-        *
-        * @return PluginUid
-        */
-        TUid PluginUid() const;
-
-        /**
-        * Method for getting caption of this plugin. This should be the 
-        * localized name of the settings view to be shown in parent view.
-        *
-        * @param aCaption pointer to Caption variable
-        */
-        void GetCaptionL( TDes& aCaption ) const;
-
-
-        /**
-        * Creates a new icon of desired type. 
-        * @param aIconType UID Icon type UID of the icon to be created.
-        * @return Pointer of the icon. NOTE: Ownership of this icon is
-        *         transferred to the caller.
-        */
-        CGulIcon* CreateIconL( const TUid aIconType );
-        
-        /**
-        * Function for getting plugin's value for a certain key.
-        * Override to provide own functionality.
-        *
-        * @param aKey Key for the value to be retrieved.
-        * @parem aValue Value for the given gey in TDes format.
-        */
-        void GetValue( const TGSPluginValueKeys aKey, TDes& aValue );
-             
-        /**
-        * Returns sap status
-        *
-        * @param None
-        * @return TInt.
-        */        
-		TInt GetSapStatusL();          
- 
- 		TVwsViewId GetParentView();
- 
-         /**
-        * From MGSTabbedView
-        * @return Reference to owned tabbed views which should be included in 
-        *         the sub-view's tab group.
-        * @since 3.1
-        */
-        CArrayPtrFlat<MGSTabbedView>* TabbedViews();
-    		       	
-    private: // Data
-        CBTUIMainContainer*             iContainer;      	    // Main container           
-        CBTEngSettings*					iBtEngSettings;         // Settings class        
-        CIdle*                          iIdle;              	// Idle time class (for doing operation delayed)
-        TBTDeviceName                   iTempNameBuffer;    	// Temporary storage for BT name        
-        CEikonEnv*                  	iEikEnv;                // Local eikonenv		
-        TInt                        	iResourceFileFlag;      // Flag for eikon env.
-		TBool							iConstructAsGsPlugin;	// Flag that indicate who constrct this obj
-		TBool							iCoverDisplayEnabled;	// Flag that indicate cover UI feature							                			
-
-        CGSTabHelper* 					iTabHelper;
-	    TBool							iParentViewNotSetYet;
-        CArrayPtrFlat<MGSTabbedView>* 	iViewArray; 
-        TVwsViewId 						iParentView; 
-        TBTStateSummary					iBtState;
-        CBTUIKeyWatcher*				iKeyWatcher;
-        MBtuiPluginViewActivationObserver* iActivationObserver; // view activation observer
-    };
-    
-#endif
-
-
--- a/bluetoothengine/btui/Ecom/inc/BTUIPairedDevicesView.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,490 +0,0 @@
-/*
-* 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:  The view that handles paired devices.
-*
-*/
-
-#ifndef BTUIPAIREDDEVICESVIEW_H
-#define BTUIPAIREDDEVICESVIEW_H
-
-#include <aknview.h>
-#include <eikmenup.h>       // Menu pane definitions
-#include <AknWaitDialog.h>
-#include <AknQueryDialog.h>
-#include <btengconstants.h>
-#include <btengdiscovery.h>
-#include "BtuiPluginInterface.h"
-#include "btdevmodel.h"
-#include "BTUIListedDevicesView.h"
-#include "btuipluginman.h"
-#include "BTUIActive.h"
-#include <secondarydisplay/BtuiSecondaryDisplayAPI.h>
-#include <gstabbedview.h>
-
-class CAknNavigationControlContainer;
-class CBTUiDeviceContainer;        
-class CGSTabHelper;
-class CBTEngSettings;
-class CBTUIMainView;
-
-// if there are more connection that this, it is disallowed to
-// connect to any device
-const TInt KBtUiMaxConnections = 6; 
-
-/**
-* Paired devicew view of the pluetooth application.
-*
-* This view handles lists of paired device and pairing new devices, unpairing devices
-* and setting previously paired devices as blocked. Also connecting and disconnecting 
-* are done by using this view.
-*
-*@lib BTUIPlugin.dll
-*@since S60 v3.0
-*/
-class CBTUIPairedDevicesView : public CBTUIListedDevicesView,
-							  public MBTEngSettingsObserver,
-		                      public MProgressDialogCallback,
-		                      public MBTEngSdpResultReceiver, // for bt discovery. SDP is not used
-		                      public MGSTabbedView,
-		                      public MBTUIActiveObserver
-{	
-    public:
-
-		/**
-        * ECOM implementation instantiation function of 
-        * interface "CBtuiPluginInterface", to be used by BTUI Application.
-        */        
-        static CBTUIPairedDevicesView* NewL(MBtuiPluginViewActivationObserver* aObserver = NULL);
-
-		static CBTUIPairedDevicesView* NewLC(CBTUIMainView* aBaseView, CArrayPtrFlat<MGSTabbedView>* aTabViewArray);
-		
-		/**
-        * Symbian 2nd phase constructor.
-        */
-        void ConstructL();
-
-		void ConstructL( CBTUIMainView* aBaseView, CArrayPtrFlat<MGSTabbedView>* aTabViewArray );
-
-		/**
-        * Destructor.
-        */
-        virtual ~CBTUIPairedDevicesView();
-
-        /**
-        * From MGSTabbedView:
-        * Creates new icon for tab. Ownership is transferred to client.
-        * @since 3.1
-        */       
-        CGulIcon* CreateTabIconL();        
-
-    public: // Functions from base classes
-        
-        /**
-        * From CAknView Returns view id.
-        * @param None.
-        * @return View id.
-        */
-        TUid Id() const;
-
-        /**
-        * From CAknView Handles user commands.
-        * @param aCommand A command id.        
-        * @return None.
-        */
-        void HandleCommandL(TInt aCommand);
-
-	protected:		
-        /**
-        * C++ default constructor.
-        */
-        CBTUIPairedDevicesView (MBtuiPluginViewActivationObserver* aObserver= NULL);
-
-    private: // Functions from base classes
-
-        /**
-        * From CAknView Activates view.
-        * @param aPrevViewId Id of previous view.
-        * @param aCustomMessageId Custom message id.
-        * @param aCustomMessage Custom message.
-        * @return None.
-        */
-        void DoActivateL( const TVwsViewId& aPrevViewId,
-                                TUid aCustomMessageId,
-                          const TDesC8& aCustomMessage );
-
-        /**
-        * From CAknView Deactivates view.        
-        * @param None.
-        * @return None.
-        */
-        void DoDeactivate();       
-
-        /**
-        * From CAknView Dynamically initialises options menu.
-        * @param aResourceId Id identifying the menu pane to initialise.
-        * @param aMenuPane The in-memory representation of the menu pane.
-        * @return None.
-        */
-        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
-
-		// implemented from MProgressDialogCallback
-        /** This is used to cancel connecting and pairing, if user presses the Cancel-button.
-        * From MProgressDialogCallback Get's called when a dialog is dismissed.        
-        * @param aButtonId Id of the pressed button.
-        * @return None.
-        */
-        void DialogDismissedL( TInt aButtonId );
-
-	public: // from MBTDeviceObserver
-    	/**
-        * Informs the observer that an error happened in changing device status or a new device added.
-        * @param aErr Symbian error code
-        * @param aDevice the device which is changed.
-        * @param aDevNameArray hold conflicting devices' short names if "AlreadyExist" error happened during "connect"
-        * @return None.
-        */
-		void NotifyChangeDeviceComplete(const TInt aErr, const TBTDevice& aDevice,
-			const RBTDevNameArray* /*aDevNameArray*/ )	;
-    	/**
-        * Leaving version of NotifyChangeDeviceComplete
-        * @param aErr Symbian error code
-        * @param aDevice the device which is changed.
-        * @param aDevNameArray hold conflicting devices' short names if "AlreadyExist" error happened during "connect"
-        * @return None.
-        */
-		void NotifyChangeDeviceCompleteL(const TInt aErr, const TBTDevice& aDevice,
-			const RBTDevNameArray* /*aDevNameArray*/ )	;
-		
-		/** Updates the shown device list. This module will send this list forward
-		 * to container that takes care of the actual display of those devices
-		 *
-		 *@param aDevices all the devices to be shown
-		 *@param aSelectedItemIndex currently selected item after refresh.
-		 */
-		void RefreshDeviceList(const RDeviceArray* aDevices,TInt aSelectedItemIndex);	
-		
-	private: // From MBTUIActiveObserver
-	    
-	    /**
-	     * Callback to notify that an outstanding request has completed.
-	     * @param aActive Pointer to the active object that completed.
-	     * @param aId The ID that identifies the outstanding request.
-	     * @param aStatus The status of the completed request.
-	     */
-	    void RequestCompletedL( CBTUIActive* aActive, TInt aId, 
-	                            TInt aStatus );
-
-	    /**
-	     * Callback to notify that an error has occurred in RunL.
-	     *
-	     * @param aActive Pointer to the active object that completed.
-	     * @param aId The ID that identifies the outstanding request.
-	     * @param aStatus The status of the completed request.
-	     */
-	    void HandleError( CBTUIActive* aActive, TInt aId, 
-	                      TInt aError );
-		
-	public: // Operations to devices not containing confirmation queries
-        /**
-        * Sets the current security setting of the device.
-        * Does not ask user about it.
-        *
-        * @param aTrusted  ETrue when trusted, EFalse if untrusted.
-        * @return None.
-        */
-        void ChangeDeviceSecurityL( TBool aTrusted );
-        		
-        /**
-        * Issues prompts to connects to specified accessory.
-        * Connects to it if user andswers yes.
-        *
-        * @param TBTDevice  connect to this device
-        * @return None.
-        */
-		void ConnectL( const TBTDevice& aDevice, TBool aNewWaitNote );        
-   
-        /**
-        * Disconnects from the selected BT Accessory.
-        *
-        * @param None.
-        * @return None.
-        */
-        void DisconnectL();
-		
-		/**
-        * Removes iDisconnectQueryDlg created in DisconnectL
-        *
-        * @param None.
-        * @return None.
-        */        
-        void CancelDisconnectQueryDlg();
-        
-        /**
-        * Disconnects from the selected BT Accessory without query.
-        *
-        * @param None.
-        * @return None.
-        */        
-        void DisconnectWithoutQuery();
-
-    	/** Checks if there is an active phonecall.
-    	*@return ETrue if there is, EFalse otherwise
-    	*/
-    	TBool CallOnGoing();
-              		
-
-		/** This is used to create TCallBack to help. This is static, since TCallBack does not
-		 * allow instance methods. This is used by BlockDeviceDlgL to add help callback to the query.
-		 *
-		 * @param aTCoeHelpContext. Must be instance TCoeHelpContext, or NULL.
-		 * If this is not specified this will open help about blocked devices.
-		 * This is not an instance of TCoeHelpContext, since TCallback does not allow
-		 * parameters of other type that TAny*.
-		 * @return allways KErrNone. TCallBack does not allow void functions
-		 */
-		static TInt LaunchHelp(TAny *aTCoeHelpContext=NULL);
-
-	private: //These handle command given by user	
-        /**
-        * Asks new nick name for the BT Device from user and
-        * attempt to rename the device. Failures are handled by NotifyChangeDeviceComplete.
-        *
-        * @param None.
-        * @return None.
-        */
-        void RenameDeviceDlgL();
-
-        /**
-        * Asks confirmation for deleting a BT Device from user.
-        * Delete the current device if yes replied yes.
-        *
-        * @param None.
-        * @return None.
-        */
-        void DeleteDeviceDlgL();
-
-        /**
-        * Asks confirmation for deleting all BT devices from user.
-        * Delete the devices if yes replied yes.
-        *
-        * @param None.
-        * @return None.
-        */
-        void DeleteAllDevicesDlgL();
-
-        /**
-        * Initiates the pairing procedure to get a new paired device.
-        * DeviceSearchComplete is called after the dialog is done.
-        *
-        * @param None.
-        * @return None.
-        */
-        void NewPairedDeviceDlgL();
-        
-  		/**
-        * Asks confirmation for Blocking the selected BT Device.
-        * Blocks the current device if yes replied yes.
-        *
-        * @param None.
-        * @return None.
-        */
-		void BlockDeviceDlgL();
-		
-		/**Opens a wait note.
-		 *
-		 *@param dialog. The dialog object to be used for displaying this note.
-		 *@param aNoteResource The resource of the note, not including the text.
-		 *@param aNoteTextResource The text resource. The %U if this note is filled up with aDevName.
-		 *@param aSec SecondaryDisplaycommand
-		 *@param aDevName The dev name filled in aNoteTextResource
-		 */		
-		void OpenWaitNoteL(CAknWaitDialog *&dialog,TUint aNoteResource,TUint aNoteTextResource,
-			TSecondaryDisplayBtuiDialogs aSec,const TDesC& aDevName);
-		
-		/** Open Setting view for peripheral devices
-		 * 
-		 * @param None.
-		 * @return None.
-		 */
-		void LaunchSettingViewL();
-
-	public:	// Inherited from MBTEngSdpResultReceiver
-		
-		
-		/** Inherited from MBTEngSdpResultReceiver and implemented as empty, 
-		 * since this class will not do service searches, only device searches.
-		 */
-		void ServiceSearchComplete( const RSdpRecHandleArray& aResult, 
-			TUint aTotalRecordsCount, TInt aErr ) ;
-		/** Inherited from MBTEngSdpResultReceiver and implemented as empty, 
-		 * since this class will not do attributes seaches, only device searches.
-		 */
-    	void AttributeSearchComplete( TSdpServRecordHandle aHandle, 
-    		const RSdpResultArray& aAttr,TInt aErr ) ;		
-		/** Inherited from MBTEngSdpResultReceiver and implemented as empty, 
-		 * since this class will not do service attribute seaches, only device searches.
-		 */
-	    void ServiceAttributeSearchComplete( TSdpServRecordHandle aHandle,
-	    	const RSdpResultArray& aAttr,TInt aErr );
-
-	  /**
-	    * Provides notification of the result of the discovery of nearby 
-	    * Bluetooth devices. If a device is selected this class will try to pair it.
-		*
-	    * @param aDevice The data structure encapsulates all information 
-	    *                about the selected device. Ownership of the data 
-	    *                structure has not been transfered and is still with
-	    *                the API client.
-	    *				 This is not TBTDevice that is normally used inside the UI.	    
-	    * @param aErr Error code of the device search operation; KErrNone if 
-	    *             sucessful, KErrCancel if the user cancelled the 
-	    *             dialog, KErrAbort if CBTEngDiscovery::CancelSearchRemoteDevice
-	    *             was called; otherwise one of the system-wide error codes.
-	    */
-	    void DeviceSearchComplete( CBTDevice* aDevice, TInt aErr );
-	    
-	    /**
-	     * Provides notification of the result of the discovery of nearby 
-	     * Bluetooth devices and EIR data. If a device is selected this class will try to pair it.
-	     *
-	     * @since S60 v5.1
-	     * @param aDevice The data structure encapsulates information 
-	     *                about the selected device. 
-	     *                Ownership of the data structure has not been transfered and
-	     *                is still with the API client.
-	     * @param aEirWrapper Contains the EIR data of the remote device.
-	     *                Ownership of the data structure has not been transfered and
-	     *                is still with the API client. 
-	     * @param aErr Error code of the device search operation; KErrNone if 
-	     *             sucessful, KErrCancel if the user cancelled the 
-	     *             dialog, KErrAbort if CBTEngDiscovery::CancelSearchRemoteDevice
-	     *             was called; otherwise one of the system-wide error codes.
-	     */	    
-	    void DeviceSearchComplete( CBTDevice* aDevice, 
-	            TNameEntry* aNameEntry, 
-	            TInt aErr );
-	    
-private:	    
-	  /** Leaving version of DeviceSearchComplete.
-		*
-	    * @param aDevice The data structure encapsulates all information 
-	    *                about the selected device. Ownership of the data 
-	    *                structure has not been transfered and is still with
-	    *                the API client.
-	    *				 This is not TBTDevice that is normally used inside the UI.
-	    * @param aEirWrapper Contains the EIR data of the remote device.
-        *                Ownership of the data structure has not been transfered and
-        *                is still with the API client.	    
-	    * @param aErr Error code of the device search operation; KErrNone if 
-	    *             sucessful, KErrCancel if the user cancelled the 
-	    *             dialog, KErrAbort if CBTEngDiscovery::CancelSearchRemoteDevice
-	    *             was called; otherwise one of the system-wide error codes.
-	    */
-	    
-	    void DeviceSearchCompleteL( CBTDevice* aDevice, 
-	            TNameEntry* aNameEntry, TInt aErr );
-	    
-	  /** Shows 'Disonnect first' note
-		*
-	    * @param aDevice 
-	    */	    
-        void ShowDisconnecNoteL(TBTDevice *aDevice);	
-        
-        /**
-         * Auto connect to headset after pairing succeeded.
-         * @param aCount the counter of connecting request issuing staring from 0.
-         */
-        void ConnectIfNeededAfterPairL( TInt aCount );
-        
-	public: // internal methods for informing operation completes	    
-        /**
-        * Informs that pairing attempt of a device has been completed.
-        * Dismisses wait note and displays questions about authorizing and
-        * connecting, if the device is connectable.
-        *
-        * This method is called by ModifyDeviceChangeL. This method will not inform
-        * iContainer about the pairing since that is done by ModifyDeviceChangeL.
-        *
-        * @param aError Status code of the operation.
-        * @param aDeviceIndex the new place of the device in UI
-        * @return None.
-        */  
-	    void BondingCompleteL( TInt aError,const TBTDevice& aDevice);
-	    
-	    /** Informs that attempt to connect to a device is completed. Closes wait
-	     * note and if there was an error shows the error notice.
-	     *
-         * This method is called by ModifyDeviceChangeL. This method will not inform
-         * iContainer about the pairing since that is done by ModifyDeviceChangeL.	    
-         *
-	     * @param aError KErrNone or system wide error code
-	     * @param aDeviceIndex The index of the new device 
-	     * @param aConflictingDeviceName this is filled only when
-	     */    	
-    	void ConnectCompleteL(TInt aError,const TBTDevice& aDevice,
-    	  const RBTDevNameArray* aConflictingDeviceNames=NULL);
-    	  
-    	  
-       /**
-        * From MBTEngSettingsObserver - Called when powerstate is changed
-        * @param TBTPowerStateValue power state
-        * @return None
-        */       
-		void PowerStateChanged( TBTPowerStateValue aState );
-		
-        /**
-        * From MBTEngSettingsObserver - Called when visibility is changed
-        * @param TBTPowerStateValue state of visibility mode
-        * @return None
-        */    		
-		void VisibilityModeChanged( TBTVisibilityMode aState );
-		 
-    	
-    private: // Data
-    
-        CAknWaitDialog*                 iWaitForPairingDlg; 	// Wait note for pairing
-        CAknWaitDialog*                 iWaitForConnectDlg; 	// Wait note for connecting to BT Accessory        
-		CAknQueryDialog* 				iDisconnectQueryDlg;	// Question dialog for disconnecting BT Accessory
-        TBool                           iHelpEnabled; 				// Flag for the Help feature
-		
-		// these are needed so these are owened by someone
-		// and can be cleaned up, in case the operations are interrupted by the user.
-		CBTDevice*						iPairingDevice;
-		TNameEntry                      iPairingDevNameEntry;
-		TBTDevice* 						iConnectDevice; 	//device we are trying to connect to
-		TBTDevice 						iDisconnectQueryDevice; 	//device we are trying to disconnect
-				
-		CBTEngDiscovery*				iDeviceSearcher;	// used only for searching devices, not for device discovery
-		CBTEngSettings*					iBtEngSettings;		// used only for turning on bluetooth, 
-		CBTUIPluginMan* 				iBTPluginMan;		
-        CGSTabHelper* 					iTabHelper;
-	    CBTUIMainView*					iBaseView; 
-		TBool							iConstructAsGsPlugin;	// Flag that indicate this obj is served as GS plugin not BTUI app's plugin.
-        TInt                            iExpectedCallBack;      // In case of DeleteAll, counter for expected callback NotifyChangeDeviceCompleteL()
-        TBool                           iSearchOngoing;        
-        TBool							iIsConnectDevice;
-		MBtuiPluginViewActivationObserver* iActivationObserver; // view activation observer        
-        TBool 							iIsAlreadyConnected; // used only for showing "Connected to" note once for Stereo device 
-        TBTDevice                       iMenuDevice;
-        CEikMenuPane*                   iActiveMenuPane;
-        CBTUIActive*                    iActive;   // used for subscribing notifier lock status
-        TBTDevAddr                      iPairConnectAddr; // the address of the just paired device
-                                                          // with which a connection establishment is pending
-        TBool                           iIsPairConnect; // if we are doing auto-connecting after pairing or not
-
-};
-
-#endif
-
-
--- a/bluetoothengine/btui/Ecom/inc/BTUIRegistryWatcher.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 Registry watcher class for BTUI.
-*
-*/
-
-
-#ifndef CBTUIREGISTRYWATCHERAO_H
-#define CBTUIREGISTRYWATCHERAO_H
-
-// INCLUDES
-
-#include <bt_subscribe.h>
-
-// CLASS DECLARATION
-
-/**
-* A callback interface for informing content change of BT Registry.
-*/
-class MBTUIRegistryObserver
-    {
-    public: // New functions
-
-        /**
-        * Informs the observer that contents of Registry has been changed.
-        * @param None.
-        * @return None.
-        */
-        virtual void RegistryContentChangedL()=0;
-    };
-
-
-// CLASS DECLARATION
-
-/**
-* An active object based class which can used to listen
-* Registry changes
-*/
-class CBTUIRegistryWatcherAO : public CActive
-    {
-    public: // Constructors and destructor
-
-        /**
-        * C++ default constructor.
-        */
-        CBTUIRegistryWatcherAO( MBTUIRegistryObserver* aParent );
-
-        /**
-        * Destructor.
-        */
-        virtual ~CBTUIRegistryWatcherAO();
-
-    public: // New functions
-
-        /**
-        * Starts / continues Registry watching
-        *
-        * @param None.
-        * @return None.
-        */
-        void WatchL();
-
-        /**
-        * Starts / continues Registry watching
-        *
-        * @param None.
-        * @return None.
-        */
-        void StopWatching();
-
-    private: // Functions from base classes
-
-        /**
-        * From CActive Gets called when CActive::Cancel is called, 
-        *              cancels Registry watching.
-        *
-        * @param None.
-        * @return None.
-        */
-        void DoCancel();
-
-        /**
-        * From CActive Gets called when content of Registry is changed, 
-        *              calls MBTUIRegistryObserver::RegistryContentChangedL.
-        *
-        * @param None.
-        * @return None.
-        */
-        void RunL();       
-
-        /**
-        * From CActive Handles a leave occurring in the request completion event.        
-        *
-        * @param aError The leave code.
-        * @return Symbian OS error code.
-        */
-        TInt RunError(TInt aError);
-
-    private: // Data
-
-        // Reference to observer
-        MBTUIRegistryObserver* iParent;
-        // Database handle
-        RProperty iProperty;
-    };
-
-#endif
-
-// End of File
--- a/bluetoothengine/btui/Ecom/inc/BTUIViewsCommonUtils.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
-* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef BTUIVIEWSCOMMONUTILS_H
-#define BTUIVIEWSCOMMONUTILS_H
-
-#include <e32base.h>
-
-class CBTEngSettings;
-/**
-* Utils class which offer common functions that were used by all BTUI views
-*/
-class TBTUIViewsCommonUtils 
-    {
-    public:
-
-        /**
-        * Displays a general error note.
-        *
-        * @param None.
-        * @return None.
-        */
-        static void ShowGeneralErrorNoteL();                     // Display general error note
-        
-        /** Check if there are any bluetooth connections. 
-         *@param None
-         *@return ETrue if there is one or more connections.
-         */
-		static TBool IsAnyDeviceConnectedL();
-		
-		/** Asks user to turn on bluetooth is it it not on.		
-		* @param aBtEngSettings settings object used to turn on the bt.
-		* @param aCoverDisplayEnabled. True if cover display is enabled.
-		* @return KErrNone, if bluetooth is on, or has turned on. KErrCancel if user said no. System wide errorcode otherwise.
-		*/
-		static TInt TurnBTOnIfNeededL(CBTEngSettings* aBtEngSettings,TBool aCoverDisplayEnabled );		
- 	};
- 	
-#endif
\ No newline at end of file
--- a/bluetoothengine/btui/Ecom/inc/bluetoothuiutil.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:   This provides utility for loading a BT device name without
-* localised to a string to be shown in GUI.
-*
-*/
-#include <StringLoader.h>
-
-class BluetoothUiUtil
-    {
-public:
-
-/*
- * Gets the starting position of a key whose pattern matches
- * '%'{(0)*|<n>}<aKey> where 0 and <n> is the decimal value 
- * of the specified position and <aKey> is the symbol of the key, 
- * either 'U' or 'N'.
- * 
- * For example, if the specified position of a number key 
- * is 0, both "%N" and "%0N" match, 
- * but "%1N" doesn't. If the position n is greater than 0, 
- * only "%<n>N" matches.
- * @param aDes the descriptor where a key parameter will be searched.
- * @param aKey the specified key, 'U' or 'N'
- * @param aKeyPos the position of the key. position starts from 0.
- * @param aKeyLength the length of the key at return if the key exists.
- * @return the start position of the key in aDes. KErrNotFound if the key
- *          is not available.
- */
-inline static TInt GetSubstringKeyPos( const TDes& aDes, const TDesC& aKey, 
-        TInt aKeyPos, TInt& aKeyLength );
-
-/*
- * Gets the starting position of a string key whose pattern matches
- * '%'{(0)*|<n>}'U' where 0 and <n> is the decimal value 
- * of the specified position. 
- * 
- * For example, if the specified position is 0, both "%U" and "%0U" match, 
- * but "%1U" doesn't. If the position n is greater than 0, 
- * only "%<n>U" matches.
- * @param aDes the descriptor in which a string key will be searched.
- * @param aKeyPos the position of the string key. position starts from 0.
- * @param aKeyLength the length of the string key at return if the key exists.
- * @return the start position of the string key in aDes. KErrNotFound if the key
- *          is not available.
- */
-inline static TInt GetStringSubstringKeyPos( const TDes& aDes, TInt aKeyPos, TInt& aKeyLength );
-
-/*
- * Add a substring to the specified RBuf descriptor.
- * ( Replace "%<n>U" at the specified position withe the given string.
- * @param aBuf the RBuf descriptor in which a "%<n>U" will be replaced.
- * @param aSub the substring that will replace a "%<n>U".
- * @param aSubPos the position of the "%U" to be replaced. Position starts from 0.
- */
-inline static void AddSubstringL( RBuf& aBuf, const TDesC& aSub, TInt aSubPos);
-
-/*
- * Load a string specified by the given resource ID, 
- * remove substrings that match "[" and ends with "]" and finally
- * replace the "%U" or "%<n>U" at the specified position with the
- * given substring.
- * 
- * This function is intended for adding a Bluetooth device name to a UI 
- * string but without localizing this name.
- * 
- * (Using StringLoader will get the device name localized in some variants. 
- * This is a workaround to tackle the unwanted localization.)
- * 
- * @param aBuf the RBuf descriptor in which a "%<n>U" will be replaced.
- * @param aSub the substring that will replace a "%<n>U".
- * @param aSubPos the position of the "%U" to be replaced. Position starts from 0.
- */
-inline static void LoadResourceAndSubstringL(RBuf& aBuf,
-        TInt aResourceId, const TDesC& aSub, TInt aSubPos );
-    };
-
-#include "bluetoothuiutil.inl"
-
-// End of File
-
--- a/bluetoothengine/btui/Ecom/inc/bluetoothuiutil.inl	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:   This provides utility for loading a BT device name without
-* localised to a string to be shown in GUI.
-*
-*/
-
-inline TInt BluetoothUiUtil::GetSubstringKeyPos( 
-        const TDes& aDes, const TDesC& aKey, 
-        TInt aKeyPos, TInt& aKeyLength )
-    {
-    ASSERT( aKeyPos > KErrNotFound );
-    _LIT(KPercentSymbol, "%" );
-    // 32 would be to fit any key substring in practice:
-    TBuf<32> key;
-    TInt pos( KErrNotFound );
-    // if the specified position is 0, check if "%<aKey>" (%U or %N) exists.
-    if ( aKeyPos == 0 )
-        {
-        key.Copy( KPercentSymbol );
-        key.Append(aKey);
-        pos = aDes.Find( key );
-        }
-    // Either the key is not found, or aKeyPos is not 0.
-    if ( pos == KErrNotFound )
-        {
-        key.Copy( KPercentSymbol );
-        key.AppendNum( aKeyPos );
-        key.Append( aKey );
-        pos = aDes.Find( key );
-        }
-    if ( pos > KErrNotFound )
-        {
-        aKeyLength = key.Length();
-        }
-    return pos;
-    }
-
-inline TInt BluetoothUiUtil::GetStringSubstringKeyPos( 
-        const TDes& aDes, TInt aKeyPos, TInt& aKeyLength )
-    {
-    _LIT(KStringKeyword,"U");
-    TPtrC ptr( KStringKeyword );
-    return GetSubstringKeyPos(aDes, ptr, aKeyPos, aKeyLength );
-    }
-
-inline void BluetoothUiUtil::AddSubstringL( 
-        RBuf& aBuf, const TDesC& aSub, TInt aSubPos)
-    {
-    // Find the position of the specified "%U" or %[0-9]U in aBuf.
-    TInt keyLength;
-    TInt pos = GetStringSubstringKeyPos( aBuf, aSubPos, keyLength );
-    if ( pos == KErrNotFound )
-        {
-        User::Leave( pos );
-        }
-    // Enlarge the max length of aBuf if needed:
-    TInt reqedLen = aBuf.Length() - keyLength + aSub.Length();
-    if ( aBuf.MaxLength() <  reqedLen )
-        {
-        aBuf.ReAllocL( reqedLen );
-        }
-    aBuf.Replace( pos, keyLength, aSub );
-    }
-
-inline void BluetoothUiUtil::LoadResourceAndSubstringL(RBuf& aBuf,
-        TInt aResourceId, const TDesC& aSub, TInt aSubPos )
-    {
-    HBufC* string = StringLoader::LoadL( aResourceId );
-    aBuf.Assign( string );
-    // Logical loc strings may contain redundant "[<chars>]" for some reason.
-    // This sub-string should be removed in our ad hoc parameter loading method.
-    _LIT( KLeftSquareBracket,"[" );
-    _LIT( KRightSquareBracket,"]" );
-    while ( 1 )
-        {
-        TInt lpos = aBuf.Find( KLeftSquareBracket );
-        TInt rpos = aBuf.Find( KRightSquareBracket );
-        if ( lpos > KErrNotFound && rpos > KErrNotFound && ( rpos > lpos ) )
-            {
-            aBuf.Delete(lpos, rpos - lpos + 1 );
-            continue;
-            }
-        // No sub-strings that match "[" and ends with "]". Done
-        break;
-        }
-    // Add the substring to this string loaded from resource:
-    AddSubstringL( aBuf,  aSub, aSubPos );
-    }
-
-// End of File
-
--- a/bluetoothengine/btui/Ecom/inc/btuipluginman.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Plugin loader
-*
-*/
-
-
-
-#ifndef BTUIPLUGINMAN_H
-#define BTUIPLUGINMAN_H
-
-#include <e32base.h>
-#include <btdevice.h>
-#include "BtuiPluginInterface.h"
-#include "btdevmodel.h"
-
-typedef RPointerArray<CImplementationInformation> RImplInfoPtrArray;
-typedef RPointerArray<CBtuiPluginInterface> RPluginPtrArray;
-
-/**
- *  Class CBTUIPluginMan
- *
- *  Load plugins of CBtuiPluginInterface
- *
- *  @since S60 v5.0
- */
-NONSHARABLE_CLASS( CBTUIPluginMan ) 
-    {
-
-public:
-
-    /**
-     * Two-phase constructor
-     *
-     * @since S60 v5.0
-     */
-    static CBTUIPluginMan* NewL( CAknViewAppUi* aAppUi );
-
-    /**
-     * Destructor
-     */
-    virtual ~CBTUIPluginMan();
-     
-    /**
-     * Get the setting view.
-     * @param TBTDevice Get this device's view
-     * @return CAknView the view of the specified plugin
-     */
-    CAknView* GetSettingViewL(TBTDevice& aDevice);
-    
-    /**
-     * Check if the plug-in for specified HID device exists.
-     * @param TBTDeviceClass Use ClassOfDevice as the property to search 
-     * @return ETrue if exist, otherwise EFalse.
-     */
-     TBool IsPluginAvaiable(TBTDeviceClass aDeviceClassInfo);
-
-private:
-
-    /**
-     * C++ default constructor
-     *
-     * @since S60 v5.0
-     */
-    CBTUIPluginMan( CAknViewAppUi* aAppUi );
-
-    /**
-     * Symbian 2nd-phase constructor
-     *
-     * @since S60 v5.0
-     */
-    void ConstructL();
-    
-    /**
-     * Load plugins which are for HID devices.
-     * @param None
-     * @return None
-     */
-    void LoadPluginsL();
-    
-private: // data
-
-	/**
-     * Array of pointers to ECom plug-in information objects.
-     */
-    RImplInfoPtrArray iPluginInfoArray;
-
-    /**
-     * Array of pointers to the BtuiPluginInterface ECom plug-ins loaded by PairedView.
-     */
-    RPluginPtrArray iPluginArray;
-    
-    /**
-     * Current Application process
-     */
-    CAknViewAppUi* iAppUi;
-    };
-
-
-#endif // BTUIPLUGINMAN_H
--- a/bluetoothengine/btui/Ecom/src/BTUIActive.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 helper class.
-*
-*/
-
-
-#include "BTUIActive.h"
-
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-// C++ default constructor
-// ---------------------------------------------------------------------------
-//
-CBTUIActive::CBTUIActive(  MBTUIActiveObserver* aObserver, TInt aId, 
-    TInt aPriority )
-:   CActive( aPriority ),
-    iRequestId( aId ),
-    iObserver( aObserver )
-    {
-    CActiveScheduler::Add( this );
-    }
-
-
-// ---------------------------------------------------------------------------
-// Symbian 2nd-phase constructor
-// ---------------------------------------------------------------------------
-//
-void CBTUIActive::ConstructL()
-    {
-    }
-
-
-// ---------------------------------------------------------------------------
-// NewL
-// ---------------------------------------------------------------------------
-//
-CBTUIActive* CBTUIActive::NewL( MBTUIActiveObserver* aObserver, 
-    TInt aId, TInt aPriority )
-    {
-    CBTUIActive* self = new( ELeave ) CBTUIActive( aObserver, aId, aPriority );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-
-// ---------------------------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------------------------
-//
-CBTUIActive::~CBTUIActive()
-    {
-    Cancel();
-    }
-
-// ---------------------------------------------------------------------------
-// RequestId()
-// Return the request ID of this active object.
-// ---------------------------------------------------------------------------
-//
-TInt CBTUIActive::RequestId()	
-    	{
-    	return iRequestId;
-    	}
-
-// ---------------------------------------------------------------------------
-// SetRequestId()
-// Set a new request ID for this active object.
-// ---------------------------------------------------------------------------
-//
-void CBTUIActive::SetRequestId( TInt aId )
-    	{
-    	iRequestId = aId;
-    	}    	
-    	
-// ---------------------------------------------------------------------------
-// GoActive()
-// Set active.
-// ---------------------------------------------------------------------------
-//
-void CBTUIActive::GoActive()
-	    {
-	    SetActive();
-	    }
-	    
-// ---------------------------------------------------------------------------
-// CancelRequest()
-// Cancel an outstanding request.
-// ---------------------------------------------------------------------------
-//    	
-void CBTUIActive::CancelRequest()
-	    {
-	    Cancel();
-	    }
-	    
-// ---------------------------------------------------------------------------
-// RequestStatus()
-// Get a reference to the active object request status.
-// ---------------------------------------------------------------------------
-//    
-TRequestStatus& CBTUIActive::RequestStatus()
-	    {
-	    return iStatus;
-	    }
-
-// ---------------------------------------------------------------------------
-// From class CActive.
-// Called by the active scheduler when the request has been cancelled.
-// ---------------------------------------------------------------------------
-//
-void CBTUIActive::DoCancel()
-    {
-    }
-
-
-// ---------------------------------------------------------------------------
-// From class CActive.
-// Called by the active scheduler when the request has been completed.
-// ---------------------------------------------------------------------------
-//
-void CBTUIActive::RunL()
-    {
-    iObserver->RequestCompletedL( this, iRequestId, iStatus.Int() );
-    }
-
-
-// ---------------------------------------------------------------------------
-// From class CActive.
-// Called by the active scheduler when an error in RunL has occurred.
-// ---------------------------------------------------------------------------
-//
-TInt CBTUIActive::RunError( TInt aError )
-    {
-    iObserver->HandleError( this, iRequestId, aError );
-    return KErrNone;
-    }
--- a/bluetoothengine/btui/Ecom/src/BTUIBlockedDevicesView.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,437 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 view that handles listing and 
-*  unblocking blocked devices view.
-*
-*/
-
-#include <avkon.hrh>                    // AVKON components
-#include <akntitle.h>
-#include <aknViewAppUi.h>
-#include <BtuiViewResources.rsg>                     // Compiled resource ids
-#include <featmgr.h>                    // Feature Manager
-#include <AknGlobalNote.h>
-#include <aknmessagequerydialog.h> 
-#include <aknnotewrappers.h>
-#include <StringLoader.h>   // Series 60 localisation stringloader
-#include <aknnavi.h>
-#include <hlplch.h>         // Help launcher
-#include <secondarydisplay/BtuiSecondaryDisplayAPI.h>
-
-#include "BTUIBlockedDevicesView.h"
-#include "BTUIDeviceContainer.h"
-#include "debug.h"
-#include "btui.h"
-
-#include <gstabhelper.h>
-#include <btui.mbg>						// Tab icon for General Setting
-#include <bluetoothuiutil.h>
-#include "BTUIMainView.h" 				// base View.
-
-// ---------------------------------------------------------
-// CBTUIBlockedDevicesView::ConstructL
-// Symbian 2nd phase constructor can leave.
-// ---------------------------------------------------------
-//
-void CBTUIBlockedDevicesView::ConstructL()
-    {
-	TRACE_FUNC_ENTRY
-
-    BaseConstructL(R_BTUI_BLOCK_DEVICES_VIEW);    
-
-	TRACE_FUNC_EXIT
-    }
-    
-// ---------------------------------------------------------
-// CBTUIBlockedDevicesView::ConstructL
-// Symbian 2nd phase constructor when served as GS plugin.
-// ---------------------------------------------------------
-//  
-void CBTUIBlockedDevicesView::ConstructL( CBTUIMainView* aBaseView, CArrayPtrFlat<MGSTabbedView>* aTabViewArray )
-    {
-	iBaseView = aBaseView,
-    iTabHelper = CGSTabHelper::NewL();
-    aTabViewArray->AppendL(this); 
-    
-    BaseConstructL(R_BTUI_BLOCK_DEVICES_VIEW_GS);  
-    	
-    TRACE_INFO(_L("CBtuiGSPlugin* aBaseView, CArrayPtrFlat<MGSTabbedView>* aTabViewArray"))
-    }
-        
-// ---------------------------------------------------------
-// CBTUIBlockedDevicesView::NewL
-// Two phased constructor
-// ---------------------------------------------------------
-//
-CBTUIBlockedDevicesView* CBTUIBlockedDevicesView::NewL(MBtuiPluginViewActivationObserver* aObserver)
-    {
-	//TRACE_FUNC_ENTRY
-    CBTUIBlockedDevicesView* self = new (ELeave) CBTUIBlockedDevicesView(aObserver);
-	CleanupStack::PushL(self);
-	self->iConstructAsGsPlugin = EFalse;	
- 	self->ConstructL();	
-	CleanupStack::Pop(self);
-
-    return self;
-    }
-    
-// ---------------------------------------------------------
-// CBTUIBlockedDevicesView::NewL
-// Two phased constructor
-// ---------------------------------------------------------
-// 
-CBTUIBlockedDevicesView* CBTUIBlockedDevicesView::NewLC(CBTUIMainView* aBaseView, CArrayPtrFlat<MGSTabbedView>* aTabViewArray)
-    {
-    CBTUIBlockedDevicesView* self = new (ELeave) CBTUIBlockedDevicesView();    
-	CleanupStack::PushL( self );
-		
-	self->iConstructAsGsPlugin = ETrue;
- 	self->ConstructL( aBaseView, aTabViewArray );
-
-    return self;
-    }
-
-// ---------------------------------------------------------
-// CBTUIBlockedDevicesView::CBTUIBlockedDevicesView
-// ---------------------------------------------------------
-    
-CBTUIBlockedDevicesView::CBTUIBlockedDevicesView(MBtuiPluginViewActivationObserver* aObserver )
-	:iActivationObserver(aObserver)
-	{
-	}        
-        
-// ---------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------
-//
-CBTUIBlockedDevicesView::~CBTUIBlockedDevicesView()
-    {
-	TRACE_FUNC_ENTRY   
-    if (iContainer)
-        {
-        AppUi()->RemoveFromViewStack(*this, iContainer);
-        }
-
-    delete iContainer;   
-    delete iModel;
-    
-	if(iConstructAsGsPlugin)
-	    	delete iTabHelper;	
-	
-	TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------
-// From CAknView
-// CBTUIBlockedDevicesView::Id
-// ---------------------------------------------------------
-//
-TUid CBTUIBlockedDevicesView::Id() const
-    {
-	TRACE_FUNC_ENTRY
-    return KBtuiPluginUidBlockedDevicesView;//KBTBlockDevicesViewId;
-    }
-
-// ---------------------------------------------------------
-// From CAknView
-// CBTUIBlockedDevicesView::HandleCommandL 
-// ---------------------------------------------------------
-//
-void CBTUIBlockedDevicesView::HandleCommandL(TInt aCommand)
-    {
-    TRACE_FUNC_ENTRY
-	TInt bItemIndex;
-    switch (aCommand)
-        {
-        case EAknSoftkeyBack:
-            // do not exit if devicechange is in progress.
-            if(iModel->DeviceChangeInProgress() )
-            	return;                
-	        AppUi()->ActivateLocalViewL(iBaseView->GetParentView().iViewUid );
-            break;
-
-        case EAknSoftkeyExit:
-            // do not exit if devicechange is in progress.
-            if(iModel->DeviceChangeInProgress() )
-            	return;        
-			AppUi()->ProcessCommandL(EEikCmdExit);        
-			break;
-		
-		case  EBTUICmdDelete:
-        case  EBTUICmdUnblock:
-        	{
-        	
-        	bItemIndex = iContainer->CurrentItemIndex(); 
-			if(bItemIndex < 0) 
-        		break;
-        	        	
-        	TBTDevice device;
-            device.iIndex = bItemIndex;
-        	iModel->GetDevice(device);
-        	
-        	RBuf s;
-        	CleanupClosePushL( s );
-        	BluetoothUiUtil::LoadResourceAndSubstringL(
-        	        s, R_BT_WARN_ERASE_BLOCKED, device.iName, 0);
-        	
-        	CAknQueryDialog* dialog = CAknQueryDialog::NewL(CAknQueryDialog::EConfirmationTone);
-			TInt keypress = dialog->ExecuteLD(R_BT_GENERIC_QUERY, s);
-
-			CleanupStack::PopAndDestroy(&s);
-
-			if(keypress)  // User has accepted the dialog
-			    {
-        		device.iOperation = EOpUnblock;
-               	iModel->ChangeDevice(device);
-			    }        		
-        	
-        	break; 
-        	
-        	}
-        case EBTUICmdDeleteAll:        	
-        case EBTUICmdUnblockAll:
-            {
-        	CAknQueryDialog* dialog = CAknQueryDialog::NewL(CAknQueryDialog::EConfirmationTone);
-        	HBufC* s=iCoeEnv->AllocReadResourceLC(R_BT_WARN_ERASE_ALL_BLOCKED);
-        	TInt keypress=dialog->ExecuteLD(R_BT_GENERIC_QUERY, *s);
-        	CleanupStack::PopAndDestroy(s);
-        	
-        	if(keypress)
-            	{
-        		iModel->ChangeAllDevices(EOpUnblock);
-            	}
-        	
-        	break; 
-            }
-
-        case EAknCmdHelp:
-            {            
-            #ifdef __SERIES60_HELP
-            HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), AppUi()->AppHelpContextL());
-            #endif
-            break;
-            }          
-                	
-        default:
-            {
-            AppUi()->HandleCommandL(aCommand);
-            break;
-            }
-        }
-	TRACE_FUNC_EXIT        
-    }
-
-
-// ---------------------------------------------------------
-// From CAknView
-// CBTUIBlockedDevicesView::DoActivateL
-// ---------------------------------------------------------
-//
-void CBTUIBlockedDevicesView::DoActivateL(const TVwsViewId& /*aPrevViewId*/,
-                                               TUid /*aCustomMessageId*/,
-                                         const TDesC8& /*aCustomMessage*/)
-    {
-	TRACE_FUNC_ENTRY
-    // Setup title
-    //
-    iModel = CBTDevModel::NewL(EGroupBlocked, this);     
-    iContainer = CBTUiDeviceContainer::NewL(ClientRect(), this, EGroupBlocked, this);
-
-    HBufC* btBlockDevices = iCoeEnv->AllocReadResourceLC(R_BT_TITLE_BLOCKED_DEV);
-    CEikStatusPane* statusPane = StatusPane();
-    CAknTitlePane* titlePane;
-    titlePane = (CAknTitlePane*) statusPane->ControlL(TUid::Uid(EEikStatusPaneUidTitle));
-    titlePane->SetTextL(*btBlockDevices);
-    CleanupStack::PopAndDestroy(btBlockDevices); 
-    AppUi()->AddToStackL(*this, iContainer);
-	DimMskL(ETrue ); 
-	// the MSK will be undimmed, if there are blocked devices when
-	// the deviceList will be refreshed
-
-    if( iBaseView && iConstructAsGsPlugin)
-        {
-        iTabHelper->CreateTabGroupL( Id(), 
-            static_cast<CArrayPtrFlat<MGSTabbedView>*>
-            (iBaseView->TabbedViews()) ); 
-        }
-        
-	// notify observer   
-    if( iActivationObserver  && iConstructAsGsPlugin == EFalse)
-    {    	    
-        iActivationObserver->PluginViewActivated(EBlockedDevicesViewId);        
-    }
-        
-	TRACE_FUNC_EXIT
-	}
-
-// ---------------------------------------------------------
-// From CAknView
-// CBTUIBlockedDevicesView::DoDeactivate
-// ---------------------------------------------------------
-//
-void CBTUIBlockedDevicesView::DoDeactivate()
-    {
-	TRACE_FUNC_ENTRY
-    if (iContainer)
-        {
-        AppUi()->RemoveFromStack(iContainer);
-        delete iContainer;
-        iContainer = NULL;
-        }
-
-    delete iModel;
-    iModel=NULL;
-    if(iConstructAsGsPlugin)
-	    iTabHelper->RemoveTabGroup();  
- 
-	TRACE_FUNC_EXIT
-    }
-// ---------------------------------------------------------
-// CBTUIBlockedDevicesView::DimMskL
-// This will dim/Undim MSK.
-// However the command is sent when the key is pressed 
-// regardless wether the MSK command is visible and 
-// the view must be able to receive it anyway.
-// ---------------------------------------------------------
-void CBTUIBlockedDevicesView::DimMskL(TBool aDimmed)
-    {
-	TRACE_FUNC_ENTRY			
-	if(aDimmed)
-		{
-		Cba()->SetCommandL (EBTUICmdUnblock,KNullDesC);
-		}
-	else
-		{
-		if(iConstructAsGsPlugin)
-			{
-			Cba()->SetCommandSetL(R_BTUI_SOFTKEYS_OPTIONS_BACK__UNBLOCK); 					
-			}
-		else
-			{
-			Cba()->SetCommandSetL(R_BTUI_SOFTKEYS_OPTIONS_EXIT__UNBLOCK); 								
-			}
-		}
-		
-	Cba()->DrawDeferred();
-	
-	// NOTE: these will only hide the MSK label.
-	// The command is still being sent if button is pressed.
-	// HandleCommanL will take care
-	// of the situation that there may be no devices to unblock
-	TRACE_FUNC_EXIT	
-    }	
-
-// ---------------------------------------------------------
-// From CAknView
-// CBTUIBlockedDevicesView::DynInitMenuPaneL
-// Shows selected item's context sensitive options menu.
-// ---------------------------------------------------------
-//
-void CBTUIBlockedDevicesView::DynInitMenuPaneL(TInt aResId, CEikMenuPane* aMenu)
-    {
-	TRACE_FUNC_ENTRY    
-	// dim help if it exists and is not supported	
-	TInt tmp;	
-	if (  aMenu->MenuItemExists(EAknCmdHelp,tmp ) )			
-		{			
-		aMenu->SetItemDimmed(EAknCmdHelp,
-		  !FeatureManager::FeatureSupported( KFeatureIdHelp ) );
-		}
-    
-    // do not show "unblock" and "unblock all" commands 
-    // if there is nothing to unblock
-	if (aResId == R_BTUI_BLOCK_DEVICES_VIEW_MENU)
-	    {
-        if( iContainer->CountItems() == 0) 
-            {        
-            aMenu->SetItemDimmed(EBTUICmdUnblock, ETrue);
-            aMenu->SetItemDimmed(EBTUICmdUnblockAll, ETrue);            
-            }
-        else
-            {
-            aMenu->SetItemDimmed(EBTUICmdUnblockAll, EFalse);
-            aMenu->SetItemDimmed(EBTUICmdUnblock, ETrue);
-            }
-	    }
-	TRACE_FUNC_EXIT        
-    }
-
-// ---------------------------------------------------------
-// From MBTDeviceObserver
-// CBTUIBlockedDevicesView::NotifyChangeDeviceComplete
-// ---------------------------------------------------------
-//
-void CBTUIBlockedDevicesView::NotifyChangeDeviceComplete(const TInt aErr, 
-		const TBTDevice&, const RBTDevNameArray* )
-	{
-	TRACE_FUNC_ENTRY	
-	// we do not show any note, when blocked devices are unblocked,
-	// and that is the only command available.
-
-	if(aErr!= KErrNone)
-		{
-		TRAP_IGNORE(TBTUIViewsCommonUtils::ShowGeneralErrorNoteL(););
-		}
-	TRACE_FUNC_EXIT		
-	}
-
-
-// -----------------------------------------------
-// From MBTDeviceObserver
-// CBTUIBlockedDevicesView::RefreshDeviceList
-// -----------------------------------------------
-void CBTUIBlockedDevicesView::RefreshDeviceList(const RDeviceArray* aDevices,
-	  TInt aSelectedItemIndex)
-	{		
-	TRACE_FUNC_ENTRY	
-	
-	TRAPD(err,	
-		if(iContainer)
-			{
-			iContainer->RefreshDeviceListL(aDevices,aSelectedItemIndex );			
-			}
-		// dim the MSK if there are no devices to unblock
-		DimMskL(aDevices->Count()==0);
-			
-	);
-	if(err!= KErrNone)	    
-        {
-        TRAP_IGNORE( TBTUIViewsCommonUtils::ShowGeneralErrorNoteL(); );
-        }
-		
-	TRACE_FUNC_EXIT		
-	}
-
-// ---------------------------------------------------------------------------
-// CBTUIBlockedDevicesView::CreateTabIconL()
-// Creates icon for tab.
-// ---------------------------------------------------------------------------
-//    
-CGulIcon* CBTUIBlockedDevicesView::CreateTabIconL()
-    {
-    TFileName bmpFilename; 
-    bmpFilename += KBitmapFileDrive;
-    bmpFilename += KDC_APP_BITMAP_DIR;
-    bmpFilename += KBtuiBmpFileName;
-    
-    CGulIcon* icon = AknsUtils::CreateGulIconL(
-        AknsUtils::SkinInstance(), 
-        KAknsIIDQgnPropBtBlockedTab3,  
-        bmpFilename, 
-        EMbmBtuiQgn_prop_bt_blocked_tab3, 
-        EMbmBtuiQgn_prop_bt_blocked_tab3_mask );
-          
-    return icon;
-    }   
-    
--- a/bluetoothengine/btui/Ecom/src/BTUIDeviceContainer.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,673 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 the implementation of device list container. It contains 
-*				 all necessary AVKON components and handles user inputs
-*				 for paired and blocked devices view.
-*
-*/
-
-
-#include <btui.mbg>				// Compiled resource ids
-#include <BtuiViewResources.rsg> 
-#include <AknsUtils.h>          // For Extended skinning icons
-#include <gulicon.h>
-#include <AknUtils.h>			// For char filter
-#include <aknlists.h> 
-#include <avkon.mbg> 			// AVKON icons
-#include <csxhelp/bt.hlp.hrh>   // Help IDs
-
-#include "BTUIDeviceContainer.h"
-#include "BTUIListedDevicesView.h"
-#include "debug.h"               
-#include "btui.h" // Global declarations
-
-const TInt KBTNumberOfIcons = 14;    // Number of class of device icons + extra one DEV_STATUS_AUTHORIZED
-	
-_LIT( DEV_TYPE_COMPUTER,"0\t");
-_LIT( DEV_TYPE_PHONE,"1\t");
-_LIT( DEV_TYPE_AUDIO,"2\t");
-_LIT( DEV_TYPE_DEFAULT,"3\t");	
-_LIT( DEV_TYPE_KEYBOARD,"4\t");
-_LIT( DEV_TYPE_MOUSE,"5\t");
-_LIT( DEV_TYPE_PRINTER,"6\t");
-_LIT( DEV_TYPE_CARKIT,"7\t");
-_LIT( DEV_TYPE_AUDIO_CONNECT,"8\t");
-_LIT( DEV_TYPE_COMPUTER_CONNECT,"9\t");
-_LIT( DEV_TYPE_KEYBOARD_CONNECT,"10\t");
-_LIT( DEV_TYPE_CARKIT_CONNECT,"11\t");
-_LIT( DEV_TYPE_MOUSE_CONNECT,"12\t");
-
-_LIT(DEV_STATUS_NORMAL, "\t" ); 		// blocked in blocked devices view, paired in pairred devices view
-_LIT(DEV_STATUS_AUTHORIZED, "\t13" ); 	// autorized in paired devices view
-
-    
-
-// ================= MEMBER FUNCTIONS =======================
-  
-// ---------------------------------------------------------
-// CBTUiDeviceContainer::ConstructL
-// ---------------------------------------------------------
-void CBTUiDeviceContainer::ConstructL(const TRect& aRect, 
-  CBTUIListedDevicesView* aView, TBTDeviceGroup aGroup)
-    {
-	TRACE_FUNC_ENTRY
-	
-    CreateWindowL();
-    
-	iView = aView;
-    iGroup = aGroup;
-    // Create new list for other paired bt-devices
-    //
-    iDeviceList = new (ELeave) CAknSingleGraphicStyleListBox;
-    iDeviceList->SetContainerWindowL(*this);
-    iDeviceList->ConstructL(this, EAknListBoxSelectionList);
-    
-	iDeviceList->SetListBoxObserver( this );    
-
-    // Set the empty text at basis of the list
-    iDeviceList->View()->SetListEmptyTextL( KNullDesC );
-
-    // Set up filenames for Btui and Avkon bitmaps
-    TFileName bmpFilename;
-    bmpFilename += KBitmapFileDrive;
-    bmpFilename += KDC_APP_BITMAP_DIR;
-    bmpFilename += KBtuiBmpFileName;
-        
-    // The avkon bitmap we will get from AknIconUtils::AvkonIconFileName()
-    TFileName avkonbmpFilename = AknIconUtils::AvkonIconFileName();
-    
-    // Setup graphic items list for BT devices listbox
-    CAknIconArray* iconList = new(ELeave) CAknIconArray(KBTNumberOfIcons);
-    CleanupStack::PushL( iconList );
-    
-
-	CreateAndAppendIconL( KAknsIIDQgnPropBtComputer, 
-						  avkonbmpFilename, 
-						  EMbmAvkonQgn_prop_bt_computer,
-						  EMbmAvkonQgn_prop_bt_computer_mask,
-						  iconList);
-
-	CreateAndAppendIconL( KAknsIIDQgnPropBtPhone,
-						  avkonbmpFilename, 
-						  EMbmAvkonQgn_prop_bt_phone,
-						  EMbmAvkonQgn_prop_bt_phone_mask,
-						  iconList);
-
-	CreateAndAppendIconL( KAknsIIDQgnPropBtAudio,
-						  avkonbmpFilename, 
-						  EMbmAvkonQgn_prop_bt_audio,
-						  EMbmAvkonQgn_prop_bt_audio_mask,
-						  iconList);
-
-	CreateAndAppendIconL( KAknsIIDQgnPropBtMisc,
-						  avkonbmpFilename, 
-						  EMbmAvkonQgn_prop_bt_misc,
-						  EMbmAvkonQgn_prop_bt_misc_mask,
-						  iconList);
-						  
-	CreateAndAppendIconL( KAknsIIDQgnPropBtKeyboard,
-						  avkonbmpFilename, 
-						  EMbmAvkonQgn_prop_bt_keyboard,
-						  EMbmAvkonQgn_prop_bt_keyboard_mask,
-						  iconList);					  
-
-	CreateAndAppendIconL( KAknsIIDQgnPropBtMouse,
-						  avkonbmpFilename, 
-						  EMbmAvkonQgn_prop_bt_mouse,
-						  EMbmAvkonQgn_prop_bt_mouse_mask,
-						  iconList);
-						  
-	CreateAndAppendIconL( KAknsIIDQgnPropBtPrinter,
-						  avkonbmpFilename, 
-						  EMbmAvkonQgn_prop_bt_printer,
-						  EMbmAvkonQgn_prop_bt_printer_mask,
-						  iconList);					  					  
-	
-	CreateAndAppendIconL( KAknsIIDQgnPropBtCarKit,
-						  avkonbmpFilename, 
-						  EMbmAvkonQgn_prop_bt_carkit,
-						  EMbmAvkonQgn_prop_bt_carkit_mask,
-						  iconList);
-						  
-	CreateAndAppendIconL( KAknsIIDQgnPropBtAudioConnect,
-						  bmpFilename, 
-						  EMbmBtuiQgn_prop_bt_audio_connect,
-						  EMbmBtuiQgn_prop_bt_audio_connect_mask,
-						  iconList);					  
-						  
-	CreateAndAppendIconL( KAknsIIDQgnPropBtComputerConnect,
-						  bmpFilename, 
-						  EMbmBtuiQgn_prop_bt_computer_connect,
-						  EMbmBtuiQgn_prop_bt_computer_connect_mask,
-						  iconList);
-						  
-    CreateAndAppendIconL( KAknsIIDQgnPropBtKeyboardConnect,
-						  bmpFilename, 
-						  EMbmBtuiQgn_prop_bt_keyboard_connect,
-						  EMbmBtuiQgn_prop_bt_keyboard_connect_mask,
-						  iconList);						  		
-						  
-	CreateAndAppendIconL( KAknsIIDQgnPropBtCarKitConnect,
-						  bmpFilename, 
-						  EMbmBtuiQgn_prop_bt_car_kit_connect,
-						  EMbmBtuiQgn_prop_bt_car_kit_connect_mask,
-						  iconList);	
-	
-	CreateAndAppendIconL( KAknsIIDQgnPropBtMouseConnect,
-                          bmpFilename, 
-                          EMbmBtuiQgn_prop_bt_mouse_connect,
-                          EMbmBtuiQgn_prop_bt_mouse_connect_mask,
-                          iconList);
-	
-	CFbsBitmap* bitmap = NULL;
-    CFbsBitmap* mask = NULL;
-    AknsUtils::CreateColorIconLC(AknsUtils::SkinInstance(), 
-                                 KAknsIIDQgnIndiBtTrustedAdd,
-                                 KAknsIIDQsnIconColors,
-                                 EAknsCIQsnIconColorsCG13,
-                                 bitmap, mask,
-                                 avkonbmpFilename,
-                                 EMbmAvkonQgn_indi_bt_trusted_add,
-                                 EMbmAvkonQgn_indi_bt_trusted_add_mask,
-                                 KRgbBlack);
-    CGulIcon* icon = CGulIcon::NewL(bitmap, mask);
-        
-    CleanupStack::Pop(mask);
-    CleanupStack::Pop(bitmap); 
-    
-    CleanupStack::PushL(icon);    
-	iconList->AppendL( icon );
-    CleanupStack::Pop(icon);
-    
-    	
-    // Transfer iconlist ownership to the listbox
-    iDeviceList->ItemDrawer()->ColumnData()->SetIconArray(iconList);
-    CleanupStack::Pop(iconList);
-
-    // Create scrollbars
-    iDeviceList->CreateScrollBarFrameL(ETrue);
-    iDeviceList->ScrollBarFrame()->SetScrollBarVisibilityL(
-    	CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto);
-
-    SetRect(aRect);
-    ActivateL();
-
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------
-// CBTUiDeviceContainer::NewL
-// ---------------------------------------------------------
-CBTUiDeviceContainer* CBTUiDeviceContainer::NewL(const TRect& aRect, 
-  CBTUIListedDevicesView* aView, TBTDeviceGroup aGroup, MObjectProvider* aParent)
-    {
-	 CBTUiDeviceContainer* self = new (ELeave) CBTUiDeviceContainer();
-	 self->SetMopParent(aParent);
-	 CleanupStack::PushL(self);
-	 self->ConstructL(aRect, aView, aGroup);
-	 CleanupStack::Pop(self);
-	 return self;
-    }
-// ---------------------------------------------------------
-// destructor
-// ---------------------------------------------------------
-
-CBTUiDeviceContainer::~CBTUiDeviceContainer()
-    {
-	TRACE_FUNC_ENTRY
-    delete iDeviceList;
-	TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------
-// CBTUiDeviceContainer::RefreshDeviceListL
-// This function will refresh only the changed parts of the
-// screen, if any.
-// ---------------------------------------------------------   
-void CBTUiDeviceContainer::RefreshDeviceListL(const RDeviceArray* aDeviceArray,TInt selectedItem)
-    {
-	TRACE_FUNC_ENTRY
-	
-    MDesCArray* itemTextArray = iDeviceList->Model()->ItemTextArray();
-    CDesCArray* itemArray = (CDesCArray*) itemTextArray;
-    TBool removal=EFalse;
-    TBool addition=EFalse;
-	TInt previouslySelected=CurrentItemIndex();
-    TBTDeviceName listItem;
-    TInt deviceCount = aDeviceArray->Count();
-    TInt i = 0;
-    for( ; i < deviceCount; i++)
-        {
-        TBTDevice device = *(*aDeviceArray)[i];
-        CreateListItemL(device, listItem);
-        if(itemArray->Count()<=i)
-        	{
-        	itemArray->AppendL(listItem);
-        	addition=ETrue;
-        	}
-        else
-        	if(listItem != (*itemArray)[i] )
-				{
-				itemArray->Delete(i);
-				itemArray->InsertL(i,listItem);
-				
-				removal=ETrue;
-				addition=ETrue;
-				}
-        
-        }
-	if(itemArray->Count()-i>=0)
-		{
-		itemArray->Delete(i,itemArray->Count()-i);        
-		removal=ETrue;
-		}
-		
-        
-	if(removal)        
-		iDeviceList->HandleItemRemovalL();
-	if(addition)
-    	iDeviceList->HandleItemAdditionL();
-
-	if(deviceCount >0 )
-		iDeviceList->SetCurrentItemIndex( Max(selectedItem,0 )) ;
-	else
-		{
-		HBufC* devEmptyText = NULL;
-		if(iGroup ==EGroupPaired)
-			{
-			devEmptyText=iCoeEnv->AllocReadResourceLC( R_BT_NO_PAIRED_DEVICES);
-			}    	
-		else
-			{    
-			devEmptyText=iCoeEnv->AllocReadResourceLC( R_BT_NO_BLOCKED_DEVICES);
-			}
-		iDeviceList->View()->SetListEmptyTextL(*devEmptyText );
-		CleanupStack::PopAndDestroy(devEmptyText);
-		}
-		
-	if(addition | removal | previouslySelected!=selectedItem)
-    	iDeviceList->DrawDeferred();
-	TRACE_FUNC_EXIT
-    } 
-
-// ---------------------------------------------------------
-// CBTUiDeviceContainer::CountItems
-// ---------------------------------------------------------    
-TInt CBTUiDeviceContainer::CountItems() 
-	{   
-	return iDeviceList->Model()->ItemTextArray()->MdcaCount();    
-	}
-
-// ---------------------------------------------------------
-// CBTUiDeviceContainer::CreateListItemL
-// ---------------------------------------------------------
-void CBTUiDeviceContainer::CreateListItemL(const TBTDevice& aDevice, TBTDeviceName& aListItem)
-    {
-	TRACE_FUNC_ENTRY
-    aListItem.Zero(); // may not needed
-    
-    TInt iconIndex = (TInt)(aDevice.iType);
-    
-    switch( iconIndex)
-    	{
-    	case EDeviceComputer:
-    		if(( aDevice.iStatus & EStatusBtuiConnected) == EStatusBtuiConnected)
-    			{
-    			aListItem.Append(DEV_TYPE_COMPUTER_CONNECT);   	
-    	    	}
-			else
-				{
-				aListItem.Append(DEV_TYPE_COMPUTER); 
-				}
-			break;
-    	
-    	case EDevicePhone:   	
-    		aListItem.Append(DEV_TYPE_PHONE); 
-    		break;
-    		
-    	case EDeviceAudio: 
-    		if(( aDevice.iStatus & EStatusBtuiConnected) == EStatusBtuiConnected)
-    			{
-    			aListItem.Append(DEV_TYPE_AUDIO_CONNECT);   	
-    	    	}
-			else
-				{
-    			aListItem.Append(DEV_TYPE_AUDIO);
-				}
-			break ;
-    	case EDeviceCarkit: 	  
-    	  	if(( aDevice.iStatus & EStatusBtuiConnected) == EStatusBtuiConnected)
-    			{
-    			aListItem.Append(DEV_TYPE_CARKIT_CONNECT);   	
-    	    	}
-			else
-				{
-    			aListItem.Append(DEV_TYPE_CARKIT);
-				}
-			break ;
-				
-		case EDevicePrinter:
-			aListItem.Append(DEV_TYPE_PRINTER);
-			break;
-			
-		case EDeviceKeyboard:
-		
-			if(( aDevice.iStatus & EStatusBtuiConnected) == EStatusBtuiConnected)
-    			{
-    			aListItem.Append(DEV_TYPE_KEYBOARD_CONNECT);   	
-    	    	}
-			else
-				{
-    			aListItem.Append(DEV_TYPE_KEYBOARD);
-				}
-			break ;
-				
-		case EDeviceMice:
-		    
-		    if(( aDevice.iStatus & EStatusBtuiConnected) == EStatusBtuiConnected)
-                {
-                aListItem.Append(DEV_TYPE_MOUSE_CONNECT);    
-                }
-            else
-                {
-                aListItem.Append(DEV_TYPE_MOUSE);
-                }
-			break;			
-			
-		case EDeviceDefault:	
-    		aListItem.Append(DEV_TYPE_DEFAULT); 
-    		break;
-    			
-		default:
-			aListItem.Append('\t');
-			break;
-    	}
-    	    
-    aListItem.Append(aDevice.iName);
-
-    if((aDevice.iStatus & EStatusTrusted) == EStatusTrusted && iGroup ==EGroupPaired )                            
-        {   	
-    	aListItem.Append(DEV_STATUS_AUTHORIZED);    
-        }    	
-    else 
-    	{	
-  		aListItem.Append( DEV_STATUS_NORMAL );
-    	}
-	TRACE_FUNC_EXIT    	
-    }
-
-
-// ---------------------------------------------------------
-// From CCoeControl
-// CBTUiDeviceContainer::OfferKeyEventL
-// ---------------------------------------------------------
-TKeyResponse CBTUiDeviceContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,
-                                                               TEventCode aType)
-    {
-	TRACE_FUNC_ENTRY    
-    // Inform model where we are now
-    TInt bItemIndex = CurrentItemIndex();
-
-    // Shortcut for deleting a device
-    if ((aKeyEvent.iCode == EKeyBackspace) && (bItemIndex >= 0))
-        {
-        iView->HandleCommandL( EBTUICmdDelete );
-        return EKeyWasConsumed;
-        }
-
-    // Show popup commands window if selection or enter key is pressed.
-	// It should not go to here, unless | EAknEnableMSK is not set
-    if ((aKeyEvent.iCode == EKeyDevice3) || (aKeyEvent.iCode == EKeyEnter))
-        {
-        iView->ProcessCommandL(EAknSoftkeyContextOptions);        
-        return EKeyWasConsumed;
-        }
-
-    if ((aKeyEvent.iCode != EKeyLeftArrow) && 
-        (aKeyEvent.iCode != EKeyRightArrow))
-        {
-		TRACE_FUNC_EXIT        
-        return iDeviceList->OfferKeyEventL(aKeyEvent, aType);
-        }
-    else
-        {
-        // BTRegistry operations are not done in atomic way
-        // so we cannot allow them to be interrupted
-        if(iView->DeviceChangeInProgress())
-        	return EKeyWasConsumed;
-        
-		TRACE_FUNC_EXIT        
-        return EKeyWasNotConsumed;
-        }
-    }
-
-// ----------------------------------------------------
-// CBTUiDeviceContainer::CreateAndAppendIconL
-// ----------------------------------------------------
-void CBTUiDeviceContainer::CreateAndAppendIconL( 
-  const TAknsItemID& aID,
-  const TDesC& aFileName,
-  const TInt aBitmapId,
-  const TInt aMaskId,
-  CAknIconArray* aIconList)
-    {    
-	TRACE_FUNC_ENTRY    
-	
-    CGulIcon* icon = AknsUtils::CreateGulIconL(AknsUtils::SkinInstance(),
-     aID, aFileName, aBitmapId, aMaskId);
-    
-    CleanupStack::PushL(icon);    
-	aIconList->AppendL(icon);
-    CleanupStack::Pop(icon);
-	}
-
-// ---------------------------------------------------------
-// From CCoeControl
-// CBTUiDeviceContainer::GetHelpContext
-// ---------------------------------------------------------
-void CBTUiDeviceContainer::GetHelpContext(TCoeHelpContext& aContext) const
-    {
-	TRACE_FUNC_ENTRY
-#ifdef __SERIES60_HELP
-
-    aContext.iMajor = KBtuiUid3;
-    if( iGroup ==EGroupPaired)
-    	aContext.iContext = KBT_HLP_PAIRED;
-    else
-    	aContext.iContext = KBT_HLP_BLOCKED ;
-#else    
-#endif
-    }
-
-// ---------------------------------------------------------
-// From CCoeControl
-// CBTUiDeviceContainer::SizeChanged
-// Called by framework when the view size is changed
-// ---------------------------------------------------------
-void CBTUiDeviceContainer::SizeChanged()
-    {
-	TRACE_FUNC_ENTRY    
-    iDeviceList->SetRect(Rect());  // Mandatory, otherwise not drawn
-    }
-
-// ---------------------------------------------------------
-// From CCoeControl
-// CBTUiDeviceContainer::CountComponentControls
-// ---------------------------------------------------------
-TInt CBTUiDeviceContainer::CountComponentControls() const
-    {
-	TRACE_FUNC_ENTRY    
-    // return number of controls inside this container
-    return 1;
-    }
-
-// ---------------------------------------------------------
-// From CCoeControl
-// CBTUiDeviceContainer::ComponentControl
-// ---------------------------------------------------------
-CCoeControl* CBTUiDeviceContainer::ComponentControl(TInt aIndex) const
-    {
-	TRACE_FUNC_ENTRY    
-	if(aIndex == 0)
-		{
-		return iDeviceList ;
-		}    	
-	else
-		{
-		return NULL;	
-		}		
-    }
-
-// ----------------------------------------------------
-// CBTUiDeviceContainer::CurrentItemIndex
-// ----------------------------------------------------
-TInt CBTUiDeviceContainer::CurrentItemIndex()
-    {
-	TRACE_FUNC_ENTRY    
-	
-    return iDeviceList->CurrentItemIndex();
-    }
-
-// ---------------------------------------------------------
-// From CCoeControl
-// CBTUiDeviceContainer::Draw
-// ---------------------------------------------------------
-void CBTUiDeviceContainer::Draw( const TRect& /* aRect */ ) const
-    {
-    }
-
-// ---------------------------------------------------------
-// From MCoeControlObserver
-// CBTUiDeviceContainer::HandleControlEventL
-// ---------------------------------------------------------
-void CBTUiDeviceContainer::HandleControlEventL( CCoeControl* /* aControl */, TCoeEvent /* aEventType */ )
-    {
-	TRACE_FUNC_ENTRY    
-    }
-
-// ---------------------------------------------------------
-// From CCoeControl
-// CBTUiDeviceContainer::HandleResourceChange
-// ---------------------------------------------------------
-void CBTUiDeviceContainer::HandleResourceChange( TInt aType )
-    {
-	TRACE_FUNC_ENTRY    
-    CCoeControl::HandleResourceChange(aType);
-    TRAP_IGNORE(HandleResourceChangeL(aType));
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------
-// Internal Leave function
-// CBTUiDeviceContainer::HandleResourceChangeL
-// ---------------------------------------------------------
-void CBTUiDeviceContainer::HandleResourceChangeL( TInt aType )
-    {
-	TRACE_FUNC_ENTRY    
-
-    //Handle change in layout orientation
-    if (aType == KEikDynamicLayoutVariantSwitch || aType == KAknsMessageSkinChange )
-        {
-        TRect mainPaneRect;
-        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-        
-        // Because the trailing icons are not changed properly after theme is changed.
-        // we refresh those icons in the iconlist from iDeviceList manually.
-        
-        // Get iconlist from listbox
-        CAknIconArray* iconList = static_cast<CAknIconArray*>(iDeviceList->ItemDrawer()->ColumnData()->IconArray());
-        
-        CleanupStack::PushL( iconList );
-        // remove the last two icons which will not be updated properly by theme changing.
-		iconList->Delete(KBTNumberOfIcons-1);
-	        
-	    // The avkon bitmap we will get from AknIconUtils::AvkonIconFileName()
-	    TFileName avkonbmpFilename = AknIconUtils::AvkonIconFileName();
-	    
-	  
-	    
-		CFbsBitmap* bitmap = NULL;
-	    CFbsBitmap* mask = NULL;
-	    AknsUtils::CreateColorIconLC(AknsUtils::SkinInstance(), 
-	                                 KAknsIIDQgnIndiBtTrustedAdd,
-	                                 KAknsIIDQsnIconColors,
-	                                 EAknsCIQsnIconColorsCG13,
-	                                 bitmap, mask,
-	                                 avkonbmpFilename,
-	                                 EMbmAvkonQgn_indi_bt_trusted_add,
-	                                 EMbmAvkonQgn_indi_bt_trusted_add_mask,
-	                                 KRgbBlack);
-	    
-	    
-	    CGulIcon* icon = CGulIcon::NewL(bitmap, mask);
-	     
-	    CleanupStack::Pop(2); // bitmap, mask;
-	    
-	    CleanupStack::PushL(icon);    
-		
-		iconList->AppendL( icon );
-	    CleanupStack::Pop(icon);
-	    
-	    	
-	    // Transfer iconlist ownership back to the listbox
-	    iDeviceList->ItemDrawer()->ColumnData()->SetIconArray(iconList);
-	    CleanupStack::Pop(iconList);
-		
-        SetRect(mainPaneRect);
-		DrawDeferred();
-		}
-	TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------
-// From CCoeControl
-// CBTUiDeviceContainer::FocusChanged
-// ---------------------------------------------------------
-void CBTUiDeviceContainer::FocusChanged(TDrawNow /*aDrawNow*/)
-    {
-	TRACE_FUNC_ENTRY    
-	iDeviceList->SetFocus(IsFocused());
-	TRACE_FUNC_EXIT        
-    }
-// ---------------------------------------------------------
-// From CCoeControl
-// CBTUiDeviceContainer::HandleListBoxEventL
-//
-// Handle touch screen singleclick as MSK devent to paired view or 
-// as delete key event to blocked devices view.
-// ---------------------------------------------------------
-//
-void CBTUiDeviceContainer::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
-    {
-    TRACE_FUNC_ENTRY
-	// this is no longer called, unless MSK is disabled.
-	// if msk is not disabled, then  
-	// BTMainView::HandleCommand(EBTUICmdMSK) is called instead
-    if( aEventType == EEventEnterKeyPressed 
-    || aEventType == EEventItemSingleClicked) // Selection key pressed, or item clicked
-        {        
-    	// msk open context options in paired devices view.
-    	// it will unblock the selected blocked device in blocked devices view.
-    	if(iGroup==EGroupPaired) 
-    		{
-    		iView->ProcessCommandL( EAknSoftkeyContextOptions);
-    		}				
-		else
-			{
-			iView->ProcessCommandL( EBTUICmdUnblock);				
-			}
-			 
-        }
-	TRACE_FUNC_EXIT
-    }
--- a/bluetoothengine/btui/Ecom/src/BTUIKeyWatcher.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Listen to CenRep and PubSub Keys
-*
-*/
-
-
-#include <e32base.h>
-#include <btserversdkcrkeys.h>
-#include <btengprivatecrkeys.h>
-#include <bt_subscribe.h>
-#include "BTUIKeyWatcher.h"
-#include "BTUIMainView.h"
-#include "debug.h"
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-// NewL
-// ---------------------------------------------------------------------------
-//
-CBTUIKeyWatcher* CBTUIKeyWatcher::NewL( TAny* aCaller, TInt aServiceID  )
-    {
-    CBTUIKeyWatcher* self = new( ELeave ) CBTUIKeyWatcher( aCaller );
-    CleanupStack::PushL( self );
-    self->ConstructL( aServiceID );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// C++ default constructor
-// ---------------------------------------------------------------------------
-//
-CBTUIKeyWatcher::CBTUIKeyWatcher( TAny* aCaller )
-:   iCaller( aCaller )
-    {
-    }
-
-// ---------------------------------------------------------------------------
-// Symbian 2nd-phase constructor
-// ---------------------------------------------------------------------------
-//
-void CBTUIKeyWatcher::ConstructL( TInt aServiceID )
-    {
-    TRACE_FUNC_ENTRY
-       
-    if( aServiceID & KBTUIPHYCountWatcher )
-    	{
-	    TInt err = iPHYCountKey.Attach( KPropertyUidBluetoothCategory, KPropertyKeyBluetoothPHYCount );
-	    if( !err )
-	        {
-	        iPHYCountWatcher = CBTUIActive::NewL( this, KBTUIPHYCountWatcher, CActive::EPriorityStandard );
-	        if( iPHYCountWatcher != NULL )
-	        	{
-	        	iPHYCountKey.Subscribe( iPHYCountWatcher->RequestStatus() );
-	        	iPHYCountWatcher->GoActive();
-	        	}
-	        else
-	        	{
-	        	TRACE_INFO(_L("new iPHYCountWatcher failed"));
-	        	}
-	        }
-	    else
-	    	{
-	    	TRACE_INFO((_L("Attach failed %d"), err))
-	    	}	
-    	}
-    
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------------------------
-//
-CBTUIKeyWatcher::~CBTUIKeyWatcher()
-    {
-    TRACE_FUNC_ENTRY
-   
-    if( iPHYCountKey.Handle() )
-        {
-        iPHYCountKey.Cancel();
-        }
-    if( iPHYCountWatcher )
-    	{
-    	delete iPHYCountWatcher;
-    	iPHYCountWatcher = NULL;
-    	}
-    iPHYCountKey.Close();
-    
-    TRACE_FUNC_EXIT
-    }
-
-
-// ---------------------------------------------------------------------------
-// From class MBTEngActiveObserver.
-// Processes a changed key value.
-// ---------------------------------------------------------------------------
-//
-void CBTUIKeyWatcher::RequestCompletedL( CBTUIActive* aActive, TInt aId, TInt /*aStatus*/ )
-    {
-    switch( aId )
-        {
-        case KBTUIPHYCountWatcher:
-            iPHYCountKey.Subscribe( aActive->RequestStatus() );
-            aActive->GoActive();
-            static_cast<CBTUIMainView*>(iCaller)->UpdateParentView();
-            break;
-        default:
-        	TRACE_INFO((_L("wrong key notification! id=%d"), aId))
-            break;
-        }
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// From class MBTEngActiveObserver.
-// Handles a leave in RunL/RequestCompletedL by checking that all 
-// the subscriptions are active.
-// ---------------------------------------------------------------------------
-//
-void CBTUIKeyWatcher::HandleError( CBTUIActive* aActive, TInt aId, TInt aError )
-    {
-    TRACE_INFO((_L("status = %d"), aError))
-    (void) aError;
-    if( !aActive->IsActive() )
-        {
-        switch( aId )
-            {
-            case KBTUIPHYCountWatcher:
-                iPHYCountKey.Subscribe( aActive->RequestStatus() );
-                aActive->GoActive();
-                break;
-            default:         
-            	TRACE_INFO((_L("wrong key notification! id=%d"), aId))
-                break;
-            }
-        }
-    }
--- a/bluetoothengine/btui/Ecom/src/BTUIMainContainer.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,466 +0,0 @@
-/*
-* 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 is the implementation of main container. It contains 
-*				  all necessary AVKON components and handles user inputs.
-*
-*/
-
-#include <e32base.h>
-#include <centralrepository.h> 
-#include <barsread.h>   // Resource reader
-#include <BtuiViewResources.rsg>     // Compiled resource ids
-#include <btfeaturescfg.h>					// For EnterpriseEnablementL()
-#include "BTUIMainContainer.h"
-#include "debug.h"      // Global declarations
-#include "btui.h"
-#ifdef __SERIES60_HELP
-#include <csxhelp/bt.hlp.hrh>   // Help ids
-#endif
-
-// ---------------------------------------------------------
-// CBTUIMainContainer::ConstructL
-// Symbian OS 2nd phase constructor can leave
-// ---------------------------------------------------------
-//
-void CBTUIMainContainer::ConstructL(const TRect& aRect, CBTUIMainView* aMainView )
-    {
-    TRACE_FUNC_ENTRY
-
-    CreateWindowL();
-
-	iMainView = aMainView;
-	
-    // Check if listbox is empty
-    __ASSERT_DEBUG(iBtMainListBox==0, PANIC( EBTMainListNotEmpty ));
-    __ASSERT_DEBUG(iBtAllItemsArray==0, PANIC( EBTAllFormatStingsArrayNotEmpty ));
-    __ASSERT_DEBUG(iBtListItemArray==0, PANIC( EBTFormatStingsArrayNotEmpty ));
-
-    // Create main itemlist
-    iBtMainListBox = new (ELeave) CAknSettingStyleListBox;
-    iBtMainListBox->SetContainerWindowL( *this );
-    iBtMainListBox->ConstructL( this, EAknListBoxMarkableList );
-
-
-    // Update settings from original sources via model    
-    iBtEngSettingsRef = iMainView->GetBtSettingsReference();    
-        
-    __ASSERT_DEBUG(iBtEngSettingsRef!=0, PANIC(EBTPanicIllegalValue));
-        
-    // Read all format strings from resources and create array for them
-    iBtAllItemsArray = iCoeEnv->ReadDesCArrayResourceL( R_BT_LABEL_STRINGS );
-    iBtListItemArray = new (ELeave) TMainListItemArray( 
-      iBtAllItemsArray, aMainView, iBtEngSettingsRef );
-
-    // Set up/down arrows at bottom of the screen (scrollbar)
-    iBtMainListBox->CreateScrollBarFrameL( ETrue );
-    iBtMainListBox->ScrollBarFrame()->SetScrollBarVisibilityL( 
-      CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto );
-
-    // Set text labels for list items again (overwriting resource definitions)
-    iBtMainListBox->Model()->SetItemTextArray( iBtListItemArray );
-    iBtMainListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );   // Does not delete items array
-
-    // Set up the observer (events listener)
-    iBtMainListBox->SetListBoxObserver( this );
-
-    
-    
-    SetRect(aRect);
-    ActivateL();    
-
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------
-//
-CBTUIMainContainer::~CBTUIMainContainer()
-    {
-	TRACE_FUNC_ENTRY		   
-    delete iBtMainListBox;
-    delete iBtAllItemsArray;
-    delete iBtListItemArray;
-	TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------
-// CBTUIMainContainer::SizeChanged()
-// From CCoeControl
-// Called by framework when the view size is changed
-// ---------------------------------------------------------
-//
-void CBTUIMainContainer::SizeChanged()
-    {
-	TRACE_FUNC_ENTRY    
-    iBtMainListBox->SetRect(Rect());    // Mandatory, otherwise not drawn
-    }
-
-// ---------------------------------------------------------
-// From CCoeControl
-// CBTUIMainContainer::CountComponentControls() const
-// ---------------------------------------------------------
-//
-TInt CBTUIMainContainer::CountComponentControls() const
-    {
-	TRACE_FUNC_ENTRY    
-	if(iBtMainListBox )
-    	return  1;
-    else
-    	return  0; // return nbr of controls inside this container
-    }
-
-// ---------------------------------------------------------
-// From CCoeControl
-// CBTUIMainContainer::ComponentControl(TInt aIndex) const
-// ---------------------------------------------------------
-//
-CCoeControl* CBTUIMainContainer::ComponentControl(TInt aIndex) const
-    {
-    TRACE_FUNC_ENTRY
-    if( aIndex ==0 )
-    	{
-    	return iBtMainListBox;
-    	}
-    return NULL;
-    }
-
-// ---------------------------------------------------------
-// From CCoeControl
-// CBTUIMainContainer::Draw
-// ---------------------------------------------------------
-//
-void CBTUIMainContainer::Draw(const TRect& /* aRect */) const
-    {
-    }
-
-// ---------------------------------------------------------
-// From CoeControl
-// CBTUIMainContainer::HandleControlEventL
-// ---------------------------------------------------------
-//
-void CBTUIMainContainer::HandleControlEventL( CCoeControl* /* aControl */, TCoeEvent /* aEventType */)
-    {
-    }
-
-// ---------------------------------------------------------
-// From CoeControl
-// CBTUIMainContainer::OfferKeyEventL
-// Redirect keypresses to the listbox
-// ---------------------------------------------------------
-//
-TKeyResponse CBTUIMainContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
-    {
-	TRACE_FUNC_ENTRY    
-    if(( iBtMainListBox ) && ( aKeyEvent.iCode != EKeyLeftArrow ) 
-      && (aKeyEvent.iCode != EKeyRightArrow ))
-        {
-        TKeyResponse res = iBtMainListBox->OfferKeyEventL( aKeyEvent, aType );
-        
-        // Store current item index for options list usage later
-        //
-        iCurrentItemIndex = iBtMainListBox->CurrentItemIndex();
-        return res;
-        }
-    return EKeyWasNotConsumed;
-    }
-
-// ---------------------------------------------------------
-// From MEikListBoxObserver 
-// CBTUIMainContainer::HandleListBoxEventL
-// ---------------------------------------------------------
-//
-void CBTUIMainContainer::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)
-    {
-	TRACE_FUNC_ENTRY
-	
-    __ASSERT_DEBUG(iMainView!=0, PANIC(EBTPanicIllegalValue));
-
-	// this is no longer called, unless MSK is disabled.
-	// if msk is not disabled, then  
-	// BTMainView::HandleCommand(EBTUICmdMSK) is called instead
-    if( aEventType == EEventEnterKeyPressed
-    || aEventType == EEventItemSingleClicked ) // Selection key pressed, or item clicked
-        {
-        TInt currentHighLightPosition = aListBox->CurrentItemIndex();
-        switch(currentHighLightPosition)
-            {
-            case EBTMainListItemPowerMode:
-                iMainView->HandleCommandL( EBTUICmdChangePowerStateSelect );
-                break;
-            case EBTMainListItemVisibilityMode:
-                iMainView->HandleCommandL( EBTUICmdChangeVisibilitySelect );
-                break;
-            case EBTMainListItemNameSetting:
-                iMainView->HandleCommandL( EBTUICmdChangeBTNameSelect );
-                break;
-                
-			// For Bluetooth SIM Access Profile feature
-			//
-			case EBTMainListItemSapMode:
-				iMainView->HandleCommandL( EBTUICmdChangeSapStateSelect );
-				break;
-            default:
-                break;
-            }
-        aListBox->DrawItem(currentHighLightPosition);   // Redraw item only to the screen
-        }
-    }
-
-// ----------------------------------------------------
-// From CEikListBox 
-// CBTUIMainContainer::CurrentItemIndex
-// ----------------------------------------------------
-//
-TInt CBTUIMainContainer::CurrentItemIndex()
-    {
-	TRACE_FUNC_ENTRY
-
-    return iBtMainListBox->CurrentItemIndex();
-    }
-
-// ----------------------------------------------------
-// CBTUIMainContainer::SettingChangedL
-// ----------------------------------------------------
-//
-void CBTUIMainContainer::SettingChanged( TBTMainListItemIndexes /* aListItem */ )
-    {
-	TRACE_FUNC_ENTRY
-
-    iBtMainListBox->DrawDeferred();
-    }    
-    
-#ifdef __SERIES60_HELP
-
-// ---------------------------------------------------------
-// From CCoeControl
-// CBTUIMainContainer::GetHelpContext
-// ---------------------------------------------------------
-//
-void CBTUIMainContainer::GetHelpContext(TCoeHelpContext& aContext) const
-    {
- 	TRACE_FUNC_ENTRY
-
-    aContext.iMajor = KBtuiUid3;
-    aContext.iContext = KBT_HLP_MAIN;
-    }
-
-#else
-
-// ---------------------------------------------------------
-// From CCoeControl
-// CBTUIMainContainer::GetHelpContext
-// ---------------------------------------------------------
-//
-void CBTUIMainContainer::GetHelpContext(TCoeHelpContext& /*aContext*/) const
-    {
-	TRACE_FUNC_ENTRY    
-    }
-
-#endif
-
-// ---------------------------------------------------------
-// From CCoeControl
-// CBTUIMainContainer::HandleResourceChange
-// ---------------------------------------------------------
-//
-void CBTUIMainContainer::HandleResourceChange( TInt aType )
-    {
-	TRACE_FUNC_ENTRY
-	//Pass the event to base class, so whenever resource changing happened, 
-	//this control will be considered to be re-drawed by base class, therefore
-	//no specific DrawNow() function call is needed here.
-    CCoeControl::HandleResourceChange(aType); 
-    
-    //Handle change in layout orientation
-    //aType == KAknsMessageSkinChange is handled by base class.
-    if (aType == KEikDynamicLayoutVariantSwitch)
-        {
-        //"TRect rect = iAvkonAppUi->ClientRect();"
-        // The line above provides to big rectangle in the bottom causing cba's overdrawn by by blank area.
-        // Correct way to do this is below.
-        TRect mainPaneRect;
-        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-        SetRect(mainPaneRect);
-		}      
-    }
-    
-// ---------------------------------------------------------
-// From CCoeControl
-// CBTUIMainContainer::FocusChanged
-// ---------------------------------------------------------
-//
-void CBTUIMainContainer::FocusChanged(TDrawNow /*aDrawNow*/)
-    {
-	TRACE_FUNC_ENTRY        
-	  if( iBtMainListBox)
-        {
-        iBtMainListBox->SetFocus( IsFocused() );
-        }
-    }
-
-    
-// ******************************************* 
-//    Nested class function implemenations:
-// *******************************************
-
-// ----------------------------------------------------
-// CBTUIMainContainer::TMainListItemArray::TMainListItemArray
-// Initialize friend class
-// ----------------------------------------------------
-CBTUIMainContainer::TMainListItemArray::TMainListItemArray( CDesCArray* aBtAllItemsArray, 
-																CBTUIMainView* aMainView, CBTEngSettings* aBtEngSettings)
-																
-        : iArray( *aBtAllItemsArray ),  // Store references
-        iMainView( aMainView ),        
-        iBtEngSettingsRef( aBtEngSettings )
-        
-    {
-	TRACE_FUNC_ENTRY        
-    }
-
-// ----------------------------------------------------
-// CBTUIMainContainer::TMainListItemArray::MdcaCount()
-// ----------------------------------------------------
-//
-TInt CBTUIMainContainer::TMainListItemArray::MdcaCount() const
-    {
-	TRACE_FUNC_ENTRY    
-    return KNumberOfMainViewItems;
-    }
-
-// ----------------------------------------------------
-// CBTUIMainContainer::TMainListItemArray::MdcaPointL
-// Main view listbox item formatter:
-// Returns the current format string depending value
-// of the item concerned.
-// ----------------------------------------------------
-//
-TPtrC CBTUIMainContainer::TMainListItemArray::MdcaPoint( TInt aIndex ) const
-    {
-	TRACE_FUNC_ENTRY    
-    _LIT(KBTUIEmptyFormatString, " \t \t\t "); // Empty format string if illegal indexing
-    TPtrC chosen;
-    	
-    switch ( aIndex )
-        {
-        case EBTMainListItemPowerMode:
-            {
-            TBTPowerStateValue powerState;
-            iBtEngSettingsRef->GetPowerState(powerState);            
-            if( powerState==EBTPowerOn )
-                chosen.Set( iArray.MdcaPoint( EBTUISettModulePowerOn ));
-            else
-                chosen.Set( iArray.MdcaPoint( EBTUISettModulePowerOff ));
-            break;
-            }
-
-        case EBTMainListItemVisibilityMode:
-            {
-        	TBTVisibilityMode mode;
-        	iBtEngSettingsRef->GetVisibilityMode(mode);          	
-            
-            switch(mode)
-                {                
-                case EBTVisibilityModeGeneral:
-                    chosen.Set( iArray.MdcaPoint( EBTUISettVisibilityModeGeneral ));
-                    break;
-                                 
-                case EBTVisibilityModeHidden:
-                    chosen.Set( iArray.MdcaPoint( EBTUISettVisibilityModeHidden ));
-                    break;
-                   
-                case EBTVisibilityModeTemporary:
-                    chosen.Set( iArray.MdcaPoint( EBTUISettVisibilityModeTemp ));
-                    break;                    
-                   
-                default:
-                    break;
-                }
-            break;
-            }
-
-        case EBTMainListItemNameSetting:
-            {
-            TDes &buf = MUTABLE_CAST(TBuf<KBTUIMaxFormattedNameLength>&,iItemText);
-            buf.Zero();
-            buf.Append( iArray.MdcaPoint( EBTUISettBTNameHeader ) );
-            buf.Append( *iMainView->GetBTLocalName() );
-            chosen.Set( iItemText );
-            break;
-            }
-
-		// For Bluetooth SIM Access Profile feature
-		case EBTMainListItemSapMode:
-            {
-			BluetoothFeatures::TEnterpriseEnablementMode mode = BluetoothFeatures::EEnabled;
-			TRAPD(err, mode = BluetoothFeatures::EnterpriseEnablementL());
-			if ( err == KErrNone )
-				{
-				if ( mode == BluetoothFeatures::EDataProfilesDisabled )
-					{
-					chosen.Set( iArray.MdcaPoint( EBTUISettSapDisabled ));
-					break;
-					}
-				}
-			
-			TInt sapStatus;    
-			TRAP_IGNORE(GetSapStatusL(sapStatus););
-			    
-			if(sapStatus==EBTSapEnabled)
-				{
-				 chosen.Set( iArray.MdcaPoint( EBTUISettSapEnabled ));
-				}
-			else
-				{
-				 chosen.Set( iArray.MdcaPoint( EBTUISettSapDisabled ));
-				}          
-				   
-			TInt sapMode = KErrNone;
-			TRAP_IGNORE(sapMode = iMainView->GetSapStatusL());  
-			
-			
-			if(sapMode==EBTSapEnabled)
-				{
-				if ( sapMode ) 
-					{			
-					chosen.Set( iArray.MdcaPoint( EBTUISettSapEnabled ));
-					}
-				else
-					{
-					chosen.Set( iArray.MdcaPoint( EBTUISettSapDisabled ));
-					}
-				}
-			               
-            break;
-            }	
-        default:
-            chosen.Set( KBTUIEmptyFormatString );
-            break;
-        }
-
-    return chosen;
-    }
-
-// ----------------------------------------------------------------------
-// CBTUIMainContainer::TMainListItemArray::GetSapStatusL(TInt& aStatus)
-// ----------------------------------------------------------------------
-//
-void CBTUIMainContainer::TMainListItemArray::GetSapStatusL( TInt& aStatus )
-{    
-    CRepository* repository = CRepository::NewL(KCRUidBTEngPrivateSettings);
-    CleanupStack::PushL(repository);            	
-    repository->Get(KBTSapEnabled, aStatus);
-    CleanupStack::PopAndDestroy(repository);      
-}
--- a/bluetoothengine/btui/Ecom/src/BTUIMainView.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1402 +0,0 @@
-/*
-* 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 the settings view of btui.
-*
-*/
-
-#include <aknViewAppUi.h>       		// AVKON components
-#include <avkon.hrh>
-#include <akntitle.h>
-#include <featmgr.h>            		// Feature Manager API
-
-#include "btui.hrh"             		// Menu commands
-#include "btui.h"
-#include "BTUIMainView.h"
-#include "BTUIMainContainer.h"
-#include "debug.h"
-#include "BTUIKeyWatcher.h"
-#include "BTUIPairedDevicesView.h"
-#include "BTUIBlockedDevicesView.h"
-
-#include <BtuiViewResources.rsg>     	// Compiled resource ids
-#include <AknGlobalNote.h>
-#include <aknnotewrappers.h>
-#include <aknradiobuttonsettingpage.h>
-#include <akntextsettingpage.h>
-#include <StringLoader.h>   			// Series 60 localisation stringloader
-#include <aknslidersettingpage.h> 		//visibility time setting page
-#include <data_caging_path_literals.hrh> 
-#include <bautils.h>         			// BAFL utils (for language file)
-#include <btui.mbg>						// application icon for General Setting
-#include <AknMediatorFacade.h>
-#include <AknUtils.h>					// For char filter
-#include <CoreApplicationUIsSDKCRKeys.h>
-#include <hlplch.h>         			// Help launcher
-#include <secondarydisplay/BtuiSecondaryDisplayAPI.h>
-#include <btengprivatecrkeys.h>
-#include <gstabhelper.h>
-#include <gsfwviewuids.h>
-#include <gsparentplugin.h>
-#include <utf.h>        				// CnvUtfConverter
-#include <btfeaturescfg.h>					// For EnterpriseEnablementL()
-#include <btnotif.h>
-
-// ---------------------------------------------------------
-// CBTUIMainView::NewL
-// Two phased constructor 
-// ---------------------------------------------------------
-//
-CBTUIMainView* CBTUIMainView::NewL(MBtuiPluginViewActivationObserver* aObserver)
-    {
-    //TRACE_FUNC_ENTRY
-
-    CBTUIMainView* self = new (ELeave) CBTUIMainView(aObserver);
-    
-	// Set construction type, before ConstructL().	
-    self->iConstructAsGsPlugin = EFalse;                  
-
-	CleanupStack::PushL( self );	
- 	self->ConstructL();
-	CleanupStack::Pop(self);
-
-	//TRACE_FUNC_EXIT
-    return self;
-    }
-
-
-// ---------------------------------------------------------
-// CBTUIMainView::NewL
-// Two phased constructor
-// ---------------------------------------------------------
-//
-CBTUIMainView* CBTUIMainView::NewGsPluginL()
-    {
-    //TRACE_FUNC_ENTRY
-
-    CBTUIMainView* self = new (ELeave) CBTUIMainView(NULL);    
-
-	// Set construction type, before ConstructL(). 
-    self->iConstructAsGsPlugin = ETrue;
-    
-	CleanupStack::PushL( self );	
- 	self->ConstructL();
-
-	CleanupStack::Pop( self );
-
-	//TRACE_FUNC_EXIT
-    return self;
-    }
-
-
-// ---------------------------------------------------------
-// CBTUIMainView::CBTUIMainView
-// ---------------------------------------------------------
-    
-CBTUIMainView::CBTUIMainView(MBtuiPluginViewActivationObserver* aObserver )
-	:iConstructAsGsPlugin(EFalse), iActivationObserver(aObserver)
-	{
-	}
-// ---------------------------------------------------------
-// CBTUIMainView::ConstructL
-// Symbian 2nd phase constructor can leave.
-// ---------------------------------------------------------
-//
-void CBTUIMainView::ConstructL()
-    {
-	TRACE_FUNC_ENTRY
-	    
-	// Plugin load resource manually.
-	// These resources are needed by BaseConstructL
-	
-    iEikEnv = CEikonEnv::Static();
-
-    TFileName filename;
-    filename += KFileDrive;
-    filename += KDC_RESOURCE_FILES_DIR; 
-    filename += KResourceFileName;
-
-    BaflUtils::NearestLanguageFile(iEikEnv->FsSession(),filename);
-    iResourceFileFlag=iEikEnv->AddResourceFileL(filename);
-        
-	// According to Construction type, different softkey resource will be used.
-	//
-	if(iConstructAsGsPlugin)
-		{
-	    iViewArray = new CArrayPtrFlat<MGSTabbedView>( 3 );   
-	    iTabHelper = CGSTabHelper::NewL();
-	    iViewArray->AppendL(this); 
-		iParentViewNotSetYet = ETrue;
-		
-		iKeyWatcher = CBTUIKeyWatcher::NewL(this, KBTUIPHYCountWatcher);
-
-		// Construct OtherDeviceView
-		//
-	    CAknView* pairedDeviceView = CBTUIPairedDevicesView::NewLC( this, iViewArray );	
-	    iAppUi->AddViewL( pairedDeviceView ); // Transfer ownership to CAknViewAppUi
-	    CleanupStack::Pop(pairedDeviceView );
-
-		// Construct BlockDeviceView
-		//
-	    CAknView* blockedDeviceView = CBTUIBlockedDevicesView::NewLC( this, iViewArray );
-	    iAppUi->AddViewL( blockedDeviceView ); // Transfer ownership to CAknViewAppUi
-	    CleanupStack::Pop(blockedDeviceView );        
-		
-		BaseConstructL( R_BTUI_MAIN_VIEW_GS_PLUGIN );     	
-		}
-	else
-		{
-		BaseConstructL( R_BTUI_MAIN_VIEW );
-		}
-
-    iBtEngSettings = CBTEngSettings::NewL(this);         
-        
-	// Sets up TLS, must be done before FeatureManager is used.
-	FeatureManager::InitializeLibL();
-	iCoverDisplayEnabled = FeatureManager::FeatureSupported(KFeatureIdCoverDisplay);
-    	
-
-	TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------
-// ---------------------------------------------------------
-// Destructor.
-// ---------------------------------------------------------
-//
-CBTUIMainView::~CBTUIMainView()
-    {
-	TRACE_FUNC_ENTRY
-    
-	iEikEnv->DeleteResourceFile(iResourceFileFlag);
-	
-    if ( iContainer )
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        }
-	
-	delete iBtEngSettings;
-    delete iContainer;	
-	delete iIdle;
-
-    if(iConstructAsGsPlugin)
-    	{
-	    if ( iViewArray )
-	        {
-	        iViewArray->Reset();
-	        delete iViewArray;
-	        }    	
-	        
-	    delete iTabHelper;
-	    delete iKeyWatcher;
-    	}
-    
-	// Frees the TLS. Must be done after FeatureManager is used.
-    FeatureManager::UnInitializeLib();  
-    	
-
-	TRACE_FUNC_EXIT
-	}
-
-// ----------------------------------------------------
-// CBTUIMainView::PowerStateChanged
-// ----------------------------------------------------
-//
-void CBTUIMainView::PowerStateChanged( TBTPowerStateValue  )
-    {
-	TRACE_FUNC_ENTRY
-	if(iContainer)
-    	{    
-        iContainer->SettingChanged(EBTMainListItemPowerMode);
-    	}
-	
-	if( iConstructAsGsPlugin )
-		{
-		UpdateParentView();
-		}
-	TRACE_FUNC_EXIT	
-    }
-// ----------------------------------------------------
-// CBTUIMainView::VisibilityModeChanged
-// ----------------------------------------------------
-//    
-void CBTUIMainView::VisibilityModeChanged( TBTVisibilityMode  )
-    {
-	TRACE_FUNC_ENTRY
-	if(iContainer)
-    	{
-    	iContainer->SettingChanged(EBTMainListItemVisibilityMode);
-    	}
-    
-    if( iConstructAsGsPlugin )
-		{
-		UpdateParentView();
-		}	
-    }
-    
-// ---------------------------------------------------------
-// From CAknView
-// CBTUIMainView::Id
-// ---------------------------------------------------------
-//
-TUid CBTUIMainView::Id() const
-    {
-	TRACE_FUNC_ENTRY    
-    if(iConstructAsGsPlugin)
-    	{
-	    return KGsBtuiPluginUid; //same as ecom impl UID, required by GS interface.
-    	}
-    else
-    	{
-    	return KBtuiPluginUidMainView;    //view id
-    	}
-    }
-// ---------------------------------------------------------
-// CBTUIMainView::HandleMiddleSoftkey
-// Handles middle soft key
-// ---------------------------------------------------------
-//    
-void CBTUIMainView::HandleMiddleSoftkey()
-    {
-		TRACE_FUNC_ENTRY 	
-       	if( iContainer == NULL ) return;
-    	
-        TInt currentHighLightPosition= iContainer->CurrentItemIndex();
-        switch(currentHighLightPosition)
-            {
-            case EBTMainListItemPowerMode:
-                HandleCommand( EBTUICmdChangePowerStateSelect );
-                break;
-            case EBTMainListItemVisibilityMode:
-                HandleCommand( EBTUICmdChangeVisibilitySelect );
-                break;
-            case EBTMainListItemNameSetting:
-                HandleCommand( EBTUICmdChangeBTNameSelect );
-                break;
-                 
-			// For Bluetooth SIM Access Profile feature
-			//
-			case EBTMainListItemSapMode:
-				HandleCommand( EBTUICmdChangeSapStateSelect );
-				break;
-            default:
-                break;
-            }
-		TRACE_FUNC_EXIT	        	    
-    }    
-// ---------------------------------------------------------
-// TUid CBTUIMainView::HandleCommand
-// ---------------------------------------------------------
-//   
-void CBTUIMainView::HandleCommand(TInt aCommand)    
-{
-    TRAP_IGNORE(HandleCommandL(aCommand));    
-}
-// ---------------------------------------------------------
-// CBTUIMainView::HandleCommandL
-// Redirects commands to the appui class.
-// ---------------------------------------------------------
-//
-void CBTUIMainView::HandleCommandL(TInt aCommand)
-    {
-	TRACE_INFO((_L(">> CBTUIMainView::HandleCommandL: %d"), aCommand))        
-    switch ( aCommand )
-        {
-        //middle soft key is handled here
-        case EBTUICmdMSK:
-	 		 HandleMiddleSoftkey();
-	 		 break;
-         case EAknSoftkeyBack:
-	         AppUi()->ActivateLocalViewL(iParentView.iViewUid);
-             break;
-
-        case EAknSoftkeyExit:
-            {
-			AppUi()->ProcessCommandL(EEikCmdExit);
-            break;
-            }
-            
-#ifdef __SERIES60_HELP
-        case EAknCmdHelp:
-            {
-            HlpLauncher::LaunchHelpApplicationL(
-            	iEikonEnv->WsSession(), AppUi()->AppHelpContextL());
-            break;
-            }          
-#endif
-        case EBTUICmdChangePowerStateMenu:
-            {
-            AskPowerModeDlgL();
-            break;
-            }
-
-        case EBTUICmdChangePowerStateSelect:
-            {            
-            TBTPowerStateValue powerState;
-            iBtEngSettings->GetPowerState(powerState);                        
-            if(powerState==EBTPowerOn)
-                {
-                SetPowerStatusL( EFalse );
-                }
-            else
-                {
-                SetPowerStatusL( ETrue );
-                }            
-            break;
-            }
-
-        case EBTUICmdChangeVisibilitySelect: // now both select key and menu command will triger the setting page.
-        case EBTUICmdChangeVisibilityMenu:
-            {
-            AskVisibilityDlgL();
-            break;
-            }
-
-        case EBTUICmdChangeBTNameMenu:
-        case EBTUICmdChangeBTNameSelect:
-            {
-            AskNewBtNameDlgL();
-            iContainer->SettingChanged(TBTMainListItemIndexes(iContainer->CurrentItemIndex())); 
-            break;
-            }
-		
-		// For Bluetooth SIM Access Profile feature
-		case EBTUICmdChangeSapStateSelect:
-            {
-	        
-	        if ( BluetoothFeatures::EnterpriseEnablementL() == BluetoothFeatures::EDataProfilesDisabled )
-	        	{
-		        RNotifier notifier;
-		        User::LeaveIfError(notifier.Connect());
-		        CleanupClosePushL(notifier);
-				User::LeaveIfError(notifier.StartNotifier(KBTEnterpriseItSecurityInfoNotifierUid, KNullDesC8 ));
-				CleanupStack::PopAndDestroy(&notifier);
-	        	}
-	        else
-	        	{
-	        	TInt sapStatus;
-	        	CRepository* repository = CRepository::NewL(KCRUidBTEngPrivateSettings);
-	        	CleanupStack::PushL(repository);            	
-				repository->Get(KBTSapEnabled, sapStatus);
-				CleanupStack::PopAndDestroy(repository);			    
-				
-	           if(sapStatus==EBTSapEnabled)
-				    {
-	                 SetSapStatusL( EBTSapDisabled );
-	                }
-	           else
-	                {
-	                 SetSapStatusL( EBTSapEnabled );
-					}     
-	            iContainer->SettingChanged(
-	              TBTMainListItemIndexes(iContainer->CurrentItemIndex())); 				  
-              	}     
-            break;
-            }
-
-		// For Bluetooth SIM Access Profile feature
-        case EBTUICmdChangeSapStateMenu:
-            {
-            AskSapModeDlgL();
-            iContainer->SettingChanged(
-              TBTMainListItemIndexes(iContainer->CurrentItemIndex())); 				
-            break;
-            }				
-
-        default:
-            {
-            AppUi()->HandleCommandL( aCommand );
-			iContainer->SettingChanged(
-			  TBTMainListItemIndexes(iContainer->CurrentItemIndex())); 
-            break;
-            }
-        }
-	TRACE_FUNC_EXIT        
-    }
-
-
-// ---------------------------------------------------------
-// From CAknView
-// CBTUIMainView::DoActivateL
-// ---------------------------------------------------------
-//
-void CBTUIMainView::DoActivateL( const TVwsViewId&  aPrevViewId,
-                                 TUid /*aCustomMessageId*/,
-                                 const TDesC8& /*aCustomMessage*/)
-    {            
-    TRACE_FUNC_ENTRY
-    
-    
-	if ( BluetoothFeatures::EnterpriseEnablementL() == BluetoothFeatures::EDisabled ) 
-		{
-		RNotifier notifier;
-		User::LeaveIfError(notifier.Connect());
-		CleanupClosePushL(notifier);
-		User::LeaveIfError(notifier.StartNotifier(KBTEnterpriseItSecurityInfoNotifierUid, KNullDesC8 ));
-		CleanupStack::PopAndDestroy(&notifier);
-		
-		AppUi()->ActivateLocalViewL(aPrevViewId.iViewUid); //go back straight away
-		return;
-		}
-    
-    
-    if( iConstructAsGsPlugin )
-        {
-	 	// Only set parent view when entering BT GS setting.
-		// since tab change chould make aPrevViewId assign to non-parent views. e.g. paired or blocked view.
-		if(iParentViewNotSetYet)
-			{
-	        iParentView = aPrevViewId; 
-	        iParentViewNotSetYet = EFalse;
-			}
-
-		// Setup tab group
-        iTabHelper->CreateTabGroupL( Id(), iViewArray ); 
-        } 
-        
-    iContainer = new (ELeave) CBTUIMainContainer;
-    iContainer->SetMopParent(this); // MObjectProvider
-    iContainer->ConstructL( ClientRect(), this );
-
-    // Setup the title
-    //
-    HBufC* btTitleMain = iCoeEnv->AllocReadResourceLC(R_BT_TITLE_BLUETOOTH);
-    CEikStatusPane* statusPane = StatusPane();
-    CAknTitlePane* titlePane;
-    titlePane = (CAknTitlePane*) statusPane->ControlL(TUid::Uid(EEikStatusPaneUidTitle));
-    titlePane->SetTextL(btTitleMain->Des());
-    CleanupStack::PopAndDestroy(btTitleMain); // btTitleMain
-    btTitleMain = NULL;
-
-    AppUi()->AddToStackL( *this, iContainer );
-	
-	//Check if the local name has been set. If not ask user to set name
-	
-	TBool nameStatus = EFalse;
-    TInt err = IsLocalNameModifiedL( nameStatus );
-    
-    if( err || nameStatus == EBTLocalNameDefault )
-    	{
-    	InitiateBTLocalNameQueryL();    // Ask local Bluetooth name if not given yet.
-    	}
-	
-	// notify observer   
-    if( iActivationObserver  && iConstructAsGsPlugin == EFalse)
-    {    	    
-        iActivationObserver->PluginViewActivated(EMainViewId);        
-    }
-    
-	TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------
-// From CAknView
-// CBTUIMainView::DoDeactivate
-// ---------------------------------------------------------
-//
-void CBTUIMainView::DoDeactivate()
-    {
-	TRACE_FUNC_ENTRY
-
-    if ( iContainer )
-        {
-        AppUi()->RemoveFromStack( iContainer );
-        }
-
-    delete iContainer;
-    iContainer = NULL;    
-     
-    if(iConstructAsGsPlugin)
-    	{
-    	iTabHelper->RemoveTabGroup();
-	    CGSBaseView::DoDeactivate();  	
-    	}
-	TRACE_FUNC_EXIT
-    
-    }
-
-// ---------------------------------------------------------
-// From CAknView
-// CBTUIMainView::DynInitMenuPaneL
-// Shows selected item's context sensitive options menu.
-// ---------------------------------------------------------
-//
-void CBTUIMainView::DynInitMenuPaneL( TInt aResId, CEikMenuPane* aMenu )
-    {
-	TRACE_FUNC_ENTRY
-    
-	// dim help if it exists and is not supported	
-	TInt tmp;	
-	if (  aMenu->MenuItemExists(EAknCmdHelp,tmp ) )			
-		{			
-		aMenu->SetItemDimmed(EAknCmdHelp,
-		  !FeatureManager::FeatureSupported( KFeatureIdHelp ) );
-		}
-			
-    if ( aResId == R_BTUI_MAIN_VIEW_MENU )
-        {
-        // Set all menus dimmed at first(hide them all)
-        //
-        aMenu->SetItemDimmed(EBTUICmdChangePowerStateMenu, ETrue);
-        aMenu->SetItemDimmed(EBTUICmdChangeVisibilityMenu, ETrue);
-        aMenu->SetItemDimmed(EBTUICmdChangeBTNameMenu, ETrue);
-        if ( FeatureManager::FeatureSupported( KFeatureIdBtSap ) )
-            aMenu->SetItemDimmed(EBTUICmdChangeSapStateMenu, ETrue);
-
-        }
-	TRACE_FUNC_EXIT        
-    }
-
-// ---------------------------------------------------------
-// CBTUIMainView::SettingChangedL
-// Redraws the BT Name field.
-// ---------------------------------------------------------
-//
-void CBTUIMainView::SettingChangedL( TBTMainListItemIndexes aListItem )
-	{
-	TRACE_FUNC_ENTRY
-	if(iContainer)
-		{
-		iContainer->SettingChanged(aListItem);	
-		}
-	
-	}
-
-// ----------------------------------------------------
-// CBTUIMainView::SetPowerStatusL
-// ----------------------------------------------------
-//
-TInt CBTUIMainView::SetPowerStatusL( TBool aValue )
-    {
-	TRACE_FUNC_ENTRY
-
-    TInt errorCode = KErrNone;    
-    TBTPowerStateValue previousPowerMode;
-    errorCode=iBtEngSettings->GetPowerState(previousPowerMode); 
-    if(errorCode)    
-    	return errorCode;    
-                   
-    TBool legalToChange = ETrue;
-
-    if ( ( previousPowerMode==EBTPowerOn ) && ( !aValue )) // power ON -> OFF
-        {
-        TRACE_INFO(_L("power ON -> OFF"))
-
-        // Check active connections before query                        
-        if( TBTUIViewsCommonUtils::IsAnyDeviceConnectedL())
-        	{
-            CAknQueryDialog* dlg = CAknQueryDialog::NewL();
-
-			if(iCoverDisplayEnabled)
-				{
-				CleanupStack::PushL(dlg);
-    			dlg->PublishDialogL(ECmdShowBtSwitchOffAnywayQuery, KUidCoverUiCategoryBtui); // initializes cover support				
-				CleanupStack::Pop(dlg);
-				}
-
-            TInt keypress = dlg->ExecuteLD( R_BT_SWITCH_OFF_ANYWAY_QUERY );
-            if( !keypress )  // User has not accepted the dialog
-                {
-                legalToChange = EFalse;
-                }
-            }
-        TRACE_INFO((_L("power ON -> OFF, legalToChange = %d"), legalToChange))
-
-        }
-    else if ( ( !previousPowerMode ) && ( aValue ) ) // power OFF -> ON
-        {
-        TRACE_INFO(_L("power OFF -> ON"))
-
-        TInt offlineModeOff = 0;    // possible values are 0 and 1
-        TInt activationEnabled = 0; // possible values are 0 and 1
-               
-        CRepository* repository = CRepository::NewL(KCRUidCoreApplicationUIs);
-        CleanupStack::PushL(repository);
-        repository->Get(KCoreAppUIsNetworkConnectionAllowed, offlineModeOff);
-		// Closing connection:
-		CleanupStack::PopAndDestroy(repository);        
-        repository =NULL;                        
-        repository = CRepository::NewL(KCRUidBluetoothEngine);
-		// Check activation enabled
-		CleanupStack::PushL(repository);
-		repository->Get(KBTEnabledInOffline, activationEnabled);
-		// Closing connection:
-		CleanupStack::PopAndDestroy(repository);
-        
-                
-		TRACE_INFO((_L("power OFF -> ON, offlineModeOff = %d"), offlineModeOff ))
-		TRACE_INFO((_L("power OFF -> ON, activationEnabled = %d"),  activationEnabled ))
-
-        // Is offline mode on
-        //
-        if ( !offlineModeOff )
-            {
-            // Choose user interaction
-            //
-            if ( activationEnabled )
-                {
-                // Create and show query
-                //
-                CAknQueryDialog* dlg = CAknQueryDialog::NewL();
-                
-				if(iCoverDisplayEnabled)
-					{  
-					CleanupStack::PushL(dlg);
-    	   	    	dlg->PublishDialogL(ECmdShowBtActivateInOfflineQuery, KUidCoverUiCategoryBtui); // initializes cover support
-					CleanupStack::Pop(dlg);
-					}
-
-                TInt keypress = dlg->ExecuteLD( R_BT_ACTIVATE_IN_OFFLINE_QUERY );
-                if( !keypress ) // User has not accepted the dialog
-                    {
-                    legalToChange = EFalse;
-                    }
-                }
-            else
-                {
-                legalToChange = EFalse;
-
-                // Load a string, create and show a note
-                //
-                HBufC* stringHolder = StringLoader::LoadLC( R_BT_OFFLINE_DISABLED );
-                CAknInformationNote* note = new (ELeave) CAknInformationNote();
-                
-				if(iCoverDisplayEnabled)
-					{  
-					CleanupStack::PushL(note);
- 	    	   	    note->PublishDialogL(ECmdShowBtOfflineDisabledNote, KUidCoverUiCategoryBtui); // initializes cover support
-					CleanupStack::Pop(note);
-					}
-                
-                note->ExecuteLD( *stringHolder );
-                CleanupStack::PopAndDestroy(stringHolder); //stringHolder
-                }
-            }
-        }
-
-    TRACE_INFO((_L("legalToChange = %d"), legalToChange))
-
-    // Switch powermode
-    //
-    if ( legalToChange )
-        {
-        
-        TInt errorCode = KErrNone;    
-        TBTPowerStateValue powerMode;
-        if(aValue)
-    	    {
-    		powerMode=EBTPowerOn;	    	
-    	    }    	
-        else
-        	{
-        	powerMode=EBTPowerOff;
-        	}
-        	
-        errorCode=iBtEngSettings->SetPowerState(powerMode); 
-                
-        if( (errorCode == KErrNone ) && (aValue))
-        
-        	{
-        	//Check the visibility mode
-        	TBTVisibilityMode visiMode;
-        	errorCode=iBtEngSettings->GetVisibilityMode(visiMode);
-        	if(errorCode==KErrNone)
-	        	{        		            		      	        		        	
-	        	if (visiMode == EBTVisibilityModeHidden)
-	        		{
-	        		//Show note
-	        		CAknNoteDialog* dlg = new (ELeave) CAknNoteDialog( CAknNoteDialog::EConfirmationTone,
-	                                                                 CAknNoteDialog::ELongTimeout );
-					if(iCoverDisplayEnabled)
-						{  
-						CleanupStack::PushL(dlg);
-		    	   	    dlg->PublishDialogL(ECmdBtuiShowBtHiddenFromOthersNote, KUidCoverUiCategoryBtui); // initializes cover support
-						CleanupStack::Pop(dlg);
-						}
-											
-	                dlg->ExecuteLD( R_BT_HIDDEN_FROM_OTHERS );
-	        		}
-	        	} 
-        	}
-        if ( errorCode != KErrNone && errorCode != KErrAlreadyExists ) 
-            {
-            TRAP_IGNORE(TBTUIViewsCommonUtils::ShowGeneralErrorNoteL());
-            }
-           
-        }
-        
-    TRACE_INFO((_L("SetPowerStatusL() complete. errorCode = %d"), errorCode))
-    return errorCode;
-    }
-
-// ----------------------------------------------------------
-// CBTUIMainView::SetVisibilityStatusL
-// ----------------------------------------------------------
-//
-void CBTUIMainView::SetVisibilityStatusL( TBTVisibilityMode aMode )
-    {
-	TRACE_FUNC_ENTRY
-
-    TInt errorCode = KErrNone;
-    
-    switch( aMode )
-        {
-            case EBTVisibilityModeGeneral:
-            {            
-            errorCode = iBtEngSettings->SetVisibilityMode(aMode);
-            
-			if(errorCode == KErrNone)
-				{
-	            CAknNoteDialog* dlg = new (ELeave) CAknNoteDialog( CAknNoteDialog::EConfirmationTone,
-                                                               CAknNoteDialog::ELongTimeout );
-
-				if(iCoverDisplayEnabled)
-					{  
-					CleanupStack::PushL(dlg);
-	    	   	    dlg->PublishDialogL(ECmdShowBtPhoneVisibToAllNote, KUidCoverUiCategoryBtui); // initializes cover support
-					CleanupStack::Pop(dlg);
-					}
-    	        dlg->ExecuteLD( R_BT_PHONE_VISIB_TO_OTH_NOTE );
-				}
-            }
-            break;
-
-            case EBTVisibilityModeHidden:
-            {            
-            errorCode = iBtEngSettings->SetVisibilityMode(aMode);
-            
-			if(errorCode == KErrNone)
-				{
-	            CAknNoteDialog* dlg = new (ELeave) CAknNoteDialog( CAknNoteDialog::EConfirmationTone,
-                                                               CAknNoteDialog::ELongTimeout );
-
-				if(iCoverDisplayEnabled)
-					{  
-					CleanupStack::PushL(dlg);
-	    	   	    dlg->PublishDialogL(ECmdBtuiShowBtHiddenFromOthersNote, KUidCoverUiCategoryBtui); // initializes cover support
-					CleanupStack::Pop(dlg);
-					}
-    	        dlg->ExecuteLD( R_BT_HIDDEN_FROM_OTHERS );		
-				}
-            }
-            break;
-                    
-            case EBTVisibilityModeTemporary:
-            {
-            // Asks user to turn on Bluetooth, if temporary visibility is chosen.            
-            if( TBTUIViewsCommonUtils::TurnBTOnIfNeededL(iBtEngSettings,iCoverDisplayEnabled) != KErrNone)
-            	{
-            	return;
-            	}            
-		    TInt sliderValue = 1; 			    
-		    CAknSettingPage* dlg = 
-		        new(ELeave) CAknSliderSettingPage(R_VISIBILITY_TIME_SETTING_PAGE, 
-		                                          sliderValue);			 
-		    
-		    if (dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged))
-		        {			        		        
-		        errorCode = iBtEngSettings->SetVisibilityMode( aMode, sliderValue );
-		        }
-            }
-            break;
-
-            default:
-                break;
-        }
-
-    if((errorCode != KErrNone) && (errorCode != KErrAlreadyExists))
-        {
-	    TRAP_IGNORE(TBTUIViewsCommonUtils::ShowGeneralErrorNoteL());
-        }
-	TRACE_FUNC_EXIT        
-    }
-    
-// ----------------------------------------------------------
-// CBTUIMainView::GetBTLocalName
-// ----------------------------------------------------------
-//
-TDesC* CBTUIMainView::GetBTLocalName()
-    {
-	TRACE_FUNC_ENTRY
-
-    iTempNameBuffer.Zero();                 // Empty Local BT device name   
-    TInt err=iBtEngSettings->GetLocalName( iTempNameBuffer );// Store name into member variable
-    if(err!=KErrNone)
-    	TRAP_IGNORE(TBTUIViewsCommonUtils::ShowGeneralErrorNoteL());
-
-    // Cut the excess part of the name away. The query can handle only 
-    // KBTUIMaxNameLength characters.
-    //
-    if( iTempNameBuffer.Length() > KBTUIMaxNameLength )
-        {
-        iTempNameBuffer.SetLength( KBTUIMaxNameLength );
-        }
-	TRACE_FUNC_EXIT
-    return &iTempNameBuffer;                // And return reference for it
-    }
-
-// ----------------------------------------------------------
-// CBTUIMainView::AskNewBtNameDlgL
-// ----------------------------------------------------------
-//
-void CBTUIMainView::AskNewBtNameDlgL()
-    {
-    TRACE_FUNC_ENTRY
-
-    // Cut the excess part of the name away. The query can handle only 
-    // KBTUIMaxNameLength characters.
-    //
-    if( iTempNameBuffer.Length() > KBTUIMaxNameLength )
-        {
-        iTempNameBuffer.SetLength( KBTUIMaxNameLength );
-        }
-
-    FOREVER
-        {
-        CAknTextSettingPage* dlg = new( ELeave )CAknTextSettingPage( R_BT_NAME_SETTING_PAGE,
-                                                                     iTempNameBuffer );
-		if( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ))
-            {
-            // Remove trouble making control chars
-	        AknTextUtils::StripCharacters(iTempNameBuffer,  KAknStripListControlChars);    
-	                 
-            iTempNameBuffer.TrimAll();                  // Remove spaces and check what is left..
-            if( iTempNameBuffer.Length() > 0 )
-                {
-                
-                if(iBtEngSettings->SetLocalName(iTempNameBuffer) != KErrNone)
-                    {
-                    TBTUIViewsCommonUtils::ShowGeneralErrorNoteL();
-                    }
-				TRACE_FUNC_EXIT       
-                return;
-                }
-            }
-        else
-            {
-            TRACE_FUNC_EXIT       
-            return; // User has cancelled this operation
-            }
-        }
-	 
-    }
-
-// ----------------------------------------------------------
-// CBTUIMainView::AskPowerModeDlgL
-// ----------------------------------------------------------
-//
-void CBTUIMainView::AskPowerModeDlgL()
-    {
-    TRACE_FUNC_ENTRY
-
-    CDesCArrayFlat* items = iCoeEnv->ReadDesCArrayResourceL( R_BT_POWER_MODES );
-    CleanupStack::PushL(items);
-    TBTPowerStateValue powerState;
-    iBtEngSettings->GetPowerState(powerState);          
-    TInt currentItem = !powerState; // Implicit cast from Not-TBool to int (inverted)
-
-    CAknRadioButtonSettingPage* dlg = new ( ELeave )CAknRadioButtonSettingPage( 
-      R_BT_POWER_SETTING_PAGE, currentItem, items );
-    if( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ))
-        {
-        SetPowerStatusL( static_cast<TBool>( !currentItem )); // Cast it back (invert again)
-        }
-    CleanupStack::PopAndDestroy(items); // items
-    TRACE_FUNC_EXIT
-    }
-
-// ----------------------------------------------------------
-// CBTUIMainView::AskVisibilityDlgL
-// ----------------------------------------------------------
-//
-void CBTUIMainView::AskVisibilityDlgL()
-    {
-	TRACE_FUNC_ENTRY
-
-    CDesCArrayFlat* items = iCoeEnv->ReadDesCArrayResourceL( R_BT_VISIBILITY_MODES );
-    CleanupStack::PushL(items);
-
-    TInt currentItem = 0;  // Current position at radio button setting page    
-    TBTVisibilityMode currentMode;
-    TInt errorCode(iBtEngSettings->GetVisibilityMode(currentMode));    
-    if(errorCode==KErrNone)
-	    {
-
-	    switch( currentMode )   // Map from mode to radio button position at setting page
-	        {
-	        case EBTVisibilityModeGeneral:
-	            currentItem = 0;
-	            break;
-	        case EBTVisibilityModeTemporary: // temp visible
-	            currentItem = 1;
-	            break;	        
-	        case EBTVisibilityModeHidden:
-	            currentItem = 1+1;
-	            break;
-	        default:
-	            break;
-	        }
-
-	    // Ask new mode from user
-
-	    CAknRadioButtonSettingPage* dlg = new ( ELeave )CAknRadioButtonSettingPage( 
-	      R_BT_VISIBILITY_SETTING_PAGE, currentItem, items );
-	    if( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ))
-	        {
-	        switch( currentItem )   // Map it back from radio button position to mode at setting page
-	            {
-	            case 0:	                
-	                SetVisibilityStatusL( EBTVisibilityModeGeneral );	                
-	                break;
-	                
-	            case 1:	                
-	                SetVisibilityStatusL( EBTVisibilityModeTemporary );
-		            break;
-		            
-	            case 1+1:
-	                SetVisibilityStatusL( EBTVisibilityModeHidden );
-	                break;
-	                
-	            default:
-	                break;
-	            }
-	        }
-	    }  
-	else
-		TBTUIViewsCommonUtils::ShowGeneralErrorNoteL();  
-   	        
-  	
-    CleanupStack::PopAndDestroy(items); // items
-    }
-
-  
-// ----------------------------------------------------
-// CBTUIMainView::GetBtSettingsReference
-//
-// This method returns the reference to the settings class
-// ----------------------------------------------------
-//
-CBTEngSettings* CBTUIMainView::GetBtSettingsReference()
-	{
-	TRACE_FUNC
-	return iBtEngSettings;
-	}
-
-// ----------------------------------------------------
-// CBTUIMainView::InitiateBTLocalNameQueryL
-//
-// Initiate BT local name query after Symbian OS has entered
-// idle state.
-// ----------------------------------------------------
-//
-void CBTUIMainView::InitiateBTLocalNameQueryL()
-    {
-	TRACE_FUNC
-    
-        	
-    __ASSERT_DEBUG( !iIdle, PANIC(EBTPanicClassMemberVariableNotNull) );
-
-    // Launch idle time regognition and execute local BT name query when ready
-    iIdle = CIdle::NewL(CActive::EPriorityIdle);
-    iIdle->Start(TCallBack(LaunchBTLocalNameQueryL, this));		
-    }
-
-// ----------------------------------------------------
-// CBTUIMainView::LaunchBTLocalNameQueryL
-//
-// Execute BT local name query. Symbian OS has entered
-// idle state now.
-// ----------------------------------------------------
-//
-TInt CBTUIMainView::LaunchBTLocalNameQueryL(TAny* aMainView)
-    {
-	//TRACE_FUNC
-
-    TInt errorCode = static_cast<CBTUIMainView*>(aMainView)->AskBTLocalNameQueryL();
-    if( errorCode != KErrNone )
-        {
-        CAknNoteDialog* dlg = new (ELeave) CAknNoteDialog( CAknNoteDialog::EErrorTone,
-                                                           CAknNoteDialog::ELongTimeout );
-		if(static_cast<CBTUIMainView*>(aMainView)->iCoverDisplayEnabled)
-			{  
-			CleanupStack::PushL(dlg);
-       	    dlg->PublishDialogL(ECmdShowBtGeneralErrorNote, KUidCoverUiCategoryBtui); // initializes cover support}
-			CleanupStack::Pop(dlg);
-			}			
-		dlg->ExecuteLD( R_BT_GENERAL_ERROR_NOTE );
-        }
-    return KErrNone;
-    }
-
-// ----------------------------------------------------
-// CBTUIMainView::AskBTLocalNameQueryL
-// ----------------------------------------------------
-//
-TInt CBTUIMainView::AskBTLocalNameQueryL()
-    {
-    TRACE_FUNC_ENTRY
-
-    TInt errorCode = KErrNone;
-    iTempNameBuffer.Zero();                     // Empty Local BT device name    
-    
-    //Get default name if given by e.g. phone product
-    errorCode = RProperty::Get( KPropertyUidBluetoothCategory, KPropertyKeyBluetoothSetDeviceName, iTempNameBuffer );
-    
-    if( errorCode || !iTempNameBuffer.Length() )
-    {
-        errorCode = RProperty::Get( KPropertyUidBluetoothCategory, KPropertyKeyBluetoothGetDeviceName, iTempNameBuffer );
-        
-        if( errorCode || !iTempNameBuffer.Length() )
-        {
-            RBTRegServ btRegServ;
-            RBTLocalDevice btReg;
-            TBTLocalDevice localDev;
-
-            errorCode = btRegServ.Connect();
-
-            if( !errorCode )
-            {
-                errorCode = btReg.Open( btRegServ );
-                
-                if( !errorCode )
-                {
-                    // Read the BT local name from BT Registry.
-                    errorCode = btReg.Get( localDev );
-                    
-                    if( !errorCode )
-                    {
-                        // The error can be > 0 if there are unconverted characters.
-                        errorCode = CnvUtfConverter::ConvertToUnicodeFromUtf8( iTempNameBuffer, localDev.DeviceName() );
-                    }
-                }
-            }
-
-            btReg.Close();
-            btRegServ.Close();
-        }
-    }
-    
-	if(errorCode==KErrNone)
-		{
-			
-	    // Cut the excess part of the name away. The query can handle only 
-	    // KBTUIMaxNameLength characters.
-	    //
-	    if( iTempNameBuffer.Length() > KBTUIMaxNameLength )
-	        {
-	        iTempNameBuffer.SetLength( KBTUIMaxNameLength );
-	        }
-
-	    CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL( iTempNameBuffer );
-	    TInt keypress = dlg->ExecuteLD( R_BT_ENTER_LOCAL_NAME_QUERY );
-
-	    if( keypress )  // User has accepted the dialog
-	        {
-	        // Remove trouble making control chars
-		    AknTextUtils::StripCharacters(iTempNameBuffer,  KAknStripListControlChars);    
-		                
-	        iTempNameBuffer.TrimAll();                           // Remove extra spaces	        
-	        errorCode = iBtEngSettings->SetLocalName(iTempNameBuffer);
-	        
-		 	this->SettingChangedL(EBTMainListItemNameSetting);	// Redraw BT name 
-	        }
-		}
-
-    delete iIdle; iIdle = NULL;	
-    TRACE_FUNC_EXIT
-    return errorCode;
-    }
-
-//---------------------------------------------------------------------
-// CBTUIMainView::GetCaption
-//----------------------------------------------------------------------
-//
-void CBTUIMainView::GetCaptionL( TDes& aCaption ) const
-	{
-	TRACE_FUNC
-	
-    // the resource file is already opened.
-    HBufC* result = StringLoader::LoadL( R_GS_BTUI_VIEW_CAPTION );
-    aCaption.Copy( *result );
-    delete result;	
-	}
-
-
-//---------------------------------------------------------------------
-// CBTUIMainView::CreateIconL
-//----------------------------------------------------------------------
-//    
-CGulIcon* CBTUIMainView::CreateIconL( const TUid aIconType )
-	{
-	TRACE_FUNC_ENTRY
-	
-	RefreshSettingsStatusL();		
-    CGulIcon* icon = NULL;
-    TFileName bmpFilename;
-    bmpFilename += KBitmapFileDrive;
-    bmpFilename += KDC_APP_BITMAP_DIR;
-    bmpFilename += KBtuiBmpFileName;
-
-    if(aIconType == KGSIconTypeLbxItem)
-    	{
-	
-	    switch(iBtState)
-			{
-			case EBTOff:
-				icon = AknsUtils::CreateGulIconL(
-			        AknsUtils::SkinInstance(), 
-			        KAknsIIDQgnPropSetAppsBtOff,  
-			        bmpFilename, 
-			        EMbmBtuiQgn_prop_set_apps_bt_off, 
-			        EMbmBtuiQgn_prop_set_apps_bt_off_mask );
-				break;
-			case EBTOnShown:
-				icon = AknsUtils::CreateGulIconL(
-			        AknsUtils::SkinInstance(), 
-			        KAknsIIDQgnPropSetAppsBtOnShown,  
-			        bmpFilename, 
-			        EMbmBtuiQgn_prop_set_apps_bt_on_shown, 
-			        EMbmBtuiQgn_prop_set_apps_bt_on_shown_mask );
-				break;
-			case EBTOnHidden:
-				icon = AknsUtils::CreateGulIconL(
-			        AknsUtils::SkinInstance(), 
-			        KAknsIIDQgnPropSetAppsBtOnHidden,  
-			        bmpFilename, 
-			        EMbmBtuiQgn_prop_set_apps_bt_on_hidden, 
-			        EMbmBtuiQgn_prop_set_apps_bt_on_hidden_mask );
-				break;
-			case EBTConnectedShown:
-				icon = AknsUtils::CreateGulIconL(
-			        AknsUtils::SkinInstance(), 
-			        KAknsIIDQgnPropSetAppsBtConnShown,  
-			        bmpFilename, 
-			        EMbmBtuiQgn_prop_set_apps_bt_conn_shown, 
-			        EMbmBtuiQgn_prop_set_apps_bt_conn_shown_mask );
-				break;
-			case EBTConnectedHidden:
-				icon = AknsUtils::CreateGulIconL(
-			        AknsUtils::SkinInstance(), 
-			        KAknsIIDQgnPropSetAppsBtConnHidden,  
-			        bmpFilename, 
-			        EMbmBtuiQgn_prop_set_apps_bt_conn_hidden, 
-			        EMbmBtuiQgn_prop_set_apps_bt_conn_hidden_mask );
-				break;
-			}	        
-    	}
-    else
-	    {
-	    icon = CGSPluginInterface::CreateIconL( aIconType );	
-	    }
-    	            
-    return icon;
-	}    
-
-
-// ---------------------------------------------------------------------------
-// CBTUIMainView::GetValue()
-// Get 2nd row text for parent Connectivity View.
-// ---------------------------------------------------------------------------
-//  
-void CBTUIMainView::GetValue( const TGSPluginValueKeys aKey, TDes& aValue )
-	{
-	TRACE_FUNC_ENTRY
-	
-	TRAP_IGNORE( GetValueL(aKey, aValue) );
-	}
-
-// ---------------------------------------------------------------------------
-// CBTUIMainView::GetValueL()
-// ---------------------------------------------------------------------------
-// 	
-void CBTUIMainView::GetValueL( const TGSPluginValueKeys aKey, TDes& aValue )
-	{
-	if(aKey == EGSPluginKeySettingsItemValueString)
-		{
-		HBufC* secondary = NULL; 
-		RefreshSettingsStatusL();
-		switch(iBtState)
-			{
-			case EBTOff:
-				secondary = StringLoader::LoadL( R_CP_DETAIL_BT_OFF );
-				break;
-			case EBTOnShown:
-				secondary = StringLoader::LoadL( R_CP_DETAIL_BT_ON_SHOWN );
-				break;
-			case EBTOnHidden:
-				secondary = StringLoader::LoadL( R_CP_DETAIL_BT_ON_HIDDEN );
-				break;
-			case EBTConnectedShown:
-				secondary = StringLoader::LoadL( R_CP_DETAIL_BT_CONN_SHOWN );
-				break;
-			case EBTConnectedHidden:
-				secondary = StringLoader::LoadL( R_CP_DETAIL_BT_CONN_HIDDEN );
-				break;
-			}
-		aValue.Copy( *secondary );
-		delete secondary;	
-		}
-	}
-
-// ---------------------------------------------------------------------------
-// CBTUIMainView::CreateTabIconL()
-// Creates icon for tab.
-// ---------------------------------------------------------------------------
-//    
-CGulIcon* CBTUIMainView::CreateTabIconL()
-    {
-    TFileName bmpFilename; 
-    bmpFilename += KBitmapFileDrive;
-    bmpFilename += KDC_APP_BITMAP_DIR;
-    bmpFilename += KBtuiBmpFileName;
-    
-    CGulIcon* icon = AknsUtils::CreateGulIconL(
-        AknsUtils::SkinInstance(), 
-        KAknsIIDQgnPropBtSetTab3,  
-        bmpFilename, 
-        EMbmBtuiQgn_prop_bt_set_tab3, 
-        EMbmBtuiQgn_prop_bt_set_tab3_mask );
-
-    return icon;
-    }       
-
-// ---------------------------------------------------------------------------
-// CBTUIMainView::RefreshSettingsStatusL()
-// Get the current BT settings: power, visibility and connection.
-// ---------------------------------------------------------------------------
-//    
-void CBTUIMainView::RefreshSettingsStatusL()
-	{
-		
-	if ( BluetoothFeatures::EnterpriseEnablementL() == BluetoothFeatures::EDisabled ) 
-		{
-		iBtState = EBTOff;	
-		}
-	else
-		{
-		TBTPowerStateValue powerState;
-		iBtEngSettings->GetPowerState(powerState);
-		
-		TBTVisibilityMode currentMode;
-		iBtEngSettings->GetVisibilityMode(currentMode);
-		
-		TBool connected = TBTUIViewsCommonUtils::IsAnyDeviceConnectedL();
-			
-		if(powerState == EBTPowerOff)
-			iBtState = EBTOff;	
-		else 
-			{
-			if( !connected && (currentMode == EBTVisibilityModeGeneral || 
-								currentMode == EBTVisibilityModeTemporary))	
-				iBtState = EBTOnShown;
-			
-			else if(!connected && currentMode == EBTVisibilityModeHidden)	
-				iBtState = EBTOnHidden;
-			
-			else if(connected && (currentMode == EBTVisibilityModeGeneral || 
-								currentMode == EBTVisibilityModeTemporary))	
-				iBtState = EBTConnectedShown;
-			
-			else if(connected && currentMode == EBTVisibilityModeHidden)
-				iBtState = EBTConnectedHidden;
-			}	
-		}
-	}
-	
-// ----------------------------------------------------
-// CBTUIMainView::UpdateParentView
-//
-// Update Connectivity View when it's the current  
-// active view and the key watched is changed.
-// ----------------------------------------------------
-void CBTUIMainView::UpdateParentView()
-	{
-	if(iConstructAsGsPlugin)
-		{
-		CGSParentPlugin* parent = static_cast<CGSParentPlugin*>(AppUi()->View( KGSConPluginUid ));
-		if( parent )
-			{
-			parent->UpdateView();
-			}		
-		}
-	}
-	    
-// ---------------------------------------------------------------------------
-// CBTUIMainView::NewContainerL
-// Creates new iContainer.
-// ---------------------------------------------------------------------------
-//
-void CBTUIMainView::NewContainerL()
-    {
-	//As a transparent view, do nothing here.
-    }
-
-// ---------------------------------------------------------------------------
-// CBTUIMainView::HandleListBoxSelectionL
-// Handle any user actions while in the list view.
-// ---------------------------------------------------------------------------
-//
-void CBTUIMainView::HandleListBoxSelectionL() 
-    {
-	//As a base-view, it's transparent, so do nothing here.
-    }
-    
-// ---------------------------------------------------------------------------
-// CBTUIMainView::GetParentView
-// ---------------------------------------------------------------------------
-//
-TVwsViewId CBTUIMainView::GetParentView()
-    {
-    return iParentView; 
-    } 
-
-// ---------------------------------------------------------------------------
-// CBTUIMainView::TabbedViews()
-// Returns pointer to tabbed views of application.
-// ---------------------------------------------------------------------------
-//
-CArrayPtrFlat<MGSTabbedView>* CBTUIMainView::TabbedViews()
-    {
-    return iViewArray;
-    }
-    
-
-// ---------------------------------------------------------------------------
-// CBTUIMainView::IsLocalNameModified
-// Checks from central repository whether the Bluetooth friendly name 
-// has been modified .
-// ---------------------------------------------------------------------------
-//
-TInt CBTUIMainView::IsLocalNameModifiedL( TBool& aStatus )
-    {
-    TRACE_FUNC_ENTRY
-
-    aStatus = (TBool) EBTLocalNameDefault;
-    
-    TInt val = 0;
-	CRepository* cenRep = NULL;
-    TInt err = KErrNone;
-    TRAP_IGNORE(cenRep = CRepository::NewL( KCRUidBTEngPrivateSettings ));
-    
-    err = cenRep->Get( KBTLocalNameChanged, val );
-    
-    if ( val != 0 )
-    	{
-    	aStatus = (TBool) EBTLocalNameSet;
-    	}
-    delete cenRep;
-    cenRep = NULL;
-    TRACE_FUNC_EXIT
-    return err;
-    }
-
--- a/bluetoothengine/btui/Ecom/src/BTUINonSap.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 is created for variant that doesn't support 
-*                 Bluetooth SIM Access Profile. 
-*
-*/
-
-	
-#include "BTUIMainView.h"
-//#include "BTUIModel.h" 
-
-// ----------------------------------------------------
-// CBTUIMainView::SetSapStatusL
-// ----------------------------------------------------
-//
-void CBTUIMainView::SetSapStatusL( TBTSapMode /*aValue*/ )
-    {
-
-    }
-
-// ----------------------------------------------------------
-// CBTUIMainView::AskSapModeDlgL
-// ----------------------------------------------------------
-//
-void CBTUIMainView::AskSapModeDlgL()
-    {
-    
-    }
-// ----------------------------------------------------------
-// CBTUIMainView::GetSapStatusL
-// ----------------------------------------------------------
-
-TInt CBTUIMainView::GetSapStatusL()
-	{
-	return EBTSapDisabled;	
-	}
-
-// End of File
-
--- a/bluetoothengine/btui/Ecom/src/BTUIPairedDevicesView.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1904 +0,0 @@
-/*
-* 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 view that handles listing and 
- *  unblocking blocked devices view.
- *
-*/
-
-#include <avkon.hrh>                    // AVKON components
-#include <akntitle.h>
-#include <aknViewAppUi.h>
-#include <BtuiViewResources.rsg>        // Compiled resource ids
-#include <featmgr.h>                    // Feature Manager
-
-#include <AknGlobalNote.h>
-#include <aknnotewrappers.h>
-#include <StringLoader.h>   			// Series 60 localisation stringloader
-#include <AknMediatorFacade.h>
-#include <aknmessagequerydialog.h>
-#include <aknnotewrappers.h>
-#include <aknnavi.h>
-#include <hlplch.h>         			// Help launcher
-#include <btengdiscovery.h> 			// for device search
-
-#include <ctsydomainpskeys.h>
-#include <bt_subscribe.h>
-#include <btengsettings.h>
-#include <centralrepository.h>
-#include <CoreApplicationUIsSDKCRKeys.h>
-#include <bamdesca.h>
-
-#include "debug.h"             
-#include "btui.h" 						// Global declarations
-#include "BTUIPairedDevicesView.h"
-#include "BTUIDeviceContainer.h"
-#include <secondarydisplay/BtuiSecondaryDisplayAPI.h>
-#include <csxhelp/bt.hlp.hrh>   // Help IDs
-
-#include <gstabhelper.h>
-#include <btui.mbg>						// Tab icon for General Setting
-#include <bluetoothuiutil.h>
-#include "BTUIMainView.h" 				// base View.
-
-
-const TInt KAutoConnect2ndTry = 1;
-const TUint32 SetExcludePairedDeviceMask = 0x800000;
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CBTUIPairedDevicesView::NewL
-// Two phased constructor called by BT AppUI when serve as part of btui.exe
-// ---------------------------------------------------------
-//
-CBTUIPairedDevicesView* CBTUIPairedDevicesView::NewL(MBtuiPluginViewActivationObserver* aObserver)
-    {
-    CBTUIPairedDevicesView* self = new (ELeave) CBTUIPairedDevicesView(aObserver);
-	CleanupStack::PushL(self);
-	
-	self->iConstructAsGsPlugin = EFalse;	
- 	self->ConstructL();
-	CleanupStack::Pop(self);
-    return self;
-    }
-
-// ---------------------------------------------------------
-// CBTUIPairedDevicesView::NewLC
-// Two phased constructor called by mainView when serve as GS Plugin.
-// ---------------------------------------------------------
-//
-CBTUIPairedDevicesView* CBTUIPairedDevicesView::NewLC(CBTUIMainView* aBaseView, CArrayPtrFlat<MGSTabbedView>* aTabViewArray)
-    {
-    CBTUIPairedDevicesView* self = new (ELeave) CBTUIPairedDevicesView();    
-	CleanupStack::PushL( self );
-		
-	self->iConstructAsGsPlugin = ETrue;
- 	self->ConstructL( aBaseView, aTabViewArray );
-
-    return self;
-    }
-    
-
-// ---------------------------------------------------------
-// CBTUIPairedDevicesView::ConstructL
-// Symbian 2nd phase constructor can leave.
-// ---------------------------------------------------------
-//
-void CBTUIPairedDevicesView::ConstructL()
-    {
-	TRACE_FUNC_ENTRY
-
-    BaseConstructL(R_BTUI_OTHER_DEVICES_VIEW);
-
-    iCoverDisplayEnabled = FeatureManager::FeatureSupported(KFeatureIdCoverDisplay); 
-    iHelpEnabled = FeatureManager::FeatureSupported(KFeatureIdHelp);
-    
-   	iDeviceSearcher = CBTEngDiscovery::NewL(this);   	
-	iBtEngSettings = CBTEngSettings::NewL(this);
-	iBTPluginMan = CBTUIPluginMan::NewL( AppUi() );
-	iIsAlreadyConnected = EFalse;
-	iExpectedCallBack = 0;
-	TRACE_INFO(_L("Initial iIsAlreadyConnected -> False"))
-    TRACE_FUNC_EXIT
-    }
-
-void CBTUIPairedDevicesView::ConstructL( CBTUIMainView* aBaseView, CArrayPtrFlat<MGSTabbedView>* aTabViewArray )
-    {
-    TRACE_FUNC_ENTRY
-    
-	iBaseView = aBaseView,
-    iTabHelper = CGSTabHelper::NewL();
-    aTabViewArray->AppendL(this); 
-    
-    BaseConstructL(R_BTUI_OTHER_DEVICES_VIEW_GS);
-    iCoverDisplayEnabled = FeatureManager::FeatureSupported(KFeatureIdCoverDisplay); 
-    iHelpEnabled = FeatureManager::FeatureSupported(KFeatureIdHelp);
-    
-   	iDeviceSearcher = CBTEngDiscovery::NewL(this);
-    iBtEngSettings=CBTEngSettings::NewL(this);	
-    iBTPluginMan = CBTUIPluginMan::NewL( AppUi() );
-	iIsAlreadyConnected = EFalse;
-	TRACE_INFO(_L("Initial iIsAlreadyConnected = False"))
-    iExpectedCallBack = 0;
-	
-	TRACE_FUNC_EXIT
-    }
-  
-// ---------------------------------------------------------
-// CBTUIBlockedDevicesView::CBTUIBlockedDevicesView
-// ---------------------------------------------------------
-    
-CBTUIPairedDevicesView::CBTUIPairedDevicesView( MBtuiPluginViewActivationObserver* aObserver )
-	: iActivationObserver(aObserver)
-	{
-	}        
-
-// ---------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------
-//
-CBTUIPairedDevicesView::~CBTUIPairedDevicesView()
-    {
-	TRACE_FUNC_ENTRY
-
-	//close dialogs if any
-	TRAP_IGNORE(
-		DialogDismissedL(EAknSoftkeyCancel);
-	);
-
-	delete iActive;
-	
-    if (iContainer)
-        {
-        AppUi()->RemoveFromViewStack(*this, iContainer);
-		delete iContainer;           
-		iContainer = NULL;
-        }
-            
-    if(iDeviceSearcher)
-        {
-    	// Canceling devicesearches is done by DialogDismissedL(),
-    	// so it is not done here    	
-    	delete iDeviceSearcher;
-    	iDeviceSearcher = NULL ;
-        }
-	delete iConnectDevice;
-	iConnectDevice=NULL;
-	
-	delete iPairingDevice;
-	delete iBtEngSettings;
-	delete iBTPluginMan;
-	
-	if(iConstructAsGsPlugin)
-	    	delete iTabHelper;	
-	
-	CancelDisconnectQueryDlg();
-	
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------
-// From CAknView
-// CBTUIPairedDevicesView::Id
-// ---------------------------------------------------------
-//
-TUid CBTUIPairedDevicesView::Id() const
-    {
-	TRACE_FUNC_ENTRY    
-    return KBtuiPluginUidPairedDevicesView;//KBTOtherDevicesViewId;
-    }
-
-
-
-
-// ---------------------------------------------------------
-// From CAknView
-// CBTUIPairedDevicesView::HandleCommandL 
-// Redirects commands to the appui class.
-// ---------------------------------------------------------
-//
-void CBTUIPairedDevicesView::HandleCommandL(TInt aCommand)
-    {
-	TRACE_FUNC_ENTRY
-
-    switch (aCommand)
-        {
-        
-        case EAknSoftkeyBack:      
-            // do not exit if devicechange is in progress.
-            if(iModel->DeviceChangeInProgress() )
-            	return;                
-	        AppUi()->ActivateLocalViewL(iBaseView->GetParentView().iViewUid );
-            break;
-            
-        case EAknSoftkeyExit:
-            {
-			TRACE_INFO(_L("EAknSoftkeyExit"))
-            // do not exit if devicechange or bt discovery is in progress.				
-            if(iModel->DeviceChangeInProgress() 
-                    || iSearchOngoing )   
-            	{
-            	TRACE_INFO(_L("exit denied, due to operation"))
-            	return;
-	           	}
-	           	
-			TRACE_INFO(_L("exit in progress"))
-			AppUi()->ProcessCommandL(EEikCmdExit);            
-            break;
-            }
-
-        case EAknCmdHelp:
-            {
-            #ifdef __SERIES60_HELP
-                HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(),AppUi()->AppHelpContextL());
-            #endif
-            break;
-            }          
-        	
-        case EBTUICmdNewPairedDevice:
-            {
-            iSearchOngoing=ETrue;
-            NewPairedDeviceDlgL();
-            break;
-            }
-
-        case EBTUICmdDelete:
-            {
-            DeleteDeviceDlgL();
-            break;
-            }
-
-        case EBTUICmdDeleteAll:
-            {
-            DeleteAllDevicesDlgL();
-            break;
-            }
-
-        case EBTUICmdGiveNickname:
-            {
-            RenameDeviceDlgL();
-            break;
-            }
-
-        case EBTUICmdSetTrusted:
-            {
-            ChangeDeviceSecurityL(ETrue);
-            break;
-            }
-
-        case EBTUICmdSetUnTrusted:
-            {
-            ChangeDeviceSecurityL(EFalse);
-            break;
-            }
-
-        case EBTUICmdConnect:
-        case EBTUICmdConnectAudio: 
-            {
-            TBTDevice device;
-            device.iIndex = iContainer->CurrentItemIndex();
-            iModel->GetDevice(device);
-            if ( device.iStatus & EStatusBtuiConnected )
-                {
-                // If device is already connected, we do nothing here. 
-                break;
-                }
-            device.iOperation = EOpConnect;
-            ConnectL( device, ETrue );
-	        break;            	
-            }
-
-        case EBTUICmdDisconnect:
-            {
-            DisconnectL();
-            break;
-            }
-  
-        case EBTUICmdSetBlocked:
-        	{
-        	BlockDeviceDlgL();
-        	break;
-        	}
-        	
-        case EBTUICmdSettings:
-        	{
-        	LaunchSettingViewL();
-        	break;
-        	}
-        	
-        default:
-            {
-            AppUi()->HandleCommandL(aCommand);
-            break;
-            }
-        }
-	TRACE_FUNC_EXIT        
-    }
-
-
-// ---------------------------------------------------------
-// From CAknView
-// CBTUIPairedDevicesView::DoActivateL
-// ---------------------------------------------------------
-//
-void CBTUIPairedDevicesView::DoActivateL(const TVwsViewId& /*aPrevViewId*/,
-                                               TUid /*aCustomMessageId*/,
-                                         const TDesC8& /*aCustomMessage*/)
-    {
-	TRACE_FUNC_ENTRY
-
-    iModel = CBTDevModel::NewL(EGroupPaired, this);
-    iContainer = CBTUiDeviceContainer::NewL(ClientRect(), this, EGroupPaired, this);
-    iContainer->SetMopParent(this); // MObjectProvider
-
-    // Setup title
-    HBufC* btTitlePairedDevices = 
-    	iCoeEnv->AllocReadResourceLC(R_BT_TITLE_PAIRED_DEV);
-    CEikStatusPane* statusPane = StatusPane();
-    CAknTitlePane* titlePane;
-    titlePane = (CAknTitlePane*) statusPane->ControlL(
-    	TUid::Uid(EEikStatusPaneUidTitle));
-    titlePane->SetTextL(btTitlePairedDevices->Des());
-    CleanupStack::PopAndDestroy(btTitlePairedDevices); // btTitlePairedDevices
-    btTitlePairedDevices = NULL;
-
-    AppUi()->AddToStackL(*this, iContainer);
-
-    if( iBaseView && iConstructAsGsPlugin)
-        {
-        iTabHelper->CreateTabGroupL( Id(), 
-            static_cast<CArrayPtrFlat<MGSTabbedView>*>
-            (iBaseView->TabbedViews()) ); 
-        } 
-        
-	// MSK menu is added here.
-	// the left key menu is added by resources.
-    MenuBar()->SetContextMenuTitleResourceId(
-    	R_BTUI_MENUBAR_OTHER_DEVICES_VIEW_CONTEXT);		
-	// notify observer   
-    if( iActivationObserver  && iConstructAsGsPlugin == EFalse)
-    {    	    
-        iActivationObserver->PluginViewActivated(EPairedDevicesViewId);        
-    }
-
-	TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------
-// From CAknView
-// CBTUIPairedDevicesView::DoDeactivate
-// ---------------------------------------------------------
-//
-void CBTUIPairedDevicesView::DoDeactivate()
-    {
-	TRACE_FUNC_ENTRY
-
-    if (iContainer)
-        {
-        AppUi()->RemoveFromStack(iContainer);
-        delete iContainer;
-        iContainer = NULL;
-        }
-	if ( iDeviceSearcher )
-	    {
-	    iDeviceSearcher->CancelSearchRemoteDevice();
-	    }
-    delete iModel;
-    iModel=NULL;
-    if(iConstructAsGsPlugin)
-	    iTabHelper->RemoveTabGroup();  
-    delete iActive;
-    iActive = NULL;
-    iIsPairConnect = EFalse;
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------
-// From CAknView
-// CBTUIPairedDevicesView::DynInitMenuPaneL
-// Shows only options supported for selected device, if any.
-// If not show only options supported regardless of selected
-// device
-// ---------------------------------------------------------
-//
-void CBTUIPairedDevicesView::DynInitMenuPaneL(TInt aResId, CEikMenuPane* aMenu)
-    {
-	TRACE_FUNC_ENTRY
-	iActiveMenuPane = aMenu;
-	// dim help if it exists and is not supported	
-	TInt tmp;	
-	if (  aMenu->MenuItemExists(EAknCmdHelp,tmp ) )			
-		{			
-		aMenu->SetItemDimmed(EAknCmdHelp,
-		  !FeatureManager::FeatureSupported( KFeatureIdHelp ) );
-		}
-	
-	if ( aResId == R_BTUI_OTHER_DEVICES_VIEW_MENU  )
-	    {
-        TInt index = iContainer->CurrentItemIndex();
-
-        // we only show "new pair device", "help" , "Exit" and "Delete All" if view contains device(s).  
-        aMenu->SetItemDimmed(EBTUICmdSetTrusted, ETrue);   
-        aMenu->SetItemDimmed(EBTUICmdDelete,ETrue);
-        aMenu->SetItemDimmed(EBTUICmdSetTrusted,ETrue);
-        aMenu->SetItemDimmed(EBTUICmdSetUnTrusted,ETrue);
-        aMenu->SetItemDimmed(EBTUICmdConnect,ETrue);
-        aMenu->SetItemDimmed(EBTUICmdConnectAudio,ETrue); 
-        aMenu->SetItemDimmed(EBTUICmdDisconnect,ETrue);
-        aMenu->SetItemDimmed(EBTUICmdSetBlocked,ETrue);
-        aMenu->SetItemDimmed(EBTUICmdSettings,ETrue);
-        aMenu->SetItemDimmed(EBTUICmdGiveNickname, ETrue);         
-        
-        if ( index < 0 ) // No devices at list. Hide all device related commands.
-            {
-            aMenu->SetItemDimmed(EBTUICmdDeleteAll, ETrue); 
-            }
-        
-	    }
-	
-    if ( aResId == R_BTUI_OTHER_DEVICES_VIEW_MENU_CONTEXT )
-        {
-        TInt index = iContainer->CurrentItemIndex();
-          
-        // If user is fast enough to click the RSK option between 
-        // bt discovery view and device found view,  bt ui will crash.
-        // Therefore, we disable commands if bt discovery is onging.
-        //          
-        if(iSearchOngoing)
-            {
-            aMenu->SetItemDimmed(EBTUICmdGiveNickname, ETrue);
-            aMenu->SetItemDimmed(EBTUICmdSetTrusted, ETrue);
-            aMenu->SetItemDimmed(EBTUICmdSetUnTrusted, ETrue);
-            aMenu->SetItemDimmed(EBTUICmdSetBlocked, ETrue);
-            aMenu->SetItemDimmed(EBTUICmdDelete, ETrue);
-            aMenu->SetItemDimmed(EBTUICmdConnect, ETrue);
-            aMenu->SetItemDimmed(EBTUICmdConnectAudio, ETrue);
-            aMenu->SetItemDimmed(EBTUICmdDisconnect, ETrue);            
-            aMenu->SetItemDimmed(EBTUICmdNewPairedDevice, ETrue);
-            return;
-            }
-        
-        if(index < 0)  // No devices at list. Hide all device related commands.
-            {            
-            TRACE_INFO(_L("no devices in list"))
-            
-            aMenu->SetItemDimmed(EBTUICmdGiveNickname, ETrue);
-            aMenu->SetItemDimmed(EBTUICmdSetTrusted, ETrue);
-            aMenu->SetItemDimmed(EBTUICmdSetUnTrusted, ETrue);
-            aMenu->SetItemDimmed(EBTUICmdSetBlocked, ETrue);
-            aMenu->SetItemDimmed(EBTUICmdDelete, ETrue);
-            aMenu->SetItemDimmed(EBTUICmdConnect, ETrue);
-            aMenu->SetItemDimmed(EBTUICmdConnectAudio, ETrue);
-            aMenu->SetItemDimmed(EBTUICmdDisconnect, ETrue);
-            aMenu->SetItemDimmed(EBTUICmdSettings, ETrue);
-            }
-        else // There are devices at list
-            {
-	        TBTDevice device;
-            device.iIndex = index;
-    	    iModel->GetDevice(device);
-            iMenuDevice = device;    	    
-            
-            TRACE_INFO(_L("there are device in list"))
-          
-            TBool dim = (device.iStatus & EStatusTrusted) == EStatusTrusted;
-            
-            aMenu->SetItemDimmed(EBTUICmdSetTrusted, dim);
-            aMenu->SetItemDimmed(EBTUICmdSetUnTrusted, !dim);
-             
-            // Check if device can be connected or disconnected
-			dim = (! (device.iStatus & EStatusConnectable) 
-			|| device.iStatus & EStatusBtuiConnected);
-			
-			if (dim) 
-				{
-            	aMenu->SetItemDimmed(EBTUICmdConnect, dim);
-            	aMenu->SetItemDimmed(EBTUICmdConnectAudio, dim);
-				}
-			else
-				{
-				if ( device.iDeviceClass.MajorDeviceClass() == EMajorDeviceComputer) 
-            		{
-            		aMenu->SetItemDimmed(EBTUICmdConnect, ETrue);
-            		}
-            	else 
-            		{
-            		aMenu->SetItemDimmed(EBTUICmdConnectAudio, ETrue);
-            		}
-				}
-			dim = (device.iStatus & EStatusBtuiConnected) != EStatusBtuiConnected;
-            aMenu->SetItemDimmed(EBTUICmdDisconnect, dim);
-
-            if ( !iBTPluginMan->IsPluginAvaiable(device.iDeviceClass) ) 
-                {
-                aMenu->SetItemDimmed(EBTUICmdSettings, ETrue);
-                }
-            else
-                {                
-                dim = (device.iStatus & EStatusBtuiConnected) != EStatusBtuiConnected;
-                aMenu->SetItemDimmed(EBTUICmdSettings, dim);
-                }
-            //Hide New pair device
-            aMenu->SetItemDimmed(EBTUICmdNewPairedDevice, ETrue);
-            }
-        }
-	TRACE_FUNC_EXIT        
-    }
-    
-
-// ----------------------------------------------------------
-// CBTUIPairedDevicesView::RenameDeviceDlgL
-// ----------------------------------------------------------
-//
-void CBTUIPairedDevicesView::RenameDeviceDlgL()
-    {
-	TRACE_FUNC_ENTRY
-
-	TInt index = iContainer->CurrentItemIndex();
-	if(index == KErrNotFound) return;
-    
-	TBTDevice device;
-    device.iIndex = index;
-	iModel->GetDevice(device);
-	TBTDeviceName name = device.iName;
-	
-    CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL(device.iName);
-    TInt keypress = dlg->ExecuteLD(R_BT_ENTER_NICKNAME_QUERY);
-
-    if(keypress)  // User has accepted the dialog
-        {
-        if(device.iName != name) // Check if the user really changed the name
-        	{
-    		device.iOperation = EOpChangeName;        
-    		// Remove trouble making control chars
-		    AknTextUtils::StripCharacters(device.iName, KAknStripListControlChars);    
-	        device.iName.TrimAll();  // Remove extra spaces    		
-        	iModel->ChangeDevice(device);        	
-        	}
-        }
-	TRACE_FUNC_EXIT        
-    }
-    
-
-// ----------------------------------------------------------
-// CBTUIPairedDevicesView::NewPairedDeviceDlgL
-//
-// Initiate bonding (pairing) by opening the search dialog.
-// DeviceSearchComplete is called after that.
-// ----------------------------------------------------------
-//
-void CBTUIPairedDevicesView::NewPairedDeviceDlgL()
-	{
-	TRACE_FUNC_ENTRY	
-	// we must not have other pairing in progress.
-	// we maight issue an error, but none is defined by 
-	// ui spec. Anyhow this should be possible
-	// only by pressing everything roo rapidly.
-	if(iPairingDevice!=NULL)
-		return;
-	iPairingDevice = CBTDevice::NewL();
-	
-	// Here we use last bit in device class to inform bt inquiry notifier 
-	// not to display the device which is already paired and in the paired 
-	// device list.  
-	    
-	// We use DeviceClass to tell btnotif not to show paired device in 
-	// bt discovery notifier through bteng.
-	// Set bit 24 to 1 ( bit 24 is not used for any other purpose currently )	
-	iPairingDevice->SetDeviceClass(iPairingDevice->DeviceClass().DeviceClass() | SetExcludePairedDeviceMask );
-	TInt err = iDeviceSearcher->SearchRemoteDevice(iPairingDevice,
-                                                   &iPairingDevNameEntry, 
-                                                   iPairingDevice->DeviceClass().DeviceClass());
-
-
-	if(err != KErrNone)
-		{
-		delete iPairingDevice;
-		iPairingDevice=NULL;
-        TBTUIViewsCommonUtils::ShowGeneralErrorNoteL();        
-    	}
-	TRACE_FUNC_EXIT    	
-	}
-
-// ----------------------------------------------------------
-// CBTUIPairedDevicesView::DeleteDeviceDlgL
-// ----------------------------------------------------------
-//
-void CBTUIPairedDevicesView::DeleteDeviceDlgL()
-    {
-	TRACE_FUNC_ENTRY
-	
-    iExpectedCallBack = 0;
-	TInt index = iContainer->CurrentItemIndex();
-	if(index == KErrNotFound) return;
-
-    TBTDevice device;
-    device.iIndex = index;
-    iModel->GetDevice(device);
-
-    RBuf stringholder;
-    CleanupClosePushL( stringholder );
-
-	TInt tmp=EStatusBtuiConnected|EStatusPhysicallyConnected;
-    // Choose confirmation phrase
-    TInt resourceId = ( device.iStatus & tmp ) ? R_BT_WARN_ERASE_CONNECTED :
-        R_BT_WARN_ERASE;
-    BluetoothUiUtil::LoadResourceAndSubstringL( 
-            stringholder, resourceId, device.iName, 0 );
-
-    // Create confirmation query
-    //
-    CAknQueryDialog* dlg = CAknQueryDialog::NewL();
-
-	if(iCoverDisplayEnabled)
-		{
-        CleanupStack::PushL(dlg); 
-	    dlg->PublishDialogL(ECmdShowBtWarnEraseNote, KUidCoverUiCategoryBtui); 
-	    // initializes cover support    
-        CleanupStack::Pop(dlg); 
-
-		CAknMediatorFacade* covercl = AknMediatorFacade(dlg); // uses MOP, so control provided 
-		if (covercl) // returns null if __COVER_DISPLAY is not defined
-		    {	    
-		    covercl->BufStream() << BTDeviceNameConverter::ToUTF8L(device.iName) ;// takes copy so consts are ok too
-		    covercl->BufStream().CommitL(); // no more data to send so commit buf
-		    }  
-		}
-    TInt keypress = dlg->ExecuteLD(R_BT_WARN_ERASE_QUERY, stringholder);
-
-    CleanupStack::PopAndDestroy(&stringholder);  // stringholder
-
-    if(keypress)  // User has accepted the dialog
-        {
-        // If device is connected we need to first to disconnect 
-        // then unpair, otherwise unpairing does not succeed.
-        if((device.iStatus & EStatusBtuiConnected) == EStatusBtuiConnected)
-        {
-            iExpectedCallBack++;
-            DisconnectWithoutQuery();            
-            return;
-        }
-        device.iOperation = EOpUnpair;
-        iModel->ChangeDevice(device);       
-        }
-
-	TRACE_FUNC_EXIT
-    }
-
-// ----------------------------------------------------------
-// CBTUIPairedDevicesView::DeleteAllDevicesDlgL
-// ----------------------------------------------------------
-//
-void CBTUIPairedDevicesView::DeleteAllDevicesDlgL()
-    {
-	TRACE_FUNC_ENTRY
-	
-    iExpectedCallBack = 0;
-    CAknQueryDialog* dlg = CAknQueryDialog::NewL();
-    TInt keypress = KErrNone;
-    
-    CleanupStack::PushL(dlg); 
-
-    // Choose and execute confirmation query
-    //
-    if (iModel->IsAnyDeviceConnected())
-        {
-		if(iCoverDisplayEnabled)
-			{
-            dlg->PublishDialogL(ECmdShowBtWarnEraseAllConnectedQuery, KUidCoverUiCategoryBtui); // initializes cover support    
-			}
-
-        keypress = dlg->ExecuteLD(R_BT_WARN_ERASE_ALL_CONNECTED_QUERY);
-        }
-    else
-        {        
-		if(iCoverDisplayEnabled)
-			{
-	        dlg->PublishDialogL(ECmdShowBtWarnEraseAllQuery, KUidCoverUiCategoryBtui); // initializes cover support    
-			}
-
-        keypress = dlg->ExecuteLD(R_BT_WARN_ERASE_ALL_QUERY);
-        }
-    CleanupStack::Pop(dlg); 
-
-    if(keypress)  // User has accepted the dialog
-        {
-        TInt count = iContainer->CountItems();   
-        for (TInt i = 0; i < count; i++)
-           {
-           // If device is connected we need to first to disconnect 
-           // then unpair, otherwise unpairing does not succeed.                      
-           TBTDevice device;
-           device.iIndex = i;
-           iModel->GetDevice(device);
-           if((device.iStatus & EStatusBtuiConnected) == EStatusBtuiConnected)
-               {
-               iExpectedCallBack++;
-               }
-           }
-        TRACE_INFO((_L("iExpectedCallBack %d"), iExpectedCallBack ))
-        
-        for (TInt i = 0; i < count; i++)
-            {
-            // If device is connected we need to first to disconnect 
-            // then unpair, otherwise unpairing does not succeed.                      
-            TBTDevice device;
-            device.iIndex = i;
-            iModel->GetDevice(device);           
-            
-            if((device.iStatus & EStatusBtuiConnected) == EStatusBtuiConnected)
-                {
-                //disconnect it first, removal will be done in 
-                //callback NotifyChangeDeviceCompleteL for ChangeDevice() below
-                TRACE_INFO((_L("EOpDisconnect issued for %d"), i ))
-                device.iOperation = EOpDisconnect;
-                iModel->ChangeDevice(device);  
-                }
-            else
-                {
-                //otherwise, just remove it from the paired view
-                device.iOperation = EOpUnpair;
-                iModel->ChangeDevice(device);
-                }
-            }
-        }
-
-	TRACE_FUNC_EXIT
-    }
-// ----------------------------------------------------------
-// CBTUIPairedDevicesView::BlockDeviceDlgL
-// ----------------------------------------------------------
-void CBTUIPairedDevicesView::BlockDeviceDlgL()
-	{
-	TRACE_FUNC_ENTRY
-
-	TInt index = iContainer->CurrentItemIndex();
-	if(index == KErrNotFound) return;
-			
-    TBTDevice device;
-    device.iIndex = index;
-    iModel->GetDevice(device);
-
-	//check if this is connected device
-		
-	HBufC* header= iCoeEnv->AllocReadResourceLC(R_BT_OPTION_BLOCK_DEVICE_HEADER); 
-	
-	RBuf stringHolder;
-	CleanupClosePushL( stringHolder );
-	TInt resouseId;
-	if (device.iStatus & (EStatusBtuiConnected|EStatusPhysicallyConnected) )
-	    {
-	    resouseId = iHelpEnabled? R_BT_OPTION_BLOCK_PAIRED_DEVICE_HELP : 
-            R_BT_OPTION_BLOCK_PAIRED_DEVICE_NOHELP;
-	    }
-	else
-	    {
-	    resouseId = iHelpEnabled ? R_BT_OPTION_BLOCK_PAIRED_DEVICE_HELP :
-            R_BT_OPTION_BLOCK_PAIRED_DEVICE_NOHELP;
-	    }
-	BluetoothUiUtil::LoadResourceAndSubstringL( 
-	        stringHolder, resouseId, device.iName, 0 );
-	
-	CAknMessageQueryDialog *queryDialog = CAknMessageQueryDialog::NewL (stringHolder, 
-	  CAknQueryDialog::EConfirmationTone);		
-	queryDialog->PrepareLC(R_BT_MESSAGE_QUERY);
-	
-	(queryDialog)->Heading()->SetTextL(*header);
-	queryDialog->SetFocus(ETrue);
-
-    TInt keypress=EFalse;
-#ifdef __SERIES60_HELP    
-	if (iHelpEnabled)
-        {
-		HBufC* queryLink = StringLoader::LoadL(R_BT_BLOCK_DEVICE_LINK);
-		TCoeHelpContext hc(KBtuiUid3,KBT_HLP_BLOCKED);
-		TCallBack helpCallBack(CBTUIPairedDevicesView::LaunchHelp , &hc);
-		
-		TRAPD(err,
-			static_cast<CAknMessageQueryDialog*>(queryDialog)->SetLinkTextL(*queryLink);
-			static_cast<CAknMessageQueryDialog*>(queryDialog)->SetLink(helpCallBack););
-		if(err==KErrNone)
-			{
-			keypress = queryDialog->RunLD();
-			}
-        	
-		delete queryLink; 
-        queryLink = NULL;
-        }
-    else
-#endif    
-        {
-        keypress = queryDialog->RunLD();
-        }
-	
-	CleanupStack::PopAndDestroy(&stringHolder);  				 
-	CleanupStack::PopAndDestroy(header);
-	        
-	if(keypress)
-		{
-		device.iOperation = EOpBlock;
-		iModel->ChangeDevice(device);
-		}
-	TRACE_FUNC_EXIT		
-	}
-// ----------------------------------------------------------
-// CBTUIPairedDevicesView::ChangeDeviceSecurityL
-// ----------------------------------------------------------
-//
-void CBTUIPairedDevicesView::ChangeDeviceSecurityL(TBool aTrusted)
-    {
-   	TRACE_FUNC_ENTRY
-
-	TInt index = iContainer->CurrentItemIndex();
-	if(index == KErrNotFound) return;
-			
-    TBTDevice device;
-    device.iIndex = index;
-    iModel->GetDevice(device);
-    
-    if(aTrusted)
-        {
-        // set to trusted
-        CAknQueryDialog* dlg = CAknQueryDialog::NewL();
-        
-		if(iCoverDisplayEnabled)
-			{
-			CleanupStack::PushL(dlg); 
-	        dlg->PublishDialogL(ECmdShowBtAuthConfirmQuery, KUidCoverUiCategoryBtui); // initializes cover support    
-		    CleanupStack::Pop(dlg); 
-			}
-        TInt keypress = dlg->ExecuteLD(R_BT_SET_TRUSTED_QUERY);
-
-        if(keypress)  // User has accepted the dialog
-            {
-            device.iOperation = EOpTrust;
-            iModel->ChangeDevice(device);
-            }
-        }
-    else
-        {
-        device.iOperation = EOpUntrust;
-        iModel->ChangeDevice(device);        
-        }
-	TRACE_FUNC_EXIT        
-    }
-    
-// ----------------------------------------------------
-// CBTUIMainView::VisibilityModeChanged
-// ----------------------------------------------------
-//    
-void CBTUIPairedDevicesView::VisibilityModeChanged( TBTVisibilityMode  )
-    {
-	TRACE_FUNC_ENTRY
-	
-	
-	TRACE_FUNC_EXIT	
-    }
-    
-        
-// ----------------------------------------------------
-// CBTUIMainView::PowerStateChanged
-// ----------------------------------------------------
-//
-void CBTUIPairedDevicesView::PowerStateChanged( TBTPowerStateValue  )
-    {
-	TRACE_FUNC_ENTRY
-	
-	if ( iIsConnectDevice )
-		{
-		iModel->ChangeDevice(*iConnectDevice);
-		iIsConnectDevice = EFalse;   // reset flag
-		}
-	
-	TRACE_FUNC_EXIT	
-    }
-    
-// ----------------------------------------------------------
-// CBTUIPairedDevicesView::ConnectL
-// ----------------------------------------------------------
-//
-void CBTUIPairedDevicesView::ConnectL(
-        const TBTDevice& aDevice, TBool aNewWaitNote )
-	{
-	TRACE_FUNC_ENTRY
-	
-	iIsAlreadyConnected = EFalse;
-	TRACE_INFO(_L("Set iIsAlreadyConnected -> False"))
-	//Check that there is not more than max amount of connections allready.		
-	TInt connNum = 0;
-    RProperty::Get(KPropertyUidBluetoothCategory, KPropertyKeyBluetoothPHYCount, connNum);
-	if(connNum > KBtUiMaxConnections) 
-  		{
-        ConnectCompleteL(KErrServerBusy, aDevice);
-  		}
-  	else if(CallOnGoing()&& connNum > 1)
-	  	{
-    	CAknNoteDialog* dlg = new (ELeave) CAknNoteDialog(CAknNoteDialog::ENoTone,
-                                                       CAknNoteDialog::ELongTimeout);
-		if(iCoverDisplayEnabled)
-			{
-			CleanupStack::PushL(dlg); 
-    		dlg->PublishDialogL(ECmdShowBtImpossibleIncallNote, KUidCoverUiCategoryBtui); // initializes cover support    
-			CleanupStack::Pop(dlg); 
-			}
-	
-    	dlg->ExecuteLD(R_BT_NOT_INCALL_NOTE);    	
-  		}
-    else
-        {
-		if(TBTUIViewsCommonUtils::TurnBTOnIfNeededL(iBtEngSettings,iCoverDisplayEnabled)!= KErrNone)
-			return;
-		
-		TInt errorCode = KErrNone;  
-		TBTPowerStateValue currentPowerMode;		
-		errorCode=iBtEngSettings->GetPowerState(currentPowerMode); 
-		
-	    if(errorCode)    
-	    	{
-	    	// handle the error code
-	    	return;
-	    	}
-	    if ( aNewWaitNote )
-	        {
-            // Launch wait note              
-            OpenWaitNoteL(iWaitForConnectDlg,R_BT_CONNECTING_TO_WAIT_NOTE,R_BT_CONNECTING_TO ,
-                ECmdShowBtWaitConnectingToNote,aDevice.iName); 
-	        }
-		iConnectDevice=new(ELeave) TBTDevice(aDevice);            
-		iConnectDevice->iOperation=EOpConnect;
-		     
-		if( currentPowerMode == EBTPowerOff )
-			{
-				// turn on the flag IsConnectDevice
-				//
-				iIsConnectDevice = ETrue;
-			}
-        else
-        	{	
-        		// connect device
-        		//
-        		iModel->ChangeDevice(*iConnectDevice);
-        		
-        		// reset IsConnectDevice flag
-        		iIsConnectDevice = EFalse;
-        	}
-        }
-    TRACE_FUNC_EXIT
-	}
-	
-// ----------------------------------------------------------
-// CBTUIPairedDevicesView::OpenWaitNoteL
-// ----------------------------------------------------------
-void CBTUIPairedDevicesView::OpenWaitNoteL(CAknWaitDialog*& aWaitDialog,TUint aNoteResource,TUint aNoteTextResource,
-		TSecondaryDisplayBtuiDialogs aSec,const TDesC& aDevName)
-	{
-	TRAPD(err,
-	        RBuf stringholder;
-	        CleanupClosePushL( stringholder );
-	        BluetoothUiUtil::LoadResourceAndSubstringL( 
-	                stringholder, aNoteTextResource, aDevName, 0 );
-	    aWaitDialog = new (ELeave) CAknWaitDialog(
-                    reinterpret_cast<CEikDialog**>(&aWaitDialog), ETrue);
-	    aWaitDialog->PrepareLC(aNoteResource);
-	    aWaitDialog->SetTextL(stringholder);
-
-	    if(iCoverDisplayEnabled)
-	        {
-	        aWaitDialog->PublishDialogL(
-	          aSec, KUidCoverUiCategoryBtui); // initializes cover support    
-	        CAknMediatorFacade* covercl = AknMediatorFacade(aWaitDialog); // uses MOP, so control provided 
-	        if (covercl) // returns null if __COVER_DISPLAY is not defined
-	            {	    
-	            covercl->BufStream() << BTDeviceNameConverter::ToUTF8L(aDevName);// takes copy so consts are ok too
-	            covercl->BufStream().CommitL(); // no more data to send so commit buf
-	            }  
-	        }	        
-	    aWaitDialog->SetCallback(this); // for capturing Cancel keypress	            
-	    aWaitDialog->RunLD();
-	    
-    	CleanupStack::PopAndDestroy(&stringholder); // stringholder
-    );
-    // if the above functions leaves the iWaitNote is deleted, but
-    // not set to NULL. This will cause a problem, when
-    // the items may be deleted again, since it has to
-    // be a member variable, in order to be closed
-    // programmatically.
-    if(err!=KErrNone)
-    	{
-    	// that is why we set it to NULL here and
-    	// continue leaving further.
-        aWaitDialog=NULL;
-		User::Leave(err);	
-    	}
-	}
-
-// ----------------------------------------------------------
-// CBTUIPairedDevicesView::LaunchSettingViewL
-// ----------------------------------------------------------
-//
-void CBTUIPairedDevicesView::LaunchSettingViewL()
-	{
-	TRACE_FUNC_ENTRY
-	
-	TInt index = iContainer->CurrentItemIndex();
-	if(index == KErrNotFound) return;			
-	TBTDevice device;
-	device.iIndex = index;
-	iModel->GetDevice(device);
-	
-	CAknView* settingView = iBTPluginMan->GetSettingViewL(device);
-	if(settingView != NULL)
-		{
-		TUid viewId = settingView->Id();		
-        if(( device.iStatus & EStatusBtuiConnected) == EStatusBtuiConnected )
-            {
-            TBuf8<KMaxBCBluetoothNameLen> DeviceName;
-            DeviceName.Copy(device.iName);
-            AppUi()->ActivateLocalViewL( viewId, KNullUid, DeviceName); 
-            }
-        else
-            {
-            AppUi()->ActivateLocalViewL( viewId ); 
-            }
-		}
-	else 
-		{
-		User::Leave(KErrNotFound);
-		}	
-		
-	TRACE_FUNC_EXIT
-	}
-
-// ----------------------------------------------------------
-// CBTUIPairedDevicesView::DisconnectL
-// ----------------------------------------------------------
-//
-void CBTUIPairedDevicesView::DisconnectL()
-    {
-	TRACE_FUNC_ENTRY
-    
-	TInt index = iContainer->CurrentItemIndex();
-	if(index == KErrNotFound) return;
-			
-    TBTDevice device;
-    device.iIndex = index;
-    iModel->GetDevice(device);
-    
-    if ( !( device.iStatus & EStatusBtuiConnected) )
-        {
-        // If device is already disconnected, return immediately.
-        return;
-        }
-    
-	iDisconnectQueryDevice = device;//remember device related with query dialog
-
-    // Create confirmation query
-    RBuf stringholder;
-    CleanupClosePushL( stringholder );
-    BluetoothUiUtil::LoadResourceAndSubstringL( 
-            stringholder, R_BT_DISCONNECT_FROM, device.iName, 0 );
-    if ( !iDisconnectQueryDlg )
-        {
-        iDisconnectQueryDlg = CAknQueryDialog::NewL();
-        }
-
-	if(iCoverDisplayEnabled)
-		{
-	    iDisconnectQueryDlg->PublishDialogL(ECmdShowDisconnectQuery, KUidCoverUiCategoryBtui); // initializes cover support    
-	
-		CAknMediatorFacade* covercl = AknMediatorFacade(iDisconnectQueryDlg); // uses MOP, so control provided 
-		if (covercl) // returns null if __COVER_DISPLAY is not defined
-		    {	    
-		    covercl->BufStream() << BTDeviceNameConverter::ToUTF8L(device.iName);// takes copy so consts are ok too
-		    covercl->BufStream().CommitL(); // no more data to send so commit buf
-		    }  
-		}
-			
-    TInt keypress = iDisconnectQueryDlg->ExecuteLD(R_BT_DISCONNECT_FROM_QUERY, stringholder);
-
-    CleanupStack::PopAndDestroy(&stringholder);  // stringholder
-
-	iDisconnectQueryDlg = NULL;
-    if(keypress)  // User has accepted the dialog
-        {
-        device.iOperation = EOpDisconnect;
-	    iModel->ChangeDevice(device);
-		}
-	TRACE_FUNC_EXIT		
-	}
-	
-// ----------------------------------------------------------
-// CBTUIPairedDevicesView::CancelDisconnectQueryDlgL
-// ----------------------------------------------------------
-//
-void CBTUIPairedDevicesView::CancelDisconnectQueryDlg()
-{
-	TRACE_FUNC_ENTRY
-	
-	if(iDisconnectQueryDlg)
-	{
-		delete iDisconnectQueryDlg;
-		iDisconnectQueryDlg = NULL;
-	}
-	
-	TRACE_FUNC_EXIT	
-}
-
-// ----------------------------------------------------------
-// CBTUIPairedDevicesView::DisconnectWithoutQuery
-// ----------------------------------------------------------
-//
-void CBTUIPairedDevicesView::DisconnectWithoutQuery()
-{
-	TRACE_FUNC_ENTRY
-    
-	TInt index = iContainer->CurrentItemIndex();
-	if(index == KErrNotFound) return;
-			
-    TBTDevice device;
-    device.iIndex = index;
-    iModel->GetDevice(device);  
-    device.iOperation = EOpDisconnect;
-    iModel->ChangeDevice(device);      
-}
-// ----------------------------------------------------------
-// CBTUIPairedDevicesView::ConnectCompleteL
-// ----------------------------------------------------------
-//
-void CBTUIPairedDevicesView::ConnectCompleteL(TInt aError,const TBTDevice& aDevice,
-	const RBTDevNameArray* aConflictingDeviceNames)
-    {
-	TRACE_FUNC_ENTRY
-
-    // Dismiss wait note
-    //   
-    if(iConnectDevice)
-        {
-        delete iConnectDevice;
-        iConnectDevice=NULL;
-        }
-    
-	if ( iIsPairConnect )
-	    {
-	    iIsPairConnect = EFalse;
-	    if ( aError != KErrNone && 
-	         aError != KErrCancel &&
-	         aError != KErrNotSupported &&
-	         aError != KErrAlreadyExists && 
-	         aError != KErrServerBusy )
-	        {
-	        // It is possible that we started connecting too soon before the
-	        // device moves to conntable mode from pairing mode. Let's try
-	        // once more:
-	        if ( !iActive )
-	            {
-	            iActive = CBTUIActive::NewL( 
-	                        this, KAutoConnect2ndTry, CActive::EPriorityStandard );
-	            }
-	        iActive->RequestStatus() = KRequestPending;
-	        iActive->GoActive();	
-	        TRequestStatus* stptr = &( iActive->RequestStatus() );
-	        User::RequestComplete( stptr, KErrNone );
-	        TRACE_INFO( _L("CBTUIPairedDevicesView, sceadule auto connect 2nd try") )
-            return;
-	        }
-	    }
-
-    if(iWaitForConnectDlg)
-        {
-        TRACE_INFO(_L("waiting dialog is active, dismiss it"))
-        iWaitForConnectDlg->ProcessFinishedL();
-        }
-	
-    switch (aError)
-        {
-        case KErrCancel:
-        	TRACE_INFO(_L("aError = KErrCancel"))
-            break;
-        case KErrAlreadyExists:	// connection exists allready
-        	{
-          	RBuf stringholder;
-          	CleanupClosePushL( stringholder );
-          	if(aConflictingDeviceNames && aConflictingDeviceNames->Count()> 0)
-        		{        		
-        		if(aConflictingDeviceNames->Count() == 1)
-        			{
-        			BluetoothUiUtil::LoadResourceAndSubstringL( stringholder, 
-        			        R_BT_DISCONNECT_FIRST_PROMPT, 
-        			        *(*aConflictingDeviceNames)[0], 0 );
-        			}
-        		else
-        			{
-        			BluetoothUiUtil::LoadResourceAndSubstringL( stringholder, 
-                        R_BT_DISCONNECT_FIRST_STEREO_PROMPT, 
-                        *(*aConflictingDeviceNames)[0], 0 );
-        			BluetoothUiUtil::AddSubstringL( stringholder, *(*aConflictingDeviceNames)[1], 1 );       					
-        			}
-        		TRACE_INFO(_L("KErrAllreadyExists"))      	  		  
-          		}
-          	else
-          		{
-       			// Showing a note in this case would always show a note with "%U" in it
-       			// so the note is not shown at all
-       			TRACE_INFO(_L("KErrAlreadyExists, but no device given, not showing a notification"))
-				CleanupStack::PopAndDestroy(&stringholder);
-	          	break;	
-          		}
-
-           	CAknInformationNote* note = new (ELeave) CAknInformationNote();
-            
-			if(iCoverDisplayEnabled)
-				{
-				CleanupStack::PushL(note); 			
-		    	note->PublishDialogL(ECmdShowBtDisconnectFirstNote, KUidCoverUiCategoryBtui); // initializes cover support    
-				CleanupStack::Pop(note); 
-
-				CAknMediatorFacade* covercl = AknMediatorFacade(note); // uses MOP, so control provided 
-				if (covercl) // returns null if __COVER_DISPLAY is not defined
-			    	{	
-					if(aConflictingDeviceNames && aConflictingDeviceNames->Count()> 0)			    	    
-						{
-							covercl->BufStream() << BTDeviceNameConverter::ToUTF8L(*(*aConflictingDeviceNames)[0]);	
-						}			    	
-			    	covercl->BufStream().CommitL(); // no more data to send so commit buf
-			    	}  
-				}
-		
-        	note->ExecuteLD(stringholder);
-        	CleanupStack::PopAndDestroy(&stringholder);
-        	}
-        	break;	
-		case KErrServerBusy:
-			{
-        	CAknNoteDialog* dlg = new (ELeave) CAknNoteDialog(
-        		CAknNoteDialog::ENoTone,CAknNoteDialog::ELongTimeout);                
-			if(iCoverDisplayEnabled)
-				{
-				CleanupStack::PushL(dlg); 			
-				dlg->PublishDialogL(ECmdBtuiShowBtBusyNote, KUidCoverUiCategoryBtui); // initializes cover support    
-				CleanupStack::Pop(dlg); 			
-				}
-			
-        	dlg->ExecuteLD(R_BT_BUSY);
-			}
-			break;        		
-        case KErrNone:
-            {           
-            
-            TRACE_INFO(_L("aError = KErrNone"))
-            // Create note 
-            //          
-			CAknInformationNote* notePtr = new (ELeave) CAknInformationNote();
-
-            RBuf stringHolder;
-            CleanupClosePushL( stringHolder );
-            
-            BluetoothUiUtil::LoadResourceAndSubstringL( stringHolder,
-                    R_BT_CONF_CONNECTED_PROMPT, aDevice.iName, 0 );
-            
-            if(iCoverDisplayEnabled)
-                    {
-                    CleanupStack::PushL(notePtr); 			
-                    notePtr->PublishDialogL(ECmdBtuiShowBtConfConnected, KUidCoverUiCategoryBtui); // initializes cover support    
-                    CleanupStack::Pop(notePtr); 
-
-                    CAknMediatorFacade* covercl = AknMediatorFacade(notePtr); // uses MOP, so control provided 
-                    if (covercl) // returns null if __COVER_DISPLAY is not defined
-                        {	
-                            covercl->BufStream() << BTDeviceNameConverter::ToUTF8L(aDevice.iName);	
-                          covercl->BufStream().CommitL(); // no more data to send so commit buf
-                        }  
-                    }
-                
-            notePtr->ExecuteLD(stringHolder);        
-            CleanupStack::PopAndDestroy(&stringHolder);
-            }
-            
-            TRAP_IGNORE(LaunchSettingViewL();)
-            break;
-
-        case KErrNotSupported:
-            {
-            TRACE_INFO(_L("error = KErrNotSupported"))
-            
-            RBuf stringHolder;
-            CleanupClosePushL( stringHolder );
-            
-            BluetoothUiUtil::LoadResourceAndSubstringL( stringHolder,
-                    R_BT_DEVICE_NOT_SUPPORTED, aDevice.iName, 0 );
-			
-			// create note
-			//
-			CAknInformationNote* note = new (ELeave) CAknInformationNote();
-            
-			if(iCoverDisplayEnabled)
-				{
-				CleanupStack::PushL(note); 			
-		    	note->PublishDialogL(ECmdBtuiShowBtDeviceNotSupported, KUidCoverUiCategoryBtui); // initializes cover support    
-				CleanupStack::Pop(note); 
-
-				CAknMediatorFacade* covercl = AknMediatorFacade(note); // uses MOP, so control provided 
-				if (covercl) // returns null if __COVER_DISPLAY is not defined
-			    	{	
-						covercl->BufStream() << BTDeviceNameConverter::ToUTF8L(aDevice.iName);	
-						covercl->BufStream().CommitL(); // no more data to send so commit buf
-			    	}  
-				}
-			note->ExecuteLD(stringHolder);
-        	CleanupStack::PopAndDestroy(&stringHolder);
-            }
-            break;
-
-        default:
-            {
-            // Create note
-           	CAknInformationNote* note = new (ELeave) CAknInformationNote();
-            HBufC* stringHolder=StringLoader::LoadLC(R_BT_DEVICE_NOT_AVAIL_NOTE );
-	      
-			if(iCoverDisplayEnabled)
-				{
-				CleanupStack::PushL(note); 			
-		    	note->PublishDialogL(ECmdBtuiShowBtDeviceNotAvail, KUidCoverUiCategoryBtui); // initializes cover support    
-				CleanupStack::Pop(note); 
-			
-				}
-		
-        	note->ExecuteLD(*stringHolder);
-        	CleanupStack::PopAndDestroy(stringHolder);
-        	TRACE_INFO(_L("default error note BT-not-available"))
-            }
-            break;
-        }    
-	TRACE_FUNC_EXIT
-    }
-
-// ------------------------------------------------------
-// CBTUIPairedDevicesView::LaunchHelp
-// static help launching function for TCallback
-// ------------------------------------------------------
-TInt CBTUIPairedDevicesView::LaunchHelp(TAny* aCoeHelpContext)
-	{	
-#ifdef __SERIES60_HELP      
-	//TRACE_FUNC_ENTRY
-	TCoeHelpContext hc;
-	
-	if(aCoeHelpContext==NULL)
-		hc = TCoeHelpContext(KBtuiUid3,KBT_HLP_BLOCKED);
-	else
-		hc = *static_cast<TCoeHelpContext*>(aCoeHelpContext);
-	TRAPD(err,		 
-		CArrayFix< TCoeHelpContext >* array=new (ELeave) CArrayFixFlat< TCoeHelpContext >(1);
-		array->AppendL(hc);
-		CleanupStack::PushL(array);
-		// codescan will complain about CCoeEnv::Static(), however it is not reasonable
-		// avoidable, since this is static funtion.
-        HlpLauncher::LaunchHelpApplicationL(CCoeEnv::Static()->WsSession() , array);
-        CleanupStack::Pop(array);
-   );
-    
-    // the array is not deleted, since deleting it will result
-    // to E32User-CBase 3. It is assumed that HlpLancher is taking care of it.
-    // however this has not been documented.
-    //TRACE_FUNC_EXIT
-    return err;
-#else
-	return KErrNone;    
-#endif    
-	}
-
-// ------------------------------------------------------
-// CBTUIPairedDevicesView::CallOnGoing
-// ------------------------------------------------------
-TBool CBTUIPairedDevicesView::CallOnGoing()
-	{
-	TRACE_FUNC_ENTRY	
-	TInt callState;
-	// Try to get the call state property
-    
-	TInt err = RProperty::Get(KPSUidCtsyCallInformation,
-	 KCTsyCallState, callState); //KPSUidTelephonyCallInformation should be used   // Check also,if retrieving the property value succeeded
-	return (err == KErrNone) ?
-           (callState != EPSCTsyCallStateNone && 
-           callState != EPSCTsyCallStateUninitialized) :
-           EFalse;
-	}
-// ----------------------------------------------------------
-// From MProgressDialogCallback
-// CBTUIPairedDevicesView::DialogDismissedL
-//
-// Cancels pairing/connection operation if user has pressed Cancel softkey.
-// Does nothing if the dialog has been dismissed by this program.
-// ----------------------------------------------------------
-//
-void CBTUIPairedDevicesView::DialogDismissedL(TInt aButtonId )
-    {    
-	TRACE_FUNC_ENTRY
-
-	// it was not canceled, but dialog was closed
-	// because it ended normally, so there is nothing to clean up.
-   if( aButtonId != EAknSoftkeyCancel )
-   		return;
-   
-    // Cancel ongoing operations if any
-    //
-    if ( iWaitForConnectDlg)
-    	{
-        if( iConnectDevice )
-        	{
-	        iModel->CancelChange(*iConnectDevice);
-	        delete iConnectDevice;        	
-			iConnectDevice=NULL;	  
-			iIsPairConnect = EFalse;
-        	}            	
-    	iWaitForConnectDlg = NULL;
-    	}    	
-    if ( iWaitForPairingDlg )
-        {
-        if( iPairingDevice )
-        	{
-	        TBTDevice device;
-	        device.iAddr = iPairingDevice->BDAddr();
-	        device.iOperation = EOpPair;
-
-        	iDeviceSearcher->CancelSearchRemoteDevice();
-        	
-	        iModel->CancelChange(device);
-        	        	
-	        delete iPairingDevice;        	
-			iPairingDevice=NULL;	        			
-        	}        
-        // The dialog has already been deleted by UI framework and
-        // must not be deleted manually.        	
-        iWaitForPairingDlg = NULL;
-        }
-	
-	TRACE_FUNC_EXIT
-    }    
-// ------------------------------------------------------
-// From MBTEngSdpResultReceiver
-// CBTUIPairedDevicesView::ServiceSearchComplete
-// not used and implemented as empty
-// ------------------------------------------------------
-void CBTUIPairedDevicesView::ServiceSearchComplete(const RSdpRecHandleArray& , TUint , TInt)
-	{
-	TRACE_FUNC_ENTRY	
-	}
-// ------------------------------------------------------
-// From MBTEngSdpResultReceiver
-// CBTUIPairedDevicesView::AttributeSearchComplete
-// not used and implemented as empty
-// ------------------------------------------------------
-void CBTUIPairedDevicesView::AttributeSearchComplete(TSdpServRecordHandle, 
-	const RSdpResultArray& ,TInt)
-	{
-	TRACE_FUNC_ENTRY	
-	}
-// ------------------------------------------------------
-// From MBTEngSdpResultReceiver
-// CBTUIPairedDevicesView::AttributeSearchComplete
-// not used and implemented as empty
-// ------------------------------------------------------
-void CBTUIPairedDevicesView::ServiceAttributeSearchComplete(TSdpServRecordHandle ,
-	const RSdpResultArray& ,TInt )
-	{
-	TRACE_FUNC_ENTRY	
-	}
-// ------------------------------------------------------
-// From MBTEngSdpResultReceiver
-// CBTUIPairedDevicesView::DeviceSearchComplete
-// ------------------------------------------------------	
-void CBTUIPairedDevicesView::DeviceSearchComplete(CBTDevice* aDevice, TInt aErr)
-	{
-	TRACE_FUNC_ENTRY	
-
-	TRAPD(err,	DeviceSearchCompleteL(aDevice, NULL, aErr);
-		);
-		// something went wrong.
-	if(err != KErrNone)
-		{
-		TRAP_IGNORE( TBTUIViewsCommonUtils::ShowGeneralErrorNoteL(); );
-		}			
-    iSearchOngoing=EFalse;
-	TRACE_FUNC_EXIT		
-	}
-
-// ------------------------------------------------------
-// From MBTEngSdpResultReceiver
-// CBTUIPairedDevicesView::DeviceSearchComplete
-// ------------------------------------------------------   
-void CBTUIPairedDevicesView::DeviceSearchComplete( CBTDevice* aDevice, 
-        TNameEntry* aNameEntry, TInt aErr )
-    {
-	TRACE_FUNC_ENTRY	
-
-	TRAPD(err,	DeviceSearchCompleteL(aDevice, aNameEntry, aErr);
-		);
-		// something went wrong.
-	if(err != KErrNone)
-		{
-		TRAP_IGNORE( TBTUIViewsCommonUtils::ShowGeneralErrorNoteL(); );
-		}
-    iSearchOngoing=EFalse;
-	TRACE_FUNC_EXIT		    
-    }
-
-// ------------------------------------------------------
-// CBTUIPairedDevicesView::DeviceSearchCompleteL
-// Leaving version of DeviceSearchComplete
-// ------------------------------------------------------
-
-void CBTUIPairedDevicesView::DeviceSearchCompleteL(CBTDevice* aDevice, 
-        TNameEntry* aNameEntry, TInt aErr)
-	{
-	TRACE_FUNC_ENTRY	
-    iSearchOngoing=EFalse;
-	if ( !iPairingDevice )
-	    {
-	    delete iModel;
-	    iModel = NULL;
-	    return;
-	    }
-		// we must  not have multiple pairings at the same time
-	__ASSERT_DEBUG(aDevice->BDAddr() == iPairingDevice->BDAddr(),
-		PANIC(EBTPanicTwoPairingAttemptsAtTheSameTime) );
-
-	// other error condition, most likely dialog cancel.
-	if(aErr != KErrNone && (aErr != KErrAlreadyExists))
-		{
-		delete iPairingDevice;
-		iPairingDevice=NULL;
-		return;
-		}
-
-    // In case user switches the view fast enough before searching starts, 
-	// It crashes the whole btui by iModel is null value.
-	// We add an extra check here
-	//
-	if ( !iModel )
-	    {
-	    delete iPairingDevice;
-	    iPairingDevice=NULL;
-	    return;
-	    }
-		
-	TBTDevice *tmpDevice=iModel->CreateDeviceL(aDevice, aNameEntry);
-	CleanupStack::PushL(tmpDevice);	
-    if(tmpDevice->iStatus & (EStatusPhysicallyConnected|EStatusBtuiConnected|EStatusPaired))	
-        {
-        ShowDisconnecNoteL(tmpDevice);        
-        CleanupStack::PopAndDestroy(tmpDevice);            
-	    delete iPairingDevice;
-	    iPairingDevice=NULL;                                  
-        return;
-        }
-    else        
-	    {
-    	// Launch wait note
-    	OpenWaitNoteL(iWaitForPairingDlg,R_BT_WAITING,R_BT_WAITING_PROMPT,
-           		ECmdShowBtWaitingNote,tmpDevice->iName);     
-
-    	CleanupStack::PopAndDestroy(tmpDevice); 
-    	tmpDevice=NULL;
-    	// and start the pairing	
-    	iModel->ChangeDevice(aDevice, aNameEntry, EOpPair);
-    	// aDevice is not deleted, since it points to iPairingDevice and it is still used
-    	// after this
-        }
-	TRACE_FUNC_EXIT		
-	}
-
-
-// ------------------------------------------------------
-// CBTUIPairedDevicesView::ShowDisconnecNote
-// ------------------------------------------------------	
-void CBTUIPairedDevicesView::ShowDisconnecNoteL(TBTDevice *aDevice)
-    {
-    RBuf stringholder;
-    CleanupClosePushL( stringholder );
-    BluetoothUiUtil::LoadResourceAndSubstringL( 
-            stringholder, R_BT_DISCONNECT_FIRST_PROMPT, aDevice->iName, 0 );
-    // Launch a waiting confirmation note
-    //
-    CAknConfirmationNote* note = new (ELeave) CAknConfirmationNote(ETrue);
-
-    if(iCoverDisplayEnabled)
-    	{
-        CleanupStack::PushL(note); 				
-        note->PublishDialogL(ECmdShowBtSuccesfullyPairedNote, 
-          KUidCoverUiCategoryBtui); // initializes cover support    
-    	CAknMediatorFacade* covercl = AknMediatorFacade(note); // uses MOP, so control provided 
-    	if (covercl) // returns null if __COVER_DISPLAY is not defined
-    	    {	    
-    	    covercl->BufStream() << BTDeviceNameConverter::ToUTF8L(aDevice->iName);// takes copy so consts are ok too
-    	    covercl->BufStream().CommitL(); // no more data to send so commit buf
-    	    }  
-        CleanupStack::Pop(note); 				
-    	}
-
-    note->ExecuteLD(stringholder);
-
-    CleanupStack::PopAndDestroy(&stringholder); // stringholder    
-    
-    }
-
-void CBTUIPairedDevicesView::ConnectIfNeededAfterPairL( TInt aCount )
-    {
-    TRACE_FUNC_ENTRY
-    TBTDevice device;
-    device.iAddr = iPairConnectAddr;
-    iModel->GetDevice(device);
-    device.iOperation = EOpConnect;
-    ConnectL( device, ( aCount ) ? EFalse : ETrue );
-    TRACE_FUNC_EXIT
-    }
-
-// ------------------------------------------------------
-// CBTUIPairedDevicesView::BondingCompleted
-// called by NotifyChangeDeviceComplete
-// ------------------------------------------------------
-void CBTUIPairedDevicesView::BondingCompleteL(TInt aError, const TBTDevice& aDevice)
-	{
-    TRACE_INFO((_L("aError=%d"), aError))
-	// We need to make a copy of the device, since it may be cleaned up
-	// by device refresh.
-	TBTDevice bDevice= aDevice;
-	
-	// this may look useless, however if the device has a given shortName it is listed with it
-	// all the time. If you omnit this line it will be shown with its original deviceName,
-	// dispite it will be listed with the given name
-	iModel->GetDevice(bDevice);
-	 	
-	delete iPairingDevice;
-	iPairingDevice=NULL;
-	           
-    // Dismiss wait note
-    if(iWaitForPairingDlg)
-        {
-        iWaitForPairingDlg->ProcessFinishedL();
-        iWaitForPairingDlg = NULL;
-        }
-	
-    // Error handling
-    switch(aError)
-        {
-        case KErrCancel:
-            break;
-        case KErrAlreadyExists: // This is a legal return value
-        case KErrNone:
-        case KHCIErrorBase:
-            {
-	        if( (bDevice.iStatus & EStatusConnectable) 
-	                && (bDevice.iDeviceClass.MajorDeviceClass() != EMajorDeviceComputer)) 
-	            // Only automatically query for a connectable device but not a computer
-	        	{
-	            iPairConnectAddr = aDevice.iAddr;
-	        	iIsPairConnect = ETrue;
-	        	ConnectIfNeededAfterPairL( 0 );
-	        	}
-            break;
-			}
-        default:
-            {
-            break;
-          }
-        }  
-	TRACE_FUNC_EXIT
-	}
-
-// -----------------------------------------------
-// From MBTDeviceObserver
-// CBTUIPairedDevicesView::RefreshDeviceList
-// calls the container to refresh the deviceList
-// -----------------------------------------------
-void CBTUIPairedDevicesView::RefreshDeviceList(const RDeviceArray* aDevices,
-       TInt aSelectedItemIndex)
-	{
-	TRACE_FUNC_ENTRY	
-	TRAPD(err,
-		if(iContainer)
-			{			
-				iContainer->RefreshDeviceListL(aDevices,aSelectedItemIndex);			
-			}
-		);			
-	if (iActiveMenuPane && iActiveMenuPane->NumberOfItemsInPane()>0 ) 
-	    {
-		TInt index = iContainer->CurrentItemIndex();
-	    if ( index >=0 )
-		    {
-		    TBTDevice device;
-		    device.iIndex = index;
-		    iModel->GetDevice(device);
-			if ( iMenuDevice.iAddr == device.iAddr && 
-			    ( ( iMenuDevice.iStatus & EStatusBtuiConnected ) != ( device.iStatus & EStatusBtuiConnected ) ) )
-			    {
-			    TRACE_INFO(_L("Device status changed, update menupane"));
-			    iMenuDevice = device;
-			    iActiveMenuPane->Close();
-			    TRAP_IGNORE( this->ProcessCommandL(EAknSoftkeyContextOptions) );
-			    }
-		    }
-	    }
-	if(err!= KErrNone)	    
-        {
-		TRAP_IGNORE( TBTUIViewsCommonUtils::ShowGeneralErrorNoteL(); );
-        }
-	TRACE_FUNC_EXIT        
-	}
-
-
-// -----------------------------------------------
-// 
-// -----------------------------------------------
-void CBTUIPairedDevicesView::RequestCompletedL( CBTUIActive* aActive, TInt aId, 
-                        TInt aStatus )
-    {
-    TRACE_INFO( ( _L("CBTUIPairedDevicesView::RequestCompletedL err %d"), aStatus ) )
-    (void) aActive;
-    (void) aId;
-    (void) aStatus;
-    TRACE_INFO( _L("CBTUIPairedDevicesView, auto connect 2nd try ... ") )
-    ConnectIfNeededAfterPairL( 1 );
-    }
-
-// -----------------------------------------------
-// 
-// -----------------------------------------------
-void CBTUIPairedDevicesView::HandleError( CBTUIActive* aActive, TInt aId, 
-                  TInt aError )
-    {
-    (void) aActive;
-    (void) aId;
-    (void) aError;
-    iIsPairConnect = EFalse;
-    }
-
-// ---------------------------------------------------------
-// From MBTDeviceObserver
-// CBTUIPairedDevicesView::NotifyChangeDeviceComplete
-// This function implement the functionality of command complete.
-// The lists of shown devices are refreshed by RefreshDeviceList, 
-// not by this function
-// ---------------------------------------------------------
-//
-void CBTUIPairedDevicesView::NotifyChangeDeviceComplete(const TInt aErr, 
-		const TBTDevice& aDevice, const RBTDevNameArray* aDevNameArray)
-	{
-	TRACE_FUNC_ENTRY
-	TBTDevice tmpDevice=aDevice;
-	TRAPD(err,NotifyChangeDeviceCompleteL(aErr,tmpDevice,aDevNameArray
-		););
-	if(err!= KErrNone)	    
-        {
-		TRAP_IGNORE( TBTUIViewsCommonUtils::ShowGeneralErrorNoteL(); );
-        }
-	TRACE_FUNC_EXIT		
-	}
-// ---------------------------------------------------------
-// CBTUIPairedDevicesView::NotifyChangeDeviceCompleteL
-// Leaving version of notifyChangeDevice
-// ---------------------------------------------------------
-
-void CBTUIPairedDevicesView::NotifyChangeDeviceCompleteL(const TInt aErr, 
-		const TBTDevice& aDevice, const RBTDevNameArray* aDevNameArray)
-	{
-	TRACE_FUNC_ENTRY
-	if(iContainer == NULL) return;
-
-	TRACE_INFO((_L("aErr=%d"), aErr))
-	TRACE_INFO((_L("aDevice.iOperation=%d"), aDevice.iOperation))
-	TRACE_INFO((_L("aDevice.iStatus=%d"), aDevice.iStatus))
-	TRACE_INFO((_L("iIsAlreadyConnected=%d"), iIsAlreadyConnected))
-	
-    if (aDevice.iOperation == EOpDisconnect && iExpectedCallBack>0 )
-        {
-        TBTDevice device;
-        device.iIndex = aDevice.iIndex;
-        iModel->GetDevice(device);    
-        device.iOperation = EOpUnpair;
-        iModel->ChangeDevice(device); 
-        iExpectedCallBack--;
-        }
-	
-	if( aDevice.iOperation == EOpConnect )
-		{
-		if( aErr == KErrNone && iIsAlreadyConnected )
-		    {
-		    TRACE_INFO(_L("Don't show notes several times for the same device with different profile connections"))
-		    return; 
-		    }
-		ConnectCompleteL(aErr, aDevice, aDevNameArray );
-		iIsAlreadyConnected = ETrue;
-		TRACE_INFO(_L("iIsAlreadyConnected False -> True"))
-		return;
-		}
-	if(aDevice.iOperation == EOpPair)		
-		{		
-		BondingCompleteL(aErr, aDevice);
-		}
-	if(aErr != KErrNone)
-		{
-        // The user tried to rename to a name that allready exists.
-        if(aDevice.iOperation == EOpChangeName && aErr == KErrAlreadyExists)
-            {
-            CAknNoteDialog* dlg2 = new (ELeave) CAknNoteDialog(CAknNoteDialog::EErrorTone,
-                                                                CAknNoteDialog::ELongTimeout);
-            dlg2->ExecuteLD(R_BT_NAME_EXISTS_NOTE);
-
-            RenameDeviceDlgL();
-            return;
-            }
-        // Need to properly handle situation when "Disconnect from xxx" query 
-        // has been shown and paired device has been turned off simultaneously.
-        // CancelDisconnectQuery dialog need to be closed. 
-        if(aErr == KErrDisconnected)
-            {
-            if(iDisconnectQueryDlg && aDevice.iAddr == iDisconnectQueryDevice.iAddr)
-                CancelDisconnectQueryDlg();
-            
-            TRACE_FUNC_EXIT
-            return;
-            }
-        // show general error if any of these failed
-        if(	aDevice.iOperation== EOpTrust ||
-            aDevice.iOperation== EOpUntrust ||
-            aDevice.iOperation== EOpBlock ||
-            aDevice.iOperation== EOpChangeName)		
-            {
-            TBTUIViewsCommonUtils::ShowGeneralErrorNoteL();
-            }
-		return;
-		}		
-	
-        if(aDevice.iOperation == EOpUntrust) 	        
-            {		
-            // Unauthorise ok note,
-            CAknNoteDialog* dlg = new (ELeave) CAknNoteDialog(CAknNoteDialog::EConfirmationTone,
-                                                                   CAknNoteDialog::ELongTimeout);
-            
-            if(iCoverDisplayEnabled)
-                {
-                CleanupStack::PushL(dlg); 
-                dlg->PublishDialogL(ECmdShowBtDevSetAsUntrustNote, KUidCoverUiCategoryBtui); 
-                // initializes cover support    
-                CleanupStack::Pop(dlg); 
-                }
-            dlg->ExecuteLD( R_BT_DEVICE_UNTRUSTED_NOTE );				
-            }
-	TRACE_FUNC_EXIT		
-	}
-
-// ---------------------------------------------------------------------------
-// CBTUIPairedDevicesView::CreateTabIconL()
-// Creates icon for tab.
-// ---------------------------------------------------------------------------
-//    
-CGulIcon* CBTUIPairedDevicesView::CreateTabIconL()
-    {
-    TFileName bmpFilename;
-    bmpFilename += KBitmapFileDrive;
-    bmpFilename += KDC_APP_BITMAP_DIR;
-    bmpFilename += KBtuiBmpFileName;
-        
-    CGulIcon* icon = AknsUtils::CreateGulIconL(
-        AknsUtils::SkinInstance(), 
-        KAknsIIDQgnPropBtDevicesTab3,  
-        bmpFilename, 
-        EMbmBtuiQgn_prop_bt_devices_tab3, 
-        EMbmBtuiQgn_prop_bt_devices_tab3_mask );
-          
-    return icon;
-    }   
-    
-// End of File
-
--- a/bluetoothengine/btui/Ecom/src/BTUIRegistryWatcher.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 Registry watcher class for BTUI.
-*
-*/
-
-
-// INCLUDE FILES
-
-#include "BTUI.h"
-#include "BTUIRegistryWatcher.h"
-#include <bt_subscribe.h>
-
-#include "BTDevModel.h"  //for Log printing Macro
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CBTUIRegistryWatcherAO::CBTUIRegistryWatcherAO
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// ---------------------------------------------------------
-//
-CBTUIRegistryWatcherAO::CBTUIRegistryWatcherAO( MBTUIRegistryObserver* aParent )
-    : CActive(EPriorityNormal), iParent ( aParent )
-    {
-    TRACE_FUNC_ENTRY
-
-    CActiveScheduler::Add(this);
-
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------
-// Destructor.
-// ---------------------------------------------------------
-//
-CBTUIRegistryWatcherAO::~CBTUIRegistryWatcherAO()
-    {
-    TRACE_FUNC_ENTRY
-
-    Cancel();
-    iProperty.Close();
-
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------
-// CBTUIRegistryWatcherAO::WatchL
-// ---------------------------------------------------------
-//
-void CBTUIRegistryWatcherAO::WatchL()
-    {
-    TRACE_FUNC_ENTRY
-
-    if( !iProperty.Handle() )
-        {
-		User::LeaveIfError( iProperty.Attach( KPropertyUidBluetoothCategory,
-                                              KPropertyKeyBluetoothRegistryTableChange ) );
-        }
-
-    if( !IsActive() )
-        {
-        iProperty.Subscribe(iStatus);
-        SetActive();    
-        }
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------
-// CBTUIRegistryWatcherAO::DoCancel
-// ---------------------------------------------------------
-//
-void CBTUIRegistryWatcherAO::DoCancel()
-    {
-    TRACE_FUNC
-
-    iProperty.Cancel();
-    }
-
-// ---------------------------------------------------------
-// CBTUIRegistryWatcherAO::RunL
-// ---------------------------------------------------------
-//
-void CBTUIRegistryWatcherAO::RunL()
-    {
-    TRACE_FUNC_ENTRY
-
-    if( iStatus.Int()==KErrNone )
-        {
-        __ASSERT_DEBUG(iParent, PANIC(EBTPanicClassMemberVariableIsNull));
-
-        // Inform observer
-        //
-        iParent->RegistryContentChangedL();
-        
-        // Continue watching
-        //
-        WatchL();
-        }
-
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------
-// CBTUIRegistryWatcherAO::RunError
-// ---------------------------------------------------------
-//
-TInt CBTUIRegistryWatcherAO::RunError( TInt aError )
-    {
-    TRACE_INFO((_L("RunError: %d"), aError))
-
-    return aError;
-    }
-
-// ---------------------------------------------------------
-// CBTUIRegistryWatcherAO::StopWatching
-// ---------------------------------------------------------
-//
-void CBTUIRegistryWatcherAO::StopWatching()
-    {
-    TRACE_FUNC
-
-    Cancel();
-    }
-
-// End of File
--- a/bluetoothengine/btui/Ecom/src/BTUISap.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,249 +0,0 @@
-/*
-* 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 is created for Bluetooth SIM Access Profile 
-*				  feature variant.
-*
-*/
-
-#include <aknnotewrappers.h>
-#include <aknradiobuttonsettingpage.h>
-#include <BtuiViewResources.rsg>		// Compiled resource ids
-#include <BTSapDomainPSKeys.h>	
-#include <centralrepository.h> 
-#include <AknMediatorFacade.h>
-#include <btengconnman.h>       // for disconnect type and connection observer
-#include <btengsettings.h>
-#include <btengdevman.h>
-#include <secondarydisplay/BtuiSecondaryDisplayAPI.h>
-#include <btfeaturescfg.h>					// For EnterpriseEnablementL()
-#include <btnotif.h>
-#include <utf.h>
-#include <bluetoothuiutil.h>
-#include "btdevmodel.h"
-
-#include "debug.h"
-#include "BTUIMainView.h"
-
-// ----------------------------------------------------
-// CBTUIMainView::SetSapStatusL
-// ----------------------------------------------------
-//
-void CBTUIMainView::SetSapStatusL( TBTSapMode aValue )
-	{
-	TRACE_FUNC_ENTRY
-
-	TInt previousSapMode = GetSapStatusL();	
-	
-	if(previousSapMode==EBTSapEnabled)
-		previousSapMode=ETrue;
-		
-	TBool legalToChange = ETrue;
-
-	if ( ( previousSapMode ) && ( !aValue ) ) // SAP Enabled -> Disabled
-		{
-		// Check active SAP connections before query
-		TInt connStatus = EBTSapNotConnected;
-        RProperty::Get(KPSUidBluetoothSapConnectionState, KBTSapConnectionState, connStatus);
-						
-		if(connStatus == EBTSapConnected) 
-			{
-			//Get name of the currently connected SAP device
-
-			TBTDeviceName connectedSap;			
-			TInt error = GetConnectedSapNameL( connectedSap ); 
-
-			if ( error )
-				{
-				TBTUIViewsCommonUtils::ShowGeneralErrorNoteL();
-				}
-			else
-				{
-
-				// Create confirmation query
-				RBuf stringholder;
-				CleanupClosePushL( stringholder );
-				BluetoothUiUtil::LoadResourceAndSubstringL( stringholder, 
-				        R_BT_DISCONNECT_FROM, connectedSap, 0 );
-				CAknQueryDialog* dlg = CAknQueryDialog::NewL();
-
-				if(iCoverDisplayEnabled)
-					{
-					CleanupStack::PushL(dlg); 						
-				    dlg->PublishDialogL(ECmdShowDisconnectQuery, KUidCoverUiCategoryBtui); // initializes cover support    
-					CAknMediatorFacade* covercl = AknMediatorFacade(dlg); // uses MOP, so control provided 
-					if (covercl) // returns null if __COVER_DISPLAY is not defined
-					    {	    
-					    covercl->BufStream() << BTDeviceNameConverter::ToUTF8L(connectedSap);// takes copy so consts are ok too
-					    covercl->BufStream().CommitL(); // no more data to send so commit buf
-					    }
-					CleanupStack::Pop(dlg);
-					}
-					
-				TInt keypress = dlg->ExecuteLD( R_BT_DISCONNECT_FROM_QUERY, stringholder );
-
-				CleanupStack::PopAndDestroy(&stringholder);	// stringholder
-
-				if( keypress )	// User has accepted the dialog
-					{
-					legalToChange = ETrue;
-					}
-				else 
-					{
-					legalToChange = EFalse;
-					}
-				}
-			}
-		}
-			
-	else if ( ( !previousSapMode ) && ( aValue ) ) // SAP Disabled	-> Enabled 
-		{
-		
-		//if Bluetooth is off
-        TBTPowerStateValue powerState;
-        iBtEngSettings->GetPowerState(powerState);				
-		if(powerState!=EBTPowerOn)
-			{
-			CAknNoteDialog* dlg2 = new (ELeave) CAknNoteDialog( CAknNoteDialog::EConfirmationTone,
-																   CAknNoteDialog::ENoTimeout/*ELongTimeout*/ );
-		if(iCoverDisplayEnabled)
-			{
-			CleanupStack::PushL(dlg2); 						
-			dlg2->PublishDialogL(ECmdShowBtSapEnableNote, KUidCoverUiCategoryBtui); // initializes cover support    
-			CleanupStack::Pop(dlg2); 						
-			}
-
-			dlg2->ExecuteLD( R_BT_SAP_ENABLE_NOTE );
-			}
-	
-		}		
-
-	// Switch sapmode
-	//
-	if ( legalToChange )
-		{		
-        CRepository* cenRep = NULL;
-        cenRep = CRepository::NewL( KCRUidBTEngPrivateSettings );
-        CleanupStack::PushL(cenRep);                         
-        TInt err = cenRep->Set( KBTSapEnabled, aValue );        
-        CleanupStack::PopAndDestroy(cenRep);        	
-		}		
-	TRACE_FUNC_EXIT
-	}
-
-// ----------------------------------------------------------
-// CBTUIMainView::AskSapModeDlgL
-// ----------------------------------------------------------
-//
-void CBTUIMainView::AskSapModeDlgL()
-	{
-	TRACE_FUNC_ENTRY
-
-	if ( BluetoothFeatures::EnterpriseEnablementL() == BluetoothFeatures::EDataProfilesDisabled )
-		{
-		RNotifier notifier;
-        User::LeaveIfError(notifier.Connect());
-        CleanupClosePushL(notifier);
-		User::LeaveIfError(notifier.StartNotifier(KBTEnterpriseItSecurityInfoNotifierUid, KNullDesC8 ));
-		CleanupStack::PopAndDestroy(&notifier);
-		}
-	else
-		{
-		CDesCArrayFlat* items = iCoeEnv->ReadDesCArrayResourceL( R_BT_SAP_MODES );
-		CleanupStack::PushL(items);	
-		
-		TInt currentItem = KErrNotFound;
-		if(GetSapStatusL() == EBTSapEnabled )
-			{
-				currentItem=0;
-			}
-		else
-			{
-				currentItem=1;
-			
-			}
-		CAknRadioButtonSettingPage* dlg = new ( ELeave )CAknRadioButtonSettingPage(
-		   R_BT_SAP_SETTING_PAGE, currentItem, items );
-		if( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ))
-			{
-			if(currentItem == 1)
-				{
-				SetSapStatusL( static_cast<TBTSapMode>(  EBTSapDisabled ) ); 
-				// Cast it back (invert again)
-				}			
-			else
-				{
-				SetSapStatusL( static_cast<TBTSapMode>(  EBTSapEnabled ) ); 
-				// Cast it back (invert again)			
-				}
-			} 
-		CleanupStack::PopAndDestroy(items); 
-		}
-	TRACE_FUNC_EXIT
-	}
-
-// ----------------------------------------------------------
-// CBTUIMainView::GetSapStatusL
-// ----------------------------------------------------------
-//
-TInt CBTUIMainView::GetSapStatusL()
-	{
-	TRACE_FUNC_ENTRY	
-	TInt sapStatus;
-	CRepository* repository = CRepository::NewL(KCRUidBTEngPrivateSettings);
-	CleanupStack::PushL(repository);            	
-	repository->Get(KBTSapEnabled, sapStatus);
-	CleanupStack::PopAndDestroy(repository);
-	TRACE_FUNC_EXIT
-	return sapStatus;	
-	}
-    
-// ----------------------------------------------------------
-// CBTUIModel::GetConnectedSapNameL
-// ----------------------------------------------------------
-//
-
-TInt CBTUIMainView::GetConnectedSapNameL( TDes& aName )
-	{
-	TRACE_FUNC_ENTRY
-
-    
-    CBTEngConnMan* cm = CBTEngConnMan::NewL(NULL);
-    CleanupStack::PushL(cm);
-        
-    RBTDevAddrArray devAddrArray;
-    cm->GetConnectedAddresses(devAddrArray, EBTProfileSAP);
-    if(devAddrArray.Count()>0)
-    {
-        CBTEngDevMan* devMan = CBTEngDevMan::NewL(NULL);  
-         
-        TBTRegistrySearch search;
-        search.FindAddress(devAddrArray[0]);
-        
-        CBTDeviceArray* deviceArray= new (ELeave) CBTDeviceArray(devAddrArray.Count());
-        //the name is in first CBTDevice in returned CBTDeviceArray. 
-        devMan->GetDevices(search, deviceArray); 
-        
-        aName = *(CnvUtfConverter::ConvertToUnicodeFromUtf8L(deviceArray->At(0)->DeviceName()));
-        
-        deviceArray->ResetAndDestroy();
-        delete deviceArray;
-        
-        delete devMan;
-    }
-        
-    devAddrArray.Close();
-    CleanupStack::PopAndDestroy(cm);               	
-	TRACE_FUNC_EXIT
-	return KErrNone;
-	}
--- a/bluetoothengine/btui/Ecom/src/BTUIViewsCommonUtils.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 function for the views.
-*
-*/
-
-#include <BtuiViewResources.rsg>    // Compiled resource ids
-#include <aknnotewrappers.h>
-#include <StringLoader.h>   		// Series 60 localisation stringloader
-#include <e32property.h>
-#include <bt_subscribe.h>
-#include <featmgr.h>            	// Feature Manager API
-#include <AknMediatorFacade.h>
-#include <btengsettings.h>
-#include <ctsydomainpskeys.h>
-#include <CoreApplicationUIsSDKCRKeys.h>
-#include <secondarydisplay/BtuiSecondaryDisplayAPI.h>
-
-#include "BTUIViewsCommonUtils.h"
-#include "debug.h"
-
-
-// ----------------------------------------------------------
-// TBTUIViewsCommonUtils::ShowGeneralErrorNoteL
-// ----------------------------------------------------------
-//
-void TBTUIViewsCommonUtils::ShowGeneralErrorNoteL()
-    {
-    //TRACE_FUNC_ENTRY
-
-    CAknNoteDialog* dlg = new (ELeave) CAknNoteDialog( CAknNoteDialog::EErrorTone,
-                                                       CAknNoteDialog::ELongTimeout );
-	if(FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ))
-		{  
-		CleanupStack::PushL(dlg); 						
-        dlg->PublishDialogL(ECmdShowBtGeneralErrorNote, KUidCoverUiCategoryBtui); // initializes cover support    
-		CleanupStack::Pop(dlg); 						
-		}
-		
-	TRACE_INFO(_L("ShowGeneralErrorNoteL "))
-	dlg->ExecuteLD( R_BT_GENERAL_ERROR_NOTE );
-
-	//TRACE_FUNC_EXIT    
-    }
-    
-// ----------------------------------------------------------
-// TBTUIViewsCommonUtils::IsAnyDeviceConnectedL()
-// ----------------------------------------------------------
-TBool TBTUIViewsCommonUtils::IsAnyDeviceConnectedL()
-    {
-	//TRACE_FUNC_ENTRY
-
-    TInt connNum = 0;
-    TInt retVal = RProperty::Get(KPropertyUidBluetoothCategory, 
-      KPropertyKeyBluetoothGetPHYCount, connNum);
-    TRACE_INFO((_L("GetConnectionNumber(): %d"), connNum))        
-    //TRACE_FUNC_EXIT    
- 	return (connNum > 0);
-    }          
-    
-// -----------------------------------------------
-// CBTUIPairedDevicesView::TurnBTOnIfNeededL
-// -----------------------------------------------
-TInt TBTUIViewsCommonUtils::TurnBTOnIfNeededL(CBTEngSettings* aBtEngSettings,TBool aCoverDisplayEnabled )
-    {
-	//TRACE_FUNC
-
-    TInt errorCode = KErrNone;    
-    TBTPowerStateValue previousPowerMode;
-       
-    errorCode=aBtEngSettings->GetPowerState(previousPowerMode); 
-    if(errorCode)    
-    	return errorCode;    
-         
-	if( previousPowerMode==EBTPowerOn )
-		return KErrNone;
-	
-	if ( previousPowerMode==EBTPowerOff ) // power OFF -> ON
-        {
-        TRACE_INFO(_L("[BTUI]\t power OFF -> ON"))
-
-        TInt offlineModeOff = 0;    // possible values are 0 and 1
-        TInt activationEnabled = 0; // possible values are 0 and 1
-               
-        CRepository* repository = CRepository::NewL(KCRUidCoreApplicationUIs);
-        CleanupStack::PushL(repository);
-        repository->Get(KCoreAppUIsNetworkConnectionAllowed, offlineModeOff);
-		// Closing connection:
-		CleanupStack::PopAndDestroy(repository);        
-		repository=NULL;
-		
-        repository = CRepository::NewL(KCRUidBluetoothEngine);
-		// Check activation enabled
-		CleanupStack::PushL(repository);
-		repository->Get(KBTEnabledInOffline, activationEnabled);
-		// Closing connection:
-		CleanupStack::PopAndDestroy(repository);
-        
-                
-        TRACE_INFO((_L("power OFF -> ON, offlineModeOff = %d"), offlineModeOff))
-        TRACE_INFO((_L("power OFF -> ON, activationEnabled = %d"), activationEnabled))
-
-           // Choose user interaction
-        //
-        if ( !offlineModeOff && !activationEnabled )
-            {
-            // Load a string, create and show a note
-            //
-            HBufC* stringHolder = StringLoader::LoadLC( R_BT_OFFLINE_DISABLED );
-            CAknInformationNote* note = new (ELeave) CAknInformationNote();
-
-			if(aCoverDisplayEnabled)
-				{  
-				CleanupStack::PushL(note); 						
-	    		note->PublishDialogL(ECmdBtuiShowBtOfflineDisableNote, KUidCoverUiCategoryBtui); // initializes cover support    
-				CleanupStack::Pop(note); 						
-				}
-			
-    		note->ExecuteLD( *stringHolder );
-    		CleanupStack::PopAndDestroy(stringHolder); //stringHolder
-            }
-        else
-            {
-            // Choose query
-            //
-            TInt resource = 0;
-
-        	TInt coverUiDlgId = 0;
-				
-            if ( offlineModeOff )
-                {
-                resource = R_BT_IS_OFF_QUERY;
-				if(aCoverDisplayEnabled)
-					{  
-        	    	coverUiDlgId = ECmdBtuiShowBtIsOffDlg;
-					}
-                }
-            else
-                {
-                resource = R_BT_ACTIVATE_IN_OFFLINE_QUERY;
-				if(aCoverDisplayEnabled)
-					{  
-        	    	coverUiDlgId = ECmdBtuiShowBtActivateInOfflineDlg;
-					}
-                }
-
-            // Create and show query
-            //
-            CAknQueryDialog* dlg = CAknQueryDialog::NewL();
-
-   			if(aCoverDisplayEnabled)
-				{  
-				CleanupStack::PushL(dlg); 						
-    			dlg->PublishDialogL(coverUiDlgId, KUidCoverUiCategoryBtui); // initializes cover support    
-				CleanupStack::Pop(dlg); 						
-				}
-				
-            TInt keypress = dlg->ExecuteLD( resource );
-
-            if( keypress )
-                {
-                // Switch BT ON
-                //
-                errorCode=aBtEngSettings->SetPowerState(EBTPowerOn ) ;
-                if (errorCode)
-                    {
-                    ShowGeneralErrorNoteL();                   
-                    }
-                }  else     
-            	{
-            	errorCode=KErrCancel;               
-            	}       
-					
-                
-            }
-
-        }    
-	
-    return errorCode;
-    }    
-    
-
-
--- a/bluetoothengine/btui/Ecom/src/BtuiPluginImplementationTable.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* 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:   ECOM proxy table for this plugin
-*
-*/
-
-#include <e32std.h>
-#include <implementationproxy.h>
-
-#include "BTUIMainView.h"
-#include "BTUIPairedDevicesView.h"
-#include "BTUIBlockedDevicesView.h"
-
-
-const TImplementationProxy KBtuiPluginImplementationTable[] = 
-	{
-	// UPDATE THIS - Uid for plugin implementation:
-	//This impl is for GS FW, in this case mainView will construct BTUI Model.
-	IMPLEMENTATION_PROXY_ENTRY( 0x1020742C,	CBTUIMainView::NewGsPluginL ), 	
-
-	//Following two are for BTUI App, in this case mainView won't construct BTUI Model, 
-	//BTUI's AppUi will do it and pass the pointer of Model to both views.
-	IMPLEMENTATION_PROXY_ENTRY( 0x1020745C,	CBTUIMainView::NewL ),
-	IMPLEMENTATION_PROXY_ENTRY( 0x1020745D,	CBTUIPairedDevicesView::NewL ),
-	IMPLEMENTATION_PROXY_ENTRY( 0x20002780,	CBTUIBlockedDevicesView::NewL )
-	};
-
-// ---------------------------------------------------------------------------
-// ImplementationGroupProxy
-// Gate/factory function
-// ---------------------------------------------------------------------------
-//
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
-	{
-	aTableCount = sizeof(KBtuiPluginImplementationTable) 
-        / sizeof(TImplementationProxy);
-	return KBtuiPluginImplementationTable;
-	}
--- a/bluetoothengine/btui/Ecom/src/btuipluginman.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,156 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Find and load plugin
-*
-*/
-
-
-#include <aknview.h>
-#include "btuipluginman.h"
-#include "debug.h"  
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-// NewL
-// ---------------------------------------------------------------------------
-//
-CBTUIPluginMan* CBTUIPluginMan::NewL( CAknViewAppUi* aAppUi )
-    {
-    CBTUIPluginMan* self = new( ELeave ) CBTUIPluginMan( aAppUi );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------------------------
-//
-CBTUIPluginMan::~CBTUIPluginMan()
-    {
-    TRACE_FUNC_ENTRY
-    
-    iPluginInfoArray.ResetAndDestroy();
-    iPluginInfoArray.Close();
-    iPluginArray.Reset();//Do not destroy - Plugins are owned by iAppUi
-
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------------
-// Check if availability of some plug-in
-// ---------------------------------------------------------------------------
-//
-TBool CBTUIPluginMan::IsPluginAvaiable(TBTDeviceClass aDeviceClassInfo)
-	{
-	for( TInt i=0; i<iPluginArray.Count(); i++ )
-		{
-		TBTDeviceClass devClass = iPluginArray[i]->GetCOD(); 
-		if( devClass.MajorDeviceClass() == aDeviceClassInfo.MajorDeviceClass() && 
-			devClass.MinorDeviceClass() == aDeviceClassInfo.MinorDeviceClass() )
-			return ETrue;
-		}
-	return EFalse;
-	}
-
-// ---------------------------------------------------------------------------
-// Get the setting view from PluginArrary based on the COD 
-// ---------------------------------------------------------------------------
-//
-CAknView* CBTUIPluginMan::GetSettingViewL(TBTDevice& aDevice)
-	{
-	for (TInt ii = 0; ii < iPluginArray.Count(); ii++ )
-		{
-		TBTDeviceClass tmpCOD = iPluginArray[ii]->GetCOD();
-		//Currently one device - one view - one plugin, 
-		//in future maybe other device properties will decide on getting the view. 
-		if(aDevice.iDeviceClass.MajorDeviceClass() == tmpCOD.MajorDeviceClass() &&
-				aDevice.iDeviceClass.MinorDeviceClass() == 	tmpCOD.MinorDeviceClass())
-			{
-			return (CAknView*)iPluginArray[ii];
-			}
-		}
-	
-	return NULL;	
-	}
-
-// ---------------------------------------------------------------------------
-// C++ default constructor
-// ---------------------------------------------------------------------------
-//
-CBTUIPluginMan::CBTUIPluginMan( CAknViewAppUi* aAppUi )
-    : iAppUi(aAppUi)
-    {
-
-    }
-
-// ---------------------------------------------------------------------------
-// Symbian 2nd-phase constructor
-// ---------------------------------------------------------------------------
-//
-void CBTUIPluginMan::ConstructL()
-    {   
-    LoadPluginsL();
-    }
-
-// ---------------------------------------------------------------------------
-// Load ECom plug-ins
-// ---------------------------------------------------------------------------
-//
-void CBTUIPluginMan::LoadPluginsL()
-	{
-	TRACE_FUNC_ENTRY
-	
-	REComSession::ListImplementationsL( KCBtuiPluginInterfaceUid, iPluginInfoArray );
-	TInt count = iPluginInfoArray.Count();
-	TRACE_INFO( ( _L( "[BTUI]\t CBTUIPluginMan::LoadSettingPluginL() PluginArray count=%d" ), count) )
-
-    iPluginArray.Reset();
-	for ( TUint ii = 0 ; ii < count; ++ii )
-		{
-		CImplementationInformation* impl = iPluginInfoArray[ii];
-		//Only append the plugins which datatype() is for HID devices. 
-	    if(impl->DataType().Length())
-	    	{
-	    	TLex8 lex( impl->DataType() );
-	    	TUint major = 0, minor = 0;
-	    	TInt err1 = lex.Val(major, EHex);
-	    	lex.SkipSpace();
-	    	TInt err2 = lex.Val(minor, EHex);
-	    	if( !err1 && !err2)
-	    	    {
-	    	    TRACE_INFO( ( _L( "[BTUI]\t CBTUIPluginMan::LoadSettingPluginL() MajorCOD=%d MinorCOD=%d" ), major, minor) )
- 	            TBTDeviceClass cod(0x00, major, minor);
-	    	                
-	    	    CBtuiPluginInterface* plugin = NULL;
-	    	    TRAPD( ret, plugin = CBtuiPluginInterface::NewL( impl->ImplementationUid() ) );
-	    	    if( !ret )
-	    	        {
-	    	        CleanupStack::PushL(plugin);
-	    	        
-	    	        // Transfer the ownership to AppUi
-	    	        iAppUi->AddViewL( (CAknView*)plugin ); 
-	    	        plugin->SetCOD(cod);
-	    	        iPluginArray.AppendL(plugin);
-	    	        CleanupStack::Pop(plugin);              
-	    	        }	    	        
-	    	    }
-	        }
-		}
-	
-	TRACE_FUNC_EXIT
-	}
-
--- a/bluetoothengine/btui/aif/BTUI_caption.rss	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Caption RSS file for creating the aif file for BTUI.
-*
-*/
-
-
-#include "btui.loc"
-#include <apcaptionfile.rh>
-
-RESOURCE CAPTION_DATA
-    {
-    caption      = qtn_apps_bluetooth_list;
-    shortcaption = qtn_apps_bluetooth_grid;
-    }
-
-
-// End of File
--- a/bluetoothengine/btui/aif/BTUIaif.rss	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 BTUI.
-*
-*/
-
-
-#include <aiftool.rh>
-
-RESOURCE AIF_DATA
-{
-    app_uid=0x10005951; // Application UID
-    num_icons=2;        // Grid and list icons with masks
-}
-
-// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/btcpplugin.cpp	Fri May 14 16:01:46 2010 +0300
@@ -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:  
+ *
+ */
+
+
+#include <cpsettingformentryitemdataimpl.h>
+#include "BtCpPlugin.h"
+#include "btcpuimainview.h"
+#include "btcpuisettingitem.h"
+
+/*!
+  BtCpPlugin::BtCpPlugin
+ */
+BtCpPlugin::BtCpPlugin()
+{
+}
+
+/*!
+  BtCpPlugin::~BtCpPlugin
+ */
+BtCpPlugin::~BtCpPlugin()
+{
+}
+
+/*!
+  BtCpPlugin::createSettingFormItemData
+ */
+QList<CpSettingFormItemData*> BtCpPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const
+{
+    
+    return QList<CpSettingFormItemData*> () << new BtCpUiSettingItem(
+            itemDataHelper, tr("Bluetooth"));
+
+}
+
+Q_EXPORT_PLUGIN2(BtCpPlugin, BtCpPlugin);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/btcpplugin.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *   
+ */
+
+#ifndef BTCPPLUGIN_H
+#define BTCPPLUGIN_H
+
+#include <qobject.h>
+#include <cpplugininterface.h>
+
+class BtCpPlugin : public QObject, public CpPluginInterface
+{
+    Q_OBJECT
+    Q_INTERFACES(CpPluginInterface)
+    
+public:
+    
+    BtCpPlugin();
+    ~BtCpPlugin();
+    virtual QList<CpSettingFormItemData*> createSettingFormItemData(CpItemDataHelper &itemDataHelper) const;
+};
+
+#endif  /* BTCPPLUGIN_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/btcpplugin.pro	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,65 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+TEMPLATE = lib
+TARGET = btcpplugin
+DEPENDPATH += .
+INCLUDEPATH += . ../inc/
+
+
+CONFIG += qt hb plugin
+LIBS += -lcpframework -lbtuimodel -lbtuidelegate
+
+MOC_DIR = moc
+OBJECTS_DIR = obj
+
+#TRANSLATIONS = telephone_cp.ts
+RESOURCES += btcpplugin.qrc
+
+# Input
+HEADERS += btcpplugin.h \
+           btcpuibaseview.h \
+           btcpuimainview.h \
+           btcpuisearchview.h \
+           btcpuisettingitem.h
+
+SOURCES += btcpplugin.cpp \
+           btcpuibaseview.cpp \
+           btcpuimainview.cpp \
+           btcpuisearchview.cpp \
+           btcpuisettingitem.cpp
+           
+symbian: {
+    DEFINES += PLUGINUID3=0x2002434E
+    TARGET.UID3 = 0x2002434E
+    TARGET.CAPABILITY = ALL -TCB
+    
+    TARGET.EPOCALLOWDLLDATA = 1  
+	INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+    
+	PLUGIN_STUB_PATH = /resource/qt/plugins/controlpanel
+	
+	deploy.path = C:
+	pluginstub.sources = $${TARGET}.dll
+	pluginstub.path = $$PLUGIN_STUB_PATH
+	DEPLOYMENT += pluginstub
+
+    qtplugins.path = $$PLUGIN_STUB_PATH
+    qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin
+     
+    for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin  $$deploy.path$$qtplugins.path/$$basename(qtplugin)" 
+} 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/btcpplugin.qrc	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,26 @@
+<RCC>
+    <qresource prefix="/" >
+        <file>icons/qgn_graf_blid_det_circle.svg</file>
+        <file>icons/qgn_graf_blid_time.svg</file>
+        <file>icons/qgn_indi_bt_blocked.svg</file>
+        <file>icons/qgn_indi_bt_paired_add.svg</file>
+        <file>icons/qgn_indi_bt_trusted_add.svg</file>
+        <file>icons/qgn_prop_bt_audio.svg</file>
+        <file>icons/qgn_prop_bt_blocked_tab3.svg</file>
+        <file>icons/qgn_prop_bt_car_kit.svg</file>
+        <file>icons/qgn_prop_bt_carkit.svg</file>
+        <file>icons/qgn_prop_bt_computer.svg</file>
+        <file>icons/qgn_prop_bt_headset.svg</file>
+        <file>icons/qgn_prop_bt_keyboard.svg</file>
+        <file>icons/qgn_prop_bt_misc.svg</file>
+        <file>icons/qgn_prop_bt_mouse.svg</file>
+        <file>icons/qgn_prop_bt_phone.svg</file>
+        <file>icons/qgn_prop_bt_printer.svg</file>
+        <file>icons/qgn_prop_bt_unknown.svg</file>
+        <file>icons/qgn_frwidget_add_friend_photo.svg</file>
+    </qresource>
+    <qresource prefix="/" >
+        <file>docml/bt-main-view.docml</file>
+        <file>docml/bt-search-view.docml</file>
+    </qresource>
+</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/btcpuibaseview.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* ============================================================================
+*  Name        : btcpuibaseclass.cpp
+*  Part of     : BluetoothUI / btapplication       *** Info from the SWAD
+*  Description : Implements the baseclass for all views in btapplication.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.1
+*/
+
+#include "btcpuibaseview.h"
+#include <HbAction.h>
+
+/*!
+    Constructor.
+ */
+BtCpUiBaseView::BtCpUiBaseView( BtuiModel &model, QGraphicsItem *parent )
+    :CpBaseSettingView( 0 , parent ),mModel(model)
+{
+
+}
+
+/*!
+    Destructor.
+ */
+BtCpUiBaseView::~BtCpUiBaseView()
+{
+
+}
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/btcpuibaseview.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,64 @@
+/*
+* ============================================================================
+*  Name        : btcpuibaseview.h
+*  Part of     : BluetoothUI / btapplication       *** Info from the SWAD
+*  Description : Declaration of the baseclass for all views in btapplication.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef BTCPUIBASEVIEW_H
+#define BTCPUIBASEVIEW_H
+
+#include <hbview.h>
+#include <qglobal.h>
+#include <cpbasesettingview.h>
+#include <btuimodel.h>
+
+/*!
+    \class BtUiBaseView
+    \brief the class is the base class for all views in btapplication.
+
+ */
+class BtCpUiBaseView : public CpBaseSettingView
+{
+    Q_OBJECT
+
+public:
+    
+    virtual ~BtCpUiBaseView();
+    virtual void activateView( const QVariant& value, int cmdId ) = 0;
+    virtual void deactivateView() = 0;    
+
+signals:
+
+protected:   
+    explicit BtCpUiBaseView( BtuiModel &model, QGraphicsItem *parent = 0);
+    virtual void setSoftkeyBack() = 0;
+    virtual void switchToPreviousView() = 0;
+    
+protected:
+    
+    //Does not own this model.
+    BtuiModel &mModel;
+
+    QGraphicsItem *mParent;
+    int mPreviousViewId;
+    
+    Q_DISABLE_COPY(BtCpUiBaseView)
+};
+
+#endif // BTCPUIBASEVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/btcpuimainview.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,524 @@
+/*
+* 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:  BtCpUiMainView implementation
+*
+*/
+
+#include "btcpuimainview.h"
+#include <QtGlobal>
+#include <QGraphicsLinearLayout>
+#include <HbInstance>
+//#include "btuiviewutil.h"
+#include <hbdocumentloader.h>
+#include <hbnotificationdialog.h>
+#include <hbgridview.h>
+#include <hbpushbutton.h>
+#include <hblabel.h>
+#include <hbicon.h>
+#include <hblineedit.h>
+#include <hbtooltip.h>
+#include <btengconstants.h>
+#include <hbmenu.h>
+#include <hbaction.h>
+#include <hbcombobox.h>
+#include "btcpuisearchview.h"
+#include <bluetoothuitrace.h>
+#include <btdelegatefactory.h>
+#include <btabstractdelegate.h>
+#include "btqtconstants.h"
+
+
+// docml to load
+const char* BTUI_MAINVIEW_DOCML = ":/docml/bt-main-view.docml";
+
+/*!
+    Constructs a new BtUiMainView using HBDocumentLoader.  Docml (basically xml) file
+    has been generated using Application Designer.   
+
+ */
+BtCpUiMainView::BtCpUiMainView( BtuiModel &model, QGraphicsItem *parent )
+    : BtCpUiBaseView( model, parent ), mAbstractDelegate(0)
+{
+    bool ret(false);
+    
+    mMainWindow = hbInstance->allMainWindows().first();
+    mMainView = this;
+    
+    // Create view for the application.
+    // Set the name for the view. The name should be same as the view's
+    // name in docml.
+    setObjectName("view");
+
+    QObjectList objectList;
+    objectList.append(this);
+    // Pass the view to documentloader. Document loader uses this view
+    // when docml is parsed, instead of creating new view.
+    mLoader = new HbDocumentLoader();
+    mLoader->setObjectTree(objectList);
+
+    bool ok = false;
+    mLoader->load( BTUI_MAINVIEW_DOCML, &ok );
+    // Exit if the file format is invalid
+    BTUI_ASSERT_X( ok, "bt-main-view", "Invalid docml file" );
+    
+    mOrientation = mMainWindow->orientation();
+    
+    if (mOrientation == Qt::Horizontal) {
+        mLoader->load(BTUI_MAINVIEW_DOCML, "landscape", &ok);
+        BTUI_ASSERT_X( ok, "bt-main-view", "Invalid docml file: landscape section problem" );
+    }
+    else {
+        mLoader->load(BTUI_MAINVIEW_DOCML, "portrait", &ok);
+        BTUI_ASSERT_X( ok, "bt-main-view", "Invalid docml file: landscape section problem" );        
+    }
+
+    mDeviceNameEdit=0;
+    mDeviceNameEdit = qobject_cast<HbLineEdit *>( mLoader->findWidget( "lineEdit" ) );
+    BTUI_ASSERT_X( mDeviceNameEdit != 0, "bt-main-view", "Device Name not found" );
+    ret =  connect(mDeviceNameEdit, SIGNAL(editingFinished ()), this, SLOT(changeBtLocalName()));
+    
+    mPowerButton=0;
+    mPowerButton = qobject_cast<HbPushButton *>( mLoader->findWidget( "pushButton" ) );
+    BTUI_ASSERT_X( mPowerButton != 0, "bt-main-view", "power button not found" );
+    ret =  connect(mPowerButton, SIGNAL(clicked()), this, SLOT(changePowerState()));
+    BTUI_ASSERT_X( ret, "BtCpUiMainView::BtCpUiMainView", "can't connect power button" );
+    
+    mVisibilityMode=0;
+    mVisibilityMode = qobject_cast<HbComboBox *>( mLoader->findWidget( "combobox" ) );
+    BTUI_ASSERT_X( mVisibilityMode != 0, "bt-main-view", "visibility combobox not found" );
+        
+    mDeviceList=0;
+    mDeviceList = qobject_cast<HbGridView *>( mLoader->findWidget( "gridView" ) );
+    BTUI_ASSERT_X( mDeviceList != 0, "bt-main-view", "Device List (grid view) not found" );   
+    
+    // listen for orientation changes
+    ret = connect(mMainWindow, SIGNAL(orientationChanged(Qt::Orientation)),
+            this, SLOT(changeOrientation(Qt::Orientation)));
+    BTUI_ASSERT_X( ret, "BtCpUiMainView::BtCpUiMainView()", "connect orientationChanged() failed");
+
+    // load tool bar actions
+    HbAction *discoverAction = static_cast<HbAction*>( mLoader->findObject( "discoverAction" ) );
+    BTUI_ASSERT_X( discoverAction, "bt-main-view", "discover action missing" ); 
+    ret = connect(discoverAction, SIGNAL(triggered()), this, SLOT(goToDiscoveryView()));
+    BTUI_ASSERT_X( ret, "bt-main-view", "orientation toggle can't connect" ); 
+    
+    // load menu
+    HbMenu *optionsMenu = qobject_cast<HbMenu *>(mLoader->findWidget("viewMenu"));
+    BTUI_ASSERT_X( optionsMenu != 0, "bt-main-view", "Options menu not found" );   
+    this->setMenu(optionsMenu);
+    
+    // update display when setting data changed
+    ret = connect(&mModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), 
+            this, SLOT(updateSettingItems(QModelIndex,QModelIndex)));
+    BTUI_ASSERT_X( ret, "BtCpUiMainView::BtCpUiMainView", "can't connect dataChanged" );
+    
+    QModelIndex top = mModel.index( BtuiModel::LocalSettingRow, BtuiModel::BluetoothNameCol );
+    QModelIndex bottom = mModel.index( BtuiModel::LocalSettingRow, BtuiModel::VisibilityCol );
+    // update name, power and visibility rows
+    updateSettingItems( top, bottom );
+
+    //Handle Visibility Change User Interaction
+    ret = connect(mVisibilityMode, SIGNAL(currentIndexChanged (int)), 
+            this, SLOT(visibilityChanged (int)));
+    // create other views
+    createViews();
+    mCurrentView = this;
+    mCurrentViewId = MainView;
+
+}
+
+/*!
+    Destructs the BtCpUiMainView.
+ */
+BtCpUiMainView::~BtCpUiMainView()
+{
+    delete mLoader; // Also deletes all widgets that it constructed.
+    mMainWindow->removeView(mSearchView);
+    delete mSearchView;
+	 if (mAbstractDelegate)
+    {
+        delete mAbstractDelegate;
+    }
+}
+
+/*! 
+    from base class, initialize the view
+ */
+void BtCpUiMainView::activateView(const QVariant& value, int cmdId )
+{
+    Q_UNUSED(value);
+    Q_UNUSED(cmdId);
+
+}
+
+/*! 
+    From base class. Handle resource before the current view is deactivated.
+ */
+void BtCpUiMainView::deactivateView()
+{
+
+}
+
+void BtCpUiMainView::itemActivated(QModelIndex index)
+{
+    Q_UNUSED(index);
+}
+
+void BtCpUiMainView::goToDiscoveryView()
+{
+    changeView( SearchView, false, 0 );
+}
+
+Qt::Orientation BtCpUiMainView::orientation()
+{
+    return mOrientation;
+}
+
+void BtCpUiMainView::changeBtLocalName()
+{
+    //Error handling has to be done.  
+    if (!mAbstractDelegate) {
+        mAbstractDelegate = BtDelegateFactory::newDelegate(BtDelegate::DeviceName, mModel); 
+        connect( mAbstractDelegate, SIGNAL(commandCompleted(int,QVariant)), this, SLOT(btNameDelegateCompleted(int,QVariant)) );
+        mAbstractDelegate->exec(mDeviceNameEdit->text ());
+    }
+    else {
+        setPrevBtLocalName();
+    }
+}
+
+void BtCpUiMainView::setPrevBtLocalName()
+{
+    //Should we notify user this as Error...?
+    HbNotificationDialog::launchDialog(hbTrId("Error"));
+    QModelIndex index = mModel.index( BtuiModel::LocalSettingRow, BtuiModel::BluetoothNameCol );
+    
+    mDeviceNameEdit->setText( mModel.data(index,BtuiModel::settingDisplay).toString() );
+}
+
+
+void BtCpUiMainView::btNameDelegateCompleted(int status, QVariant param)
+{
+    if(KErrNone == status) {
+        mDeviceNameEdit->setText(param.toString());
+    }
+    else {
+        setPrevBtLocalName();
+    }
+    //Error handling has to be done.    
+    if (mAbstractDelegate)
+    {
+        disconnect(mAbstractDelegate);
+        delete mAbstractDelegate;
+        mAbstractDelegate = 0;
+    }
+
+}
+
+void BtCpUiMainView::visibilityChanged (int index)
+{
+    QList<QVariant> list;
+    
+    VisibilityMode mode = indexToVisibilityMode(index);
+    list.append(QVariant((int)mode));
+    if(BtTemporary == VisibilityMode(mode)) {
+        //Right now hardcoded to 5 Mins.
+        list.append(QVariant(5));
+    }
+    //Error handling has to be done.    
+    if (!mAbstractDelegate) {
+        mAbstractDelegate = BtDelegateFactory::newDelegate(BtDelegate::Visibility, mModel); 
+        connect( mAbstractDelegate, SIGNAL(commandCompleted(int)), this, SLOT(visibilityDelegateCompleted(int)) );
+        mAbstractDelegate->exec(list);
+    }
+    else {
+        setPrevVisibilityMode();
+    }
+
+}
+
+void BtCpUiMainView::setPrevVisibilityMode()
+{
+    bool ret(false);
+    
+    //Should we notify this error to user..?
+    HbNotificationDialog::launchDialog(hbTrId("Error"));
+    QModelIndex index = mModel.index( BtuiModel::LocalSettingRow, BtuiModel::VisibilityCol );
+    
+    ret = disconnect(mVisibilityMode, SIGNAL(currentIndexChanged (int)), 
+                    this, SLOT(visibilityChanged (int)));
+    BTUI_ASSERT_X( ret, "BtCpUiMainView::setPrevVisibilityMode", "can't disconnect signal" );
+    
+        mVisibilityMode->setCurrentIndex ( visibilityModeToIndex((VisibilityMode)
+                mModel.data(index,BtuiModel::SettingValue).toInt()) );
+    
+    //Handle Visibility Change User Interaction
+    ret = connect(mVisibilityMode, SIGNAL(currentIndexChanged (int)), 
+            this, SLOT(visibilityChanged (int)));
+    BTUI_ASSERT_X( ret, "BtCpUiMainView::setPrevVisibilityMode", "can't connect signal" );
+
+}
+
+
+void BtCpUiMainView::visibilityDelegateCompleted(int status)
+{
+    
+    //This should be mapped to Qt error
+    if(KErrNone != status) {
+        setPrevVisibilityMode();
+    }
+    
+    //Error handling has to be done.    
+    if (mAbstractDelegate)
+    {
+        disconnect(mAbstractDelegate);
+        delete mAbstractDelegate;
+        mAbstractDelegate = 0;
+    }
+
+}
+
+
+// called due to real orientation change event coming from main window
+void BtCpUiMainView::changeOrientation( Qt::Orientation orientation )
+{
+    bool ok = false;
+    mOrientation = orientation;
+    if( orientation == Qt::Vertical ) {
+        // load "portrait" section
+        mLoader->load( BTUI_MAINVIEW_DOCML, "portrait", &ok );
+        BTUI_ASSERT_X( ok, "bt-main-view", "Invalid docml file: portrait section problem" );
+    } else {
+        // load "landscape" section
+        mLoader->load( BTUI_MAINVIEW_DOCML, "landscape", &ok );
+        BTUI_ASSERT_X( ok, "bt-main-view", "Invalid docml file: landscape section problem" );
+    }
+}
+
+void BtCpUiMainView::commandCompleted( int cmdId, int err, const QString &diagnostic )
+{
+    Q_UNUSED(cmdId);
+    Q_UNUSED(err);
+    Q_UNUSED(diagnostic);
+
+}
+
+/*!
+    Slot for receiving notification of data changes from the model.
+    Identify the setting changed and update the corresponding UI item.
+ */
+void BtCpUiMainView::updateSettingItems(const QModelIndex &topLeft, const QModelIndex &bottomRight)
+{   
+
+    // update only the part of the view specified by the model's row(s)
+
+    for (int i=topLeft.column(); i <= bottomRight.column(); i++) {
+        QModelIndex index = mModel.index( BtuiModel::LocalSettingRow, i);
+        // Distinguish which setting value is changed.
+        switch ( i ) {
+        case BtuiModel::BluetoothNameCol :
+            mDeviceNameEdit->setText( mModel.data(index,BtuiModel::settingDisplay).toString() );
+            break;
+        case BtuiModel::PowerStateCol:
+            mPowerButton->setText( mModel.data(index,BtuiModel::settingDisplay).toString() );
+            break;
+        case BtuiModel::VisibilityCol:
+            mVisibilityMode->setCurrentIndex ( visibilityModeToIndex((VisibilityMode)
+                    mModel.data(index,BtuiModel::SettingValue).toInt()) );
+            break;
+        }
+    }
+
+    
+}
+
+/*!
+    Slot for receiving notification for user interaction on power state.
+    Manually update model data since HbPushButton is not linked to model directly.
+ */
+void BtCpUiMainView::changePowerState()
+{
+    
+    QModelIndex index = mModel.index(BtuiModel::LocalSettingRow, BtuiModel::PowerStateCol);
+    QVariant powerState = mModel.data(index, Qt::EditRole);
+    if (!mAbstractDelegate)//if there is no other delegate running
+    { 
+        mAbstractDelegate = BtDelegateFactory::newDelegate(BtDelegate::ManagePower, mModel); 
+        connect( mAbstractDelegate, SIGNAL(commandCompleted(int)), this, SLOT(powerDelegateCompleted(int)) );
+        mAbstractDelegate->exec(powerState);
+    }
+   
+}
+
+void BtCpUiMainView::powerDelegateCompleted(int status)
+{
+    Q_UNUSED(status);
+    //ToDo: Error handling here 
+    if (mAbstractDelegate)
+    {
+        disconnect(mAbstractDelegate);
+        delete mAbstractDelegate;
+        mAbstractDelegate = 0;
+    }
+    //BTUI_ASSERT_X( status, "bt-main-view", "error in delegate complete" );  
+}
+
+/*!
+ * Mapping from visibility mode UI row to VisibilityMode
+ */
+VisibilityMode BtCpUiMainView::indexToVisibilityMode(int index)
+{
+    VisibilityMode mode; 
+    switch(index) {
+    case UiRowBtHidden:  
+        mode = BtHidden;
+        break;
+    case UiRowBtVisible:  
+        mode = BtVisible;
+        break;
+    case UiRowBtTemporary:  
+        mode = BtTemporary;
+        break;
+    default:
+        mode = BtUnknown;
+    }
+    return mode;
+}
+
+/*!
+ * Mapping from VisibilityMode to visibility mode UI row  
+ */
+int BtCpUiMainView::visibilityModeToIndex(VisibilityMode mode)
+{
+    int uiRow;
+    switch(mode) {
+    case BtHidden:  
+        uiRow = UiRowBtHidden;
+        break;
+    case BtVisible:  
+        uiRow = UiRowBtVisible;
+        break;
+    case BtTemporary:  
+        uiRow = UiRowBtTemporary;
+        break;
+    default:
+        uiRow = -1;  // error
+    }
+    return uiRow;
+}
+//////////////////////
+//
+// from view manager
+// 
+//////////////////////
+
+/*!
+    Create views(main view, device view and search view).
+    Add them to MainWindow.  All views are long-lived and are deleted only when exiting the application 
+    (or when main view is deleted).
+ */
+void BtCpUiMainView::createViews()
+{
+    Qt::Orientation orientation = mMainWindow->orientation();
+    // Create other views
+    mSearchView = new BtCpUiSearchView( mModel, this );
+    mMainWindow->addView(mSearchView);
+    mDeviceView = 0;  // ToDo: add this later
+    
+    mCurrentView = this;
+    mCurrentViewId = MainView;
+
+    
+    // QList<int> stores the previous view ids for each view.
+    for( int i=0; i < LastView; i++ ) {
+        mPreviousViewIds.append( 0 );
+    }
+}
+
+/*!
+    Switch between the views.  
+    Parameter cmdId is used for automatically executing command.
+    Parameter "value" is optional except for GadgetView, 
+    which needs the BT address (QString)
+ */
+void BtCpUiMainView::changeView(int targetViewId, bool fromBackButton, 
+        int cmdId, const QVariant& value )
+{
+    mCurrentView->deactivateView();
+
+    // update the previous view Id in QList<int> 
+    // If launching the target view from back softkey, 
+    // the previous viewId of target view should not be changed. 
+    // Otherwise, loop happens between two views.
+    if(!fromBackButton) {
+        if ((targetViewId == DeviceView) && (mCurrentViewId == SearchView)) {
+            // we don't want to return to search view after e.g. pairing a new device
+            mPreviousViewIds[ targetViewId ] = MainView;  
+        } 
+        else {
+            // normal case:  return to previous view
+            mPreviousViewIds[ targetViewId ] = mCurrentViewId;
+        }
+    }
+
+    // set the new current view 
+    mCurrentView = idToView(targetViewId);
+    mCurrentViewId = targetViewId;
+    mMainWindow->setCurrentView( mCurrentView );
+
+    // do preparation or some actions when new view is activated 
+    mCurrentView->activateView( value, cmdId );
+}
+ 
+
+BtCpUiBaseView * BtCpUiMainView::idToView(int targetViewId)
+{
+    switch (targetViewId) {
+    case MainView:
+        return mMainView;
+    case SearchView:
+        return mSearchView;
+    case DeviceView:
+        return mDeviceView;
+    default :
+        BTUI_ASSERT_X(false, "BtCpUiMainView::idToView", "invalid view id");
+    }
+    return 0;
+}
+
+/*
+   Jump to previous view.  This function is used when back button is pressed.
+ */
+void BtCpUiMainView::switchToPreviousViewReally()
+{  
+    // jump to previous view of current view.
+    if( (mCurrentViewId >= 0) && (mCurrentViewId < LastView)) {
+        changeView( mPreviousViewIds[mCurrentViewId], true, 0 );
+    } 
+    else {
+        BTUI_ASSERT_X(false, "BtCpUiMainView::switchToPreviousViewReally", "invalid view id");
+    }
+}
+
+
+void BtCpUiMainView::setSoftkeyBack()
+{
+
+}
+
+void BtCpUiMainView::switchToPreviousView()
+{
+        
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/btcpuimainview.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,120 @@
+/*
+* 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:  Main View of BT Application
+*
+*/
+
+#ifndef BTCPUIMAINVIEW_H
+#define BTCPUIMAINVIEW_H
+
+#include "btcpuibaseview.h"
+#include <btqtconstants.h>
+#include <QStringListModel>
+
+class HbLabel;
+class HbLineEdit;
+class HbPushButton;
+class HbIcon;
+class HbComboBox;
+class HbDocumentLoader;
+class HbGridView;
+class BtAbstractDelegate;
+
+
+class BtCpUiMainView : public BtCpUiBaseView
+{
+    Q_OBJECT
+
+public:
+    enum ViewIndex {
+        MainView,
+        SearchView, 
+        DeviceView,
+        LastView
+    };
+    explicit BtCpUiMainView( BtuiModel &model, QGraphicsItem *parent = 0 );
+    ~BtCpUiMainView();
+    // from view manager
+    void createViews();
+
+    Qt::Orientation  orientation();
+
+    // from base class BtCpUiBaseView
+    virtual void setSoftkeyBack();
+    virtual void activateView( const QVariant& value, int cmdId );
+    virtual void deactivateView();
+
+public slots: 
+    void commandCompleted( int cmdId, int err, const QString &diagnostic );
+    void changeOrientation( Qt::Orientation orientation );
+    void itemActivated(QModelIndex index); 
+    void changePowerState();
+    void updateSettingItems(const QModelIndex &topLeft, const QModelIndex &bottomRight);
+    
+    void goToDiscoveryView();
+    
+    // from view manager
+    void changeView(int targetViewId, bool fromBackButton, int cmdId, const QVariant& value = 0 );
+    void switchToPreviousViewReally();
+    virtual void switchToPreviousView();
+    
+    void visibilityChanged (int index);
+    void changeBtLocalName();
+    
+    //from delegate classes
+    void powerDelegateCompleted(int status);
+    void visibilityDelegateCompleted(int status);
+    void btNameDelegateCompleted(int status, QVariant param);
+    
+protected:
+
+    
+private:
+    VisibilityMode indexToVisibilityMode(int index);
+    int visibilityModeToIndex(VisibilityMode mode);
+    BtCpUiBaseView * idToView(int targetViewId);
+    
+    //Functions to set the Previous Local settings in case of error
+    void setPrevBtLocalName();
+    void setPrevVisibilityMode();
+    
+private:
+    QAbstractItemModel* mSubModel;
+    HbDocumentLoader *mLoader;
+    HbLineEdit *mDeviceNameEdit;
+    HbPushButton *mPowerButton;
+    HbComboBox *mVisibilityMode;
+    QStringListModel *mVisiListModel;
+    HbGridView *mDeviceList;
+    
+    // data structures for switching between views
+    bool mEventFilterInstalled;
+    int mAutoCmdId;
+    Qt::Orientation mOrientation;
+    
+    // from view manager
+    HbMainWindow* mMainWindow;
+    BtCpUiBaseView* mMainView;
+    BtCpUiBaseView* mDeviceView;
+    BtCpUiBaseView* mSearchView;
+    BtCpUiBaseView* mCurrentView;
+    int mCurrentViewId;
+    HbAction *mBackAction;
+    QList<int> mPreviousViewIds;
+    
+    //poiter to abstract delegate, and it is instantiated at runtime
+    BtAbstractDelegate* mAbstractDelegate;
+    
+};
+#endif // BTCPUIMAINVIEW_H 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/btcpuisearchview.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,215 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+
+#include "btcpuisearchview.h"
+#include <QtGui/QGraphicsLinearLayout>
+#include <HbInstance>
+#include <hbdocumentloader.h>
+#include <hbdataform.h>
+#include <hbpushbutton.h>
+#include <hblabel.h>
+#include <hblistview.h>
+#include <hbmenu.h>
+#include <qstringlist>
+#include <qdebug>
+#include <bluetoothuitrace.h>
+#include "btcpuimainview.h"
+
+
+
+// docml to load
+const char* BTUI_SEARCHVIEW_DOCML = ":/docml/bt-search-view.docml";
+
+BtCpUiSearchView::BtCpUiSearchView(BtuiModel &model, QGraphicsItem *parent) :
+    BtCpUiBaseView(model,parent)
+/*{
+    mSoftKeyBackAction = new HbAction(Hb::BackNaviAction, this);
+    BTUI_ASSERT_X(mSoftKeyBackAction, "BtCpUiBaseView::BtCpUiBaseView", "can't create back action");
+
+    QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout( Qt::Vertical, this );
+    // create button
+    HbPushButton *button = new HbPushButton(this);
+    button->setText("Press Me");
+    button->setMaximumSize(150,50);
+    mainLayout->addItem(button);  
+
+//    (void) connect(button, SIGNAL(clicked()), this, SLOT(changePowerState()));  
+    
+    setLayout(mainLayout);
+    
+    // create dummy options menu
+    HbMenu *optionsMenu = new HbMenu();
+    HbAction *openGadgetGallery = optionsMenu->addAction("Open Device Gallery");
+//    connect(openGadgetGallery, SIGNAL(triggered()), this, SLOT(openGadgetGalleryView()));
+    HbAction *openNewMainView = optionsMenu->addAction("Open new Main View");   
+//    connect(openNewMainView, SIGNAL(triggered()), this, SLOT(openNewMainView()));   
+    setMenu(optionsMenu);
+
+}*/
+    
+{
+    //bool ret(false);
+    
+    mSearchView = this;
+    mMainView = (BtCpUiMainView *) parent;
+    
+    mMainWindow = hbInstance->allMainWindows().first();
+    
+    mSoftKeyBackAction = new HbAction(Hb::BackNaviAction, this);
+    BTUI_ASSERT_X(mSoftKeyBackAction, "BtCpUiBaseView::BtCpUiBaseView", "can't create back action");
+    
+
+    // read view info from docml file
+
+
+    // Create view for the application.
+    // Set the name for the view. The name should be same as the view's
+    // name in docml.
+    setObjectName("bt_search_view");
+
+    QObjectList objectList;
+    objectList.append(this);
+    // Pass the view to documentloader. Document loader uses this view
+    // when docml is parsed, instead of creating new view.
+    mLoader = new HbDocumentLoader();
+    mLoader->setObjectTree(objectList);
+
+    bool ok = false;
+    mLoader->load( BTUI_SEARCHVIEW_DOCML, &ok );
+    // Exit if the file format is invalid
+    BTUI_ASSERT_X( ok, "bt-search-view", "Invalid docml file" );
+    
+    // Set title for the control panel
+    // ToDo:  check if deprecated API
+    setTitle("Control Panel");
+
+    // assign automatically created widgets to local variables
+
+    mDeviceIcon=0;
+    // can't use qobject_cast since HbIcon is not derived from QObject!
+    mDeviceIcon = qobject_cast<HbLabel *>( mLoader->findWidget( "icon" ) );  
+    BTUI_ASSERT_X( mDeviceIcon != 0, "bt-search-view", "Device Icon not found" );
+    
+    mDeviceName=0;
+    mDeviceName = qobject_cast<HbLabel *>( mLoader->findWidget( "label_found_devices" ) );
+    BTUI_ASSERT_X( mDeviceName != 0, "bt-search-view", "Device Name not found" );
+        
+    mDeviceList=0;
+    mDeviceList = qobject_cast<HbListView *>( mLoader->findWidget( "deviceList" ) );
+    BTUI_ASSERT_X( mDeviceList != 0, "bt-search-view", "Device List not found" );   
+    
+    
+//    // set model to list view
+//    mDeviceList->setModel( mFilterProxy );
+//    // define settings for list view
+//    mDeviceList->setSelectionMode(HbAbstractItemView::SingleSelection);
+//    // set prototype item for list view
+//    BtUiDevListGridItem *item = new BtUiDevListGridItem( mDeviceList ); 
+//    mDeviceList->setItemPrototype(item);
+//    // connect to list view pressed signal
+//    ret = connect( mDeviceList, SIGNAL(pressed(QModelIndex)),this, SLOT(itemActivated(QModelIndex)) );
+//    BTUI_ASSERT_X( ret, "bt-search-view", "device list can't connect" ); 
+    
+    // read landscape orientation section from docml file if needed
+//    mOrientation = ((BTUIViewManager*)parent)->orientation();
+    mOrientation = Qt::Vertical;
+    if (mOrientation == Qt::Horizontal) {
+        mLoader->load(BTUI_SEARCHVIEW_DOCML, "landscape", &ok);
+        BTUI_ASSERT_X( ok, "bt-search-view", "Invalid docml file: landscape section problem" );
+    }
+
+    
+    // load tool bar actions
+    HbAction *viewByAction = static_cast<HbAction*>( mLoader->findObject( "viewByAction" ) );
+    BTUI_ASSERT_X( viewByAction, "bt-search-view", "view by action missing" ); 
+//    ret = connect(viewByAction, SIGNAL(triggered()), this, SLOT(noOp()));
+//    BTUI_ASSERT_X( ret, "bt-search-view", "viewByAction can't connect" ); 
+
+    HbAction *stopAction = static_cast<HbAction*>( mLoader->findObject( "stopAction" ) );
+    BTUI_ASSERT_X( stopAction, "bt-search-view", "view by action missing" ); 
+//    ret = connect(stopAction, SIGNAL(triggered()), this, SLOT(noOp()));
+//    BTUI_ASSERT_X( ret, "bt-search-view", "stopAction can't connect" ); 
+
+    HbAction *retryAction = static_cast<HbAction*>( mLoader->findObject( "retryAction" ) );
+    BTUI_ASSERT_X( retryAction, "bt-search-view", "view by action missing" ); 
+//    ret = connect(retryAction, SIGNAL(triggered()), this, SLOT(noOp()));
+//    BTUI_ASSERT_X( ret, "bt-search-view", "retryAction can't connect" ); 
+
+    
+    // load menu
+    HbMenu *optionsMenu = qobject_cast<HbMenu *>(mLoader->findWidget("viewMenu"));
+    BTUI_ASSERT_X( optionsMenu != 0, "bt-search-view", "Options menu not found" );   
+    this->setMenu(optionsMenu);
+        
+    
+    // update display when setting data changed
+//    ret = connect(mModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), 
+//            this, SLOT(updateSettingItems(QModelIndex,QModelIndex)));
+//    BTUI_ASSERT_X( ret, "BtCpUiSearchView::BtCpUiSearchView", "can't connect dataChanged" );
+    
+//    QModelIndex top = mModel->index( Btuim::LocalDeviceName, KDefaultColumn );
+//    QModelIndex bottom = mModel->index( Btuim::Visibility, KDefaultColumn );
+//    // update name, power and visibility rows
+//    updateSettingItems( top, bottom );
+
+ 
+}
+
+BtCpUiSearchView::~BtCpUiSearchView()
+{
+    setNavigationAction(0);
+    delete mSoftKeyBackAction;
+}
+
+void BtCpUiSearchView::deviceSelected(const QModelIndex& modelIndex)
+{
+    int row = modelIndex.row();
+}
+
+void BtCpUiSearchView::setSoftkeyBack()
+{
+    if (navigationAction() != mSoftKeyBackAction) {
+        setNavigationAction(mSoftKeyBackAction);
+        connect( mSoftKeyBackAction, SIGNAL(triggered()), this, SLOT(switchToPreviousView()) );
+    }
+}
+
+void BtCpUiSearchView::switchToPreviousView()
+{
+    BTUI_ASSERT_X(mMainView, "BtCpUiSearchView::switchToPreviousView", "invalid mMainView");
+    // jump to previous view of current view.
+    mSearchView->deactivateView();
+    
+    // set the new current view 
+    mMainWindow->setCurrentView( mMainView );
+
+    // do preparation or some actions when new view is activated 
+    mMainView->activateView( 0, 0 );
+
+}
+
+void BtCpUiSearchView::activateView( const QVariant& value, int cmdId )
+{
+    Q_UNUSED(value);
+    Q_UNUSED(cmdId);  
+    
+    setSoftkeyBack();
+}
+
+void BtCpUiSearchView::deactivateView()
+{
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/btcpuisearchview.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+
+#ifndef	BTCPUISEARCHVIEW_H
+#define	BTCPUISEARCHVIEW_H
+
+#include <cpbasesettingview.h>
+#include <hbaction.h>
+#include <hbtoolbar.h>
+#include "btcpuibaseview.h"
+
+class HbLabel;
+class HbPushButton;
+class HbIcon;
+class HbDocumentLoader;
+class HbListView;
+class HbDataFormModel;
+class HbDataFormModelItem;
+class CpSettingFormItemData;
+
+
+class BtCpUiSearchView : public BtCpUiBaseView
+{
+    Q_OBJECT
+    
+public:
+    explicit BtCpUiSearchView(BtuiModel &model, QGraphicsItem *parent = 0);
+    virtual ~BtCpUiSearchView();
+    virtual void activateView( const QVariant& value, int cmdId );
+    virtual void deactivateView();
+    virtual void setSoftkeyBack();
+    
+public slots:
+    void deviceSelected(const QModelIndex& modelIndex);
+    virtual void switchToPreviousView();
+
+private:
+    HbDocumentLoader *mLoader;
+    HbLabel *mDeviceIcon;
+    HbLabel *mDeviceName;
+    HbListView *mDeviceList;
+    
+    // data structures for switching between views
+    bool mEventFilterInstalled;
+    int mAutoCmdId;
+    Qt::Orientation mOrientation;
+    
+    HbMainWindow* mMainWindow;
+    BtCpUiBaseView* mMainView;
+    BtCpUiBaseView* mSearchView;
+    HbAction *mSoftKeyBackAction;
+//    CpCustomLabelViewItem*      mLabelItem;
+//    CpCustomListViewItem*       mListItem;
+    HbToolBar*                  mToolBar;
+    HbAction*                   mViewBy;
+    HbAction*                   mStop;
+    HbAction*                   mRetry;
+    HbDataFormModel*            mModel;    
+};
+
+#endif//	BTCPUISEARCHVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/btcpuisettingitem.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *   
+ */
+
+#include "btcpuisettingitem.h"
+#include <cpitemdatahelper.h>
+
+#include <HbInstance>
+
+BtCpUiSettingItem::BtCpUiSettingItem(CpItemDataHelper &itemDataHelper,
+													   const QString &text /*= QString()*/,
+													   const QString &description /*= QString()*/,
+													   const HbIcon &icon /*= HbIcon()*/,
+													   const HbDataFormModelItem *parent /*= 0*/)
+													   : CpSettingFormEntryItemData(itemDataHelper,
+													   text,
+													   description,
+													   icon,
+													   parent)
+{
+}
+
+BtCpUiSettingItem::~BtCpUiSettingItem()
+{
+
+}
+
+void BtCpUiSettingItem::onLaunchView()
+{
+    mModel = new BtuiModel();
+    
+    mMainWindow = hbInstance->allMainWindows().first();
+    
+    mBtMainView = new BtCpUiMainView(*mModel);
+    
+    mCpView = mMainWindow->currentView();
+    
+    mMainWindow->addView(mBtMainView);
+    mMainWindow->setCurrentView(mBtMainView);
+    
+    connect(mBtMainView, SIGNAL(aboutToClose()), this, SLOT(handleCloseView()));
+    
+}
+
+void BtCpUiSettingItem::handleCloseView()
+{
+    mBtMainView->deactivateView();
+    mMainWindow->setCurrentView(mCpView);
+    delete mBtMainView;
+    delete mModel;
+}
+
+
+CpBaseSettingView *BtCpUiSettingItem::createSettingView() const
+{
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/btcpuisettingitem.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *   
+ */
+
+#ifndef BTCPUISETTINGITEM_H
+#define BTCPUISETTINGITEM_H
+
+#include <cpsettingformentryitemdata.h>
+#include <btuimodel.h>
+
+#include "btcpuimainview.h"
+
+class BtCpUiSettingItem : public CpSettingFormEntryItemData
+{
+	Q_OBJECT
+public:
+	explicit BtCpUiSettingItem(CpItemDataHelper &itemDataHelper,
+		const QString &text = QString(),
+		const QString &description = QString(),
+		const HbIcon &icon = HbIcon(),
+		const HbDataFormModelItem *parent = 0);	 
+	virtual ~BtCpUiSettingItem();
+private slots:
+	void onLaunchView();
+	void handleCloseView();
+private:
+	virtual CpBaseSettingView *createSettingView() const;
+	
+private:
+	HbMainWindow* mMainWindow;
+	
+	BtCpUiMainView *mBtMainView;
+	
+	//Owns this model.
+	BtuiModel *mModel;
+	
+	HbView *mCpView;
+	
+};
+
+#endif //BTCPUISETTINGITEM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/docml/bt-main-view.docml	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.0">
+    <object name="allAction" type="HbAction">
+        <string name="text" value="All"/>
+    </object>
+    <object name="pairedAction" type="HbAction">
+        <string name="text" value="Paired"/>
+    </object>
+    <object name="discoverAction" type="HbAction">
+        <string name="text" value="Discover"/>
+    </object>
+    <object name="advanceSettings" type="HbAction">
+        <string name="text" value="Advanced Settings"/>
+    </object>
+    <object name="audioDevices" type="HbAction">
+        <string name="text" value="Audio Devices"/>
+    </object>
+    <object name="computers" type="HbAction">
+        <string name="text" value="Computers"/>
+    </object>
+    <object name="inputDevices" type="HbAction">
+        <string name="text" value="Input Devices"/>
+    </object>
+    <object name="otherDevices" type="HbAction">
+        <string name="text" value="Other Devices"/>
+    </object>
+    <object name="removePairedDevices" type="HbAction">
+        <string name="text" value="Remove Paired Devices"/>
+    </object>
+    <object name="exit" type="HbAction">
+        <string name="text" value="Exit"/>
+    </object>
+    <object name="phones" type="HbAction">
+        <string name="text" value="Phones"/>
+    </object>
+    <widget name="view" type="HbView">
+        <widget name="content" role="HbView:widget" type="HbWidget">
+            <widget name="gridView" type="HbGridView">
+                <widget name="gridItemPrototype" role="HbAbstractView:prototype" type="HbGridViewItem"/>
+                <integer name="columnCount" value="1"/>
+                <sizehint height="47.7612un" type="PREFERRED" width="47.7612un"/>
+            </widget>
+            <widget name="toolBar" type="HbToolBar">
+                <sizehint height="7.46269un" type="PREFERRED" width="22.38806un"/>
+                <ref object="allAction" role="HbToolBar:addAction"/>
+                <ref object="pairedAction" role="HbToolBar:addAction"/>
+                <ref object="discoverAction" role="HbToolBar:addAction"/>
+            </widget>
+            <widget name="container_1" type="HbWidget">
+                <widget name="groupBox" type="HbGroupBox">
+                    <bool name="collapsable" value="FALSE"/>
+                    <string name="heading" value="Bluetooth"/>
+                </widget>
+                <widget name="container" type="HbWidget">
+                    <widget name="icon" type="HbLabel">
+                        <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                        <icon iconName="qtg_large_mobile" name="icon"/>
+                        <real name="z" value="1"/>
+                        <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+                        <sizehint height="var(hb-param-graphic-size-primary-large)" type="PREFERRED" width="var(hb-param-graphic-size-primary-large)"/>
+                        <enums name="elideMode" value="ElideNone"/>
+                    </widget>
+                    <widget name="pushButton" type="HbPushButton">
+                        <real name="z" value="2"/>
+                        <sizehint height="var(hb-param-graphic-size-primary-large)" type="PREFERRED" width="var(hb-param-graphic-size-primary-large)"/>
+                        <sizehint height="var(hb-param-graphic-size-primary-large)" type="MAXIMUM" width="var(hb-param-graphic-size-primary-large)"/>
+                        <string name="text" value="On"/>
+                    </widget>
+                    <widget name="combobox" type="HbComboBox">
+                        <container name="items" type="stringlist">
+                            <string value="Hidden"/>
+                            <string value="Visible"/>
+                            <string value="Visible for 5 Min"/>
+                        </container>
+                        <real name="z" value="4"/>
+                        <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+                        <sizehint height="var(hb-param-graphic-size-primary-large)" type="PREFERRED" width="36un"/>
+                    </widget>
+                    <widget name="lineEdit" type="HbLineEdit">
+                        <real name="z" value="3"/>
+                        <integer name="maxLength" value="30"/>
+                        <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+                        <sizehint height="var(hb-param-graphic-size-primary-large)" type="PREFERRED" width="34un"/>
+                        <string name="text" value="Text"/>
+                    </widget>
+                    <real name="z" value="0"/>
+                    <sizehint height="23.8806un" type="PREFERRED" width="23.8806un"/>
+                    <layout type="anchor">
+                        <anchoritem dst="icon" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="" srcEdge="LEFT"/>
+                        <anchoritem dst="icon" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
+                        <anchoritem dst="lineEdit" dstEdge="LEFT" spacing="2un" src="icon" srcEdge="RIGHT"/>
+                        <anchoritem dst="lineEdit" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
+                        <anchoritem dst="lineEdit" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+                        <anchoritem dst="combobox" dstEdge="LEFT" spacing="2un" src="pushButton" srcEdge="RIGHT"/>
+                        <anchoritem dst="combobox" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="lineEdit" srcEdge="BOTTOM"/>
+                        <anchoritem dst="combobox" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+                        <anchoritem dst="combobox" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+                        <anchoritem dst="pushButton" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="" srcEdge="LEFT"/>
+                        <anchoritem dst="pushButton" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="icon" srcEdge="BOTTOM"/>
+                        <anchoritem dst="pushButton" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+                    </layout>
+                </widget>
+                <real name="z" value="0"/>
+                <sizehint height="23.8806un" type="PREFERRED" width="11.9403un"/>
+                <layout orientation="Vertical" spacing="0un" type="linear">
+                    <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                    <linearitem itemname="groupBox"/>
+                    <linearitem itemname="container"/>
+                </layout>
+            </widget>
+            <layout orientation="Vertical" type="linear">
+                <linearitem itemname="container_1"/>
+                <linearitem itemname="gridView"/>
+                <linearitem itemname="toolBar"/>
+            </layout>
+        </widget>
+        <widget name="viewMenu" role="HbView:menu" type="HbMenu">
+            <widget name="subMenu" role="HbMenu:menu" type="HbMenu">
+                <ref object="audioDevices" role="HbMenu:addAction"/>
+                <ref object="computers" role="HbMenu:addAction"/>
+                <ref object="phones" role="HbMenu:addAction"/>
+                <ref object="inputDevices" role="HbMenu:addAction"/>
+                <ref object="otherDevices" role="HbMenu:addAction"/>
+                <string name="title" value="Show Only"/>
+            </widget>
+            <ref object="advanceSettings" role="HbMenu:addAction"/>
+            <ref object="removePairedDevices" role="HbMenu:addAction"/>
+            <ref object="exit" role="HbMenu:addAction"/>
+        </widget>
+        <string name="title" value="Control Panel"/>
+    </widget>
+    <section name="portrait">
+        <widget name="lineEdit" type="HbLineEdit">
+            <sizehint type="PREFERRED" width="29.25373un"/>
+        </widget>
+        <widget name="combobox" type="HbComboBox">
+            <sizehint height="var(hb-param-graphic-size-primary-large)" type="PREFERRED" width="31.34328un"/>
+        </widget>
+        <widget name="container" type="HbWidget">
+            <layout type="anchor">
+                <anchoritem dst="icon" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="" srcEdge="LEFT"/>
+                <anchoritem dst="icon" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
+                <anchoritem dst="lineEdit" dstEdge="LEFT" spacing="2un" src="icon" srcEdge="RIGHT"/>
+                <anchoritem dst="lineEdit" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
+                <anchoritem dst="lineEdit" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="combobox" dstEdge="LEFT" spacing="2un" src="pushButton" srcEdge="RIGHT"/>
+                <anchoritem dst="combobox" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="lineEdit" srcEdge="BOTTOM"/>
+                <anchoritem dst="combobox" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="combobox" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+                <anchoritem dst="pushButton" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="" srcEdge="LEFT"/>
+                <anchoritem dst="pushButton" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="icon" srcEdge="BOTTOM"/>
+                <anchoritem dst="pushButton" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+            </layout>
+        </widget>
+        <widget name="icon" type="HbLabel">
+            <sizehint height="var(hb-param-graphic-size-primary-large)" type="PREFERRED" width="var(hb-param-graphic-size-primary-large)"/>
+            <sizehint height="var(hb-param-graphic-size-primary-large)" type="MAXIMUM" width="var(hb-param-graphic-size-primary-large)"/>
+        </widget>
+        <widget name="content" role="HbView:widget" type="HbWidget">
+            <layout orientation="Vertical" spacing="var(hb-param-margin-gene-middle-vertical)" type="linear">
+                <linearitem itemname="groupBox"/>
+                <linearitem itemname="container"/>
+                <linearitem itemname="gridView"/>
+                <linearitem itemname="toolBar"/>
+            </layout>
+        </widget>
+        <widget name="pushButton" type="HbPushButton">
+            <sizehint height="var(hb-param-graphic-size-primary-large)" type="PREFERRED" width="var(hb-param-graphic-size-primary-large)"/>
+            <sizehint height="var(hb-param-graphic-size-primary-large)" type="MAXIMUM" width="var(hb-param-graphic-size-primary-large)"/>
+        </widget>
+    </section>
+    <section name="landscape">
+        <widget name="lineEdit" type="HbLineEdit">
+            <sizehint height="var(hb-param-graphic-size-primary-large)" type="PREFERRED" width="33un"/>
+        </widget>
+        <widget name="gridView" type="HbGridView">
+            <enums name="horizontalScrollBarPolicy" value="ScrollBarAlwaysOff"/>
+            <enums name="scrollDirections" value="Horizontal"/>
+            <integer name="columnCount" value="5"/>
+            <integer name="rowCount" value="1"/>
+        </widget>
+        <widget name="combobox" type="HbComboBox">
+            <sizehint height="var(hb-param-graphic-size-primary-large)" type="PREFERRED" width="34.92537un"/>
+        </widget>
+        <widget name="container" type="HbWidget">
+            <layout type="anchor">
+                <anchoritem dst="icon" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="" srcEdge="LEFT"/>
+                <anchoritem dst="icon" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
+                <anchoritem dst="lineEdit" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
+                <anchoritem dst="lineEdit" dstEdge="LEFT" spacing="1.97885un" src="icon" srcEdge="RIGHT"/>
+                <anchoritem dst="combobox" dstEdge="LEFT" spacing="expr(var(hb-param-margin-gene-middle-horizontal) )" src="pushButton" srcEdge="RIGHT"/>
+                <anchoritem dst="combobox" dstEdge="TOP" spacing="expr(var(hb-param-margin-gene-top) )" src="" srcEdge="TOP"/>
+                <anchoritem dst="combobox" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="pushButton" dstEdge="LEFT" spacing="2un" src="lineEdit" srcEdge="RIGHT"/>
+                <anchoritem dst="pushButton" dstEdge="TOP" spacing="expr(var(hb-param-margin-gene-top) )" src="" srcEdge="TOP"/>
+            </layout>
+        </widget>
+        <widget name="icon" type="HbLabel">
+            <sizehint height="var(hb-param-graphic-size-primary-large)" type="PREFERRED" width="var(hb-param-graphic-size-primary-large)"/>
+        </widget>
+    </section>
+    <metadata activeUIState="landscape" display="NHD landscape" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+        <uistate name="portrait" sections="#common"/>
+        <uistate name="portrait_UI" sections="#common portrait"/>
+        <uistate name="landscape" sections="#common landscape"/>
+        <dummydata objectName="gridView" section="#common" value="app_grid_template2"/>
+    </metadata>
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/docml/bt-search-view.docml	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.9">
+    <object name="viewByAction" type="HbAction">
+        <string name="text" value="View by"/>
+        <bool name="visible" value="TRUE"/>
+    </object>
+    <object name="stopAction" type="HbAction">
+        <string name="text" value="Stop"/>
+    </object>
+    <object name="retryAction" type="HbAction">
+        <string name="text" value="Retry"/>
+    </object>
+    <object name="exitAction" type="HbAction">
+        <string name="text" value="Exit"/>
+    </object>
+    <object name="connectAction" type="HbAction">
+        <string name="text" value="Connect"/>
+    </object>
+    <object name="disconnectAction" type="HbAction">
+        <string name="text" value="Disconnect"/>
+    </object>
+    <widget name="bt_search_view" type="HbView">
+        <widget name="search_view_content" role="HbView:widget" type="HbWidget">
+    	<widget name="search_container" type="HbWidget">
+                <widget name="label_found_devices" type="HbLabel">
+                    <real name="z" value="3"/>
+                    <sizehint height="var(hb-param-graphic-size-primary-large)" type="PREFERRED" width="38.20896un"/>
+                    <bool name="visible" value="TRUE"/>
+                    <string name="plainText" value="Bluetooth - Found devices"/>
+                </widget>
+                <widget name="icon" type="HbLabel">
+                    <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                    <icon iconName="note_warning" name="icon"/>
+                    <real name="z" value="2"/>
+                    <sizehint height="var(hb-param-graphic-size-primary-large)" type="PREFERRED" width="var(hb-param-graphic-size-primary-large)"/>
+                    <bool name="visible" value="TRUE"/>
+                    <sizehint height="var(hb-param-graphic-size-primary-large)" type="MAXIMUM" width="var(hb-param-graphic-size-primary-large)"/>
+                </widget>
+                <widget name="label_searching" type="HbLabel">
+                    <real name="z" value="3"/>
+                    <sizehint height="var(hb-param-graphic-size-primary-large)" type="PREFERRED" width="38.20896un"/>
+                    <bool name="visible" value="TRUE"/>
+                    <string name="plainText" value="Searching..."/>
+                </widget>
+                <real name="z" value="0"/>
+                <sizehint height="21un" type="PREFERRED" width="51.19403un"/>
+                <bool name="visible" value="TRUE"/>
+                <layout type="anchor">
+                    <anchoritem dst="label_found_devices" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
+                    <anchoritem dst="label_found_devices" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="" srcEdge="LEFT"/>
+                    <anchoritem dst="label_found_devices" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+                    <anchoritem dst="icon" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="label_found_devices" srcEdge="BOTTOM"/>
+                    <anchoritem dst="icon" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="" srcEdge="LEFT"/>
+                    <anchoritem dst="icon" dstEdge="BOTTOM" spacing="-var(hb-param-margin-gene-bottom)" src="" srcEdge="BOTTOM"/>
+                    <anchoritem dst="label_searching" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="label_found_devices" srcEdge="BOTTOM"/>
+                    <anchoritem dst="label_searching" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="icon" srcEdge="RIGHT"/>
+                    <anchoritem dst="label_searching" dstEdge="BOTTOM" spacing="-var(hb-param-margin-gene-bottom)" src="" srcEdge="BOTTOM"/>
+                    <anchoritem dst="label_searching" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+                 </layout>
+            </widget>
+            <widget name="toolBar" type="HbToolBar">
+                <real name="z" value="2"/>
+                <sizehint height="7.46269un" type="PREFERRED" width="52.98508un"/>
+                <bool name="visible" value="TRUE"/>
+                <ref object="viewByAction" role="HbToolBar:addAction"/>
+                <ref object="stopAction" role="HbToolBar:addAction"/>
+                <ref object="retryAction" role="HbToolBar:addAction"/>
+            </widget>
+            <widget name="deviceList" type="HbListWidget"/>
+            <real name="z" value="0"/>
+            <layout orientation="Vertical" type="linear">
+                <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                <linearitem itemname="search_container"/>
+                <linearitem itemname="deviceList"/>
+                <linearitem itemname="toolBar"/>
+            </layout>
+        </widget>
+        <widget name="viewMenu" role="HbView:menu" type="HbMenu">
+            <ref object="exitAction" role="HbMenu:addAction"/>
+            <ref object="connectAction" role="HbMenu:addAction"/>
+        </widget>
+        <string name="title" value="Control Panel"/>
+        <real name="z" value="1"/>
+    </widget>
+    <section name="landscape">
+    	<widget name="search_container" type="HbWidget">
+    			<sizehint height="10un" type="PREFERRED" width="51.19403un"/>
+    			<layout type="anchor">
+                    <anchoritem dst="label_found_devices" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
+                    <anchoritem dst="label_found_devices" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="" srcEdge="LEFT"/>
+                    <anchoritem dst="label_found_devices" dstEdge="BOTTOM" spacing="-var(hb-param-margin-gene-bottom)" src="" srcEdge="BOTTOM"/>
+                    <anchoritem dst="icon" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
+                    <anchoritem dst="icon" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="label_found_devices" srcEdge="RIGHT"/>
+                    <anchoritem dst="icon" dstEdge="BOTTOM" spacing="-var(hb-param-margin-gene-bottom)" src="" srcEdge="BOTTOM"/>
+                    <anchoritem dst="label_searching" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
+                    <anchoritem dst="label_searching" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="icon" srcEdge="RIGHT"/>
+                    <anchoritem dst="label_searching" dstEdge="BOTTOM" spacing="-var(hb-param-margin-gene-bottom)" src="" srcEdge="BOTTOM"/>
+                    <anchoritem dst="label_searching" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+                </layout>
+         </widget>
+    </section>    
+    <metadata activeUIState="portrait_ui" display="NHD portrait" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+        <uistate name="landscape_ui" sections="#common landscape"/>
+        <uistate name="portrait_ui" sections="#common"/>
+    </metadata>
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/icons/qgn_frwidget_add_friend_photo.svg	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14948)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 width="54px" height="54px" viewBox="0 0 54 54" enable-background="new 0 0 54 54" xml:space="preserve">
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="18.2432" y1="-6516.127" x2="18.2432" y2="-6462.127" gradientTransform="matrix(1 0 0 -1 8.2573 -6462.627)">
+	<stop  offset="0" style="stop-color:#171511"/>
+	<stop  offset="0.51" style="stop-color:#2F3838"/>
+	<stop  offset="0.51" style="stop-color:#3A4547"/>
+	<stop  offset="1" style="stop-color:#5C6869"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M53.5,47.072c0,3.535-2.893,6.428-6.429,6.428H5.929c-3.535,0-6.429-2.893-6.429-6.428V5.929
+	C-0.5,2.392,2.394-0.5,5.929-0.5h41.143c3.536,0,6.429,2.892,6.429,6.429V47.072z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="8.8711" y1="1490.1309" x2="15.9404" y2="1524.4484" gradientTransform="matrix(1 0 0 1 8.2573 -1479.3516)">
+	<stop  offset="0" style="stop-color:#CCCFD3"/>
+	<stop  offset="0.8146" style="stop-color:#7F848B"/>
+	<stop  offset="1" style="stop-color:#5A5D60"/>
+</linearGradient>
+<path fill="url(#SVGID_2_)" d="M22.764,24.915c-6.442,0-11.667,5.228-11.667,11.666v4.138c0,5.25,23.334,5.25,23.334,0V36.58
+	C34.432,30.145,29.207,24.915,22.764,24.915z M22.39,24.097c4.076-0.196,7.325-3.443,7.523-7.517
+	c-0.202-3.794-3.308-6.814-7.143-6.812c-3.963,0.007-7.18,3.216-7.18,7.18C15.59,20.788,18.608,23.897,22.39,24.097z"/>
+<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="14.4937" y1="1489.9238" x2="14.4937" y2="1498.3613" gradientTransform="matrix(1 0 0 1 8.2573 -1479.3516)">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="0.1629" style="stop-color:#FFFFFF"/>
+	<stop  offset="0.4554" style="stop-color:#FAFAFA"/>
+	<stop  offset="0.8002" style="stop-color:#ECECEC"/>
+	<stop  offset="1" style="stop-color:#E0E0E0"/>
+</linearGradient>
+<path fill="url(#SVGID_3_)" fill-opacity="0.5" d="M22.772,10.573L22.772,10.573c-3.517,0.007-6.378,2.867-6.378,6.376
+	c0,1.535,2.63,1.861,5.999,2.062c3.644-0.197,6.714-1.222,6.714-2.425C28.904,13.207,26.131,10.57,22.772,10.573z"/>
+<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="24.2915" y1="9332.8164" x2="38.4707" y2="9332.8164" gradientTransform="matrix(1 0 0 1 8.2573 -9317.2422)">
+	<stop  offset="0" style="stop-color:#B2B2B2"/>
+	<stop  offset="0.5" style="stop-color:#B0B0B0"/>
+	<stop  offset="1" style="stop-color:#797878"/>
+</linearGradient>
+<path fill="url(#SVGID_4_)" d="M37.842,8.488c-0.24,0-0.436,0.195-0.436,0.434v4.395h-4.42c-0.279,0-0.438,0.23-0.438,0.435v3.615
+	c0,0.24,0.195,0.436,0.438,0.436h4.42v4.42c0,0.241,0.195,0.437,0.437,0.437h3.616c0.241,0,0.438-0.195,0.438-0.437v-4.42h4.396
+	c0.24,0,0.436-0.195,0.436-0.436V13.75c0-0.24-0.194-0.435-0.436-0.435h-4.396V8.921c0-0.243-0.192-0.434-0.438-0.434L37.842,8.488
+	L37.842,8.488z"/>
+<linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="26.6006" y1="-13502.2988" x2="32.5521" y2="-13513.8125" gradientTransform="matrix(1 0 0 -1 8.2573 -13495.9805)">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#D8D8D8"/>
+</linearGradient>
+<path fill="url(#SVGID_5_)" d="M46.283,17.366h-4.827v4.855h-3.614v-4.855h-4.857v-3.614h4.857V8.921h3.614v4.829h4.827V17.366
+	L46.283,17.366z"/>
+<linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="14.5039" y1="1506.3008" x2="14.5039" y2="1518.3916" gradientTransform="matrix(1 0 0 1 8.2573 -1479.3516)">
+	<stop  offset="0" style="stop-color:#E8E7E6"/>
+	<stop  offset="0.0056" style="stop-color:#E8E7E6"/>
+	<stop  offset="0.8933" style="stop-color:#9B9A9A"/>
+	<stop  offset="1" style="stop-color:#9B9A9A"/>
+</linearGradient>
+<path fill="url(#SVGID_6_)" fill-opacity="0.5" d="M22.402,29.436c-1.952-0.101-3.693-0.981-4.927-2.331
+	c-2.824,1.581-4.872,4.385-5.423,7.698c0,2.004,5.314,4.238,10.711,4.238c5.389,0,10.663-2.227,10.708-4.227
+	c-0.646-3.938-3.197-6.568-5.682-7.864C26.425,28.396,24.528,29.333,22.402,29.436z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/icons/qgn_graf_blid_det_circle.svg	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="150px" version="1.1" viewBox="0 0 200 150" width="200px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<path d="M188,75c0-36.117-39.477-65.5-88-65.5S12,38.883,12,75c0,0.167,0.007,0.333,0.009,0.5  C12.007,75.667,12,75.833,12,76c0,36.117,39.477,65.5,88,65.5s88-29.383,88-65.5c0-0.167-0.007-0.333-0.009-0.5  C187.993,75.333,188,75.167,188,75z" fill-opacity="0.2" stroke-opacity="0.2"/>
+<path d="M13,76c0,35.565,39.028,64.5,87,64.5s87-28.935,87-64.5s-39.028-64.5-87-64.5S13,40.435,13,76z" fill-opacity="0.5" stroke-opacity="0.5"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="100" x2="100" y1="-13.6875" y2="268.3076">
+<stop offset="0" style="stop-color:#FFFFFF"/>
+<stop offset="1" style="stop-color:#FCBA63"/>
+</linearGradient>
+<path d="M13,75c0,35.565,39.028,64.5,87,64.5s87-28.935,87-64.5s-39.028-64.5-87-64.5S13,39.435,13,75z" fill="url(#SVGID_1_)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="100" x2="100" y1="-63.6826" y2="110.3163">
+<stop offset="0" style="stop-color:#FFFFFF"/>
+<stop offset="1" style="stop-color:#FCBA63"/>
+</linearGradient>
+<ellipse cx="100" cy="75" fill="url(#SVGID_2_)" rx="67.5" ry="50.625"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_3_" x1="100" x2="100" y1="-31.0229" y2="184.9786">
+<stop offset="0" style="stop-color:#FFE23D"/>
+<stop offset="0.2239" style="stop-color:#FAD337"/>
+<stop offset="0.6537" style="stop-color:#EFAB26"/>
+<stop offset="1" style="stop-color:#E48717"/>
+</linearGradient>
+<ellipse cx="100" cy="75" fill="url(#SVGID_3_)" rx="45" ry="33.75"/>
+<ellipse cx="100" cy="75" fill="#E48717" rx="22.5" ry="16.875"/>
+<rect fill="none" height="150" width="200"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/icons/qgn_graf_blid_time.svg	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="32px" version="1.1" viewBox="0 0 32 32" width="32px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<path d="M26.311,11.072c0,0,0.286-0.339,0.592-0.702c0.474-0.562,0.661-1.684-0.205-2.409  c-0.373-0.313-2.18-1.827-2.18-1.827c-0.719-0.603-1.797-0.51-2.404,0.206c0,0-0.254,0.303-0.598,0.711  c-0.588-0.285-1.197-0.534-1.83-0.727c0.199-0.36,0.324-0.766,0.324-1.204V3.77c0-0.698-0.281-1.349-0.791-1.833  c-0.475-0.458-1.113-0.712-1.791-0.712h-2.869c-1.422,0-2.58,1.14-2.582,2.541l-0.006,1.343c0,0.432,0.123,0.849,0.328,1.221  c-0.631,0.192-1.234,0.442-1.82,0.726L9.873,6.332C9.871,6.33,8.709,5.726,8.709,5.726c0,0.001-1.246,0.394-1.246,0.394L5.289,7.943  C4.887,8.282,4.68,8.768,4.68,9.256c0,0.387,0.131,0.776,0.398,1.095l0.607,0.729c-1.508,2.091-2.408,4.65-2.408,7.42  c0,7.018,5.707,12.726,12.725,12.726c7.016,0,12.723-5.708,12.723-12.726C28.725,15.727,27.822,13.165,26.311,11.072z" fill-opacity="0.2" stroke-opacity="0.2"/>
+<path d="M25.037,11.031l1.1-1.305c0.257-0.305,0.215-0.747-0.086-1.001l-7.906-2.241  c0.51-0.256,0.865-0.768,0.865-1.363V3.77c0-0.42-6.031-0.854-6.033-0.003l-0.006,1.346c0,0.416,0.174,0.82,0.477,1.109  c0.115,0.11-7.516,2.488-7.516,2.488C5.633,8.961,5.594,9.409,5.844,9.708l1.113,1.331c-6.304,7.632-0.87,19.186,9.045,19.186  C25.957,30.225,31.339,18.647,25.037,11.031z" fill-opacity="0.5" stroke-opacity="0.5"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="15.9907" x2="15.9907" y1="3.6362" y2="7.4279">
+<stop offset="0" style="stop-color:#E3E3E3"/>
+<stop offset="1" style="stop-color:#404040"/>
+</linearGradient>
+<polygon fill="url(#SVGID_1_)" points="18.139,6.402 13.834,6.399 13.84,4.682 18.148,4.683 "/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="15.9897" x2="15.9897" y1="1.1694" y2="6.3812">
+<stop offset="0" style="stop-color:#E3E3E3"/>
+<stop offset="1" style="stop-color:#404040"/>
+</linearGradient>
+<path d="M14.559,1.225c-0.871,0-1.58,0.691-1.582,1.542l-0.006,1.346c0,0.416,0.174,0.82,0.477,1.109  c0.295,0.282,0.688,0.438,1.105,0.438h2.869c0.875,0,1.588-0.69,1.588-1.54V2.77c0-0.42-0.17-0.813-0.479-1.107  c-0.293-0.281-0.686-0.438-1.104-0.438H14.559z" fill="url(#SVGID_2_)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_3_" x1="23.377" x2="23.377" y1="5.6616" y2="12.5607">
+<stop offset="0" style="stop-color:#E3E3E3"/>
+<stop offset="1" style="stop-color:#404040"/>
+</linearGradient>
+<path d="M26.051,7.725L23.875,5.9c-0.299-0.251-0.744-0.213-0.998,0.086L20.449,8.87l3.262,2.736l2.426-2.88  c0.121-0.144,0.18-0.33,0.166-0.519C26.285,8.02,26.193,7.845,26.051,7.725z" fill="url(#SVGID_3_)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_4_" x1="8.6069" x2="8.6069" y1="5.6465" y2="12.5806">
+<stop offset="0" style="stop-color:#E3E3E3"/>
+<stop offset="1" style="stop-color:#404040"/>
+</linearGradient>
+<path d="M11.535,8.877l-2.43-2.903C8.984,5.83,8.813,5.739,8.625,5.723C8.438,5.706,8.25,5.764,8.105,5.886  L5.932,7.709C5.633,7.961,5.594,8.409,5.844,8.708l2.436,2.913L11.535,8.877z" fill="url(#SVGID_4_)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_5_" x1="16.0005" x2="16.0005" y1="5.4863" y2="33.038">
+<stop offset="0" style="stop-color:#E3E3E3"/>
+<stop offset="1" style="stop-color:#404040"/>
+</linearGradient>
+<path d="M27.725,17.499c0,6.477-5.248,11.726-11.723,11.726c-6.479,0-11.725-5.249-11.725-11.726  c0-6.476,5.246-11.722,11.725-11.722C22.477,5.777,27.725,11.023,27.725,17.499z" fill="url(#SVGID_5_)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_6_" x1="16.0005" x2="16.0005" y1="10.6353" y2="34.4321">
+<stop offset="0" style="stop-color:#FFFFFF"/>
+<stop offset="1" style="stop-color:#B2B2B2"/>
+</linearGradient>
+<circle cx="16.001" cy="17.499" fill="url(#SVGID_6_)" r="9.714"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_7_" x1="16.0005" x2="16.0005" y1="35.3066" y2="2.7685">
+<stop offset="0" style="stop-color:#E3E3E3"/>
+<stop offset="1" style="stop-color:#404040"/>
+</linearGradient>
+<path d="M5.951,17.499c0-5.552,4.5-10.048,10.051-10.048l0,0c5.549,0,10.045,4.497,10.045,10.048l0,0h0.002  c-0.002,5.551-4.498,10.049-10.047,10.05l0,0C10.451,27.548,5.951,23.05,5.951,17.499L5.951,17.499z M6.621,17.499  c0.008,5.181,4.199,9.37,9.381,9.379l0,0c5.18-0.009,9.367-4.198,9.377-9.379l0,0c-0.01-5.182-4.197-9.372-9.377-9.38l0,0  C10.82,8.127,6.629,12.317,6.621,17.499L6.621,17.499z" fill="url(#SVGID_7_)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_8_" x1="20.4492" x2="20.4492" y1="7.4663" y2="52.9759">
+<stop offset="0" style="stop-color:#EA2227"/>
+<stop offset="0.3116" style="stop-color:#D22024"/>
+<stop offset="0.9676" style="stop-color:#94191C"/>
+<stop offset="1" style="stop-color:#91191C"/>
+</linearGradient>
+<path d="M16.045,8.654c-0.016,0-0.029,0.001-0.043,0.002v8.845l5.869,6.652  c1.85-1.623,3.025-3.998,3.025-6.648C24.896,12.625,20.926,8.654,16.045,8.654z" fill="url(#SVGID_8_)"/>
+<linearGradient gradientTransform="matrix(1 -0.0026 0.0026 1 -2.9697 1.1626)" gradientUnits="userSpaceOnUse" id="SVGID_9_" x1="17.6729" x2="25.3105" y1="19.2891" y2="19.2891">
+<stop offset="0" style="stop-color:#404040"/>
+<stop offset="1" style="stop-color:#000000"/>
+</linearGradient>
+<path d="M22.4,23.839l-5.23-5.852c0.063-0.15,0.098-0.313,0.098-0.486c-0.002-0.695-0.568-1.259-1.264-1.257  c-0.699,0.001-1.26,0.567-1.258,1.264s0.566,1.259,1.264,1.257c0.129,0,0.252-0.025,0.373-0.063l5.227,5.845L22.4,23.839z" fill="url(#SVGID_9_)"/>
+<path d="M14.043,4.598c-0.135-0.129-0.209-0.302-0.209-0.482l0.006-1.348  c0.002-0.376,0.322-0.681,0.719-0.681h2.869c0.191,0,0.375,0.072,0.51,0.201l0.594-0.625c-0.293-0.281-0.686-0.438-1.104-0.438  h-2.869c-0.871,0-1.58,0.691-1.582,1.542l-0.006,1.346c0,0.416,0.174,0.82,0.477,1.109L14.043,4.598z" fill="#FFFFFF" fill-opacity="0.2" stroke-opacity="0.2"/>
+<path d="M18.531,1.663l-0.594,0.625c0.135,0.128,0.211,0.3,0.211,0.481v1.349c-0.002,0.374-0.328,0.679-0.727,0.679  h-2.869c-0.191,0-0.375-0.071-0.51-0.2l-0.596,0.624c0.295,0.282,0.688,0.438,1.105,0.438h2.869c0.875,0,1.588-0.69,1.588-1.54V2.77  C19.01,2.35,18.84,1.956,18.531,1.663z" fill-opacity="0.2" stroke-opacity="0.2"/>
+<path d="M12.288,9.465c-4.629,2.147-6.305,7.529-4.286,11.802l16.027-7.473  C21.954,9.318,16.695,7.421,12.288,9.465z" fill="#FFFFFF" fill-opacity="0.2" stroke-opacity="0.2"/>
+<rect fill="none" height="32" width="32"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/icons/qgn_indi_bt_blocked.svg	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="13" height="13" viewBox="-0.014 -0.048 13 13">
+<rect fill="none" height="13" width="13" x="-0.014" y="-0.048"/>
+<path d="M6.5,2.044c-2.462,0-4.457,1.996-4.457,4.455c0,2.46,1.995,4.457,4.457,4.457c2.46,0,4.457-1.995,4.457-4.457 C10.955,4.04,8.96,2.044,6.5,2.044z M3.222,7.575V5.426h6.555v2.149H3.222z"/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/icons/qgn_indi_bt_paired_add.svg	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg width="13" height="13" viewBox="0 0 13 13">
+<path d="M7.313,3.31L4.796,0.792V3.67L3.717,2.59L3.223,3.085c0,0,1.117,1.117,1.574,1.573v0.18 C4.34,5.293,3.223,6.412,3.223,6.412l0.495,0.495l1.079-1.079v2.878l2.517-2.518c0,0-1.094-1.094-1.438-1.438 C6.219,4.404,7.313,3.31,7.313,3.31z M6.325,6.187C6.147,6.365,5.821,6.69,5.516,6.997V5.378 C5.822,5.685,6.159,6.021,6.325,6.187z M5.516,4.119V2.5c0.306,0.306,0.631,0.632,0.809,0.81 C6.159,3.476,5.822,3.813,5.516,4.119z"/>
+<path d="M12.823,6.973l-2.517-2.518v2.877l-1.079-1.08L8.732,6.749c0,0,1.117,1.117,1.574,1.573v0.18 c-0.457,0.456-1.574,1.573-1.574,1.573l0.495,0.494l1.079-1.079v2.877l2.517-2.518c0,0-1.094-1.094-1.438-1.438 C11.729,8.067,12.823,6.973,12.823,6.973z M11.834,6.973c-0.166,0.166-0.502,0.502-0.809,0.809V6.164 C11.331,6.47,11.657,6.795,11.834,6.973z M11.834,9.85c-0.178,0.178-0.503,0.504-0.809,0.81V9.042 C11.332,9.348,11.669,9.685,11.834,9.85z"/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/icons/qgn_indi_bt_trusted_add.svg	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg width="13" height="13" viewBox="0 0 13 13">
+<path d="M11.036,3.501V1.162H3.964v2.339h-1V12.5h9.072V3.501H11.036z M10.036,3.417H4.964V2.162h5.072V3.417z M11.036,4.501 V11.5H3.964V4.501H11.036z"/>
+<path d="M7.188,8.097C6.851,8.434,6.024,9.261,6.024,9.261L6.39,9.626l0.798-0.798v1.397v0.731L9.05,9.095 c0,0-0.809-0.81-1.064-1.063C8.241,7.776,9.05,6.967,9.05,6.967L7.188,5.104v2.129L6.39,6.435L6.024,6.801 c0,0,0.827,0.827,1.164,1.164V8.097z M8.318,9.095c-0.131,0.132-0.373,0.373-0.599,0.6V8.497 C7.946,8.723,8.196,8.973,8.318,9.095z M8.318,6.967C8.196,7.089,7.946,7.338,7.72,7.565V6.367 C7.946,6.594,8.187,6.834,8.318,6.967z"/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_audio.svg	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg width="16" height="16" viewBox="0 0 16 16">
+<path d="M12.419,1.676v3.953c-0.055-0.017-0.095-0.048-0.158-0.057 c-0.648-0.09-1.453,0.32-1.798,0.914c-0.345,0.594-0.097,1.148,0.55,1.237c0.648,0.09,1.453-0.319,1.797-0.913 c0.09-0.155,0.136-0.306,0.148-0.448c0.001-0.002,0.002-0.002,0.003-0.005c0-0.144,0-3.131,0-3.131l1.374,0.734V2.826 L12.419,1.676z" fill="#496DA2"/>
+<path d="M2.718,6.217C3.72,6.211,4.533,6.235,4.533,6.235l-0.024,5.754 c0,0-1.093,0.005-1.773,0.005C1.32,11.697,1.299,6.572,2.718,6.217z" fill="#A2C2DD"/>
+<linearGradient id="_3" gradientUnits="userSpaceOnUse" x1="6.83" y1="3.67" x2="6.83" y2="13.89">
+<stop stop-color="#CEE1EF" offset="0"/>
+<stop stop-color="#A2C2DD" offset="0.5"/>
+<stop stop-color="#496DA2" offset="1"/>
+</linearGradient>
+<path d="M8.146,3.86H7.216c-0.007,0-0.013,0.008-0.021,0.009 c-0.01,0-0.02-0.009-0.029-0.009c-0.993,0-1.798,2.343-1.798,5.231c0,2.89,0.805,5.231,1.798,5.231c0.016,0,1.006,0,1.006,0 C8.353,14.323,8.327,3.86,8.146,3.86z" fill="url(#_3)"/>
+<linearGradient id="_4" gradientUnits="userSpaceOnUse" x1="6.32" y1="9.09" x2="9.91" y2="9.09">
+<stop stop-color="#CEE1EF" offset="0"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</linearGradient>
+<ellipse cx="8.116" cy="9.092" fill="url(#_4)" rx="1.798" ry="5.231"/>
+<ellipse cx="8.147" cy="9.092" fill="#A2C2DD" rx="1.529" ry="4.447"/>
+<path d="M6.74,10.781C8.343,9.891,8.343,7.898,6.776,7.19C6.598,8.052,6.615,9.66,6.74,10.781z" fill="#496DA2"/>
+<path d="M6.121,4.823L3.665,6.235L3.664,6.237c-1.16,0.736-1.16,4.934-0.026,5.709 c0.003,0.008,0.005,0.015,0.008,0.022c0.817,0.466,1.116,0.616,2.476,1.354C4.521,8.883,6.121,4.823,6.121,4.823z" fill="#496DA2"/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_blocked_tab3.svg	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg width="44" height="22" viewBox="29 27.393 44 22">
+<path d="M57.641,35.668c-3.277,0-5.934,2.657-5.934,5.934c0,3.273,2.656,5.932,5.934,5.932c3.275,0,5.933-2.656,5.933-5.932 C63.572,38.325,60.916,35.668,57.641,35.668z M53.275,43.034v-2.865h8.729v2.865H53.275z"/>
+<path d="M40.973,38.393c0.957-0.958,4-4,4-4l-7-7v8l-3-3l-1.375,1.375c0,0,3.092,3.094,4.375,4.375v0.5 c-1.283,1.281-4.375,4.375-4.375,4.375l1.375,1.375l3-3v8l7-7C44.973,42.393,41.93,39.352,40.973,38.393z M42.223,34.393l-2.25,2.25 v-4.5L42.223,34.393z M39.973,44.643v-4.5c0.853,0.854,1.791,1.79,2.25,2.25L39.973,44.643z"/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_car_kit.svg	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="16px" version="1.1" viewBox="-0.012 -0.038 16 16" width="16px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<rect fill="none" height="16" width="16"/>
+<polygon fill="#CEE1EF" points="12.87,7.236 12.04,6.979 9.01,8.949 9.976,9.259 "/>
+<path d="M5.034,11.765c0.005-0.003,0.011-0.007,0.016-0.009c0.482-0.25,1.362-1.096,1.362-1.096  S3.317,9.071,3.291,9.91c-0.027,0.838,0.465,1.689,1.101,1.897c0.222,0.073,0.43,0.054,0.61-0.031v0.006  C5.012,11.778,5.023,11.77,5.034,11.765z" fill="#496DA2"/>
+<path d="M9.994,11.781c0,0-3.284-1.877-3.313-0.95c-0.027,0.928,0.517,1.866,1.218,2.097  c0.249,0.083,0.483,0.062,0.685-0.037v0.015C9.054,12.687,9.994,11.781,9.994,11.781z" fill="#496DA2"/>
+<polygon fill="#496DA2" points="9.217,9.008 12.04,6.979 10.879,4.431 8.289,5.777 "/>
+<polygon fill="#496DA2" points="10.455,11.982 13.327,9.541 12.861,7.22 9.94,9.219 "/>
+<polygon fill="#CEE1EF" points="10.937,4.453 6.985,3.806 4.288,4.797 8.307,5.785 "/>
+<polygon fill="#A2C2DD" points="9.16,8.851 9.988,9.212 10.455,11.984 2.051,9.408 2.529,7.396 3.146,7.257 4.261,4.805   8.299,5.779 "/>
+<polygon fill="#496DA2" points="4.676,5.74 3.88,7.515 8.339,8.807 7.823,6.486 "/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_carkit.svg	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg width="16" height="16" viewBox="0 0 16 16">
+<path d="M4.994,11.816c0.006-0.003,0.012-0.007,0.018-0.01c0.546-0.283,1.542-1.24,1.542-1.24 S3.051,8.767,3.021,9.717c-0.031,0.949,0.526,1.913,1.246,2.148c0.251,0.083,0.486,0.061,0.69-0.036v0.007 C4.968,11.832,4.982,11.822,4.994,11.816z" fill="#496DA2"/>
+<path d="M10.609,11.835c0,0-3.718-2.125-3.75-1.075c-0.031,1.05,0.585,2.112,1.378,2.373 c0.282,0.094,0.547,0.07,0.775-0.042l0,0.016C9.544,12.86,10.609,11.835,10.609,11.835z" fill="#496DA2"/>
+<polygon fill="#496DA2" points="9.729,8.696 12.925,6.4 11.61,3.514 8.678,5.039 "/>
+<polygon fill="#496DA2" points="11.13,12.063 14.382,9.299 13.854,6.672 10.548,8.934 "/>
+<polygon fill="#CEE1EF" points="11.675,3.54 7.203,2.807 4.149,3.929 8.698,5.048 "/>
+<polygon fill="#CEE1EF" points="13.864,6.69 12.925,6.4 9.494,8.629 10.588,8.98 "/>
+<polygon fill="#A2C2DD" points="9.665,8.518 10.602,8.927 11.13,12.065 1.617,9.149 2.158,6.87 2.857,6.713 4.118,3.937 8.69,5.041 "/>
+<polygon fill="#496DA2" points="4.588,4.997 3.687,7.005 8.735,8.468 8.151,5.841 "/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_computer.svg	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg width="16" height="16" viewBox="0 0 16 16">
+<polygon fill="#A2C2DD" points="8.984,14.184 2.357,12.119 2.211,9.661 8.961,11.244 "/>
+<polygon fill="#CEE1EF" points="14.003,8.848 6.92,8.078 2.211,9.66 8.92,11.25 "/>
+<polygon fill="#496DA2" points="8.984,14.184 13.899,11.202 14.003,8.827 8.95,11.244 "/>
+<polygon fill="#CEE1EF" points="14.107,2.749 6.79,1.816 1.892,3.293 9.003,4.567 "/>
+<polygon fill="#496DA2" points="9.033,4.561 4.055,8.145 4.04,9.613 8.88,10.725 12.415,8.988 12.415,8.729 13.961,7.978 14.086,2.749 "/>
+<polygon fill="#A2C2DD" points="9.067,10.355 2.205,8.687 1.892,3.293 9.045,4.562 "/>
+<polygon fill="#496DA2" points="8.072,9.375 2.924,8.12 2.654,4.211 8.016,5.179 "/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_connected.svg	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="16px" version="1.1" viewBox="0.054 -0.014 16 16" width="16px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<rect fill="none" height="16" width="16"/>
+<path d="M1.172,8.063c0-2.249,0.572-4.364,1.578-6.209H1.739C0.817,3.696,0.295,5.774,0.295,7.976  c0,2.424,0.633,4.702,1.739,6.678h0.935C1.829,12.72,1.172,10.468,1.172,8.063z" fill="#6695BD"/>
+<path d="M14.833,8.063c0-2.249-0.572-4.364-1.578-6.209h1.012c0.922,1.843,1.443,3.921,1.443,6.122  c0,2.424-0.633,4.702-1.738,6.678h-0.936C14.177,12.72,14.833,10.468,14.833,8.063z" fill="#6695BD"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_headset.svg	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg width="16" height="16" viewBox="0 0 16 16">
+<linearGradient id="_5" gradientUnits="userSpaceOnUse" x1="8.89" y1="3.04" x2="4.1" y2="5.37">
+<stop stop-color="#CEE1EF" offset="0"/>
+<stop stop-color="#A2C2DD" offset="0.5"/>
+<stop stop-color="#496DA2" offset="1"/>
+</linearGradient>
+<path d="M7.388,2.271C5.996,2.133,3.993,3.315,3.9,6.61l1.165,0.2 c0.074-1.4,1.086-3.7,2.424-3.842c0.396-0.044,1.014-0.077,1.606,0.407C9.096,3.375,8.878,2.419,7.388,2.271z" fill="url(#_5)"/>
+<path d="M6.325,9.855c-0.105,1.563-1.071,2.572-2.162,2.256 c-1.087-0.319-1.891-1.846-1.787-3.407c0.105-1.56,1.071-2.571,2.162-2.252C5.628,6.77,6.427,8.296,6.325,9.855z" fill="#496DA2"/>
+<linearGradient id="_6" gradientUnits="userSpaceOnUse" x1="5.01" y1="4.9" x2="3.62" y2="11.27">
+<stop stop-color="#CEE1EF" offset="0"/>
+<stop stop-color="#A2C2DD" offset="0.5"/>
+<stop stop-color="#496DA2" offset="1"/>
+</linearGradient>
+<path d="M3.545,6.363C3.118,6.538,2.438,7.604,2.367,8.65 c-0.104,1.563,0.709,3.141,1.796,3.46c0.423,0.122,0.825,0.047,1.168-0.182c-1.495,0.54-3.472-3.269-1.259-5.402L3.545,6.363z" fill="url(#_6)"/>
+<path d="M12.615,8.292c-0.212-3.181-1.057-5.533-3.243-6.413 C7.998,1.326,6.809,1.539,5.5,2.366c0,0,1.481-0.373,2.437-0.045c1.961,0.672,2.93,3.877,3.021,5.705 c-0.668,0.23-1.295,0.824-1.688,1.72c-0.703,1.619-0.383,3.564,0.722,4.343c1.102,0.78,2.569,0.104,3.276-1.515 C13.958,10.991,13.657,9.102,12.615,8.292z" fill="#A2C2DD"/>
+<linearGradient id="_7" gradientUnits="userSpaceOnUse" x1="10.61" y1="8.66" x2="10.52" y2="14.3">
+<stop stop-color="#CEE1EF" offset="0"/>
+<stop stop-color="#A2C2DD" offset="0.5"/>
+<stop stop-color="#496DA2" offset="1"/>
+</linearGradient>
+<path d="M12.181,14.006c-0.686,0.482-1.489,0.592-2.158,0.118 c-1.104-0.779-1.456-2.76-0.753-4.378c0.354-0.808,0.931-1.393,1.523-1.667l0.577,0.361 C9.335,10.192,9.704,14.871,12.181,14.006z" fill="url(#_7)"/>
+<linearGradient id="_8" gradientUnits="userSpaceOnUse" x1="5.35" y1="3.41" x2="9.4" y2="7.91">
+<stop stop-color="#CEE1EF" offset="0"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</linearGradient>
+<path d="M11.363,8.481c-0.188-2.877-1.328-5.8-3.257-6.345 C5.426,1.375,3.948,3.083,3.545,6.363l0.527,0.163c0.17-2.525,1.301-4.599,3.794-3.947c1.692,0.443,2.449,3.271,2.676,5.685 L11.363,8.481z" fill="url(#_8)"/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_keyboard.svg	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="16px" version="1.1" viewBox="-0.136 0.042 16 16" width="16px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<rect fill="none" height="16" width="16"/>
+<polygon fill="#CEE1EF" points="6.074,6.093 13.66,7.63 12.829,8.118 5.254,6.401 "/>
+<polygon fill="#496DA2" points="9.594,12.813 9.579,11.876 12.829,8.118 13.647,7.594 13.572,9.055 "/>
+<polygon fill="#A2C2DD" points="12.829,8.118 5.254,6.401 1.803,9.365 9.579,11.876 "/>
+<polygon fill="#6695BD" points="9.579,11.876 1.803,9.365 1.867,9.922 9.594,12.813 "/>
+<polygon fill="#496DA2" points="5.898,6.707 5.976,7.194 5.337,7.822 5.257,7.338 "/>
+<polygon fill="#6695BD" points="5.257,7.338 5.341,7.827 4.413,7.575 4.328,7.091 "/>
+<polygon fill="#E1EBF4" points="5.898,6.707 5.257,7.338 4.328,7.091 4.997,6.509 "/>
+<polygon fill="#496DA2" points="7.24,7.044 7.318,7.532 6.679,8.16 6.599,7.676 "/>
+<polygon fill="#6695BD" points="6.599,7.676 6.683,8.165 5.755,7.912 5.67,7.429 "/>
+<polygon fill="#E1EBF4" points="7.24,7.044 6.599,7.676 5.67,7.429 6.327,6.814 "/>
+<polygon fill="#496DA2" points="8.649,7.428 8.727,7.916 8.088,8.544 8.008,8.061 "/>
+<polygon fill="#6695BD" points="8.008,8.061 8.092,8.549 7.164,8.296 7.079,7.813 "/>
+<polygon fill="#E1EBF4" points="8.649,7.428 8.008,8.061 7.079,7.813 7.736,7.199 "/>
+<polygon fill="#496DA2" points="10.118,7.817 10.196,8.305 9.557,8.932 9.477,8.449 "/>
+<polygon fill="#6695BD" points="9.477,8.449 9.561,8.938 8.633,8.685 8.547,8.201 "/>
+<polygon fill="#E1EBF4" points="10.118,7.817 9.477,8.449 8.547,8.201 9.206,7.588 "/>
+<polygon fill="#496DA2" points="11.666,8.188 11.746,8.688 11.091,9.331 11.01,8.835 "/>
+<polygon fill="#6695BD" points="11.01,8.835 11.096,9.336 10.145,9.078 10.058,8.583 "/>
+<polygon fill="#E1EBF4" points="11.666,8.188 11.01,8.835 10.058,8.583 10.731,7.954 "/>
+<polygon fill="#496DA2" points="4.943,7.632 5.021,8.119 4.383,8.748 4.303,8.264 "/>
+<polygon fill="#6695BD" points="4.303,8.264 4.387,8.752 3.459,8.5 3.374,8.016 "/>
+<polygon fill="#E1EBF4" points="4.943,7.632 4.303,8.264 3.374,8.016 4.031,7.402 "/>
+<polygon fill="#496DA2" points="3.935,8.55 4.013,9.038 3.374,9.667 3.294,9.182 "/>
+<polygon fill="#6695BD" points="3.294,9.182 3.378,9.671 2.45,9.418 2.365,8.935 "/>
+<polygon fill="#E1EBF4" points="3.935,8.55 3.294,9.182 2.365,8.935 3.021,8.321 "/>
+<polygon fill="#496DA2" points="9.622,10.197 9.706,10.719 9.02,11.393 8.934,10.875 "/>
+<polygon fill="#6695BD" points="8.934,10.875 9.024,11.399 8.029,11.127 7.938,10.609 "/>
+<polygon fill="#E1EBF4" points="9.622,10.197 8.934,10.875 7.938,10.609 8.642,9.951 "/>
+<polygon fill="#496DA2" points="7.983,9.79 8.061,10.277 7.422,10.905 7.342,10.421 "/>
+<polygon fill="#6695BD" points="7.338,10.411 7.422,10.9 3.717,9.749 3.645,9.299 "/>
+<polygon fill="#E1EBF4" points="7.987,9.784 7.346,10.417 3.631,9.299 4.288,8.686 "/>
+<polygon fill="#496DA2" points="6.234,7.96 6.312,8.448 5.673,9.077 5.593,8.592 "/>
+<polygon fill="#6695BD" points="5.593,8.592 5.677,9.082 4.75,8.829 4.664,8.345 "/>
+<polygon fill="#E1EBF4" points="6.234,7.96 5.593,8.592 4.664,8.345 5.321,7.731 "/>
+<polygon fill="#496DA2" points="7.627,8.325 7.705,8.813 7.066,9.44 6.986,8.958 "/>
+<polygon fill="#6695BD" points="6.986,8.958 7.071,9.446 6.143,9.194 6.057,8.709 "/>
+<polygon fill="#E1EBF4" points="7.627,8.325 6.986,8.958 6.057,8.709 6.714,8.096 "/>
+<polygon fill="#496DA2" points="9.112,8.75 9.19,9.237 8.551,9.866 8.471,9.381 "/>
+<polygon fill="#6695BD" points="8.471,9.381 8.555,9.87 7.627,9.618 7.542,9.134 "/>
+<polygon fill="#E1EBF4" points="9.112,8.75 8.471,9.381 7.542,9.134 8.199,8.52 "/>
+<polygon fill="#496DA2" points="10.688,9.131 10.769,9.634 10.111,10.282 10.028,9.783 "/>
+<polygon fill="#6695BD" points="10.028,9.783 10.116,10.287 9.159,10.026 9.071,9.528 "/>
+<polygon fill="#E1EBF4" points="10.688,9.131 10.028,9.783 9.071,9.528 9.749,8.895 "/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_misc.svg	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg width="16" height="16" viewBox="0 0 16 16">
+<path d="M12.527,10.281c0.349-0.349,1.455-1.455,1.455-1.455l-2.545-2.545v3.013l-1.169-1.169 l-0.5,0.5c0,0,1.269,1.269,1.669,1.669v0.025c-0.4,0.4-1.669,1.669-1.669,1.669l0.5,0.5l1.169-1.169v2.962l2.545-2.545 C13.982,11.736,12.876,10.63,12.527,10.281z M12.982,8.827c-0.167,0.167-0.508,0.508-0.818,0.818V8.008 C12.473,8.318,12.802,8.647,12.982,8.827z M12.164,12.554v-1.637c0.31,0.31,0.651,0.651,0.818,0.818 C12.802,11.916,12.473,12.245,12.164,12.554z" fill="#496DA2"/>
+<path d="M4.777,10.281c0.349-0.349,1.455-1.455,1.455-1.455L3.687,6.281v3.013L2.518,8.125 l-0.5,0.5c0,0,1.269,1.269,1.669,1.669v0.025c-0.4,0.4-1.669,1.669-1.669,1.669l0.5,0.5l1.169-1.169v2.962l2.545-2.545 C6.232,11.736,5.126,10.63,4.777,10.281z M5.232,8.827C5.064,8.994,4.724,9.335,4.414,9.645V8.008 C4.723,8.318,5.052,8.647,5.232,8.827z M4.414,12.554v-1.637c0.31,0.31,0.651,0.651,0.818,0.818 C5.052,11.916,4.723,12.245,4.414,12.554z" fill="#A2C2DD"/>
+<path d="M8.777,5.719c0.349-0.349,1.455-1.455,1.455-1.455L7.687,1.719v3.013L6.518,3.563 l-0.5,0.5c0,0,1.269,1.269,1.669,1.669v0.025c-0.4,0.4-1.669,1.669-1.669,1.669l0.5,0.5l1.169-1.169v2.962l2.545-2.545 C10.232,7.173,9.126,6.067,8.777,5.719z M9.232,4.264C9.064,4.432,8.724,4.772,8.414,5.083V3.446 C8.723,3.755,9.052,4.084,9.232,4.264z M8.414,7.992V6.355c0.31,0.31,0.651,0.651,0.818,0.818 C9.052,7.354,8.723,7.683,8.414,7.992z" fill="#A2C2DD"/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_mouse.svg	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="16px" version="1.1" viewBox="-0.229 -0.035 16 16" width="16px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<rect fill="none" height="16" width="16"/>
+<path d="M13.5,7.189c0,0-0.349,1.197-0.888,1.922c-0.24,0.323-0.571,0.588-0.871,0.854  c-1.063,0.941-2.06,2.014-3.304,2.723c-0.981,0.559-2.318,0.605-3.391,0.301c-0.287-0.081-0.629-0.232-0.85-0.438  c-0.391-0.365-0.704-0.861-0.886-1.362c-0.199-0.552-0.263-1.1-0.256-1.665c0.011-0.961,5.899-3.915,5.899-3.915L13.5,7.189z" fill="#496DA2"/>
+<path d="M13.427,6.034c0,0,0.283,0.698,0.03,1.285c-0.151,0.351-1.001,0.653-1.798,1.124  c-0.536,0.316-1.092,0.838-1.229,1.013c-0.258,0.325-0.797,0.972-1.519,1.516c-0.815,0.613-1.845,1.112-2.588,1.182  c-1.4,0.133-2.174-0.479-2.396-0.669c-0.1-0.086-0.783-0.812-0.87-1.643C3.014,9.421,2.939,8.85,3.07,8.364  c0.182-0.672,0.597-1.209,0.597-1.209L13.427,6.034z" fill="#6695BD"/>
+<path d="M13.542,6.64c0,0-0.263,0.361-0.841,0.665c-0.579,0.303-1.473,0.549-2.104,1  c-0.665,0.477-0.634,0.747-1.325,1.41c-0.356,0.342-1.181,1.024-2.082,1.374c-0.852,0.33-1.661,0.293-2.309,0.01  c-0.646-0.283-1.044-0.531-1.33-1.064C3.066,9.132,3.134,7.83,3.735,7.104c0.956-1.155,4.641-2.781,5.79-2.767  c1.148,0.014,3.318,0.521,3.82,1.534C13.62,6.343,13.542,6.64,13.542,6.64z" fill="#E1EBF4"/>
+<path d="M11.996,7.569c0,0-2.256-1.45-2.404-1.502C9.443,6.017,7.824,4.74,7.824,4.74L7.682,4.788  c0,0,1.609,1.325,1.83,1.39c0.221,0.063,1.995,1.35,2.17,1.478C11.753,7.707,11.996,7.569,11.996,7.569z" fill="#6695BD"/>
+<path d="M12.335,5.036c0,0-0.688,0.147-1.323,0.422C10.444,5.704,9.924,6.074,9.9,6.155  c-0.05,0.172-0.375-0.144-0.375-0.144s0.82-0.505,1.379-0.744c0.558-0.239,1.191-0.348,1.191-0.348L12.335,5.036z" fill="#6695BD"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_phone.svg	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg width="16" height="16" viewBox="0 0 16 16">
+<polygon fill="#A2C2DD" points="9.726,14.442 4.13,12.736 3.566,4.131 9.705,5.273 "/>
+<polygon fill="#CEE1EF" points="12.479,4.039 6.432,3.059 3.521,4.131 9.657,5.273 "/>
+<path d="M10.163,3.842l0.396-2.03c-0.509-0.355-1.241-0.322-1.777,0l0.301,2.119 C8.9,4.015,8.782,4.123,8.796,4.235c0.025,0.193,0.465,0.389,0.921,0.342c0.455-0.045,0.753-0.32,0.725-0.512 C10.43,3.967,10.323,3.889,10.163,3.842z" fill="#496DA2"/>
+<polygon fill="#496DA2" points="9.726,14.442 12.102,12.962 12.479,4.039 9.691,5.262 "/>
+<polygon fill="#496DA2" points="4.477,5.16 4.695,8.257 8.898,9.294 8.884,6.06 "/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_printer.svg	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="16px" version="1.1" viewBox="-0.02 -0.029 16 16" width="16px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<rect fill="none" height="16" width="16"/>
+<polygon fill="#A2C2DD" points="7.234,7.223 6.468,7.585 11.48,8.652 12.49,8.159 "/>
+<polygon fill="#CEE1EF" points="6.965,6.975 7.356,7.026 6.284,7.541 11.48,8.652 12.946,7.924 13.73,8.07 11.931,9.189   5.294,7.736 "/>
+<path d="M5.33,7.723c0,0-1.696,0.762-1.719,1.992c-0.003,0.159-0.009,0.979-0.009,0.979l6.828,2.104l1.521-3.605  L5.33,7.723z" fill="#A2C2DD"/>
+<path d="M13.73,8.07l-1.813,1.122c0,0-1.337,0.859-1.471,2.014c-0.029,0.245-0.016,1.592-0.016,1.592l3.06-1.895  L13.73,8.07z" fill="#496DA2"/>
+<polygon fill="#496DA2" points="4.642,10.733 4.617,9.733 9.344,11.03 9.343,12.137 "/>
+<polygon fill="#CEE1EF" points="13.227,4.78 8.463,4.227 7.559,7.431 11.98,8.221 "/>
+<polygon fill="#496DA2" points="13.227,4.78 11.98,8.221 12.279,8.123 13.221,5.419 "/>
+<polygon fill="#496DA2" points="6.284,7.541 6.571,7.601 7.316,7.237 7.356,7.026 "/>
+<path d="M10.338,10.145c0,0.271-0.246,0.491-0.55,0.491c-0.305,0-0.551-0.22-0.551-0.491s0.246-0.492,0.551-0.492  C10.092,9.652,10.338,9.873,10.338,10.145z" fill="#496DA2"/>
+<polygon fill="#A2C2DD" points="2.774,11.087 6.922,12.496 6.911,12.852 2.781,11.37 "/>
+<polygon fill="#CEE1EF" points="5.157,10.141 2.773,11.087 6.914,12.491 9.09,11.25 "/>
+<polygon fill="#496DA2" points="6.914,12.491 9.092,11.255 9.048,11.602 6.911,12.852 "/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/icons/qgn_prop_bt_unknown.svg	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg width="16" height="16" viewBox="0 0 16 16">
+<linearGradient id="_2" gradientUnits="userSpaceOnUse" x1="7.27" y1="4.59" x2="11.38" y2="9.5">
+<stop stop-color="#B3DDFF" offset="0"/>
+<stop stop-color="#5AA7E0" offset="0.5"/>
+<stop stop-color="#0046B7" offset="1"/>
+</linearGradient>
+<path fill="url(#_2)" d="M4.252,3.612l1.564-0.828C5.807,2.79,7.711,2.017,9.338,2.44 c1.574,0.409,2.516,1.266,3.422,2.664s1.119,3.848,0.52,5.15c-0.6,1.306-1,1.61-1.438,2.024l-2.045,1.479 c1.652-2.877,1.313-6.031,0.301-7.431C9.084,4.931,6.982,3.093,4.252,3.612z"/>
+<circle fill="#B3DDFF" cx="6.872" cy="8.774" r="5.328"/>
+<path fill="#0046B7" d="M6.982,13.864c0.629,0.137,1.115-0.256,1.115-0.828c0-0.611-0.486-1.173-1.115-1.287 c-0.617-0.117-1.102,0.26-1.102,0.839C5.881,13.144,6.381,13.733,6.982,13.864z"/>
+<path fill="#0046B7" d="M7.867,10.915c0-1.08-0.549-1.78-1.311-2.564C6.113,7.903,5.682,7.513,5.682,6.899 c0-0.701,0.613-1.252,1.361-1.177c0.865,0.083,1.428,0.786,1.441,1.606l1.691,0.184c0.025-1.767-1.352-3.293-3.146-3.421 C5.377,3.96,3.965,5.118,3.965,6.642c0,1.988,1.979,2.213,2.252,3.988L7.867,10.915z"/>
+<rect x="9.707" y="1.619" fill="#0046B7" width="1.4" height="2.436"/>
+<rect x="11.859" y="3.502" fill="#0046B7" width="2.429" height="1.4"/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btui.pro	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,33 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+
+TEMPLATE = subdirs
+
+# Directories
+SUBDIRS += btuimodel \
+btuidelegate \
+btcpplugin \
+tsrc
+
+CONFIG += ordered
+
+symbian: {
+
+    BLD_INF_RULES.prj_exports += \
+				"$${LITERAL_HASH}include<platform_paths.hrh>" \
+				"rom/btui.iby CORE_MW_LAYER_IBY_EXPORT_PATH(btui.iby)"
+} 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuidelegate/btabstractdelegate.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include "btabstractdelegate.h"
+#include "btuimodel.h"
+
+/*!
+    Constructor.
+ */
+BtAbstractDelegate::BtAbstractDelegate( BtuiModel& model, QObject *parent )
+    : QObject( parent ), mModel(model)
+{
+}
+
+/*!
+    Destructor.
+ */
+BtAbstractDelegate::~BtAbstractDelegate()
+{
+}
+
+BtuiModel &BtAbstractDelegate::model()
+{
+    return mModel;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuidelegate/btabstractdelegate.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef BTABSTRACTDELEGATE_H
+#define BTABSTRACTDELEGATE_H
+
+#include <QObject>
+#include <QVariant>
+
+class BtuiModel;
+
+#ifdef BUILD_BTUIDELEGATE
+#define BTUIDELEGATE_IMEXPORT Q_DECL_EXPORT
+#else
+#define BTUIDELEGATE_IMEXPORT Q_DECL_IMPORT
+#endif
+
+
+/*!
+    \class BtAbstractDelegate
+    \brief the base class for handling user requests from BT application.
+
+
+    \\sa btuidelegate
+ */
+class BTUIDELEGATE_IMEXPORT BtAbstractDelegate : public QObject
+{
+    Q_OBJECT
+
+public:
+    explicit BtAbstractDelegate( BtuiModel& model, QObject *parent = 0 );
+    
+    virtual ~BtAbstractDelegate();
+
+    virtual void exec( const QVariant &params ) = 0;
+
+signals:
+    void commandCompleted(int status, QVariant params = QVariant() );
+    
+protected:
+    
+    BtuiModel &model();
+    
+public slots:
+
+private:
+    
+    BtuiModel& mModel;
+
+    Q_DISABLE_COPY(BtAbstractDelegate)
+
+};
+
+#endif // BTABSTRACTDELEGATE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuidelegate/btdelegateconsts.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef BTDELEGATECONSTS_H
+#define BTDELEGATECONSTS_H
+
+#include <QObject>
+
+namespace BtDelegate
+    {
+    enum Command
+        {
+        Undefined,
+        ManagePower,
+        DeviceName,
+        Visibility,
+        };
+    }
+
+#endif // BTDELEGATECONSTS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuidelegate/btdelegatedevname.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include "btdelegatedevname.h"
+#include "btuimodel.h"
+#include <bluetoothuitrace.h>
+#include <QRegExp>
+
+BtDelegateDevName::BtDelegateDevName( BtuiModel& model, QObject *parent ) :
+    BtAbstractDelegate( model, parent )
+{
+    TRAP_IGNORE( mBtEngSettings = CBTEngSettings::NewL() );
+    Q_CHECK_PTR( mBtEngSettings );
+
+}
+    
+BtDelegateDevName::~BtDelegateDevName()
+{
+    delete mBtEngSettings;
+}
+
+/*!
+    Validate the bluetooth device name given by the user:
+    Extra spaces (' ', '\n', '\t' and '\r') from the beginning, 
+    middle and the end of the name are always removed;
+    the maximum lengthof a name is 30.
+ */
+bool BtDelegateDevName::validateName(QString &name )
+{
+    // remove spaces at the beginning and end:
+    name = name.trimmed();
+    // regular expression of one or more consecutive spaces:
+    QRegExp rx("[ \n\t\r]+");
+    name.replace( rx, " ");
+    if (name.length() > 30 ) {
+        name.resize( 30 );
+    }
+    return name.length() > 0;
+}
+
+void BtDelegateDevName::exec( const QVariant &params )
+{
+    int error = KErrNone;
+    QString btDevName = params.toString();
+    
+    validateName(btDevName);
+    
+    TPtrC ptrName(reinterpret_cast<const TText*>(btDevName.constData()));
+    
+    RBuf16 btName;
+    error = btName.Create(ptrName.Length());
+    
+    if(error == KErrNone) {
+        btName.Copy(ptrName);
+        error = mBtEngSettings->SetLocalName(btName);
+        btName.Close();
+    }
+    
+    emit commandCompleted(error, btDevName);
+}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuidelegate/btdelegatedevname.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef BTDELEGATEDEVNAME_H
+#define BTDELEGATEDEVNAME_H
+
+#include <e32base.h>
+#include <btengsettings.h>
+#include "btabstractdelegate.h"
+
+class BtuiModel;
+
+/*!
+    \class BtDelegateDevName
+    \brief the base class for handling Bluetooth Local Name.
+ */
+class BtDelegateDevName : public BtAbstractDelegate
+{
+    Q_OBJECT
+
+public:
+    explicit BtDelegateDevName( BtuiModel& model, QObject *parent = 0 );
+    
+    virtual ~BtDelegateDevName();
+
+    virtual void exec( const QVariant &params );
+    
+public slots:
+
+private:
+    bool validateName(QString &name );
+
+    CBTEngSettings* mBtEngSettings;
+
+private:
+
+    Q_DISABLE_COPY(BtDelegateDevName)
+
+};
+
+#endif // BTDELEGATEDEVNAME_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuidelegate/btdelegatefactory.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include "btdelegatefactory.h"
+#include "btdelegatepower.h"
+#include "btuimodel.h"
+#include "btdelegatedevname.h"
+#include "btdelegatevisibility.h"
+
+
+/*!
+    Constructor.
+ */
+BtAbstractDelegate * BtDelegateFactory::newDelegate(
+        BtDelegate::Command cmd, BtuiModel& model, QObject *parent )
+{
+    switch ( cmd ) {
+        case BtDelegate::ManagePower:
+            return new BtDelegatePower( model, parent );
+        case BtDelegate::DeviceName:
+            return new BtDelegateDevName( model, parent );
+        case BtDelegate::Visibility:
+                    return new BtDelegateVisibility( model, parent );
+    }
+    return 0;
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuidelegate/btdelegatefactory.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef BTDELEGATEFACTORY_H
+#define BTDELEGATEFACTORY_H
+
+#include <QObject>
+#include "btdelegateconsts.h"
+
+class BtAbstractDelegate;
+class BtuiModel;
+
+#ifdef BUILD_BTUIDELEGATE
+#define BTUIDELEGATE_IMEXPORT Q_DECL_EXPORT
+#else
+#define BTUIDELEGATE_IMEXPORT Q_DECL_IMPORT
+#endif
+
+/*!
+    \class BtDelegateFactory
+    \brief the base class for creating concrete delegate instances
+
+    \\sa btuidelegate
+ */
+class BTUIDELEGATE_IMEXPORT BtDelegateFactory
+{
+
+public:
+    static BtAbstractDelegate *newDelegate( 
+            BtDelegate::Command cmd, BtuiModel& model, QObject *parent = 0 );
+
+};
+
+#endif // BTDELEGATEFACTORY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuidelegate/btdelegatepower.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,223 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include "btdelegatepower.h"
+#include "btuimodel.h"
+#include <hbmessagebox.h>
+#include <bluetoothuitrace.h>
+#include <hbaction.h>
+
+/*!
+    Constructor.
+ */
+BtDelegatePower::BtDelegatePower( BtuiModel& model, QObject *parent )
+    : BtAbstractDelegate( model, parent )
+{
+    TRAP_IGNORE( mBtengSettings = CBTEngSettings::NewL(this) );
+    Q_CHECK_PTR( mBtengSettings );
+    
+}
+
+/*!
+    Destructor.
+ */
+BtDelegatePower::~BtDelegatePower()
+{
+    delete mBtengSettings;
+    
+}
+
+void BtDelegatePower::exec( const QVariant &params )
+{   
+    if (params.toInt()){//turn power OFF
+        
+        switchBTOff();     
+    }
+    else{//turn power ON  
+    
+        switchBTOn();
+    }
+}
+       
+    
+
+void BtDelegatePower::switchBTOn()
+{
+    int err = 0;
+    
+    //check if device is in OFFLINE mode first
+    TBTEnabledInOfflineMode enabledInOffline = EBTDisabledInOfflineMode;
+    if (checkOfflineMode(enabledInOffline)){
+    //if (1){
+        if (enabledInOffline){
+        //if (1){
+            // BT is allowed to be enabled in offline mode, show query.
+            HbMessageBox::question( tr("Turn Bluetooth on in offline mode?"),this, SLOT(btOnQuestionClose(HbAction*)));
+
+        }
+        else{
+            //if BT is not allowed to be enabled in offline mode, show message and complete
+            HbMessageBox::warning(tr("Bluetooth not allowed to be turned on in offline mode"),this, SLOT(btOnWarningClose()));
+        }
+        
+    }
+    else{
+        //set BT on if the not in offline mode
+        err = mBtengSettings->SetPowerState((TBTPowerStateValue)(1));
+    }
+    
+    if ( err ) {
+        QString info = "Unable to switch BT power ON" ;
+        emit commandCompleted(KErrGeneral);
+    }
+    
+}
+
+void BtDelegatePower::btOnQuestionClose(HbAction *action)
+{
+    HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
+    int err = 0;
+    if(action == dlg->actions().at(0)) 
+    {
+        //user chooses "yes" for using BT in offline 
+        err = mBtengSettings->SetPowerState((TBTPowerStateValue)(1));
+    }
+    else
+    {
+        //if user chooses "NO", emits the signal
+        emit commandCompleted(KErrNone);
+           
+    }     
+    if ( err ) {
+        QString info = "Unable to switch BT power ON" ;
+        emit commandCompleted(KErrGeneral);
+    }
+}
+
+void BtDelegatePower::btOnWarningClose()
+{
+    emit commandCompleted(KErrNone);        
+}
+
+
+
+void BtDelegatePower::switchBTOff()
+{
+    int err = 0;
+    err = mBtengSettings->SetPowerState((TBTPowerStateValue)(0));
+    
+    if ( err ) {
+        QString info = "Unable to switch BT power OFF" ;
+        emit commandCompleted(KErrGeneral);
+    }
+        
+}
+
+void BtDelegatePower::btOffDialogClose(HbAction *action)
+{
+    Q_UNUSED( action );
+    
+}
+
+void BtDelegatePower::PowerStateChanged( TBTPowerStateValue aState )
+{
+    Q_UNUSED( aState );
+    emit commandCompleted(KErrNone);
+}
+
+//Method derived from MBTEngSettingsObserver, no need to be implemented here
+void BtDelegatePower::VisibilityModeChanged( TBTVisibilityMode aState )
+{
+    Q_UNUSED( aState );
+}
+
+bool BtDelegatePower::checkOfflineMode(TBTEnabledInOfflineMode& aEnabledInOffline)
+{
+    TCoreAppUIsNetworkConnectionAllowed offline = ECoreAppUIsNetworkConnectionAllowed;  
+   
+    mBtengSettings->GetOfflineModeSettings(offline, aEnabledInOffline);
+    return (!offline);
+    
+}
+
+/*if (params.toBool()) {  // turning power on
+
+        // find out if local device is in offline mode
+        QModelIndex idx = mModel->index( Btuim::OfflineMode, 0);
+        QVariant var = mModel->data( idx, Qt::EditRole );
+        bool offlineMode = var.toBool();
+
+        // find out whether BT is allowed in offline mode
+        var = mModel->data( idx, Btuim::SettingAdditionalParam );
+        bool activationAllowed = var.toBool();
+        
+        if (offlineMode) {
+            // in offline mode
+            if (activationAllowed) {
+                HbMessageBox *messageBox = new HbMessageBox(); 
+                // BT is allowed to be enabled in offline mode, show query.
+                if (messageBox->question( tr("Activate Bluetooth in offline mode?") )) {
+                    ret = mModel->setData(index, value, role);
+                }
+                delete messageBox;
+            }
+            else {
+                // BT is not allowed to be activated in offline mode, show note.
+
+                HbDialog *mShowOnlyPopup = new HbDialog();
+                mShowOnlyPopup->setAttribute(Qt::WA_DeleteOnClose);
+                mShowOnlyPopup->setModal(false);
+                mShowOnlyPopup->setBackgroundFaded(false);
+                mShowOnlyPopup->setDismissPolicy( HbPopup::NoDismiss  );
+                mShowOnlyPopup->setTimeout( 5000 );  // 5 sec
+                HbLabel *label = new HbLabel( tr("Bluetooth is not allowed in offline mode") );
+                label->setAlignment(Qt::AlignCenter);
+                QSizeF popupSize(350,100);
+                mShowOnlyPopup->setMinimumSize(popupSize);
+                mShowOnlyPopup->setContentWidget(label);                
+                mShowOnlyPopup->show();
+            }
+        } 
+        else {
+            // not in offline mode, forward the request to model. 
+            ret =  mModel->setData(index, value, role);    
+        }
+    }
+    else {   // turning power off
+        // first check if existing connections
+        QModelIndex idx = mModel->index(Btuim::BtConnections, 0);
+        QVariant var = mModel->data(idx, Qt::EditRole);
+        bool ok;
+        TInt connNum = var.toInt( &ok );
+        BTUI_ASSERT_X( ok, "BtUiSettingsDelegate::setData", "wrong qvariant type");
+        if (connNum) {
+            // there is at least 1 active connection, show query.
+            HbMessageBox *messageBox = new HbMessageBox(); 
+            if (messageBox->question( tr("Turn Bluetooth off even though connections exist?") )) {
+                ret = mModel->setData(index, value, role);
+            }
+            delete messageBox;
+        } 
+        else {  
+            // no active connections exist, forward the request to model.
+            ret =  mModel->setData(index, value, role);
+        }
+    }*/
+    //emit commandCompleted(err);
+        //return ret;
+    //return false;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuidelegate/btdelegatepower.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef BTDELEGATEPOWER_H
+#define BTDELEGATEPOWER_H
+
+#include <e32base.h>
+#include <btengsettings.h>
+#include "btabstractdelegate.h"
+
+class BtuiModel;
+class HbAction;
+
+/*!
+    \class BtDelegatePower
+    \brief the base class for handling Bluetooth power management.
+
+    \\sa btuidelegate
+ */
+class BtDelegatePower : public BtAbstractDelegate, public MBTEngSettingsObserver
+{
+    Q_OBJECT
+
+public:
+    explicit BtDelegatePower( BtuiModel& model, QObject *parent = 0 );
+    
+    virtual ~BtDelegatePower();
+
+    virtual void exec( const QVariant &params );
+    
+    virtual void PowerStateChanged( TBTPowerStateValue aState );
+
+    virtual void VisibilityModeChanged( TBTVisibilityMode aState );
+    
+public slots:
+    void btOnQuestionClose(HbAction *action);
+    
+    void btOnWarningClose();
+    
+    void btOffDialogClose(HbAction *action);
+    
+private:
+    void switchBTOn();
+    
+    void switchBTOff();
+    
+    bool checkOfflineMode(TBTEnabledInOfflineMode& aEnabledInOffline);
+    
+public slots:
+
+private:
+    CBTEngSettings* mBtengSettings;
+
+private:
+
+    Q_DISABLE_COPY(BtDelegatePower)
+
+};
+
+#endif // BTDELEGATEPOWER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuidelegate/btdelegatevisibility.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Delegate class for setting visibility mode
+*
+*/
+
+
+#include "btdelegatevisibility.h"
+#include "btuimodel.h"
+#include <bluetoothuitrace.h>
+#include "btqtconstants.h"
+#include <btengsettings.h>
+
+const int MAX_TEMPORARY_VISIBILITY = 60;  // minutes, this value comes from the UI spec
+
+/*!
+    Constructor.
+ */
+BtDelegateVisibility::BtDelegateVisibility( BtuiModel& model, QObject *parent )
+    : BtAbstractDelegate( model, parent )
+{
+    TRAP_IGNORE( mBtengSettings = CBTEngSettings::NewL(this) );
+    Q_CHECK_PTR( mBtengSettings );
+    mOperationOngoing = false;
+}
+
+/*!
+    Destructor.
+ */
+BtDelegateVisibility::~BtDelegateVisibility()
+{
+    delete mBtengSettings;
+}
+/*!
+ * executes visibility delegate functionality, ie. calls CBTEngSettings to set the visibility mode;
+ * when operation completes, emits commandCompleted signal
+ * Parameters:  Qlist<QVariant> where first item is VisibilityMode integer specifying operation;  
+ *              for BtTemporary a 2nd parameter is give which signifies the number of minutes to stay visible.
+ */
+void BtDelegateVisibility::exec( const QVariant &params )
+{
+    int minutes, err = 0;
+
+    if (mOperationOngoing) {
+        // complete command with error
+        emit commandCompleted(KErrInUse);
+        return;
+    } 
+    mOperationOngoing = true;
+    
+    // read 1st parameter
+    BTUI_ASSERT_X(params.toList().at(0).isValid(), "BtDelegateVisibility::exec", "invalid parameter");
+    VisibilityMode btQtMode = (VisibilityMode)params.toList().at(0).toInt();
+    mOperation = BtEngVisibilityMode(btQtMode);
+    
+    // verify that we are setting visibility to a new value, otherwise we won't get a callback
+    TBTVisibilityMode visibilityMode( EBTVisibilityModeNoScans );
+    err = mBtengSettings->GetVisibilityMode( visibilityMode );
+    if (err) {
+        mOperationOngoing = false;
+        emit commandCompleted(err);
+        return;
+    }
+    if (visibilityMode == mOperation) {
+        mOperationOngoing = false;
+        emit commandCompleted(KErrNone);
+        return;
+    }
+    
+    switch (mOperation) {
+    case EBTVisibilityModeGeneral :
+        err = mBtengSettings->SetVisibilityMode(mOperation, 0);
+        break;
+    case EBTVisibilityModeHidden:
+        err = mBtengSettings->SetVisibilityMode(mOperation, 0);
+        break;
+    case EBTVisibilityModeTemporary:
+        BTUI_ASSERT_X(params.toList().at(1).isValid(), "BtDelegateVisibility::exec", "invalid time parameter");
+        minutes = params.toList().at(1).toInt();
+        BTUI_ASSERT_X(((minutes >= 0 ) && (minutes <= MAX_TEMPORARY_VISIBILITY)), 
+                "BtDelegateVisibility::exec", "invalid time parameter");
+        err = mBtengSettings->SetVisibilityMode(mOperation, minutes);
+        break;
+    default:
+        // error
+        BTUI_ASSERT_X(false, "BtDelegateVisibility::exec", "invalid parameter");
+    }
+    if (err) {
+        // complete command with error
+        mOperationOngoing = false;
+        emit commandCompleted(err);
+    }
+}
+
+void BtDelegateVisibility::PowerStateChanged( TBTPowerStateValue aState )
+{
+    Q_UNUSED( aState );
+}
+
+/*!
+ * callback from BtEngine
+ *    emits command complete with either: 
+ *    1) KErrUnknown if something went wrong, or
+ *    2) KErrNone if everything ok 
+ */
+void BtDelegateVisibility::VisibilityModeChanged( TBTVisibilityMode aState )
+{
+    if (mOperationOngoing) {
+        //Error handling has to be done, if value is not set properly.
+        mOperationOngoing = false;
+        if (mOperation == aState) {
+            emit commandCompleted(KErrNone);
+        }
+        else {
+            emit commandCompleted(KErrUnknown);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuidelegate/btdelegatevisibility.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef BTDELEGATEVISIBILITY_H
+#define BTDELEGATEVISIBILITY_H
+
+#include <e32base.h>
+#include <btengsettings.h>
+#include "btabstractdelegate.h"
+
+class BtuiModel;
+
+/*!
+    \class BtDelegateVisibility
+    \brief the base class for handling Bluetooth visibility management.
+
+    \\sa btuidelegate
+ */
+class BtDelegateVisibility : public BtAbstractDelegate, public MBTEngSettingsObserver
+{
+    Q_OBJECT
+
+public:
+    explicit BtDelegateVisibility( BtuiModel& model, QObject *parent = 0 );
+    
+    virtual ~BtDelegateVisibility();
+
+    virtual void exec( const QVariant &params );
+    
+
+    
+public slots:
+
+private:
+
+    virtual void PowerStateChanged( TBTPowerStateValue aState );
+    virtual void VisibilityModeChanged( TBTVisibilityMode aState );
+
+private:
+    CBTEngSettings* mBtengSettings;
+    bool mOperationOngoing;
+    TBTVisibilityMode mOperation;
+
+private:
+
+    Q_DISABLE_COPY(BtDelegateVisibility)
+
+};
+
+#endif // BTDELEGATEVISIBILITY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuidelegate/btuidelegate.pro	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,61 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+TEMPLATE = lib
+TARGET = btuidelegate
+MOC_DIR = moc
+DEFINES += BUILD_BTUIDELEGATE
+INCLUDEPATH += . \
+    ../inc
+
+CONFIG += qt \
+    hb \
+    dll
+HEADERS += btdelegateconsts.h \
+    btdelegatepower.h \
+    btdelegatefactory.h \
+    btabstractdelegate.h \
+    btdelegatevisibility.h \
+    btdelegatedevname.h
+    
+SOURCES += btdelegatepower.cpp \
+    btdelegatefactory.cpp \
+    btabstractdelegate.cpp \
+    btdelegatevisibility.cpp \
+    btdelegatedevname.cpp
+    
+symbian: { 
+    SYMBIAN_PLATFORMS = WINSCW \
+        ARMV5
+    BLD_INF_RULES.prj_exports += "btdelegatefactory.h |../inc/btdelegatefactory.h"
+    BLD_INF_RULES.prj_exports += "btabstractdelegate.h |../inc/btabstractdelegate.h"
+    BLD_INF_RULES.prj_exports += "btdelegateconsts.h |../inc/btdelegateconsts.h"
+    TARGET.EPOCALLOWDLLDATA = 1
+    TARGET.UID3 = 0xEE02434F
+    TARGET.CAPABILITY = CAP_GENERAL_DLL
+    INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+    LIBS += -lbtengsettings \
+        -lbtserviceutil \
+        -lbtdevice \
+        -lbtmanclient \
+        -lesock \
+        -lbluetooth \
+        -lbtengdevman \
+        -lbtengconnman \
+        -lcentralrepository \
+        -lflogger
+    //MMP_RULES -= EXPORTUNFROZEN
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuimodel/activewrapper.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,114 @@
+/*
+* ============================================================================
+*  Name        : btuimsettings_p.cpp
+*  Part of     : BluetoothUI / bluetoothuimodel       *** Info from the SWAD
+*  Description : Implements the data source settings class used by BluetoothUiDataModel.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.1
+*/
+
+#include "activewrapper.h"
+
+/*!
+    Constructor.
+ */
+ActiveWrapper::ActiveWrapper( int id, int priority, QObject *parent )
+:   QObject( parent ){
+    d = new ActiveWrapperPrivate( this, id, priority );
+}
+
+/*!
+    Destructor.
+ */
+ActiveWrapper::~ActiveWrapper(){
+    delete d;
+}
+
+int ActiveWrapper::getRequestId(){
+    return d->mRequestId;
+}
+
+void ActiveWrapper::setRequestId( int reqId ){
+    d->mRequestId = reqId;
+}
+
+
+void ActiveWrapper::setActive() {
+    d->SetActive();
+}
+
+void ActiveWrapper::cancel(){
+    d->Cancel();
+}
+
+bool ActiveWrapper::isActive(){
+    return (bool) d->IsActive();
+}
+
+void ActiveWrapper::emitRequestCompleted( int status, int id ) {
+    emit requestCompleted( status, id );
+}
+
+void ActiveWrapper::emitCancelRequest( int id ) {
+    emit cancelRequest( id );
+}
+
+inline void ActiveWrapper::emitError( int status, int id ) {
+    emit error( status, id );
+}
+
+/*!
+    Constructor.
+ */
+ActiveWrapperPrivate::ActiveWrapperPrivate( 
+    ActiveWrapper *parent, int id, int priority )
+:   CActive( (TInt) priority ),
+    q( parent ),
+    mRequestId( id ) {
+    CActiveScheduler::Add( this );
+}
+
+/*!
+    Destructor.
+ */
+ActiveWrapperPrivate::~ActiveWrapperPrivate() {
+    Cancel();
+}
+
+/*!
+    \reimp
+    Called by the active scheduler when the request has been cancelled.
+ */
+void ActiveWrapperPrivate::RunL() {
+    q->emitRequestCompleted( iStatus.Int(), mRequestId );
+}
+
+/*!
+    \reimp
+    Called by Cancel() when the request is outstanding.
+ */
+void ActiveWrapperPrivate::DoCancel() {
+     q->emitCancelRequest( mRequestId );
+}
+
+/*!
+    \reimp
+    Called by the active scheduler when an error in RunL has occurred.
+ */
+TInt ActiveWrapperPrivate::RunError( TInt error ) {
+    q->emitRequestCompleted( error, mRequestId );
+    return KErrNone;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuimodel/activewrapper.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef ACTIVEWRAPPER_H
+#define ACTIVEWRAPPER_H
+
+#include <QObject>
+#include <e32base.h>
+
+class ActiveWrapperPrivate;
+
+/*!
+    \class ActiveWrapper
+    \brief Helper class for using active objects in Qt classes.
+
+    ActiveWrapper is a helper class for using active objects 
+    from any Qt class. It wraps a CActive-derived class in an interface
+    that uses Qt's signal-slot mechanism for communicating status changes 
+    of the active object.
+
+    \\sa bluetoothuimodel
+ */
+class ActiveWrapper : public QObject
+{
+    Q_OBJECT
+    friend class ActiveWrapperPrivate;
+
+public:
+    explicit ActiveWrapper( int id, 
+                int priority = CActive::EPriorityStandard, QObject *parent = NULL );
+    ~ActiveWrapper();
+
+    int getRequestId();
+    void setRequestId(int reqId);
+    void setActive();
+    void cancel();
+    bool isActive();
+    
+signals:
+    void requestCompleted( int status, int id );
+    void cancelRequest( int id );
+    void error( int status, int id );
+
+private:
+    void emitRequestCompleted( int status, int id );
+    void emitCancelRequest( int id );
+    void emitError( int status, int id );
+
+private:
+    ActiveWrapperPrivate *d;
+
+};
+
+
+/*!
+    \class ActiveWrapperPrivate
+    \brief Private class of ActiveWrapper, for using active objects in Qt classes.
+
+    ActiveWrapperPrivate is a helper class for using active objects 
+    from any Qt class. It derives from CActive and allows other classes to use 
+    it for passing to asynchronous function calls through its RequestStatus method.
+
+    \\sa bluetoothuimodel
+ */
+class ActiveWrapperPrivate : public CActive
+{
+    friend class ActiveWrapper;
+
+public:
+    explicit ActiveWrapperPrivate( ActiveWrapper *parent, int id, int priority );
+    ~ActiveWrapperPrivate();
+
+private:
+    virtual void RunL();
+    virtual void DoCancel();
+    virtual TInt RunError( TInt error );
+
+private:
+    ActiveWrapper *q;
+    int mRequestId;
+};
+
+#endif // ACTIVEWRAPPER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuimodel/btdevicedata.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include "btdevicedata.h"
+
+/*!
+    Constructor.
+ */
+BtDeviceData::BtDeviceData(
+        const QSharedPointer<BtuiModelDataSource> &data,
+        QObject *parent)
+    : QObject( parent ), mData( data ), mBtengConnMan(0)
+{
+    TRAP_IGNORE({
+        mBtengConnMan = CBTEngConnMan::NewL( this );
+        mDeviceRepo = CBtDevRepository::NewL( );
+    });
+    
+    Q_CHECK_PTR( mBtengConnMan );
+    Q_CHECK_PTR( mDeviceRepo );
+}
+
+/*!
+    Destructor.
+ */
+BtDeviceData::~BtDeviceData()
+{
+    delete mBtengConnMan;
+    delete mDeviceRepo;
+}
+
+void BtDeviceData::ConnectComplete( TBTDevAddr& addr, TInt err, 
+        RBTDevAddrArray* conflicts ) 
+{
+    Q_UNUSED( addr );
+    Q_UNUSED( err );
+    Q_UNUSED( conflicts );
+}
+
+void BtDeviceData::DisconnectComplete( TBTDevAddr& addr, TInt err ) 
+{
+    Q_UNUSED( addr );
+    Q_UNUSED( err );
+}
+
+void BtDeviceData::BtDeviceDeleted( const TBTDevAddr& addr ) 
+{
+    Q_UNUSED( addr );
+}
+
+void BtDeviceData::BtDeviceAdded( const CBTDevice& device ) 
+{
+    Q_UNUSED( device );
+}
+
+void BtDeviceData::BtDeviceChanged( const CBTDevice& device, TUint similarity )
+{
+    Q_UNUSED( device );
+    Q_UNUSED( similarity );
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuimodel/btdevicedata.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef BTDEVICEDATA_H
+#define BTDEVICEDATA_H
+
+#include <qglobal.h>
+#include <e32base.h>
+#include <btengconnman.h>
+#include <btservices/btdevrepository.h>
+#include "btuimodel.h"
+
+/*!
+    \class BtDeviceData
+    \brief class for handling local Bluetooth setting updates.
+
+    BtDeviceData class is responsible for providing the latest information
+    regarding the properties of remote devices and the connection status.
+
+    \\sa bluetoothuimodel
+ */
+class BtDeviceData : public QObject,
+                     public MBTEngConnObserver,
+                     public MBtDevRepositoryObserver
+{
+    Q_OBJECT
+
+public:
+    BtDeviceData(
+            const QSharedPointer<BtuiModelDataSource> &data,
+            QObject *parent = 0
+            );
+    
+    virtual ~BtDeviceData();
+    
+private:
+    // from MBTEngConnObserver
+    
+    void ConnectComplete( TBTDevAddr& addr, TInt err, 
+         RBTDevAddrArray* conflicts );
+
+    void DisconnectComplete( TBTDevAddr& addr, TInt err );
+    
+    // From MBtDeviceRepositoryObserver
+    
+    void BtDeviceDeleted( const TBTDevAddr& addr );
+
+    void BtDeviceAdded( const CBTDevice& device );
+    
+    void BtDeviceChanged( const CBTDevice& device, TUint similarity ); 
+    
+public slots:
+    //void activeRequestCompleted( int status, int id );
+
+private:
+
+private:
+    QSharedPointer<BtuiModelDataSource> mData;
+    
+    CBTEngConnMan *mBtengConnMan;
+    
+    CBtDevRepository* mDeviceRepo;
+    
+    Q_DISABLE_COPY(BtDeviceData)
+
+};
+
+#endif // BTLOCALSETTING_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuimodel/btlocalsetting.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,267 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include "btlocalsetting.h"
+#include <btdevice.h>
+//#include <QStringList>
+#include <btmanclient.h>
+#include <bt_subscribe.h>
+//#include <centralrepository.h>
+//#include <coreapplicationuissdkcrkeys.h>
+#include "btqtconstants.h"
+
+const int KLocalDeviceNameWatcher = 10;
+const int KBtLinkCountWatcher = 11;
+
+/*!
+    Constructor.
+ */
+BtLocalSetting::BtLocalSetting( BtuiModel& model, QObject *parent )
+    : QObject( parent ), mModel(model), mLocalDeviceWatcher(0)
+    {
+    int err( 0 );
+    if (!err ) {
+        err = mLocalDeviceKey.Attach( KPropertyUidBluetoothCategory, 
+                    KPropertyKeyBluetoothGetRegistryTableChange );
+    }
+    
+    Q_CHECK_PTR( !err ); // other proper alternative?
+
+    TRAP_IGNORE({
+        mBtengSetting = CBTEngSettings::NewL( this );
+        mLocalDeviceWatcher = CBtSimpleActive::NewL(*this, KLocalDeviceNameWatcher );
+    });
+    
+    Q_CHECK_PTR( mBtengSetting );
+    Q_CHECK_PTR( mLocalDeviceWatcher );
+
+    for ( int i = 0; i < BtuiModel::LocalSettingColCount; ++i ) {
+        // Initialize the list with empty values.
+        mData.append( BtuiModelDataItem() );
+    }
+    
+    // subscribe to local device table change:
+    mLocalDeviceKey.Subscribe( mLocalDeviceWatcher->RequestStatus() );
+    mLocalDeviceWatcher->GoActive();
+    
+    // Get the device name
+    TBTDeviceName  deviceName;
+    (void) mBtengSetting->GetLocalName( deviceName );
+    updateDeviceName( QString::fromUtf16( deviceName.Ptr(), deviceName.Length() ) );
+    
+    // Get the power setting.
+    TBTPowerStateValue power( EBTPowerOff );
+    (void) mBtengSetting->GetPowerState( power );
+    setPowerSetting( power );
+    
+    // Get the visibility mode
+    TBTVisibilityMode visibilityMode( EBTVisibilityModeNoScans );
+    (void) mBtengSetting->GetVisibilityMode( visibilityMode );
+    setVisibilityMode( visibilityMode );
+}
+
+/*!
+    Destructor.
+ */
+BtLocalSetting::~BtLocalSetting()
+{
+    // delete main data structure
+    delete mBtengSetting;
+    delete mLocalDeviceWatcher;
+    mLocalDeviceKey.Close();
+    
+    // delete mBtLinkCountWatcher;
+    //mBtLinkCountKey.Close();
+}
+
+
+bool BtLocalSetting::isValid( int column) const
+{
+    return column < mData.count();
+}
+
+int BtLocalSetting::itemCount() const
+{
+    return mData.count();
+}
+
+void BtLocalSetting::data(QVariant& val, int col, int role ) const
+{
+    if ( isValid( col ) ) {
+        val = mData.at( col ).value( role );
+    }
+    else {
+        val = QVariant( QVariant::Invalid );
+    }
+}
+
+BtuiModelDataItem BtLocalSetting::itemData( int col ) const
+{
+    if ( isValid( col ) ) {
+        return mData.at( col );
+    }
+    return BtuiModelDataItem();
+}
+
+
+/*!
+    Provides notification of changes in the power state
+    of the Bluetooth hardware.
+
+    @param state EBTPowerOff if the BT hardware has been turned off,
+                 EBTPowerOn if it has been turned on.
+ */
+void BtLocalSetting::PowerStateChanged( TBTPowerStateValue state ) 
+{
+    setPowerSetting( state );
+    emit settingDataChanged( BtuiModel::LocalSettingRow, BtuiModel::PowerStateCol, this );
+}
+
+/*!
+    Provides notification of changes in the discoverability
+    mode of the Bluetooth hardware.
+    @param state EBTDiscModeHidden if the BT hardware is in hidden mode,
+                  EBTDiscModeGeneral if it is in visible mode.
+ */
+void BtLocalSetting::VisibilityModeChanged( TBTVisibilityMode state )
+{
+    setVisibilityMode( state );
+    emit settingDataChanged( BtuiModel::LocalSettingRow, BtuiModel::VisibilityCol, this );
+}
+
+void BtLocalSetting::RequestCompletedL( CBtSimpleActive* active, TInt status ) {
+    Q_UNUSED( active );
+    Q_UNUSED( status );
+    if ( active->RequestId() == KLocalDeviceNameWatcher ) {
+        mLocalDeviceKey.Subscribe( mLocalDeviceWatcher->RequestStatus() );
+        mLocalDeviceWatcher->GoActive();
+        updateDeviceName( QString() );
+    }
+}
+
+void BtLocalSetting::CancelRequest( TInt requestId ) {
+    if ( requestId == KLocalDeviceNameWatcher ) {
+        mLocalDeviceKey.Cancel();
+    }
+    else if ( requestId == KBtLinkCountWatcher ) {
+        //mBtLinkCountKey.Cancel();
+    }
+}
+
+void BtLocalSetting::HandleError( CBtSimpleActive* active, TInt error ) {
+    Q_UNUSED( active );
+    Q_UNUSED( error );
+}
+
+/*!
+    Update local Bluetooth device name in the data store.
+    @param name the latest Bluetooth name.
+ */
+void BtLocalSetting::updateDeviceName( const QString &name ) 
+{
+    // To-do: the data structure initialization is not impled yet in the model
+    BtuiModelDataItem& item = 
+            mData[ BtuiModel::BluetoothNameCol ];
+    
+    if ( item.isEmpty() ) {
+        // Initialize with additional information on the setting
+        item[ BtuiModel::SettingIdentity ] = QVariant( tr( "Local Bluetooth name" ) );
+    }
+    
+    bool setByUser = !name.isEmpty();
+    
+    // The additional parameter is the flag indicating whether the 
+    // Bluetooth name has been set by the user.
+    // The flag is set to true if the name has been set.    
+    // requirement does not 
+    //nitem[ BtuiModel::SettingValueParam ] = QVariant( setByUser );
+    
+    QString resolvedName( name );
+    if ( resolvedName.isEmpty() ) {
+        // We get the default name as suggestion for the user to set.
+        getNameFromRegistry( resolvedName );
+    }
+    item[ BtuiModel::settingDisplay ] = QVariant( resolvedName );
+    item[ BtuiModel::SettingValue ] = QVariant( resolvedName );
+}
+
+/*!
+    Updates all values related to the power setting.
+ */
+void BtLocalSetting::setPowerSetting( TBTPowerStateValue state )
+{
+    BtuiModelDataItem& item = 
+            mData[ BtuiModel::PowerStateCol ];
+    if ( item.isEmpty() ) {
+        // Initialize with additional information on the setting
+        item[ BtuiModel::SettingIdentity ] = QVariant( tr( "Bluetooth power" ) );
+    }
+    
+    bool powerOn = ( state == EBTPowerOn );
+
+    item[ BtuiModel::settingDisplay ] = 
+            powerOn ? QVariant( tr( "On" ) ) : QVariant( tr( "Off" ) );
+    item[ BtuiModel::SettingValue ] = QVariant( powerOn );
+}
+
+void BtLocalSetting::setVisibilityMode( TBTVisibilityMode state )
+{
+    BtuiModelDataItem& item = mData[ BtuiModel::VisibilityCol ];
+
+    if ( item.isEmpty() ) {
+        item[ BtuiModel::SettingIdentity ] = QVariant( tr( "Phone visibility" ) );
+    }
+    
+    if ( state == EBTVisibilityModeHidden )
+        {
+        item [ BtuiModel::settingDisplay ] = QVariant( tr( "Hidden" ) );
+        }
+    else if ( state == EBTVisibilityModeGeneral )
+        {
+        item [ BtuiModel::settingDisplay ] = QVariant( tr( "Visible" ) );
+        }
+    else
+        {
+        item [ BtuiModel::settingDisplay ] = QVariant( tr( "Temporarily visible" ) );
+        }
+    item [ BtuiModel::SettingValue ] = QVariant( QtVisibilityMode(state) );
+}
+
+/*!
+    Get local Bluetooth device name from BTRegistry.
+ */
+void BtLocalSetting::getNameFromRegistry( QString &name )
+{
+    RBTRegServ btRegServ;   // Session with BTMan
+    RBTLocalDevice btReg;   // Subsession with local device table
+    TBTLocalDevice localDev;// Data structure holding local device information
+
+    TInt err = btRegServ.Connect();
+    if ( !err ) {
+        err = btReg.Open( btRegServ );
+    }
+    if ( !err ) {
+        // Read the BT local name from BT Registry.
+        err = btReg.Get( localDev );
+    }
+    if ( !err ) {
+        name = QString::fromUtf8( (const char*) localDev.DeviceName().Ptr(), (int) localDev.DeviceName().Length() );
+    }
+    btReg.Close();
+    btRegServ.Close();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuimodel/btlocalsetting.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,116 @@
+/*
+* ============================================================================
+*  Name        : btuimsettings.h
+*  Part of     : BluetoothUI / bluetoothuimodel       *** Info from the SWAD
+*  Description : Declaration of the class representing the Bluetooth
+*                settings source data.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef BTLOCALSETTING_H
+#define BTLOCALSETTING_H
+
+#include <qglobal.h>
+#include <e32base.h>
+#include <e32property.h>
+#include <btengsettings.h>
+#include <btservices/btsimpleactive.h>
+
+#include "btuimodel.h"
+
+/*!
+    \class BtuimSettings
+    \brief class for handling local Bluetooth setting updates.
+
+    BtLocalSetting class is responsible for providing the latest information
+    regarding the local Bluetooth settings such as device name and power state.
+
+    \\sa bluetoothuimodel
+ */
+class BtLocalSetting : public QObject,
+                      public MBTEngSettingsObserver,
+                      public MBtSimpleActiveObserver
+{
+    Q_OBJECT
+
+public:
+    explicit BtLocalSetting( BtuiModel& model, QObject *parent = 0 );
+    
+    virtual ~BtLocalSetting();
+    
+    bool isValid( int col) const;
+    
+    int itemCount() const;
+        
+    void data(QVariant& val, int col, int role ) const;
+    
+    BtuiModelDataItem itemData( int col ) const;
+
+signals:
+
+    void settingDataChanged( int row, int column, void *parent );    
+    
+private:
+    // from MBTEngSettingsObserver
+    
+    void PowerStateChanged( TBTPowerStateValue state );
+    
+    void VisibilityModeChanged( TBTVisibilityMode state );
+    
+    // from MBtSimpleActiveObserver
+    
+    void RequestCompletedL( CBtSimpleActive* active, TInt status );
+
+    void CancelRequest( TInt requestId );
+
+    void HandleError( CBtSimpleActive* active, TInt error );
+    
+
+    
+public slots:
+    //void activeRequestCompleted( int status, int id );
+
+private:
+
+    void setVisibilityMode( TBTVisibilityMode state );
+    void updateDeviceName( const QString &name );
+    
+    void setPowerSetting( TBTPowerStateValue state );
+    
+    //void setOfflineSetting( bool state );
+    //void setBtConnectionsSetting( int connections );
+    
+    void getNameFromRegistry( QString &name );
+
+private:
+    BtuiModelDataSource mData;
+    
+    BtuiModel& mModel;
+    
+    CBTEngSettings *mBtengSetting;
+    
+    // For monitoring local device name change
+    RProperty mLocalDeviceKey;
+    CBtSimpleActive *mLocalDeviceWatcher;
+    
+    //RProperty mBtLinkCountKey;
+    //CBTEngActive *mBtLinkCountWatcher;
+    Q_DISABLE_COPY(BtLocalSetting)
+
+};
+
+#endif // BTLOCALSETTING_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuimodel/btuimodel.cpp	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,138 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include "btuimodel.h"
+#include "btlocalsetting.h"
+
+/*!
+    This Constructor creates new instances of model data structure.
+ */
+BtuiModel::BtuiModel( QObject *parent )
+    : QAbstractItemModel( parent )
+{
+   mLocalSetting = QSharedPointer<BtLocalSetting>( new BtLocalSetting( *this ) );
+   bool b = connect( mLocalSetting.data(), SIGNAL(settingDataChanged(int,int,void*)), this, SLOT(btDataChanged(int,int,void*)));
+   Q_ASSERT( b );
+}
+
+/*!
+    This Constructor shares the instances of model data structure with the
+    given model.
+ */
+BtuiModel::BtuiModel( const BtuiModel &model, QObject *parent )
+    : QAbstractItemModel( parent )
+{
+    mLocalSetting = model.mLocalSetting;
+    bool b = connect( mLocalSetting.data(), SIGNAL(settingDataChanged(int,int,void*)), this, SLOT(btDataChanged(int,int,void*)));
+    Q_ASSERT( b );
+}
+
+/*!
+    Destructor.
+ */
+BtuiModel::~BtuiModel()
+{
+}
+
+/*!
+    \reimp
+ */
+QModelIndex BtuiModel::index( int row, int column, const QModelIndex &parent ) const
+{
+    Q_UNUSED( parent );
+    if ( row == LocalSettingRow
+         && mLocalSetting->isValid( column ) ) {
+        // local setting data:
+        return createIndex( row, column, mLocalSetting.data() );
+        }
+    else if ( row == RemoteDeviceRow ) {
+    
+    }
+    // invalid row and column:
+    return QModelIndex();
+}
+
+/*!
+    \reimp
+ */
+QModelIndex BtuiModel::parent( const QModelIndex &child ) const
+{
+    Q_UNUSED( child );
+    // root level, no parent.
+    return QModelIndex();
+}
+
+/*!
+    \reimp
+ */
+int BtuiModel::rowCount( const QModelIndex &parent ) const
+{
+    Q_UNUSED( parent );
+    return ModelRowCount;
+}
+
+/*!
+    \reimp
+ */
+int BtuiModel::columnCount( const QModelIndex &parent ) const
+{
+    if ( parent.row() == LocalSettingRow 
+         && mLocalSetting->isValid( parent.column() ) ) {
+        // local setting data:
+        return mLocalSetting->itemCount();
+        }
+    else if ( parent.row() == RemoteDeviceRow ) {
+    }
+    return 0;
+}
+
+/*!
+    \reimp
+ */
+QVariant BtuiModel::data( const QModelIndex &index, int role ) const
+{
+    QVariant val( QVariant::Invalid );
+    if ( index.row() == LocalSettingRow ) {
+        mLocalSetting.data()->data( val, index.column(), role );
+        }
+    else if ( index.row() == RemoteDeviceRow ) {
+    }
+    return val;
+}
+
+QMap<int, QVariant> BtuiModel::itemData( const QModelIndex & index ) const
+{
+    if ( index.row() == LocalSettingRow ) {
+        mLocalSetting.data()->itemData( index.column() );
+        }
+    else if ( index.row() == RemoteDeviceRow ) {
+    }
+    return QMap<int, QVariant>();
+}
+
+/*!
+    Slot for receiving notification of changes from the data source.
+    Forward the notification using dataChanged signal.
+ */
+void BtuiModel::btDataChanged( int row, int column, void *parent )
+{
+    (void) parent;
+    QModelIndex idx = createIndex( row, column, parent );
+    emit dataChanged( idx, idx );
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuimodel/btuimodel.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,152 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef BTUIMODEL_H
+#define BTUIMODEL_H
+
+
+#include <qglobal.h>
+#include <QAbstractItemModel>
+#include <QSharedPointer>
+
+class BtLocalSetting;
+class BtDeviceStore;
+
+// A data item in this model. For example, power state item consists 
+// of the information regarding the current Bluetooth power state.
+typedef QMap< int, QVariant > BtuiModelDataItem;
+
+// A category of the model data for specific group
+typedef QList< BtuiModelDataItem > BtuiModelDataSource;
+
+#ifdef BUILD_BTUIMODEL
+#define BTUIMODEL_IMEXPORT Q_DECL_EXPORT
+#else
+#define BTUIMODEL_IMEXPORT Q_DECL_IMPORT
+#endif
+
+/*!
+    \class BtuiModel
+    \brief The data model provided to Bluetooth UIs in QT
+
+    BtuiModel provides APIs for accessing certain BT data, such as local Bluetooth
+    settings and the properties of remote BT devices. In addition, signals from this
+    model are provided for being informed of data update. 
+    
+    This model is in two dimension (2 rows * n columns), i.e.,
+    
+    row 0 (BT local setting)
+          col 0 (local device name)
+          col 1 (power state)
+          ...
+    row 1 (remote devices)
+          col 0 ( a remote device)
+          col 1 ( another device)
+          ...
+    
+    The data in this model is non-modifiable from the user interface (except device
+    search may add a number of in-range devices temporarily) , 
+    determined by the characteristics of Bluetooth, the underline BT software 
+    services and the BT application requirements. 
+    
+    Whenever feasible, the detailed description should contain a simple
+    example code example:
+    \code
+    // ...
+    \endcode
+
+    \sa \link model-view-programming.html Model/View Programming\endlink
+ */
+
+class BTUIMODEL_IMEXPORT BtuiModel : public QAbstractItemModel
+{
+    Q_OBJECT
+    Q_ENUMS( RowId LocalSettingCol LocalSettingDataRole )
+
+public:
+    
+    /**
+     * The parent row identifier of data model. Data in this model is grouped into
+     * two categories: the local Bluetooth settings and the remote device 
+     * database. The data of each category is stored in multiple 
+     * rows of a specified row.
+     */
+    enum RowId {
+        LocalSettingRow = 0,
+        RemoteDeviceRow = 1,
+        ModelRowCount = 2
+    };
+    //Q_DECLARE_FLAGS(Rows, BtuiModelRow)
+
+    /**
+     * child row identifiers of the local setting row
+     */
+    enum LocalSettingCol {
+        BluetoothNameCol = 0,
+        PowerStateCol ,
+        VisibilityCol,
+        SapModeCol,
+        AllowedInOfflineCol,
+        LocalSettingColCount,
+    };
+    //Q_DECLARE_FLAGS(BtuiModelLocalSettings, BtuiModelLocalSettingColumn)
+    
+    /**
+     * Data roles that the items in the local setting row
+     */
+    enum LocalSettingDataRole {
+        SettingIdentity = Qt::WhatsThisRole,
+        settingDisplay = Qt::DisplayRole,
+        SettingValue = Qt::EditRole,
+        SettingValueParam = Qt::UserRole + 1,  // e.g., temp visibility time     
+    };
+
+public:
+    
+    explicit BtuiModel( QObject *parent = 0 );
+    
+    explicit BtuiModel( const BtuiModel &model, QObject *parent = 0 );
+    
+    virtual ~BtuiModel();
+    
+    // from QAbstractItemModel
+    virtual QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const;
+    
+    virtual QModelIndex parent( const QModelIndex &child ) const;
+    
+    virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
+    
+    virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
+    
+    virtual QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const;
+
+    virtual QMap<int, QVariant> itemData( const QModelIndex & index ) const;
+    
+public slots:
+    
+    void btDataChanged(int row, int column, void *parent );
+    
+private:
+    QSharedPointer<BtLocalSetting> mLocalSetting;
+};
+
+//Q_DECLARE_OPERATORS_FOR_FLAGS(BtuiModel::Rows)
+
+Q_DECLARE_METATYPE(BtuiModelDataItem)
+Q_DECLARE_METATYPE(BtuiModelDataSource)
+
+#endif // BTUIMODEL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuimodel/btuimodel.pro	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,61 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+TEMPLATE = lib
+TARGET = btuimodel
+
+MOC_DIR = moc
+DEFINES += BUILD_BTUIMODEL
+
+INCLUDEPATH += . \
+    ../inc
+    
+CONFIG += qt \
+    hb \
+    dll
+    
+HEADERS += btdevicedata.h \
+    btlocalsetting.h \
+    btuimodel.h \
+    activewrapper.h
+SOURCES += btdevicedata.cpp \
+    btlocalsetting.cpp \
+    btuimodel.cpp \
+    activewrapper.cpp
+    
+symbian: { 
+    SYMBIAN_PLATFORMS = WINSCW \
+        ARMV5
+	BLD_INF_RULES.prj_exports += "btuimodel.h |../inc/btuimodel.h"
+	
+    TARGET.EPOCALLOWDLLDATA = 1
+    TARGET.UID3 = 0x2002434F
+    TARGET.CAPABILITY = CAP_GENERAL_DLL
+    
+    INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+    
+    LIBS += -lbtengsettings \
+    	-lbtserviceutil \
+        -lbtdevice \
+        -lbtmanclient \
+        -lesock \
+        -lbluetooth \
+        -lbtengdevman \
+        -lbtengconnman \
+        -lcentralrepository \
+        -lflogger
+    //MMP_RULES -= EXPORTUNFROZEN
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuimodel/btuimodelutil.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,174 @@
+/*
+* ============================================================================
+*  Name        : btuimutil.h
+*  Part of     : BluetoothUI / bluetoothuimodel       *** Info from the SWAD
+*  Description : utilities in the model for some often used functions, 
+*                e.g. conversions between Qt and Symbian types.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef BTUIMODELUTIL_H
+#define BTUIMODELUTIL_H
+
+#include <qglobal.h>
+#include <bt_sock.h>
+
+_LIT(KDefaultBTDevName, "Bluetooth Device" );
+
+/*!
+  Converts a QString which contains a BT device address in readable format to
+  Symbian native TBTDevAddr type.
+ */
+inline void addrReadbleStringToSymbian( const QString &readable, TBTDevAddr &addr)
+{
+    TBuf<KBTDevAddrSize * 2> buffer(readable.utf16());
+    addr.SetReadable( buffer );
+}
+
+/*!
+  Converts a Symbian native TBTDevAddr to 
+  QString which contains the BT device address in readable format.
+ */
+inline void addrSymbianToReadbleString( QString &readable, const TBTDevAddr &addr)
+{
+    TBuf<KBTDevAddrSize * 2> buffer;
+    addr.GetReadable( buffer );
+    readable = QString::fromUtf16( buffer.Ptr(), buffer.Length() );
+}
+
+/*!
+  Decide the device name to display from the device information, and 
+  converts the name if necessary. If the device doesn't have a valid name,
+  the given default name will be used.
+*/
+inline void getDeviceDisplayName( QString& dispName, const CBTDevice& device ,
+    const TDesC& defaultName )
+{
+    // friendly name is preferred if available
+    if( device.IsValidFriendlyName() && device.FriendlyName().Length()){
+        dispName = QString::fromUtf16( 
+                device.FriendlyName().Ptr(), device.FriendlyName().Length() );
+    }
+    // next preferred is actual device name
+    else if( device.IsValidDeviceName() && device.DeviceName().Length() ) {
+        dispName = QString::fromUtf8( 
+                (char*) device.DeviceName().Ptr(), device.DeviceName().Length() );
+    }
+    else {
+        // finally, use default name if nothing else is available
+        dispName = QString::fromUtf16( 
+                defaultName.Ptr(), defaultName.Length() );
+    }
+}
+
+/*!
+  Decide the device name to display from the device information, and 
+  converts the name if necessary. If the device doesn't have a valid name,
+  the given default name will be used.
+*/
+inline void getDeviceDisplayName( QString& dispName, const CBTDevice& device  )
+{
+    getDeviceDisplayName( dispName, device, KDefaultBTDevName );
+}
+
+
+/*!
+  Guess if the given Class of Device indicates an Audio/Video device (headset and carkit)
+  or not.
+  Computer device supporting audio is not considered as AV device.
+*/
+inline bool isAVDevice( const TBTDeviceClass &cod )
+{
+    int majorDevCls = cod.MajorDeviceClass();
+    int minorDevCls = cod.MinorDeviceClass();
+    return ( ( majorDevCls == EMajorDeviceAV ) 
+        || ( cod.MajorServiceClass() == EMajorServiceRendering 
+        && majorDevCls != EMajorDeviceImaging ) );
+}
+
+/*!
+  Guess if the given Class of Device indicates an input device (keyboard and mouse)
+  or not.
+*/
+inline bool isHIDDevice( const TBTDeviceClass &cod )
+{
+    int majorDevCls = cod.MajorDeviceClass();
+    int minorDevCls = cod.MinorDeviceClass();
+    return ( ( majorDevCls == EMajorDevicePeripheral ) &&
+        ( minorDevCls == EMinorDevicePeripheralKeyboard || 
+        minorDevCls == EMinorDevicePeripheralPointer ) );
+}
+
+/*!
+  Tells if the given device has been paired.
+*/
+inline bool isPaired( const CBTDevice &dev )
+{
+    return dev.IsValidPaired() && dev.IsPaired() &&
+        dev.LinkKeyType() != ELinkKeyUnauthenticatedUpgradable;
+}
+
+/*!
+  Tells if the given device supports file transfer.
+*/
+inline bool supportsFileTransfer( const TBTDeviceClass &cod )
+{
+    int majorDevCls = cod.MajorDeviceClass();
+    return ( majorDevCls == EMajorDevicePhone 
+            || majorDevCls == EMajorDeviceComputer ); 
+}
+
+/*! 
+    Tells if the given device is currently connected.
+*/
+inline bool isConnected( CBTEngConnMan &btConnMan, 
+        const TBTDevAddr &addr )
+{
+    TBTEngConnectionStatus connectStatus( EBTEngNotConnected );
+    btConnMan.IsConnected( addr, connectStatus );
+    return connectStatus == EBTEngConnected;
+}
+
+/*! 
+    Tells if the given device is currently connected.
+*/
+inline bool isConnected( CBTEngConnMan &btConnMan, 
+        const CBTDevice &dev )
+{
+    return isConnected( btConnMan, dev.BDAddr() );
+}
+
+/*! 
+    Tells if the given device is connectible with services managed by bteng.
+*/
+inline bool isConnectible( CBTEngConnMan &btConnMan, 
+        const TBTDeviceClass &devClass )
+{
+    TBool connectible( false );
+    btConnMan.IsConnectable( devClass, connectible );
+    return connectible;
+}
+
+/*! 
+    Tells if the given device is connectible with services managed by bteng.
+*/
+inline bool isConnectible( CBTEngConnMan &btConnMan, 
+        const CBTDevice &dev )
+{
+    return isConnectible( btConnMan, dev.DeviceClass() );
+}
+#endif // BTUIMODELUTIL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/bwins/btuidelegateu.def	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,17 @@
+EXPORTS
+	?staticMetaObject@BtAbstractDelegate@@2UQMetaObject@@B @ 1 NONAME ; struct QMetaObject const BtAbstractDelegate::staticMetaObject
+	?qt_metacall@BtAbstractDelegate@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 2 NONAME ; int BtAbstractDelegate::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?newDelegate@BtDelegateFactory@@SAPAVBtAbstractDelegate@@W4Command@BtDelegate@@AAVBtuiModel@@PAVQObject@@@Z @ 3 NONAME ; class BtAbstractDelegate * BtDelegateFactory::newDelegate(enum BtDelegate::Command, class BtuiModel &, class QObject *)
+	??_EBtAbstractDelegate@@UAE@I@Z @ 4 NONAME ; BtAbstractDelegate::~BtAbstractDelegate(unsigned int)
+	??1BtAbstractDelegate@@UAE@XZ @ 5 NONAME ; BtAbstractDelegate::~BtAbstractDelegate(void)
+	?metaObject@BtAbstractDelegate@@UBEPBUQMetaObject@@XZ @ 6 NONAME ; struct QMetaObject const * BtAbstractDelegate::metaObject(void) const
+	?tr@BtAbstractDelegate@@SA?AVQString@@PBD0H@Z @ 7 NONAME ; class QString BtAbstractDelegate::tr(char const *, char const *, int)
+	?commandCompleted@BtAbstractDelegate@@IAEXHVQVariant@@@Z @ 8 NONAME ; void BtAbstractDelegate::commandCompleted(int, class QVariant)
+	?tr@BtAbstractDelegate@@SA?AVQString@@PBD0@Z @ 9 NONAME ; class QString BtAbstractDelegate::tr(char const *, char const *)
+	??0BtAbstractDelegate@@QAE@AAVBtuiModel@@PAVQObject@@@Z @ 10 NONAME ; BtAbstractDelegate::BtAbstractDelegate(class BtuiModel &, class QObject *)
+	?getStaticMetaObject@BtAbstractDelegate@@SAABUQMetaObject@@XZ @ 11 NONAME ; struct QMetaObject const & BtAbstractDelegate::getStaticMetaObject(void)
+	?qt_metacast@BtAbstractDelegate@@UAEPAXPBD@Z @ 12 NONAME ; void * BtAbstractDelegate::qt_metacast(char const *)
+	?model@BtAbstractDelegate@@IAEAAVBtuiModel@@XZ @ 13 NONAME ; class BtuiModel & BtAbstractDelegate::model(void)
+	?trUtf8@BtAbstractDelegate@@SA?AVQString@@PBD0@Z @ 14 NONAME ; class QString BtAbstractDelegate::trUtf8(char const *, char const *)
+	?trUtf8@BtAbstractDelegate@@SA?AVQString@@PBD0H@Z @ 15 NONAME ; class QString BtAbstractDelegate::trUtf8(char const *, char const *, int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/bwins/btuimodelu.def	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,22 @@
+EXPORTS
+	??0BtuiModel@@QAE@PAVQObject@@@Z @ 1 NONAME ; BtuiModel::BtuiModel(class QObject *)
+	?tr@BtuiModel@@SA?AVQString@@PBD0@Z @ 2 NONAME ; class QString BtuiModel::tr(char const *, char const *)
+	?qt_metacall@BtuiModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 3 NONAME ; int BtuiModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?itemData@BtuiModel@@UBE?AV?$QMap@HVQVariant@@@@ABVQModelIndex@@@Z @ 4 NONAME ; class QMap<int, class QVariant> BtuiModel::itemData(class QModelIndex const &) const
+	?qt_metacast@BtuiModel@@UAEPAXPBD@Z @ 5 NONAME ; void * BtuiModel::qt_metacast(char const *)
+	?getStaticMetaObject@BtuiModel@@SAABUQMetaObject@@XZ @ 6 NONAME ; struct QMetaObject const & BtuiModel::getStaticMetaObject(void)
+	??1BtuiModel@@UAE@XZ @ 7 NONAME ; BtuiModel::~BtuiModel(void)
+	?parent@BtuiModel@@UBE?AVQModelIndex@@ABV2@@Z @ 8 NONAME ; class QModelIndex BtuiModel::parent(class QModelIndex const &) const
+	?btDataChanged@BtuiModel@@QAEXHHPAX@Z @ 9 NONAME ; void BtuiModel::btDataChanged(int, int, void *)
+	?trUtf8@BtuiModel@@SA?AVQString@@PBD0@Z @ 10 NONAME ; class QString BtuiModel::trUtf8(char const *, char const *)
+	?metaObject@BtuiModel@@UBEPBUQMetaObject@@XZ @ 11 NONAME ; struct QMetaObject const * BtuiModel::metaObject(void) const
+	?data@BtuiModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 12 NONAME ; class QVariant BtuiModel::data(class QModelIndex const &, int) const
+	?columnCount@BtuiModel@@UBEHABVQModelIndex@@@Z @ 13 NONAME ; int BtuiModel::columnCount(class QModelIndex const &) const
+	??_EBtuiModel@@UAE@I@Z @ 14 NONAME ; BtuiModel::~BtuiModel(unsigned int)
+	?trUtf8@BtuiModel@@SA?AVQString@@PBD0H@Z @ 15 NONAME ; class QString BtuiModel::trUtf8(char const *, char const *, int)
+	?index@BtuiModel@@UBE?AVQModelIndex@@HHABV2@@Z @ 16 NONAME ; class QModelIndex BtuiModel::index(int, int, class QModelIndex const &) const
+	?staticMetaObject@BtuiModel@@2UQMetaObject@@B @ 17 NONAME ; struct QMetaObject const BtuiModel::staticMetaObject
+	??0BtuiModel@@QAE@ABV0@PAVQObject@@@Z @ 18 NONAME ; BtuiModel::BtuiModel(class BtuiModel const &, class QObject *)
+	?rowCount@BtuiModel@@UBEHABVQModelIndex@@@Z @ 19 NONAME ; int BtuiModel::rowCount(class QModelIndex const &) const
+	?tr@BtuiModel@@SA?AVQString@@PBD0H@Z @ 20 NONAME ; class QString BtuiModel::tr(char const *, char const *, int)
+
--- a/bluetoothengine/btui/data/BTUI.rss	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, 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 BTUI.
-*
-*/
-
-
-#include <data_caging_paths_strings.hrh>
-
-//  RESOURCE IDENTIFIER
-
-NAME    BTUI          // 4 letter ID
-
-//  INCLUDES
-#include <eikon.rh>
-#include "btui.hrh"   // Enums for these resources
-#include <btui.loc>   // Localisation file
-#include <btui.mbg>   // Icon indexes created by abld
-#include "eikon.rsg"
-#include <avkon.rsg>
-#include <avkon.rh>
-#include <appinfo.rh>
-
-//  MACROS
-
-//  RESOURCE DEFINITIONS
-
-RESOURCE RSS_SIGNATURE { }
-
-RESOURCE TBUF { buf="BTUI"; }
-
-RESOURCE EIK_APP_INFO
-    {
-    status_pane = r_btui_status_pane;
-    }
-
-//----------------------------------------------------
-//
-//  Hotkeys for BTUI
-//
-//----------------------------------------------------
-//
-RESOURCE HOTKEYS r_btui_hotkeys
-    {
-    control=
-        {
-        HOTKEY { command=EAknCmdExit; key='e'; }
-        };
-    }
-
-//----------------------------------------------------
-//
-//  The status pane for BTUI application
-//
-//----------------------------------------------------
-//
-RESOURCE STATUS_PANE_APP_MODEL r_btui_status_pane
-    {
-    panes =
-        {
-        SPANE_PANE
-            {
-            id       = EEikStatusPaneUidNavi;
-            type     = EAknCtNaviPane;
-            resource = r_btui_navi_decorator;
-            }
-        };
-    }
-
-//----------------------------------------------------
-//
-//  The navi decorator for BTUI application
-//  Defines application views tabs
-//
-//----------------------------------------------------
-//
-RESOURCE NAVI_DECORATOR r_btui_navi_decorator
-    {
-    type    = ENaviDecoratorControlTabGroup;
-    control = TAB_GROUP
-        {
-        tab_width = EAknTabWidthWithThreeTabs;
-        active    = 0;  // Initial tab to be active
-        tabs =
-            {
-            TAB
-                {
-                id      = EBTUIMainViewTab;
-                bmpfile = btui_bitmap_file_data_caging;
-                bmpid   = EMbmBtuiQgn_prop_bt_set_tab3;
-                bmpmask = EMbmBtuiQgn_prop_bt_set_tab3_mask;
-                },
-            TAB
-                {
-                id      = EBTUIPairedDevicesViewTab;
-                bmpfile = btui_bitmap_file_data_caging;
-                bmpid   = EMbmBtuiQgn_prop_bt_devices_tab3;
-                bmpmask = EMbmBtuiQgn_prop_bt_devices_tab3_mask;
-                },
-
-            TAB
-                {
-                id      = EBTUIBlockedDevicesViewTab;
-                bmpfile = btui_bitmap_file_data_caging;
-                bmpid   = EMbmBtuiQgn_prop_bt_blocked_tab3;
-                bmpmask = EMbmBtuiQgn_prop_bt_blocked_tab3_mask;
-                }
-            };
-        };
-    }
-
-
-
-//----------------------------------------------------
-//
-// 	LOCALISABLE_APP_INFO
-//
-//----------------------------------------------------
-
-
-RESOURCE LOCALISABLE_APP_INFO r_btui_localisable_app_info
-    {
-    short_caption = qtn_apps_bluetooth_grid;
-    caption_and_icon = 
-    CAPTION_AND_ICON_INFO
-        {
-        caption = qtn_apps_bluetooth_list;
-		#ifdef __SCALABLE_ICONS
-			number_of_icons = 1;
-        	icon_file = APP_BITMAP_DIR"\\Btui_aif.mif";			
-		#else
-			number_of_icons = 2;
-        	icon_file = APP_BITMAP_DIR"\\Btui_aif.mbm";
-		#endif
-        };
-    }
-
-
-
--- a/bluetoothengine/btui/data/Btui_reg.rss	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
-* 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:  
-*
-*/
-
-
-#include <appinfo.rh>
-#include <BTUI.rsg>
-#include <data_caging_paths_strings.hrh>
-
-UID2 KUidAppRegistrationResourceFile
-UID3 0x10005951 
-
-RESOURCE APP_REGISTRATION_INFO
-    {
-    app_file = "Btui";
-	localisable_resource_file = APP_RESOURCE_DIR"\\btui";
-	localisable_resource_id = R_BTUI_LOCALISABLE_APP_INFO;
-    }
-
-
--- a/bluetoothengine/btui/devmodel/BWINS/btdevmodelU.DEF	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-EXPORTS
-	??0TBTDevice@@QAE@XZ @ 1 NONAME ; TBTDevice::TBTDevice(void)
-	?IsAnyDeviceConnected@CBTDevModel@@QAEHXZ @ 2 NONAME ; int CBTDevModel::IsAnyDeviceConnected(void)
-	?CancelChange@CBTDevModel@@QAEXABVTBTDevice@@@Z @ 3 NONAME ; void CBTDevModel::CancelChange(class TBTDevice const &)
-	?ReverseCompareAphabetically@TBTDeviceComparison@@SAHABVTBTDevice@@0@Z @ 4 NONAME ; int TBTDeviceComparison::ReverseCompareAphabetically(class TBTDevice const &, class TBTDevice const &)
-	?ChangeDevice@CBTDevModel@@QAEXPBVCBTDevice@@PAV?$TPckgBuf@VTNameRecord@@@@W4TBTDeviceOp@@@Z @ 5 NONAME ; void CBTDevModel::ChangeDevice(class CBTDevice const *, class TPckgBuf<class TNameRecord> *, enum TBTDeviceOp)
-	?DeviceChangeInProgress@CBTDevModel@@QAEHXZ @ 6 NONAME ; int CBTDevModel::DeviceChangeInProgress(void)
-	??0TBTDevice@@QAE@ABV0@@Z @ 7 NONAME ; TBTDevice::TBTDevice(class TBTDevice const &)
-	?CreateDeviceL@CBTDevModel@@QAEPAVTBTDevice@@PBVCBTDevice@@PAV?$TPckgBuf@VTNameRecord@@@@@Z @ 8 NONAME ; class TBTDevice * CBTDevModel::CreateDeviceL(class CBTDevice const *, class TPckgBuf<class TNameRecord> *)
-	?ChangeDevice@CBTDevModel@@QAEXABVTBTDevice@@@Z @ 9 NONAME ; void CBTDevModel::ChangeDevice(class TBTDevice const &)
-	??4TBTDevice@@QAEAAV0@ABV0@@Z @ 10 NONAME ; class TBTDevice & TBTDevice::operator=(class TBTDevice const &)
-	?ChangeAllDevices@CBTDevModel@@QAEXW4TBTDeviceOp@@@Z @ 11 NONAME ; void CBTDevModel::ChangeAllDevices(enum TBTDeviceOp)
-	?GetDevice@CBTDevModel@@QAEHAAVTBTDevice@@@Z @ 12 NONAME ; int CBTDevModel::GetDevice(class TBTDevice &)
-	?NewL@CBTDevModel@@SAPAV1@W4TBTDeviceGroup@@PAVMBTDeviceObserver@@PAV?$TLinearOrder@VTBTDevice@@@@@Z @ 13 NONAME ; class CBTDevModel * CBTDevModel::NewL(enum TBTDeviceGroup, class MBTDeviceObserver *, class TLinearOrder<class TBTDevice> *)
-	?CompareAphabetically@TBTDeviceComparison@@SAHABVTBTDevice@@0@Z @ 14 NONAME ; int TBTDeviceComparison::CompareAphabetically(class TBTDevice const &, class TBTDevice const &)
-
--- a/bluetoothengine/btui/devmodel/eabi/btdevmodelu.DEF	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-EXPORTS
-	_ZN11CBTDevModel12CancelChangeERK9TBTDevice @ 1 NONAME
-	_ZN11CBTDevModel12ChangeDeviceEPK9CBTDeviceP8TPckgBufI11TNameRecordE11TBTDeviceOp @ 2 NONAME
-	_ZN11CBTDevModel12ChangeDeviceERK9TBTDevice @ 3 NONAME
-	_ZN11CBTDevModel13CreateDeviceLEPK9CBTDeviceP8TPckgBufI11TNameRecordE @ 4 NONAME
-	_ZN11CBTDevModel16ChangeAllDevicesE11TBTDeviceOp @ 5 NONAME
-	_ZN11CBTDevModel20IsAnyDeviceConnectedEv @ 6 NONAME
-	_ZN11CBTDevModel22DeviceChangeInProgressEv @ 7 NONAME
-	_ZN11CBTDevModel4NewLE14TBTDeviceGroupP17MBTDeviceObserverP12TLinearOrderI9TBTDeviceE @ 8 NONAME
-	_ZN11CBTDevModel9GetDeviceER9TBTDevice @ 9 NONAME
-	_ZN19TBTDeviceComparison20CompareAphabeticallyERK9TBTDeviceS2_ @ 10 NONAME
-	_ZN19TBTDeviceComparison27ReverseCompareAphabeticallyERK9TBTDeviceS2_ @ 11 NONAME
-	_ZN9TBTDeviceC1ERKS_ @ 12 NONAME
-	_ZN9TBTDeviceC1Ev @ 13 NONAME
-	_ZN9TBTDeviceC2ERKS_ @ 14 NONAME
-	_ZN9TBTDeviceC2Ev @ 15 NONAME
-	_ZN9TBTDeviceaSERKS_ @ 16 NONAME
-
--- a/bluetoothengine/btui/devmodel/group/bld.inf	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 btdevmodel
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-../inc/btdevmodel.h                 |../../../inc/btdevmodel.h
-PRJ_MMPFILES
-btdevmodel.mmp
-
-PRJ_TESTMMPFILES
-
-PRJ_TESTEXPORTS
--- a/bluetoothengine/btui/devmodel/group/btdevmodel.mmp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 btdevmodel
-*
-*/
-
-
-
-#include <platform_paths.hrh>
-#include <data_caging_paths.hrh>
-
-TARGET                  btdevmodel.dll
-TARGETTYPE              DLL
-UID                     0x10009D8D 0x1020745E
-
-CAPABILITY          CAP_GENERAL_DLL NetworkControl
-VENDORID                VID_DEFAULT
-
-SOURCEPATH              ../src
-SOURCE                  btdevmodel.cpp
-SOURCE                  btdevmodelbase.cpp
-SOURCE                  btpairedmodel.cpp
-SOURCE                  btblockedmodel.cpp
-SOURCE                  btregistryobserver.cpp
-SOURCE			btdevice.cpp
-
-USERINCLUDE             ../inc
-USERINCLUDE             ../../inc
-SYSTEMINCLUDE           ../../../inc
-MW_LAYER_SYSTEMINCLUDE
-
-LIBRARY                 euser.lib //CActive, TDes
-LIBRARY         		btengsettings.lib
-LIBRARY                 btengdevman.lib
-LIBRARY                 btengconnman.lib
-LIBRARY                 btmanclient.lib //TBTRegistrySearch,CBluetoothPhysicalLinks
-LIBRARY                 bluetooth.lib //TBTDevAddr
-LIBRARY                 btdevice.lib
-LIBRARY                 centralrepository.lib
-LIBRARY					esock.lib //btpairedmodel
-DEBUGLIBRARY            flogger.lib
--- a/bluetoothengine/btui/devmodel/inc/btblockedmodel.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
-* 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:   Maintains a Bluetooth devices data model for blocked devices view.
-*
-*/
-
-#ifndef BTBLOCKEDMODEL_H
-#define BTBLOCKEDMODEL_H
-
-#include "btdevmodelbase.h"
-/**
-* This is a adds funtionality to show only blocked devices to BTDevModelBase.
-*
-* It act as a mediator between UI applications and Bluetooth Engine Device Management API.
-*
-*@lib btdevmodel.dll
-*@since S60 V3.2
-*/
-NONSHARABLE_CLASS(CBTBlockedModel) : public CBTDevModelBase
-    {
-public: // Constructors and destructor
-	/** NewL function 
-	 * @param aObserver The observer will receive information about command completes and
-	 * changes in the devices.
-	 * @param aOrder The order the devices are sorted. Default order is added by CBTDevMan, so
-	 * this class can assume this parameter to be used. This class is responsible for deleting this parameter on
-	 * its destructor.
-	 */
-    static CBTBlockedModel* NewL(MBTDeviceObserver* aObserver , 
-                                 TBTDeviceSortOrder* aOrder  );
-    /** Destructor
-     */
-    virtual ~CBTBlockedModel();       
-
-    /** Add new device to the list, but only if the device is blocked.
-     * This function will filter out those devices that are not blocked.
-     *@param aRegdevice the device to be added to the list
-     */
-    void HandleNewDeviceL(const CBTDevice* aRegDevice,
-            TNameEntry* aNameEntry);
-
-private:
-	/** Constructor
-	 * @param aObserver The observer will receive information about command completes and
-	 * changes in the devices.
-	 * @param aOrder The order the devices are sorted. Default order is added by CBTDevMan, so
-	 * this class can assume this parameter to be used. This class is responsible for deleting this parameter on
-	 * its destructor.	
-	 */
-    CBTBlockedModel(MBTDeviceObserver* aObserver , 
-                     TBTDeviceSortOrder* aOrder  );
-    /** Symbian 2nd phase constuctor that may leave.
-     *@param None.
-     * @return None.
-     */
-    void ConstructL();
-    
-    
-    };
-    
-#endif 
-
--- a/bluetoothengine/btui/devmodel/inc/btdevmodel.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,304 +0,0 @@
-/*
-* 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:   Maintain a Bluetooth devices data model for UI components.
-*
-*/
-
-#ifndef BTDEVMODEL_H
-#define BTDEVMODEL_H
-
-#include <e32base.h>     
-#include <btmanclient.h>
-#include <btdevice.h>
-#include <e32cmn.h>
-  
-// used to support different device list of UI
-enum TBTDeviceGroup
-    {
-    EGroupPaired, // for paired device list
-    EGroupBlocked // for blocked device list
-    };
-    
-// for showing left side icon of a device in device list. Based on CoD major device
-enum TBTDeviceType
-    {
-    EDeviceComputer = 0,// computer
-    EDevicePhone,		// mobile phone
-    EDeviceAudio, 		// headset or loudspeakers    
-    EDeviceCarkit, 		// audio-caraudio
-    EDevicePrinter, 	// imaging-printer
-    EDeviceKeyboard,	// peripheral-keyboard
-    EDeviceMice, 		// peripheral-pointer
-    EDeviceGPS, 		// major service positioning
-    EDeviceDefault,		// device of other type than define above.
-    };
-
-// for showing right side icon of a device on a device list    
-enum TBTDeviceStatus
-    {
-    EStatusTrusted = 0x0001,	 		// show authorised icon on both paired and blocked lists
-    EStatusBtuiConnected = 0x0002,  	// show connected icon on paired list
-    EStatusBlocked = 0x0004, 			// show device on blocked list
-    EStatusPaired = 0x0008, 			// show the device in paired devices list
-    EStatusConnectable = 0x0010, 		// The device can be connected to.
-    									// NOTE: connected devices are also connectable,
-    									// despite they cannot be connected before disconnect.
-	EStatusPhysicallyConnected = 0x0020  // Physical bluetooth connection. 
-    };
-    
-enum TBTDeviceOp
-    {
-    EOpPair,	
-    EOpUnpair,	
-    EOpBlock,	
-    EOpUnblock, 
-    EOpConnect, 
-    EOpDisconnect,
-    EOpTrust,
-    EOpUntrust,
-    EOpChangeName,
-    EOpNone,
-    EOPInternalUntust // used by CBTDevModel internally
-    };
-    
-/* TBTDevAddr that is not address of any device
-*/    
-#define KNullAddress TBTDevAddr(TInt64(0))
-   
-// contain all device info needed for shown on a device list
-NONSHARABLE_CLASS( TBTDevice )
-    {
-public:
-	/** Constructor, that initialized this as empty*/
-    IMPORT_C TBTDevice();
-    /** Copy constructor */
-    IMPORT_C TBTDevice(const TBTDevice& aDevice);
-    /** Copy  */
-    IMPORT_C TBTDevice& operator=(const TBTDevice& aDevice);
-    
-    TBTDeviceType iType; 				// left side icon
-    TBTDeviceClass iDeviceClass; 		// this is needed by connect
-    TBTDeviceName iName; 				// a formated friendly/device name in corresponding CBTDevice
-    TBTDeviceName iFriendlyName;        // still need to remember if friendly name has been set   
-    TUint iStatus; 						// mask of TDeviceStatus
-    TBTDeviceOp iOperation; 			// last operation on the device
-    TBTDevAddr iAddr; 					// bt device address
-    TInt iIndex; 						// new position of the device in the device list. 
-                 						// Default value means iAddr should be used instead.
-    TBTLinkKeyType iLinkKeyType;
-    TNameEntry iNameEntry; // the device's EIR data
-    };   
-/** Static methods for TBTDeviceComparison. These are meant to be given to TBTDeviceSortOrder and
-* to be used for defining sort orders.
-*/
-class TBTDeviceComparison
-	{
-public:
-	/** 
-	* Compare function for alphabetic sorting order.
-	* @param aFirstDevice to be compared
-	* @param aSecondDevice sencond device to be compared
-	* @return 1 if aFirstDevice is before aSecondDevice -1 otherwise. May not return 0,
-	* on devices that are not the same.
-	*/
-		
-	IMPORT_C static TInt CompareAphabetically(
-		const TBTDevice& aFirstDevice, const TBTDevice& aSecondDevice) ;
-		
-	/** 
-	* Compare function for reverse alphabetic sorting order.
-	* @param aFirstDevice to be compared
-	* @param aSecondDevice sencond device to be compared
-	* @return 1 if aFirstDevice is before aSecondDevice -1 otherwise. May not return 0,
-	* on devices that are not the same.
-	*/	
-	IMPORT_C static TInt ReverseCompareAphabetically(
-	 	const TBTDevice& aFirstDevice, const TBTDevice& aSecondDevice) ;
-	};
-	     
-typedef RPointerArray<TBTDevice> RDeviceArray; 
-typedef RPointerArray<TBTDeviceName> RBTDevNameArray; 
-typedef TLinearOrder<TBTDevice> TBTDeviceSortOrder ;
-
-class CBTDevModelBase;
-
-/**
-* Callback interface for informing about the changes in the devices shown by the listening view.
-* Also a callback interface that informs the listener when the issued commands have been completed.
-*/
-class MBTDeviceObserver
-    {
-public: 
-    /** 
-    * Informs the observer that ChangeDevice command has been completed.
-    *
-    * The listener must not change the displaid devices, since RefreshDeviceList is used for that purpose.
-    * Also this will not be called, if changes happen from outside such as pairing initiated by 3rd party
-    * of blocking from notifier.
-    *
-    * @param aErr Symbian error code, KErrNone if no error.
-    * @param aDevice the device which is changed. This has allways given to the listener by RefreshDeviceList 
-    * prior this call, if that device is visible at the listening view. This not passed by refrence,
-    * since this device could change, if registry is changed
-    * @param aDevNameArray hold conflicting devices' short names if "AlreadyExist" error happened during "connect"
-    * @return None.
-    */
-    virtual void NotifyChangeDeviceComplete(const TInt aErr, const TBTDevice& aDevice, 
-        const RBTDevNameArray* aDevNameArray = NULL) = 0;
-	
-	/** 
-	 * This is used to notify the listening graphic component that the deviceList is changed.
-	 * After receiving this call the graphic component has to redraw its screen to match this list.
-	 * @param aDevices The devices to be displaid. 
-	 * @param aSelectedItemIndex The index of the item to be selected in the given devices.
-	 */
-	virtual void RefreshDeviceList(const RDeviceArray* aDevices,TInt aSelectedItemIndex) =0;
-	
-	/** 
-	* This is used before calling RefreshDeviceList to save the currently selected index,
-	* so that the same device could be selected after the refresh, if that device still exists.
-	* @param None.
-	* @return the selected device. KErrNotFound if the view has no devices.
-	*/
-	virtual TInt CurrentItemIndex() =0;
-    };
-
-/**
-* This is a abstract class providing basic common fucntions for derived classes.
-* It act as a facade between UI applications and Bluetooth Engine Device Management API.
-*/
-NONSHARABLE_CLASS( CBTDevModel ) : public CBase
-    {
-public: // Constructors and destructor
-    /**
-    * Constructs devmodel.
-    * @param aGroup. do you wish to list other or blocked devices.
-    * @param MBTDeviceObserver The object that will receive the notifications for command completes,
-    * @param the order the devices are sorted in the list. If you do not give this the devices
-    * will be sorted in ascending alphabetic order. Devices with same name are sorted according to
-    * bluetooth addreses. DevModel will take the ownership of this object.
-    */    
-    IMPORT_C static CBTDevModel* NewL(const TBTDeviceGroup aGroup,
-                                      MBTDeviceObserver* aObserver=NULL, 
-                                      TBTDeviceSortOrder* aOrder=NULL);
-    /** Destructor */
-    virtual ~CBTDevModel();       
-
-public: // New functions
-
-   /**
-    * Get device based on addr or index.
-    * @param aDevice the TBTDevice holder. The device address is passed in
-    * @return KErrNone if ok.
-    * KErrArgument, if neither index not address is filled.
-    * KErrOverFlow if index is out of range. 
-    * KErrNotFound if the given address does not exists, in the internal array.
-    */
-    IMPORT_C TInt GetDevice(TBTDevice& aDevice);
-    
-	/** 
-	* Checks if any of the devices shown in view have active bluetooth connection.
-	* @return ETrue, if one or more devices are connected. EFalse if no devices are connected.
-	* This also return EFalse, in case of blocked devices.
-	*/
-	IMPORT_C TBool IsAnyDeviceConnected();
-	
-    /** 
-    * Creates and allocates TBTDevice representation of this device.
-    * The caller is responsibe for the garbage connection of the created device.
-    * @param aRegDevice the device to be converted
-    * @return the TBTDevice representation of the same device
-    */
-    IMPORT_C TBTDevice* CreateDeviceL(const CBTDevice* aRegDevice,
-            TNameEntry* aNameEntry); 
-           
-    /**
-    * Change status of all devices on the list, e.g. used by unpair all and unblock all commands.
-    * @param aOperation unpair/unblock
-    * @return None.
-    */
-    IMPORT_C void ChangeAllDevices(const TBTDeviceOp aOperation);
-    
-    /**
-    * Change device status, add device, e.g. pair/block, or delete device,e.g. unpair/unblcok
-    * You must not pair device without properly filling deviceName.
-    * @param aDevice the TBTDevice holder. The device address is passed in
-    * @return None
-    */
-    IMPORT_C void ChangeDevice(const TBTDevice& aDevice);
-    
-    /**
-    * Change device status, add device, e.g. pair/block, or delete device,e.g. unpair/unblcok
-    * @param aDevice the CBTDevice holder.
-    * @return None.
-    */
-  	IMPORT_C void ChangeDevice(const CBTDevice* aDevice,
-  	      TNameEntry* aNameEntry,
-  	        TBTDeviceOp aOp) ;
-  	
-    /**
-    * Cancel ongoing operation, such as connecting or pairing.
-    * At the moment btui does not support other Other operations than pairing and connecting cannot be canceled.
-    *
-    * @param aDevice the device, whose command is to be canceled.   
-    * @return None.
-    */
-    IMPORT_C void CancelChange(const TBTDevice& aDevice);
-
-	/** 
-	*Checks if there are ChangeDeviceCommands that are not finnished.
-	*/
-	IMPORT_C TBool DeviceChangeInProgress();
-	
-	
-private:
-	/** constructor */
-    CBTDevModel();
-    
-    /** Symbian 2nd phase constuctor that may leave.
-     * @param aGroup EGroupPaired and EGroupBlocked are supported.
-     * @param aObserver the observer of the device list. This is not mandatory
-     * @param aOrder The order the devices are sorted
-     */
-    void ConstructL(const TBTDeviceGroup aGroup,
-                    MBTDeviceObserver* aObserver,
-					TBTDeviceSortOrder* aOrder );
-private:
-	
-    CBTDevModelBase* iDevModel; // CBTDevModelPaired or CBTDevModel Blocked 
-    TBTDeviceGroup iGroup;
-    };    
-	
-     
-/** Adds flags to iStatus of TBTDevice.
- *@param aStatus the status of the device
- *@param aFlags the flags to be set
- */
-inline TUint SetStatusFlags(TUint& aStatus,TBTDeviceStatus aFlags)
-	{
-		aStatus |=aFlags;
-		return aStatus;
-	}
-/** Clear status flags to iStatus of TBTDevice.
- *@param aStatus the status of the device
- *@param aFlags the flags to be set
- */	
-inline TUint UnsetStatusFlags(TUint& aStatus,TBTDeviceStatus aFlags)
-	{
-		aStatus &= ~aFlags;
-		return aStatus;
-	}
-
-#endif     
-
--- a/bluetoothengine/btui/devmodel/inc/btdevmodelbase.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,286 +0,0 @@
-/*
-* 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:  Abstract base class for concete models.
-*
-*/
-
-
-#ifndef BTDEVMODELBASE_H
-#define BTDEVMODELBASE_H
-
-#include <btengdevman.h>       // for MBTEngDevManObserver
-
-#include "btdevmodel.h"
-#include "btregistryobserver.h" // for MBTRegistryObserver
-
-/**
-* This is a abstract class providing basic common fucntions for derived classes.
-* It act as a mediator between UI applications and Bluetooth Engine Device Management API.
-*
-*@lib btdevmodel.dll
-*@since S60 V3.2
-*/
-NONSHARABLE_CLASS( CBTDevModelBase ): public CBase, public MBTEngDevManObserver, public MBTRegistryObserver
-    {
-public: // Constructors and destructor
-    /** destructor 
-    *@param none.
-    *@return none.
-    */
-    virtual ~CBTDevModelBase();       
-public: 
-
-	/** Checks if any of the devices shown in view have active bluetooth connection.
-	 * This baseclass does not support connections, so the answer is allways EFalse.
-	 *
-	 * NOTE: TBTUIViewsCommonUtils::IsAnyDeviceConnectedL will report also those devices
-	 * that are not part of particular view, such as paired devices.
-	 * CBTPairedModel::IsAnyDeviceConnected reports only connection from paired devices.
-	 *
-	 *@return ETrue, if one or more devices are connected. EFalse if no devices are connected.
-	 */
-	TBool virtual IsAnyDeviceConnected();
-    /**
-    * Get device based on addr or index.
-    * @param aDevice the TBTDevice holder. You have to set either the deviceAddress or the
-    * or the device index. If you specify both the device address and the index then the address is used,
-    * this includes those cases when there is no device corresponding the address.
-    * @return KErrNone if ok. 
-    * KErrArgument, if neither index not address is filled.
-    * KErrOverFlow if index is out of range. which means it is negative or the internal array does not have that
-    * many items.
-    * KErrNotFound if the given address does not exists, in the internal array.
-    */
-    TInt virtual GetDevice(TBTDevice& aDevice);
-       
-    /**
-    * Change status of all devices on the list. This is used by Delete All operations in paired devices view
-    * (EOpPair) and Blocked devices view(EOpUnblock)
-    *
-    * This creates multiple operations in the intergal queue that are all executed on by one.
-    *
-    * @param aOperation unpair/unblock
-    * @return None.
-    */
-    void ChangeAllDevices(const TBTDeviceOp aOperation);
-
-    /**
-    * Change device status, add device, e.g. block, unpair,unblock etc.
-    *
-    * The operation is put to queue and executed when the prior operations
-    * of the queue are finnished. Immeadiately if the queue is empty.
-    *
-    * @param aDevice. The device and the type of the change. If the address is empty, then the 
-    * device index means what device is to be used.
-    * @return none
-    */
-    virtual void ChangeDeviceL(const TBTDevice& aDevice);
-    
-    /**
-    * Change device status, add device, e.g. block, unpair,unblock etc.
-    * This will check for leaves and make a callback, if leave occurs.
-    *
-    * The operation is put to queue and executed when the prior operations
-    * of the queue are finnished. Immeadiately if the queue is empty.
-    *
-    * @param aDevice. The device and the type of the change. If the address is empty, then the 
-    * device index means what device is to be used.
-    * @return none
-    */
-    
-    virtual void ChangeDevice(const TBTDevice& aDevice);
-    
-    /**
-    * Cancel connecting, pairing, modifying device in BTRegistry
-    *
-    * Cancels ongoing operation or operation from queue, if it has not been started yet.
-    * Cancels it, if it is being executed. Used by Canceling Connecting and pairing operations.
-    *
-    * @param aDevice. The device and the type of the change that will be canceled. 
-    * If the address is empty, then the 
-    * device index means what device is to be used.
-    * @return None.
-    */
-    virtual void CancelChange(const TBTDevice& aDevice);
-    
-    /** Creates and allocates TBTDevice representation of this device
-     *@param aRegDevice the device to be converted,
-     *@param aNameEntry contains the EIR data of the device if its data is valid
-     *@return the TBTDevice representation of the same device. (Note the caller is responsible for deleting
-     * the returned item.)
-     */
-    virtual TBTDevice* CreateDeviceL(const CBTDevice* aRegDevice, 
-            TNameEntry* aNameEntry);    
-    
-	/** Checks if there are any ChangeDeviceCommands that are not finnished.
-	 *@return ETrue if the are one or more commands being executed or are in the execution queue.
-	 */
-	virtual TBool DeviceChangeInProgress();
-	
-	/** This is used to make callback to iObserver, when a leave has been detected.
-	*It will also clean up the partial operation.
-	*
-	*@param aErr the leave error code
-	*@param aDevice The device and operation that cause the leave.
-	* If this is inserted in the queue, it is deleted from there.
-	* If the leave occurred before inserting it to execution queue 
-	* (not common), then it will not deleted from there.
-	*@return none.
-	*/
-	virtual void HandleLeave(TInt aErr,const TBTDevice* aDevice );
-
-protected:
-    /**
-    * Change device status, add device, e.g. block, unpair,unblock etc.
-    *
-    * This is the operation that is used to to execute the operation queued by ChangeDevice.
-    *
-    * @param aDevice. The device and the type of the change. If the address is empty, then the 
-    * device index means what device is to be used.
-    * @return KerrNone or system wide error code.
-    */
-    virtual TInt DoChangeDeviceL(const TBTDevice& aDevice);    
-    
-    /**
-    * Cancel ongoing connecting, pairing, modifying device in BTRegistry
-    *
-    * This is the operation that is used to cancel ongoing operation.
-    *
-    * @param aDevice. The device and the type of the change that will be canceled. 
-    * If the address is empty, then the 
-    * device index means what device is to be used.
-    * @return None.
-    */   
-    virtual void DoCancelChangeL(const TBTDevice& aDevice);
-
-	/** This function recounts the indexes of iDeviceArray.
-	 *@return none.
-	 */
-	void RenumberDeviceArray();
-
-	/** Constructor 
-	 * @param aObserver The observer will receive information about command completes and
-	 * changes in the devices.
-	 * @param aOrder The order the devices are sorted. Default order is added by CBTDevMan, so
-	 * this class can assume this parameter to be used. This class is responsible for deleting this parameter on
-	 * its destructor.
-	 */
-    CBTDevModelBase(MBTDeviceObserver* aObserver,
-                    TBTDeviceSortOrder* aOrder );
-
-	/** Get the index for a device specified by bluetooth device address.
-	 *
-	 *@param aAddr the address of the searched device or KNullAddres.
-	 *@param aIndexIfNullAddress, if this parameter is defined this function 
-	 *returns this index instead of KErrNotFound, it the device has nullAddress.
-	 *@return index of the address. If the given address is KNullAddress then returns aIndexIfNullAddress or KErrNotFound if one is not specified by called.
-	 *This will allways return KErrNone if the given address is not a KNullAddress  and is not found.	 
-	 */
-    TInt GetIndexByAddress(const TBTDevAddr aAddr,TInt aIndexIfNullAddress=KErrNotFound);
-	    
-    /** Adds the TBTDevice representation of this device to iDeviceArray, if
-     * this device is of that type (paired/blocked) that this model supports.
-     * If the device is not that type, it will not be added.
-     *
-     * NOTE: This function is not guaranteed againt duplicates, so multiple
-     * additions of the same device will lead to multiple copies of it.
-     *
-     * Subclasses can also implement their version of this function to add information
-     * to the device objects, such as connection information.
-     *
-     * @param aRegDevice the device to be added (if not filtered).
-     * @param aNameEntry contains the EIR data of the device if its data is valid
-     * @aOperation the operation that this device will contain when added.
-     */
-    void AddDeviceL(const CBTDevice* aRegDevice, 
-            TNameEntry* aNameEntry,
-            const TBTDeviceOp aOperation=EOpNone);
-        
-    /** Replaces iDeviceArray contents with the given devices 
-     *@param aDeviceArray the devices that will be added to internal structures.
-     */
-    virtual void CreateDevicesL(const CBTDeviceArray* aDeviceArray);
-    
-    /** Adds the given device to internal structures of this class
-     * using AddDeviceL, if the device is such that it should not be listed by this
-     * class, then it is not added.
-     *
-     * Implementing is used to filter out devices that are not handled by particular view.
-     * 
-     * @param aNameEntry contains the EIR data of the device if its data is valid
-     */
-    virtual void HandleNewDeviceL(const CBTDevice* aRegDevice,
-            TNameEntry* aNameEntry) = 0;
-	
-	/** Sends refresh of list of shown devices to listener.
-	 *
-	 * @param aErr If this is not KErrNone, then this function
-	 * will send refresh to the listener. Allways send, if not specified. 
-	 * If this funtion is not KEerrNone, then the funtion does nothing.	
-	 * @param aSelectedItem. If this is specified, then select this item.
-	 * if not specified uses the same item that the listener used to have active.
-	 */
-	virtual void SendRefreshIfNoError(TInt aErr=KErrNone,TInt aSelectedItem = KErrNotSupported );
-	 
-protected:
-
-    /** This callback is used to to notify this call from completed changed from iDevMan.
-    * Inherited from MBTEngDevManObserver.
-    *
-    * This funtion will trap any leave if they may occur and report them as errors in the
-    * corresponfing device change operarion.
-    */
-    void HandleDevManComplete(TInt aErr); 
-        
-    /** Inherited from BTEng's MBTEngDevManObserver, and implemented as empty,    
-    * because we do ask devicelists directly from iDevman, but trough iRegistryObserver->Refresh()
-    */
-    void HandleGetDevicesComplete(TInt aErr, CBTDeviceArray* aDeviceArray); 
-
-    /** This callback is used by iRegistryObserver to notify device changes, that
-     * originate both from changes of the BTRegistry as well as refreshes requested
-     * by this class. 
-     * @aDeviceArray the devices that the registry observer gets.
-     */
-    void RegistryChangedL(const CBTDeviceArray* aDeviceArray);
-
-	/** Check if there is allready one or more devices with this name.
-	 *@return ETrue if there is.
-	 */
-    TBool IsNameExisting(const TDesC& aName);
-    
-    /** Executes the next one in the queue, if any.
-    * Leaves are trapped by this class and send as failed commands to iObserver
-    * using HandleLeave.
-	*@param none.
-	*@return none.
-    */
-	void HandleQueue();    
-		
-protected: // Data
-    MBTDeviceObserver* iObserver;	// the listener of the completed commands and registry changes.
-    CBTEngDevMan* iDevMan;			// This is used to change the devices.
-    TBTDeviceSortOrder* iSortOrder;	// The order the devices are sorted to.    				
-    RDeviceArray iDeviceArray;		// The list of current devices.
-    CBTRegistryObserver* iRegistryObserver;	// This takes care of sending the devicelist to us each time 
-    										// something may have been changes.
-    TBTRegistrySearch iSearchPattern; // the pattern iRegistrySearch uses in retrieving devicelist.
-    								  // NOTE: HandleDeviceL is used to filter the results.
-    TBool iIsChangeAll;    
-    TBTDevice* iDevice;				 // the currently changed device, if any
-    RDeviceArray iQueue;			// The queue of commands to be executed
-    };
-  
-#endif // BT_DEV_MODEL_BASE_H
-
--- a/bluetoothengine/btui/devmodel/inc/btpairedmodel.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,282 +0,0 @@
-/*
-* 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:  The model that is used to list and handle all paired devices.
-*
-*/
-
-
-#ifndef BTPAIREDMODEL_H
-#define BTPAIREDMODEL_H
-
-#include "btdevmodelbase.h"
-#include <btengconnman.h>
-#include <bt_sock.h> 				// for TBTDevAddr
-#include <btserversdkcrkeys.h> 		//for TBTPowerStateValue
-#include <btengconstants.h>
-#include <btengsettings.h>
-
-enum TPairedModelState
-	{
-	EIdleState=0,
-	EDeleteDeviceState,
-	EAddDeviceState,
-	EPairDeviceState,
-	EDisconnectBeforeOperationState,	
-	};
-class CBTEngSettings;
-
-/**
-* This is a adds pairing and connecting functionality to BTDevModelBase.
-*
-* It act as a mediator between UI applications and Bluetooth Engine Device Management API.
-*
-*@lib btdevmodel.dll
-*@since S60 V3.2
-*/	
-NONSHARABLE_CLASS(CBTPairedModel) :
-		public CBTDevModelBase, public MBTEngConnObserver, 
-		public MBluetoothPhysicalLinksNotifier,
-		public MBTEngSettingsObserver
-    {
-    
-public: // Constructors and destructor
-
-	/**
-    * C++ default constructor.
-    */
-	CBTPairedModel(MBTDeviceObserver* aObserver, 
-                  TBTDeviceSortOrder* aOrder  );
-                  
-    /** Symbian 2nd phase constuctor that may leave.
-    *@param None.
-    *@return None.
-    */
-    void ConstructL();
-
-	/** 
-	* NewL function 
-	* @param aObserver The observer will receive information about command completes and
-	* changes in the devices.
-	* @param aOrder The order the devices are sorted. Default order is added by CBTDevMan, so
-	* this class can assume this parameter to be used. This class is responsible for deleting this parameter on
-	* its destructor.
-	*/
-    static CBTPairedModel* NewL(MBTDeviceObserver* aObserver,
-                                TBTDeviceSortOrder* aOrder  );
-    
-    /** 
-    * Destructor
-    * @param None.
-    */
-    virtual ~CBTPairedModel();       
-
-	/** 
-	* Checks if any of the devices shown in paired devices view have active bluetooth connection.
-    *
-	* NOTE: TBTUIViewsCommonUtils::IsAnyDeviceConnectedL will also check
-	* those devices that are not paired.
-	*
-	*@return ETrue, if one or more devices are connected. EFalse if no devices are connected.
-	*/
-	TBool virtual IsAnyDeviceConnected();
-	
-	/** 
-	* Start new device pairing. This is handled by Queue, like
-	* all other device changes. 
-	*
-	* This is used by CBTDevice::ChangeDevice(CBTDevice* ,EOpPair)
-	*
-	* @param aPairingDevice the device to be paired.
-	* @return KErrInUse, if another operation has be queued and not finnished. KErrNone otherwise.
-	*/
-	TInt PairDeviceL(const CBTDevice* aPairingDevice,
-	        TNameEntry* aNameEntry);
-	
-protected:
-
-    /**
-	* Change device status, add device, e.g. block, unpair,unblock etc.
-    *
-    * This is the operation that is used to to execute the operation queued by ChangeDevice.
-    *
-    * This class will add connection releted operations to CBTDevModelBase::DoChangeDevice.
-    *
-    * @param aDevice. The device and the type of the change. If the address is empty, then the 
-    * device index means what device is to be used.
-    * @return KerrNone or system wide error code.
-    */
-    TInt DoChangeDeviceL(const TBTDevice& aDevice);
-
-    /**
-    * Cancel ongoing connecting, pairing, modifying device in BTRegistry
-    *
-    * This is the operation that is used to cancel ongoing operation.
-    *
-    * @param aDevice. The device and the type of the change that will be canceled. 
-    * If the address is empty, then the 
-    * device index means what device is to be used.
-    * @return None.
-    */    
-    void DoCancelChangeL(const TBTDevice& aDevice);
-
-    /** 
-    * These two methods set the EStatusPhysicallyConnected attribute to 
-    * the devices that have active connection.
-    */
-    void FlagPhysicallyConnectedDevices(RDeviceArray &aDevices);
-    void FlagPhysicallyConnectedDevices(TBTDevice& aDevice, RBTDevAddrArray& aBTDeviceArray);
-
-	
-private:
-			
-	/** 
-	* Start the actual pairing of iPairingDevice
-	* This is called by DoChangeDevice, if the operation is pairing.
-	*@param none.
-	*@return none.
-	*/
-	void DoPairDeviceL();
-
-	/** 
-	* BTEngConnMan will call this when the connecting is finnished.
-	* This is called as callback not only for connections initiated by this class,
-	* but also for all BT Engines supported porofile connections, including those
-	* initiated by remote devices.
-	* @param aAddr The address of the device whose connection attempt has been finnished.
-	* @param aErr KErrNone if connection is succesfull, Otherwise system wide error code.
-	* @param aConflicts The conflicting devices in case of unsuccesfull connection attempt if any.
-	* @return none.
-	*/    
-    void ConnectComplete(TBTDevAddr& aAddr, TInt aErr, RBTDevAddrArray* aConflicts = NULL);
-
-	/** 
-	* BTEngConnMan will call this when the disconnecting is finnished.
-	* This is called as callback not only for disconnections initiated by this class,
-	* but also for disconnection of BT Engines supported porofile connections, including those
-	* initiated by remote devices.
-	* @param aAddr The address of the device whose connection attempt has been finnished.
-	* @param aErr KErrNone if disconnection is succesfull, Otherwise system wide error code.
-	* @return none.
-	*/    
-	void DisconnectComplete(TBTDevAddr& aAddr, TInt aErr);
-    
-	/**
-	*  from BTEng's MBTEngConnObserver
-	*/
-    void PairingComplete(TBTDevAddr& aAddr, TInt aErr);
-    
-    /** 
-    * The leaving version of PairingComplete. Internally called by PairingComplete
-    */
-    void PairingCompleteL(TBTDevAddr& aAddr, TInt aErr);
-
-    /** 
-    * Creates and allocates TBTDevice representation of this device
-    *
-    * This class will add the connection status information to 
-    * to CBTDevModelBase::CreateDevice.
-    *
-    * @param aRegDevice the device to be converted
-    * @return the TBTDevice representation of the same device. (Note the caller is responsible for deleting
-    * the returned item.)
-    */    
-    TBTDevice* CreateDeviceL(const CBTDevice* aRegDevice, TNameEntry* aNameEntry);
-    
-    /** 
-    * Adds the given device to internal structures of this class
-    * using AddDeviceL, if it is paired and not blocked.
-    *
-    * @param aRegDevice
-    */    
-    void HandleNewDeviceL(const CBTDevice* aRegDevice,
-            TNameEntry* aNameEntry);
-
-    /** 
-    * This callback is used to to notify this call from completed changed from iDevMan.
-    * Inherited from MBTEngDevManObserver.    
-    *
-    * This funtion will trap any leave if they may occur and report them as errors in the
-    * corresponfing device change operarion.
-    *
-    * @param aErr KErrNone or system wide error code.
-    */
-    void HandleDevManComplete(TInt aErr);
-    
-public: 
-    
-    /**
-     * From MBTEngSettingsObserver - Called when powerstate is changed
-     * @param TBTPowerStateValue power state
-     * @return None
-     */       
-	void PowerStateChanged( TBTPowerStateValue aState );
-		
-    /**
-     * From MBTEngSettingsObserver - Called when visibility is changed
-     * @param TBTPowerStateValue state of visibility mode
-     * @return None
-     */    		
-	void VisibilityModeChanged( TBTVisibilityMode aState );  
-    
-    
-public:    //from MBluetoothPhysicalLinksNotifier
-
-	/** 
-	* Inherited from MBluetoothPhysicalLinksNotifier and implemented empty
-	*/
-	void HandleCreateConnectionCompleteL(TInt ) {};
-	
-	/** 
-	* Disconnect from non BTEng device by iLinks is complete.
-	*@param aErr KErrNone or system wide errorcode.
-	*/	
-	void HandleDisconnectCompleteL(TInt aErr) ;
-	
-	/** Inherited from MBluetoothPhysicalLinksNotifier and not used.
-	*/
-	void HandleDisconnectAllCompleteL(TInt aErr) {HandleDisconnectCompleteL(aErr); }
-
-    /**
-    * Get device based on addr or index.
-    * @param aDevice the TBTDevice holder. The device address is passed in
-    * @return KErrNone if ok.
-    * KErrArgument, if neither index not address is filled.
-    * KErrOverFlow if index is out of range. 
-    * KErrNotFound if the given address does not exists, in the internal array.
-    */
-    TInt virtual GetDevice(TBTDevice& aDevice);
-
-	/** 
-	* This is used to make callback to iObserver, when a leave has been detected.
-	*
-	*@param aErr the leave error code
-	*@param aDevice The device and operation that cause the leave.
-	*/
-	virtual void HandleLeave(TInt aErr,const TBTDevice* aDevice );               
-	
-private:
-
-    CBTEngConnMan* iConnMan;
-    CBTDevice* iPairingDevice;	
-
-    TBTDevice* iDisconnectDevice;
-    TPairedModelState iState;	// The device is deleted and written back to bt registry before pairing
-    							// this is used to control those operations
-	//used for disconnecting connections not managed by BTEngine    							
-	CBluetoothPhysicalLinks *iLinks;   							
-	RSocketServ iSocketServ;
-	CBTEngSettings *iBtEngSettings; // used for turning on BT, if not enabled
-    };
-    
-#endif
--- a/bluetoothengine/btui/devmodel/inc/btregistryobserver.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-/*
-* 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:  Registry observer is listening to registry changes and
-* 				  and reporting the changed devices to the listener.
-*
-*/
-
-#ifndef BTREGISTRYOBSERVER_H
-#define BTREGISTRYOBSERVER_H
-
-#include <e32base.h>
-#include <e32property.h>
-#include <btmanclient.h>
-#include <btengdevman.h> 
-
-/** This class will inform the listener about the new BTregistry status
-*after registry change events. 
-*
-* This class will listen to events about registry changes and inform
-* the listener about the latest registry status. The listener can
-* also ask the status using refresh. This is usefull for for
-* for example retrieval of initial lists of devices. 
-*
-*@lib btdevmodel.dll
-*@since S60 V3.2
-*/
-NONSHARABLE_CLASS(MBTRegistryObserver)
-    {
-public:
-	/** The aDeviceArray constents are deleted after this
-	* call returns. If storage is wanted the array and its contents
-	* must be copied by implementor.
-	*/
-    virtual void RegistryChangedL(const CBTDeviceArray* aDeviceArray) = 0;
-    };
-    
-NONSHARABLE_CLASS(CBTRegistryObserver) : public CActive, public MBTEngDevManObserver
-    {
-public: 
-	/** NewL
-	 *@param aObserver The class that is listening to registry changes
-	 *@param aPattern The pattern to be used to retrieve the changed objects.
-	 */
-    static CBTRegistryObserver* NewL(MBTRegistryObserver* aObserver, 
-        const TBTRegistrySearch aPattern);
-    
-    /** Destructor*/
-    virtual ~CBTRegistryObserver();       
-
-	/** Start listening to registry changes. 
-	 *
-	 *Calling this while registry observer is running is silently ignored.
-	 */
-    void StartIfNotRunning();
-
-    /* Registry observer will retrieve list of devices in the backround 
-     * and send it to the listener, when one is retrieved.
-     */
-    void Refresh();
-    
-    /** Check if this is running.       
-     *@return ETrue if not listening to registry changes.
-     */
-    inline TBool IsStopped() {return iIsStopped;}
-
-    /** This will stop listening and cancel any retrieval of devicelists,
-    * if any.
-    * @param none.
-    * @return none.
-    */
-    void Cancel();    
-private:
-	/* Constructor that may not leave.
-	 *@param aObserver The class that is listening to registry changes
-	 *@param aPattern The pattern to be used to retrieve the changed objects.
-	 */
-    CBTRegistryObserver(MBTRegistryObserver* aObserver, const TBTRegistrySearch aPattern);
-	/** 2nd phase constructor. Called by NewL only.
-    * @param none.
-    * @return none.	
-	 */
-    void ConstructL();
-
-	/** This is called when registry changes occur, but not when deviceLists are
-	* retrieved, since HandleGetDevicesComplete is called then. 
-	*
-	* If one or more registry events occur during devicelist retrieval, there
-	* will be one new devicelist retrieval after the current retrieval is done.
-	*
-    * @param none.
-    * @return none.
-	*/
-    void RunL();
-    
-    /** This will clear iRegDeviceArray and delete its contents.
-    * @param none.
-    * @return none.     
-    */
-    void DeleteAllocatedDevices();
-    
-    
-    /** This will cancel listening. To be called by Cancel only.
-     * @param none.
-     * @return none.
-	 */
-    void DoCancel();    
-    
-	/** This is called when devicelist have been read from BtDevMan 
-	* @param aErr KErrNone or the accurred error.
-	* @param aDeviceArray the devices that have been retrieved.
-    * @return none.
-    */
-    void HandleGetDevicesComplete(TInt aErr, CBTDeviceArray* aDeviceArray);
-    
-private:
-    MBTRegistryObserver* iObserver; // the class listening to this class
-    CBTDeviceArray* iRegDeviceArray;  // this is used for retrieving devices
-    TBTRegistrySearch iSearchPattern; // the search used to retrieve devices
-    								 // NOTE: this class does not filter the results,
-    								 // but the one listening to this (if filtering is done).
-    RProperty iProperty;
-    CBTEngDevMan* iDevMan;			// the object that is used to retrieve the device lists.
-    TBool iIsStopped;				// is this runining.
-    TBool iAnotherEventPending;		// Has there been one or more changes during this retrieval.
-    								// if this is true then HandleGetDevices will start a new search.
-    };
-    
-#endif 
--- a/bluetoothengine/btui/devmodel/src/btblockedmodel.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
-* 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:  Maintain a Bluetooth devices data model for Blocked devices view.
-*
-*/
-
-
-// INCLUDE FILES
-#include "btblockedmodel.h"
-#include "debug.h"
-
-// ---------------------------------------------------------------------
-// constructor
-// ----------------------------------------------------------------------        
-CBTBlockedModel::CBTBlockedModel(MBTDeviceObserver* aObserver,TBTDeviceSortOrder* aOrder )
-    : CBTDevModelBase(aObserver, aOrder)
-    {
-    TRACE_FUNC
-    }
-// ---------------------------------------------------------------------
-// CBTBlockedModel::NewL
-// ----------------------------------------------------------------------        
-CBTBlockedModel* CBTBlockedModel::NewL(MBTDeviceObserver* aObserver, TBTDeviceSortOrder* aOrder )
-    {
-    CBTBlockedModel* self = new (ELeave) CBTBlockedModel(aObserver, aOrder);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-// ---------------------------------------------------------------------
-// destructor
-// ----------------------------------------------------------------------        
-CBTBlockedModel::~CBTBlockedModel() 
-    {    
-    TRACE_FUNC
-    }
-// ---------------------------------------------------------------------
-// CBTBlockedModel::ConstructL
-// ----------------------------------------------------------------------        
-void CBTBlockedModel::ConstructL()
-    {
-    TRACE_FUNC_ENTRY
-    // get all devices from btregistry to iDeviceArray - a TBTDevice array 
-    iDevMan = CBTEngDevMan::NewL(this);
-    iSearchPattern.FindAll();
-   	iRegistryObserver = CBTRegistryObserver::NewL(this, iSearchPattern);
-	iRegistryObserver->Refresh();
-    TRACE_FUNC_EXIT
-    }
-// ---------------------------------------------------------------------
-// CBTBlockedModel::HandleNewDeviceL
-// from CBTDevModel
-// ----------------------------------------------------------------------    
-void CBTBlockedModel::HandleNewDeviceL(const CBTDevice* aRegDevice,
-        TNameEntry* aNameEntry)
-    {
-    TRACE_FUNC_ENTRY
-    TBTDeviceSecurity security = aRegDevice->GlobalSecurity();
-    if (security.Banned())
-        {
-        AddDeviceL(aRegDevice, aNameEntry, EOpBlock);
-        }
-    TRACE_FUNC_EXIT        
-    }
-
--- a/bluetoothengine/btui/devmodel/src/btdevice.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
-* 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 is used by BTUI to contain the information on a displaid device.
-*
-*/
-
-#include "btdevmodel.h"
-// ---------------------------------------------------------------------
-// Default Constructor
-// ---------------------------------------------------------------------
-EXPORT_C TBTDevice::TBTDevice()
-    {
-    iType = EDeviceDefault;
-    iName = KNullDesC;
-    iFriendlyName = KNullDesC;
-    iStatus = 0;
-    iOperation = EOpNone;
-    iAddr = KNullAddress;
-    iIndex = KErrNotFound;    
-    iDeviceClass=TBTDeviceClass(0);
-    iLinkKeyType = ELinkKeyCombination;
-    iNameEntry() = TNameRecord();
-    }
-// ---------------------------------------------------------------------
-// Copy Constructor
-// ---------------------------------------------------------------------    
-EXPORT_C TBTDevice::TBTDevice(const TBTDevice& aDevice) 
-    {
-    iType = aDevice.iType;
-    iName = aDevice.iName;
-    iFriendlyName = aDevice.iFriendlyName;
-    iStatus = aDevice.iStatus;
-    iOperation = aDevice.iOperation;
-    iAddr = aDevice.iAddr;
-    iIndex = aDevice.iIndex;
-    iDeviceClass= aDevice.iDeviceClass;
-    iLinkKeyType = aDevice.iLinkKeyType;
-    iNameEntry() = TNameRecord();
-    }
-// ---------------------------------------------------------------------
-// operator=
-// ---------------------------------------------------------------------    
-EXPORT_C TBTDevice& TBTDevice::operator=(const TBTDevice& aDevice)
-    {
-    iType = aDevice.iType;
-    iName = aDevice.iName;
-    iFriendlyName = aDevice.iFriendlyName;
-    iStatus = aDevice.iStatus;
-    iOperation = aDevice.iOperation;
-    iAddr = aDevice.iAddr;
-    iIndex = aDevice.iIndex;
-    iDeviceClass= aDevice.iDeviceClass;    
-    iLinkKeyType = aDevice.iLinkKeyType;
-    iNameEntry = aDevice.iNameEntry;
-	return *this;
-    } 
-// End of File
--- a/bluetoothengine/btui/devmodel/src/btdevmodel.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,230 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Maintain a Bluetooth devices data model for UI components.
-*
-*/
-
-// INCLUDE FILES
-#include <e32cmn.h>
-#include "btdevmodel.h"
-#include "btpairedmodel.h"
-#include "btblockedmodel.h"
-#include "debug.h"
-
-// --------------------------------------------------------------------------------------------
-// CBTDevModel::CBTDevModel
-// --------------------------------------------------------------------------------------------                            
-CBTDevModel::CBTDevModel()
-    {
-    }
-// --------------------------------------------------------------------------------------------
-// CBTDevModel::NewL
-// --------------------------------------------------------------------------------------------                            
-EXPORT_C CBTDevModel* CBTDevModel::NewL(const TBTDeviceGroup aGroup,
-                                        MBTDeviceObserver* aObserver,
-                                        TBTDeviceSortOrder* aOrder 
-                                         )
-    {
-    CBTDevModel* self = new (ELeave) CBTDevModel();
-    CleanupStack::PushL(self);
-    
-    TBTDeviceSortOrder *order=NULL;    
-    if(aOrder == NULL)
-    	{
-    	order=new(ELeave) TBTDeviceSortOrder(TBTDeviceComparison::CompareAphabetically);    	
-    	// Order ownership goes to btdevmodel - don't push it to stack
-    	self->ConstructL(aGroup, aObserver, order);
-    	}    	
-    else
-		{
-    	order=aOrder;		
-		self->ConstructL(aGroup, aObserver, order);    	
-		}        
-    CleanupStack::Pop(self);
-    return self;
-    }    
-// --------------------------------------------------------------------------------------------
-// CBTDevModel::~CBTDevModel
-//
-// Destructor
-// --------------------------------------------------------------------------------------------
-
-CBTDevModel::~CBTDevModel()
-    {
-	TRACE_FUNC_ENTRY
-    delete iDevModel;
-    }
-// --------------------------------------------------------------------------------------------
-// CBTDevModel::ConstructL
-//
-// Constructs CBTPairedModel or CBTBlockedModel, depending on aGroup
-// --------------------------------------------------------------------------------------------                                
-void CBTDevModel::ConstructL(const TBTDeviceGroup aGroup,
-                             MBTDeviceObserver* aObserver,
-                             TBTDeviceSortOrder* aOrder  )
-    { 
-	TRACE_FUNC_ENTRY    
-    iGroup=aGroup;
-    switch (aGroup)
-        {
-        case EGroupPaired:
-            iDevModel = CBTPairedModel::NewL(aObserver, aOrder);
-            break;
-        
-        case EGroupBlocked:
-            iDevModel = CBTBlockedModel::NewL(aObserver, aOrder);
-            break;
-        default:
-            break;
-        }
-	TRACE_FUNC_EXIT
-    }
-
-EXPORT_C TBool CBTDevModel::IsAnyDeviceConnected()
-	{
-	return iDevModel->IsAnyDeviceConnected();
-	}
-// --------------------------------------------------------------------------------------------
-// CBTDevModel::GetDevice
-// wrapper function
-// --------------------------------------------------------------------------------------------                                
-EXPORT_C TInt CBTDevModel::GetDevice(TBTDevice& aDevice)
-    {
-    return iDevModel->GetDevice(aDevice);
-    }
-// --------------------------------------------------------------------------------------------
-// CBTDevModel::CreateDevice 
-// wrapper function
-// --------------------------------------------------------------------------------------------                                
-EXPORT_C TBTDevice* CBTDevModel::CreateDeviceL(const CBTDevice* aRegDevice, 
-        TNameEntry* aNameEntry)
-	{
-		return iDevModel->CreateDeviceL(aRegDevice, aNameEntry);
-	}
-
-// --------------------------------------------------------------------------------------------
-// CBTDevModel::GetDeviceType
-// wrapper function
-// --------------------------------------------------------------------------------------------                                    
-EXPORT_C void CBTDevModel::ChangeAllDevices(const TBTDeviceOp aOperation)
-    {
-    iDevModel->ChangeAllDevices(aOperation);
-    }
-// --------------------------------------------------------------------------------------------
-// CBTDevModel::ChangeDevice
-// wrapper function
-// --------------------------------------------------------------------------------------------    
-EXPORT_C void CBTDevModel::ChangeDevice(const TBTDevice& aDevice)
-    {
-    iDevModel->ChangeDevice(aDevice);    
-    }
-// --------------------------------------------------------------------------------------------
-// CBTDevModel::ChangeDevice
-// --------------------------------------------------------------------------------------------       
-EXPORT_C void CBTDevModel::ChangeDevice(const CBTDevice* aDevice,
-        TNameEntry* aNameEntry, TBTDeviceOp aOp)
-    {
-    	TRACE_FUNC_ENTRY
-		TBTDevice *tmp=NULL;      	
-    	TInt err = KErrNone;
-		if(aOp == EOpPair)
-    		{
-    		if(iGroup !=EGroupPaired )
-    			{
-    			err = KErrNotSupported;
-    			}
-    		else
-    			{
-    			TInt err2 = KErrNone;
-    			TRAP(err, err2 = static_cast<CBTPairedModel*>(iDevModel)->PairDeviceL( aDevice, aNameEntry));
-    			err = (err2 != KErrNone) ? err2 : err;
-    			}
-    		}
-		else 
-			{
-			TRAP(err, tmp=iDevModel->CreateDeviceL(aDevice, aNameEntry ));
-			if(err == KErrNone)
-				{
-				tmp->iOperation=aOp;
-				iDevModel->ChangeDevice(*tmp );
-				}
-			}
-		if(err != KErrNone)
-		    {
-		    iDevModel->HandleLeave(err,tmp);
-		    }
-    	TRACE_FUNC_EXIT
-    }        
-// --------------------------------------------------------------------------------------------
-// CBTDevModel::CancelChange
-// wrapper function
-// --------------------------------------------------------------------------------------------        
-EXPORT_C void CBTDevModel::CancelChange(const TBTDevice& aDevice)
-    {
-    iDevModel->CancelChange(aDevice);
-    }
-
-// --------------------------------------------------------------------------------------------
-// CBTDevModel::DeviceChangeInProgress
-// wrapper function
-// --------------------------------------------------------------------------------------------        
-EXPORT_C TBool CBTDevModel::DeviceChangeInProgress()
-	{
-	return iDevModel->DeviceChangeInProgress();
-	}
-// --------------------------------------------------------------------------------------------
-// TBTDeviceComparison::CompareAphabetically
-// --------------------------------------------------------------------------------------------
-EXPORT_C TInt TBTDeviceComparison::CompareAphabetically(
-	  const TBTDevice& aFirstDevice, const TBTDevice& aSecondDevice) 
-	{  	
-	// This funtion is used when sorting devicelists, so the tracing has been omnitted
-	// in order decreas the amount of trash in the logs.
-	TInt rvalue= aFirstDevice.iName.CompareC(aSecondDevice.iName);
-	if(rvalue !=0)
-		{
-		return rvalue;
-		}		
-	if( aFirstDevice.iAddr <= aSecondDevice.iAddr )
-		{
-		return  -1;
-		}			
-	else
-		{
-		return 1;			
-		}		
-	}
-
-// --------------------------------------------------------------------------------------------
-// TBTDeviceComparison::ReverseCompareAphabetically
-// --------------------------------------------------------------------------------------------	
-EXPORT_C TInt TBTDeviceComparison::ReverseCompareAphabetically(
-        const TBTDevice& aFirstDevice, const TBTDevice& aSecondDevice) 
-	{  	
-	// This funtion is used when sorting devicelists, so the tracing has been omnitted
-	// in order decreas the amount of trash in the logs.
-	TInt rvalue= aSecondDevice.iName.CompareC(aFirstDevice.iName);
-	if(rvalue !=0)
-		{
-		return rvalue;
-		}		
-	if(aFirstDevice.iAddr <= aSecondDevice.iAddr )
-		{
-		return 1;
-		}			
-	else
-		{
-		return -1;			
-		}		
-	}    
--- a/bluetoothengine/btui/devmodel/src/btdevmodelbase.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,807 +0,0 @@
-/*
-* 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:  Maintain a Bluetooth devices data model for UI components.
-*
-*/
-
-#include "btdevice.h"
-#include "btdevmodelbase.h"
-#include <btengutil.h>
-#include "debug.h"
-#include "btui.h"
-#include "btregistryobserver.h"
-
-// --------------------------------------------------------------------------------------------
-// 1st phaze constructor
-// --------------------------------------------------------------------------------------------
-CBTDevModelBase::CBTDevModelBase(MBTDeviceObserver* aObserver, TBTDeviceSortOrder* aOrder)
-    : iObserver(aObserver)
-    {
-	TRACE_FUNC_ENTRY
-	iSortOrder=aOrder;
-    TRACE_FUNC_EXIT    
-	
-    }
-
-// --------------------------------------------------------------------------------------------
-// Destructor
-// --------------------------------------------------------------------------------------------
-CBTDevModelBase::~CBTDevModelBase()
-    {
-    TRACE_FUNC_ENTRY
-    delete iRegistryObserver;
-
-    for(TInt i=0;i<iDeviceArray.Count();i++)
-    	delete iDeviceArray[i];    
-	iDeviceArray.Close();
-	delete iDevice;
-	iDevice=NULL;
-
-    for(TInt i=0;i<iQueue.Count();i++)
-    	delete iQueue[i];    
-	iQueue.Close();
-	
-	if(iDevMan)
-		iDevMan->Cancel();
-    delete iDevMan;
-    
-    delete iSortOrder;
-    TRACE_FUNC_EXIT        
-    }
-// --------------------------------------------------------------------------------------------
-// CBTDevModelBase::IsAnyDeviceConnected
-// Allways false, since base class does not support connection
-// --------------------------------------------------------------------------------------------    
-
-TBool CBTDevModelBase::IsAnyDeviceConnected()
-    {
-    TRACE_FUNC_ENTRY
-    return EFalse;
-   
-    }
-    
-// --------------------------------------------------------------------------------------------
-// CBTDevModelBase::GetDevice
-// --------------------------------------------------------------------------------------------    
-TInt CBTDevModelBase::GetDevice(TBTDevice& aDevice)	
-    {
-    TRACE_FUNC_ENTRY
-	TBTDeviceOp op=aDevice.iOperation;
-
-    TInt index = GetIndexByAddress(aDevice.iAddr,aDevice.iIndex); 
-
-    if (index < 0 )
-        {
-        if(aDevice.iAddr == KNullAddress )
-        	{
-        	return KErrArgument;
-        	} 
-        else
-       		{
-			return KErrNotFound ;
-       		} 
-        }
-    if(index >= iDeviceArray.Count())
-    	return KErrOverflow;
-            
-    aDevice=*iDeviceArray[index];
-    aDevice.iOperation=op;
-    TRACE_FUNC_EXIT        
-    return KErrNone;
-    }
-// --------------------------------------------------------------------------------------------
-// CBTDevModelBase::ChangeAllDevices
-// --------------------------------------------------------------------------------------------        
-void CBTDevModelBase::ChangeAllDevices(const TBTDeviceOp aOperation)
-    {
-    TRACE_FUNC_ENTRY
-    TInt count = iDeviceArray.Count();  
-    
-    for (TInt i = 0; i < count; i++)
-        {        
-        //TBTDevice device;
-        //device=iDeviceArray[i];
-        //device.iIndex = i;
-        //device.iOperation = aOperation;
-        //ChangeDevice(device);
-        iDeviceArray[i]->iIndex = i;
-        iDeviceArray[i]->iOperation = aOperation;
-        ChangeDevice(*iDeviceArray[i]);        
-        }        
-    TRACE_FUNC_EXIT    
-    }
-
-// --------------------------------------------------------------------------------------------
-// CBTDevModelBase::GetIndexByAddress
-//
-// returns the index of the address, if one is not null address.
-// if it is give aNullAdressIndex
-// --------------------------------------------------------------------------------------------
-TInt CBTDevModelBase::GetIndexByAddress(TBTDevAddr aAddr,TInt aNullAdressIndex)
-	{
-    TRACE_FUNC_ENTRY	
-	
-    if(aAddr == KNullAddress )
-    	{
-		TRACE_FUNC_EXIT        			    	
-    	return aNullAdressIndex;
-    	}
-    	else
-    	{
-	    TInt count = iDeviceArray.Count();
-	    TInt i;
-	    for (i = 0; i < count; i++)
-	        {
-	        if (iDeviceArray[i]->iAddr == aAddr) break;
-	        }
-		if(i == count)
-			{
-			TRACE_FUNC_EXIT        		
-			return KErrNotFound ;	
-			}
-	    
-		else
-			{
-			TRACE_FUNC_EXIT        		
-			return i;		
-			}	    		
-    	}	    		    
-	}
-// --------------------------------------------------------------------------------------------
-// CBTDevModelBase::DoChangeDevice
-// --------------------------------------------------------------------------------------------            
-TInt CBTDevModelBase::DoChangeDeviceL(const TBTDevice& aDevice)
-    {
-    TRACE_FUNC_ENTRY
-    //check that the command in progress has been started       
-   	__ASSERT_DEBUG(iDevice==NULL,PANIC(EBTPanicDevManQueueIsCorrupt));
-
-    TInt index = GetIndexByAddress(aDevice.iAddr, aDevice.iIndex ); 
-        
-    if (index == KErrNotFound)
-        {
-        TRACE_INFO(_L("index not found"));
-	    TRACE_FUNC_EXIT    
-        if (aDevice.iAddr == KNullAddress) 
-        	{
-    		return KErrArgument;
-        	}
-        else
-    		{
-    		return KErrNotFound ;
-    		} 
-        }
-    if(index >= iDeviceArray.Count())
-    	{
-        TRACE_INFO((_L("index is %d, max expected is %d"), index, iDeviceArray.Count()));
-   		TRACE_FUNC_EXIT	   
-    	return KErrOverflow;
-    	}
-
-    
-    TBTDevice* device = iDeviceArray[index];
-    // store pointer to the indexed TBTDevice
-
-	// untrust trusted device to be deleted, and delete it only after that
-    if( (device->iStatus & EStatusTrusted ) 
-    	&& aDevice.iOperation== EOpUnpair )
-        	{
-        	device=new (ELeave) TBTDevice(*iDeviceArray[index]);
-        	device->iOperation=EOPInternalUntust;
-        	iQueue.Insert(device,0);
-        	TInt rvalue=DoChangeDeviceL(*device);
-        	TRACE_FUNC_EXIT	   
-        	return rvalue;
-        	}
-    
- 
-    iDevice = new (ELeave) TBTDevice(*device);
-    iDevice->iOperation = aDevice.iOperation;
-
-    CBTDevice* regDevice = CBTDevice::NewL(iDevice->iAddr);
-
-    regDevice->SetPaired( aDevice.iLinkKeyType );
-    
-    TBTDeviceSecurity security;
-    
-    if(aDevice.iOperation != EOpChangeName)
-        {
-        regDevice->SetDeviceNameL( BTDeviceNameConverter::ToUTF8L( iDevice->iName ) );
-        
-        // BTEngDevMan will delete friendly name when modify device if friendly name is not set
-        // So if friendly name has been set before, it need to be set again before modify it for
-        // any other purpuse e.g change security
-        regDevice->SetFriendlyNameL(iDevice->iFriendlyName);
-        }  
-        
-    switch (aDevice.iOperation)
-        {
-        case EOpUntrust:
-        case EOPInternalUntust:        
-        	security.SetNoAuthenticate(EFalse);
-            security.SetNoAuthorise(EFalse);	
-        	regDevice->SetGlobalSecurity(security);	        	
-        	UnsetStatusFlags(iDeviceArray[index]->iStatus,EStatusTrusted );  	        
-			break;
-				        	
-        case EOpTrust:	        
-            security.SetNoAuthenticate(EFalse); 
-            security.SetNoAuthorise(ETrue);	            
-            security.SetBanned(EFalse);
-        	regDevice->SetGlobalSecurity(security);	        	
-            
-            SetStatusFlags(iDeviceArray[index]->iStatus,EStatusTrusted );
-            break;  
-
-        case EOpUnblock:
-         	// unblock may be done to a number of devices.
-        	// So we want it to happen as quicky as possible
-        	iRegistryObserver->Cancel();
-          	UnsetStatusFlags( iDevice->iStatus,EStatusBlocked );
-          	security.SetBanned(EFalse );
-            regDevice->DeleteLinkKey();
-
-            regDevice->SetGlobalSecurity(security);                   	
-        	break;
-        	
-        case EOpBlock:	            
-            security.SetBanned(ETrue );
-            security.SetNoAuthenticate(EFalse );
-            security.SetNoAuthorise(EFalse);
-            regDevice->SetGlobalSecurity(security);
-            regDevice->DeleteLinkKey();
-
-			UnsetStatusFlags( iDevice->iStatus,EStatusTrusted );
-        	SetStatusFlags( iDevice->iStatus,EStatusBlocked );
-			break;
-
-        case EOpUnpair:
-        	// unpair may be done to a number of devices.
-        	// So we want it to happen as quicky as possible
-        	iRegistryObserver->Cancel();				
-            regDevice->DeleteLinkKey();
-
-            UnsetStatusFlags(iDevice->iStatus,EStatusPaired);
-            security.SetNoAuthenticate(EFalse );
-            security.SetNoAuthorise(EFalse );         
-            regDevice->SetGlobalSecurity(security);               
-            break;
-
-        case EOpChangeName:
-            if (IsNameExisting(aDevice.iName)) 
-            	{
-            	delete regDevice;
-            	regDevice=NULL;
-            	return KErrAlreadyExists;
-            	}
-                
-            regDevice->SetFriendlyNameL(aDevice.iName);
-            iDevice->iName = aDevice.iName;
-            
-            // set iFriendlyName to remember that friendly name has been set
-            iDevice->iFriendlyName = aDevice.iName;
-            break;
-
-        default:
-            delete regDevice;
-            delete iDevice;
-            iDevice=NULL;
-			TRACE_FUNC_EXIT            
-            return KErrNotSupported;
-        }
-    iDevMan->ModifyDevice(*regDevice);
-    delete regDevice;
-
-   	TRACE_FUNC_EXIT    
-    return KErrNone;
-    }
-// --------------------------------------------------------------------------------------------
-// CBTDevModelBase::DoChangeDevice
-// --------------------------------------------------------------------------------------------                
-void CBTDevModelBase::DoCancelChangeL(const TBTDevice& /*aDevice*/)
-    {
-    TRACE_FUNC_ENTRY
-    iDevMan->Cancel();    
-	TRACE_FUNC_EXIT    
-    }
-
-// --------------------------------------------------------------------------------------------
-// CBTDevModelBase::CreateDevice
-// --------------------------------------------------------------------------------------------                    
-TBTDevice* CBTDevModelBase::CreateDeviceL(const CBTDevice* aRegDevice,
-        TNameEntry* aNameEntry)
-    {
-    TRACE_FUNC_ENTRY
-    TRACE_BDADDR(aRegDevice->BDAddr());
-    TRACE_INFO((_L("CoD %b"), aRegDevice->DeviceClass().DeviceClass()));
-    TBTDevice* device = new (ELeave) TBTDevice();
-    if ( aNameEntry )
-        {
-        device->iNameEntry = *aNameEntry;
-        }
-    switch( aRegDevice->DeviceClass().MajorDeviceClass() )
-        {
-        case EMajorDeviceComputer:
-			device->iType=EDeviceComputer;
-            break;
-        case EMajorDevicePhone:
-        	device->iType=EDevicePhone;
-            break;
-        case EMajorDeviceAudioDevice:
-        	if ( aRegDevice->DeviceClass().MinorDeviceClass() == EMinorDeviceAVCarAudio ||
-        	     aRegDevice->DeviceClass().MinorDeviceClass() == EMinorDeviceAVHandsfree)
-        		{
-        		device->iType=EDeviceCarkit;
-        		}
-        	else
-        		{
-        		device->iType=EDeviceAudio;
-        		}
-            break;
-		
-        case EMajorDevicePeripheral:
-        	if ( aRegDevice->DeviceClass().MinorDeviceClass() == EMinorDevicePeripheralKeyboard )
-        		{
-				device->iType=EDeviceKeyboard;
-        		}
-        	else 
-        		{
-        		
-        		if ( aRegDevice->DeviceClass().MinorDeviceClass() == EMinorDevicePeripheralPointer )
-        			{
-					device->iType=EDeviceMice;
-        			}	
-        		else
-        			{
-        			device->iType=EDeviceDefault;
-        			}
-        		}
-        	break;
-        	
-        case EMajorDeviceImaging:
-        	if ( aRegDevice->DeviceClass().MinorDeviceClass() == EMinorDeviceImagingPrinter )
-        		{
-				device->iType=EDevicePrinter;
-        		}
-        	else
-        		{
-        		device->iType=EDeviceDefault;
-        		}
-        	break;
-        
-        default:
-        	device->iType=EDeviceDefault;
-          	break;
-        }
-    device->iAddr = aRegDevice->BDAddr();
-    
-    TBTDeviceSecurity security = aRegDevice->GlobalSecurity();
-    
-    if(security.Banned() )
-    	{
-    	SetStatusFlags(device->iStatus,EStatusBlocked);
-    	}
-    if( IsUserAwarePaired( aRegDevice->AsNamelessDevice() ) )
-    	{
-    	SetStatusFlags(device->iStatus,EStatusPaired);
-    	device->iLinkKeyType = aRegDevice->LinkKeyType();  	
-    	}
-    if( security.NoAuthorise())
-    	SetStatusFlags(device->iStatus,EStatusTrusted);
-	if(aRegDevice->FriendlyName().Length() >0)
-		{
-    	device->iName = aRegDevice->FriendlyName();
-    	
-    	// set iFriendlyName to remember that friendly name has been set before in registry 
-    	device->iFriendlyName = aRegDevice->FriendlyName();
-		}
-	else
-		{
-		CleanupStack::PushL(device);
-		device->iName = BTDeviceNameConverter::ToUnicodeL(aRegDevice->DeviceName());
-		CleanupStack::Pop(device);
-		}
-        
-
-	device->iDeviceClass=aRegDevice->DeviceClass();
-    TRACE_FUNC_EXIT    	
-    return device;
-    }
-// --------------------------------------------------------------------------------------------
-// CBTDevModelBase::AddDeviceL
-// --------------------------------------------------------------------------------------------                    
-void CBTDevModelBase::AddDeviceL(const CBTDevice* aRegDevice, 
-        TNameEntry* aNameEntry, const TBTDeviceOp aOperation)
-    {
-    TRACE_FUNC_ENTRY
-    TBTDevice* device = CreateDeviceL(aRegDevice, aNameEntry);
-    device->iOperation = aOperation;
-    // insert it to the RDeviceArray by order
-	  iDeviceArray.InsertInOrderL(device,*iSortOrder);
-    TRACE_FUNC_EXIT        
-    }
-// --------------------------------------------------------------------------------------------
-// CBTDevModelBase::CreateDevices
-// --------------------------------------------------------------------------------------------                        
-void CBTDevModelBase::CreateDevicesL(const CBTDeviceArray* aDeviceArray)
-    {
-    TRACE_FUNC_ENTRY
-    // clear the old contents of the array
-    for(TInt i=0;i<iDeviceArray.Count();i++)
-    	delete iDeviceArray[i];
-    iDeviceArray.Reset();
-    
-    TInt count = aDeviceArray->Count();
-    for (TInt i = 0; i < count; i++)
-        {
-        // form a TBTDevice for a CBTDevice
-        CBTDevice* regDevice = aDeviceArray->At(i);
-		HandleNewDeviceL(regDevice, NULL);
-		RenumberDeviceArray();
-        }
-    TRACE_FUNC_EXIT    
-    }
-// --------------------------------------------------------------------------------------------
-// CBTDevModelBase::IsNameExisting
-// --------------------------------------------------------------------------------------------                        
-TBool CBTDevModelBase::IsNameExisting(const TDesC& aName)
-    {
-    TRACE_FUNC_ENTRY
-    for (TInt i = 0; i < iDeviceArray.Count(); i++)
-        {
-        if (iDeviceArray[i]->iName.Compare(aName) == 0)
-        	{
-        	return ETrue;
-        	}
-        }
-    TRACE_FUNC_EXIT    
-    return EFalse;
-    }
-// --------------------------------------------------------------------------------------------
-// CBTDevModelBase::RegistryChangedL
-// --------------------------------------------------------------------------------------------                            
-void CBTDevModelBase::RegistryChangedL(const CBTDeviceArray* aDeviceArray)
-    {
-    TRACE_FUNC_ENTRY
-
-	// Store the device seleted before refresh
-    TInt bSelectedDeviceIndex = KErrNotFound;
-    if (iObserver)
-	{
-    	bSelectedDeviceIndex=iObserver->CurrentItemIndex();
-	}
-	
-    // the selected device before the update
-    TBTDevice currentDevice;
-        
-    if (bSelectedDeviceIndex != KErrNotFound && bSelectedDeviceIndex < iDeviceArray.Count() )
-    	{    	
-    	currentDevice=*iDeviceArray[bSelectedDeviceIndex];    	
-    	}    
-    
-	CreateDevicesL(aDeviceArray);
-
-	TInt newIndex=GetIndexByAddress(currentDevice.iAddr,KErrNotFound);
-	if (newIndex==KErrNotFound)
-	{
-		newIndex= bSelectedDeviceIndex;
-	}
-
-	newIndex=Min(newIndex,iDeviceArray.Count() -1 );
-
-	// notify the listener about the new list of devices
-	SendRefreshIfNoError(KErrNone,newIndex);    
-	TRACE_FUNC_EXIT
-    }
-// ----------------------------------------------------------
-// CBTDevModelBase::RenumberDeviceArray
-//
-// ReCalculates the indexes of internal array.
-// ----------------------------------------------------------
-void CBTDevModelBase::RenumberDeviceArray()
-	{
-	TRACE_FUNC_ENTRY
-	for(TInt i=0;i<iDeviceArray.Count();i++)
-		{
-		iDeviceArray[i]->iIndex=i;
-		}
-	TRACE_FUNC_EXIT	
-	}
-//---------------------------------------------------------------------------------------------
-// from MBTEngDevManObserver for call back on adding, modifying, deleting device completion
-//---------------------------------------------------------------------------------------------
-void  CBTDevModelBase::HandleDevManComplete(TInt aErr)
-    {    
-    TRACE_FUNC_ENTRY
-    //command has been succesfully completed. If there is no command but something has
-    // completed, something is very wrong.
-	__ASSERT_DEBUG(iDevice != NULL || aErr != KErrNone, PANIC(EBTPanicDevManQueueIsCorrupt));    
-	__ASSERT_DEBUG(iQueue.Count()>0, PANIC(EBTPanicDevManQueueIsCorrupt));    
-	
-    RenumberDeviceArray();
-    
-	// EOPInternalUntust is untrst before delete. It is not an operation of its own, so no-one is notified about it.
-    if(iDevice && iDevice->iOperation== EOPInternalUntust)
-    	{
-    	delete(iDevice);
-    	iDevice=NULL;
-		delete iQueue[0];
-		iQueue.Remove(0);
-			    	
-		HandleQueue();
-		TRACE_FUNC_EXIT
-		return;
-    	}
-	// in case of just paired device the refresh does
-	// not work adequately quickly, so we have not refresh the
-	// shown devices immediately.
-	//
-	// If we would not do it, there might be a small window, for
-	// answering yes to to question if user wants to trust the
-	// device. This would fail, since the device would not
-	// be in the list.
-    if( aErr == KErrNone && (iDevice->iOperation== EOpTrust || iDevice->iOperation== EOpUntrust ))
-    	{
-		TInt index=GetIndexByAddress(iDevice->iAddr);
-		if(index != KErrNotFound)
-			{    	
-			if(iDevice->iOperation== EOpTrust )			
-				{
-				SetStatusFlags(iDeviceArray[index]->iStatus, EStatusTrusted);
-				}				
-			else
-				{
-				UnsetStatusFlags(iDeviceArray[index]->iStatus, EStatusTrusted);	
-				}
-							
-	    	SendRefreshIfNoError(aErr);
-			}
-			
-    	}
-	// delete the unpaired and blocked devices from the list
-	if( aErr == KErrNone && iDevice && 
-			(iDevice->iOperation== EOpBlock || iDevice->iOperation== EOpUnpair ) )
-		{
-			TInt index=GetIndexByAddress(iDevice->iAddr);	
-			if(index != KErrNotFound )
-				{
-					delete( iDeviceArray[index] );
-					iDeviceArray.Remove(index);				
-				}
-			// do not send refresh if this and the next are unpair/unblock operations.
-			// This is meant to hasten the screen refresh, in case of DeleteAll command
-			// is issued.
-			if( iQueue.Count()>1 && iQueue[1]->iOperation==iDevice->iOperation )
-				{
-				
-				}
-			else
-				{
-	    		SendRefreshIfNoError();	
-	    		iRegistryObserver->StartIfNotRunning();				
-	    		//NOTE:It is ok to attempt starting when allready running.	    		
-				}
-				
-		}
-    if(iObserver && iDevice)    
-    	iObserver->NotifyChangeDeviceComplete(aErr, *iDevice);
-    
-    delete(iDevice);
-    iDevice=NULL;
-    
-    iRegistryObserver->Refresh();
-
-	delete iQueue[0];
-	iQueue.Remove(0);
-		    
-	HandleQueue();
-	TRACE_FUNC_EXIT	
-    }
-    
-// ---------------------------------------------------------------------
-// CBTDevModelBase::HandleGetDevicesComplete
-// From MBTEngDevManObserver
-//
-// Devices are received from CBTRegistryObserver, so this is not used.
-// ----------------------------------------------------------------------
-void  CBTDevModelBase::HandleGetDevicesComplete(TInt /*aErr*/, CBTDeviceArray* /*aDeviceArray*/)
-    {
-	TRACE_FUNC_ENTRY
- 
-	TRACE_FUNC_EXIT    
-    }
-    
-
-// ---------------------------------------------------------------------
-// CBTDevModelBase::SendRefreshIfNoError
-// ---------------------------------------------------------------------
-void CBTDevModelBase::SendRefreshIfNoError(TInt aErr,TInt selectedItem)
-	{
-	TRACE_FUNC_ENTRY	
-	
-	//this shouldn't be reached if iObserver is NULL
-	__ASSERT_DEBUG(iObserver, PANIC(EBTPanicNullObserver));
-	
-	if (selectedItem == KErrNotSupported )
-		{
-   		iObserver->RefreshDeviceList( &iDeviceArray ,
-   		        Min(iObserver->CurrentItemIndex(),iDeviceArray.Count()-1  ) );    				
-		}
-	else
-		{
-	   	if (aErr == KErrNone && iObserver)
-	   	    {
-	   		iObserver->RefreshDeviceList( &iDeviceArray,
-	   		        Min(selectedItem,iDeviceArray.Count()-1  ) );
-	   	    }
-		}
-	
-	TRACE_FUNC_EXIT   		  
-	}    
-// ---------------------------------------------------------------------
-// CBTDevModelBase::ChangeDeviceL
-//
-// puts the change device command into Queue
-// ---------------------------------------------------------------------	
-void CBTDevModelBase::ChangeDeviceL(const TBTDevice& aDevice)
-	{
-	TRACE_FUNC_ENTRY
-	
-	TBTDevice* device=new(ELeave) TBTDevice(aDevice);		
-	CleanupStack::PushL(device);
-
-	TInt err = GetDevice(*device);
-	if(err!=KErrNone)
-		{
-		CleanupStack::PopAndDestroy(device);
-		User::Leave(err);
-		}
-
-	if(aDevice.iOperation==EOpChangeName)
-		{
-		device->iName=aDevice.iName;		
-		}
-	
-	iQueue.Append(device);
-	CleanupStack::Pop(device);	
-	if(iQueue.Count() ==1 )
-		{
-			User::LeaveIfError( DoChangeDeviceL(*iQueue[0]) );
-		}
-	TRACE_FUNC_EXIT
-	}
-
-// ---------------------------------------------------------------------
-// CBTDevModelBase::ChangeDevice
-//
-// Calls the ChangeDeviceL and traps leaves and calls error callback,
-// if they occur.
-// ---------------------------------------------------------------------	
-void CBTDevModelBase::ChangeDevice(const TBTDevice& aDevice)
-	{
-	TRACE_FUNC_ENTRY		
-	TRAPD(err,
-		ChangeDeviceL(aDevice);
-	);
-	if(err!=KErrNone)
-	{
-		HandleLeave(err,&aDevice);	
-	}
-	TRACE_FUNC_EXIT
-	}
-
-// ---------------------------------------------------------------------
-// CBTDevModelBase::CancelChange
-//
-// cancels the change from queue, only calls DoCancelChange,
-// if the command is actually in progress.
-// ---------------------------------------------------------------------		
-void CBTDevModelBase::CancelChange(const TBTDevice& aDevice)	
-	{
-	TRACE_FUNC_ENTRY	
-	// retrieve the device based on index, in
-	// case the address is not filled in.
-	TBTDevice device=aDevice;
-	GetDevice(device);
-	device.iOperation=aDevice.iOperation;
-				
-	// delete any operations to device from queueu
-	if(iQueue.Count()>0 )
-		{
-		// Before calling DoCancelChangeL check if first operation on the 
-		// queue is the one to be cancelled - otherwise crash may occure 
-		// as per TSW EMZA-7EUHYE
-		if(iQueue[0]->iAddr== device.iAddr &&
-			iQueue[0]->iOperation== device.iOperation )
-			TRAP_IGNORE(DoCancelChangeL(device));
-		
-		for (TInt i = iQueue.Count() - 1; i >= 0; i--)
-			{
-			if(iQueue[i]->iAddr== device.iAddr &&
-				iQueue[i]->iOperation== device.iOperation )
-				{
-				delete iQueue[i];
-				iQueue.Remove(i);
-				}
-			}
-		}
-	// failed cancel is not reported forward.		
-	TRACE_FUNC_EXIT			
-	}
-	
-// ---------------------------------------------------------------------
-// CBTDevModelBase::DeviceChangeInProgress
-// ---------------------------------------------------------------------
-TBool CBTDevModelBase::DeviceChangeInProgress()
-	{
-	TRACE_FUNC_ENTRY
-	TRACE_FUNC_EXIT
-	return iQueue.Count() !=0;
-	}
-
-// ---------------------------------------------------------------------
-// CBTDevModelBase::HandleQueue
-//
-// Starts executing the next devicechange(if any).
-// Currently Executed command must be deleted from iQueue and iDevice
-// (and corresponding places in subclasses), before calling this method.
-// ---------------------------------------------------------------------
-	
-void CBTDevModelBase::HandleQueue()
-	{
-	TRACE_FUNC_ENTRY
-	
-	RenumberDeviceArray();
-	if(iQueue.Count() >0 )
-		{
-		TRAPD(err2,	DoChangeDeviceL(*iQueue[0]); );
-		if (err2 !=KErrNone)
-			{
-			HandleLeave(err2,iQueue[0]);
-			}
-		}
-	TRACE_FUNC_EXIT		
-	}
-
-// ---------------------------------------------------------------------
-// CBTDevModelBase::HandleLeave
-// ---------------------------------------------------------------------
-void CBTDevModelBase::HandleLeave(TInt aErr,const TBTDevice* aDevice )
-	{
-	TRACE_FUNC_ENTRY
-	iRegistryObserver->StartIfNotRunning();
-	iRegistryObserver->Refresh();
-	if(aDevice == NULL )
-		{		
-		iObserver->NotifyChangeDeviceComplete(aErr,TBTDevice() );	
-		} 
-	else
-		{		
-		iObserver->NotifyChangeDeviceComplete(aErr, *aDevice );	
-		} 
-	delete iDevice;
-	iDevice=NULL;
-	iDevMan->Cancel();
-
-	if(aDevice != NULL && iQueue.Count() > 0 && 
-		(iQueue[0]->iAddr == aDevice->iAddr ) && 
-		(iQueue[0]->iOperation == aDevice->iOperation ) )
-		{
-		delete iQueue[0];
-		iQueue.Remove(0);
-		}	
-	
-	HandleQueue();
-	TRACE_FUNC_EXIT
-	}
--- a/bluetoothengine/btui/devmodel/src/btpairedmodel.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,999 +0,0 @@
-/*
-* 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:  Maintain a Bluetooth devices data model for paired devices view
-*
-*/
-
-
-#include "btpairedmodel.h"
-#include <btengutil.h>
-#include "debug.h"
-#include "btui.h"
-
-const TInt KMaxCheckedConnections=20;
-
-
-// ---------------------------------------------------------------------
-// CBTPairedModel::CBTPairedModel
-// ---------------------------------------------------------------------
-//
-CBTPairedModel::CBTPairedModel(MBTDeviceObserver* aObserver, TBTDeviceSortOrder* aOrder)
-	: CBTDevModelBase(aObserver, aOrder)
-    {
-	TRACE_FUNC_ENTRY    
-    TRACE_FUNC_EXIT	
-    }
-
-// ---------------------------------------------------------------------
-// CBTPairedModel::NewL
-// ---------------------------------------------------------------------
-//
-CBTPairedModel* CBTPairedModel::NewL(MBTDeviceObserver* aObserver, TBTDeviceSortOrder* aOrder )
-    {
-    CBTPairedModel* self = new (ELeave) CBTPairedModel(aObserver, aOrder);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-     
-    return self;       
-    }
-    
-// --------------------------------------------------------------------------------------------
-// Destructor
-// --------------------------------------------------------------------------------------------
-//
-CBTPairedModel::~CBTPairedModel()
-    {
-	TRACE_FUNC_ENTRY    
-	
-    delete iConnMan;
-    delete iPairingDevice;
-    delete iLinks;
-    delete iBtEngSettings;
-    iSocketServ.Close();    
-    
-    TRACE_FUNC_EXIT    
-    }
-
-// ---------------------------------------------------------------------
-// CBTPairedModel::ConstructL
-// ----------------------------------------------------------------------
-//
-void CBTPairedModel::ConstructL()
-    {
-	TRACE_FUNC_ENTRY
-	
-    // get all devices from btregistry to cache - local copy of CBTDeviceArray
-    iDevMan = CBTEngDevMan::NewL(this);
-    iConnMan = CBTEngConnMan::NewL(this);
-    iSearchPattern.FindAll(); 
-   	iRegistryObserver = CBTRegistryObserver::NewL(this, iSearchPattern);
-	iRegistryObserver->Refresh();
-	User::LeaveIfError( iSocketServ.Connect() );
-	iLinks=CBluetoothPhysicalLinks::NewL(*this,iSocketServ);
-	
-	iBtEngSettings = CBTEngSettings::NewL(this);
-	
-    TRACE_FUNC_EXIT	
-    }
-    
-// ---------------------------------------------------------------------
-// CBTPairedModel::IsAnyDeviceConnected
-// ----------------------------------------------------------------------
-//
-TBool CBTPairedModel::IsAnyDeviceConnected()
-    {        
-	TRACE_FUNC_ENTRY
-
-	FlagPhysicallyConnectedDevices(iDeviceArray);
-    
-	for(TInt i = 0; i < iDeviceArray.Count(); i++)
-		{
-		if(iDeviceArray[i]->iStatus & (EStatusPhysicallyConnected|EStatusBtuiConnected))
-			{
-			TRACE_FUNC_EXIT				
-			return ETrue;
-			}        
-		}
-					
-	TRACE_FUNC_EXIT				
-	
-    return EFalse;
-    }
-    
-// ---------------------------------------------------------------------
-// CBTPairedModel::DoChangeDevice
-// ---------------------------------------------------------------------
-
-TInt CBTPairedModel::DoChangeDeviceL(const TBTDevice& aDevice)
-    {
-    TRACE_FUNC_ENTRY
-    TRACE_BDADDR(aDevice.iAddr)
-   	// check that the device actually still exists
-   	if(aDevice.iOperation != EOpPair )
-   		{
-   		User::LeaveIfError( GetIndexByAddress(aDevice.iAddr, aDevice.iIndex ) );	
-   		}
-   	
-    // disconnect device to be unpaired, or blocked
-    if((aDevice.iOperation == EOpBlock || aDevice.iOperation == EOpUnpair ))
-    	{    	
-    	if( iState != EDisconnectBeforeOperationState)
-    		{
-    			// disconnect by CBTEngConnMan if connected that way.
-    			if (aDevice.iStatus & static_cast<TInt>(EStatusBtuiConnected ) )
-    				{
-    				TInt code=KErrNone;
-		    		TRAPD(err,
-		    		iState=EDisconnectBeforeOperationState;
-			    		iDisconnectDevice=new(ELeave) TBTDevice(aDevice);
-			    		code=iConnMan->Disconnect(aDevice.iAddr,EBTDiscImmediate);    				
-			    		);
-					// if the return code is KErrNone then there will be
-					// a callback. However if it fails, there will not be any.
-					// So the execution will go on inside this method, if there was an error.
-					if(err == KErrNone && code==KErrNone )
-						{
-						return KErrNone;
-						}
-						
-    				}
-    			else // try disconnecting from the link layer
-    				{
-    				TInt code=KErrNone;
-    				TRAPD(err,
-					iState=EDisconnectBeforeOperationState;
-						iDisconnectDevice=new(ELeave) TBTDevice(aDevice);
-						code=iLinks->Disconnect(aDevice.iAddr);
-						);
-					// if the return code is KErrNone then there will be
-					// a callback. However if it fails, there will not be any.
-					// So the execution will go on inside this method, if there was an error.
-					if(err == KErrNone && code==KErrNone )
-						{
-						return KErrNone;
-						}
-    				}
-    		}
-   		else    
-			iState=EIdleState;
-    
-    	}
-    	
-    if(	aDevice.iOperation ==EOpPair)
-    	{
-    	DoPairDeviceL();
-    	TRACE_FUNC_EXIT 
-    	return KErrNone;    	
-    	}
-    
-    TInt err = CBTDevModelBase::DoChangeDeviceL(aDevice);
-    if(iDisconnectDevice!= NULL)
-    	{
-    	delete iDisconnectDevice;
-    	iDisconnectDevice=NULL;
-    	}
-    
-    if (err != KErrNone)
-        {      
-        TBTDevAddr addr;
-        if(aDevice.iAddr == KNullAddress )
-        	{        	        	
-        	if(aDevice.iIndex < 0 || aDevice.iIndex >= iDeviceArray.Count())
-        		return KErrArgument;
-        	else
-        		addr=iDeviceArray[aDevice.iIndex]->iAddr;
-        	}
-        	else
-        		addr=aDevice.iAddr;
-        	
-        switch (aDevice.iOperation)
-            {
-            case EOpConnect:
-            	{                    	   		            		               
-                err = iConnMan->Connect(addr, aDevice.iDeviceClass);
-                break;
-            	}
-            case EOpDisconnect:
-            	{
-            	iDisconnectDevice=new(ELeave) TBTDevice(aDevice);            		            		           	
-				if (aDevice.iStatus & static_cast<TInt>(EStatusBtuiConnected ) )            	
-					{
-					err = iConnMan->Disconnect(addr, EBTDiscImmediate);	
-					}
-				else
-					{
-					err=iLinks->Disconnect(aDevice.iAddr);
-					}
-                
-                break;
-            	}
-            default:
-            	User::Leave(err);
-                break;
-            }
-        }
-        
-    TRACE_FUNC_EXIT        
-    
-    return err;
-    }
-    
-// ---------------------------------------------------------------------
-// CBTPairedModel::DoCancelChange
-// ---------------------------------------------------------------------
-//    
-void CBTPairedModel::DoCancelChangeL(const TBTDevice& aDevice)
-    {
-    TRACE_FUNC_ENTRY
-    
-	if(aDevice.iIndex >= iDeviceArray.Count())
-        {
-        TRACE_INFO((_L("index is %d, max expected is %d"), aDevice.iIndex, iDeviceArray.Count()));
-        TRACE_FUNC_EXIT    
-		return; 
-        }
-    
-    // in case it was stopped
-    iRegistryObserver->StartIfNotRunning();
-    switch (aDevice.iOperation)
-        {
-        case EOpPair:
-        	if( iState==EDeleteDeviceState || iState==EAddDeviceState )
-        		{
-        		iDevMan->Cancel();
-        		}        		
-        	else
-        		{
-        		iConnMan->CancelPairDevice();
-        		}            	        	
-            delete iPairingDevice;
-            iPairingDevice=NULL;
-            iState=EIdleState;
-            iRegistryObserver->Refresh();
-            break;
-            
-        case EOpConnect:
-        	{	
-        	
-            TBTDevAddr addr;
-            if(aDevice.iIndex == KErrNotFound) 
-            	{
-            	addr=aDevice.iAddr;
-            	}                
-            else
-            	{
-            	addr=iDeviceArray[aDevice.iIndex]->iAddr;
-            	}
-            	
-            iConnMan->CancelConnect(addr);
-            break;
-        	}
-        default:
-            CBTDevModelBase::CancelChange(aDevice);
-            return;
-        }
-    iRegistryObserver->StartIfNotRunning();
-    
-	if(iQueue.Count()>0)
-		{
-		delete iQueue[0];
-		iQueue.Remove(0);		
-		HandleQueue();
-		}
-	
-    TRACE_FUNC_EXIT	       
-    }
-    
-// ---------------------------------------------------------------------
-// CBTPairedModel::HandleNewDevice
-//
-// Adds the device if it is not banned
-// ---------------------------------------------------------------------
-//
-void CBTPairedModel::HandleNewDeviceL(const CBTDevice* aRegDevice,
-        TNameEntry* aNameEntry)
-    {
-    TRACE_FUNC_ENTRY
-    
-    // It is needed to filter out blocked devices,
-    // since otherwise blocked and paired devices would
-    // be listed.
-    if( ! aRegDevice->GlobalSecurity().Banned()     	
-            && IsUserAwarePaired( aRegDevice->AsNamelessDevice() ) ) 
-        {
-        AddDeviceL(aRegDevice, aNameEntry, EOpNone);
-        }
-
-    TRACE_FUNC_EXIT		    
-    }
-    
-// -----------------------------------------------------------------------
-// CBTPairedModel::CreateDevice
-//
-// This implementaion will add the connectable status from the superclass.
-// -----------------------------------------------------------------------  
-//
-TBTDevice* CBTPairedModel::CreateDeviceL(const CBTDevice* aRegDevice,
-        TNameEntry* aNameEntry)
-    {
-    TRACE_FUNC_ENTRY
-    
-    TBTDevice* device = CBTDevModelBase::CreateDeviceL(aRegDevice, aNameEntry);
-    
-    // add EStatusBtuiConnected status if the device has a profile connection
-    TBTEngConnectionStatus connStatus;
-    iConnMan->IsConnected(device->iAddr, connStatus);
-    
-    if(connStatus == EBTEngConnecting || connStatus == EBTEngConnected)
-    	{
-    	SetStatusFlags(device->iStatus,EStatusBtuiConnected);
-    	}
-    
-    // add connectable status
-    TBool connectable=EFalse;
-    iConnMan->IsConnectable(aRegDevice->BDAddr(), aRegDevice->DeviceClass(), connectable );
-    
-    if( connectable) 
-    	{
-    	SetStatusFlags(device->iStatus, EStatusConnectable );
-    	}
-    	
-	TRACE_FUNC_EXIT 
-	       
-    return device;
-    }
-    
-// ---------------------------------------------------------------------
-// CBTPairedModel::ConnectComplete
-// from MBTEngConnObserver
-// ----------------------------------------------------------------------
-//
-void CBTPairedModel::ConnectComplete(TBTDevAddr& aAddr, TInt aErr, RBTDevAddrArray* aConflicts)
-    {
-    TRACE_FUNC_ENTRY
-    
-    TRACE_INFO((_L("aErr=%d"), aErr))
-
-    TInt index = GetIndexByAddress(aAddr);
-    TBool requestIssuedFromPhone = EFalse;
-    TBTDevice connectedDevice;
-    
-    // was the device connected from request by the ui
-	if(iQueue.Count()>0 && iQueue[0]->iOperation==EOpConnect && 
-	  iQueue[0]->iAddr == aAddr)
-		{
-		requestIssuedFromPhone = ETrue;
-		if(index >=0) // is it from paired list
-			{			
-			connectedDevice=*iDeviceArray[index];
-			connectedDevice.iOperation=EOpConnect;
-			}
-		else
-			{
-			connectedDevice=*iQueue[0];		
-			}
-    	
-    	}
-    else
-    	{
-    	requestIssuedFromPhone = EFalse;
-		if(index >=0) // is it from paired list
-			{
-			connectedDevice=*iDeviceArray[index];
-			connectedDevice.iOperation=EOpConnect;
-			}
-		else
-			{
-	    	// it was not. Try to fill what can be filled.
-			connectedDevice.iAddr=aAddr;
-			connectedDevice.iIndex=KErrNotFound;
-			connectedDevice.iOperation = EOpConnect;			
-			}    	
-    	}        
-    
-    if (aErr == KErrAlreadyExists )
-        { 
-        // gather the names of the conflicting devices.
-        RBTDevNameArray nameArray;
-        for (TInt i = 0; aConflicts!= NULL && i < aConflicts->Count(); i++)
-            {
-            //remove duplicates
-            if(i>0&& (*aConflicts)[i]==(*aConflicts)[i-1])
-            	{
-            	continue;
-            	}
-            TInt di = GetIndexByAddress((*aConflicts)[i]);
-            
-            if(di >=0 )
-            	{
-            	nameArray.Append(&iDeviceArray[di]->iName);
-            	}
-            }
-
-        // we will unset the connect status of the device if connection failed &
-            // it is found in paired devices.
-        if( index >= 0 )
-            {
-            // add EStatusBtuiConnected status if the device has a profile connection
-            TBTEngConnectionStatus connStatus;
-            iConnMan->IsConnected(connectedDevice.iAddr, connStatus);
-   
-            if (connStatus != EBTEngConnecting && connStatus != EBTEngConnected)
-                {
-                TRACE_INFO(_L("Unset EStatusBtuiConnected"))
-                UnsetStatusFlags(iDeviceArray[index]->iStatus,EStatusBtuiConnected );
-                }
-            }
-        
-        if(iObserver)
-            {
-            //Show only phone issued request complete notes
-            //Do not show notes for device issued request when BTUI is active
-            if ( requestIssuedFromPhone ) 
-                {
-                iObserver->NotifyChangeDeviceComplete(aErr, connectedDevice, &nameArray);
-                }
-               
-            SendRefreshIfNoError(aErr);
-            }
-        nameArray.Reset();
-        }
-    else 
-        {
-        if (aErr == KErrNone)
-            {
-            // we will set the connect status of the device
-            // if it is found in paired devices.
-            if( index >= 0 )
-            	{
-            	SetStatusFlags(iDeviceArray[index]->iStatus,EStatusBtuiConnected );
-            	}
-            }
-        else        
-            {
-            // we will unset the connect status of the device if connection failed &
-            // it is found in paired devices.
-            if( index >= 0 )
-                {                   
-                // add EStatusBtuiConnected status if the device has a profile connection
-                TBTEngConnectionStatus connStatus;
-                iConnMan->IsConnected(connectedDevice.iAddr, connStatus);
-   
-                if (connStatus != EBTEngConnecting && connStatus != EBTEngConnected)
-                   {
-                   TRACE_INFO(_L("Unset EStatusBtuiConnected"))
-                   UnsetStatusFlags(iDeviceArray[index]->iStatus,EStatusBtuiConnected );
-                   }                
-                }
-            }
-		if(iObserver)
-			{
-			//Show only phone issued request complete notes
-			//Do not show notes for device issued request when BTUI is active
-			if ( requestIssuedFromPhone ) 
-			    {
-        	    iObserver->NotifyChangeDeviceComplete(aErr, connectedDevice);
-			    }
-        	
-        	SendRefreshIfNoError(aErr);
-			}		
-        }           
-    
-    // Process the next command if the connect was
-    //initiated by this UI.    
-	if(iQueue.Count()>0 && iQueue[0]->iOperation==EOpConnect && 
-       iQueue[0]->iAddr == aAddr)        
-        {
-        delete iQueue[0];
-        iQueue.Remove(0);		
-        HandleQueue();
-        }
-    else
-        {
-        if( iQueue.Count()==0 ) 
-            {
-            TRACE_INFO((_L("op Q is empty")));
-            }
-        else
-            {
-            TRACE_INFO((_L("unexpected op Q contents, count is %d, op is %d"), iDeviceArray.Count(), iQueue[0]->iOperation));
-            }
-        }
-    TRACE_FUNC_EXIT	
-    }
-    
-// ---------------------------------------------------------------------
-// CBTPairedModel::PowerStateChanged
-// from MBTEngSettingObserver
-// ----------------------------------------------------------------------
-//
-void CBTPairedModel::PowerStateChanged( TBTPowerStateValue )
-	{
-	TRACE_FUNC_ENTRY
-	
-	// This is implemented for case like when user choses offlne mode, Bluetooth is swithced off
-	// very fast. Bt audio components don't have enough time to close audio connection.
-	// BTUI needs to update UI display.
-	
-	TInt count = iDeviceArray.Count();  
-    
-    for (TInt i = 0; i < count; i++)
-    	{
-     	UnsetStatusFlags(iDeviceArray[i]->iStatus, EStatusBtuiConnected );
-    	}
-	
-	SendRefreshIfNoError(KErrNone);
-	
-	TRACE_FUNC_EXIT
-	}
-    
-// ----------------------------------------------------
-// CBTPairedModel::VisibilityModeChanged
-// from MBTEngSettingObserver
-// ----------------------------------------------------
-//    
-void CBTPairedModel::VisibilityModeChanged( TBTVisibilityMode  )
-    {
-	TRACE_FUNC_ENTRY
-	
-	
-	TRACE_FUNC_EXIT	
-    }
-        
-// ---------------------------------------------------------------------
-// CBTPairedModel::DisconnectComplete
-// from MBTEngConnObserver
-// ----------------------------------------------------------------------
-//
-void CBTPairedModel::DisconnectComplete(TBTDevAddr& aAddr, TInt aErr)
-    {
-    TRACE_FUNC_ENTRY
-    
-    // the disconnect was part of a unpairing or blocking operation
-	if(iState == EDisconnectBeforeOperationState && iDisconnectDevice && aAddr == iDisconnectDevice->iAddr )
-		{
-
-		TRAPD(err,
-			DoChangeDeviceL(*iDisconnectDevice);		
-		);
-		iState=EIdleState;		
-		if(err != KErrNone)
-			{
-			HandleLeave(err,iDisconnectDevice);
-			}
-		TRACE_FUNC_EXIT
-		return;
-		}		    
-    
-    TInt index = GetIndexByAddress(aAddr);
-    
-    // the disconnected device was not the devicein the list,
-    // so we do not tell anyone about it.
-    if ( iDisconnectDevice == NULL || iDisconnectDevice->iAddr != aAddr )
-    	{
-    	if (index >=0 )
-    	{
-    		UnsetStatusFlags(iDeviceArray[index]->iStatus, EStatusBtuiConnected );
-    	}
-    	
-    	SendRefreshIfNoError(KErrNone);
-
-		TBTDevice disconnectedDevice;
-		disconnectedDevice.iAddr = aAddr;
-		// Notify needed when there is active disconnect query dialog
-    	iObserver->NotifyChangeDeviceComplete(KErrDisconnected, disconnectedDevice);
-		
-    	TRACE_FUNC_EXIT  
-    	return;
-    	}
-    	
-	if(index >=0 )
-		{
-	    // set it to "not connected" no matter disconnection works or not
-	    UnsetStatusFlags(iDeviceArray[index]->iStatus, EStatusBtuiConnected );
-	    iDeviceArray[index]->iOperation = EOpDisconnect;
-	    iObserver->NotifyChangeDeviceComplete(aErr, *iDeviceArray[index]);		
-		}
-	else
-		{
-		iDisconnectDevice->iIndex=index;
-		iObserver->NotifyChangeDeviceComplete(aErr, *iDisconnectDevice);		
-		}
-
-	delete iDisconnectDevice;
-	iDisconnectDevice=NULL;    	
-
-   	SendRefreshIfNoError(aErr);
-   	// continue processing queue only if the disconnected device is
-   	// the device with we requested disconnect to.
-   	// this has to be checked so that we do not end on having multiple
-   	// queue processors at the same time
-	if(iQueue.Count()>0 && iQueue[0]->iOperation==EOpDisconnect && 
-	  iQueue[0]->iAddr == aAddr)           	
-		{
-		delete iQueue[0];
-		iQueue.Remove(0);		
-		HandleQueue();
-		}
-    else
-        {
-        if( iQueue.Count()==0 ) 
-            {
-            TRACE_INFO((_L("op Q is empty")));
-            }
-        else
-            {
-            TRACE_INFO((_L("unexpected op Q contents, count is %d, op is %d"), iDeviceArray.Count(), iQueue[0]->iOperation));
-            }
-        }
-    TRACE_FUNC_EXIT   	
-    }
-    
-// ---------------------------------------------------------------------
-// CBTPairedModel::PairingComplete
-// from MBTEngConnObserver
-// ----------------------------------------------------------------------
-//
-void CBTPairedModel::PairingComplete(TBTDevAddr& aAddr, TInt aErr)
-	{
-	TRACE_FUNC_ENTRY
-	
-	TRAPD(err,
-		PairingCompleteL(aAddr,aErr);
-		);
-		
-	if(err!=KErrNone)
-	{
-		TBTDevice tmp;
-		tmp.iAddr=aAddr;					
-		tmp.iIndex=GetIndexByAddress(aAddr);
-		tmp.iOperation=EOpPair;
-		HandleLeave(err,&tmp );
-
-		delete iPairingDevice;
-		iPairingDevice=NULL;				
-	}
-	
-	TRACE_FUNC_EXIT
-	}
-	
-// ---------------------------------------------------------------------
-// CBTPairedModel::PairingCompleteL
-// Leaving version of PairingComplete
-// ----------------------------------------------------------------------
-//	
-void CBTPairedModel::PairingCompleteL(TBTDevAddr& aAddr, TInt aErr)
-    {
-    TRACE_FUNC_ENTRY
-    
-	// The device that was attempted to be paired is 
-	// different from the the device that the pairing is finnished.
-	// This cannot happen, since CBTConnMan will report
-	// only pairing started by the listener and the UI
-	// does not allow making two pairings at the same time
-    __ASSERT_DEBUG(aAddr==iPairingDevice->BDAddr(),
-      PANIC(EBTPanicCommandComplettedToDiffrentDeviceThanStarted));
-    (void) aAddr;
-
-    // bail out if the operation queue is not what we expect
-    if( iQueue.Count() == 0 
-        || iQueue[0]->iOperation != EOpPair 
-        || iQueue[0]->iAddr != aAddr )        
-        {
-        if( iQueue.Count()==0 ) 
-            {
-            TRACE_INFO((_L("op Q is empty")));
-            }
-        else
-            {
-            TRACE_INFO((_L("unexpected op Q contents, count is %d, op is %d"), iDeviceArray.Count(), iQueue[0]->iOperation));
-            }
-        TRACE_FUNC_EXIT
-        return;
-        }
-
-    iState=EIdleState;		
-	TBTDevice* tmpDevice=NULL;
-	tmpDevice=CreateDeviceL(iPairingDevice, &( iQueue[0]->iNameEntry ) );
-	tmpDevice->iOperation=EOpPair;    		
-	
-    // new paired device must be inserted to the array, since
-    // user may be doing trust/ connect operations before
-    // it is refreshed from registry
-    TBool deleleteTmpDevice=ETrue;
-	
-	if( aErr == KErrNone  )    	
-		{
-		SetStatusFlags(tmpDevice->iStatus,EStatusPaired);
-		TInt index;
-		index=GetIndexByAddress(iPairingDevice->BDAddr());
-		
-		if(index == KErrNotFound)
-			{
-			iDeviceArray.InsertInOrderL(tmpDevice,*iSortOrder );
-  			  			
-    		RenumberDeviceArray();
-
-    		// iPairingDevice is now owned by iDeviceArray. 
-    		// So it must not be deleted by his function
-    		deleleteTmpDevice=EFalse;
-    		
-    		SendRefreshIfNoError(aErr,GetIndexByAddress(iPairingDevice->BDAddr()));
-			}					
-		}
-
-	
-    iObserver->NotifyChangeDeviceComplete(aErr, *tmpDevice);         
-    
-    /*
-     * We issue an background refresh in case 
-     * registry is updated from btnotif
-     */
-	iRegistryObserver->StartIfNotRunning();
-	iRegistryObserver->Refresh();
-    // delete if the ownership has not changed
-    if(deleleteTmpDevice )
-        {
-    	delete tmpDevice;
-    	tmpDevice=NULL;
-        }
-
-	delete iPairingDevice;    
-    iPairingDevice=NULL;       
-	delete iQueue[0];
-	iQueue.Remove(0);
-    
-    HandleQueue();    		    
-
-    TRACE_FUNC_EXIT    
-    }
-    
-// ---------------------------------------------------------------------
-// BTPairedModel::HandleDevManComplete
-// from MBTEngDevModelBase
-// ----------------------------------------------------------------------
-//
-void  CBTPairedModel::HandleDevManComplete(TInt aErr)
-	{
-	TRACE_FUNC_ENTRY
-	
-	// if this is handled we can remove this
-	if(iDisconnectDevice)
-		{
-		delete iDisconnectDevice;
-		iDisconnectDevice=NULL;
-		}
-		
-	if(iPairingDevice)
-		{
-		// add the device just deleted	
-		if(iState==EDeleteDeviceState && (aErr==KErrNone || aErr == KErrNotFound))
-			{
-				iPairingDevice->DeleteLinkKey();
-				TBTDeviceSecurity sec=iPairingDevice->GlobalSecurity();
-				sec.SetBanned(EFalse);
-				sec.SetNoAuthorise(EFalse);
-				iDevMan->AddDevice(*iPairingDevice);
-				iState=EAddDeviceState;
-				TRACE_FUNC_EXIT	
-				return;
-			}
-		// if the device is added allready, or if deletion failed
-		// we will go on with pairing the device
-		if(iState==EAddDeviceState||(iState==EDeleteDeviceState&& aErr != KErrNone))
-			{
-			aErr = iConnMan->PairDevice(iPairingDevice->BDAddr(), iPairingDevice->DeviceClass());
-			iState=EPairDeviceState;
-			// NOTE: now PairingComplete will be called and not this method.
-			TRACE_FUNC_EXIT	
-			return;
-			}
-		}
-	// these are not handled by superclass		
-	if(iQueue.Count()>0 &&
-	    ( iQueue[0]->iOperation==EOpConnect || 
-	     iQueue[0]->iOperation==EOpDisconnect ) )
-		{
-		iObserver->NotifyChangeDeviceComplete(aErr, *iQueue[0]);
-		}
-			
-	CBTDevModelBase::HandleDevManComplete(aErr);
-	
-    TRACE_FUNC_EXIT	
-	}
-	
-// ---------------------------------------------------------------------
-// CBTPairedModel::DoPairDevice
-// ---------------------------------------------------------------------
-//
-void  CBTPairedModel::DoPairDeviceL()
-	{
-	TRACE_FUNC_ENTRY
-	
-	// we are starting a new command. Checks that no earlier commands 
-	// have been executed, but not finished properly.
-	__ASSERT_DEBUG(iState==EIdleState,PANIC(EBTPanicDevManQueueIsInIllegalState));
-	// check that there is no other pairing going on.
-	__ASSERT_DEBUG(iPairingDevice!=NULL,PANIC(EBTPanicTwoPairingAttemptsAtTheSameTime));
-	
-	iRegistryObserver->Cancel();
-	
-	// devices to be paired are first deleted
-	// then added back. Only after that the paring itself is
-	// started
-	TBTRegistrySearch dele;
-	dele.FindAddress(iPairingDevice->BDAddr());
-	TInt err = iDevMan->DeleteDevices(dele);
-
-	iState=EDeleteDeviceState;
-   if (err)
-       {
-       HandleDevManComplete(err);
-       }
-       
-    TRACE_FUNC_EXIT
-	}
-	
-// ---------------------------------------------------------------------
-// CBTPairedModel::PairDevice
-//
-// Puts the given aPairingDevice to iPairingDevice and
-// adds and empty device with iOperation=EOpPair as placeholder to iQueue.
-// the pairing itself will be handled by DoChangeDevice that
-// cals then 
-// ---------------------------------------------------------------------
-//
-TInt CBTPairedModel::PairDeviceL(const CBTDevice* aPairingDevice,
-        TNameEntry* aNameEntry)	
-	{
-	TRACE_FUNC_ENTRY
-	
-	// cannot put two pairings to queue. 
-	// this is not possible since ui does not allow it.
-	if(iPairingDevice)
-		return KErrInUse;
-		
-	TBTDevice*  device=new(ELeave) TBTDevice();
-	device->iOperation=EOpPair;
-	device->iAddr=aPairingDevice->BDAddr();
-	if ( aNameEntry )
-	    {
-	    device->iNameEntry = *aNameEntry;
-	    }
-	CleanupStack::PushL(device);
-	iPairingDevice=aPairingDevice->CopyL();
-	// put the device to queue directly
-	iQueue.AppendL(device);
-	TInt err = KErrNone;
-	if(iQueue.Count() ==1 )
-		{
-		err = DoChangeDeviceL(*iQueue[0]);
-		}
-	CleanupStack::Pop(device);	
-    TRACE_FUNC_EXIT			
-	return err;
-	
-	}
-	
-// ---------------------------------------------------------------------
-// CBTPairedModel::HandleDisconnectCompleteL
-// Disconnection by CBluetoothPhysicalLinks, for those
-// connections not opened by btui. 
-// ---------------------------------------------------------------------
-//
-void CBTPairedModel::HandleDisconnectCompleteL(TInt aErr)
-	{
-	 TRACE_FUNC_ENTRY 
-	 
-	 if(iDisconnectDevice)
-	 	{
-	 	DisconnectComplete(iDisconnectDevice->iAddr,aErr);
-	 	}
-	 	
-	TRACE_FUNC_EXIT
-	}
-	
-// ---------------------------------------------------------------------
-// CBTPairedModel::FlagPhysicallyConnectedDevices
-//
-// Marks the EStatusPhysicallyConnected attribute to the devices
-// that have active connection.
-// ---------------------------------------------------------------------
-//
-void CBTPairedModel::FlagPhysicallyConnectedDevices(RDeviceArray &aDeviceArray)
-	{
-	TRACE_FUNC_ENTRY 
-	
-	RBTDevAddrArray a;
-	iLinks->Enumerate(a,KMaxCheckedConnections);
-	
-	TInt i=0; 
-	
-	for(i=0;i<aDeviceArray.Count();i++)
-		{
-        FlagPhysicallyConnectedDevices( *aDeviceArray[i], a );
-		}
-	a.Close();	
-	
-	TRACE_FUNC_EXIT 	
-	}
-	
-void CBTPairedModel::FlagPhysicallyConnectedDevices(TBTDevice& aDevice, RBTDevAddrArray& aBTDeviceArray)
-	{
-	TRACE_FUNC_ENTRY 
-	
-	TInt i2=0;
-	
-    UnsetStatusFlags( aDevice.iStatus, EStatusPhysicallyConnected );		
-    for( i2=0; i2<aBTDeviceArray.Count(); i2++ )
-        {
-        if(aDevice.iAddr == aBTDeviceArray[i2])
-            {
-            SetStatusFlags( aDevice.iStatus,EStatusPhysicallyConnected );		
-            break;				
-            }
-        }
-	
-	TRACE_FUNC_EXIT 	
-	}
-	
-// ---------------------------------------------------------------------
-// CBTPairedModel::GetDevice
-//
-// Adds the EPhysicallyConnected attribute devices that have any active
-// bluetooth connection.
-// ---------------------------------------------------------------------	
-//
-TInt CBTPairedModel::GetDevice(TBTDevice& aDevice)
-	{	
-	TRACE_FUNC_ENTRY 	
-	
-	TInt rvalue=CBTDevModelBase::GetDevice(aDevice);
-	RBTDevAddrArray a;
-	iLinks->Enumerate(a,KMaxCheckedConnections);
-    FlagPhysicallyConnectedDevices(aDevice, a);
-	a.Close();	
-	
-	TRACE_FUNC_EXIT 
-	
-	return rvalue;	
-	}
-	
-// ---------------------------------------------------------------------
-// CBTPairedModel::HandleLeave
-// from CBTDevModelBase
-// ---------------------------------------------------------------------
-//
-void CBTPairedModel::HandleLeave(TInt aErr,const TBTDevice* aDevice )
-	{
-	TRACE_FUNC_ENTRY
-	
-	iConnMan->CancelPairDevice();
-
-	delete iPairingDevice;
-	iPairingDevice=NULL;
-
-	delete iDisconnectDevice;
-	iDisconnectDevice=NULL;
-	
-	iRegistryObserver->StartIfNotRunning();
-	iRegistryObserver->Refresh();
-	
-	iState=EIdleState;
-	
-	CBTDevModelBase::HandleLeave(aErr,aDevice );
-	
-	TRACE_FUNC_EXIT
-	}
--- a/bluetoothengine/btui/devmodel/src/btregistryobserver.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,256 +0,0 @@
-/*
-* 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:  Monitors BTRegistry device changes and sends the 
-*				 new status to listener
-*
-*/
-
-#include "btregistryobserver.h"
-#include "debug.h"
-
-#include <bt_subscribe.h>
-const TInt KDeviceArrayDefaultSize=10;
-// ---------------------------------------------------------------------
-// Constructor
-// ---------------------------------------------------------------------
-CBTRegistryObserver::CBTRegistryObserver(MBTRegistryObserver* aObserver, 
-    const TBTRegistrySearch aPattern) 
-    	: CActive(CActive::EPriorityHigh), 
-      	  iObserver(aObserver),   iSearchPattern(aPattern)
-    {    
-    TRACE_FUNC_ENTRY
-    CActiveScheduler::Add(this);
-    // The priority will be EPriorityHigh only initially.
-    // after the first successfull retrieval of the devicelist
-    // the priority will be changed to EPriorityLow.
-    
-    // This will make the 1st devicelist drawn as quickly as possible,
-    // but the subsequent refrehes will not decrease the responsiveness
-    // of the Btui.
-    iAnotherEventPending=EFalse;
-    
-    TRACE_FUNC_EXIT
-    }
-// ---------------------------------------------------------------------
-// CBTRegistryObserver::NewL
-// ---------------------------------------------------------------------
-CBTRegistryObserver* CBTRegistryObserver::NewL(MBTRegistryObserver* aObserver,
-	  const TBTRegistrySearch aPattern)
-    {
-    CBTRegistryObserver* self = new (ELeave) CBTRegistryObserver(aObserver, aPattern);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
-// ---------------------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------------------    
-CBTRegistryObserver::~CBTRegistryObserver()
-    {
-    TRACE_FUNC_ENTRY
-    Cancel();
-    iProperty.Close();
-    delete iDevMan;
-    
-    DeleteAllocatedDevices();
-    
-    delete iRegDeviceArray;
-    iRegDeviceArray=NULL;
-    
-    TRACE_FUNC_EXIT
-    }
-// ---------------------------------------------------------------------
-// CBTRegistryObserver::ConstructL()
-// ---------------------------------------------------------------------
-void CBTRegistryObserver::ConstructL()
-    {
-    TRACE_FUNC_ENTRY
-	iRegDeviceArray = new (ELeave) CBTDeviceArray(KDeviceArrayDefaultSize);    
-    iDevMan =  CBTEngDevMan::NewL(this);
-    iDevMan->SetPriority(CActive::EPriorityHigh);
-    
-    iProperty.Attach(KPropertyUidBluetoothCategory, KPropertyKeyBluetoothGetRegistryTableChange);
-    StartIfNotRunning();
-    TRACE_FUNC_EXIT
-    }
-// ---------------------------------------------------------------------
-// CBTRegistryObserver::Refresh
-// This will simulate registry change event.
-// ---------------------------------------------------------------------    
-void CBTRegistryObserver::Refresh()
-	{
-	TRACE_FUNC_ENTRY
-	
-	__ASSERT_DEBUG(iDevMan, User::Invariant());
-	
-    if (iDevMan->IsActive())
-    	{
-    	// An attempt to start a new search, during a prior
-    	// one. 
-    	iAnotherEventPending=ETrue;
-    	return;
-    	}   
-	Cancel();
-
-    DeleteAllocatedDevices();
-    iDevMan->GetDevices(iSearchPattern, iRegDeviceArray);
-    
-	StartIfNotRunning();    
-    
-    TRACE_FUNC_EXIT    
-	}
-	
-// ---------------------------------------------------------------------
-// CBTRegistryObserver::StartIfNotRunning
-// this have to be called again each time there has been registry event
-// ---------------------------------------------------------------------
-void CBTRegistryObserver::StartIfNotRunning()
-    {
-    TRACE_FUNC_ENTRY
-    if (!IsActive())
-        {
-        TRACE_INFO(_L("Start()"))
-        iIsStopped = EFalse;
-        iProperty.Subscribe(iStatus);
-        SetActive();
-        }
-    TRACE_FUNC_EXIT        
-    }
-// ---------------------------------------------------------------------
-// CBTRegistryObserver::RunL
-// From CAtive
-// This is called when registry has changed. This will not
-// be called when BTRegistry date retrieval is complete, since
-// HandleGetDevicesComplete is called when RBTregistry data retrieval
-// is complete
-// ----------------------------------------------------------------------
-
-void CBTRegistryObserver::RunL()
-    {
-    TRACE_FUNC_ENTRY
-    if(iDevMan && iDevMan->IsActive())
-    	{
-    	// An attempt to start a new search, during a prior
-    	// one. We will not start a new search, but we
-    	// will do it after the current search is complete
-    	iAnotherEventPending=ETrue;
-    	StartIfNotRunning();
-		TRACE_FUNC_EXIT    	
-    	return;
-    	}
-    if(!IsActive())
-    	SetPriority(CActive::EPriorityLow);
-    
-    
-
-    TInt registryTable;
-    iProperty.Get(registryTable);
-    iAnotherEventPending=EFalse;
-    
-    if(iDevMan && iStatus.Int() == KErrNone && registryTable == KRegistryChangeRemoteTable)
-        {
-        TRACE_INFO(_L("Remote table change"))
-        
-        DeleteAllocatedDevices();
-        iDevMan->GetDevices(iSearchPattern, iRegDeviceArray);
-        }
-    StartIfNotRunning();
-    TRACE_FUNC_EXIT
-    }
-
-// ---------------------------------------------------------------------
-// CBTRegistryObserver::HandleGetDevicesComplete
-// From MBTEngDevManObserver
-//
-// This function will not filter out refreshes with no changes,
-// since the connect status may have been changed in those cases, and
-// this class does not know about that
-//
-// It is worth to mention that CBTDeviceContainer will not refresh parts
-// of the screen that are not changed.
-// ---------------------------------------------------------------------
-void  CBTRegistryObserver::HandleGetDevicesComplete(TInt aErr, CBTDeviceArray* aDeviceArray)
-    {
-    TRACE_FUNC_ENTRY
-    TRACE_INFO((_L("aErr = %d"), aErr))
-    
-    // the initial view refresh is done. We will decrese
-    // the priority of this component to quarantee UI
-    // responsiveness
-    if(!iDevMan->IsActive())
-    	iDevMan->SetPriority(CActive::EPriorityLow);
-    
-    TRAP_IGNORE(
-		if( aErr != KErrNotFound)
-			iObserver->RegistryChangedL(aDeviceArray );
-		else
-			{
-			// handle the empty response case. The DevMan may issue
-			// NULL in that case 
-			iObserver->RegistryChangedL(iRegDeviceArray );	
-			}
-	);	
-
-    DeleteAllocatedDevices();
-
-	if(iAnotherEventPending)	
-		{
-		// Current results are not sent further, since
-		// there has been changes, witch may have rendered the current
-		// results allready obsolate. Therefore a refresh is made instead
-    
-		iAnotherEventPending=EFalse;
-        iDevMan->GetDevices(iSearchPattern, iRegDeviceArray);
-		}
-    TRACE_FUNC_EXIT		
-    }
-
-// ---------------------------------------------------------------------
-// CBTRegistryObserver::DeleteAllocatedDevices
-// ---------------------------------------------------------------------
-void CBTRegistryObserver::DeleteAllocatedDevices()
-	{
-	TRACE_FUNC_ENTRY
-	if(iRegDeviceArray)
-		{
-        iRegDeviceArray->ResetAndDestroy();
-        }
-    TRACE_FUNC_EXIT		
-	}
-// ---------------------------------------------------------------------
-// CBTRegistryObserver::Cancel
-// From CActive
-// ---------------------------------------------------------------------
-    
-void CBTRegistryObserver::Cancel()
-    {
-    TRACE_FUNC_ENTRY
-    iIsStopped = ETrue;
-    iAnotherEventPending=EFalse;    
-    CActive::Cancel();
-    if (iDevMan) iDevMan->Cancel();
-    DeleteAllocatedDevices();
-    TRACE_FUNC_EXIT    
-    }
-// ---------------------------------------------------------------------
-// CBTRegistryObserver::DoCancel
-// From CActive
-// ---------------------------------------------------------------------
-void CBTRegistryObserver::DoCancel()
-	{
-	TRACE_FUNC_ENTRY
-    iProperty.Cancel();	
-    TRACE_FUNC_EXIT
-	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/eabi/btuidelegateu.def	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,16 @@
+EXPORTS
+	_ZN17BtDelegateFactory11newDelegateEN10BtDelegate7CommandER9BtuiModelP7QObject @ 1 NONAME
+	_ZN18BtAbstractDelegate11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME
+	_ZN18BtAbstractDelegate11qt_metacastEPKc @ 3 NONAME
+	_ZN18BtAbstractDelegate16commandCompletedEi8QVariant @ 4 NONAME
+	_ZN18BtAbstractDelegate16staticMetaObjectE @ 5 NONAME DATA 16
+	_ZN18BtAbstractDelegate19getStaticMetaObjectEv @ 6 NONAME
+	_ZN18BtAbstractDelegate5modelEv @ 7 NONAME
+	_ZN18BtAbstractDelegateC2ER9BtuiModelP7QObject @ 8 NONAME
+	_ZN18BtAbstractDelegateD0Ev @ 9 NONAME
+	_ZN18BtAbstractDelegateD1Ev @ 10 NONAME
+	_ZN18BtAbstractDelegateD2Ev @ 11 NONAME
+	_ZNK18BtAbstractDelegate10metaObjectEv @ 12 NONAME
+	_ZTI18BtAbstractDelegate @ 13 NONAME
+	_ZTV18BtAbstractDelegate @ 14 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/eabi/btuimodelu.def	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,23 @@
+EXPORTS
+	_ZN9BtuiModel11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
+	_ZN9BtuiModel11qt_metacastEPKc @ 2 NONAME
+	_ZN9BtuiModel13btDataChangedEiiPv @ 3 NONAME
+	_ZN9BtuiModel16staticMetaObjectE @ 4 NONAME DATA 16
+	_ZN9BtuiModel19getStaticMetaObjectEv @ 5 NONAME
+	_ZN9BtuiModelC1EP7QObject @ 6 NONAME
+	_ZN9BtuiModelC1ERKS_P7QObject @ 7 NONAME
+	_ZN9BtuiModelC2EP7QObject @ 8 NONAME
+	_ZN9BtuiModelC2ERKS_P7QObject @ 9 NONAME
+	_ZN9BtuiModelD0Ev @ 10 NONAME
+	_ZN9BtuiModelD1Ev @ 11 NONAME
+	_ZN9BtuiModelD2Ev @ 12 NONAME
+	_ZNK9BtuiModel10metaObjectEv @ 13 NONAME
+	_ZNK9BtuiModel11columnCountERK11QModelIndex @ 14 NONAME
+	_ZNK9BtuiModel4dataERK11QModelIndexi @ 15 NONAME
+	_ZNK9BtuiModel5indexEiiRK11QModelIndex @ 16 NONAME
+	_ZNK9BtuiModel6parentERK11QModelIndex @ 17 NONAME
+	_ZNK9BtuiModel8itemDataERK11QModelIndex @ 18 NONAME
+	_ZNK9BtuiModel8rowCountERK11QModelIndex @ 19 NONAME
+	_ZTI9BtuiModel @ 20 NONAME
+	_ZTV9BtuiModel @ 21 NONAME
+
--- a/bluetoothengine/btui/group/BTUI.mmp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 BTUI.
-*
-*/
-
-#include <bldvariant.hrh>
-#include <data_caging_paths.hrh>
-#include <platform_paths.hrh>
-
-VENDORID	VID_DEFAULT
-
-CAPABILITY		CAP_APPLICATION NetworkServices NetworkControl
-
-TARGET          BTUI.exe
-TARGETTYPE      exe
-EPOCSTACKSIZE	0x5000
-UID             0x100039CE 0x10005951
-
-SOURCEPATH      ../src
-SOURCE          BTUIApp.cpp
-SOURCE          BTUIAppUi.cpp
-SOURCE          BTUIDocument.cpp
-
-
-// Application Resource
-//
-START RESOURCE  ../data/BTUI.rss
-HEADER
-TARGETPATH APP_RESOURCE_DIR
-LANGUAGE_IDS
-END 
-
-
-// Application Registeration Resource
-//
-START RESOURCE ../data/Btui_reg.rss
-DEPENDS btui.rsg
-
-// Do not change the UID below.
-TARGETPATH /private/10003a3f/apps
-END
-
-USERINCLUDE     ../inc 			
-USERINCLUDE		../devmodel/inc
-USERINCLUDE		../Ecom/inc
-USERINCLUDE		../data
-
-SYSTEMINCLUDE   ../../inc   	//for private API headers (BluetoothEngine subsystem)
-SYSTEMINCLUDE   ../../../inc    //for internal API headers (localconnectivity)
-MW_LAYER_SYSTEMINCLUDE
-
-LIBRARY         euser.lib apparc.lib cone.lib       // Symbian OS framework libraries
-LIBRARY         eikcore.lib eikcoctl.lib eikctl.lib // UIKON libraries
-LIBRARY         avkon.lib                           // Series 60 UI library
-LIBRARY         bafl.lib                            // Basic Application Framework 
-LIBRARY         AknSkins.lib                        // Skinned icons
-LIBRARY         aknicon.lib
-LIBRARY         BtdevModel.lib
-LIBRARY         ecom.lib
-           
-LIBRARY         GSEcomPlugin.lib
-LIBRARY         GSFramework.lib
-
-#ifdef __SERIES60_HELP
-LIBRARY         hlplch.lib                          // Help library
-#endif
-
-DEBUGLIBRARY    flogger.lib                         // File logging services
-
-// This is optional - used only by Codewarrior IDE for .RSS file editing.
-//
-//Document		../data/Btui_reg.rss
-//Document		../data/BTUI.rss
-//Document		../inc/btui.loc
-
-// End of File
--- a/bluetoothengine/btui/group/bld.inf	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, 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 project information required for BTUI.
-*
-*/
-
-
-#include <platform_paths.hrh>
-//#include "../devmodel/group/bld.inf"
-
-PRJ_PLATFORMS
-//DEFAULT
-
-PRJ_EXPORTS
-../loc/btui.loc        MW_LAYER_LOC_EXPORT_PATH(btui.loc)
-//../rom/btui.iby        CORE_MW_LAYER_IBY_EXPORT_PATH(btui.iby)
-//../rom/BtuiResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(BtuiResources.iby)
-../inc/BtuiPluginInterface.h |../../inc/BtuiPluginInterface.h
-../inc/BtuiPluginInterface.inl |../../inc/BtuiPluginInterface.inl
-../Ecom/inc/bluetoothuiutil.h   |../../inc/bluetoothuiutil.h
-../Ecom/inc/bluetoothuiutil.inl |../../inc/bluetoothuiutil.inl
-// Help exports
-#include "../help/group/bld.inf"
-
-PRJ_EXTENSIONS
-
-START EXTENSION s60/mifconv
-OPTION TARGETFILE btui.mif
-OPTION HEADERFILE btui.mbg
-OPTION SOURCES \
-             -c8,8 qgn_prop_bt_devices_tab3 -c8,8 qgn_prop_bt_set_tab3 -c8,8 qgn_prop_set_apps_bt \
-		         -c8,8 qgn_prop_bt_blocked_tab3 -c8,8 qgn_prop_set_apps_bt_off -c8,8 qgn_prop_set_apps_bt_on_shown \
-		         -c8,8 qgn_prop_set_apps_bt_on_hidden -c8,8 qgn_prop_set_apps_bt_conn_shown -c8,8 qgn_prop_set_apps_bt_conn_hidden \
-		         -c8,8 qgn_prop_bt_audio_connect -c8,8 qgn_prop_bt_computer_connect -c8,8 qgn_prop_bt_car_kit_connect \
-		         -c8,8 qgn_prop_bt_keyboard_connect -c8,8 qgn_prop_bt_mouse_connect
-END
-
-START EXTENSION s60/mifconv
-OPTION TARGETFILE btui_aif.mif
-OPTION SOURCES -c8,8 qgn_menu_bt
-END
-
-PRJ_MMPFILES
-
-// CP plugin API removed. Do not build "../Ecom/group/BtuiPlugin.mmp"	
-//../group/BTUI.mmp			
-
-
-//---End of File---  
--- a/bluetoothengine/btui/group/btui_Icons_aif_bitmaps_dc.mk	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-#
-# 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: 
-#
-
-ifeq (WINS,$(findstring WINS, $(PLATFORM)))
-ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
-else
-ZDIR=\epoc32\data\z
-endif
-
-# ----------------------------------------------------------------------------
-# TODO: Configure these
-# ----------------------------------------------------------------------------
-
-TARGETDIR=$(ZDIR)\resource\apps
-ICONTARGETFILENAME=$(TARGETDIR)\btui_aif.mbm
-
-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) \
-		/c8,8 qgn_menu_bt_lst.bmp \
-		/c8,8 qgn_menu_bt_cxt.bmp
-
-FREEZE : do_nothing
-
-SAVESPACE : do_nothing
-
-RELEASABLES :
-	@echo $(ICONTARGETFILENAME)
-
-FINAL : do_nothing
-  
\ No newline at end of file
--- a/bluetoothengine/btui/group/btui_Icons_aif_scalable_dc.mk	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-#
-# 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: 
-#
-
-ifeq (WINS,$(findstring WINS, $(PLATFORM)))
-ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
-else
-ZDIR=\epoc32\data\z
-endif
-
-# ----------------------------------------------------------------------------
-# TODO: Configure these
-# ----------------------------------------------------------------------------
-
-TARGETDIR=$(ZDIR)\resource\apps
-ICONTARGETFILENAME=$(TARGETDIR)\btui_aif.mif
-
-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) \
-		/c8,8 qgn_menu_bt.svg
-
-FREEZE : do_nothing
-
-SAVESPACE : do_nothing
-
-RELEASABLES :
-	@echo $(ICONTARGETFILENAME)
-
-FINAL : do_nothing
-  
\ No newline at end of file
--- a/bluetoothengine/btui/group/btui_icons_dc.mk	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-#
-# 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: 
-#
-
-ifeq (WINS,$(findstring WINS, $(PLATFORM)))
-ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
-else
-ZDIR=\epoc32\data\z
-endif
-
-# ----------------------------------------------------------------------------
-# TODO: Configure these
-# ----------------------------------------------------------------------------
-
-TARGETDIR=$(ZDIR)\resource\apps
-ICONTARGETFILENAME=$(TARGETDIR)\btui.mif
-
-HEADERDIR=\epoc32\include
-HEADERFILENAME=$(HEADERDIR)\btui.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, \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_bt_devices_tab3.svg \
-		/c8,8 qgn_prop_bt_set_tab3.svg \
-		/c8,8 qgn_prop_set_apps_bt.svg \
-		/c8,8 qgn_prop_bt_blocked_tab3.svg \
-		/c8,8 qgn_prop_set_apps_bt_off.svg \
-		/c8,8 qgn_prop_set_apps_bt_on_shown.svg \
-		/c8,8 qgn_prop_set_apps_bt_on_hidden.svg \
-		/c8,8 qgn_prop_set_apps_bt_conn_shown.svg \
-		/c8,8 qgn_prop_set_apps_bt_conn_hidden.svg \
-		/c8,8 qgn_prop_bt_audio_connect.svg \
-		/c8,8 qgn_prop_bt_computer_connect.svg \
-		/c8,8 qgn_prop_bt_car_kit_connect.svg \
-		/c8,8 qgn_prop_bt_keyboard_connect.svg
-
-FREEZE : do_nothing
-
-SAVESPACE : do_nothing
-
-RELEASABLES :
-	@echo $(HEADERFILENAME)&& \
-	@echo $(ICONTARGETFILENAME)
-
-FINAL : do_nothing
-  
Binary file bluetoothengine/btui/help/data/xhtml.zip has changed
--- a/bluetoothengine/btui/help/group/bld.inf	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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/bt.hlp.hrh	MW_LAYER_PLATFORM_EXPORT_PATH(csxhelp/bt.hlp.hrh)
-../rom/btuihelps_variant.iby		CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(btuihelps_variant.iby)
--- a/bluetoothengine/btui/help/inc/bt.hlp.hrh	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description:
-*
-*/
-	
-//
-// bt.hlp.hrh generated by CSXHelp Utilities.
-//           
-
-#ifndef __BT_HLP_HRH__
-#define __BT_HLP_HRH__
-
-_LIT(KBT_HLP_MAIN, "BT_HLP_MAIN"); // 
-_LIT(KBT_HLP_PAIRED, "BT_HLP_PAIRED"); // 
-_LIT(KBT_HLP_BLOCKED, "BT_HLP_BLOCKED"); // 
-_LIT(KBTKEYBOARD_HLP_SETTINGS, "BTKEYBOARD_HLP_SETTINGS"); // 
-
-#endif 
--- a/bluetoothengine/btui/help/rom/btuihelps_variant.iby	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef __BTUIHELPS_VARIANT_IBY__
-#define __BTUIHELPS_VARIANT_IBY__
-
-#if defined(FF_S60_HELPS_IN_USE) && defined(__BT)
-    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x10005951\contents.zip, RESOURCE_FILES_DIR\xhtml\%02d\0x10005951\contents.zip)
-    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x10005951\index.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x10005951\index.xml)
-    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x10005951\keywords.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x10005951\keywords.xml)
-    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x10005951\meta.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x10005951\meta.xml)
-#endif
-
-#endif
\ No newline at end of file
--- a/bluetoothengine/btui/inc/BTUIApp.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
-* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-#ifndef BTUIAPP_H
-#define BTUIAPP_H
-
-#include <aknapp.h>
-
-/**
-* CBTUIApp application class
-*
-* Provides factory to create concrete document object.
-*
-* @lib btui.exe
-* @sice S60v3.0
-*/
-class CBTUIApp : public CAknApplication
-    {
-
-    private:
-
-        /**
-        * From CAknApplication Creates CBTUIDocument document object.
-        * @return A pointer to the created document object.
-        */
-        CApaDocument* CreateDocumentL();
-
-        /**
-        * From CAknApplication  Returns application's UID (KUidBTUI).
-        * @return The value of KUidBTUI.
-        */
-        TUid AppDllUid() const;
-    };
-
-#endif
-
-
-
--- a/bluetoothengine/btui/inc/BTUIAppUi.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-/*
-* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-#ifndef BTUIAPPUI_H
-#define BTUIAPPUI_H
-
-// INCLUDES
-#include <aknapp.h>         // AVKON components
-#include <aknViewAppUi.h>
-#include <akntabgrp.h>
-#include <aknnavide.h>
-#include <AknTabObserver.h>
-#include "BtuiPluginInterface.h"
-
-// CLASS DECLARATION
-
-/**
-*  This class is a base class mandatory for all Symbian OS UI applications.
-*/
-class CBTUIAppUi : public CAknViewAppUi, 
-                   public MAknTabObserver,
-                   public MBtuiPluginViewActivationObserver
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Symbian 2nd phase constructor.
-        */
-        void ConstructL();
-
-        /**
-        * Destructor
-        */
-        virtual ~CBTUIAppUi();
-
-       
-    public: // Functions from base classes
-
-        /**
-        * From CAknViewAppUi Handles user commands.
-        * @param aCommand A command id.        
-        * @return None.
-        */
-        void HandleCommandL(TInt aCommand);
-
-    private: // Functions from base classes
-
-        /**
-        * From CAknViewAppUi Initializes menu pane dynamically.
-        * @param aResourceId Resource ID identifying the menu pane to initialise.
-        * @param aMenuPane The in-memory representation of the menu pane.
-        * @return None.
-        */
-        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
-        
-        /**
-        * From CAknViewAppUi Handles key events.
-        * @param aKeyEvent The key event that occurred.
-        * @param aType The event type.
-        * @return Response to the key event.
-        */
-        virtual TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent,TEventCode aType );
-        
-        /**
-        * From MBtuiPluginViewActivationObserver
-        * @param aViewId  activated plugin id
-        * @return none
-        */
-        void PluginViewActivated(TPluginViewId aViewId);  
-
-        /**
-        * From MAknTabObserver Takes care of tab handling.
-        * @param aIndex tab to be handled
-        */
-        virtual void TabChangedL(TInt aIndex); 
-
-    private: // Data
-
-		CAknNavigationControlContainer* iNaviPane;          // pointer to the navi pane control
-        CAknTabGroup*                   iTabGroup;          // Tab group
-        CAknNavigationDecorator*        iDecoratedTabGroup; // Frame for tabgroup                               
-    };
-
-#endif
-
--- a/bluetoothengine/btui/inc/BTUIDocument.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
-* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-#ifndef BTUIDOCUMENT_H
-#define BTUIDOCUMENT_H
-
-// INCLUDES
-
-#include <AknDoc.h>
-#include <aknapp.h>
-
-// FORWARD DECLARATIONS
-
-class CEikAppUi;
-//class CBTUIModel;
-
-// CLASS DECLARATION
-
-/**
-*  This class is a base class mandatory for all Symbian OS UI applications.
-*/
-class CBTUIDocument : public CAknDocument
-    {
-    public: // Constructors and destructor
-
-		/**
-        * Two-phased constructor.
-        */
-        static CBTUIDocument* NewL(CAknApplication& aApp);
-
-		/**
-        * Destructor.
-        */
-        virtual ~CBTUIDocument();
-
-	private: // Functions from base classes
-
-		/**
-        * From CAknDocument Creates AppUi class.        
-        * @param None.
-        * @return A reference to created class.
-        */
-		CEikAppUi*  CreateAppUiL();
-
-    private:
-
-		/**
-        * C++ default constructor.
-        */
-        CBTUIDocument(CEikApplication& aApp) :CAknDocument(aApp) { }
-
-		/**
-        * By default Symbian 2nd phase constructor is private.
-        */
-        void ConstructL();
-    };
-
-#endif
-
--- a/bluetoothengine/btui/inc/BtuiPluginInterface.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-/*
-* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef BTUIPLUGININTERFACE_H
-#define BTUIPLUGININTERFACE_H
-
-#include <aknview.h>
-#include <gsbaseview.h>
-#include <btdevice.h>
-
-const TUid KCBtuiPluginInterfaceUid    = { 0x1020745F }; 
-
-
-enum TPluginViewId 
-{
-    EMainViewId =1,
-    EPairedDevicesViewId=2,
-    EBlockedDevicesViewId=3
-};
-
-
-
-/**
-* Callback interface for plugins view activation observer
-*/
-class MBtuiPluginViewActivationObserver
-{
-public: 
-    /**
-     *  Called when view is activated
-     *
-     *  @param aView Activated view id
-     */
-    virtual void PluginViewActivated(TPluginViewId aViewId)=0;    
-};
-
-
-/** This class implements the CGSPluginInterface which is used 
-* to implement the main view as general settings plugin.
-*
-*@lib BTUIPlugin.dll
-*@since S60 v3.1
-*/
-class CBtuiPluginInterface	: public CGSBaseView
-    {    
-    public: // Constructors & destructors
-
-        /**
-        * Creates new BTUI View plugin having the given UID.
-        * Uses Leave code KErrNotFound if implementation is not found.
-        *
-        * @param aImplementationUid Implementation UID of the plugin to be 
-        *        created.
-        * @param aModel Pointer to the BTUI Model of BTUI Application.
-        */                                                 
-        static CBtuiPluginInterface* NewL(
-            const TUid aImplementationUid, MBtuiPluginViewActivationObserver* aObserver = NULL);
-
-        /**
-        * From CGSPluginInterface
-        */            
-		void GetCaptionL( TDes& aCaption ) const;
-
-        /**
-        * Destructor
-        */
-        inline ~CBtuiPluginInterface();
-        
-        /**
-         * One ECom plugin of a type of HID device has its unique DeviceClass.
-         * The HID plugin has to implement this function to report the plug-in loader of its COD.
-         * Otherwise, it won't be added to enable setting view.
-         * @return TBTDeviceClass Class of Device defined in btdevice.h
-         */        
-        inline void SetCOD(TBTDeviceClass& aCOD);
-        inline TBTDeviceClass GetCOD() const;
-            
-    protected: 
-    	/** Non leaving constructor
-    	*/
-        inline CBtuiPluginInterface();
-
-		inline void NewContainerL();
-
-		inline void HandleListBoxSelectionL();
-
-			
-    private: // Data
-
-        /**
-        * ECOM plugin instance UID.
-        */
-        TUid iDtor_ID_Key;
-        TBTDeviceClass iCOD;
-    };
-
-#include "BtuiPluginInterface.inl"
-
-#endif //BTUIPLUGININTERFACE_H
--- a/bluetoothengine/btui/inc/BtuiPluginInterface.inl	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 code of CBtuiPluginInterface class.
-*
-*/
-
-
-// -----------------------------------------------------------------------------
-// Empty implementations of 3 pure virtual functions 
-// defined in base class CGSBaseView
-// -----------------------------------------------------------------------------
-inline void CBtuiPluginInterface::NewContainerL()
-	{	
-	}
-inline void CBtuiPluginInterface::HandleListBoxSelectionL()
-	{	
-	}
-inline CBtuiPluginInterface::CBtuiPluginInterface()
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// Destructor
-// -----------------------------------------------------------------------------
-//
-inline CBtuiPluginInterface::~CBtuiPluginInterface()
-    {
-    REComSession::DestroyedImplementation( iDtor_ID_Key );
-    }
-
-// -----------------------------------------------------------------------------
-// CBtuiPluginInterface::NewL
-// -----------------------------------------------------------------------------
-//
-inline CBtuiPluginInterface* CBtuiPluginInterface::NewL( 
-    TUid aImplementationUid, MBtuiPluginViewActivationObserver* aObserver)
-    {
-    TInt32 keyOffset = _FOFF( CBtuiPluginInterface, iDtor_ID_Key );
-    TAny* ptr = REComSession::CreateImplementationL( aImplementationUid, keyOffset, aObserver);
-    
-    return reinterpret_cast< CBtuiPluginInterface* >( ptr ) ;
-    }
-
-// -----------------------------------------------------------------------------
-// CBtuiPluginInterface::NewL
-// offer a default implementation to make it non-pure virtual.
-// -----------------------------------------------------------------------------
-//
-inline void CBtuiPluginInterface::GetCaptionL( TDes& aCaption ) const
-	{
-	_LIT( NO_CAPTION,"no caption to offer" );
-	aCaption.Copy(NO_CAPTION);
-	return;
-	}
-
-// -----------------------------------------------------------------------------
-// CBtuiPluginInterface::SetCOD
-// only used for derived add-on plugins out of BTUI
-// -----------------------------------------------------------------------------
-//
-inline void CBtuiPluginInterface::SetCOD(TBTDeviceClass& aCOD)
-	{
-	iCOD = aCOD;
-	}
-inline TBTDeviceClass CBtuiPluginInterface::GetCOD() const
-    {
-	return iCOD;
-    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/inc/bluetoothtrace.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,455 @@
+/*
+* ============================================================================
+*  Name        : bluetoothtrace.h
+*  Part of     : BluetoothUI / bluetoothuimodel       *** Info from the SWAD
+*  Description : API declaration of run-time debug tracing
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef BLUETOOTHTRACE_H
+#define BLUETOOTHTRACE_H
+
+#include <e32base.h>
+#include "traceconfig.h"
+
+/*
+ * Common tracing utility definition to be used by Bluetooth projects.
+ * The configuration is loaded from traceconfig.h which shall be private for
+ * each individual project.
+ * 
+ * In this utility, a set of OST-alike tracing macros are defined. 
+ * (The purpose is to ease migration to OST in future.)
+ * 
+ * Individual project can also define new macros based on this utility in
+ * its own space.
+ * 
+ */
+
+#ifdef BLUETOOTHTRACE_ENABLED
+
+#ifdef BLUETOOTHTRACE_MEDIA_OST
+
+/**
+ * Convert own macros to OST macros when OST tracing is used.
+ * In OST tracing, aTraceName must be a unique identifier in scope of a module. 
+ * Thus many OST compiling errors may occur if the same TraceName is used in multiple
+ * tracing lines where tracing is miigrated from non-OST to OST. 
+ * The fix is to renaming the TraceName:s to be unique.
+ */
+#include <OpenSystemTrace.h>
+
+#define BOstrace0( aGroupName, aTraceName, aTraceText ) \
+    OstTrace0( aGroupName, aTraceName, aTraceText )
+
+#define BOstrace1( aGroupName, aTraceName, aTraceText, aParam ) \
+    OstTrace1( aGroupName, aTraceName, aTraceText, aParam )
+
+#define BOstraceData( aGroupName, aTraceName, aTraceText, aPtr, aLength ) \
+    OstTraceData( aGroupName, aTraceName, aTraceText, aPtr, aLength )
+
+#define BOstraceExt1( aGroupName, aTraceName, aTraceText, aParam ) \
+    OstTraceExt1( aGroupName, aTraceName, aTraceText, aParam )
+
+#define BOstraceExt2( aGroupName, aTraceName, aTraceText, aParam1, aParam2 ) \
+    OstTraceExt2( aGroupName, aTraceName, aTraceText, aParam1, aParam2 )
+
+#define BOstraceExt3( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3 ) \
+    OstTraceExt3( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3 )
+
+#define BOstraceExt4( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4 ) \
+    OstTraceExt4( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4 )
+
+#define BOstraceExt5( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4, aParam5 ) \
+    OstTraceExt5( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4, aParam5 )
+
+#define BOstraceFunctionEntry0( aTraceName ) \
+    OstTraceFunctionEntry0( aTraceName )
+
+#define BOstraceFunctionEntry1( aTraceName, aInstance ) \
+    OstTraceFunctionEntry1( aTraceName, aInstance )
+
+#define BOstraceFunctionEntryExt(aTraceName, aInstance, aArg) \
+    OstTraceFunctionEntryExt(aTraceName, aInstance, aArg)
+
+#define BOstraceFunctionExit0( aTraceName ) \ 
+    OstTraceFunctionExit0( aTraceName )
+
+#define BOstraceFunctionExit1( aTraceName, aInstance ) \
+    OstTraceFunctionExit1( aTraceName, aInstance )
+
+#define BOstraceFunctionExitExt(aTraceName, aInstance, aRetval) \
+    OstTraceFunctionExitExt(aTraceName, aInstance, aRetval)
+    
+#define BOstraceEventStart0( aTraceName, aEventName ) \
+    OstTraceEventStart0( aTraceName, aEventName )
+    
+#define BOstraceEventStart1( aTraceName, aEventName, aParam ) \
+    OstTraceEventStart1( aTraceName, aEventName, aParam )
+
+#define BOstraceEventStop( aTraceName, aEventName ) \
+    OstTraceEventStop( aTraceName, aEventName )
+
+#define BOstraceState0( aTraceName, aStateName, aNewState ) \
+    OstTraceState0( aTraceName, aStateName, aNewState )
+
+#define BOstraceState1( aTraceName, aStateName, aNewState, aInstance ) \
+    OstTraceState1( aTraceName, aStateName, aNewState, aInstance )
+    
+#else  // BLUETOOTHTRACE_MEDIA_OST
+
+#ifdef BLUETOOTHTRACE_MEDIA_FILE
+#include <flogger.h>
+#else   
+#include <e32debug.h>
+#endif
+
+/**
+ * When tracing compilation with OST is disabled, the TraceName in each OST trace line
+ * is ignored, that is, the Trace Names are not checked at compiling time, neither
+ * are they written into the specified trace output media.
+ */
+    
+/**
+ * Handlers below are used for tolerating overflow of formatting strings.
+ * to trucate rather than panic the caller.
+ */
+NONSHARABLE_CLASS( TBtTraceOflowTruncate8 ) : public TDes8Overflow
+    {
+public:
+    void Overflow( TDes8& /*aDes*/ ) {}
+    };
+
+NONSHARABLE_CLASS( TBtTraceOflowTruncate16 ) : public TDes16Overflow
+    {
+public:
+    void Overflow( TDes16& /*aDes*/ ) {}
+    };
+
+/**
+ * internal tracing implementation, do not use it out of this file.
+ */
+inline void Trace(const TDesC &trGrp, const TDesC &trTxt)
+{
+    _LIT(Format, "%S%S%S");
+    TBuf16<0x180> str; 
+    TPtrC cp(KComponentName);
+    str.Format(Format, &cp, &trGrp, &trTxt);
+#ifdef BLUETOOTHTRACE_MEDIA_FILE
+    RFileLogger::WriteFormat( KLogDir, KLogFile, EFileLoggingModeAppend, str);
+#else
+    RDebug::Print( str );
+#endif
+}
+
+/*
+ * trace with no parameters
+ */
+#define BOstrace0( aGroupName, aTraceName, aTraceText ) \
+{\
+    _LIT(TrGrp, aGroupName); _LIT(TrTxt, aTraceText); \
+    Trace( TrGrp, TrTxt ); \
+}
+
+/*
+ * trace with one 32-bit parameter
+ */
+#define BOstrace1( aGroupName, aTraceName, aTraceText, aParam ) \
+{\
+    _LIT(TrGrp, aGroupName); _LIT(TrTxt, aTraceText); \
+    TBuf<512> buf; TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(TrTxt, &overflow, aParam); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * trace with more than 32 bits of data. Not supported
+ */
+#define BOstraceData( aGroupName, aTraceName, aTraceText, aPtr, aLength ) 
+
+/*
+ * trace with one parameter that is not 32-bit integer
+ */
+#define BOstraceExt1( aGroupName, aTraceName, aTraceText, aParam ) \
+    BOstrace1( aGroupName, aTraceName, aTraceText, aParam )
+
+/*
+ * trace with two parameters.
+ */
+#define BOstraceExt2( aGroupName, aTraceName, aTraceText, aParam1, aParam2 ) \
+{\
+    _LIT(TrGrp, aGroupName); _LIT(TrTxt, aTraceText); \
+    TBuf<512> buf; TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(TrTxt, &overflow, aParam1, aParam2); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * trace with three parameters.
+ */
+#define BOstraceExt3( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3 ) \
+{\
+    _LIT(TrGrp, aGroupName); _LIT(TrTxt, aTraceText); \
+    TBuf<512> buf; TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(TrTxt, &overflow, aParam1, aParam2, aParam3); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * trace with four parameters
+ */    
+#define BOstraceExt4( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4 ) \
+{\
+    _LIT(TrGrp, aGroupName); _LIT(TrTxt, aTraceText); \
+    TBuf<512> buf; TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(TrTxt, &overflow, aParam1, aParam2, aParam3, aParam4); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * trace with five parameters
+ */   
+#define BOstraceExt5( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4, aParam5 ) \
+{\
+    _LIT(TrGrp, aGroupName); _LIT(TrTxt, aTraceText); \
+    TBuf<512> buf; TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(TrTxt, &overflow, aParam1, aParam2, aParam3, aParam4, aParam5); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * Function entry trace without extra parameters. 
+ * The trace is mapped to TRACE_API group.
+ */
+#define BOstraceFunctionEntry0( aTraceName ) \
+{\
+    _LIT(TrGrp, "[ API ]"); \
+    TPtrC8 func( (TUint8*) __PRETTY_FUNCTION__ ); \
+    _LIT(Entry, ">> "); \
+    TBuf<512> buf; buf.Copy( func ); buf.Insert(0, Entry );\
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * Function entry trace with a parameter representing the instance identifier, e.g.
+ * "this" pointer.
+ * The trace is mapped to TRACE_API group.
+ */
+#define BOstraceFunctionEntry1( aTraceName, aInstance ) \
+{\
+    _LIT(TrGrp, "[ API ]");\
+    TPtrC8 func( (TUint8*) __PRETTY_FUNCTION__ ); \
+    _LIT(Entry, ">> "); _LIT(Fmt, " 0x%X(%d)"); \
+    TBuf<512> buf; buf.Copy( func ); buf.Insert(0, Entry); \
+    TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(Fmt, &overflow, aInstance, aInstance); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * Function entry trace, which traces function parameters.
+ * The trace is mapped to TRACE_API group. 
+ */
+#define BOstraceFunctionEntryExt(aTraceName, aInstance, aArg) \
+{ \
+    _LIT(TrGrp, "[ API ]");\
+    TPtrC8 func( (TUint8*) __PRETTY_FUNCTION__ ); \
+    _LIT(Entry, ">> "); _LIT(Fmt, " 0x%X(%d) arg %d"); \
+    TBuf<512> buf; buf.Copy( func );  buf.Insert(0, Entry); \
+    TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(Fmt, &overflow, aInstance, aInstance, aArg); \
+    Trace( TrGrp, buf ); \
+}
+/*
+ * Function exit trace without extra parameters. 
+ * The trace is mapped to TRACE_API group.
+ */
+#define BOstraceFunctionExit0( aTraceName ) \
+{\
+    _LIT(TrGrp, "[ API ]"); \
+    TPtrC8 func( (TUint8*) __PRETTY_FUNCTION__ ); \
+    _LIT(Entry, "<< "); \
+    TBuf<512> buf; buf.Copy( func );  buf.Insert(0, Entry); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * Function exit trace with a parameter representing the instance identifier
+ * for example "this" pointer.
+ * The trace is mapped to TRACE_API group.
+ */
+#define BOstraceFunctionExit1( aTraceName, aInstance ) \
+{\
+    _LIT(TrGrp, "[ API ]"); \
+    TPtrC8 func( (TUint8*) __PRETTY_FUNCTION__ ); \
+    _LIT(Entry, "<< "); _LIT(Fmt, " 0x%X(%d)"); \
+    TBuf<512> buf; buf.Copy( func );  buf.Insert(0, Entry); \
+    TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(Fmt, &overflow, aInstance, aInstance); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * Function exit trace with parameters representing the instance identifier, 
+ * for example "this" pointer, and return value.
+ * The trace is mapped to TRACE_API group.
+ */
+#define BOstraceFunctionExitExt(aTraceName, aInstance, aRetval) \
+{\
+    _LIT(TrGrp, "[ API ]");\
+    TPtrC8 func( (TUint8*) __PRETTY_FUNCTION__ ); \
+    _LIT(Entry, "<< "); _LIT(Fmt, " 0x%X(%d) ret %d"); \
+    TBuf<512> buf; buf.Copy( func );  buf.Insert(0, Entry); \
+    TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(Fmt, &overflow, aInstance, aInstance, aRetval); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * Performance measurement event start trace without extra parameters. 
+ * The trace is mapped to TRACE_PERFORMANCE group.
+ */
+#define BOstraceEventStart0( aTraceName, aEventName ) \
+{\
+    _LIT(TrGrp, "[PFMAN]"); _LIT(EvName, aEventName); \
+    _LIT(Entry, "[Start] "); \
+    TBuf<512> buf(Entry); buf.Append( EvName ); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * Performance measurement event start trace with single 32-bit parameter. 
+ * The trace is mapped to TRACE_PERFORMANCE group.
+ */
+#define BOstraceEventStart1( aTraceName, aEventName, aParam ) \
+{\
+    _LIT(TrGrp, "[PFMAN]"); _LIT(EvName, aEventName); \
+    _LIT(Entry, "[Start] %S 0x%X(%d)"); \
+    TPtrC evt(EvName); TBuf<512> buf; \
+    TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(Entry, &overflow, &evt, aParam, aParam ); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * Performance measurement event end trace. 
+ * The trace is mapped to TRACE_PERFORMANCE group.
+ */
+#define BOstraceEventStop( aTraceName, aEventName ) \
+{\
+    _LIT(TrGrp, "[PFMAN]"); _LIT(EvName, aEventName); \
+    _LIT(Entry, "[Stop] "); \
+    TBuf<512> buf(Entry); buf.Append( EvName ); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * State transition event.
+ * The trace is mapped to TRACE_STATE group.
+ */
+#define BOstraceState0( aTraceName, aStateName, aNewState ) \
+{\
+    _LIT(TrGrp, "[STATE]"); _LIT(StName, aStateName); \
+    _LIT(Entry, "%S 0x%X(%d)"); \
+    TPtrC evt(StName); TBuf<512> buf; \
+    TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(Entry, &overflow, &evt, aNewState, aNewState ); \
+    Trace( TrGrp, buf ); \
+}
+
+/*
+ * State transition event with instance identifier.
+ * The trace is mapped to TRACE_STATE group.
+ */
+#define BOstraceState1( aTraceName, aStateName, aNewState, aInstance ) \
+{\
+    _LIT(TrGrp, "[STATE]"); _LIT(StName, aStateName); \
+    _LIT(Entry, "%S 0x%X(%d) instance=0x%X(%d)"); \
+    TPtrC evt(StName); TBuf<512> buf; \
+    TBtTraceOflowTruncate16 overflow; \
+    buf.AppendFormat(Entry, &overflow, &evt, aNewState, aNewState, aInstance, aInstance ); \
+    Trace( TrGrp, buf ); \
+}
+
+#endif // BLUETOOTHTRACE_MEDIA_OST
+
+// Extended tracing macros facilitating domain specific tracing needs:
+
+/*
+ * A block of source code merely for tracing purpose.
+ */
+#define BtTraceBlock( exp ) {exp}
+
+/*
+ * trace macro for BT device address printing with an additional trace text. 
+ * aParam must be TBTDevAddr type.
+ */
+#define BtTraceBtAddr1( aGroupName, aTraceName, aTraceText, aParam ) \
+{ \
+    _LIT(TrTxt, aTraceText); TPtrC p(TrTxt); \
+    TBuf<12> buf; \
+    aParam.GetReadable( buf ); TPtrC p2(buf);\
+    BOstraceExt2( aGroupName, aTraceName, "%S%S", &p, &p2 ); \
+}
+
+/*
+ * trace macro for BT device address printing with no additional trace text. 
+ * aParam must be TBTDevAddr type.
+ */
+#define BtTraceBtAddr0( aGroupName, aTraceName, aParam ) \
+{ \
+    TBuf<12> buf; aParam.GetReadable( buf ); TPtrC p(buf); \
+    BOstraceExt1( aGroupName, aTraceName, "%S", &p ); \
+}
+
+#else // BLUETOOTHTRACE_ENABLED
+
+#define BOstrace0( aGroupName, aTraceName, aTraceText )
+#define BOstrace1( aGroupName, aTraceName, aTraceText, aParam )
+#define BOstraceData( aGroupName, aTraceName, aTraceText, aPtr, aLength )
+#define BOstraceExt1( aGroupName, aTraceName, aTraceText, aParam )
+#define BOstraceExt2( aGroupName, aTraceName, aTraceText, aParam1, aParam2 )
+#define BOstraceExt3( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3 )
+#define BOstraceExt4( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4 )
+#define BOstraceExt5( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4, aParam5 )
+
+#define BOstraceFunctionEntry0( aTraceName )
+#define BOstraceFunctionEntry1( aTraceName, aInstance )
+#define BOstraceFunctionEntryExt(aTraceName, aInstance, aArg)
+#define BOstraceFunctionExit0( aTraceName )
+#define BOstraceFunctionExit1( aTraceName, aInstance )
+#define BOstraceEventStart0( aTraceName, aEventName )
+#define BOstraceEventStart1( aTraceName, aEventName, aParam )
+#define BOstraceFunctionExitExt(aTraceName, aInstance, aRetval)
+#define BOstraceEventStop( aTraceName, aEventName )
+#define BOstraceState0( aTraceName, aStateName, aNewState )
+#define BOstraceState1( aTraceName, aStateName, aNewState, aInstance )
+
+#define BtTraceBlock( exp )
+#define BtTraceBtAddr1( aGroupName, aTraceName, aTraceText, aParam )
+#define BtTraceBtAddr0( aGroupName, aTraceName, aParam )
+
+#endif // BLUETOOTHTRACE_ENABLED
+
+/*
+ * Additional general purpose definition, a hook for defining a friend class
+ * for unit testing to get access to class internals.
+ */
+#ifndef BTUNITTEST
+#define BTUNITTESTHOOK
+#endif
+
+#endif // BLUETOOTHTRACE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/inc/bluetoothuitrace.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,182 @@
+/*
+* ============================================================================
+*  Name        : bluetoothuitrace.h
+*  Part of     : BluetoothUI / bluetoothuimodel       *** Info from the SWAD
+*  Description : API declaration of run-time debug tracing in bluetoothui project
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef BLUETOOTHUITRACE_H
+#define BLUETOOTHUITRACE_H
+
+#include <bluetoothtrace.h>
+#include <QDateTime>
+
+#ifdef BLUETOOTHTRACE_ENABLED
+
+/*
+ * trace macro for Qt code with an additional trace text. 
+ * param must be QString type.
+ */
+#define BtTraceQString1( groupName, traceName, traceText, param ) \
+{\
+    _LIT(TrTxt, traceText); TPtrC p(TrTxt); \
+    TPtrC textPtr(reinterpret_cast<const TUint16*>(param.utf16()), param.length() ); \
+    BOstraceExt2( groupName, traceName, "%S%S", &p, &textPtr ); \
+}
+
+/*
+ * trace macro for Qt code with no additional trace text. 
+ * param must be QString type.
+ */
+#define BtTraceQString0( groupName, traceName, param ) \
+{\
+    TPtrC textPtr(reinterpret_cast<const TUint16*>(param.utf16()), param.length() ); \
+    BOstraceExt1( groupName, traceName, "%S", &textPtr ); \
+}
+
+/*
+ * Macro for tracing a Bluetooth device entry in btuimdevlist
+ * with no additional trace text. 
+ */
+#define BtTraceDevListEntry0( groupName, traceName, dev ) \
+{\
+    QString info("["); \
+    info += dev[Btuim::DevAddrReadableRole].toString() + "]"; \
+    QString filterBinary; \
+    filterBinary.setNum( dev[Btuim::MajorFilterRole].toInt(), 16); \
+    info += "[" + filterBinary + "]"; \
+    info += "[" \
+        + dev[Btuim::LastUsedTimeRole].value<QDateTime>().toString(Qt::ISODate ) \
+        + "]" ; \
+    info += "[" + dev[Btuim::DevNameRoleRole].toString() + "]" ; \
+    TPtrC textPtr(reinterpret_cast<const TUint16*>(info.utf16()), info.length() ); \
+    BOstraceExt1( groupName, traceName, "%S", &textPtr ); \
+}
+
+/*
+ * Macro for tracing a Bluetooth device entry in btuim
+ * with an additional trace text. 
+ */
+#define BtTraceDevListEntry1( groupName, traceName, traceText, dev ) \
+{\
+    QString info("["); \
+    info += dev[Btuim::DevAddrReadableRole].toString() + "]"; \
+    QString cod; \
+    cod.setNum( dev[Btuim::ClassOfDeviceRole].toInt(), 16); \
+    info += "[" + cod + "]"; \
+    QString filterBinary; \
+    filterBinary.setNum( dev[Btuim::MajorFilterRole].toInt(), 16); \
+    info += "[" + filterBinary + "]"; \
+    info += "[" \
+        + dev[Btuim::LastUsedTimeRole].value<QDateTime>().toString(Qt::ISODate ) \
+        + "]" ; \
+    info += "[" + dev[Btuim::DevNameRole].toString() + "]" ; \
+    TPtrC textPtr(reinterpret_cast<const TUint16*>(info.utf16()), info.length() ); \
+    _LIT(TrTxt, traceText); TPtrC p(TrTxt); \
+    BOstraceExt2( groupName, traceName, "%S%S", &p, &textPtr ); \
+}
+
+/*
+ * Macro for Qt code with additional trace text. 
+ * list must be QStringList type.
+ */
+#define BtTraceQStringList1( groupName, traceName, traceText, list ) \
+{\
+    QString info(": ["); \
+    info += list.join(".") + "]"; \
+    TPtrC textPtr(reinterpret_cast<const TUint16*>(info.utf16()), info.length() ); \
+    _LIT(TrTxt, traceText); TPtrC p(TrTxt); \
+    BOstraceExt2( groupName, traceName, "%S%S", &p, &textPtr ); \
+}
+
+/*
+ * Macro for Qt code with no additional trace text. 
+ * list must be QStringList type.
+ */
+#define BtTraceQStringList0( groupName, traceName, list ) \
+{\
+    QString info(": ["); \
+    info += list.join(".") + "]"; \
+    TPtrC textPtr(reinterpret_cast<const TUint16*>(info.utf16()), info.length() ); \
+    BOstraceExt1( groupName, traceName, "%S", &textPtr ); \
+}
+
+
+/*
+ * Macro for tracing Bluetooth DevData data source in btuimdevdata
+ * with no additional trace text. 
+*/
+#define BtTraceDevDataEntry0( groupName, traceName, devData ) \
+{\
+    QString info("["); \
+    QMap< int, QVariant > val = devData.at( Btuim::DevDataIndexName ); \
+    info += val.value(Qt::EditRole).toString() + "]" ; \
+    val = devData.at( Btuim::DevDataIndexStatus ); \
+    int statusBits = val.value(Qt::EditRole).toInt(); \
+    info += "["; \
+    info += QString::number(statusBits, 16 ); \
+    info += "]"; \
+    QStringList strl = val.value(Qt::DisplayRole).toStringList(); \
+    info += "[" ; \
+    for ( int i = 0; i < strl.count(); ++i ) { \
+        info += strl.at(i) + ","; \
+    } \
+    info += "]" ; \
+    val = devData.at( Btuim::DevDataIndexOptionsMenu ); \
+    info += " opts:"; \
+    QList<QVariant> cmdItems = val.value( Btuim::DevDataCmdItemsRole ).toList(); \
+    for ( int i = 0; i < cmdItems.count(); i++ ) { \
+        const Btuim::DevDataCmdItem& item = cmdItems.at(i).value<Btuim::DevDataCmdItem>(); \
+        info += "[" + QString::number(item.mCmdId) + "," + QString::number(item.mEnabled) + "," + "]"; \
+    } \
+    val = devData.at( Btuim::DevDataIndexCmdList ); \
+    info += " cmds:"; \
+    cmdItems = val.value( Btuim::DevDataCmdItemsRole ).toList(); \
+    for ( int i = 0; i < cmdItems.count(); i++ ) { \
+        const Btuim::DevDataCmdItem& item = cmdItems.at(i).value<Btuim::DevDataCmdItem>(); \
+        info += "[" + QString::number(item.mCmdId) + "," + QString::number(item.mEnabled) + "," + "]"; \
+    } \
+    TPtrC textPtr(reinterpret_cast<const TUint16*>(info.utf16()), info.length() ); \
+    BOstraceExt1( groupName, traceName, "%S", &textPtr ); \
+}
+#else
+
+#define BtTraceQString1( aGroupName, aTraceName, aTraceText, aParam ) 
+#define BtTraceQString0( aGroupName, aTraceName, aParam )
+#define BtTraceDevListEntry0( groupName, traceName, dev )
+#define BtTraceDevListEntry1( groupName, traceName, traceText, dev )
+#define BtTraceQStringList1( groupName, traceName, traceText, list )
+#define BtTraceQStringList0( groupName, traceName, list )
+#define BtTraceDevDataEntry0( groupName, traceName, devData )
+#endif // BLUETOOTHTRACE_ENABLED
+
+// At early development phase, we force assertion in release build to find out 
+// design and implementation issues.
+//#ifndef QT_NO_DEBUG
+#define BTUI_DEBUG
+//#endif
+
+#if !defined(BTUI_ASSERT_X)
+#  ifdef BTUI_DEBUG
+#define BTUI_ASSERT_X(cond, where, what) ((!(cond)) ? qt_assert_x(where, what,__FILE__,__LINE__) : qt_noop())
+#  else
+#    define BTUI_ASSERT_X(cond, where, what) qt_noop()
+#  endif
+#endif
+
+#endif // BLUETOOTHUITRACE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/inc/btqtconstants.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef BTQTCONSTANTS_H
+#define BTQTCONSTANTS_H
+
+#include <btengconstants.h>
+
+
+enum VisibilityMode {
+    BtHidden = 0x10,  // using a different number space than TBTVisibilityMode
+    BtVisible,
+    BtTemporary,
+    BtUnknown
+    
+};
+
+// used for mapping between UI row and VisibilityMode item
+enum VisibilityModeUiRowMapping {
+    UiRowBtHidden = 0,
+    UiRowBtVisible,
+    UiRowBtTemporary
+};
+
+inline VisibilityMode QtVisibilityMode(TBTVisibilityMode btEngMode)
+{
+    VisibilityMode mode; 
+    switch(btEngMode) {
+    case EBTVisibilityModeHidden:
+        mode = BtHidden;
+        break;
+    case EBTVisibilityModeGeneral:
+        mode = BtVisible;
+        break;
+    case EBTVisibilityModeTemporary:
+        mode = BtTemporary;
+        break;
+    default:
+        mode = BtUnknown;
+    }
+    return mode;
+}
+
+inline TBTVisibilityMode  BtEngVisibilityMode(VisibilityMode btQtMode)
+{
+    TBTVisibilityMode mode; 
+    switch(btQtMode) {
+    case BtHidden:
+        mode = EBTVisibilityModeHidden;
+        break;
+    case BtVisible:
+        mode = EBTVisibilityModeGeneral;
+        break;
+    case BtTemporary:
+        mode = EBTVisibilityModeTemporary;
+        break;
+    default:
+        mode = (TBTVisibilityMode)KErrUnknown;
+    }
+    return mode;
+}
+
+
+#endif // BTQTCONSTANTS_H
--- a/bluetoothengine/btui/inc/btui.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
-* 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 header file contains global declarations and methods 
-*                  which are visible to all BTUI classes.
-*
-*/
-
-#ifndef BTUI_H
-#define BTUI_H
-
-#include <e32svr.h>     // For RDebug and Panic
-#include <data_caging_path_literals.hrh> 
-
-const TUid KBtuiUid3 = { 0x10005951 }; //Application UID for help context
-
-//Ecom implementation UID of GS interface plugin
-const TUid KGsBtuiPluginUid = { 0x1020742B };   
-
-//Ecom implementation UID of BTUI interface plugin
-const TUid KBtuiPluginUidMainView = { 0x1020745C };   			// Ecom interface implementation UID
-const TUid KBtuiPluginUidPairedDevicesView = { 0x1020745D };   	// Ecom interface implementation UID
-const TUid KBtuiPluginUidBlockedDevicesView = {0x20002780 };	// Ecom interface implementation UID
-
-
-_LIT( KBTUIAppName, "BTUI" );           // The application name
-
-// Literals for bitmap files ( drive, directory, filename(s) )
-_LIT(KBitmapFileDrive,"z:");
-// KDC_APP_BITMAP_DIR == from data_caging_path_literals.hrh
-
-
-_LIT( KGSBtuiPluginResourceFileName, "z:BtuiViewResources.rsc" );
-
-_LIT(KBtuiBmpFileName,"btui.mbm");
-
-_LIT(KFileDrive,"z:");
-_LIT(KResourceFileName, "BtuiViewResources.rsc");
-
-
-enum TBTPanics {    
-    EBTMainListNotEmpty = 10000,
-    EBTAllFormatStingsArrayNotEmpty,
-    EBTFormatStingsArrayNotEmpty,
-    EBTPairedDevicesListNotEmpty,
-    EBTPanicClassMemberVariableNotNull,
-    EBTPanicClassMemberVariableIsNull,    
-    EBTPanicIllegalValue,
-    EBTPanicDevManQueueIsCorrupt,
-    EBTPanicDevManQueueIsInIllegalState,
-	EBTPanicTwoPairingAttemptsAtTheSameTime,
-	EBTPanicCommandComplettedToDiffrentDeviceThanStarted,
-	EBTPanicNullObserver
-};
-
-// MACROS
-//#define PANIC(aPanic) User::Panic(KBTUIAppName,aPanic)
-
-#endif // BTUI_H
--- a/bluetoothengine/btui/inc/btui.hrh	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, 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 BTUI.
-*
-*/
-
-
-
-
-#ifndef BTUI_HRH
-#define BTUI_HRH
-
-enum TBTUIMenuCommands
-    {
-    EBTUICmdUndefined = 0,    
-    EBTUICmdChangePowerStateMenu,
-    EBTUICmdChangePowerStateSelect,
-    EBTUICmdChangeVisibilityMenu,
-    EBTUICmdChangeVisibilitySelect,
-    EBTUICmdChangeBTNameMenu,
-    EBTUICmdChangeBTNameSelect,
-    EBTUICmdNewPairedDevice,
-    EBTUICmdDelete,
-    EBTUICmdDeleteAll,
-    EBTUICmdSetTrusted,
-    EBTUICmdSetUnTrusted,
-    EBTUICmdGiveNickname,	
-    EBTUICmdConnect,
-    EBTUICmdConnectAudio,
-    EBTUICmdDisconnect,
-	EBTUICmdChangeSapStateMenu,
-	EBTUICmdChangeSapStateSelect,
-	EBTUICmdMSK,
-	EBTUICmdUnblock,
-	EBTUICmdUnblockAll,
-	EBTUIDeleteTabGroup,
-	EBTUICreateTabGroup,
-	EBTUICmdSetBlocked,
-	EBTUICmdSettings
-	};
-
-enum TBTUITabViewId
-    {
-    EBTUIMainViewTab = 1,
-    EBTUIPairedDevicesViewTab,
-    EBTUIBlockedDevicesViewTab
-    };
-
-enum TBTUINotes
-    {
-    EBTUIGeneralError = 100,
-    EBTUIPhoneVisibleToOthers,
-    EBTUIHiddenFromOthersNote,
-    EBTUINameAlreadyExists,
-    EBTUIInvalidLocalNameNote,
-    EBTUIDeviceSetAsUntrusted,
-    EBTUIWaitingForPairing,    
-    EBTUIConnectingTo,
-    EBTUIDisconnectWired,    
-    EBTUINotIncall,
-    EBTUIBtBusy,
-	EBTUIBtSapEnableNote
-    };
-
-// This enum reflects the "r_bt_label_strings" in .rss file and must follow the same order.
-//
-enum TBTUIMainViewSettingFormatStrings
-    {
-    EBTUISettModulePowerOn,
-    EBTUISettModulePowerOff,
-    EBTUISettVisibilityModeGeneral,
-    EBTUISettVisibilityModeHidden,
-    EBTUISettVisibilityModeTemp,
-    
-    EBTUISettBTNameHeader,
-	EBTUISettSapEnabled,
-	EBTUISettSapDisabled
-    };
-
-// Main list item indexes (see KNumberOfMainViewItems also)
-
-enum TBTMainListItemIndexes
-    {
-    EBTMainListItemPowerMode = 0,
-    EBTMainListItemVisibilityMode,
-    EBTMainListItemNameSetting,
-	EBTMainListItemSapMode,
-	
-	EBTMainListItemVisibilityTimeSetting
-    };
-
-#ifdef __BT_SAP
-    #define KNumberOfMainViewItems 4
-#else
-	#define KNumberOfMainViewItems 3
-#endif
-
-// Maximum lengths of bluetooth device names
-#define KBTUIMaxNameLength   30      // Series 60 local BT name
-#define KBTUIMaxAliasLength  30      // Series 60 friendlyname/alias BT name
-#define KBTUIMaxFormattedNameLength 270     // Localized header (icon indexes with tabs) + name
-
-#define btui_bitmap_file "Z:\\system\\data\\btui.mbm"
-#define btui_bitmap_file_data_caging "Z:\\resource\\apps\\btui.mbm"
-
-#endif      //  BTUI
-
-
--- a/bluetoothengine/btui/inc/debug.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,184 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Logging definition
-*
-*/
-
-
-#ifndef PRJ_LOGGING_H
-#define PRJ_LOGGING_H
-
-#include <e32base.h>
-#include <bttypes.h>
-#include "debugconfig.h"
-
-#ifdef PRJ_ENABLE_TRACE
-
-#ifdef PRJ_FILE_TRACE
-#include <flogger.h>
-#else
-#include <e32debug.h>
-#endif
-
-NONSHARABLE_CLASS(TOverflowTruncate16) : public TDes16Overflow
-    {
-public:
-    void Overflow(TDes16& /*aDes*/) {}
-    };
-
-NONSHARABLE_CLASS(TOverflowTruncate8) : public TDes8Overflow
-    {
-public:
-    void Overflow(TDes8& /*aDes*/) {}
-    };
-
-inline void Trace(TRefByValue<const TDesC16> aFmt, ...)
-    {
-    VA_LIST list;
-    VA_START(list,aFmt);
-#ifdef PRJ_FILE_TRACE
-    RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list);
-#else
-    TBuf16<KMaxLogLineLength> theFinalString;
-    theFinalString.Append(KTracePrefix16);
-    TOverflowTruncate16 overflow;
-    theFinalString.AppendFormatList(aFmt,list,&overflow);
-    RDebug::Print(theFinalString);
-#endif
-    }
-
-inline void Trace(TRefByValue<const TDesC8> aFmt, ...)
-    {
-    VA_LIST list;
-    VA_START(list, aFmt);
-#ifdef PRJ_FILE_TRACE
-    RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list);
-#else
-    TOverflowTruncate8 overflow;
-    TBuf8<KMaxLogLineLength> buf8;
-    buf8.Append(KTracePrefix8);
-    buf8.AppendFormatList(aFmt, list, &overflow);
-    TBuf16<KMaxLogLineLength> buf16(buf8.Length());
-    buf16.Copy(buf8);
-    TRefByValue<const TDesC> tmpFmt(_L("%S"));
-    RDebug::Print(tmpFmt, &buf16);
-#endif
-    }
-
-inline void TracePanic(
-    char* aFile, 
-    TInt aLine,
-    TInt aPanicCode,
-    const TDesC& aPanicCategory)
-    {
-    TPtrC8 fullFileName((const TUint8*)aFile);
-    TPtrC8 fileName(fullFileName.Ptr()+fullFileName.LocateReverse('\\')+1);
-    TBuf8<KMaxLogLineLength> buf;
-    buf.Append(KPanicPrefix8);
-    buf.AppendFormat(_L8("%d at line %d in file %S"), aPanicCode, aLine, &fileName);
-    Trace(buf);
-    User::Panic(aPanicCategory, aPanicCode); 
-    }
-
-inline void TraceLeave(char* aFile, TInt aLine, TInt aReason)
-    {
-    TPtrC8 fullFileName((const TUint8*)aFile);
-    TPtrC8 fileName(fullFileName.Ptr()+fullFileName.LocateReverse('\\')+1);
-    TBuf8<KMaxLogLineLength> buf;
-    buf.Append(KLeavePrefix8);
-    buf.AppendFormat(_L8("%d at line %d in file %S"), aReason, aLine, &fileName);
-    Trace(buf);
-    User::Leave(aReason);
-    }
-
-inline void DebugPrintBDAddr(const TBTDevAddr& aAddr)
-    {
-    TBuf<16> addrdes;
-    aAddr.GetReadable(addrdes);
-    Trace(_L("[BTENG]\t BD addr %S") , &addrdes);   
-    }
-
-#define TRACE_INFO(p) {if(KTraceMask & KPRINTINFO) Trace p;}
-
-#define TRACE_ERROR(p) {if(KTraceMask & KPRINTERROR) Trace p;}
-
-#define TRACE_STATE(p) {if(KTraceMask & KPRINTSTATE) Trace p;}
-
-#define TRACE_WARNING(p) {if(KTraceMask & KPRINTWARNING) Trace p;}
-
-#define TRACE_INFO_SEG(p) {if(KTraceMask & KPRINTINFO) p;}
-
-#define TRACE_ASSERT(GUARD, CODE) {if (!(GUARD)) TracePanic(__FILE__, __LINE__, CODE, KPanicCategory);}
-
-#define PANIC(CODE) TracePanic(__FILE__, __LINE__, CODE, KPanicCategory)
-
-#define LEAVE_IF_ERROR(REASON) {if (REASON) TraceLeave(__FILE__, __LINE__, REASON);}
-
-#define LEAVE_IF_NULL(PTR) {if (!PTR) TraceLeave(__FILE__, __LINE__, KErrGeneral);}
-
-#define LEAVE(REASON) {TraceLeave(__FILE__, __LINE__, REASON);}
-
-#define TRACE_STATIC_FUNC_ENTRY {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncEntryFormat8, &ptr8);}}
-
-#define TRACE_FUNC_ENTRY {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncEntryThisFormat8, &ptr8, this);}}
-
-#define TRACE_FUNC_EXIT {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncExitFormat8, &ptr8);}}
-
-#define TRACE_STATIC_FUNC {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncFormat8, &ptr8);}}
-
-#define TRACE_FUNC {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncThisFormat8, &ptr8, this);}}
-
-#define RETURN_IF_ERR(ERR) {if(ERR) {TPtrC8 ptr8((TUint8*)__FILE__); Trace(_L8(" RETURN %d at file %S line %d"), ERR, &ptr8, __LINE__); return ERR;}}
-
-#define TRACE_BDADDR( a ) { if( KTraceMask & KPRINTINFO ) DebugPrintBDAddr(a); }
-
-#else // PRJ_ENABLE_TRACE not defined
-
-#define TRACE_INFO(p)
-
-#define TRACE_ERROR(p)
-
-#define TRACE_STATE(p)
-
-#define TRACE_WARNING(p)
-
-#define TRACE_INFO_SEG(p)
-
-#define TRACE_ASSERT(GUARD, CODE)
-
-#define PANIC(CODE) {User::Panic(KPanicCategory, CODE);}
-
-#define LEAVE_IF_ERROR(REASON) {static_cast<void>(User::LeaveIfError(REASON));}
-
-#define LEAVE_IF_NULL(PTR) {static_cast<void>(User::LeaveIfNull(PTR));}
-
-#define LEAVE(REASON) {static_cast<void>(User::Leave(REASON));}
-
-#define TRACE_STATIC_FUNC_ENTRY
-
-#define TRACE_FUNC_ENTRY
-
-#define TRACE_FUNC_EXIT
-
-#define TRACE_STATIC_FUNC
-
-#define TRACE_FUNC
-
-#define RETURN_IF_ERR(ERR) {if(ERR) return ERR;}
-
-#define TRACE_BDADDR( a )
-
-#endif // PRJ_ENABLE_TRACE
-
-#endif // PRJ_LOGGING_H
--- a/bluetoothengine/btui/inc/debugconfig.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  logging configure file.
-*
-*/
-
-
-#ifndef BTUI_DEBUGCONFIG_H
-#define BTUI_DEBUGCONFIG_H
-
-#include "prjconfig.h"
-
-/**
- * Custom logging variations.
- */
-#ifdef PRJ_FILE_TRACE
-_LIT(KLogFile,"btuilog.txt");
-_LIT(KLogDir,"BT");
-#endif
-
-#ifdef PRJ_ENABLE_TRACE
-_LIT(KTracePrefix16, "[BTUI] ");
-_LIT8(KTracePrefix8, "[BTUI] ");
-_LIT8(KFuncFormat8, "><%S");
-_LIT8(KFuncThisFormat8, "><%S, [0x%08X]");
-_LIT8(KFuncEntryFormat8, ">%S");
-_LIT8(KFuncEntryThisFormat8, ">%S, [0x%08X]");
-_LIT8(KFuncExitFormat8, "<%S");
-
-_LIT(KPanicCategory, "BTUI");    
-_LIT8(KPanicPrefix8, "PANIC code ");
-_LIT8(KLeavePrefix8, "LEAVE code ");
-#endif
-
-const TInt KMaxLogLineLength = 512;
-
-#define KPRINTERROR        0x00000001 // Tracing level: error
-#define KPRINTINFO        0x00000002 // Tracing level: function trace
-#define KPRINTSTATE        0x00000004 // Tracing level: state machine info
-#define KPRINTWARNING   0x00000008 // Tracing level: warning
-
-const TInt KTraceMask = KPRINTERROR | KPRINTINFO | KPRINTSTATE | KPRINTWARNING;
-
-#endif // BTUI_DEBUGCONFIG_H
--- a/bluetoothengine/btui/inc/prjconfig.h	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 configure file.
-*
-*/
-
-
-#ifndef BTUI_PRJCONFIG_H
-#define BTUI_PRJCONFIG_H
-
-/**
- * Traces are enabled in _DEBUG build, by default.
- */
-#ifdef _DEBUG
-#define PRJ_ENABLE_TRACE
-#endif
-
-/**
- * traces to file if this is defined.
- */
-//#define PRJ_FILE_TRACE
-
-
-/**
- * build the project for module test purpose if this is defined
- */
-//#define PRJ_MODULETEST_BUILD
-
-/**
- * build the project using stubs to replace the dependencies if this is defined
- */
-//#define PRJ_USE_STUB
-
-
-#endif // BTUI_PRJCONFIG_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/inc/traceconfig.h	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,126 @@
+/*
+* ============================================================================
+*  Name        : traceconfig_template.h
+*  Part of     : BluetoothUI / bluetoothuimodel       *** Info from the SWAD
+*  Description : Configuration of debug tracing in bluetoothuimodel
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+#ifndef BLUETOOTHTRACECONFIG_H
+#define BLUETOOTHTRACECONFIG_H
+
+/*
+Sample usage:
+    void testTracing() 
+    {
+        BOstrace0( TRACE_FATAL, TNAME_DEVLIST_1, "BOstrace0" );
+        BOstrace1( TRACE_IMPORTANT, TNAME_DEVLIST_2, "BOstrace1 %d", 123 );
+        _LIT(String, "\"Symbian Descriptor\"");
+        TPtrC ptr(String);
+        TBuf<20> buf(ptr);
+        BOstraceExt1( TRACE_NORMAL, TNAME_DEVLIST_3, "BOstraceExt1 %S",  &ptr);
+        BOstraceExt2( TRACE_API, TNAME_DEVLIST_4, "BOstraceExt2 %d %S", 456, &ptr );
+        BOstraceExt3( TRACE_FLOW, TNAME_DEVLIST, "BOstraceExt3 0x%x %d %S", 128, 256, &ptr );
+        BOstraceExt4( TRACE_DETAILED, TNAME_DEVL_5IST, "BOstraceExt4 0x%x %d %S %S", 128, 256, &ptr, &buf );
+        BOstraceExt5( TRACE_DEBUG, TNAME_DEVLIST_6, "BOstraceExt5 0x%x %d %S %S, %b", 128, 256, &ptr, &buf, 512 );
+        BOstraceFunctionEntry0( TNAME_DEVLIST_7 );
+        BOstraceFunctionEntry1( TNAME_DEVLIST_8, 0x00abcdef );
+        BOstraceFunctionEntryExt(TNAME_DEVLIST_9, 0xdeadbeef, 123 );
+        BOstraceFunctionExit0( TNAME_DEVLIST_9 );
+        BOstraceFunctionExit1( TNAME_DEVLIST_10, 0x00beebee );
+        BOstraceFunctionExitExt(TNAME_DEVLIST_11, 0x00badbed, -1);
+        BOstraceEventStart0( TNAME_DEVLIST_12, "BOstraceEventStart0" );
+        BOstraceEventStart1( TNAME_DEVLIST_13, "BOstraceEventStart1", 789 );
+        BOstraceEventStop( TNAME_DEVLIST_14, "BOstraceEventStop" );
+        BOstraceState0( TNAME_DEVLIST_15, "connection state", 1 );
+        BOstraceState1( TNAME_DEVLIST_16, "audio state", 2, 0xdeadbeef );
+        BtTraceBlock( 
+                for (int i = 0; i < 5; ++i) { 
+                    BOstrace1( TRACE_IMPORTANT, TNAME_DEVLIST_, "BtTraceBlock counter(1-5): %d", i+1 );
+                });
+        QString str("\"Qt String\"");
+        BtTraceQString0( TRACE_NORMAL, TNAME_DEVLIST_17, str);
+        BtTraceQString1( TRACE_NORMAL, TNAME_DEVLIST_18, "additioanl text;", str);
+        TBTDevAddr addr;
+        addr.SetReadable(_L("0060576ff376"));
+        BtTraceBtAddr0( TRACE_NORMAL, TNAME_DEVLIST_19, addr );
+        BtTraceBtAddr1( TRACE_NORMAL, TNAME_DEVLIST_20, "additional trace;", addr );
+    }
+
+ */
+
+// At early development phase, tracing is activated 
+//#ifdef _DEBUG
+#define BLUETOOTHTRACE_ENABLED
+//#endif //_DEBUG
+
+/*
+ * Tracing media configuration
+ */  
+#ifdef BLUETOOTHTRACE_ENABLED
+    #ifdef __WINS__
+    #define BLUETOOTHTRACE_MEDIA_FILE
+    #else 
+    // RDEBUG is used for tracing output before we migrate to OST tracing.
+    #define BLUETOOTHTRACE_MEDIA_RDEBUG
+    //#define BLUETOOTHTRACE_MEDIA_OST 
+    #endif // __WINS__
+#endif //BLUETOOTHTRACE_ENABLED
+
+/*
+ * Configuration of tracing to file
+ */
+#ifdef BLUETOOTHTRACE_MEDIA_FILE
+
+_LIT( KLogFile, "btuiqt.txt" );
+_LIT( KLogDir, "bt" );
+
+#endif //BLUETOOTHTRACE_MEDIA_FILE
+
+/*
+ * Configuration of tracing using RDebug
+ */
+#ifdef BLUETOOTHTRACE_MEDIA_RDEBUG
+
+#endif //BLUETOOTHTRACE_MEDIA_RDEBUG
+
+/*
+ * Configuration of tracing using OST
+ */
+#ifndef BLUETOOTHTRACE_MEDIA_OST
+
+/**
+ * Group-mapping aligning with OST groups.
+ * The purpose of using groups is to ease migrating tracing from legacy logging to OST.
+ */
+#define TRACE_FATAL       "[FATAL]"
+#define TRACE_IMPORTANT   "[IMPTT]"
+#define TRACE_NORMAL      "[NORML]"
+#define TRACE_API         "[ API ]"
+#define TRACE_FLOW        "[FLOW ]"
+#define TRACE_STATE       "[STATE]"
+#define TRACE_DETAILED    "[DETLD]"
+#define TRACE_DEBUG       "[DEBUG]"
+#define TRACE_PERFORMANCE "[PFMAN]"
+
+/**
+ * Component Identifier to be written into traces:
+ */
+_LIT(KComponentName, "[BtUi]");
+
+#endif //BLUETOOTHTRACE_MEDIA_OST
+
+#endif // BLUETOOTHTRACECONFIG_H
--- a/bluetoothengine/btui/loc/btui.loc	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,528 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 Bluetooth UI application.
-*
-*/
-
-
-// LOCALISATION STRINGS
-
-// Please note! Default class of device names are defined in "btnotif.loc".
-
-
-// *** CAPTION STRINGS ***
-
-// d: BTUI application name on the application shell's app. list
-// l: list_single_large_graphic_pane_t1
-// 
-#define qtn_apps_bluetooth_list "Bluetooth"
-
-// d: BTUI application name on the application shell's app. grid
-// l: cell_app_pane_t1
-// 
-#define qtn_apps_bluetooth_grid "Bluetooth"
-
-
-// *** TITLES ***
-
-// d: Status pane title for main view
-// l: title_pane_t2/opt9
-//  
-#define qtn_bt_title_bluetooth "Bluetooth"
-
-// d: Status pane title for paired devices view
-// l: title_pane_t2/opt9
-// 
-#define qtn_bt_title_paired_dev "Paired devices"
-
-
-// *** MAIN VIEW SETTING ITEMS ***
-
-// d: The setting item title for bluetooth functionality (1st item)
-// l: list_setting_pane_t1
-// 
-#define qtn_bt_sett_module "Bluetooth"
-
-// d: The setting item value when bluetooth functionality is enabled
-// l: list_set_graphic_pane_t1
-// 
-#define qtn_bt_sett_on "On"
-
-// d: The setting item value when bluetooth functionality is disabled
-// l: list_set_graphic_pane_t1
-// 
-#define qtn_bt_sett_off "Off"
-
-// d: The setting item title for phone's bluetooth visibility mode (2nd item)
-// l: list_setting_pane_t1
-//
-#define qtn_bt_sett_phone_visibility "My phone's visibility" 
-
-// d: The setting item value visibility mode
-// l: list_set_graphic_pane_t1
-//
-#define qtn_bt_det_sett_general "Shown to all" 
-
-// d: The setting item value visibility mode
-// l: list_set_graphic_pane_t1
-//
-#define qtn_bt_hidden "Hidden"
-
-// d: The setting item title for phones bluetooth name (3rd item)
-// d: Also for the title of settings item editing window for phones bluetooth name
-// l: list_setting_pane_t1
-//
-#define qtn_bt_sett_bt_name "My bluetooth name"
-
-// d: The setting item title for SIM Access Profile (4th item)
-// l:  list_setting_pane_t1
-//
-#define qtn_bt_sap "SIM Access Profile"
-
-// d: The setting item value when SIM Access Profile is enabled
-// l: list_set_graphic_pane_t1
-//
-#define qtn_bt_sap_enabled "Enabled"
-
-// d: The setting item value when SIM Access profile is disabled
-// l: list_set_graphic_pane_t1
-//
-#define qtn_bt_sap_disabled "Disabled"
-
-// *** EMPTY LISTS ***
-
-// d: Empty list text when there are no paired devices
-// l: main_list_empty_pane
-//
-#define qtn_bt_no_paired_devices "(no paired devices)"
-
-
-// *** MENU POPUP OPTIONS ***
-
-// d: Command in options list
-// l: list_single_pane_t1_cp2
-//
-#define qtn_bt_change_value "Change"
-
-// d: Command in options list
-// l: list_single_pane_t1_cp2
-//
-#define qtn_bt_new_paired_device "New paired device"
-
-// d: Command in options list
-// l: list_single_pane_t1_cp2
-//
-#define qtn_bt_give_nickname "Assign short name"
-
-// d: Command in options list
-// l: list_single_pane_t1_cp2
-//
-#define qtn_bt_set_as_trusted "Set as authorised"
-
-// d: Command in options list
-// l: list_single_pane_t1_cp2
-//
-#define qtn_bt_set_as_untrusted "Set as unauthorised"
-
-// d: Command in options list
-// l: list_single_pane_t1_cp2
-//
-#define qtn_bt_delete "Delete"
-
-// d: Command in options list
-// l: list_single_pane_t1_cp2
-//
-#define qtn_bt_delete_all "Delete all"
-
-// d: Command in options list, and this text should inform user that only an audio connection can be established with this command.
-// l: list_single_pane_t1_cp2
-//
-#define qtn_bt_connect "Connect to audio"
-
-// d: Command in options list, and this text should inform user that connection can be established with this command.
-// l: list_single_pane_t1_cp2
-//
-#define qtn_bt_gen_connect "Connect"
-
-// d: Command in options list
-// l: list_single_pane_t1_cp2
-//
-#define qtn_bt_disconnect "Disconnect"
-
-// d: Command in options list
-// l: list_single_pane_t1_cp2
-//
-#define qtn_bt_settings "Settings"
-
-
-// *** QUERIES ***
-
-// d: Confirmation query if the value Enabled is selected when Bluetooth is off
-// l: popup_note_window
-//
-#define qtn_bt_sap_enable_info "Enabling SIM Access Profile connection Bluetooth must be on"
-
-// d: Data query when user has opened BTUI (for first time) and
-// d: there is no local Bluetooth name defined yet (empty name).
-// l: popup_query_data_window
-//
-#define qtn_enter_bt_name "My Bluetooth name:"
-
-// d: Confirmation query to disable bluetooth functionality while there is still connections active.
-// l: popup_note_window
-//
-#define qtn_bt_switch_off_anyway "Active Bluetooth connection. Switch off anyway?"
-
-// d: Confirmation query when Bluetooth needs to be activated in off-line mode.
-// l: popup_note_window
-//
-#define qtn_bt_activate_in_offline "Do you want to activate bluetooth in off-line mode?"
-
-// d: Confirmation query when bluetooth functionality is off and user action (connect) cannot be performed.
-// l: popup_note_window
-//
-#define qtn_bt_is_off "Bluetooth is currently switched off.\nSwitch on?"
-
-// d: Confirmation query when user has requested to remove pairing for bluetooth device concerned.
-// l: popup_note_window
-//
-#define qtn_bt_warn_erase "Delete pairing with: %U"
-
-// d: Confirmation query when user has requested to remove pairing with connected Bluetooth device.
-// d: %U contains device name.
-// l: popup_note_window
-//
-#define qtn_bt_warn_erase_connected "Deleting this pairing will disconnect %U"
-
-// d: Confirmation query when user has requested to remove all pairings.
-// l: popup_note_window
-//
-#define qtn_bt_warn_erase_all "Delete all pairings?"
-
-// d: Confirmation query when user has requested to remove all pairings and 
-// some ( or only one ) of the devices are connected.
-// l: popup_note_window
-//
-#define qtn_bt_warn_erase_all_connected "Delete all pairings? Some devices may be disconnected." 
-
-// d: Data query when user has requested to change local friendlyname/nickname for bluetooth device concerned.
-// l: popup_query_data_window
-//
-#define qtn_bt_enter_nickname "Short name:"
-
-// d: Confirmation query when user has requested to change Bluetooth device security to trusted.
-// l: popup_note_window
-//
-#define qtn_bt_conf_aut "Connections will take place automatically without confirmation. Continue?"
-
-// d: Confirmation query when disconnecting BT Accessory.
-// l: popup_note_window
-//
-#define qtn_bt_disconn_from "Disconnect from: %U"
-
-
-// *** NOTES ***
-
-// d: Information note after the phone's visibility has changed to general.
-// l: popup_note_window
-//
-#define qtn_bt_phone_visib_to_oth "Phone is detectable by all other devices."
-
-// d: Information note after the phone's visibility has changed to hidden.
-// l: popup_note_window
-//
-#define qtn_bt_hidden_from_others "Phone is not detectable in searches made by other devices" 
-
-// d: Error note after user has changed the local friendlyname/nickname and it conflicts with existing one
-// l: popup_note_window
-//
-#define qtn_bt_name_exists "Short name already in use"
-
-// d: Confirmation note when user has requested to change Bluetooth device security to untrusted.
-// l: popup_note_window
-//
-#define qtn_bt_dev_set_as_untrust "Device set as unauthorised. Connection requests will require confirmation." 
-
-// d: Error note for situations which are not defined in UI specs. and user interaction cannot be completed.
-// l: popup_note_window
-//
-#define qtn_bt_general_error "Unable to perform Bluetooth operation"
-
-// d: Wait note after "New paired device" is executed from paired devices view.
-// d: %U contains device name.
-// l: popup_note_wait_window
-//
-#define qtn_bt_waiting "Waiting for response from %U"
-
-
-// d: Information note for disconnecting wired accessory
-// d: %U contains device name.
-// l: popup_note_window
-//
-#define qtn_bt_disconnect_wired "Disconnect wired accessory"
-
-// d: Wait note during connection establishment.
-// d: %U contains device name.
-// l: popup_note_window
-//
-#define qtn_bt_wait_connecting_to "Connecting to %U"
-
-// d: Information note telling there's already an active BTAA connection.
-// d: %U contains device name.
-// l: popup_note_window
-//
-#define qtn_bt_disconnect_first "Disconnect %U first"
-
-// d: Information note telling there's already an active BTAA connection with call ongoing.
-// l: popup_note_window
-//
-#define qtn_bt_not_incall "Not possible during a call"
-
-// d: Information note if there is maximum number of connections and new one can not be created.
-// l: popup_note_window
-//
-#define qtn_bt_busy "Maximum amount of Bluetooth connections in use. Can't establish a new one."
-
-// d: An information note when Bluetooth needs to be activated and it's disallowed in off-line mode.
-// l: popup_note_window
-//
-#define qtn_bt_offline_disabled "Bluetooth can't activated in off-line mode"
-
-// d: Information note telling there's already an active BTAA connection.
-// d: %U contains device name.
-// l: popup_note_window
-//
-#define qtn_bt_disconnect_first_stereo "Disconnect %0U device and %1U device first"
-
-// *** GLOBAL NOTES ***
-
-// d: Global Information note telling audio is routed to BT handsfree.
-// l: popup_note_window
-//
-#define qtn_bt_audio_accessory "Audio routed to BT handsfree"
-
-// d: Global Information note for successful connection establishment.
-// d: %U contains device name.
-// l: popup_note_window
-//
-#define qtn_bt_conf_connected "Connected to %U"
-
-// d: Global Information note for successful connection close.
-// d: %U contains device name.
-// l: popup_note_window
-//
-#define qtn_bt_conf_disconnected "Disconnected from %U"
-
-// d: Global Information note for unsuccessful connection establishment.
-// d: Reason: The audio device does not support Hands-Free Profile.
-// d: %U contains device name.
-// l: popup_note_window
-//
-#define qtn_bt_hfp_not_supported "Hands-Free Profile not supported by %U"
-
-// d: Global Information note for unsuccessful connection establishment.
-// d: Reason: The audio device does not support Bluetooth Hands-Free nor Headset Profile.
-// d: %U contains device name.
-// l: popup_note_window
-//
-#define qtn_bt_device_not_supported "Unsupported device: %U"
-
-
-// VISIBILITY MODE OPTION
-
-//d:The setting item value of visibility mode (option item in radio box)
-//l:list_set_graphic_pane_t1
-//w:
-//r:3.1
-//
-#define qtn_bt_set_visibility_time "Set visibility time"
-
-//d:The setting item value of visibility mode (shows in listbox after visibility timeout set)
-//l:list_set_graphic_pane_t1
-//w:
-//r:3.1
-//
-#define qtn_bt_temp_visible "Temporarily visible"
-
-
-// VISIBLILITY TIME SETTING SLIDER
-
-//d:Text in slider control head label
-//d:visibility time-out setting page
-//l:list_setting_pane_t1
-//w:
-//r:3.1
-//
-#define qtn_bt_slider_visibility_time "Visibility time"
-
-//d:Text in slider control slider's current value label
-//d:visibility time-out setting page
-//d:Current value when it's 1 minute
-//l:list_set_graphic_pane_t1
-
-//w:
-//r:3.1
-//
-#define qtn_bt_slider_singular "%U minute"
-
-//d:Text in slider control slider's current value label
-//d:visibility time-out setting page
-//d:Current value when it's > 1 minute 
-//l:list_set_graphic_pane_t1
-//w:
-//r:3.1
-//
-#define qtn_bt_slider_plural "%U minutes"
-
-//d:Text in slider control
-//d:visibility time-out setting page
-//d:Minimum value
-//l:setting_slider_pane_t2
-
-//w:
-//r:3.1
-//
-#define qtn_bt_slider_min "1 min"
-
-//d:Text in slider control
-//d:visibility time-out setting page
-//d:Maximum value
-//l:setting_slider_pane_t2
-
-//w:
-//r:3.1
-//
-#define qtn_bt_slider_max "60 min"
-
-//Blocked device view
-
-// d: Command in options list
-// l: list_single_pane_t1_cp2
-// w:
-// r: 3.2
-#define qtn_bt_block "Block"
-
-// d: Status pane title for blocked devices view
-// l:  title_pane_t2/opt9
-
-// w: 
-// r: 3.2
-#define qtn_bt_title_blocked_devices "Blocked devices" 
-
-// d: query header of the message queries about blocked devices
-// l: heading_pane_t1
-// w: 
-// r: 3.2
-#define qtn_bt_block_device_header "Block device?"
-
-// d: text of dialog asking about blocking a paired devices.
-// l: popup_info_list_pane_t1
-// w: 
-// r:3.2
-#define qtn_bt_block_paired_device "Do you want to block all future connection attempts from paired device ?U? \nThis will delete your pairing with the device."
-
-
-// d: text of dialog asking about blocking a paired devices.
-// l: popup_info_list_pane_t1
-// w: 
-// r:3.2
-#define qtn_bt_block_connected_paired_devices "Do you want to block all future connection attempts from paired device ?U?\n This will disconnect the device and delete your pairing with it."
-
-// d: the link key to help in blocking queries.
-// l: popup_info_list_pane_t1
-// w:
-// r: 3.2
-#define qtn_bt_block_device_link "More Info"
-
-// d: the query text about deleting one blocking.
-// l: popup_note_window
-// w:
-// r: 3.2
-#define qtn_bt_warn_erase_blocked "Delete blocked device\n%U?"
-
-// d: the query text about deleting all blockings
-// l: popup_note_window
-// w:
-// r: 3.2
-#define qtn_bt_warn_erase_all_blocked "Delete all blocked devices?"
-
-// d: Empty list text when there are no blocked devices
-// l: main_list_empty_pane
-// w:
-// r: 3.2
-#define qtn_bt_no_blocked_devices "(no blocked devices)"
-
-// d: Empty list primary text when there are no blocked devices
-// l: main_pane_empty_t1/opt2
-// w:
-// r: 3.2
-#define qtn_bt_empty_blocked_view_primary_text "(no blocked devices)"
-
-// d: Empty list secondary text when there are no blocked devices
-// l: main_list_empty_pane/opt2
-// w:
-// r: 3.2
-#define qtn_bt_empty_blocked_view_sedondary_text "Block devices only if you wish to ever receive connections from them."
-
-// *** For General Setting Application ***
-
-// *** Caption for General Setting Application ***
-// d: BTUI Setting caption 
-// l: list_double_large_graphic_pane_t1
-// w:
-// r: 3.1
-#define qtn_set_folder_bluetooth "Bluetooth"
-
-// d: Secondary status information of BT power, discoverability and connection
-// l: list_double_large_graphic_pane_t2
-// w:
-// r:5.0
-#define qtn_cp_detail_bt_off "Switched off"
-
-// d: Secondary status information 
-// l: list_double_large_graphic_pane_t2
-// w:
-// r:5.0
-#define qtn_cp_detail_bt_on_shown "Enabled, shown to all"
-
-// d: Secondary status information 
-// l: list_double_large_graphic_pane_t2
-// w:
-// r:5.0
-#define qtn_cp_detail_bt_on_hidden "Enabled, hidden"
-
-// d: Secondary status information 
-// l: list_double_large_graphic_pane_t2
-// w:
-// r:5.0
-#define qtn_cp_detail_bt_conn_shown "Connected, shown to all"
-
-// d: Secondary status information 
-// l: list_double_large_graphic_pane_t2
-// w:
-// r:5.0
-#define qtn_cp_detail_bt_conn_hidden "Connected, hidden"
-
-// *** Error code handling for SSP PasskeyEntry mode ***
-// d: Warning Note if the passcode entered on the remote device doesn't match the one given on the local device (Passkey Entry mode).
-// l: popup_note_window
-// r: 5.1
-#define qtn_bt_simple_incorrect_passcode "Incorrect passcode"
-
-// d: Query gives the user an option to enter a passcode again (Passkey Entry mode).
-// l: popup_note_window
-// r: 5.1
-#define qtn_bt_simple_passcode_retry "Try again?"
-
-// End of File
--- a/bluetoothengine/btui/rom/BtuiResources.iby	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef __BTUIRESOURCES_IBY__
-#define __BTUIRESOURCES_IBY__
-
-#ifdef __BT
-//Resource file(s) for BTUI application (BtUi.iby)
-data=DATAZ_\APP_RESOURCE_DIR\BTUI.RSC                         APP_RESOURCE_DIR\Btui.rsc
-
-//View resource in Ecom plutin
-data=DATAZ_\RESOURCE_FILES_DIR\BtuiViewResources.rsc	RESOURCE_FILES_DIR\BtuiViewResources.rsc
-
-#endif //__BT
-#endif //__BTUIRESOURCES_IBY__
--- a/bluetoothengine/btui/rom/btui.iby	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/btui/rom/btui.iby	Fri May 14 16:01:46 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -11,26 +11,23 @@
 *
 * Contributors:
 *
-* Description:
+* Description: 
 *
 */
-#ifndef __BTUI_IBY__
-#define __BTUI_IBY__
+#ifndef __BTCPPLUGIN_IBY__
+#define __BTCPPLUGIN_IBY__
 
+#include <data_caging_paths_for_iby.hrh>
+#include <bldvariant.hrh>
 #ifdef __BT
 
-// BTUI Application(EXE)
-//S60_APP_EXE(BtUi)
-//SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,BtUi)
-//S60_APP_AIF_ICONS(BtUi)
-//S60_APP_AIF_RSC(BtUi)
+file=ABI_DIR/BUILD_DIR/btuimodel.dll SHARED_LIB_DIR/btuimodel.dll
+file=ABI_DIR/BUILD_DIR/btuidelegate.dll SHARED_LIB_DIR/btuidelegate.dll
 
-// BTUI Model(DLL)
-//file=ABI_DIR\BUILD_DIR\btdevmodel.dll          SHARED_LIB_DIR\btdevmodel.dll
-
-//ECOM plugin(Ecom DLL)
-// CP plugin API removed. Do not export ECOM_PLUGIN( BtuiPlugin.dll, BtuiPlugin.rsc )
+file=ABI_DIR/BUILD_DIR/btcpplugin.dll SHARED_LIB_DIR/btcpplugin.dll
+data=/epoc32/data/c/resource/qt/plugins/controlpanel/btcpplugin.qtplugin resource/qt/plugins/controlpanel/btcpplugin.qtplugin
 
 #endif //__BT
 
-#endif //__BTUI_IBY__
+#endif  // __BTCPPLUGIN_IBY__
+
--- a/bluetoothengine/btui/src/BTUIApp.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
-* 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 the implementation of application class.
- *
-*/
-
-
-// INCLUDE FILES
-
-#include "btui.h"       // Global declarations
-#include "BTUIApp.h"
-#include "BTUIDocument.h"
-
-// ---------------------------------------------------------
-// CBTUIApp::AppDllUid()
-// Returns application UID
-// ---------------------------------------------------------
-//
-TUid CBTUIApp::AppDllUid() const
-    {
-    return KBtuiUid3;
-    }
-
-// ---------------------------------------------------------
-// CBTUIApp::CreateDocumentL()
-// Creates CBTUIDocument object
-// ---------------------------------------------------------
-//
-CApaDocument* CBTUIApp::CreateDocumentL()
-    {
-    return CBTUIDocument::NewL( *this );
-    }
-
-#include <eikstart.h>
-
-// ---------------------------------------------------------
-// NewApplication()
-// ---------------------------------------------------------
-LOCAL_C CApaApplication* NewApplication()
-    {
-    return new CBTUIApp;
-    }
-// ---------------------------------------------------------
-// E32Main()
-// ---------------------------------------------------------
-GLDEF_C TInt E32Main()
-    {
-    return EikStart::RunApplication(NewApplication);
-    }    
-
-  
-
-
--- a/bluetoothengine/btui/src/BTUIAppUi.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,214 +0,0 @@
-/*
-* 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 class the care of opening and closing the views.
- *
-*/
-
-
-// INCLUDE FILES
-#include "BTUIDocument.h"
-#include <aknview.h>
-#include "BTUIAppUi.h"
-#include <avkon.hrh>
-#include <aknappui.h>
-#include "BtuiPluginInterface.h"
-#include "btui.h"
-#include "BTUIMainView.h"
-#include "debug.h"
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------------
-// CBTUIAppUi::ConstructL
-//
-// Symbian 2nd phase constructor can leave. 
-// Contains status pane, navi pane, tab group and view 
-// creations and setting the main view active.
-// ----------------------------------------------------------
-//
-void CBTUIAppUi::ConstructL()
-    {
-    TRACE_FUNC_ENTRY
-
-    BaseConstructL( EAknEnableSkin | EAknEnableMSK | EAknSingleClickCompatible);
-
-    // Show tabs for main views from resources
-    CEikStatusPane* sp = StatusPane();
-
-    // Fetch pointer to the default navi pane control
-    iNaviPane = (CAknNavigationControlContainer*)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
-
-    // Tabgroup has been read from resource and it were pushed to the navi pane.
-    // Get pointer to the navigation decorator and set this to be a MAknTabObserver    
-    iDecoratedTabGroup = iNaviPane->ResourceDecorator();
-
-    if (iDecoratedTabGroup)
-        {
-        iTabGroup = (CAknTabGroup*) iDecoratedTabGroup->DecoratedControl();
-        iTabGroup->SetObserver( this );
-        }    
-        
-    // -----------------------------------------------------------------------    
-    // Construct Views by calling ECOM interface CBtuiPluginInterface's 
-    // factory function NewL(), which in turn will call instantiation funtion
-    // of the concrate class that implement this interface.
-    // -----------------------------------------------------------------------
-        
-	// 1.Construct Mainview 
-	// 
-    CBtuiPluginInterface* mainView = CBtuiPluginInterface::NewL(KBtuiPluginUidMainView,(MBtuiPluginViewActivationObserver*) this );
-   		
-    CleanupStack::PushL( mainView );
-    AddViewL( mainView ); // Transfer ownership to CAknViewAppUi
-    CleanupStack::Pop(mainView );    
-
-	// 2.Construct OtherDeviceView
-	//
-    CBtuiPluginInterface* otherDeviceView = CBtuiPluginInterface::NewL(
-    	KBtuiPluginUidPairedDevicesView, (MBtuiPluginViewActivationObserver*) this );	
-
-    CleanupStack::PushL( otherDeviceView );
-    AddViewL( otherDeviceView ); // Transfer ownership to CAknViewAppUi
-    CleanupStack::Pop(otherDeviceView );
-
-	// 3.Construct BlockDeviceView
-	//
-    CBtuiPluginInterface* blockDeviceView = CBtuiPluginInterface::NewL(
-    	KBtuiPluginUidBlockedDevicesView , (MBtuiPluginViewActivationObserver*) this );	
-
-    CleanupStack::PushL( blockDeviceView );
-    AddViewL( blockDeviceView ); // Transfer ownership to CAknViewAppUi
-    CleanupStack::Pop(blockDeviceView );
-
-    //ActivateLocalViewL( mainView->Id() ); 
-    TRACE_FUNC_EXIT
-    }
-
-// ----------------------------------------------------
-// CBTUIAppUi::~CBTUIAppUi
-// ----------------------------------------------------
-//
-CBTUIAppUi::~CBTUIAppUi() 
-    {
-    TRACE_FUNC_ENTRY
-    if(iNaviPane != NULL && iDecoratedTabGroup != NULL)
-    	{
-    
-  		delete iDecoratedTabGroup; // Tabgroup was read from resource.
-  		iDecoratedTabGroup=NULL;
-    	}
-  	
-	REComSession::FinalClose();
-  	
-    TRACE_FUNC_EXIT
-    }
-
-
-// ------------------------------------------------------------------------------
-// CBTUIAppUi::DynInitMenuPaneL
-//
-// This function is called by the UIKON framework just before it displays
-// a menu pane. Its default implementation is empty, and by overriding it,
-// the application can set the state of menu items dynamically according
-// to the state of application data.
-// ------------------------------------------------------------------------------
-//
-void CBTUIAppUi::DynInitMenuPaneL( TInt /* aResourceId */, CEikMenuPane* /* aMenuPane */ )
-    {
-    }
-
-// ----------------------------------------------------
-// CBTUIAppUi::HandleKeyEventL
-// ----------------------------------------------------
-//
-
-TKeyResponse CBTUIAppUi::HandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
-    {
-    TRACE_FUNC
-
-    iTabGroup = (CAknTabGroup*)iDecoratedTabGroup->DecoratedControl();
-    
-	//  Event will not be handled, if:
-	//  1.It is not a key event.  
-	//  2.No tab group be created yet.
-	//  3.Device's BT name hasn't been initialized by user yet.   
-	//
-    if (aType != EEventKey || !iTabGroup ) 
-        {
-        return EKeyWasNotConsumed;
-        }
-
-    return 	iTabGroup->OfferKeyEventL(aKeyEvent, aType);
-    }
-
-// ----------------------------------------------------
-//  CBTUIAppUi::HandleCommandL
-//
-// Handle user commands. All commands are handled via
-// this routine.
-// ----------------------------------------------------
-//
-void CBTUIAppUi::HandleCommandL(TInt aCommand)
-    {
-    TRACE_INFO((_L("command = %d"), aCommand ))
-
-    switch ( aCommand )
-        {
-        case EAknCmdExit:
-        case EEikCmdExit:
-            {
-            Exit();
-            break;
-            }
-        default:
-            {
-            break;
-            }
-        }
-    }
-// ----------------------------------------------------
-// CBTUIAppUi::PluginViewActivated
-// ----------------------------------------------------
-//   
-void CBTUIAppUi::PluginViewActivated(TPluginViewId aViewId)
-
-    {
-    TRACE_INFO((_L("view id = %d"), aViewId ))        
-    if(iTabGroup->ActiveTabId()!=aViewId)
-        {            
-            iTabGroup->SetActiveTabById(aViewId);
-        }
-    }
-
-// ----------------------------------------------------
-// CBTUIAppUi::TabChangedL
-// ----------------------------------------------------
-//
-void CBTUIAppUi::TabChangedL(TInt aIndex)
-    {
-    TRACE_FUNC
-    switch (aIndex)
-    	{
-    	case 0:
-		    ActivateLocalViewL(KBtuiPluginUidMainView);
-			break;
-    	case 1:
-		    ActivateLocalViewL(KBtuiPluginUidPairedDevicesView);    	
-			break;    	
-    	case 2:
-		    ActivateLocalViewL(KBtuiPluginUidBlockedDevicesView);    	
-			break;    	
-    	}
-    }
-    
--- a/bluetoothengine/btui/src/BTUIDocument.cpp	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
-* 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 the implementation of document class.
- *
-*/
-
- 
-// INCLUDE FILES
-
-#include "BTUIDocument.h"
-#include "debug.h"
-#include "BTUIAppUi.h"
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------
-// Destructor
-// ----------------------------------------------------
-//
-CBTUIDocument::~CBTUIDocument()
-    {
-    TRACE_FUNC
-  //  delete iModel;
-    }
-
-// ----------------------------------------------------
-// Symbian OS default constructor can leave.
-// ----------------------------------------------------
-//
-void CBTUIDocument::ConstructL()
-    {
-    TRACE_FUNC
-    }
-
-// ----------------------------------------------------
-// Two-phased constructor
-// ----------------------------------------------------
-//
-CBTUIDocument* CBTUIDocument::NewL( CAknApplication& aApp ) // CBTUIApp reference
-    {
-    CBTUIDocument* self = new (ELeave) CBTUIDocument( aApp );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self);
-
-    return self;
-    }
-
-// ----------------------------------------------------
-// CBTUIDocument::CreateAppUiL()
-// constructs CBTUIAppUi
-// ----------------------------------------------------
-//
-CEikAppUi* CBTUIDocument::CreateAppUiL()
-    {
-    return new (ELeave) CBTUIAppUi;
-    }
--- a/bluetoothengine/group/bld.inf	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/group/bld.inf	Fri May 14 16:01:46 2010 +0300
@@ -19,15 +19,18 @@
 PRJ_PLATFORMS
 DEFAULT
 
+// This is to break cyclic building dependency between these logical components.
+// A better source structure will be implemented in future.
 
+#include "../btnotif/btnotifclient/group/bld.inf"
 #include "../bteng/group/bld.inf"
+#include "../btserviceutil/group/bld.inf"
 #include "../btnotif/group/bld.inf"
 #include "../btaudioman/group/bld.inf"
 #include "../btmac/group/bld.inf"
 #include "../btsac/group/bld.inf"
 #include "../btaudiostreamer/group/bld.inf"
 #include "../btsap/group/bld.inf"
-#include "../btui/group/bld.inf"
 #include "../btpbap/group/bld.inf"
 #include "../bthid/group/bld.inf"
 #include "../btctrldcmoadapter/group/bld.inf"
--- a/btservices_plat/bluetooth_engine_connection_management_api/inc/btengconnman.h	Mon May 03 12:40:50 2010 +0300
+++ b/btservices_plat/bluetooth_engine_connection_management_api/inc/btengconnman.h	Fri May 14 16:01:46 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -23,6 +23,7 @@
 #include <btengconstants.h>
 
 class CBTEngConnHandler;
+class CBTEngPairingHandler;
 
 /**
  *  Class MBTEngConnObserver
@@ -449,10 +450,10 @@
     CBTEngConnHandler* iConnHandler;
 
     /**
-     * This field is NOT used. Reserved for future extension.
+     * For handling pairing requests
      * Own.
      */
-    TAny* iReserved;
+    CBTEngPairingHandler* iPairingHandler;
 
     /**
      * Reference to receiver of connection events.
--- a/btservices_plat/bluetooth_secondary_display_notification_api/group/bld.inf	Mon May 03 12:40:50 2010 +0300
+++ b/btservices_plat/bluetooth_secondary_display_notification_api/group/bld.inf	Fri May 14 16:01:46 2010 +0300
@@ -24,5 +24,5 @@
 
 PRJ_EXPORTS
 
-../inc/secondarydisplay/BTnotifSecondaryDisplayAPI.h     MW_LAYER_PLATFORM_EXPORT_PATH(secondarydisplay/BTnotifSecondaryDisplayAPI.h)
-../inc/secondarydisplay/BtuiSecondaryDisplayAPI.h     MW_LAYER_PLATFORM_EXPORT_PATH(secondarydisplay/BtuiSecondaryDisplayAPI.h)
+../inc/secondarydisplay/BTnotifSecondaryDisplayAPI.h     MW_LAYER_PLATFORM_EXPORT_PATH(SecondaryDisplay/BTnotifSecondaryDisplayAPI.h)
+../inc/secondarydisplay/BtuiSecondaryDisplayAPI.h     MW_LAYER_PLATFORM_EXPORT_PATH(SecondaryDisplay/BtuiSecondaryDisplayAPI.h)
--- a/cbsatplugin/atmisccmdplugin/rom/atmisccmdplugin.iby	Mon May 03 12:40:50 2010 +0300
+++ b/cbsatplugin/atmisccmdplugin/rom/atmisccmdplugin.iby	Fri May 14 16:01:46 2010 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
  * All rights reserved.
  * This component and the accompanying materials are made available
  * under the terms of "Eclipse Public License v1.0"
@@ -17,7 +17,6 @@
 #define ATMISCCMDPLUGIN_IBY
 
 ECOM_PLUGIN(atmisccmdplugin.dll, atmisccmdplugin.rsc)
-S60_APP_RESOURCE(atmisccmdpluginresource)
 
 #endif // ATMISCCMDPLUGIN_IBY
 
--- a/layers.sysdef.xml	Mon May 03 12:40:50 2010 +0300
+++ b/layers.sysdef.xml	Fri May 14 16:01:46 2010 +0300
@@ -1,14 +1,20 @@
 <?xml version="1.0"?>
-<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [
+<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_5_1.dtd" [
   <!ENTITY layer_real_source_path "sf/mw/btservices" >
 ]>
 
-<SystemDefinition name="btservices" schema="1.4.0">
+<SystemDefinition name="btservices" schema="1.5.1">
   <systemModel>
     <layer name="mw_layer">
       <module name="btservices">
         <unit unitID="lcdo.btservices" mrp="" bldFile="&layer_real_source_path;/group" name="btservices" />
       </module>
+      <module name="btcpplugin">
+        <unit unitID="lcdo.btservices.btcpplugin" mrp="" bldFile="&layer_real_source_path;/bluetoothengine/btui" name="bluetooth_setting_plugin" proFile="btui.pro" qmakeArgs="" />
+      </module>
+      <module name="btdialog">
+        <unit unitID="lcdo.btservices.btdialog" mrp="" bldFile="&layer_real_source_path;/bluetoothengine/btnotif/btdevicedialogplugin" name="bluetooth_dialogs" proFile="btdevicedialogplugin.pro" qmakeArgs="" />
+      </module>
     </layer>
     <layer name="api_test_layer">
       <module name="btservices_test">
--- a/package_definition.xml	Mon May 03 12:40:50 2010 +0300
+++ b/package_definition.xml	Fri May 14 16:01:46 2010 +0300
@@ -5,7 +5,12 @@
       <component id="bteng" filter="s60" name="Bluetooth Engine">
         <unit bldFile="bluetoothengine/bteng/group"/>
       </component>
+      <component id="btserviceutil" filter="s60" name="Bluetooth Service Utility">
+        <unit bldFile="bluetoothengine/btserviceutil/group"/>
+      </component>
       <component id="btnotif" filter="s60" name="Bluetooth Notifier">
+      	<!-- client is separated for breaking cyclic compiling dependencies -->
+        <unit bldFile="bluetoothengine/btnotif/btnotifclient/group"/>
         <unit bldFile="bluetoothengine/btnotif/group"/>
           <!-- is this test needed as unit? -->
         <!-- <unit bldFile="bluetoothengine/btnotif/tsrc/btnotifapitest/group"/> -->
--- a/sysdef_1_4_0.dtd	Mon May 03 12:40:50 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
- <!ELEMENT SystemDefinition (systemModel?, build?)>
- <!ATTLIST SystemDefinition
-  name CDATA #REQUIRED
-  schema CDATA #REQUIRED>
- <!ELEMENT systemModel (layer+)>
- <!ELEMENT layer (logicalset* | module*)*>
- <!ATTLIST layer
-  name CDATA #REQUIRED
-  levels CDATA #IMPLIED
-  span CDATA #IMPLIED>
- <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
- <!ATTLIST logicalset name CDATA #REQUIRED>
- <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
- <!ATTLIST logicalsubset name CDATA #REQUIRED>
- <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
- <!ATTLIST module
-  name CDATA #REQUIRED
-  level CDATA #IMPLIED>
- <!ELEMENT component (unit* | package* | prebuilt*)*>
- <!ATTLIST component name CDATA #REQUIRED>
- <!ELEMENT unit EMPTY>
- <!ATTLIST unit
-  unitID ID #REQUIRED
-  name CDATA #REQUIRED
-  mrp CDATA #REQUIRED
-  filter CDATA #IMPLIED
-  bldFile CDATA #REQUIRED
-  priority CDATA #IMPLIED
-  contract CDATA #IMPLIED>
- <!ELEMENT package EMPTY>
- <!ATTLIST package
-  name CDATA #REQUIRED
-  mrp CDATA #REQUIRED
-  filter CDATA #IMPLIED
-  contract CDATA #IMPLIED>
- <!ELEMENT prebuilt EMPTY>
- <!ATTLIST prebuilt
-  name CDATA #REQUIRED
-  version CDATA #REQUIRED
-  late (Y|N) #IMPLIED
-  filter CDATA #IMPLIED
-  contract CDATA #IMPLIED>
- <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
- <!ELEMENT unitList (unitRef+)>
- <!ATTLIST unitList
-  name ID #REQUIRED
-  description CDATA #REQUIRED>
- <!ELEMENT unitRef EMPTY>
- <!ATTLIST unitRef unit IDREF #REQUIRED>
- <!ELEMENT targetList EMPTY>
- <!ATTLIST targetList
-  name ID #REQUIRED
-  description CDATA #REQUIRED
-  target IDREFS #REQUIRED>
- <!ELEMENT target EMPTY>
- <!ATTLIST target
-  name ID #REQUIRED
-  abldTarget CDATA #REQUIRED
-  description CDATA #REQUIRED>
- <!ELEMENT option EMPTY>
- <!ATTLIST option
-  name ID #REQUIRED
-  abldOption CDATA #REQUIRED
-  description CDATA #REQUIRED
-  enable (Y | N | y | n) #REQUIRED>
- <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
- <!ATTLIST configuration
-  name ID #REQUIRED
-  description CDATA #REQUIRED
-  filter CDATA #REQUIRED>
- <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
- <!ELEMENT unitListRef EMPTY>
- <!ATTLIST unitListRef unitList IDREF #REQUIRED>
- <!ELEMENT layerRef EMPTY>
- <!ATTLIST layerRef layerName CDATA #REQUIRED>
- <!ELEMENT buildLayer EMPTY>
- <!ATTLIST buildLayer
-  command CDATA #REQUIRED
-  targetList IDREFS #IMPLIED
-  unitParallel (Y | N | y | n) #REQUIRED
-  targetParallel (Y | N | y | n) #IMPLIED>
- <!ELEMENT specialInstructions EMPTY>
- <!ATTLIST specialInstructions
-  name CDATA #REQUIRED
-  cwd CDATA #REQUIRED
-  command CDATA #REQUIRED>  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysdef_1_5_1.dtd	Fri May 14 16:01:46 2010 +0300
@@ -0,0 +1,88 @@
+ <!ELEMENT SystemDefinition (systemModel?, build?)>
+ <!ATTLIST SystemDefinition
+  name CDATA #REQUIRED
+  schema CDATA #REQUIRED>
+ <!ELEMENT systemModel (layer+)>
+ <!ELEMENT layer (logicalset* | module*)*>
+ <!ATTLIST layer
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED
+  span CDATA #IMPLIED>
+ <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalset name CDATA #REQUIRED>
+ <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalsubset name CDATA #REQUIRED>
+ <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
+ <!ATTLIST module
+  name CDATA #REQUIRED
+  level CDATA #IMPLIED>
+ <!ELEMENT component (unit* | package* | prebuilt*)*>
+ <!ATTLIST component name CDATA #REQUIRED>
+ <!ELEMENT unit EMPTY>
+ <!ATTLIST unit
+  unitID ID #REQUIRED
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  bldFile CDATA #REQUIRED
+  priority CDATA #IMPLIED
+  contract CDATA #IMPLIED
+  proFile CDATA #IMPLIED
+  qmakeArgs CDATA #IMPLIED>
+ <!ELEMENT package EMPTY>
+ <!ATTLIST package
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT prebuilt EMPTY>
+ <!ATTLIST prebuilt
+  name CDATA #REQUIRED
+  version CDATA #REQUIRED
+  late (Y|N) #IMPLIED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
+ <!ELEMENT unitList (unitRef+)>
+ <!ATTLIST unitList
+  name ID #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT unitRef EMPTY>
+ <!ATTLIST unitRef unit IDREF #REQUIRED>
+ <!ELEMENT targetList EMPTY>
+ <!ATTLIST targetList
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  target IDREFS #REQUIRED>
+ <!ELEMENT target EMPTY>
+ <!ATTLIST target
+  name ID #REQUIRED
+  abldTarget CDATA #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT option EMPTY>
+ <!ATTLIST option
+  name ID #REQUIRED
+  abldOption CDATA #REQUIRED
+  description CDATA #REQUIRED
+  enable (Y | N | y | n) #REQUIRED>
+ <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
+ <!ATTLIST configuration
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  filter CDATA #REQUIRED>
+ <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
+ <!ELEMENT unitListRef EMPTY>
+ <!ATTLIST unitListRef unitList IDREF #REQUIRED>
+ <!ELEMENT layerRef EMPTY>
+ <!ATTLIST layerRef layerName CDATA #REQUIRED>
+ <!ELEMENT buildLayer EMPTY>
+ <!ATTLIST buildLayer
+  command CDATA #REQUIRED
+  targetList IDREFS #IMPLIED
+  unitParallel (Y | N | y | n) #REQUIRED
+  targetParallel (Y | N | y | n) #IMPLIED>
+ <!ELEMENT specialInstructions EMPTY>
+ <!ATTLIST specialInstructions
+  name CDATA #REQUIRED
+  cwd CDATA #REQUIRED
+  command CDATA #REQUIRED>